/* ---------- Tokens (matched to Bluebook) ---------- */
:root {
  --bar: #d5e2f7;
  --ink: #1b1b1b;
  --blue: #324dc7;
  --blue-dark: #2640ad;
  --gray-bar: #f1f1f3;
  --line: #2a2a2a;
  --divider: #6b6b6b;
  --ui: "Roboto", "Segoe UI", Arial, sans-serif;
  --serif: "Noto Serif", "Georgia", serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { font-family: var(--ui); color: var(--ink); background: #fff; -webkit-font-smoothing: antialiased; }
/* everything is selectable, including options */
body, #app, #app * { user-select: text; -webkit-user-select: text; }
button { font-family: inherit; }
button, .btn { cursor: pointer; }
::selection { background: #b9d2ff; }

/* ---------- Dashed Bluebook rules ---------- */
.dash-b::after, .dash-t::before { content: ""; position: absolute; left: 0; right: 0; height: 2px; background-image: repeating-linear-gradient(90deg, #111 0 9px, transparent 9px 12px); }
.dash-b::after { bottom: 0; } .dash-t::before { top: 0; }

/* ---------- Exam shell ---------- */
.exam { height: 100vh; height: 100dvh; display: flex; flex-direction: column; background: #fff; overflow: hidden; }
.hdr { background: var(--bar); min-height: 80px; flex: none; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: start; column-gap: 16px; padding: 10px 40px; position: relative; }
.hdr .l, .hdr .r { min-width: 0; }
.hdr .l .title { font-size: 18px; font-weight: 500; letter-spacing: .1px; margin-top: 2px; }
.hdr .l .dir { font-size: 14px; margin-top: 12px; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; background: none; border: 0; padding: 0; color: var(--ink); position: relative; }
.hdr .c { text-align: center; padding-top: 2px; }
.hdr .timer { font-size: 20px; font-weight: 700; letter-spacing: .5px; line-height: 28px; }
.hdr .hide { margin-top: 6px; font-size: 12px; font-weight: 500; border: 1px solid #111; background: transparent; border-radius: 12px; padding: 1px 22px; height: 20px; line-height: 16px; }
.hdr .r { display: flex; justify-content: flex-end; gap: 26px; align-items: flex-start; padding-top: 6px; }
.tool { background: none; border: 0; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; color: var(--ink); min-width: 48px; }
.tool svg { height: 22px; width: auto; }
.tool.on svg { color: var(--blue); }
.tool.on { color: var(--blue); }

.main { flex: 1; min-height: 0; display: flex; position: relative; }
.preview-banner { flex: none; height: 34px; margin: 0 2%; display: flex; align-items: center; justify-content: center; border-radius: 0 0 18px 18px; background: #0c1b71; color: #fff; font-size: 12px; font-weight: 700; }
.main { background: #fff; }
.sample-section-break { align-self: center; width: min(620px, calc(100% - 40px)); margin: auto; padding: 38px 32px; border: 1px solid #d9e1f3; border-radius: 14px; background: #f8faff; text-align: center; }
.sample-section-break .sample-section-kicker { margin: 0 0 10px; color: #52658d; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.sample-section-break h2 { margin: 0 0 12px; font-size: 30px; }
.sample-section-break p:last-child { margin: 0; color: #3e4657; font-size: 16px; line-height: 1.6; }
.pane { flex: 1 1 0; min-width: 0; min-height: 0; overflow: auto; position: relative; }
.pane.left { padding: 52px 40px 40px 42px; }
.pane.right { padding: 52px 40px 40px 38px; }
.pane.hidden { display: none; }
.pane.left .passage { max-width: 900px; margin-left: auto; margin-right: auto; }
.pane.right:not(.solo) > :not(.expand) { max-width: 666px; margin-left: auto; margin-right: auto; }
/* single-pane (math) questions: centered column that slides right of the calculator, like Bluebook */
.pane.right.solo > * { max-width: 760px; margin-left: auto; margin-right: auto; transform: translateX(0); }
.divider { flex: none; width: 3px; background: #777; position: relative; cursor: col-resize; touch-action: none; }
.divider::before { content: ""; position: absolute; left: -12px; right: -12px; top: 0; bottom: 0; }
.divider .handle { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background: #111; color: #fff; width: 22px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 11px; }
.expand { position: absolute; top: 10px; width: 32px; height: 32px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35); border: 0; display: flex; align-items: center; justify-content: center; z-index: 2; }
.pane.left .expand { right: 26px; }
.pane.right .expand { left: 18px; }

.ftr { background: var(--bar); height: 62px; flex: none; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 16px; padding: 0 40px; position: relative; }
.ftr .who { font-size: 18px; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qnav { background: #1a1a1a; color: #fff; border: 0; border-radius: 6px; padding: 9px 16px; font-size: 15px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; justify-self: center; }
.nav-btns { display: flex; gap: 14px; justify-self: end; }
.pill { background: var(--blue); color: #fff; border: 0; border-radius: 22px; padding: 0 26px; height: 42px; font-size: 16px; font-weight: 700; min-width: 78px; }
.pill:hover { background: var(--blue-dark); }
.pill.ghost { background: #fff; color: var(--blue); border: 2px solid var(--blue); }
.pill[disabled] { opacity: .45; cursor: default; }

/* Practice keeps the familiar question tools without a clock or question counter. */
.practice-exam .hdr { grid-template-columns: minmax(0, 1fr) auto; }
.practice-exam .ftr { grid-template-columns: minmax(0, 1fr) auto; gap: 12px; }
.practice-exam .ftr .who { min-width: 0; }
.practice-empty-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.practice-topic { padding: 0 12px; font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.practice-feedback { margin-top: 22px; padding: 16px 18px; border: 1px solid; border-radius: 10px; font: 15px/1.5 var(--ui); }
.practice-feedback.correct { color: #176b2e; border-color: #9ac8a7; background: #effaf2; }
.practice-feedback.incorrect { color: #9d2323; border-color: #e5b3b3; background: #fff3f3; }
.practice-feedback p { margin: 6px 0 0; }
.practice-exam .choice[aria-disabled="true"] { cursor: default; }

/* ---------- New 300 Questions: Bluebook-style test assets ---------- */
.new300-exam-image { width: 100%; max-width: 980px; margin: 0 auto; background: #fff; }
.new300-exam-image img { display: block; width: 100%; height: auto; }
.new300-answer-instruction { margin: 0 0 14px; color: #596984; font: 14px/1.5 var(--ui); }
.new300-review-rationale { margin-top: 26px; padding-top: 18px; border-top: 1px solid #d7dce4; }
.new300-review-rationale h3 { margin: 0 0 12px; font-size: 18px; }
.new300-review-rationale img { display: block; width: min(100%, 900px); height: auto; margin: 0 auto; border: 1px solid #d7dce4; border-radius: 8px; background: #fff; }
/* ---------- Question content ---------- */
.passage { font-family: var(--serif); font-size: 21px; line-height: 1.55; color: #111; }
.passage p { margin: 0 0 14px; }
.passage .src { font-style: italic; }
.passage ul { padding-left: 22px; margin: 8px 0 14px; }
.passage .blank { white-space: nowrap; }
.figimg { max-width: 100%; display: block; margin: 8px 0 16px; }
.qhead { display: flex; align-items: center; background: var(--gray-bar); height: 36px; margin-bottom: 0; position: relative; }
.qhead::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; background: #111; }
.qnum { background: #111; color: #fff; width: 32px; height: 36px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 17px; }
.mark { display: flex; align-items: center; gap: 6px; background: none; border: 0; margin-left: 14px; font-size: 14.5px; font-weight: 500; color: #111; }
.mark.on { color: #b3261e; }
.mark.on svg path { fill: #b3261e; stroke: #b3261e; }
.abc { margin-left: auto; margin-right: 6px; width: 28px; height: 26px; border: 2px solid #111; border-radius: 4px; background: #fff; display: flex; align-items: center; justify-content: center; padding: 0; }
.abc.on { background: var(--blue); border-color: var(--blue); }
.abc.on svg * { stroke: #fff; fill: #fff; }
.prompt { font-family: var(--serif); font-size: 16px; line-height: 1.7; margin: 8px 0 10px; color: #111; }
.prompt p { margin: 0 0 12px; }
.math-stem { font-family: var(--serif); font-size: 20px; line-height: 1.55; color: #111; }
.math-stem .math-expression { font-size: 1.35em; margin: 0 0 42px; }
.math-stem .math-prompt { font-size: 20px; line-height: 1.5; margin: 0 0 10px; }
.math-stem > p:not(.math-expression):not(.math-prompt):not(.math-equations) { font-size: 14px; line-height: 1.45; color: #444; }
.math-stem .math-table { border-collapse: collapse; margin: 0 0 14px; font-size: .92em; line-height: 1.25; }
.math-stem .math-table caption { caption-side: top; padding: 0 0 4px; font-weight: 600; }
.math-stem .math-table th, .math-stem .math-table td { border: 1px solid #555; padding: 5px 10px; text-align: center; }
.exam.math-exam .choice .txt math { font-size: 22px; }
.choices { display: flex; flex-direction: column; gap: 12px; }
.choice-row { display: grid; grid-template-columns: minmax(0, 1fr) 44px; align-items: center; gap: 8px; }
.choice-row > .choice:only-child { grid-column: 1 / -1; }
.choice-row > .strike, .choice-row > .strike-undo { justify-self: center; }
.choice { flex: 1; display: flex; align-items: center; gap: 14px; border: 1.5px solid #858585; border-radius: 10px; padding: 12px 16px; background: #fff; font-family: var(--serif); font-size: 16px; line-height: 1.5; min-height: 52px; cursor: pointer; text-align: left; color: #222; position: relative; }
.choice:hover { border-color: #000; box-shadow: 0 0 0 1px #000 inset; }
.choice .ltr { flex: none; width: 26px; height: 26px; border: 1.5px solid #666; border-radius: 50%; font-family: var(--ui); font-weight: 500; font-size: 14px; display: flex; align-items: center; justify-content: center; background: transparent; }
.choice .txt { flex: 1; min-width: 0; }
.choice .txt img { max-width: 100%; display: block; }
.choice .txt svg { max-width: 100%; display: block; height: auto; }
.exam.math-exam .choice .txt .math-option { font-size: 22px; }
.choice.sel:not(.struck) { border-color: var(--blue); box-shadow: 0 0 0 1.5px var(--blue) inset; background: #f3f5ff; }
.choice.sel:not(.struck) .ltr { background: var(--blue); border-color: var(--blue); color: #fff; }
.choice.struck { border-color: #858585; box-shadow: none; background: #fff; }
.choice.struck .txt { opacity: .5; }
.choice.struck::after { content: ""; position: absolute; left: -2px; right: -2px; top: 50%; height: 2px; background: #111; pointer-events: none; }
.choice.struck .ltr { opacity: .45; background: transparent; border-color: #666; color: #222; }
/* letters-only choices (choice text lives in the question image) */
.lettersnote { font: 13px var(--ui); color: #555; margin: 0 0 10px; }
.choices.letters { flex-direction: row; flex-wrap: wrap; gap: 12px 18px; }
.choices.letters .choice-row { flex: 0 0 auto; grid-template-columns: 64px 44px; }
.choices.letters .choice { flex: none; min-width: 64px; justify-content: center; }
.choices.letters .choice:only-child { grid-column: 1; }
.choices.letters .txt { display: none; }
.choices.letters .choice.struck .ltr { text-decoration: line-through; opacity: .5; }
/* image (math) choices: line-through can't reach pixels, so draw the line across the image itself — not the box */
.choice.struck .txt .imgwrap::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2px; background: #111; transform: translateY(-50%); pointer-events: none; }
.choice.correct { border-color: #1e8a3c; box-shadow: 0 0 0 1.5px #1e8a3c inset; background: #effaf2; }
.choice.correct .ltr { background: #1e8a3c; border-color: #1e8a3c; color: #fff; }
.choice.wrong { border-color: #c62828; box-shadow: 0 0 0 1.5px #c62828 inset; background: #fdf0f0; }
.choice.wrong .ltr { background: #c62828; border-color: #c62828; color: #fff; }
.strike { flex: none; width: 22px; height: 22px; margin: 0 2px 0 0; border-radius: 50%; border: 1.5px solid #666; background: transparent; font-size: 11px; line-height: 1; position: relative; padding: 0; font-family: var(--ui); font-weight: 500; }
.strike::after { content: ""; position: absolute; left: -4px; right: -4px; top: 50%; height: 1.5px; background: #222; }
.strike-undo { flex: none; border: 0; background: none; padding: 0 2px; text-decoration: underline; font: 500 14px var(--ui); color: #111; }
.spr-entry { position: relative; min-height: 250px; }
.spr-answer { width: 130px; }
.pane.left.spr-directions-pane > * { max-width: 440px; margin-left: 116px; margin-right: 0; }
.pane.right.spr-pane > * { max-width: 900px; margin-left: 78px; margin-right: 0; }
.spr input { font: 400 16px var(--serif); border: 1.5px solid #888; border-radius: 7px; padding: 8px 10px; width: 75px; height: 41px; background: transparent; }
.spr input:focus { outline: none; border-color: var(--blue); }
.spr .prev { margin-top: 38px; font: 700 16px/1.2 var(--serif); color: #222; }
.spr .prev b { font: inherit; margin-left: 8px; color: #111; }
.spr .hint { font-size: 13px; color: #555; margin-top: 12px; line-height: 1.5; max-width: 420px; }
.keypad { width: 100%; border: 1px solid #777; background: #ffff; }
.spr-pane .keypad { position: absolute; left: 164px; top: 0; width: 230px; }
.keypad header { height: 36px; background: #292929; color: #fff; display: flex; align-items: center; justify-content: space-between; padding: 0 8px; font: 500 13px var(--ui); }
.keypad header button { border: 0; color: #fff; background: none; font-size: 24px; }
.keypad .keys { display: grid; grid-template-columns: repeat(12, 1fr); gap: 5px; padding: 7px; }
.keypad .keys button { min-height: 32px; border: 1px solid #d2d2d2; border-radius: 7px; background: #f8f8f8; font: 400 19px var(--ui); color: #222; }
.keypad .keys button:nth-child(-n+9) { grid-column: span 4; }
.keypad .keys button:nth-child(10), .keypad .keys button:nth-child(11), .keypad .keys button:nth-child(13), .keypad .keys button:nth-child(14) { grid-column: span 2; }
.keypad .keys button:nth-child(12) { grid-column: span 4; }
.keypad.closed { display: none; }
.keypad-toggle { margin-top: 32px; padding: 7px 16px; border: 0; border-radius: 20px; background: #292929; color: #fff; font: 500 14px var(--ui); }
.spr-directions { max-width: 640px; margin: 0 auto; font: 16px/1.45 var(--serif); color: #333; }
.spr-directions h3 { margin: 0 0 18px; font-size: 18px; }
.spr-directions ul { padding-left: 24px; margin: 0 0 22px; }
.spr-directions li { margin: 0 0 6px; }
.spr-examples { max-width: 600px; margin: 18px auto 0; text-align: center; }
.spr-example-title { margin-bottom: 4px; }
.spr-examples table { width: 100%; border-collapse: collapse; font-size: 14px; }
.spr-examples th, .spr-examples td { border: 1px solid #888; padding: 8px 10px; }
.imgwrap { position: relative; line-height: 0; overflow: hidden; width: 100%; }
.imgwrap img { display: block; mix-blend-mode: multiply; user-select: none; -webkit-user-select: none; }
.exam.math-exam .imgwrap { width: min(100%, calc(var(--natw, 100%) * 1.6)) !important; }
.imgwrap .ocr { position: absolute; inset: 0; overflow: hidden; pointer-events: auto; }
/* scanned passages may grow past their natural width when the pane allows it (expanded pane, wide tablet) */
.pane.left .passage .imgwrap { width: min(100%, calc(var(--natw, 100%) * 1.5)) !important; }
/* each span's scaleX makes it its own stacking context, so the blend has to sit on the span (not the mark) to reach the scan */
.imgwrap .ocr span { position: absolute; color: transparent; white-space: pre; line-height: 1; transform-origin: 0 0; cursor: text; mix-blend-mode: multiply; }
.imgwrap .ocr span::selection, .imgwrap .ocr mark::selection { background: rgba(60,110,230,.35); color: transparent; }

mark.hl { background: #fff3a3; color: inherit; border-radius: 2px; padding: 0; }
mark.hl.blue { background: #bfe0ff; }
mark.hl.pink { background: #ffc9e2; }
mark.hl.ul { background: none; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
mark.hl.note { box-shadow: 0 -2px 0 #324dc7 inset; }
/* OCR text is transparent; the span's multiply blend keeps the scanned letters visible through full-strength highlights. */
.imgwrap .ocr mark.hl { color: transparent; }
.imgwrap .ocr mark.hl.ul { background: none; text-decoration-color: #26324d; }
.hltb { position: absolute; z-index: 50; background: #fff; border: 0; border-radius: 28px; box-shadow: 0 3px 12px rgba(0,0,0,.25); padding: 8px; display: flex; align-items: center; gap: 8px; }
.hltb button { width: 36px; height: 36px; border-radius: 50%; border: 1px solid #777; background: transparent; font-weight: 700; font-size: 13px; padding: 0; }
.hltb button.y { background: #f1edcf; } .hltb button.b { background: #d5e2e9; } .hltb button.p { background: #efd6e4; }
.hltb button.underline-tool, .hltb button.delete-tool, .hltb button.note-tool { width: 40px; border: 0; border-radius: 0; font-size: 18px; }
.hltb button svg { width: 22px; height: 22px; fill: none; stroke: #222; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }

/* ---------- Popovers ---------- */
.pop { position: absolute; z-index: 40; background: #fff; border: 1px solid #999; border-radius: 10px; box-shadow: 0 6px 24px rgba(0,0,0,.28); }
.navpop { bottom: 70px; left: 50%; transform: translateX(-50%); width: 620px; max-width: 94vw; padding: 18px 20px 14px; }
.navpop h4 { margin: 0 0 12px; text-align: center; font-size: 16px; font-weight: 500; padding-bottom: 12px; border-bottom: 1px solid #ccc; }
.navpop .legend { display: flex; justify-content: center; gap: 18px; font-size: 13px; margin-bottom: 14px; flex-wrap: wrap; }
.navpop .grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 10px 8px; margin-bottom: 14px; }
.nbtn { height: 36px; border: 1.5px dashed #324dc7; background: #fff; color: var(--blue); font-weight: 700; font-size: 14px; border-radius: 4px; position: relative; padding: 0; }
.nbtn.done { border-style: solid; background: var(--blue); color: #fff; }
.nbtn.review-correct { border: 2px solid #188447; background: #e5f5eb; color: #126c39; }
.nbtn.review-wrong { border: 2px solid #c62828; background: #fff0f0; color: #a51f1f; }
.nbtn.cur { outline: 2px solid #111; outline-offset: 2px; }
.nbtn .flag { position: absolute; top: -9px; right: -5px; color: #c62828; font-size: 13px; }
.navpop .nav-legend-correct { color: #168044; }
.navpop .nav-legend-wrong { color: #b3261e; }
.navpop .go { display: block; margin: 0 auto; background: #fff; border: 2px solid var(--blue); color: var(--blue); border-radius: 20px; padding: 7px 22px; font-weight: 700; font-size: 14px; }
.dirpop { top: 66px; left: 40px; width: 520px; padding: 18px 20px; font-size: 14px; line-height: 1.55; z-index: 60; }
.drawer { position: absolute; right: 0; top: 0; bottom: 0; width: 330px; background: #fff; border-left: 2px solid #111; z-index: 45; box-shadow: -6px 0 18px rgba(0,0,0,.2); display: flex; flex-direction: column; }
.drawer h3 { margin: 0; padding: 16px 18px; font-size: 17px; font-weight: 500; border-bottom: 1px solid #ccc; display: flex; justify-content: space-between; }
.drawer .body { padding: 14px 18px; overflow: auto; flex: 1; font-size: 14px; }
.drawer .item { border: 1px solid #ddd; border-radius: 8px; padding: 8px 10px; margin-bottom: 10px; }
.drawer .item q { display: block; font-family: var(--serif); font-size: 13.5px; margin-bottom: 6px; quotes: none; }
.drawer textarea { width: 100%; min-height: 54px; font: 14px var(--ui); border: 1px solid #aaa; border-radius: 6px; padding: 6px; }
.scratchdrawer { position: absolute; right: 0; top: 0; bottom: 0; width: 330px; background: #fff; border-left: 2px solid #111; z-index: 45; box-shadow: -6px 0 18px rgba(0,0,0,.2); display: flex; flex-direction: column; }
.scratchdrawer h3 { margin: 0; padding: 16px 18px; font-size: 17px; font-weight: 500; border-bottom: 1px solid #ccc; display: flex; justify-content: space-between; }
.scratchdrawer .body { padding: 14px 18px; overflow: auto; flex: 1; display: flex; }
.scratchdrawer textarea { flex: 1; width: 100%; resize: none; font: 14px var(--ui); line-height: 1.55; border: 1px solid #aaa; border-radius: 6px; padding: 10px; }
.scratchdrawer textarea:focus { outline: none; border-color: var(--blue); }
.moremenu { top: 52px; right: 40px; width: 220px; padding: 6px 0; z-index: 60; }
.moremenu button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 10px 16px; font-size: 14px; }
.moremenu button:hover { background: #f1f3fb; }
.refsheet { position: relative; z-index: 44; flex: 0 0 clamp(340px, 34vw, 640px); width: clamp(340px, 34vw, 640px); min-width: 0; min-height: 0; align-self: stretch; background: #fff; border-left: 1px solid #777; display: flex; flex-direction: column; container-type: inline-size; }
.ref-expanded .refsheet { flex-basis: min(680px, 60%); width: min(680px, 60%); }
.refsheet > header { flex: none; min-height: 42px; padding: 5px 10px 5px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #292929; color: #fff; font: 500 16px/1.3 var(--ui); }
.ref-actions { display: flex; align-items: center; gap: 4px; }
.ref-actions button { display: grid; place-items: center; width: 32px; height: 32px; padding: 4px; border: 0; background: transparent; color: inherit; font: 24px/1 var(--ui); }
.ref-actions button:hover { background: #444; }
.ref-actions button:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
.ref-actions svg { width: 18px; height: 18px; }
.refsheet .body { flex: 1; min-height: 0; padding: 20px 18px 28px; overflow: auto; color: #222; font: 15px/1.5 var(--serif); }
.ref-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 14px; align-items: start; }
.ref-figure { min-width: 0; margin: 0; text-align: center; }
.ref-figure > svg { display: block; width: 100%; max-width: 170px; height: auto; margin: 0 auto 5px; color: #444; }
.ref-figure svg text { font: italic 16px Georgia, serif; }
.ref-figure svg .ref-angle { font-size: 12px; font-style: normal; }
.ref-figure figcaption { display: grid; justify-content: center; gap: 2px; font-size: 15px; }
.ref-figure math { margin: 0; font-size: 19px; }
.ref-special { grid-column: span 2; }
.ref-special-diagrams { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ref-special-diagrams svg { display: block; width: 100%; max-width: 190px; height: auto; margin: 0 auto 5px; color: #444; }
.ref-special figcaption { font-weight: 700; }
.ref-facts { margin-top: 28px; }
.ref-facts p { margin: 0 0 14px; }
@container (min-width: 520px) { .ref-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.calc header { background: var(--bar); padding: 10px 14px; display: flex; justify-content: space-between; align-items: center; font-weight: 500; border-radius: 8px 8px 0 0; cursor: move; }
.xbtn { background: none; border: 0; font-size: 20px; line-height: 1; padding: 0 4px; }
.calc { position: fixed; z-index: 44; top: 19.5vh; left: 9vw; width: 390px; height: min(645px, 74vh); background: #fff; border: 1px solid #aaa; border-radius: 2px; box-shadow: 0 4px 16px rgba(0,0,0,.22); display: flex; flex-direction: column; resize: both; overflow: hidden; min-width: 320px; min-height: 340px; max-width: calc(100vw - 16px); max-height: calc(100vh - 16px); }
.calc .cbody { flex: 1; min-height: 0; }
.calc[hidden] { display: none; }
.calc header { touch-action: none; }
.calc header { background: #292929; color: #fff; padding: 5px 10px; border-radius: 0; }
.calc header .xbtn { color: #fff; }
.calc iframe { display: block; width: 100%; height: 100%; border: 0; border-radius: 0 0 8px 8px; }
.calc.dragging iframe, .calc:active iframe { pointer-events: none; }

/* ---------- Review page ---------- */
.review { flex: 1; overflow: auto; padding: 32px 20px; text-align: center; }
.review h2 { font-size: 30px; font-weight: 500; margin: 0 0 24px; }
.review p.sub { color: #333; margin: 0 auto 26px; max-width: 800px; line-height: 1.5; }
.review .box { border: 1px solid #e3e3e3; border-radius: 10px; background: #fff; max-width: 1024px; margin: 0 auto 22px; padding: 22px; text-align: left; box-shadow: 0 6px 16px rgba(0,0,0,.08); }
.review .box .top { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; font-size: 15px; font-weight: 500; }
.review .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 16px 12px; }

/* ---------- Home / menus ---------- */
.site { min-height: 100vh; min-height: 100dvh; background: #f6f8fd; }
.topnav { display: flex; align-items: center; }
.site-top { background: var(--bar); padding: 22px 40px; display: flex; align-items: center; gap: 14px; }
.site-top .logo, .site-top h1 { cursor: pointer; }
.site-top .logo { width: 38px; height: 38px; border-radius: 10px; background: var(--blue); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 15px; }
.site-top h1 { margin: 0; font-size: 20px; font-weight: 500; }
.site-top .spacer { flex: 1; }
.site-top a.link { color: var(--blue); font-weight: 500; font-size: 14px; text-decoration: none; margin-left: 18px; cursor: pointer; }
.site-top a.link[aria-current="page"] { text-decoration: underline; text-underline-offset: 5px; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 36px 24px 80px; }
.crumbs { font-size: 14px; color: #444; margin-bottom: 14px; display: flex; gap: 6px; flex-wrap: wrap; }
.crumbs a { color: var(--blue); cursor: pointer; text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.wrap h2 { font-size: 30px; font-weight: 500; margin: 0 0 6px; }
.wrap .lead { color: #444; margin: 0 0 28px; font-size: 16px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(290px, 100%), 1fr)); gap: 16px; }
.card { background: #fff; border: 1.5px solid #cfd6ea; border-radius: 14px; padding: 20px 22px; text-align: left; font-size: 17px; font-weight: 500; color: var(--ink); display: flex; flex-direction: column; gap: 6px; min-height: 104px; transition: .12s; }
.card:hover { border-color: var(--blue); box-shadow: 0 4px 14px rgba(50,77,199,.16); transform: translateY(-1px); }
.card small { font-size: 13.5px; font-weight: 400; color: #555; line-height: 1.4; }
.card .bar { height: 6px; border-radius: 3px; background: #e5e9f5; margin-top: auto; overflow: hidden; }
.card .bar i { display: block; height: 100%; background: var(--blue); }
.card.mix { background: linear-gradient(135deg, #324dc7, #4a63dc); color: #fff; border-color: transparent; }
.card.mix small { color: #dfe5ff; }
.card.big { min-height: 150px; font-size: 22px; }
.sec-title { font-size: 14px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: #555; margin: 30px 0 12px; }
.tests { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); gap: 14px; }
.tcard { background: #fff; border: 1.5px solid #cfd6ea; border-radius: 12px; padding: 16px 18px; text-align: left; display: flex; flex-direction: column; gap: 4px; }
.tcard:hover { border-color: var(--blue); box-shadow: 0 4px 14px rgba(50,77,199,.16); }
.tcard b { font-size: 16px; font-weight: 500; } .tcard span { font-size: 13px; color: #555; }
.tcard .st { margin-top: 8px; font-size: 13px; font-weight: 700; }
.tcard .st.ok { color: #1e8a3c; } .tcard .st.prog { color: #b36b00; }
.tcard .row { display: flex; gap: 8px; margin-top: 10px; }
.tcard .row button { flex: 1; font-size: 13px; font-weight: 700; border-radius: 16px; padding: 6px 0; border: 2px solid var(--blue); background: var(--blue); color: #fff; }
.tcard .row button.o { background: #fff; color: var(--blue); }
.tcard.locked { background: #f1f2f6; border-color: #d8dbe5; opacity: .78; }
.tcard.locked:hover { border-color: #d8dbe5; box-shadow: none; }
.tcard.locked .st.locked-label { color: #6d7280; }
.tcard.locked .row button { background: #d8dbe5; border-color: #d8dbe5; color: #4d5260; }
.tcard.free-active { border-color: #9ab4ef; }

/* ---------- Results ---------- */
.score { display: flex; gap: 22px; align-items: center; background: #fff; border: 1.5px solid #cfd6ea; border-radius: 16px; padding: 24px 28px; margin: 8px 0 28px; flex-wrap: wrap; }
.score .big { font-size: 56px; font-weight: 700; color: var(--blue); line-height: 1; }
.score .meta { font-size: 16px; line-height: 1.6; }
.score .acts { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }
.scoreveil { display: flex; flex: 0 0 auto; flex-direction: column; align-items: center; gap: 8px; min-width: 190px; color: #34415e; text-align: center; }
.scoreveil-title { font: 700 17px/1.25 var(--ui); letter-spacing: .035em; }
.score-machine { position: relative; display: inline-flex; align-items: center; min-height: 1em; padding-right: 38px; }
.score-cells { display: flex; gap: 4px; color: #35415e; font: 700 clamp(42px, 6vw, 68px)/1 var(--ui); font-variant-numeric: tabular-nums; }
.score-wheel { display: block; width: .62em; height: 1em; overflow: hidden; border: 1.5px solid #c4d2e8; border-radius: 15px; background: #f8faff; box-shadow: inset 0 1px 5px rgba(41, 67, 115, .06); }
.score-awaiting-reveal .score-cells { visibility: hidden; }
.score-reel { display: flex; flex-direction: column; transform: translateY(0); }
.score-reel > span { display: block; height: 1em; flex: 0 0 1em; line-height: 1em; }
.scoreveil.is-spinning .score-reel { transform: translateY(var(--score-end-offset)); transition: transform 1900ms cubic-bezier(.13, .78, .18, 1); transition-delay: var(--score-delay); }
.score-lever { position: absolute; inset: 0 0 0 auto; width: 30px; }
.score-lever-button { padding: 0; border: 0; border-radius: 8px; background: transparent; cursor: pointer; }
.score-lever-button:focus-visible { outline: 3px solid #3857dc; outline-offset: 3px; }
.score-lever-button:disabled { cursor: default; }
.score-lever i { position: absolute; z-index: 2; top: 2px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: radial-gradient(circle at 34% 30%, #ff8887, #d64049 65%, #aa2936); box-shadow: 0 2px 4px rgba(70, 40, 50, .25); transition: transform 260ms ease; }
.score-lever b { position: absolute; top: 22px; bottom: 16px; left: 12px; width: 6px; border-radius: 5px; background: linear-gradient(90deg, #afbed1, #e5eaf2 55%, #9aabc1); transform-origin: center top; transition: transform 260ms ease; }
.score-lever em { position: absolute; right: 0; bottom: 0; left: 0; height: 13px; border-radius: 5px; background: linear-gradient(#59657a, #30394b); box-shadow: 0 2px 3px rgba(24, 35, 55, .2); }
.scoreveil.is-spinning .score-lever i { transform: translateY(18px); }
.scoreveil.is-spinning .score-lever b { transform: scaleY(1.2); }
.scoreveil-range { min-height: 1.3em; color: #65718a; font: 400 14px/1.3 var(--ui); letter-spacing: .03em; }
.scoreveil-live { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.score-awaiting-reveal [data-score-details], .score-revealing [data-score-details] { visibility: hidden; opacity: 0; pointer-events: none; }
.score-revealed [data-score-details] { visibility: visible; opacity: 1; transition: opacity 350ms ease; }
.score .scoreveil { flex-basis: 250px; }
.wlist { display: flex; flex-direction: column; gap: 12px; }
.witem { background: #fff; border: 1.5px solid #e2c3c3; border-radius: 12px; padding: 14px 18px; display: flex; gap: 16px; align-items: center; }
.witem .n { width: 36px; height: 36px; border-radius: 8px; background: #c62828; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.witem .info { flex: 1; font-size: 14.5px; line-height: 1.5; }
.witem .info .q { font-family: var(--serif); color: #333; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 2px; }
.witem .ans b.r { color: #c62828; } .witem .ans b.g { color: #1e8a3c; }
.perfect { background: #effaf2; border: 1.5px solid #9fd5ae; border-radius: 12px; padding: 20px; text-align: center; font-size: 18px; }

/* ---------- My notes ---------- */
.nlist { display: flex; flex-direction: column; gap: 12px; }
.ncard { background: #fff; border: 1.5px solid #cfd6ea; border-radius: 12px; padding: 16px 18px; display: flex; gap: 16px; align-items: flex-start; }
.ncard .info { flex: 1; min-width: 0; }
.ncard .meta { font-size: 12.5px; font-weight: 700; letter-spacing: .2px; color: #555; text-transform: uppercase; margin-bottom: 8px; }
.ncard .txt { font-family: var(--serif); font-size: 15px; line-height: 1.6; color: #222; white-space: pre-wrap; }
.ncard .pill { flex: none; }

.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: #111; color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 14px; z-index: 100; }
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 90; display: flex; align-items: center; justify-content: center; }
.dialog { background: #fff; border-radius: 12px; padding: 26px 28px; max-width: 460px; box-shadow: 0 10px 40px rgba(0,0,0,.4); }
.dialog h3 { margin: 0 0 10px; font-weight: 500; } .dialog p { line-height: 1.5; margin: 0 0 20px; }
.dialog .acts { display: flex; gap: 10px; justify-content: flex-end; }

@media (max-width: 900px) {
  .hdr { padding: 8px 14px; } .ftr { padding: 0 14px; }
  .main { flex-direction: column; } .divider { width: auto; height: 4px; cursor: row-resize; }
  .divider::before { left: 0; right: 0; top: -12px; bottom: -12px; }
  .divider .handle { width: 34px; height: 24px; }
  .pane.left, .pane.right { padding: 52px 18px 24px; }
  .spr-entry { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .spr-entry { min-height: 0; }
  .spr-answer { width: auto; }
  .pane.left.spr-directions-pane > * { max-width: none; margin-left: 0; }
  .spr .prev { margin-top: 14px; }
  .keypad-toggle { margin-top: 16px; }
  .pane.right.spr-pane > * { max-width: none; margin-left: 0; }
  .spr-pane .keypad { position: static; max-width: 360px; width: 100%; }
  .hdr .r .tool span { display: none; }
  .refsheet, .ref-expanded .refsheet { position: absolute; inset: 0; width: 100%; height: auto; border-left: 0; }
}

.origrow { margin-top: 26px; }
.origbtn { background: none; border: 0; padding: 0; color: var(--blue); font: 500 13px var(--ui); text-decoration: underline; }

.site { display: flex; flex-direction: column; }
.site .wrap { flex: 1; width: 100%; }
.site-paywall .wrap { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.paywall { width: 100%; max-width: 640px; margin: 0 auto; text-align: center; }
.wrap .paywall-note { font-size: 13px; margin: 20px 0 0; }
.paywall-alternative { margin: 20px 0 0; }
.paywall-alternative .link { color: var(--blue); cursor: pointer; }
.foot { text-align: center; font-size: 12px; color: #6b7280; padding: 18px 0 24px; }
.foot a { color: inherit; }
.foot a:hover { color: var(--blue); }

/* ---------- Account ---------- */
.access-panel { position: relative; width: min(440px, calc(100vw - 32px)); }
.access-panel-close { position: absolute; top: 12px; right: 12px; }
.access-panel label { display: block; margin: 18px 0 8px; font-weight: 500; }
.access-panel input { width: 100%; height: 46px; padding: 10px 12px; border: 1px solid #aab4ce; border-radius: 8px; font: 16px var(--ui); }
.access-panel input:focus { outline: 2px solid var(--blue); outline-offset: 2px; }
.access-panel-status { min-height: 20px; margin: 14px 0; font: 14px/1.5 var(--ui); color: #555; }
.access-panel [type="submit"] { width: 100%; }
.site-top { position: relative; }
.acct { margin-left: 22px; width: 36px; height: 36px; flex: none; border-radius: 50%; border: 0; background: var(--blue); color: #fff; font: 700 15px var(--ui); display: flex; align-items: center; justify-content: center; padding: 0; }
.acct:hover, .acct[aria-expanded="true"] { background: var(--blue-dark); box-shadow: 0 0 0 3px rgba(50,77,199,.2); }
.acctmenu { top: 70px; right: 40px; width: 260px; padding: 6px 0; z-index: 60; }
.acctmenu[hidden] { display: none; }
.acctmenu .who { padding: 10px 16px 12px; border-bottom: 1px solid #e3e7f2; display: flex; flex-direction: column; gap: 3px; font-size: 14px; overflow-wrap: anywhere; }
.acctmenu .who span { color: #555; font-size: 13px; }
.acctmenu .who .plan { margin-top: 6px; align-self: flex-start; background: #eef1fc; color: var(--blue); font-weight: 500; font-size: 12px; border-radius: 10px; padding: 2px 10px; }
.acctmenu button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 10px 16px; font-size: 14px; color: var(--ink); }
.acctmenu button:hover, .acctmenu button:focus-visible { background: #f1f3fb; outline: none; }

/* checkbox row (sign-up form + consent dialog) */
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; line-height: 1.45; color: #333; cursor: pointer; margin: 0 0 12px; }
.check input { appearance: none; -webkit-appearance: none; flex: none; width: 20px; height: 20px; margin: 0; border: 1.5px solid #8a93ad; border-radius: 5px; background: #fff; display: grid; place-content: center; cursor: pointer; transition: .12s; }
.check input::after { content: ""; width: 10px; height: 6px; border: solid #fff; border-width: 0 0 2.4px 2.4px; transform: translateY(-1px) rotate(-45deg) scale(0); transition: transform .12s; }
.check input:checked { background: var(--blue); border-color: var(--blue); }
.check input:checked::after { transform: translateY(-1px) rotate(-45deg) scale(1); }
.check input:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(50,77,199,.3); }
.check a { color: var(--blue); font-weight: 500; }
.check.invalid input { border-color: #c62828; }
.dialog.consent { width: min(480px, 92vw); }
.dialog.consent .check { margin-bottom: 14px; }
.consent-err { color: #c62828; font-size: 13.5px; margin: 4px 0 14px !important; }

/* ---------- Touch screens (phones, iPads) ---------- */
@media (pointer: coarse) {
  .strike { width: 28px; height: 28px; font-size: 12px; }
  .hltb { padding: 8px; gap: 8px; }
  .hltb button { width: 38px; height: 38px; font-size: 15px; }
  .hltb button.wide { padding: 0 12px; }
  /* iOS zooms the page when focusing a field with text under 16px */
  .drawer textarea, .scratchdrawer textarea, .dialog textarea { font-size: 16px !important; }
}
/* tablets: give the passage the room the desktop padding would take */
@media (pointer: coarse) and (min-width: 641px) {
  .pane.left { padding: 52px 20px 32px 22px; }
  .pane.right { padding: 52px 22px 32px 22px; }
}

/* ---------- Phones ---------- */
@media (max-width: 640px) {
  /* site chrome: brand + account on the first row, page links on the second */
  .site-top { padding: 12px 16px 10px; flex-wrap: wrap; gap: 6px 10px; }
  .site-top .logo { width: 34px; height: 34px; font-size: 14px; }
  .site-top h1 { font-size: 17px; }
  .site-top .spacer { display: none; }
  .acct { order: 2; margin-left: auto; width: 34px; height: 34px; }
  .topnav { order: 3; width: 100%; gap: 22px; overflow-x: auto; }
  .site-top .topnav a.link { margin-left: 0; padding: 4px 0; white-space: nowrap; }
  .acctmenu { top: 54px; right: 12px; width: min(260px, calc(100vw - 24px)); }
  .wrap { padding: 22px 16px 56px; }
  .wrap h2 { font-size: 24px; }
  .wrap .lead { font-size: 15px; margin-bottom: 20px; }
  .card { min-height: 0; padding: 16px 18px; }
  .card.big { min-height: 108px; font-size: 20px; }
  .score { padding: 18px; gap: 14px; }
  .score .big { font-size: 44px; }
  .score .acts { margin-left: 0; width: 100%; }
  .score .acts .pill { flex: 1 1 auto; }
  .witem, .ncard { flex-wrap: wrap; gap: 10px 14px; padding: 14px; }
  .witem .info, .ncard .info { flex: 1 1 calc(100% - 60px); }
  .witem > .pill, .ncard > .pill { width: 100%; }

  /* exam header: title truncates, tools shrink to icons */
  .hdr { height: auto; min-height: 58px; padding: 8px 10px 6px; grid-template-columns: minmax(0, 1fr) auto auto; column-gap: 8px; }
  .hdr .l { min-width: 0; }
  .hdr .l .title { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .hdr .l .dir { margin-top: 6px; font-size: 13px; }
  .hdr .timer { font-size: 17px; line-height: 22px; }
  .hdr .hide { margin-top: 3px; padding: 0 12px; }
  .hdr .r { gap: 2px; padding-top: 2px; }
  .tool { min-width: 32px; }
  .tool svg { height: 20px; }

  /* exam footer: question navigator sits in the flow so it can't cover Back/Next */
  .ftr { height: 58px; grid-template-columns: auto minmax(0, 1fr); padding: 0 10px; gap: 8px; }
  .ftr .who { display: none; }
  .qnav { position: static; transform: none; font-size: 14px; padding: 8px 12px; white-space: nowrap; }
  .nav-btns { gap: 8px; margin-left: auto; }
  .practice-exam .ftr { grid-template-columns: minmax(0, 1fr); }
  .practice-exam .ftr .nav-btns { width: 100%; justify-content: flex-end; gap: 6px; }
  .practice-exam .ftr .pill { padding: 0 12px; }
  .pill { padding: 0 18px; height: 40px; font-size: 15px; min-width: 0; }

  .pane.left, .pane.right { padding: 48px 14px 28px; }
  /* scanned passages/figures stay legible: keep a readable minimum width and let the pane scroll sideways */
  .pane .passage .imgwrap { min-width: min(var(--natw, 100%), 560px); }
  .passage { font-size: 18px; line-height: 1.55; }
  .choice { padding: 10px 12px; gap: 10px; font-size: 15.5px; }
  .spr input { width: 100%; max-width: 240px; }

  /* floating tools become full-width sheets */
  .calc { left: 8px !important; right: 8px; top: auto !important; bottom: 66px; width: auto; height: 52vh; height: 52dvh; min-width: 0; min-height: 0; resize: none; }
  .calc header { cursor: default; }
  .refsheet .body { padding: 14px 16px; }
  .navpop { bottom: 64px; padding: 14px 12px 12px; }
  .navpop .grid { grid-template-columns: repeat(5, 1fr); }
  .dirpop { left: 10px; right: 10px; top: 60px; width: auto; max-height: 70vh; overflow: auto; }
  .moremenu { right: 10px; top: 56px; }
  .drawer, .scratchdrawer { width: 100%; }
  .dialog { padding: 20px; margin: 0 12px; }
  .dialog .acts { flex-wrap: wrap; }
  .origview img { min-width: 860px; }
  .review { padding: 24px 14px; }
  .review h2 { font-size: 22px; }
  .review .box { padding: 16px; }
  .review .grid { grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 12px 8px; }
}
.math-figure { margin: 0 auto 18px; max-width: 540px; }
.math-figure svg { display: block; width: min(100%, 540px); height: auto; color: #111; }

/* ---------- Full-length practice tests ---------- */
.sat-overview { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(280px, 1fr); align-items: start; gap: 32px; margin: 6px 0 30px; }
.sat-overview > * { min-width: 0; }
.sat-overview p { max-width: 66ch; line-height: 1.6; }
.sat-overview > aside { padding: 18px 20px; background: #edf2fc; border-left: 4px solid var(--blue); border-radius: 0 8px 8px 0; }
.sat-overview > aside h3 { margin: 0 0 12px; font-size: 17px; font-weight: 500; }
.sat-test-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin: 24px 0 36px; }
.sat-test-card { display: flex; flex-direction: column; min-width: 0; background: #fff; border: 1.5px solid #d3dbee; border-radius: 12px; overflow: hidden; }
.sat-test-card:focus-within { border-color: var(--blue); }
.sat-test-open { display: flex; flex: 1; flex-direction: column; align-items: flex-start; gap: 10px; width: 100%; min-height: 164px; padding: 22px 20px 18px; border: 0; border-radius: 0; background: transparent; color: var(--ink); text-align: left; font: 400 14px/1.45 var(--ui); }
.sat-test-open:hover { background: #f4f6ff; }
.sat-test-open b, .sat-test-open strong, .sat-test-open h3 { margin: 0; color: var(--ink); font-size: 21px; line-height: 1.3; font-weight: 500; }
.sat-test-open small { color: #596277; font-size: 13px; line-height: 1.5; }
.sat-test-open .sat-status { margin-top: auto; }
.sat-status { display: inline-flex; align-items: center; align-self: flex-start; width: fit-content; gap: 6px; min-height: 25px; padding: 3px 9px; border: 1px solid #dce2ef; border-radius: 5px; color: #4d576e; background: #f5f7fb; font: 500 12px/1.35 var(--ui); }
.sat-status.is-complete, .sat-test-card.is-complete .sat-status { color: #176d36; border-color: #b9dcc3; background: #eef8f0; }
.sat-status.is-progress, .sat-test-card.is-progress .sat-status { color: #2640ad; border-color: #c2cef6; background: #eef1fc; }
.sat-status.is-locked, .sat-test-card.is-locked .sat-status { color: #596174; border-color: #d8dce5; background: #edf0f5; }
.sat-test-card.is-locked { background: #f4f5f8; border-color: #d8dce5; }
.sat-test-card.is-locked .sat-test-open:hover { background: #eaedf4; }
.sat-card-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 20px 20px; }
.sat-card-actions > button, .sat-card-actions > a { display: inline-flex; flex: 1 1 auto; align-items: center; justify-content: center; min-height: 42px; padding: 8px 14px; border: 1.5px solid var(--blue); border-radius: 22px; background: var(--blue); color: #fff; text-decoration: none; font: 500 14px/1.3 var(--ui); }
.sat-card-actions > .ghost { color: var(--blue); background: #fff; }
.sat-card-actions > button:hover, .sat-card-actions > a:hover { background: var(--blue-dark); border-color: var(--blue-dark); color: #fff; }
.sat-module-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.sat-module-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 13px 0; border-bottom: 1px solid #d7dfed; font-size: 14px; line-height: 1.45; }
.sat-module-row:last-child { border-bottom: 0; }
.sat-module-row > :first-child { min-width: 0; }
.sat-module-row > :last-child { flex-shrink: 0; }
.sat-module-row b, .sat-module-row strong { font-weight: 500; }
.sat-module-row small { display: block; margin-top: 3px; color: #596277; font-size: 13px; }
.sat-module-row.is-break { color: #596277; font-size: 13px; }
.sat-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin: 24px 0 0; }
.sat-actions .pill { min-height: 44px; }
.sat-notice { max-width: 76ch; margin: 16px 0; padding: 0 0 0 14px; border-left: 3px solid #b8c6eb; color: #596277; font: 400 14px/1.65 var(--ui); }
.sat-notice p { margin: 0 0 8px; }
.sat-notice p:last-child { margin-bottom: 0; }
.sat-notice a { color: var(--blue); }
.sat-intro { max-width: 760px; margin: 14px auto 0; padding: 30px; border: 1.5px solid #d3dbee; border-radius: 12px; background: #fff; }
.sat-intro h2 { margin-bottom: 14px; }
.sat-intro > p { max-width: 65ch; color: #4d576e; font-size: 16px; line-height: 1.65; }
.sat-intro .sat-module-list { margin: 20px 0; }
.sat-break { max-width: 680px; margin: 24px auto 0; padding: 38px 28px; background: #fff; border: 1.5px solid #d3dbee; border-radius: 12px; text-align: center; }
.sat-break > p { max-width: 52ch; margin-left: auto; margin-right: auto; color: #596277; font-size: 16px; line-height: 1.65; }
.sat-break-time { margin: 26px 0; color: var(--blue); font: 500 clamp(52px, 8vw, 76px)/1.1 var(--ui); font-variant-numeric: tabular-nums; }
.sat-break .sat-actions { justify-content: center; }
.sat-break button:disabled, .sat-actions button:disabled { background: #e3e7f1; border-color: #e3e7f1; color: #687187; cursor: default; }
.sat-score-report { display: grid; grid-template-columns: minmax(180px, .8fr) minmax(0, 2fr); align-items: center; gap: 30px; margin: 20px 0 26px; padding: 28px 0; border-top: 3px solid var(--blue); border-bottom: 1px solid #d3dbee; }
.sat-score-total { color: #596277; font-size: 14px; line-height: 1.5; }
.sat-score-caption { margin-bottom: 8px; color: #596277; font-size: 14px; }
.sat-score-total .scoreveil { align-items: flex-start; }
.sat-score-total .scoreveil-title { display: none; }
.sat-score-total .score-cells { font-size: clamp(58px, 7vw, 82px); }
.sat-score-total .scoreveil-range { font-size: 15px; }
.sat-section-scores { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.sat-section-score { min-width: 0; padding: 6px 0 6px 22px; border-left: 1px solid #c9d2e7; font-size: 14px; line-height: 1.55; }
.sat-section-score h3 { margin: 0 0 10px; font-size: 16px; font-weight: 500; }
.sat-section-score .scoreveil { align-items: flex-start; min-width: 0; }
.scoreveil-section .score-cells { font-size: 38px; }
.scoreveil-section .score-wheel { border-radius: 10px; }
.scoreveil-section .score-machine { padding-right: 31px; }
.scoreveil-section .score-lever { width: 24px; transform: scale(.78); transform-origin: top left; }
.scoreveil-section .scoreveil-range { font-size: 12px; }
.sat-section-score small, .sat-section-score p { color: #596277; font-size: 13px; }
.sat-section-score p { margin: 5px 0 0; }
.sat-domain-table { width: 100%; margin: 18px 0 28px; overflow-x: auto; }
.sat-domain-table table { width: 100%; border-collapse: collapse; background: #fff; text-align: left; font-size: 14px; line-height: 1.5; }
.sat-domain-table th, .sat-domain-table td { padding: 12px 16px; border-bottom: 1px solid #dce2ef; vertical-align: top; }
.sat-domain-table th { color: #4d576e; background: #edf2fc; font-weight: 500; }
.sat-domain-table th:not(:first-child), .sat-domain-table td:not(:first-child) { text-align: right; }
.sat-domain-table tbody tr:last-child td { border-bottom: 0; }
.sat-domain-table td small { display: block; color: #596277; font-size: 12px; }
.sat-review-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 20px 0 28px; }
.sat-review-list > button, .sat-review-list > a { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 62px; padding: 14px 18px; border: 1.5px solid #d3dbee; border-radius: 8px; color: var(--ink); background: #fff; text-align: left; text-decoration: none; font: 500 15px/1.45 var(--ui); }
.sat-review-list > button:hover, .sat-review-list > a:hover { color: var(--blue); border-color: var(--blue); background: #f4f6ff; }
.sat-review-list small { display: block; color: #596277; font-size: 13px; font-weight: 400; }
.sat-test-open:focus-visible, .sat-card-actions > button:focus-visible, .sat-card-actions > a:focus-visible, .sat-actions button:focus-visible, .sat-actions a:focus-visible, .sat-review-list > button:focus-visible, .sat-review-list > a:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.sat-test-open:focus-visible { outline-offset: -4px; }

@media (max-width: 900px) {
  .sat-overview { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .sat-overview > aside { max-width: none; }
  .sat-test-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .sat-score-report { gap: 22px; grid-template-columns: minmax(160px, .8fr) minmax(0, 2fr); }
  .sat-section-scores { gap: 16px; }
  .sat-section-score { padding-left: 16px; }
}
@media (max-width: 640px) {
  .sat-overview { margin-bottom: 22px; }
  .sat-overview > aside { padding: 14px 16px; }
  .sat-test-list { grid-template-columns: minmax(0, 1fr); gap: 14px; margin-top: 20px; }
  .sat-test-open { min-height: 144px; padding: 18px 18px 14px; }
  .sat-card-actions { padding: 0 18px 18px; }
  .sat-module-row { gap: 12px; }
  .sat-intro { padding: 22px 18px; }
  .sat-break { margin-top: 16px; padding: 26px 18px; }
  .sat-actions { gap: 10px; }
  .sat-actions .pill { flex: 1 1 auto; }
  .sat-score-report { grid-template-columns: minmax(0, 1fr); gap: 24px; padding: 22px 0; }
  .sat-score-total .score-cells { font-size: 64px; }
  .sat-section-scores { gap: 18px; }
  .sat-section-score { padding-left: 14px; }
  .scoreveil-section .score-cells { font-size: 34px; }
  .sat-domain-table th, .sat-domain-table td { padding: 10px 12px; }
  .sat-review-list { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .scoreveil.is-spinning .score-reel { transition-duration: 1ms; transition-delay: 0ms; }
  .score-lever i, .score-lever b { transition-duration: 1ms; }
  .score-revealed [data-score-details] { transition-duration: 1ms; }
}
