:root {
  --ink: #082938;
  --muted: #607078;
  --paper: #f5f2ea;
  --surface: #fffefa;
  --line: #d9ddd7;
  --green: #176b5b;
  --green-dark: #0d5145;
  --coral: #f0624d;
  --success: #e4f3eb;
  --error: #fff0ec;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { min-width: 320px; margin: 0; background: var(--paper); }
button, input, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.site-header {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px clamp(20px, 5vw, 68px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 254, 250, .96);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: var(--green); color: white; font: 700 19px Georgia, serif; }
.brand strong { font: 600 19px Georgia, serif; }
.environment-badge { padding: 7px 10px; border-radius: 999px; background: #e8efeb; color: var(--green-dark); font-size: 11px; font-weight: 800; }

main { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.access-shell { max-width: 650px; margin: clamp(54px, 9vw, 110px) auto; text-align: center; }
.eyebrow { color: var(--coral); font-size: 11px; font-weight: 850; letter-spacing: 1.4px; text-transform: uppercase; }
h1 { margin: 10px 0 12px; font: 500 clamp(36px, 6vw, 58px)/1.08 Georgia, "Times New Roman", serif; }
.access-shell > p, .unit-header p { color: var(--muted); line-height: 1.65; }
.access-card { display: grid; gap: 9px; margin-top: 34px; padding: clamp(24px, 5vw, 42px); border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 22px 60px rgba(30, 48, 43, .08); text-align: left; }
label { margin-top: 7px; font-size: 12px; font-weight: 800; }
label span { color: var(--muted); font-weight: 500; }
input, select { width: 100%; min-height: 48px; padding: 11px 13px; border: 1px solid #cbd3cd; border-radius: 9px; background: white; color: var(--ink); }
input:focus, select:focus, button:focus-visible { outline: 3px solid rgba(23, 107, 91, .2); outline-offset: 2px; }
.access-card > button, .primary-button { min-height: 49px; margin-top: 15px; padding: 12px 18px; border: 0; border-radius: 9px; background: var(--green); color: white; font-weight: 850; }
.access-card > button { display: flex; justify-content: space-between; align-items: center; }
button:disabled { cursor: not-allowed; opacity: .55; }
.form-message { min-height: 20px; margin: 3px 0 0; color: #9a3f31; font-size: 12px; line-height: 1.5; }

.study-shell { padding: 46px 0 80px; }
.unit-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 30px; }
.unit-header h1 { max-width: 760px; font-size: clamp(32px, 5vw, 48px); }
.unit-header p { max-width: 760px; }
.text-button { padding: 8px 0; border: 0; background: transparent; color: var(--green); font-size: 11px; font-weight: 800; }
.study-navigation { display: flex; gap: 8px; margin: 30px 0 12px; padding-bottom: 12px; overflow-x: auto; }
.study-navigation button { flex: 0 0 auto; padding: 10px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 11px; font-weight: 800; }
.study-navigation button.active { border-color: var(--green); background: var(--green); color: white; }
.study-navigation button:disabled { opacity: .42; }
.study-progress { min-height: 28px; padding: 7px 2px; color: var(--muted); font-size: 11px; }
.study-content { min-height: 420px; padding: clamp(20px, 4vw, 42px); border: 1px solid var(--line); border-radius: 17px; background: var(--surface); box-shadow: 0 16px 45px rgba(30, 48, 43, .06); }
.section-heading { margin-bottom: 28px; }
.section-heading h2 { margin: 6px 0; font: 500 clamp(25px, 4vw, 36px) Georgia, serif; }
.section-heading p { margin: 0; color: var(--muted); line-height: 1.55; }
.empty-state { padding: 55px 20px; color: var(--muted); text-align: center; }

.source-list, .board-list { display: grid; gap: 22px; }
.source-card { padding: clamp(20px, 4vw, 34px); border: 1px solid #d7d4c9; background: #fffef9; }
.source-card header { padding-bottom: 16px; border-bottom: 2px solid #293b3a; }
.source-card h3 { margin: 5px 0; font: 600 21px Georgia, serif; }
.source-card small, .source-card cite { color: var(--muted); font-size: 11px; font-style: normal; }
.source-card blockquote { margin: 24px 0 15px; white-space: pre-line; font: 400 17px/1.72 Georgia, serif; }
.source-card .explanation { padding: 15px 17px; border-left: 3px solid var(--green); background: #f0f6f3; line-height: 1.6; }

.board-card { overflow-x: auto; padding: clamp(20px, 4vw, 34px); border: 1px solid #dce2dd; border-radius: 12px; background: #f4f7f4; }
.board-card > h3 { margin: 0 0 6px; font: 600 24px Georgia, serif; text-align: center; }
.board-card > p { color: var(--muted); text-align: center; }
.board-root { width: min(520px, 88%); margin: 24px auto 28px; padding: 16px 22px; border-radius: 999px; background: var(--green); color: white; font: 600 18px Georgia, serif; text-align: center; }
.board-level { min-width: 560px; display: grid; grid-template-columns: repeat(var(--columns), minmax(145px, 1fr)); gap: 13px; margin-top: 28px; position: relative; }
.board-level::before { content: ""; position: absolute; top: -15px; left: 7%; right: 7%; border-top: 1px solid #9aada6; }
.board-branch { min-height: 82px; display: grid; align-content: center; gap: 5px; padding: 14px; border: 1px solid var(--branch-color, var(--green)); background: white; text-align: center; }
.board-branch.capsule { border-radius: 999px; }
.board-branch.rounded { border-radius: 15px; }
.board-branch.rectangle { border-radius: 3px; }
.board-branch.hexagon { clip-path: polygon(10% 0, 90% 0, 100% 50%, 90% 100%, 10% 100%, 0 50%); }
.board-branch strong { font-size: 12px; line-height: 1.4; }
.board-branch small { color: var(--muted); font-size: 10px; line-height: 1.4; }
.board-note { margin-top: 26px; padding: 16px 18px; border: 1px solid #d9bf77; background: #fff7dc; font-size: 13px; line-height: 1.65; }
.board-note b { display: block; margin-bottom: 4px; color: #745b1f; font-size: 10px; letter-spacing: .7px; }

.question-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 20px; }
.question-meta span { padding: 6px 9px; border-radius: 999px; background: #edf1ee; color: #52635d; font-size: 10px; font-weight: 800; }
.question-card h2 { margin: 0 0 24px; font: 500 clamp(23px, 4vw, 33px)/1.35 Georgia, serif; }
.alternatives { display: grid; gap: 10px; }
.alternative { width: 100%; display: grid; grid-template-columns: 36px 1fr; gap: 12px; align-items: center; padding: 13px; border: 1px solid #d4d9d4; border-radius: 10px; background: white; color: var(--ink); text-align: left; }
.alternative > b { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; background: #eff0eb; }
.alternative.selected { border-color: var(--green); box-shadow: 0 0 0 2px rgba(23, 107, 91, .12); }
.alternative.correct { border-color: #5c9d83; background: var(--success); }
.alternative.wrong { border-color: #d77d6c; background: var(--error); }
.answer-area { display: grid; gap: 14px; margin-top: 22px; }
.answer-area .primary-button { justify-self: end; min-width: 170px; }
.typing-input { font-size: 16px; }
.feedback { margin-top: 25px; padding: 18px 20px; border-left: 4px solid var(--green); background: var(--success); line-height: 1.6; }
.feedback.error { border-color: var(--coral); background: var(--error); }
.feedback h3 { margin: 0 0 7px; font: 600 19px Georgia, serif; }
.feedback p { margin: 6px 0; }
.question-footer { display: flex; justify-content: space-between; gap: 12px; margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); }
.question-footer button { padding: 10px 13px; border: 1px solid #bccbc5; border-radius: 8px; background: white; color: var(--green-dark); font-size: 11px; font-weight: 800; }
.correlation-categories { display: grid; gap: 8px; margin: 0 0 20px; padding: 0; list-style: none; }
.correlation-categories li { display: grid; grid-template-columns: 31px 1fr; gap: 10px; align-items: center; padding: 9px; border: 1px solid var(--line); border-radius: 8px; }
.correlation-categories b { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 6px; background: var(--green); color: white; }
.correlation-items { display: grid; gap: 10px; }
.correlation-row { display: grid; grid-template-columns: 72px 1fr; gap: 12px; align-items: center; padding: 11px; border: 1px solid var(--line); border-radius: 8px; }
.correlation-row.correct { background: var(--success); }
.correlation-row.wrong { background: var(--error); }
.correlation-row small { display: block; margin-top: 4px; color: var(--muted); }
.assertions { display: grid; gap: 13px; margin: 0 0 20px; padding: 20px; border-left: 3px solid var(--green); background: #f6f7f3; list-style: none; }
.assertions li { display: grid; grid-template-columns: 34px 1fr; gap: 8px; font: 16px/1.5 Georgia, serif; }

footer { padding: 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; text-align: center; }
@media (max-width: 620px) {
  .site-header { align-items: flex-start; }
  .environment-badge { font-size: 9px; }
  .unit-header { flex-direction: column; gap: 8px; }
  .study-content { padding: 20px 15px; }
  .question-footer { align-items: stretch; flex-direction: column; }
  .correlation-row { grid-template-columns: 58px 1fr; }
}
