/* CS Sprint — an offline-first, buildless study space. */
:root {
  color-scheme: light;
  --canvas: #f7f8f4;
  --surface: #ffffff;
  --surface-soft: #f6f8f7;
  --ink: #162e36;
  --muted: #607178;
  --faint: #78858b;
  --line: #e3e9e5;
  --teal: #126655;
  --teal-dark: #0b4c3f;
  --mint: #e3f0e9;
  --mint-strong: #cce7d8;
  --coral: #b6402e;
  --coral-hover: #9d3424;
  --coral-soft: #fbeddf;
  --amber: #855b0b;
  --amber-soft: #fff5da;
  --blue: #315a97;
  --blue-soft: #edf2fc;
  --purple: #655090;
  --purple-soft: #f0edf7;
  --red: #ac3441;
  --red-soft: #fcebef;
  --shadow: 0 5px 22px rgb(27 54 43 / 3%);
  --shadow-float: 0 16px 56px rgb(17 40 30 / 14%);
  --radius: 20px;
  --sidebar-width: 236px;
}
[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #101b20;
  --surface: #18272d;
  --surface-soft: #1d2e34;
  --ink: #e7efee;
  --muted: #afbfbe;
  --faint: #95aaa8;
  --line: #30424a;
  --teal: #8cdbc1;
  --teal-dark: #abead6;
  --mint: #1d3e37;
  --mint-strong: #285546;
  --coral: #f79b82;
  --coral-hover: #ffb39d;
  --coral-soft: #3d2b28;
  --amber: #f3d285;
  --amber-soft: #3a3321;
  --blue: #abcafb;
  --blue-soft: #233449;
  --purple: #d3bdf9;
  --purple-soft: #352c43;
  --red: #ffb1bd;
  --red-soft: #3d2931;
  --shadow: none;
  --shadow-float: 0 16px 56px rgb(0 0 0 / 30%);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 110px; }
body { margin: 0; min-width: 300px; background: var(--canvas); color: var(--ink); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Arial, sans-serif; font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }
button, a { touch-action: manipulation; }
button { color: inherit; }
a { color: var(--teal); text-underline-offset: 3px; overflow-wrap: anywhere; }
a:hover { color: var(--teal-dark); }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 4px; }
button:focus:not(:focus-visible) { outline: none; }
main:focus { outline: none; }
h1, h2, h3, h4, p { margin-top: 0; }
h1, h2, h3, h4 { line-height: 1.25; letter-spacing: -.035em; }
h2 { font-size: 28px; }
h3 { font-size: 18px; }
h4 { font-size: 16px; }
p:last-child { margin-bottom: 0; }
img, svg { max-width: 100%; }
svg.icon { width: 21px; height: 21px; flex: 0 0 21px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.icon-definitions { position: absolute; width: 0; height: 0; overflow: hidden; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 100; top: 12px; left: 12px; padding: 10px 16px; background: var(--surface); border: 2px solid var(--teal); border-radius: 10px; transform: translateY(-180%); }
.skip-link:focus { transform: translateY(0); }

/* Navigation */
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; display: flex; flex-direction: column; width: var(--sidebar-width); padding: 30px 18px 20px; background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto; overscroll-behavior: contain; }
.brand { display: flex; align-items: center; gap: 10px; width: 100%; padding: 0 7px; border: 0; background: transparent; text-align: left; }
.brand-mark { display: grid; place-items: center; flex: 0 0 43px; height: 43px; border-radius: 13px; background: #153c34; color: #cff0d5; }
.brand-mark svg { width: 29px; height: 29px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.brand-name { font-size: 24px; font-weight: 800; letter-spacing: -.065em; line-height: 1.05; }
.brand-name > span { display: block; margin-top: 7px; font-size: 8px; letter-spacing: .18em; color: var(--muted); font-weight: 700; }
.exam-label { align-self: flex-start; display: flex; align-items: center; gap: 7px; margin: 23px 7px 32px; padding: 5px 10px; color: var(--teal); background: var(--mint); font-size: 10px; font-weight: 800; letter-spacing: .045em; border-radius: 5px; }
.status-dot { display: inline-block; flex: 0 0 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--teal); }
.nav-caption { margin: 0 14px 11px; font-size: 9px; font-weight: 750; letter-spacing: .14em; color: var(--faint); }
.primary-nav, .secondary-nav { display: grid; gap: 5px; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 47px; padding: 11px 14px; border: 0; border-radius: 10px; background: transparent; text-align: left; color: var(--muted); font-size: 13px; font-weight: 550; transition: background .15s, color .15s; }
.nav-item:hover { background: var(--surface-soft); color: var(--ink); }
.nav-item.active, .nav-item[aria-current="page"] { background: var(--mint); color: var(--teal); font-weight: 750; }
.nav-count { margin-left: auto; padding: 0 6px; font-size: 10px; line-height: 21px; border-radius: 5px; background: var(--surface-soft); color: var(--muted); }
.nav-divider { height: 1px; min-height: 1px; margin: 23px 13px 18px; background: var(--line); }
.sidebar-note { position: relative; margin: auto 7px 20px; padding: 25px 17px 19px; border: 1px solid var(--line); border-radius: 15px; background: var(--canvas); overflow: hidden; }
.sidebar-note strong { display: block; margin-bottom: 10px; font-size: 17px; line-height: 1.35; letter-spacing: -.035em; }
.sidebar-note p { font-size: 11px; color: var(--muted); line-height: 1.7; }
.note-spark { position: absolute; top: 12px; right: 13px; color: var(--coral); font-size: 25px; }
.sidebar-bottom { display: flex; justify-content: center; align-items: center; gap: 8px; color: var(--faint); font-size: 10px; }
.app-shell { margin-left: var(--sidebar-width); min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; min-height: 92px; padding: 17px 38px; border-bottom: 1px solid var(--line); background: var(--canvas); gap: 16px; }
.topbar-kicker { display: block; margin-bottom: 5px; font-size: 9px; font-weight: 750; color: var(--muted); letter-spacing: .12em; }
.topbar h1 { margin: 0; font-size: 20px; letter-spacing: -.025em; }
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.local-status { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; color: var(--muted); }
.icon-button { display: inline-flex; justify-content: center; align-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--muted); flex: 0 0 44px; transition: background .15s, color .15s; }
.icon-button:hover { color: var(--teal); background: var(--mint); }
.theme-sun { display: none; }
[data-theme="dark"] .theme-moon { display: none; }
[data-theme="dark"] .theme-sun { display: block; }
.mobile-resource, .mobile-nav { display: none; }
.main-content { width: 100%; max-width: 1450px; margin: 0 auto; padding: 32px 38px 24px; }
.main-content > * + * { margin-top: 25px; }
.app-footer { display: flex; justify-content: space-between; gap: 12px; max-width: 1450px; margin: 0 auto; padding: 22px 38px 28px; font-size: 10px; color: var(--faint); }
.app-footer > :first-child { font-weight: 800; letter-spacing: -.025em; }

/* Typography, layout, controls */
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 25px; }
.page-heading h2 { margin: 0 0 8px; font-size: 30px; }
.page-heading p { color: var(--muted); margin: 0; font-size: 13px; }
.eyebrow { margin: 0 0 11px; font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--teal); }
.muted, .text-muted { color: var(--muted); }
.faint { color: var(--faint); }
.positive, .text-success { color: var(--teal); }
.negative, .text-danger { color: var(--red); }
.text-coral { color: var(--coral); }
.small, small { font-size: 12px; }
.text-center { text-align: center; }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; }
.stack { display: grid; gap: 14px; }
.flex { display: flex; align-items: center; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.w-full { width: 100%; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 46px; padding: 11px 19px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font-size: 12px; font-weight: 750; line-height: 1.4; text-decoration: none; text-align: center; transition: background .15s, border-color .15s, transform .15s, box-shadow .15s; }
.button:hover { background: var(--surface-soft); border-color: var(--faint); color: var(--ink); }
.button:active:not(:disabled) { transform: translateY(1px); }
.button.primary { background: var(--coral); color: #fff; border-color: var(--coral); box-shadow: 0 3px 0 rgb(79 26 15 / 8%); }
.button.primary:hover { background: var(--coral-hover); border-color: var(--coral-hover); color: #fff; }
[data-theme="dark"] .button.primary, [data-theme="dark"] .button.primary:hover { color: #2e211d; }
.button.secondary { background: var(--mint); color: var(--teal); border-color: var(--mint); }
.button.secondary:hover { background: var(--mint-strong); border-color: var(--mint-strong); }
.button.ghost { color: var(--teal); border-color: transparent; background: transparent; box-shadow: none; }
.button.ghost:hover { background: var(--mint); }
.button.danger { background: var(--red-soft); border-color: var(--red-soft); color: var(--red); }
.button.small { min-height: 44px; padding: 9px 13px; font-size: 11px; }
.button.large { min-height: 52px; padding: 14px 23px; font-size: 13px; }
.button svg.icon { width: 17px; height: 17px; flex-basis: 17px; }
.button-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.link-button { padding: 0; border: 0; min-height: 44px; background: none; color: var(--teal); font-weight: 700; font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.card { min-width: 0; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-header, .section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 19px; }
.card-header h2, .card-header h3, .section-head h2, .section-head h3 { margin: 0; font-size: 17px; }
.card-header p, .section-head p { margin: 5px 0 0; font-size: 12px; color: var(--muted); }
.section-head { margin-top: 28px; margin-bottom: 16px; }
.card .section-head:first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 5px; color: var(--muted); background: var(--surface-soft); font-size: 10px; font-weight: 750; line-height: 1.5; letter-spacing: .01em; }
.badge.success, .badge.easy, .badge.green { background: var(--mint); color: var(--teal); }
.badge.warning, .badge.medium, .badge.moderate, .badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.danger, .badge.hard, .badge.red { background: var(--red-soft); color: var(--red); }
.badge.blue { background: var(--blue-soft); color: var(--blue); }
.badge.purple { background: var(--purple-soft); color: var(--purple); }
.badge.coral { background: var(--coral-soft); color: var(--coral); }
.badge.outline { border: 1px solid var(--line); background: transparent; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); font-size: 11px; font-weight: 700; color: var(--muted); }
.chip:hover { background: var(--surface-soft); color: var(--ink); }
.chip.active, .chip[aria-pressed="true"] { background: var(--mint); border-color: var(--teal); color: var(--teal); }
.progress-track { height: 6px; width: 100%; overflow: hidden; background: var(--surface-soft); border-radius: 20px; }
.progress-fill { height: 100%; min-width: 0; background: var(--teal); border-radius: inherit; transition: width .3s; }
.progress-fill.coral { background: var(--coral); }
.progress-fill.blue { background: var(--blue); }
.progress-fill.purple { background: var(--purple); }
.progress-caption { display: flex; justify-content: space-between; gap: 12px; font-size: 10px; color: var(--muted); margin-bottom: 7px; }
.divider { height: 1px; background: var(--line); margin: 20px 0; }

/* Home */
.hero { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 30px; min-height: 267px; padding: 33px 39px; border: 1px solid var(--mint-strong); border-radius: 23px; background: var(--mint); overflow: hidden; }
.hero-copy { position: relative; z-index: 1; flex: 1; min-width: 0; }
.hero h2 { margin: 0 0 14px; max-width: 530px; font-size: clamp(28px, 2.8vw, 42px); font-weight: 780; line-height: 1.1; letter-spacing: -.05em; }
.hero h2 em { font-style: normal; color: var(--teal); }
.hero p:not(.eyebrow) { max-width: 450px; margin-bottom: 21px; font-size: 12px; color: var(--muted); line-height: 1.8; }
.hero .button-row { gap: 11px; }
.hero-footnote { display: flex; align-items: center; gap: 8px; margin-top: 17px; color: var(--teal); font-size: 10px; font-weight: 650; }
.hero-footnote .icon { width: 15px; height: 15px; flex-basis: 15px; }
.hero-art { position: relative; display: flex; align-items: center; justify-content: center; flex: 0 0 228px; min-height: 206px; }
.hero-art::before, .hero-art::after { position: absolute; content: "✦"; color: var(--teal); opacity: .3; font-size: 27px; top: 16px; right: 0; }
.hero-art::after { top: auto; right: auto; bottom: 4px; left: 7px; font-size: 19px; color: var(--coral); opacity: .65; }
.daily-ring, .score-ring { --progress: 0%; position: relative; display: flex; flex-direction: column; justify-content: center; align-items: center; width: 184px; height: 184px; border-radius: 50%; background: conic-gradient(var(--teal) var(--progress), var(--mint-strong) 0); isolation: isolate; text-align: center; }
.daily-ring::before, .score-ring::before { content: ""; position: absolute; inset: 10px; border-radius: 50%; background: var(--surface); z-index: -1; }
.daily-ring strong, .score-ring strong { display: block; font-size: 49px; line-height: 1; font-weight: 750; letter-spacing: -.075em; }
.daily-ring span, .score-ring span { margin-top: 7px; font-size: 11px; color: var(--muted); }
.daily-ring small, .score-ring small { color: var(--teal); font-size: 9px; font-weight: 800; letter-spacing: .13em; margin-top: 10px; text-transform: uppercase; }
.ring-badge { position: absolute; right: -5px; bottom: 9px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--teal); box-shadow: var(--shadow); font-size: 10px; font-weight: 800; transform: rotate(-6deg); }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; }
.stat-card { position: relative; min-width: 0; padding: 19px 20px 17px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.stat-card .stat-label, .stat-card > p:first-child, .stat-card > .muted:first-child { color: var(--muted); font-size: 11px; font-weight: 550; margin: 0 0 10px; }
.stat-card strong, .stat-value { display: block; font-size: 28px; font-weight: 750; letter-spacing: -.055em; line-height: 1.15; }
.stat-card small, .stat-card .stat-detail { display: block; margin-top: 10px; color: var(--faint); font-size: 10px; }
.stat-icon { position: absolute; top: 15px; right: 15px; display: grid; place-items: center; width: 29px; height: 29px; border-radius: 9px; color: var(--teal); background: var(--mint); }
.stat-icon .icon { width: 16px; height: 16px; }
.stat-icon.coral { background: var(--coral-soft); color: var(--coral); }
.stat-icon.blue { background: var(--blue-soft); color: var(--blue); }
.stat-icon.purple { background: var(--purple-soft); color: var(--purple); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(260px, 1fr); gap: 22px; align-items: start; }
.dashboard-grid.equal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.topic-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.topic-card { display: flex; flex-direction: column; align-items: stretch; gap: 11px; min-width: 0; min-height: 139px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); text-align: left; transition: border-color .16s, box-shadow .16s, transform .16s; }
button.topic-card:hover, a.topic-card:hover { border-color: var(--teal); box-shadow: var(--shadow); transform: translateY(-2px); }
.topic-card h3, .topic-card strong { margin: 0; font-size: 13px; line-height: 1.4; font-weight: 750; letter-spacing: -.02em; }
.topic-card p { margin: 0; color: var(--muted); font-size: 10px; }
.topic-card .topic-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: auto; font-size: 10px; color: var(--muted); }
.topic-card .progress-track { height: 4px; }
.topic-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: var(--teal); background: var(--mint); font-size: 17px; }
.quick-action { display: flex; align-items: center; gap: 13px; width: 100%; padding: 14px 0; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--ink); text-align: left; }
.quick-action:last-child { border-bottom: 0; padding-bottom: 0; }
.quick-action strong { display: block; font-size: 12px; }
.quick-action small { color: var(--muted); font-size: 10px; }
.quick-action > .icon:last-child { margin-left: auto; width: 15px; height: 15px; color: var(--faint); }
.activity-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); align-items: end; gap: 8px; }
.activity-day { text-align: center; font-size: 9px; color: var(--muted); }
.activity-bar-track { display: flex; align-items: flex-end; justify-content: center; height: 74px; margin-bottom: 10px; border-radius: 6px; background: var(--surface-soft); overflow: hidden; }
.activity-bar { width: 100%; min-height: 3px; background: var(--mint-strong); border-radius: 6px 6px 0 0; }
.activity-day.today .activity-bar { background: var(--teal); }
.activity-day.today { color: var(--teal); font-weight: 800; }
.metric-row { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.metric-row:last-child { border-bottom: 0; }
.metric-row strong { font-size: 13px; }

/* Forms and question bank */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 19px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > label, .field-label, label.field > span:first-child { color: var(--ink); font-size: 11px; font-weight: 750; }
.field > small, .field .hint { color: var(--muted); font-size: 10px; line-height: 1.7; }
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea { width: 100%; min-width: 0; min-height: 46px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font-size: 13px; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--faint); opacity: 1; }
input:hover, select:hover, textarea:hover { border-color: var(--faint); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--teal); min-width: 19px; width: 19px; min-height: 19px; margin: 0; }
label.checkbox, label.radio { display: flex; align-items: center; gap: 9px; min-height: 44px; font-size: 12px; cursor: pointer; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
legend { padding: 0; margin-bottom: 10px; font-size: 12px; font-weight: 700; }
.search-row { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(140px, .5fr) minmax(130px, .45fr); align-items: end; gap: 12px; margin-bottom: 18px; }
.search-input { position: relative; }
.search-input > .icon { position: absolute; left: 13px; top: 13px; color: var(--faint); width: 18px; height: 18px; }
.search-input input { padding-left: 40px; }
.bank-list { display: grid; gap: 14px; }
.bank-question { padding: 22px; border: 1px solid var(--line); background: var(--surface); border-radius: 15px; }
.bank-question .question-stem { font-size: 15px; margin: 13px 0; }
.bank-question summary { font-weight: 750; font-size: 12px; color: var(--teal); }
.bank-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.pagination { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.pagination > span { color: var(--muted); font-size: 12px; }
.pagination .button-row { gap: 6px; }

/* Practice */
.quiz-layout { display: grid; grid-template-columns: minmax(0, 1fr) 252px; align-items: start; gap: 22px; }
.quiz-main, .quiz-sidebar { min-width: 0; }
.quiz-main { display: grid; gap: 18px; }
.quiz-sidebar { position: sticky; top: 112px; display: grid; gap: 16px; }
.quiz-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 13px 17px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.quiz-toolbar > div { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.timer { display: inline-flex; align-items: center; gap: 7px; color: var(--ink); font-size: 15px; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -.025em; }
.timer .icon { color: var(--muted); width: 18px; height: 18px; flex-basis: 18px; }
.timer.warning, .timer.urgent { color: var(--red); }
.question-card { min-width: 0; padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.question-number { display: inline-block; font-size: 10px; font-weight: 800; color: var(--teal); letter-spacing: .1em; text-transform: uppercase; }
.question-meta { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 17px; }
.question-stem { margin: 18px 0 24px; color: var(--ink); font-size: 19px; line-height: 1.7; font-weight: 620; letter-spacing: -.02em; white-space: pre-wrap; overflow-wrap: anywhere; }
.question-stem pre, pre { max-width: 100%; padding: 15px 17px; border: 1px solid var(--line); border-radius: 9px; overflow-x: auto; background: var(--surface-soft); color: var(--ink); font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; font-size: 12px; font-weight: 450; line-height: 1.75; white-space: pre-wrap; tab-size: 2; letter-spacing: 0; }
code { padding: 1px 4px; border-radius: 4px; background: var(--surface-soft); font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; font-size: .9em; }
pre code { padding: 0; background: transparent; font-size: inherit; }
.options { display: grid; gap: 11px; }
.option { position: relative; display: flex; align-items: flex-start; gap: 13px; width: 100%; min-height: 61px; padding: 14px 17px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); text-align: left; font-size: 13px; font-weight: 500; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; transition: background .13s, border-color .13s; }
.option:hover:not(:disabled):not(.correct):not(.wrong) { border-color: var(--teal); background: var(--surface-soft); }
.option:disabled { opacity: 1; cursor: default; }
.option-letter { display: grid; place-items: center; flex: 0 0 29px; width: 29px; height: 29px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); background: var(--surface); font-size: 10px; line-height: 1; font-weight: 800; }
.option-text { min-width: 0; padding-top: 3px; flex: 1; }
.option.selected { border-color: var(--teal); box-shadow: inset 0 0 0 1px var(--teal); background: var(--mint); }
.option.selected .option-letter { color: var(--surface); background: var(--teal); border-color: var(--teal); }
.option.correct { border-color: var(--teal); background: var(--mint); }
.option.correct .option-letter { color: var(--surface); background: var(--teal); border-color: var(--teal); }
.option.wrong { border-color: var(--red); background: var(--red-soft); }
.option.wrong .option-letter { background: var(--red); border-color: var(--red); color: var(--surface); }
.option-marker { align-self: center; margin-left: auto; padding-left: 8px; font-size: 10px; font-weight: 800; color: var(--teal); }
.option.wrong .option-marker { color: var(--red); }
.explanation { margin-top: 22px; padding: 20px; border: 1px solid var(--mint-strong); border-left: 3px solid var(--teal); border-radius: 11px; background: var(--mint); color: var(--ink); font-size: 13px; line-height: 1.8; white-space: normal; overflow-wrap: anywhere; }
.explanation h3, .explanation h4 { margin: 0 0 11px; color: var(--teal); font-size: 14px; }
.explanation p { margin: 0 0 11px; white-space: pre-wrap; }
.explanation ul { padding-left: 19px; }
.explanation li { margin-bottom: 7px; }
.explanation .option-explanation { padding: 9px 0; border-top: 1px solid var(--mint-strong); font-size: 12px; }
.answer-feedback { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 750; color: var(--teal); margin-top: 20px; }
.answer-feedback.wrong { color: var(--red); }
.question-actions { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.palette { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.palette-button { position: relative; display: grid; place-items: center; min-height: 44px; aspect-ratio: 1; width: 100%; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); color: var(--muted); font-size: 11px; font-weight: 750; }
.palette-button:hover { border-color: var(--teal); }
.palette-button.current { border: 2px solid var(--teal); background: var(--surface); color: var(--teal); }
.palette-button.answered { background: var(--mint); color: var(--teal); border-color: var(--mint-strong); }
.palette-button.correct { background: var(--mint); color: var(--teal); border-color: var(--teal); }
.palette-button.wrong { background: var(--red-soft); color: var(--red); border-color: var(--red); }
.palette-button.flagged::after { position: absolute; content: ""; width: 6px; height: 6px; right: 3px; top: 3px; border-radius: 50%; background: var(--purple); }
.palette-button.current.answered, .palette-button.current.correct, .palette-button.current.wrong { outline: 2px solid var(--ink); outline-offset: 2px; }
.palette-legend { display: flex; flex-wrap: wrap; gap: 9px 12px; margin-top: 16px; font-size: 9px; color: var(--muted); }
.palette-legend > span { display: inline-flex; align-items: center; gap: 5px; }
.legend-square { width: 9px; height: 9px; border-radius: 3px; border: 1px solid var(--line); background: var(--surface-soft); }
.legend-square.answered { background: var(--mint); border-color: var(--teal); }
.legend-square.flagged { background: var(--purple); border-color: var(--purple); }
.quiz-note { font-size: 10px; color: var(--muted); line-height: 1.8; }
.quiz-sidebar .card { padding: 18px; border-radius: 16px; }
.quiz-sidebar h3 { font-size: 13px; margin-bottom: 16px; }
.quiz-progress { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 10px; font-size: 11px; color: var(--muted); }
.quiz-progress strong { color: var(--ink); }
.keyboard-help { margin-top: 12px; font-size: 10px; color: var(--faint); text-align: center; }
.kbd, kbd { display: inline-block; padding: 0 5px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; background: var(--surface); color: var(--muted); font-family: inherit; font-size: 9px; line-height: 20px; }

/* Results, revision, progress */
.result-hero { display: flex; align-items: center; justify-content: center; gap: 39px; padding: 30px; text-align: left; }
.result-hero h2 { margin-bottom: 11px; font-size: 29px; }
.result-hero .score-ring { flex: 0 0 172px; width: 172px; height: 172px; }
.result-hero .score-ring strong { font-size: 42px; }
.result-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.result-grid > div { padding: 19px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); text-align: center; }
.result-grid strong { display: block; font-size: 27px; letter-spacing: -.04em; }
.result-grid span { color: var(--muted); font-size: 11px; }
.review-item { padding: 22px; margin-bottom: 15px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.review-item h3 { font-size: 15px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.review-item .explanation { font-size: 12px; }
.review-answer { padding: 10px 13px; border-radius: 8px; margin-top: 8px; background: var(--surface-soft); font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.review-answer.correct { color: var(--teal); background: var(--mint); }
.review-answer.wrong { color: var(--red); background: var(--red-soft); }
.empty-state { padding: 45px 25px; text-align: center; color: var(--muted); }
.empty-state .empty-icon { display: grid; place-items: center; width: 65px; height: 65px; margin: 0 auto 20px; border-radius: 19px; background: var(--mint); color: var(--teal); font-size: 26px; }
.empty-state h2, .empty-state h3 { color: var(--ink); margin-bottom: 11px; font-size: 20px; }
.empty-state p { max-width: 450px; margin: 0 auto 21px; font-size: 13px; }
.empty-state .button-row { justify-content: center; }
.table-wrap { max-width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 13px; }
table { width: 100%; border-collapse: collapse; border-spacing: 0; text-align: left; font-size: 12px; }
th { padding: 13px 17px; background: var(--surface-soft); color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .02em; white-space: nowrap; }
td { padding: 14px 17px; border-top: 1px solid var(--line); vertical-align: top; }
tbody tr:hover { background: var(--surface-soft); }
.history-list { display: grid; gap: 0; }
.history-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.history-item:first-child { padding-top: 0; }
.history-item:last-child { border-bottom: 0; padding-bottom: 0; }
.history-item h4, .history-item strong { margin: 0 0 4px; font-size: 12px; }
.history-item p, .history-item small { margin: 0; color: var(--muted); font-size: 10px; }
.history-score { text-align: right; white-space: nowrap; }
.history-score strong { display: block; color: var(--teal); font-size: 16px; }
.topic-progress-row { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(90px, 1fr) 45px; align-items: center; gap: 15px; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.topic-progress-row:last-child { border-bottom: 0; }
.topic-progress-row small { display: block; color: var(--muted); font-size: 10px; }
.topic-progress-row > :last-child { text-align: right; font-weight: 700; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.calendar-day { min-height: 44px; padding: 7px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-soft); font-size: 10px; color: var(--muted); text-align: center; }
.calendar-day.done { background: var(--mint); color: var(--teal); border-color: var(--mint-strong); }
.calendar-day.today { border-color: var(--teal); }

/* Settings, guide, overlays */
.setting-row { display: flex; justify-content: space-between; align-items: center; gap: 25px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.setting-row:first-child { padding-top: 0; }
.setting-row:last-child { padding-bottom: 0; border-bottom: 0; }
.setting-row h3, .setting-row h4 { margin: 0 0 6px; font-size: 14px; }
.setting-row p { max-width: 600px; color: var(--muted); margin: 0; font-size: 11px; }
.setting-row > .field { width: 170px; flex: 0 0 170px; }
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: 0 0 46px; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; z-index: 1; cursor: pointer; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 20px; transition: background .15s; }
.switch span::before { position: absolute; content: ""; left: 4px; top: 4px; width: 18px; height: 18px; background: var(--surface); border-radius: 50%; transition: transform .15s; }
.switch input:checked + span { background: var(--teal); }
.switch input:checked + span::before { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 3px solid var(--teal); outline-offset: 4px; }
.notice { padding: 15px 18px; border: 1px solid var(--mint-strong); border-radius: 12px; background: var(--mint); color: var(--teal); font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
.notice h3, .notice h4 { margin: 0 0 7px; font-size: 13px; }
.notice p { margin: 0 0 8px; }
.notice p:last-child { margin: 0; }
.notice.warning { background: var(--amber-soft); color: var(--amber); border-color: color-mix(in srgb, var(--amber) 22%, var(--amber-soft)); }
.notice.danger, .notice.error { background: var(--red-soft); color: var(--red); border-color: var(--red); }
.notice.info { background: var(--blue-soft); color: var(--blue); border-color: color-mix(in srgb, var(--blue) 20%, var(--blue-soft)); }
.notice a { color: inherit; font-weight: 700; }
.accordion, details { overflow-wrap: anywhere; }
.accordion { padding: 17px 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.accordion + .accordion { margin-top: 11px; }
summary { position: relative; min-height: 30px; padding: 2px 24px 2px 0; cursor: pointer; color: var(--ink); font-size: 13px; font-weight: 700; line-height: 1.7; }
details[open] > summary { margin-bottom: 15px; }
details > p, details > ul, details > ol { color: var(--muted); font-size: 12px; line-height: 1.9; }
.guide-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.guide-step { display: flex; align-items: flex-start; gap: 14px; margin-top: 19px; }
.step-number { display: grid; place-items: center; flex: 0 0 32px; height: 32px; border-radius: 10px; background: var(--mint); color: var(--teal); font-size: 11px; font-weight: 800; }
.guide-step h4 { margin: 0 0 6px; font-size: 13px; }
.guide-step p { font-size: 12px; color: var(--muted); }
.source-list { margin: 13px 0 0; padding-left: 18px; font-size: 11px; line-height: 1.9; }
.source-list li { margin-bottom: 8px; }
.footer-note { margin-top: 17px; font-size: 10px; line-height: 1.9; color: var(--faint); }
.toast { position: fixed; z-index: 90; bottom: 25px; left: calc(50% + var(--sidebar-width) / 2); max-width: min(500px, calc(100vw - 40px)); width: max-content; padding: 13px 19px; border: 1px solid var(--line); border-radius: 12px; background: var(--ink); color: var(--surface); box-shadow: var(--shadow-float); font-size: 12px; transform: translate(-50%, 25px); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .2s, transform .2s, visibility .2s; }
.toast.show, .toast.visible, .toast:not(:empty) { transform: translate(-50%, 0); opacity: 1; visibility: visible; }
.modal { position: fixed; max-width: min(610px, calc(100vw - 32px)); max-height: calc(100dvh - 50px); width: 100%; padding: 31px; border: 1px solid var(--line); border-radius: 22px; color: var(--ink); background: var(--surface); box-shadow: var(--shadow-float); overflow: auto; }
.modal::backdrop { background: rgb(10 26 24 / 55%); backdrop-filter: blur(4px); }
.modal-close { position: absolute; top: 15px; right: 15px; width: 35px; height: 35px; min-height: 44px; min-width: 44px; border: 0; background: transparent; }
.modal h2 { padding-right: 40px; font-size: 24px; }
.modal p { font-size: 13px; color: var(--muted); }
.modal .button-row { margin-top: 22px; }
.loading-state { margin: 25px auto; max-width: 600px; padding: 55px 25px; text-align: center; }
.loading-state h2 { font-size: 25px; }
.loading-state p { font-size: 13px; }
.loading-orbit { display: block; width: 33px; height: 33px; margin: 0 auto 25px; border: 3px solid var(--mint); border-top-color: var(--teal); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.reveal { animation: reveal .25s ease-out both; }
@keyframes reveal { from { opacity: .6; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* Application markup: study dashboard and session builder. */
.page-heading h1 { margin: 0 0 8px; font-size: 31px; letter-spacing: -.055em; }
.heading-dot { color: var(--coral); }
.hero-kicker { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 17px; color: var(--teal); font-size: 9px; font-weight: 800; letter-spacing: .12em; }
.hero-kicker .icon { width: 16px; height: 16px; flex-basis: 16px; }
.hero-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 15px; margin-top: 20px; color: var(--teal); font-size: 9px; font-weight: 600; }
.hero-foot > span { display: inline-flex; align-items: center; gap: 6px; }
.hero-foot .icon { width: 13px; height: 13px; flex-basis: 13px; }
.hero-art { flex-direction: column; gap: 15px; }
.ring-inner { display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; width: 100%; height: 100%; padding: 17px; }
.ring-inner .ring-caption { display: block; margin: 0; font-size: 8px; font-weight: 750; color: var(--teal); letter-spacing: .09em; line-height: 1.4; }
.ring-inner strong { margin: 11px 0 12px; font-size: 43px; letter-spacing: -.07em; }
.ring-inner strong small { display: inline; margin: 0; color: var(--muted); font-size: 17px; font-weight: 500; letter-spacing: -.04em; text-transform: none; }
.ring-note { max-width: 205px; color: var(--teal); font-size: 10px; font-weight: 550; text-align: center; }
.stat-label { display: flex; align-items: center; gap: 7px; }
.stat-label .icon { width: 15px; height: 15px; flex-basis: 15px; color: var(--teal); }
.stat-card:nth-child(2) .stat-label .icon { color: var(--blue); }
.stat-card:nth-child(3) .stat-label .icon { color: var(--coral); }
.stat-card:nth-child(4) .stat-label .icon { color: var(--purple); }
.stat-value small { display: inline; font-size: 12px; font-weight: 450; letter-spacing: -.02em; margin: 0; color: var(--faint); }
.stat-card > p { margin: 10px 0 0; font-size: 10px; line-height: 1.6; color: var(--muted); }
.next-move { display: flex; align-items: flex-start; gap: 14px; margin: 21px 0 22px; }
.move-icon { display: grid; place-items: center; width: 41px; height: 41px; flex: 0 0 41px; color: var(--coral); background: var(--coral-soft); border-radius: 12px; }
.next-move h3 { margin: 0 0 8px; font-size: 15px; letter-spacing: -.025em; }
.next-move p { font-size: 12px; line-height: 1.8; }
.full-width { width: 100%; }
.field-full { grid-column: 1 / -1; }
.week-chart { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); align-items: end; gap: 12px; margin: 9px 0 0; }
.day-column { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; min-width: 0; gap: 6px; }
.day-count { color: var(--faint); font-size: 9px; font-weight: 550; font-variant-numeric: tabular-nums; }
.day-bar-track { display: flex; align-items: flex-end; width: 100%; height: 79px; border-radius: 7px; background: var(--surface-soft); overflow: hidden; }
.day-bar { width: 100%; min-height: 3px; border-radius: 7px 7px 0 0; background: var(--mint-strong); }
.day-bar.goal-hit, .is-today .day-bar { background: var(--teal); }
.day-label { color: var(--muted); font-size: 9px; margin-top: 2px; }
.is-today .day-label, .is-today .day-count { color: var(--teal); font-weight: 800; }
.history-row { display: flex; align-items: center; gap: 14px; width: 100%; padding: 17px 4px; background: transparent; border: 0; border-bottom: 1px solid var(--line); text-align: left; color: var(--ink); }
.history-row:first-child { padding-top: 5px; }
.history-row:last-child { padding-bottom: 4px; border-bottom: 0; }
.history-row:hover { background: var(--surface-soft); }
.history-icon { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 36px; border-radius: 11px; color: var(--teal); background: var(--mint); }
.history-icon .icon { width: 17px; height: 17px; flex-basis: 17px; }
.history-info { display: flex; flex-direction: column; flex: 1; min-width: 0; gap: 4px; }
.history-info strong { font-size: 12px; font-weight: 700; }
.history-info > .muted { font-size: 10px; line-height: 1.6; }
.history-row .history-score { font-size: 18px; font-weight: 750; color: var(--teal); letter-spacing: -.05em; }
.history-row .history-score small { font-size: 10px; font-weight: 450; color: var(--muted); letter-spacing: 0; }
.history-row > span:last-child { color: var(--faint); font-size: 15px; }
.topic-card { position: relative; }
.topic-content { display: flex; flex-direction: column; flex: 1; min-width: 0; gap: 8px; }
.topic-content > .muted { font-size: 10px; line-height: 1.6; }
.topic-content > .progress-track { margin-top: auto; }
.topic-arrow { position: absolute; top: 15px; right: 16px; color: var(--faint); font-size: 16px; }
.tone-0 { color: var(--teal); background: var(--mint); }
.tone-1 { color: var(--blue); background: var(--blue-soft); }
.tone-2 { color: var(--purple); background: var(--purple-soft); }
.tone-3 { color: var(--coral); background: var(--coral-soft); }
.mode-description { display: flex; align-items: flex-start; gap: 13px; margin-top: 23px; padding-top: 19px; border-top: 1px solid var(--line); }
.mode-number { display: grid; place-items: center; width: 31px; height: 31px; flex: 0 0 31px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-soft); color: var(--teal); font-size: 10px; font-weight: 800; }
.mode-description h3 { font-size: 14px; margin: 0 0 9px; }
.mode-description p { font-size: 12px; line-height: 1.8; color: var(--muted); }
.resume-notice { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.resume-notice strong { font-size: 12px; }
.resume-notice p { font-size: 11px; }
#marking-preview { margin-top: 21px; }
.stack > .card h2 { font-size: 24px; }
.stack > .card > .muted { font-size: 12px; }

/* Question bank, full quiz, results and reference pages. */
.card > h2 { font-size: 22px; margin-bottom: 18px; }
.card > p:not(.eyebrow):not(.footer-note):not(.notice) { font-size: 13px; line-height: 1.8; }
.card > .badge + h2 { margin-top: 16px; }
.filter-card .search-row { grid-template-columns: minmax(0, 1fr) auto; margin-bottom: 18px; }
.search-field { min-width: 0; }
.bank-item, .revision-item { min-width: 0; }
.bank-stem { margin: 17px 0 20px; font-size: 17px; font-weight: 650; line-height: 1.75; letter-spacing: -.02em; white-space: pre-wrap; overflow-wrap: anywhere; }
.bank-item .question-meta, .review-item .question-meta, .revision-item .question-meta { justify-content: flex-start; gap: 7px; }
.badge.subtle { background: var(--blue-soft); color: var(--blue); }
.badge { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.answer-details { margin-top: 19px; padding-top: 14px; border-top: 1px solid var(--line); }
.answer-details > summary { min-height: 44px; display: list-item; padding: 9px 0; color: var(--teal); font-size: 12px; }
.answer-details[open] > summary { margin-bottom: 0; }
.answer-details .explanation { margin-top: 9px; }
.explanation-heading { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; margin-bottom: 13px; }
.explanation-heading > strong { font-size: 14px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.option-explanations { display: grid; min-width: 0; }
.option-explanation > strong { display: block; font-size: 12px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.option-explanation > p { margin-top: 6px; margin-bottom: 0; font-size: 12px; line-height: 1.85; }
.option-explanation.is-correct > strong { color: var(--teal); }
.source-details { margin-top: 11px; padding-top: 11px; border-top: 1px solid var(--mint-strong); }
.source-details > summary { min-height: 44px; padding: 10px 0; font-size: 10px; color: var(--teal); }
.source-details > p { font-size: 10px; line-height: 1.8; color: var(--muted); }
.my-note, .your-answer { padding: 13px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); color: var(--muted); font-size: 12px; line-height: 1.85; white-space: pre-wrap; overflow-wrap: anywhere; }
.my-note { background: var(--purple-soft); border-color: var(--purple-soft); color: var(--purple); }
.your-answer > strong { color: var(--ink); font-weight: 650; }
.quiz-session-header { display: flex; align-items: center; justify-content: space-between; gap: 17px; flex-wrap: wrap; }
.quiz-session-header .eyebrow { margin-bottom: 6px; }
.quiz-session-header .muted { margin: 0; font-size: 11px; }
.compact-notice { padding-top: 11px; padding-bottom: 11px; font-size: 11px; }
.question-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.question-top .question-actions { margin: 0; display: flex; flex-wrap: nowrap; gap: 5px; }
.question-top .question-actions .icon-button { min-width: 44px; min-height: 44px; padding: 0; flex: 0 0 44px; }
.question-actions .button[aria-pressed="true"] { background: var(--mint); color: var(--teal); border-color: var(--mint-strong); }
.question-actions .button[data-action="flag"][aria-pressed="true"] { color: var(--purple); background: var(--purple-soft); border-color: var(--purple-soft); }
.question-number small { font-size: 10px; font-weight: 500; letter-spacing: 0; color: var(--muted); text-transform: none; }
.question-card > .question-meta { justify-content: flex-start; gap: 7px; }
.question-stem { max-width: 100%; }
.option-instruction { margin: -8px 0 17px; font-size: 11px; color: var(--muted); }
.option-state { align-self: center; flex: 0 0 auto; margin-left: auto; font-size: 9px; font-weight: 800; color: var(--teal); white-space: nowrap; }
.option.wrong .option-state { color: var(--red); }
.quiz-footer { display: flex; flex-direction: column; gap: 13px; margin-top: 25px; padding-top: 22px; border-top: 1px solid var(--line); }
.quiz-footer > .button-row { justify-content: space-between; }
.quiz-footer > .button-row:first-child { justify-content: flex-start; }
.quiz-footer > .button-row:first-child .primary { margin-left: auto; }
.keyboard-hint { text-align: center; font-size: 9px; }
.quiz-sidebar .palette { grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); max-height: 362px; margin-top: 18px; padding: 3px; overflow-y: auto; overscroll-behavior: contain; }
.quiz-sidebar .palette-button { min-width: 44px; min-height: 44px; }
.quiz-sidebar .palette-legend { margin-bottom: 18px; }
.quiz-sidebar .card-header h2 { font-size: 14px; }
.quiz-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin: 17px 0 20px; padding-top: 17px; border-top: 1px solid var(--line); text-align: center; }
.quiz-summary > span { min-width: 0; font-size: 9px; color: var(--muted); overflow-wrap: anywhere; }
.quiz-summary strong { display: block; font-size: 20px; color: var(--ink); line-height: 1.2; margin-bottom: 4px; letter-spacing: -.05em; }
.result-overview { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.result-overview p { font-size: 13px; line-height: 1.8; }
.result-overview .footer-note { font-size: 10px; }
.result-overview .chips { margin: 18px 0 0; }
.result-hero .score-ring strong { max-width: 100%; padding: 0 10px; font-size: 36px; line-height: 1.1; letter-spacing: -.06em; font-variant-numeric: tabular-nums; }
.result-actions { justify-content: flex-start; }
.review-list { display: grid; gap: 16px; }
.review-list .review-item { margin: 0; }
.review-item .bank-stem { font-size: 16px; }
.review-item > .button-row { margin-top: 15px; }
.score-example { margin-top: 21px; padding: 18px 20px; border: 1px solid var(--mint-strong); border-radius: 12px; background: var(--mint); font-size: 12px; color: var(--teal); }
.score-example > strong { font-size: 13px; }
.score-example p { margin: 8px 0 0; font-size: 12px; line-height: 1.8; }
.content-provenance { font-size: 13px; line-height: 1.9; }
.content-provenance ul { padding-left: 20px; margin-top: 15px; }
.content-provenance li { padding-left: 3px; margin-bottom: 10px; }
.guide-steps { margin: 0 0 23px; padding-left: 21px; color: var(--muted); font-size: 13px; line-height: 1.9; }
.guide-steps li { padding-left: 7px; margin-bottom: 14px; }
.guide-steps li::marker { color: var(--teal); font-weight: 800; }
.guide-steps strong { color: var(--ink); font-weight: 650; }
.setting-summary { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-top: 21px; }
.setting-summary > span { padding: 5px 8px; color: var(--teal); background: var(--mint); border-radius: 6px; font-size: 10px; font-weight: 650; }
form > .notice { margin-top: 22px; margin-bottom: 19px; }
.danger-zone { border-color: color-mix(in srgb, var(--red) 25%, var(--surface)); }
.danger-zone > h2 { color: var(--red); }
input:disabled, select:disabled { opacity: .55; cursor: not-allowed; background: var(--surface-soft); }
.table-wrap { -webkit-overflow-scrolling: touch; }
.table-wrap th[scope="row"] { white-space: normal; min-width: 135px; background: transparent; color: var(--ink); font-size: 11px; font-weight: 650; border-top: 1px solid var(--line); }

/* Small desktop / tablet */
@media (max-height: 850px) and (min-width: 901px) {
  .sidebar { padding-top: 23px; }
  .exam-label { margin-bottom: 25px; }
  .sidebar-note { margin-top: 28px; }
}
@media (min-width: 1600px) { .main-content { padding-top: 41px; } }
@media (max-width: 1220px) {
  :root { --sidebar-width: 211px; }
  .sidebar { padding-left: 13px; padding-right: 13px; }
  .brand-name { font-size: 22px; }
  .topbar { padding-left: 27px; padding-right: 27px; }
  .main-content { padding-left: 27px; padding-right: 27px; }
  .app-footer { padding-left: 27px; padding-right: 27px; }
  .hero { padding: 28px; gap: 18px; }
  .hero-art { flex-basis: 189px; }
  .daily-ring { width: 167px; height: 167px; }
  .daily-ring strong { font-size: 44px; }
  .stat-grid { gap: 11px; }
  .stat-card { padding: 17px 15px; }
  .stat-icon { width: 25px; height: 25px; right: 12px; top: 12px; }
  .dashboard-grid { grid-template-columns: minmax(0, 1.3fr) minmax(235px, 1fr); gap: 17px; }
  .topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quiz-layout { grid-template-columns: minmax(0, 1fr) 222px; gap: 16px; }
  .quiz-sidebar .card { padding: 15px; }
  .question-card { padding: 23px; }
  .palette { gap: 5px; }
  .palette-button { min-height: 44px; }
}
@media (max-width: 1050px) {
  .local-status { display: none; }
  .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
  .topic-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero-art { flex-basis: 164px; }
  .hero-art::before, .hero-art::after { display: none; }
  .daily-ring { width: 151px; height: 151px; }
  .daily-ring strong { font-size: 39px; }
  .daily-ring span { font-size: 10px; }
  .daily-ring::before { inset: 8px; }
  .hero h2 { font-size: 31px; }
  .quiz-layout { grid-template-columns: minmax(0, 1fr); }
  .quiz-sidebar { position: static; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .palette { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .palette-button { min-height: 40px; aspect-ratio: auto; }
  .form-grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  :root { --sidebar-width: 0px; }
  html { scroll-padding-top: 92px; }
  .sidebar { display: none; }
  .app-shell { margin-left: 0; }
  .topbar { min-height: 82px; padding: 15px 25px; }
  .topbar-actions { gap: 8px; }
  .topbar-kicker { font-size: 8px; }
  .mobile-resource { display: inline-flex; }
  .main-content { padding: 27px 25px 15px; }
  .mobile-nav { position: fixed; z-index: 40; bottom: 0; left: 0; right: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 5px 12px max(6px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); box-shadow: 0 -3px 25px rgb(15 38 31 / 4%); }
  .mobile-nav-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 0; min-height: 55px; padding: 5px 0; border: 0; border-radius: 10px; color: var(--faint); background: none; font-size: 9px; font-weight: 650; }
  .mobile-nav-item .icon { width: 20px; height: 20px; flex-basis: 20px; }
  .mobile-nav-item.active, .mobile-nav-item[aria-current="page"] { color: var(--teal); background: var(--mint); }
  .app-footer { padding: 20px 25px calc(97px + env(safe-area-inset-bottom)); }
  .toast { left: 50%; bottom: calc(83px + env(safe-area-inset-bottom)); }
  .topic-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero { min-height: 248px; }
  .hero-art { flex-basis: 192px; }
  .daily-ring { width: 175px; height: 175px; }
  .daily-ring strong { font-size: 46px; }
  .palette-button { min-height: 44px; }
}

/* Phone */
@media (max-width: 620px) {
  body { font-size: 14px; }
  .topbar { min-height: 76px; padding: 12px 17px; gap: 8px; }
  .topbar-heading { min-width: 0; }
  .topbar h1 { font-size: 17px; }
  .topbar-kicker { font-size: 7px; letter-spacing: .08em; margin-bottom: 4px; }
  .topbar-actions { gap: 3px; }
  .topbar .icon-button { width: 44px; height: 44px; flex-basis: 44px; border: 0; background: transparent; }
  .topbar .icon-button .icon { width: 19px; height: 19px; }
  .main-content { padding: 22px 17px 8px; }
  .main-content > * + * { margin-top: 21px; }
  .app-footer { padding-left: 18px; padding-right: 18px; font-size: 9px; }
  .page-heading { margin-bottom: 20px; }
  .page-heading h2 { font-size: 25px; }
  .page-heading h1 { font-size: 27px; }
  .page-heading p { font-size: 12px; }
  .eyebrow { font-size: 9px; }
  .hero { align-items: flex-start; flex-direction: column; min-height: auto; padding: 24px; border-radius: 19px; gap: 20px; }
  .hero h2 { max-width: 360px; font-size: 34px; }
  .hero p:not(.eyebrow) { max-width: none; font-size: 12px; margin-bottom: 18px; }
  .hero .button-row { flex-wrap: wrap; }
  .hero-art { position: static; min-height: 0; flex-basis: auto; width: 100%; height: auto; flex-direction: row; align-items: center; justify-content: flex-start; gap: 19px; padding-top: 18px; border-top: 1px solid var(--mint-strong); }
  .hero .hero-copy { width: 100%; }
  .hero-copy .button-row { padding-right: 0; }
  .hero-footnote { padding-right: 0; margin-top: 12px; font-size: 9px; }
  .hero-foot { margin-top: 17px; gap: 12px; font-size: 9px; }
  .hero-kicker { margin-bottom: 14px; }
  .daily-ring { width: 120px; height: 120px; flex: 0 0 120px; }
  .daily-ring::before { inset: 7px; }
  .ring-inner { padding: 13px; }
  .daily-ring .ring-inner strong { margin: 7px 0; font-size: 32px; letter-spacing: -.06em; }
  .daily-ring .ring-inner strong small { font-size: 13px; }
  .daily-ring .ring-caption { font-size: 6.5px; letter-spacing: .055em; }
  .ring-note { max-width: 125px; font-size: 11px; text-align: left; line-height: 1.8; }
  .ring-badge { display: none; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
  .stat-card { padding: 17px; border-radius: 14px; }
  .stat-card strong, .stat-value { font-size: 27px; }
  .stat-card .stat-label, .stat-card > p:first-child, .stat-card > .muted:first-child { font-size: 10px; padding-right: 20px; }
  .stat-card small, .stat-card .stat-detail { font-size: 9px; }
  .stat-value small { font-size: 11px; }
  .stat-card > p { font-size: 9px; }
  .stat-card .stat-label { padding-right: 0; font-size: 10px; }
  .stat-icon { width: 24px; height: 24px; top: 13px; right: 12px; border-radius: 7px; }
  .stat-icon .icon { width: 14px; height: 14px; }
  .dashboard-grid, .dashboard-grid.equal, .guide-grid { grid-template-columns: minmax(0, 1fr); gap: 19px; }
  .card { padding: 21px; border-radius: 17px; }
  .card-header, .section-head { margin-bottom: 16px; gap: 9px; }
  .card-header h2, .card-header h3, .section-head h2, .section-head h3 { font-size: 16px; }
  .card-header p, .section-head p { font-size: 11px; }
  .topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
  .topic-card { min-height: 136px; padding: 15px; gap: 10px; border-radius: 13px; }
  .topic-card h3, .topic-card strong { font-size: 12px; }
  .topic-card p, .topic-card .topic-meta { font-size: 9px; }
  .topic-content > .muted { font-size: 9px; }
  .topic-arrow { top: 13px; right: 14px; }
  .topic-card .topic-meta { flex-wrap: wrap; gap: 3px; }
  .button { font-size: 11px; padding: 11px 15px; }
  .button.large { min-height: 49px; padding: 12px 17px; font-size: 12px; }
  .button.small { font-size: 10px; }
  .form-grid, .form-grid.three { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .search-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
  .search-row > :first-child { grid-column: 1 / -1; }
  .filter-card .search-row { grid-template-columns: minmax(0, 1fr) auto; }
  .filter-card .search-row > :first-child { grid-column: auto; }
  .filter-card .search-row .button { padding-left: 13px; padding-right: 13px; }
  .chips { gap: 7px; }
  .chip { padding: 8px 11px; font-size: 10px; }
  .quiz-toolbar { padding: 12px 14px; gap: 10px; }
  .quiz-toolbar .badge { font-size: 9px; }
  .timer { font-size: 14px; }
  .question-card { padding: 22px 18px; border-radius: 17px; }
  .question-stem { font-size: 17px; line-height: 1.7; margin: 18px 0 22px; }
  .question-number { font-size: 9px; }
  .option { padding: 12px; gap: 10px; border-radius: 10px; font-size: 13px; min-height: 58px; }
  .option-letter { flex-basis: 28px; width: 28px; height: 28px; font-size: 10px; }
  .option-marker { font-size: 9px; padding-left: 2px; }
  .option-state { position: absolute; right: 12px; bottom: 9px; line-height: 1; font-size: 9px; }
  .option:has(.option-state) { padding-bottom: 29px; }
  .explanation { padding: 16px; font-size: 12px; }
  .explanation .option-explanation { font-size: 11px; }
  .question-actions { gap: 9px; }
  .question-actions .button { flex: 1; }
  .question-top { gap: 7px; margin-bottom: 13px; }
  .question-top .question-actions { gap: 2px; }
  .question-number { letter-spacing: .045em; }
  .question-number small { font-size: 9px; }
  .quiz-session-header { gap: 11px; }
  .quiz-session-header .muted { font-size: 10px; }
  .quiz-footer > .button-row:first-child { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .quiz-footer > .button-row:first-child .button { width: 100%; margin: 0; padding-left: 9px; padding-right: 9px; }
  .quiz-footer > .button-row:first-child .button:nth-child(3) { grid-column: 1 / -1; }
  .quiz-footer > .button-row:first-child .icon { width: 14px; flex-basis: 14px; }
  .keyboard-hint { display: none; }
  .quiz-sidebar { grid-template-columns: minmax(0, 1fr); }
  .quiz-sidebar .card { padding: 18px; }
  .palette { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; }
  .palette-button { min-height: 44px; aspect-ratio: auto; }
  .palette-legend { font-size: 10px; }
  .keyboard-help { display: none; }
  .result-hero { flex-direction: column; gap: 22px; padding: 25px 20px; text-align: center; }
  .result-hero .button-row { justify-content: center; }
  .result-hero h2 { font-size: 26px; }
  .result-overview .chips { justify-content: center; }
  .result-actions .button { flex: 1; }
  .result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
  .result-grid > div { padding: 17px; }
  .result-grid strong { font-size: 25px; }
  .review-item { padding: 18px; }
  .review-item h3 { font-size: 14px; }
  .bank-question { padding: 18px; }
  .bank-question .question-stem { font-size: 14px; }
  .bank-stem, .review-item .bank-stem { font-size: 15px; line-height: 1.8; }
  .bank-item, .revision-item { padding: 19px; }
  .explanation-heading > strong { font-size: 12px; }
  .option-explanation > strong, .option-explanation > p { font-size: 11px; }
  .source-details > p { font-size: 10px; }
  .guide-steps, .content-provenance { font-size: 12px; }
  .score-example { padding: 16px; }
  .setting-row { flex-wrap: wrap; gap: 13px; padding: 19px 0; }
  .setting-row > .field { width: 100%; flex: 1 0 100%; }
  .setting-row > .button-row { width: 100%; }
  .setting-row > .button-row .button { flex: 1; }
  .setting-row > :first-child { flex: 1 1 190px; }
  .setting-row:has(.switch) { flex-wrap: nowrap; }
  .notice { padding: 14px 16px; font-size: 11px; }
  .topic-progress-row { grid-template-columns: minmax(105px, 1fr) minmax(65px, .7fr) 38px; gap: 10px; font-size: 11px; }
  .topic-progress-row small { font-size: 9px; }
  .history-item { gap: 10px; }
  .history-item h4, .history-item strong { font-size: 11px; }
  .history-score strong { font-size: 15px; }
  .history-row { gap: 10px; }
  .history-icon { flex-basis: 30px; width: 30px; height: 30px; border-radius: 9px; }
  .history-info strong { font-size: 11px; }
  .history-info > .muted { font-size: 9px; }
  .history-row .history-score { font-size: 16px; }
  .history-row .history-score small { display: block; font-size: 9px; }
  .history-row > span:last-child { display: none; }
  .week-chart { gap: 11px; }
  .resume-notice { flex-wrap: wrap; gap: 13px; }
  .resume-notice .button { width: 100%; }
  th, td { padding: 11px 12px; }
  .modal { padding: 27px 22px; border-radius: 18px; }
  .modal h2 { font-size: 22px; }
  .modal p { font-size: 12px; }
  .modal .button-row .button { flex: 1; }
  .empty-state { padding: 32px 18px; }
  .empty-state p { font-size: 12px; }
}
@media (max-width: 370px) {
  .topbar { padding-left: 12px; padding-right: 10px; }
  .topbar h1 { font-size: 16px; }
  .topbar-kicker { letter-spacing: .02em; font-size: 6.5px; }
  .topbar .icon-button { width: 44px; flex-basis: 44px; }
  .main-content { padding-left: 13px; padding-right: 13px; }
  .hero { padding: 21px; }
  .hero h2 { font-size: 30px; }
  .hero-art { gap: 16px; }
  .hero-copy .button-row { padding-right: 0; }
  .hero .button { padding-left: 12px; padding-right: 12px; font-size: 10px; }
  .hero .button .icon { display: none; }
  .card { padding: 18px; }
  .stat-card { padding: 15px; }
  .topic-grid { gap: 9px; }
  .topic-card { padding: 13px; }
  .palette { gap: 7px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media print {
  :root { --canvas: white; --surface: white; --ink: #162e36; --muted: #4a5b62; --line: #cbd5cf; }
  .sidebar, .topbar, .mobile-nav, .app-footer, .toast, .button-row, .question-actions, .quiz-sidebar, .icon-button, .skip-link { display: none !important; }
  .app-shell { margin: 0; }
  .main-content { max-width: none; padding: 0; }
  .card, .question-card, .review-item, .bank-question { box-shadow: none; break-inside: avoid; }
  .dashboard-grid, .quiz-layout { display: block; }
}
