@font-face{font-family:Fraunces;src:url('/fonts/fraunces.woff2') format('woff2');font-weight:100 900;font-display:swap}
@font-face{font-family:'DM Sans';src:url('/fonts/dm-sans.woff2') format('woff2');font-weight:100 1000;font-display:swap}

:root {
  color-scheme: light;
  --canvas: #eef3ef;
  --paper: #fffefa;
  --ink: #262f27;
  --muted: #526054;
  --line: #dedfd2;
  --forest: #244a3c;
  --forest-deep: #19382c;
  --mint: #e8efde;
  --lime: #e2edb4;
  --cream: #f9f8ec;
  --rust: #965139;
  --peach: #f8e8dc;
  --serif: Fraunces, Georgia, serif;
  --sans: 'DM Sans', 'Segoe UI', sans-serif;
  font: 16px/1.5 var(--sans);
  background: var(--canvas);
  color: var(--ink);
  scrollbar-color: #9aa48e var(--canvas);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
[hidden], .symbol-library { display: none !important; }
::selection { background: #dbe8b1; color: #233a2c; }
:focus-visible { outline: 3px solid #bb7954; outline-offset: 4px; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .62; }
a { color: inherit; text-underline-offset: .25em; }
svg.icon { display: inline-block; width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
h1, h2, h3, p { margin: 0; }
h1, h2 { font-family: var(--serif); font-weight: 600; letter-spacing: -.028em; line-height: 1.1; text-wrap: balance; }
.wrap { width: min(1120px, 100% - 72px); margin-inline: auto; }

.masthead { border-bottom: 1px solid var(--line); background: var(--paper); }
.masthead-inner { min-height: 73px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font: 650 23px/1 var(--serif); letter-spacing: -.028em; }
.brand-icon { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 11px; background: var(--mint); color: var(--forest); }
.brand-icon .icon { width: 23px; height: 23px; }
.grade { white-space: nowrap; display: inline-flex; align-items: center; gap: 9px; color: var(--muted); font-size: .83rem; font-weight: 700; }
.grade-dot, .meta-dot { width: 6px; height: 6px; border-radius: 50%; background: #b46c4f; }
.grade-divider { height: 14px; width: 1px; background: var(--line); margin-inline: 2px; }
.intro { padding: 42px 0 29px; display: flex; align-items: end; justify-content: space-between; gap: 18px; }
.intro h1 { font-size: clamp(2.65rem, 5vw, 4.05rem); font-weight: 650; }
.intro p { margin-top: 8px; color: var(--muted); font-size: 1.06rem; }
.intro > button { margin-bottom: 3px; flex: none; }
.page-status { margin: -12px 0 18px; color: var(--rust); font-size: .91rem; }

.board { display: grid; grid-template-columns: minmax(0, 2.08fr) minmax(285px, 1fr); align-items: start; gap: 24px 26px; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; }
.passage { grid-column: 1; overflow: hidden; }
.passage-header { padding: 27px 31px 25px; }
.passage-header h2 { font-size: clamp(1.95rem, 4vw, 2.78rem); margin-top: 9px; text-wrap: wrap; }
.meta { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .84rem; font-weight: 680; }
.genre { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; background: var(--peach); color: #743f2b; }
.meta-dot { width: 4px; height: 4px; background: #899284; }
.mobile-jump { display: none; }
.passage-image { width: 100%; height: clamp(152px, 16.1vw, 225px); display: block; object-fit: cover; object-position: 50% 55%; background: #cdded4; }
.passage-text { padding: 24px 31px 29px; font: 1.225rem/1.65 var(--serif); font-weight: 370; }
.passage-text p + p { margin-top: 17px; }
.passage-text p:first-child::first-letter { color: var(--forest); font-weight: 700; }
.word-mark { color: #712c1b; border-radius: 3px; background: #f7ddcb; text-decoration: underline dotted #98503a; text-underline-offset: 3px; }

.sidebar { grid-column: 2; grid-row: 1; display: grid; gap: 17px; }
.coach { min-width: 0; border-radius: 16px; background: var(--forest); color: var(--cream); padding: 23px; }
.coach-header { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 18px; }
.coach-header h2 { font-size: 1.56rem; }
.coach-spark.icon { width: 23px; height: 23px; color: var(--lime); stroke-width: 1.35; }
.step, .question-entry { display: flex; gap: 12px; align-items: flex-start; }
.step + .step { margin-top: 19px; padding-top: 19px; border-top: 1px solid #577264; }
.step-icon { display: grid; place-items: center; flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; background: #3b6051; color: #f4f5dd; }
.step-icon .icon { width: 19px; height: 19px; }
.step-content { flex: 1; min-width: 0; }
.step-content h3 { font-weight: 760; font-size: 1rem; margin: 1px 0 3px; }
.step-content p { font-size: .91rem; line-height: 1.43; }
.step p { color: #e0e9d9; }
.step-content .button { margin-top: 12px; width: 100%; }
.coach-status { margin-top: 10px; }
.timer { color: var(--lime); display: inline-block; margin-top: 8px; font-weight: 750; font-variant-numeric: tabular-nums; }
.coach-link { color: #f1f3d9; margin-top: 8px; }

.question-entry { padding: 20px 21px 21px; }
.question-icon { background: var(--peach); color: var(--rust); }
.question-entry h2 { font-size: 1.25rem; margin: 2px 0 6px; }
.question-entry p { color: var(--muted); }
.question-start { justify-content: space-between !important; text-align: left; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 44px; padding: 9px 15px; border: 1px solid transparent; border-radius: 10px; font-size: .9rem; font-weight: 750; line-height: 1.24; transition: background .16s ease, color .16s ease, border-color .16s ease; }
.outline { background: var(--paper); color: var(--forest-deep); border-color: #d2d8c9; }
.outline:hover:not(:disabled) { background: var(--mint); border-color: #b9c5b4; }
.listen { color: var(--forest-deep); background: var(--lime); }
.listen:hover:not(:disabled) { background: #f0f6d1; }
.record { color: var(--cream); border-color: #a0b7a9; background: #305444; }
.record:hover:not(:disabled) { background: #3d6655; }
.record.is-recording { background: #884332; border-color: #e3a98e; }
.primary { color: #fffef5; background: var(--forest); }
.primary:hover:not(:disabled) { background: var(--forest-deep); }
.text-button { border: 0; background: none; padding: 5px 0; font-size: .875rem; font-weight: 720; text-decoration: underline; text-underline-offset: 3px; }
.text-button:hover { text-decoration-thickness: 2px; }
.icon-button { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border: 1px solid var(--line); background: var(--paper); color: var(--forest); border-radius: 9px; }
.icon-button:hover { background: var(--mint); }

.questions, .results { grid-column: 1; padding: 26px 31px 29px; scroll-margin-top: 16px; }
.questions h2, .results h2, dialog h2 { font-size: clamp(1.55rem, 3vw, 2.125rem); }
.results > p { color: var(--muted); margin-top: 8px; }
.reading-edits { list-style: none; padding: 0; margin: 15px 0; }
.reading-edits li { display: flex; justify-content: space-between; align-items: start; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.reading-edits li:first-child { border-top: 0; }
.edit-line { font-size: .96rem; overflow-wrap: anywhere; }
.edit-context { font-size: .87rem; color: var(--muted); }
.reading-edits .button { flex: none; }
.transcript { font-size: .92rem; color: var(--muted); }
.transcript summary { cursor: pointer; color: var(--forest); font-weight: 720; }
.transcript p { margin: 6px 0 0; overflow-wrap: anywhere; }
.question-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; margin-bottom: 9px; color: var(--muted); font-size: .85rem; font-weight: 700; }
.question-meta a { color: var(--forest); }
.choices { border: 0; margin: 17px 0 0; padding: 0; display: grid; gap: 9px; min-width: 0; }
.choices legend { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; white-space: nowrap; }
.choice { display: flex; align-items: center; gap: 12px; padding: 11px 13px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.choice:hover, .choice:has(:checked) { background: var(--mint); border-color: #97a98e; }
.choice:has(:focus-visible) { outline: 3px solid #bb7954; outline-offset: 2px; }
.choice input { width: 16px; height: 16px; accent-color: var(--forest); flex: none; }
.choice input:focus-visible { outline: none; }
.choice-letter { font-weight: 760; color: var(--forest); }
.question-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 17px; }
.answer-status { margin-top: 9px; color: var(--muted); font-size: .91rem; overflow-wrap: anywhere; }
.answer-result { margin-top: 17px; padding: 15px 18px; background: var(--mint); border-radius: 10px; }
.answer-result.try-again { background: var(--peach); }
.answer-result h3 { font-size: 1rem; }
.answer-result p { margin-top: 5px; }
.answer-result blockquote { margin: 12px 0 0; color: var(--muted); font: 1.05rem/1.4 var(--serif); }
.mobile-stop { display: none; }
.summary-list { padding-left: 22px; }
.summary-list li + li { margin-top: 10px; }

.footer { margin-top: 25px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding: 13px 0 22px; font-size: .83rem; color: var(--muted); }
.family-link { color: var(--forest); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; text-decoration: none; }
.family-link:hover { text-decoration: underline; }
.family-link .icon { width: 15px; height: 15px; }
dialog { width: min(470px, 100% - 28px); padding: 23px; color: var(--ink); border: 1px solid var(--line); border-radius: 16px; background: var(--paper); }
dialog::backdrop { background: #17291fb0; }
.dialog-header { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 9px; }
dialog p { margin-top: 8px; color: var(--muted); font-size: .95rem; }
.family-state { font-weight: 700; }
dialog form { display: grid; gap: 8px; margin-top: 12px; }
dialog label { font-size: .86rem; font-weight: 720; }
dialog input { min-width: 0; height: 43px; background: var(--paper); color: var(--ink); border: 1px solid #a3af9c; border-radius: 9px; padding: 0 10px; caret-color: var(--forest); }
dialog form button { margin-top: 3px; }

@media (max-width: 850px) {
  .wrap { width: min(100% - 44px, 720px); }
  .board { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .sidebar { grid-column: 1; grid-row: auto; grid-template-columns: minmax(0, 1fr) minmax(215px, .8fr); align-items: start; }
  .passage-image { height: clamp(145px, 25vw, 215px); }
  .mobile-jump { display: inline-flex; align-items: center; gap: 6px; color: var(--forest); margin-top: 9px; font-size: .85rem; font-weight: 720; }
  .mobile-jump .icon { width: 14px; height: 14px; transform: rotate(90deg); }
  .coach { scroll-margin-top: 12px; }
  .mobile-stop { position: fixed; z-index: 2; inset: auto 16px max(16px, env(safe-area-inset-bottom)) auto; display: inline-flex; background: #884332; box-shadow: 0 3px 16px #40190935; }
}

@media (max-width: 580px) {
  .wrap { width: calc(100% - 32px); }
  .masthead-inner { min-height: 60px; }
  .brand { font-size: 20px; gap: 8px; }
  .brand-icon { width: 32px; height: 32px; border-radius: 9px; }
  .brand-icon .icon { width: 19px; height: 19px; }
  .grade { font-size: .72rem; gap: 5px; }
  .grade-divider { margin: 0; }
  .intro { padding: 27px 0 17px; flex-wrap: wrap; align-items: flex-start; gap: 12px; }
  .intro h1 { font-size: 2.85rem; }
  .intro p { margin-top: 5px; font-size: .94rem; }
  .intro > button { margin: 0; }
  .page-status { margin-top: -5px; }
  .sidebar { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .passage-header { padding: 19px 18px 17px; }
  .passage-header h2 { font-size: 1.95rem; }
  .passage-text, .questions, .results { padding: 18px 18px 21px; }
  .passage-text { font-size: 1.105rem; }
  .coach, .question-entry { padding: 18px; }
  .footer { margin-top: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
