/* NCLEX QBank — shared styles. Same palette and type as the original Mini-CAT. */
:root {
  --bg: #F1F5F4; --surface: #FFFFFF; --surface-2: #F7FAF9; --ink: #0F2A2E; --muted: #57706F; --line: #D3DFDD;
  --accent: #0B6B63; --accent-ink: #085A53; --accent-soft: #E0F0ED; --on-accent: #FFFFFF;
  --pass: #1D7A3E; --pass-soft: #E3F3E8; --fail: #B0261C; --fail-soft: #FBE7E4; --warn: #9A5B00; --warn-soft: #FBF0DD;
  --f-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --f-body: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) { :root {
  --bg: #0C1618; --surface: #132225; --surface-2: #0F1C1F; --ink: #E2ECEA; --muted: #92A8A6; --line: #253A3D;
  --accent: #4FC4B4; --accent-ink: #7AD6C9; --accent-soft: #163733; --on-accent: #06201D;
  --pass: #6BD08E; --pass-soft: #14301F; --fail: #F28B80; --fail-soft: #3A1A17; --warn: #E8B35A; --warn-soft: #342812;
  color-scheme: dark } }

* { box-sizing: border-box }
html { -webkit-text-size-adjust: 100% }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--f-body) }
a { color: var(--accent-ink) }
img { max-width: 100% }
h1, h2, h3 { font-family: var(--f-display); line-height: 1.15; margin: 0 0 .5em; text-wrap: balance }
h1 { font-size: clamp(26px, 5vw, 36px); font-weight: 800; letter-spacing: -.015em }
h2 { font-size: 20px; font-weight: 700 }
h3 { font-size: 17px; font-weight: 700 }
p { margin: 0 0 1em; max-width: 70ch }
.muted { color: var(--muted) }
.small { font-size: 14px }
.label { font: 500 12px var(--f-mono); letter-spacing: .07em; text-transform: uppercase; color: var(--muted) }
.num { font-variant-numeric: tabular-nums; font-family: var(--f-mono) }
[hidden] { display: none !important }

/* Layout */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10 }
.topbar-in { max-width: 1120px; margin: 0 auto; padding: 10px max(16px, env(safe-area-inset-left)); display: flex; align-items: center; gap: 16px; flex-wrap: wrap }
.brand { font: 800 19px var(--f-display); color: var(--ink); text-decoration: none; letter-spacing: -.01em }
.brand span { color: var(--accent) }
.nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1 }
.nav a { padding: 7px 11px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 15px }
.nav a:hover { background: var(--surface-2) }
.nav a.on { background: var(--accent-soft); color: var(--accent-ink); font-weight: 700 }
.nav-right { display: flex; gap: 10px; align-items: center; font-size: 14px; color: var(--muted) }
.main { max-width: 1120px; margin: 0 auto; padding: 28px max(16px, env(safe-area-inset-right)) 64px max(16px, env(safe-area-inset-left)) }
.main.narrow { max-width: 760px }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px }
.page-head h1 { margin: 0 }
.stack { display: flex; flex-direction: column; gap: 20px }
.grid { display: grid; gap: 16px }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)) }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap }
.spread { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap }

/* Surfaces */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; min-width: 0 }
.card > h2:first-child, .card > h3:first-child { margin-top: 0 }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px }
.stat b { display: block; font: 800 28px var(--f-display); font-variant-numeric: tabular-nums; margin-top: 2px }
.stat small { color: var(--muted); font-size: 13px }

/* Status pills */
.pill { display: inline-block; font: 500 12px var(--f-mono); padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap }
.pill.ok { background: var(--pass-soft); color: var(--pass); border-color: var(--pass) }
.pill.bad { background: var(--fail-soft); color: var(--fail); border-color: var(--fail) }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn) }
.pill.info { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent) }

/* Banners */
.flash { border-radius: var(--radius); padding: 12px 16px; margin-bottom: 18px; border: 1px solid; font-size: 15px }
.flash.ok { background: var(--pass-soft); border-color: var(--pass); color: var(--ink) }
.flash.bad { background: var(--fail-soft); border-color: var(--fail); color: var(--ink) }
.flash.warn { background: var(--warn-soft); border-color: var(--warn); color: var(--ink) }
.flash ul { margin: 4px 0 0; padding-left: 20px }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: 700 15px var(--f-body); padding: 10px 18px; border-radius: 8px; border: 1.5px solid transparent; background: var(--accent); color: var(--on-accent); cursor: pointer; text-decoration: none; line-height: 1.2 }
.btn:hover { filter: brightness(1.05) }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line) }
.btn.ghost:hover { background: var(--surface-2) }
.btn.danger { background: var(--fail); color: #fff }
.btn.sm { padding: 6px 12px; font-size: 14px }
.btn:disabled { opacity: .45; cursor: not-allowed }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--accent-ink); text-decoration: underline; cursor: pointer }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; min-width: 0 }
.field label, .field .label-text { font-weight: 700; font-size: 15px }
.field .hint { color: var(--muted); font-size: 13px }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], input[type=tel], select, textarea {
  font: 16px var(--f-body); color: var(--ink); background: var(--surface); border: 1.5px solid var(--line); border-radius: 8px; padding: 10px 12px; width: 100%; max-width: 100% }
textarea { min-height: 90px; resize: vertical }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft) }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400 !important; cursor: pointer }
.check input { margin-top: 4px; accent-color: var(--accent); width: 18px; height: 18px; flex: none }
.choice-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) }
.choice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer }
.choice input { margin-top: 4px; accent-color: var(--accent); flex: none }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft) }
.choice small { display: block; color: var(--muted); font-size: 13px }
.error-text { color: var(--fail); font-size: 14px }
.form-inline { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end }
.form-inline .field { margin: 0; flex: 1 1 180px }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface) }
table { width: 100%; border-collapse: collapse; font-size: 15px }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top }
th { font: 500 12px var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); white-space: nowrap; background: var(--surface-2) }
tbody tr:last-child td { border-bottom: 0 }
td.nowrap, th.nowrap { white-space: nowrap }
.truncate { max-width: 520px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical }

/* Subject bars */
.areas { display: flex; flex-direction: column; gap: 14px }
.area { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center }
.area .scale { grid-column: 1 / -1; position: relative; height: 10px; border-radius: 5px; background: linear-gradient(90deg, var(--fail-soft), var(--warn-soft) 50%, var(--pass-soft)); border: 1px solid var(--line) }
.area .scale i { position: absolute; left: 50%; top: -4px; bottom: -4px; width: 2px; background: var(--warn); transform: translateX(-1px) }
.area .scale b { position: absolute; top: 50%; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--surface); transform: translate(-50%, -50%) }
.area.strong .scale b { background: var(--pass) } .area.close .scale b { background: var(--warn) } .area.weak .scale b { background: var(--fail) }
.area .meta { font: 13px var(--f-mono); color: var(--muted); text-align: right }

/* Progress meter */
.meter { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden }
.meter i { display: block; height: 100%; background: var(--accent) }

/* Practice */
.q-top { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; margin-bottom: 10px }
.stem { font-size: 19px; line-height: 1.55; margin: 6px 0 6px; max-width: none }
.instr { color: var(--accent-ink); font-weight: 700; font-size: 15px; margin-bottom: 16px }
.opts { display: flex; flex-direction: column; gap: 10px; margin-bottom: 22px }
.opt { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius); cursor: pointer }
.opt input { position: absolute; opacity: 0; pointer-events: none }
.opt .mark { flex: none; width: 26px; height: 26px; border: 2px solid var(--muted); display: grid; place-items: center; font: 500 12px var(--f-mono); color: var(--muted); border-radius: 50% }
.opt.multi .mark { border-radius: 6px }
.opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft) }
.opt:has(input:checked) .mark { background: var(--accent); border-color: var(--accent); color: var(--on-accent) }
.opt:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px }
.opt.right { border-color: var(--pass); background: var(--pass-soft) }
.opt.wrong { border-color: var(--fail); background: var(--fail-soft) }
.opt.missed { border-style: dashed; border-color: var(--pass) }
.opt.static { cursor: default }
.feedback { border-left: 4px solid var(--line); background: var(--surface); padding: 14px 16px; border-radius: 0 var(--radius) var(--radius) 0; margin-bottom: 20px }
.feedback.ok { border-color: var(--pass) } .feedback.no { border-color: var(--fail) }
.feedback b { display: block; margin-bottom: 4px }
.feedback p { margin: 0 }

/* Review list */
.review details { border-top: 1px solid var(--line); padding: 12px 0 }
.review details:first-child { border-top: 0 }
.review summary { display: flex; gap: 10px; align-items: baseline; cursor: pointer; list-style: none }
.review summary::-webkit-details-marker { display: none }
.review .dot { flex: none; font: 500 12px var(--f-mono); padding: 2px 7px; border-radius: 4px }
.review .dot.ok { background: var(--pass-soft); color: var(--pass) } .review .dot.no { background: var(--fail-soft); color: var(--fail) } .review .dot.skip { background: var(--surface-2); color: var(--muted) }
.review ul { margin: 10px 0; padding-left: 20px; font-size: 15px }
.review li.c { color: var(--pass); font-weight: 700 }
.review li.x { color: var(--fail); text-decoration: line-through }
.review .rat { font-size: 15px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px }

/* Chart */
.bars { display: flex; align-items: flex-end; gap: 4px; height: 110px; padding-top: 6px }
.bars div { flex: 1; min-width: 6px; background: var(--accent-soft); border-radius: 3px 3px 0 0; position: relative; display: flex; flex-direction: column; justify-content: flex-end }
.bars div span { display: block; background: var(--accent); border-radius: 3px 3px 0 0 }
.bars-x { display: flex; justify-content: space-between; font: 12px var(--f-mono); color: var(--muted); margin-top: 6px }

.days-left { text-align: right }
@media (max-width: 640px) { .days-left { text-align: left } }

/* Auth pages */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px }
.auth .card { width: 100%; max-width: 420px; padding: 28px }

.pagination { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 16px }
.pagination a, .pagination span { padding: 6px 11px; border: 1px solid var(--line); border-radius: 6px; text-decoration: none; font-size: 14px; color: var(--ink); background: var(--surface) }
.pagination .active { background: var(--accent); color: var(--on-accent); border-color: var(--accent) }
.pagination .disabled { color: var(--muted) }

@media (max-width: 640px) {
  .nav { order: 3; flex-basis: 100%; overflow-x: auto; flex-wrap: nowrap }
  .nav a { white-space: nowrap }
  .card { padding: 16px }
  .stem { font-size: 17px }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important } }

/* Study section */
:root { --low: #3F7FB5 }
@media (prefers-color-scheme: dark) { :root { --low: #7FB0DE } }
.study-wrap { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 24px; align-items: start }
.study-side { position: sticky; top: 72px; max-height: calc(100vh - 90px); overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 10px }
.study-side summary { font-weight: 700; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; padding: 2px 6px }
.study-side summary::-webkit-details-marker { display: none }
.study-prog { margin: 10px 6px 4px }
.study-part { font: 500 11px var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 14px 6px 4px }
.study-list { list-style: none; margin: 0; padding: 0 }
.study-list li { display: flex; gap: 8px; align-items: baseline; padding: 5px 6px; border-radius: 7px; font-size: 14px; line-height: 1.35 }
.study-list .n { font: 500 11px var(--f-mono); color: var(--muted); flex: none; width: 20px }
.study-list a { color: var(--ink); text-decoration: none; flex: 1; min-width: 0 }
.study-list a:hover { text-decoration: underline }
.study-list .t { flex: 1; min-width: 0 }
.study-list .s { font: 500 10px var(--f-mono); color: var(--muted); text-transform: uppercase }
.study-list li.soon { color: var(--muted) }
.study-list li.current { background: var(--accent-soft) }
.study-list li.current a { color: var(--accent-ink); font-weight: 700 }
.study-list li.done a::after { content: " ✓"; color: var(--pass) }
.chapter-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)) }
.chapter-card { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); background: var(--surface-2) }
a.chapter-card:hover { border-color: var(--accent) }
.chapter-card.soon { opacity: .6 }
.chapter { padding: 28px clamp(18px, 4vw, 44px) 36px }
.chapter .lede { color: var(--muted); font-size: 17px }
.chapter-body section { padding-top: 18px }
.chapter-body h2 { font-size: 23px; margin: 8px 0 10px }
.chapter-body h3 { margin: 14px 0 6px }
.chapter-body ul, .chapter-body ol { padding-left: 20px; margin: 6px 0 12px }
.chapter-body p, .chapter-body li { max-width: 70ch }
.chapter-body table { min-width: 480px }
.chapter-body .two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 4px 24px }
.callout { border-radius: 10px; padding: 12px 16px; margin: 14px 0; border: 1px solid var(--line); border-left-width: 5px; background: var(--surface-2); max-width: 74ch }
.callout > b:first-child { display: block; font: 500 11px var(--f-mono); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 3px }
.callout.priority { border-left-color: var(--fail); background: var(--fail-soft) } .callout.priority > b:first-child { color: var(--fail) }
.callout.warn { border-left-color: var(--warn); background: var(--warn-soft) } .callout.warn > b:first-child { color: var(--warn) }
.callout.tip { border-left-color: var(--accent); background: var(--accent-soft) } .callout.tip > b:first-child { color: var(--accent-ink) }
.callout.key { border-left-color: var(--pass); background: var(--pass-soft) } .callout.key > b:first-child { color: var(--pass) }
.imbalance { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 14px; margin: 10px 0 }
.imb { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; background: var(--surface-2); min-width: 0 }
.imb h3 { margin-top: 0; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: baseline }
.imb h3 span { font: 500 12px var(--f-mono); color: var(--muted) }
.imb.low { border-top: 4px solid var(--low) } .imb.high { border-top: 4px solid var(--fail) }
.imb p { margin: 0 0 8px; font-size: 15px }
.selfcheck { border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; margin-bottom: 10px; background: var(--surface-2) }
.selfcheck summary { cursor: pointer; font-weight: 700 }
.selfcheck p { margin: 10px 0 0 }
.chapter-end { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; gap: 12px; flex-wrap: wrap }
.chapter-nav { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 20px; font-size: 15px }
@media (max-width: 900px) { .study-wrap { grid-template-columns: 1fr } .study-side { position: static; max-height: none } }

/* ===== Phase 2 ===== */
.main.wide { max-width: 1240px }
.btn.lg { padding: 13px 22px; font-size: 16px }
.btn.block { width: 100%; justify-content: center }
.nav .count { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--warn); color: #fff; font: 700 12px/20px var(--f-body); text-align: center }
.stat.link { text-decoration: none; color: var(--ink) } .stat.link:hover { border-color: var(--accent) } .stat.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent) }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 }
.facts dt { font: 500 12px var(--f-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding-top: 3px }
.facts dd { margin: 0 }
.receipt { max-width: 100%; max-height: 520px; border: 1px solid var(--line); border-radius: 8px; display: block }
.pay-details { white-space: normal; font-size: 16px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px }
.notes { background: var(--warn-soft); border: 1px solid var(--warn); border-radius: 8px; padding: 10px 12px }
.chapter-card.locked { opacity: .78 } .chapter-card.locked b { color: var(--muted) }
.free-card { border-color: var(--accent); background: linear-gradient(0deg, var(--surface), var(--surface)), var(--accent-soft) }

/* Feedback states incl. partial credit */
.feedback.part { border-color: var(--warn) }
.review .dot.part { background: var(--warn-soft); color: var(--warn) }
.rationale { white-space: normal }
.small-stem { font-size: 17px }

/* NGN items */
.item { margin-bottom: 18px }
.ngn-table { font-size: 15px }
.ngn-table th { white-space: normal }
.ngn-table td, .ngn-table th { vertical-align: middle }
.matrix th[scope=row], .matrix tbody th { font: 400 15px var(--f-body); text-transform: none; letter-spacing: 0; color: var(--ink); background: var(--surface); min-width: 180px }
.matrix .c { text-align: center; width: 1%; white-space: nowrap }
.matrix td.c { padding: 0 }
.matrix .cell { display: flex; align-items: center; justify-content: center; padding: 12px 18px; cursor: pointer; min-height: 46px }
.matrix .cell input { width: 20px; height: 20px; accent-color: var(--accent); cursor: pointer }
.matrix td.right { background: var(--pass-soft) } .matrix td.wrong { background: var(--fail-soft) } .matrix td.missed { box-shadow: inset 0 0 0 2px var(--pass) }
.matrix tbody tr:hover td, .matrix tbody tr:hover th { background: var(--surface-2) }
.cloze { font-size: 18px; line-height: 2.2; max-width: none }
.dd { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; vertical-align: middle; margin: 0 2px }
.dd select { width: auto; min-width: 150px; max-width: 100%; padding: 5px 30px 5px 10px; font-size: 16px; border-width: 1.5px; border-color: var(--accent) }
.dd.right select { border-color: var(--pass); background-color: var(--pass-soft) }
.dd.wrong select { border-color: var(--fail); background-color: var(--fail-soft) }
.key { font-size: 13px; font-weight: 700; color: var(--pass); background: var(--pass-soft); border-radius: 6px; padding: 1px 7px; line-height: 1.5 }
.key::before { content: "✓ " }
.tokens { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px; background: var(--surface-2); border: 1px dashed var(--line); border-radius: var(--radius); margin-bottom: 14px }
.token { font: 15px var(--f-body); padding: 7px 12px; border-radius: 8px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); cursor: grab }
.token:hover { border-color: var(--accent) }
.token.held { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent-soft) }
.token:disabled { opacity: .35; cursor: default }
.dz { display: inline-flex; align-items: center; min-width: 150px; min-height: 36px; padding: 3px 12px; margin: 2px; border: 2px dashed var(--accent); border-radius: 8px; background: var(--surface); vertical-align: middle; cursor: pointer; line-height: 1.4 }
.dz .dz-text { color: var(--muted); font-size: 15px }
.dz.filled { border-style: solid; background: var(--accent-soft) } .dz.filled .dz-text { color: var(--ink) }
.dz.over { background: var(--accent-soft) }
.dz.right { border: 2px solid var(--pass); background: var(--pass-soft) } .dz.wrong { border: 2px solid var(--fail); background: var(--fail-soft) }
.hl-text { font-size: 17px; line-height: 2; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px }
.hl { cursor: pointer; border-radius: 4px; padding: 1px 2px; transition: background .1s }
.hl input { position: absolute; opacity: 0; pointer-events: none }
.hl span { border-bottom: 1px dotted var(--muted) }
.hl:hover span { background: var(--warn-soft) }
.hl:has(input:checked) span { background: #FFE58A; color: #1a1a1a; border-bottom-color: transparent }
.hl:has(input:focus-visible) { outline: 2px solid var(--accent) }
.hl.right span { background: var(--pass-soft); color: var(--ink); outline: 2px solid var(--pass) }
.hl.wrong span { background: var(--fail-soft); color: var(--ink); text-decoration: line-through }
.hl.missed span { outline: 2px dashed var(--pass) }
.hl-table .hl-check { width: 1%; text-align: center }
.hl-table input { width: 18px; height: 18px; accent-color: var(--accent) }
.hl-table label { cursor: pointer }
.hl-row:has(input:checked) td { background: #FFF6CC; color: #1a1a1a }
.hl-row.right td { background: var(--pass-soft) } .hl-row.wrong td { background: var(--fail-soft) } .hl-row.missed td { box-shadow: inset 0 2px 0 var(--pass), inset 0 -2px 0 var(--pass) }
.bt-diagram { display: grid; grid-template-columns: 1fr 1.2fr 1fr; gap: 14px; align-items: center; margin-bottom: 18px; padding: 16px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius) }
.bt-col { display: flex; flex-direction: column; gap: 10px; text-align: center }
.bt-box { min-height: 48px; border: 2px dashed var(--line); border-radius: 8px; padding: 8px; font-size: 14px; display: flex; align-items: center; justify-content: center; background: var(--surface) }
.bt-box.big { min-height: 70px; border-color: var(--accent) }
.bt-box.filled { border-style: solid; border-color: var(--accent); background: var(--accent-soft) }
.bt-cap { font: 500 11px var(--f-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted) }
.bt-lists { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px }
.bt-list, .group { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px 4px; margin: 0; min-width: 0 }
.bt-list legend, .group legend { font-weight: 700; padding: 0 6px }
.bt-list .opt, .groups .opt { padding: 9px 11px; font-size: 15px }
.groups { display: grid; gap: 14px }
.shake { animation: shake .35s }
@keyframes shake { 25% { transform: translateX(-4px) } 75% { transform: translateX(4px) } }

/* Case study / exhibits */
.case-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px }
@media (min-width: 980px) { .case-layout { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr) } .case-record { position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow: auto } }
.case-record { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px }
.exhibits .ex-tabs { display: none; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 12px }
.exhibits.js .ex-tabs { display: flex }
.exhibits.js .ex-title { display: none }
.ex-tab { font: 700 14px var(--f-body); background: none; border: 0; border-bottom: 3px solid transparent; padding: 8px 10px; color: var(--muted); cursor: pointer }
.ex-tab[aria-selected=true] { color: var(--accent-ink); border-bottom-color: var(--accent) }
.ex-title { font-size: 15px; margin: 12px 0 6px }
.ex-text { font-size: 15px; line-height: 1.6 }
.ex-panel .table-wrap { margin-bottom: 8px }
.ex-panel table { font-size: 14px }
.ex-panel td { padding: 7px 10px; white-space: nowrap }
.ex-details { margin: 8px 0 12px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px }
.ex-details summary { cursor: pointer; color: var(--accent-ink); font-weight: 700 }
.review-item .rat { margin-top: 10px; font-size: 15px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px }
.decision textarea { min-height: 80px }

/* Pricing cards */
.price-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; align-items: stretch }
.price { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px 20px; display: flex; flex-direction: column; gap: 6px }
.price.featured { border: 2px solid var(--accent); box-shadow: 0 10px 30px -18px var(--accent) }
.price .badge { position: absolute; top: -12px; left: 20px; background: var(--accent); color: var(--on-accent); font: 700 12px var(--f-body); padding: 3px 10px; border-radius: 999px }
.price h3 { margin: 0 }
.price .amount { font: 800 30px var(--f-display); letter-spacing: -.01em }
.price .save { color: var(--pass) }
.price .ticks { list-style: none; padding: 0; margin: 10px 0 14px; font-size: 15px; flex: 1 }
.price .ticks li { padding: 3px 0 3px 22px; position: relative }
.price .ticks li::before { content: "✓"; position: absolute; left: 0; color: var(--pass); font-weight: 700 }

/* Public site */
body.public { background: var(--surface) }
.pub-in { max-width: 1120px; margin: 0 auto; padding: 0 max(16px, env(safe-area-inset-left)) }
.narrow-in { max-width: 780px }
.pub-top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line) }
.pub-top .pub-in { display: flex; align-items: center; gap: 18px; padding-top: 12px; padding-bottom: 12px }
.pub-nav { display: flex; gap: 18px; flex: 1 }
.pub-nav a { color: var(--ink); text-decoration: none; font-size: 15px }
.pub-nav a:hover { color: var(--accent-ink) }
@media (max-width: 720px) { .pub-nav { display: none } .pub-top .pub-in > .row { margin-left: auto } }
.hero { padding: 56px 0 44px; background: radial-gradient(1200px 400px at 85% -10%, var(--accent-soft), transparent 70%) }
.hero-grid { display: grid; gap: 36px; grid-template-columns: minmax(0, 1fr) }
@media (min-width: 940px) { .hero-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); align-items: center } }
.hero h1 { font-size: clamp(30px, 5.2vw, 50px); line-height: 1.06; margin: 10px 0 16px; max-width: 18ch }
.lede { font-size: 18px; color: var(--muted); max-width: 56ch; margin-bottom: 22px }
.hero-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; box-shadow: 0 24px 48px -32px rgba(11, 107, 99, .55); transform: rotate(.6deg) }
.matrix.demo { border: 1px solid var(--line); border-radius: 8px; overflow: hidden }
.matrix.demo td.c { padding: 10px 14px }
.cell-dot { display: inline-block; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); vertical-align: middle }
.cell-dot.on { border-color: var(--pass); background: radial-gradient(circle, var(--pass) 45%, transparent 50%) }
.pub-band { background: var(--ink); color: var(--bg) }
.proof { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; padding-top: 26px; padding-bottom: 26px }
.proof b { display: block; font: 800 32px var(--f-display); color: #fff }
.proof span { font-size: 14px; opacity: .8 }
@media (prefers-color-scheme: dark) { .pub-band { background: var(--surface-2); color: var(--ink) } .proof b { color: var(--accent) } }
.pub-sec { padding: 60px 0 }
.pub-sec.alt { background: var(--bg) }
.sec-title { font-size: clamp(24px, 3.6vw, 34px); margin-bottom: 10px }
.sec-sub { color: var(--muted); max-width: 64ch; margin-bottom: 26px }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin-top: 22px }
.step { border: 1px solid var(--line); border-radius: 14px; padding: 20px; background: var(--surface) }
.step .n { display: inline-flex; width: 34px; height: 34px; align-items: center; justify-content: center; border-radius: 50%; background: var(--accent); color: var(--on-accent); font: 800 16px var(--f-display); margin-bottom: 10px }
.step p, .feature p { color: var(--muted); font-size: 15px; margin: 0 }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 22px }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px }
.feature h3 { margin-bottom: 6px }
.faq { border-bottom: 1px solid var(--line); padding: 14px 0 }
.faq summary { cursor: pointer; font-weight: 700; font-size: 17px; list-style: none; display: flex; justify-content: space-between; gap: 12px }
.faq summary::after { content: "+"; color: var(--accent); font-weight: 800 }
.faq[open] summary::after { content: "–" }
.faq summary::-webkit-details-marker { display: none }
.faq p { margin: 10px 0 0; color: var(--muted) }
.pub-sec.cta { background: var(--accent-soft) }
.pub-foot { border-top: 1px solid var(--line); padding: 32px 0 40px; background: var(--bg) }
.foot-cols { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 14px }
.foot-cols nav { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start }
.legal { font-size: 12.5px; color: var(--muted); max-width: 90ch; margin: 6px 0 }
.policy h2 { margin-top: 26px }
/* Review marking must win over the "selected" look */
.opt.right, .opt.right:has(input:checked) { border-color: var(--pass); background: var(--pass-soft) }
.opt.wrong, .opt.wrong:has(input:checked) { border-color: var(--fail); background: var(--fail-soft) }
.opt.wrong:has(input:checked) .mark { background: var(--fail); border-color: var(--fail) }
.opt.right:has(input:checked) .mark { background: var(--pass); border-color: var(--pass) }
.hl { padding: 0 1px }
.hl.right span, .hl.right:has(input:checked) span { background: var(--pass-soft); color: var(--ink); outline: 2px solid var(--pass); text-decoration: none }
.hl.wrong span, .hl.wrong:has(input:checked) span { background: var(--fail-soft); color: var(--ink); outline: 2px solid var(--fail); text-decoration: line-through }
.hl.missed span { background: transparent; outline: 2px dashed var(--pass) }
.hl-row.right td, .hl-row.right:has(input:checked) td { background: var(--pass-soft); color: var(--ink) }
.hl-row.wrong td, .hl-row.wrong:has(input:checked) td { background: var(--fail-soft); color: var(--ink) }
.mark-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin: -6px 0 14px }
.mark-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -1px }
.matrix thead th.c { white-space: normal; min-width: 96px; max-width: 160px; text-align: center }

/* Report a problem (under each question) */
.report-q { margin-top: 18px; border-top: 1px dashed var(--line, #ddd); padding-top: 10px }
.report-q summary { cursor: pointer; color: var(--muted, #666) }
.report-q form { display: grid; gap: 8px; margin-top: 8px; max-width: 560px; justify-items: start }
.report-q textarea { width: 100% }
