/* AI Calibrate components. Prefix: ac-. Every value comes from tokens.css. */

/* ---------- base ---------- */
html { color-scheme: light; }
[data-theme="dark"] { color-scheme: dark; }
body { margin: 0; background: var(--surface); color: var(--ink); font-family: var(--font-sans); font-size: 16px; line-height: 24px; -webkit-font-smoothing: antialiased; }
*, *::before, *::after { box-sizing: border-box; }
.ac-mono, .display, .heading, .subheading, .label, .score, .timer, .stat, .counter, .code, .code-inline { font-stretch: 87.5%; font-variation-settings: "wdth" 87.5; font-variant-numeric: tabular-nums; }
.label { text-transform: uppercase; }
.code { font-stretch: 75%; font-variation-settings: "wdth" 75; }
.ac-surface { background: var(--surface); color: var(--ink); }
.ac-muted { color: var(--ink-muted); }
.ac-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ac-icon { width: 20px; height: 20px; flex: none; display: inline-block; vertical-align: middle; }
.ac-icon svg { width: 100%; height: 100%; display: block; }
.ac-icon-24 { width: 24px; height: 24px; }
.ac-icon-16 { width: 16px; height: 16px; }
a, .ac-link { color: var(--ink-brand); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover, .ac-link:hover { color: var(--brand-hover); text-decoration-thickness: 2px; }
:where(a, button, input, summary, textarea, [tabindex]):focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.ac-rule { border: 0; border-top: 3px solid var(--rule); margin: 0; }
.ac-hair { border: 0; border-top: 1px solid var(--line); margin: 0; }
.ac-eyebrow { font-family: var(--font-mono); font-stretch: 87.5%; font-variation-settings: "wdth" 87.5; font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-muted); margin: 0; }
.ac-eyebrow--brand { color: var(--ink-brand); }
.ac-h1 { font-family: var(--font-mono); font-stretch: 87.5%; font-variation-settings: "wdth" 87.5; font-size: 32px; line-height: 36px; font-weight: 600; letter-spacing: -0.02em; margin: 0; }
.ac-h2 { font-family: var(--font-mono); font-stretch: 87.5%; font-variation-settings: "wdth" 87.5; font-size: 20px; line-height: 28px; font-weight: 600; letter-spacing: -0.01em; margin: 0; }
.ac-h3 { font-family: var(--font-mono); font-stretch: 87.5%; font-variation-settings: "wdth" 87.5; font-size: 15px; line-height: 22px; font-weight: 600; margin: 0; }
.ac-p { margin: 0; max-width: var(--measure); }
.ac-small { font-size: 14px; line-height: 20px; }
.ac-titleblock { display: flex; flex-direction: column; gap: var(--space-2); padding-bottom: var(--space-4); border-bottom: 3px solid var(--rule); }

/* inline code */
code, .ac-ic { font-family: var(--font-mono); font-stretch: 87.5%; font-variation-settings: "wdth" 87.5; font-size: 0.82em; font-weight: 400; background: var(--surface-code-inline); border: 1px solid var(--line); border-radius: var(--radius-1); padding: 0 4px; white-space: normal; overflow-wrap: anywhere; -webkit-box-decoration-break: clone; box-decoration-break: clone; color: var(--ink); }

/* ---------- buttons ---------- */
.ac-btn { appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: 48px; min-width: var(--touch-min); padding: 0 var(--space-5); border-radius: var(--radius-1); border: 2px solid transparent; font-family: var(--font-mono); font-stretch: 87.5%; font-variation-settings: "wdth" 87.5; font-size: 14px; line-height: 20px; font-weight: 600; text-decoration: none; cursor: pointer; transition: background-color var(--dur-fast) var(--ease-standard), border-color var(--dur-fast) var(--ease-standard), color var(--dur-fast) var(--ease-standard); }
.ac-btn--primary { background: var(--brand); color: var(--on-brand); }
.ac-btn--primary:hover { background: var(--brand-hover); color: var(--on-brand); }
.ac-btn--secondary { background: transparent; color: var(--ink); border-color: var(--ink); }
.ac-btn--secondary:hover { background: var(--surface-sunken); color: var(--ink); }
.ac-btn--quiet { background: transparent; color: var(--ink-brand); padding: 0 var(--space-3); text-decoration: underline; text-underline-offset: 4px; }
.ac-btn--quiet:hover { color: var(--brand-hover); background: var(--brand-tint); }
.ac-btn--block { width: 100%; }
.ac-btn--sm { min-height: var(--touch-min); padding: 0 var(--space-4); font-size: 13px; }
.ac-btn--icon { padding: 0; width: var(--touch-min); min-height: var(--touch-min); background: transparent; color: var(--ink); border-color: transparent; }
.ac-btn--icon:hover { background: var(--surface-sunken); }
.ac-btn:disabled, .ac-btn[aria-disabled="true"] { background: var(--surface-sunken); color: var(--ink-disabled); border-color: transparent; cursor: not-allowed; }
.ac-btn[aria-busy="true"] { cursor: progress; }
.ac-btn[aria-pressed="true"] { background: var(--ink); color: var(--surface-raised); border-color: var(--ink); }
.ac-busy { display: inline-flex; gap: 3px; align-items: flex-end; height: 14px; }
.ac-busy i { width: 3px; height: 6px; background: currentColor; animation: ac-tick 900ms var(--ease-standard) infinite; }
.ac-busy i:nth-child(2) { animation-delay: 150ms; } .ac-busy i:nth-child(3) { animation-delay: 300ms; }
@keyframes ac-tick { 0%, 100% { height: 4px; } 50% { height: 14px; } }
.ac-btnrow { display: flex; gap: var(--space-3); flex-wrap: wrap; align-items: center; }

/* ---------- logo / top bar / theme switch ---------- */
.ac-logo { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.ac-logo:hover { color: var(--ink); }
.ac-logo svg { width: 28px; height: 28px; flex: none; }
.ac-logo .arc { stroke: var(--ink); } .ac-logo .ndl { stroke: var(--brand); } .ac-logo .hub { fill: var(--brand); }
.ac-logo b { font-family: var(--font-mono); font-stretch: 87.5%; font-variation-settings: "wdth" 87.5; font-weight: 600; font-size: 15px; letter-spacing: -0.01em; line-height: 1; white-space: nowrap; }
.ac-logo .ac-examlabel { font-family: var(--font-mono); font-stretch: 87.5%; font-variation-settings: "wdth" 87.5; font-size: 13px; letter-spacing: 0.04em; color: var(--ink-brand); padding-left: 10px; border-left: 2px solid var(--line); line-height: 18px; }
.ac-topbar { position: sticky; top: 0; z-index: 10; height: var(--topbar-h); display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: 0 var(--space-2) 0 var(--space-4); background: var(--surface-raised); border-bottom: 1px solid var(--line); }
.ac-topnav { display: none; gap: var(--space-1); margin-left: var(--space-6); flex: 1; }
.ac-topnav a { display: inline-flex; align-items: center; min-height: var(--touch-min); padding: 0 var(--space-3); font-family: var(--font-mono); font-stretch: 87.5%; font-variation-settings: "wdth" 87.5; font-size: 14px; font-weight: 500; color: var(--ink-muted); text-decoration: none; border-bottom: 3px solid transparent; }
.ac-topnav a:hover { color: var(--ink); }
.ac-topnav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--brand); }
.ac-topbar__end { display: flex; align-items: center; gap: var(--space-2); }
.ac-account { display: none; width: var(--touch-min); height: var(--touch-min); border: 1px dashed var(--line-strong); align-items: center; justify-content: center; color: var(--ink-muted); }
.ac-theme { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius-1); padding: 1px; background: var(--surface-raised); }
.ac-theme button { appearance: none; width: 42px; height: 40px; border: 0; background: transparent; color: var(--ink-muted); display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-1); cursor: pointer; }
.ac-theme button:hover { color: var(--ink); background: var(--surface-sunken); }
.ac-theme button[aria-checked="true"] { background: var(--ink); color: var(--surface-raised); }

/* ---------- bottom tab bar ---------- */
.ac-tabbar { position: sticky; bottom: 0; z-index: 10; display: grid; grid-template-columns: repeat(4, 1fr); min-height: var(--tabbar-h); padding-bottom: env(safe-area-inset-bottom); background: var(--surface-raised); box-shadow: var(--elev-bar); }
.ac-tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: var(--tabbar-h); color: var(--ink-muted); text-decoration: none; font-family: var(--font-mono); font-stretch: 87.5%; font-variation-settings: "wdth" 87.5; font-size: 12px; line-height: 16px; font-weight: 500; border-top: 3px solid transparent; }
.ac-tabbar a:hover { color: var(--ink); }
.ac-tabbar a[aria-current="page"] { color: var(--ink-brand); border-top-color: var(--brand); font-weight: 600; }

/* ---------- footer / disclaimer ---------- */
.ac-disclaimer { font-size: 14px; line-height: 20px; color: var(--ink-muted); margin: 0; }
.ac-footer { padding: var(--space-6) var(--space-4); border-top: 3px solid var(--rule); display: flex; flex-direction: column; gap: var(--space-3); background: var(--surface); }
.ac-footer nav { display: flex; flex-wrap: wrap; gap: 0 var(--space-4); }
.ac-footer nav a { display: inline-flex; align-items: center; min-height: var(--touch-min); font-size: 14px; color: var(--ink); }

/* ---------- cards / stat card ---------- */
.ac-card { background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-0); padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-3); }
.ac-stat { background: var(--surface-raised); border: 1px solid var(--line); padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
.ac-stat__value { font-family: var(--font-mono); font-stretch: 87.5%; font-variation-settings: "wdth" 87.5; font-variant-numeric: tabular-nums; font-size: 28px; line-height: 32px; font-weight: 500; letter-spacing: -0.02em; }
.ac-stat__value small { font-size: 14px; color: var(--ink-muted); letter-spacing: 0; }
.ac-stat__ctx { font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.ac-statgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; }
.ac-statgrid .ac-stat + .ac-stat { border-left: 0; }
.ac-statgrid .ac-stat:nth-child(2n+1) { border-left: 1px solid var(--line); }
.ac-statgrid .ac-stat:nth-child(n+3) { border-top: 0; }

/* ---------- tags & badges ---------- */
.ac-tag { display: inline-flex; align-items: center; gap: var(--space-1); height: 22px; padding: 0 6px; border: 1px solid var(--line-strong); border-radius: var(--radius-1); font-family: var(--font-mono); font-stretch: 87.5%; font-variation-settings: "wdth" 87.5; font-size: 12px; line-height: 16px; font-weight: 500; color: var(--ink); background: var(--surface-raised); white-space: nowrap; }
.ac-tag--correct { color: var(--correct); border-color: var(--correct); }
.ac-tag--incorrect { color: var(--incorrect); border-color: var(--incorrect); }
.ac-tag--flagged { color: var(--flagged); border-color: var(--flagged); }
.ac-tag--brand { color: var(--ink-brand); border-color: var(--brand); }
.ac-choose { display: inline-flex; align-items: center; gap: var(--space-2); padding: 4px 8px; background: var(--ink); color: var(--surface-raised); font-family: var(--font-mono); font-stretch: 87.5%; font-variation-settings: "wdth" 87.5; font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; border-radius: var(--radius-1); }
.ac-choose i { display: inline-block; width: 9px; height: 9px; border: 1.5px solid currentColor; }

/* readiness badge: pips + word, never colour alone */
.ac-ready { display: inline-flex; align-items: center; gap: var(--space-2); font-family: var(--font-mono); font-stretch: 87.5%; font-variation-settings: "wdth" 87.5; font-size: 12px; line-height: 16px; font-weight: 500; color: var(--ink); white-space: nowrap; }
.ac-pips { display: inline-flex; gap: 2px; }
.ac-pips i { width: 8px; height: 12px; border: 1.5px solid var(--line-strong); background: transparent; }
.ac-ready[data-level="1"] .ac-pips i:nth-child(-n+1) { background: var(--ready-1); border-color: var(--ready-2); }
.ac-ready[data-level="2"] .ac-pips i:nth-child(-n+2) { background: var(--ready-2); border-color: var(--ready-2); }
.ac-ready[data-level="3"] .ac-pips i { background: var(--ready-3); border-color: var(--ready-3); }
.ac-ready[data-level="none"] .ac-pips i { border-style: dashed; border-color: var(--ready-none); }
.ac-ready[data-level="none"] { color: var(--ink-muted); }

/* readiness bar (segmented 3) */
.ac-rbar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; width: 100%; height: 8px; }
.ac-rbar i { background: var(--ready-0); }
.ac-rbar[data-level="1"] i:nth-child(1) { background: var(--ready-1); }
.ac-rbar[data-level="2"] i:nth-child(-n+2) { background: var(--ready-2); }
.ac-rbar[data-level="3"] i { background: var(--ready-3); }
.ac-rbar[data-level="none"] i { background: transparent; border: 1px dashed var(--ready-none); }

/* ---------- progress / stepper ---------- */
.ac-progress { display: flex; flex-direction: column; gap: var(--space-1); }
.ac-progress__meta { display: flex; justify-content: space-between; font-family: var(--font-mono); font-stretch: 87.5%; font-variation-settings: "wdth" 87.5; font-variant-numeric: tabular-nums; font-size: 13px; line-height: 20px; font-weight: 500; color: var(--ink-muted); }
.ac-progress__meta b { color: var(--ink); font-weight: 600; }
.ac-progress__track { height: 6px; background: var(--chart-track); position: relative; overflow: hidden; }
.ac-progress__fill { position: absolute; inset: 0 auto 0 0; background: var(--brand); transition: width var(--dur-slow) var(--ease-standard); }
.ac-stepper { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; height: 6px; }
.ac-stepper i { background: var(--chart-track); }
.ac-stepper i[data-s="done"] { background: var(--ink-muted); }
.ac-stepper i[data-s="current"] { background: var(--brand); outline: 1px solid var(--brand); outline-offset: 1px; }

/* ---------- timer ---------- */
.ac-timer { display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--touch-min); padding: 0 var(--space-3); font-family: var(--font-mono); font-stretch: 87.5%; font-variation-settings: "wdth" 87.5; font-variant-numeric: tabular-nums; font-size: 20px; line-height: 24px; font-weight: 500; color: var(--ink); border: 1px solid var(--line); background: var(--surface-raised); }
.ac-timer__lbl { font-size: 12px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-muted); }
.ac-timer[data-state="warning"] { background: var(--flagged-tint); color: var(--flagged); border-color: var(--flagged); font-size: 24px; font-weight: 600; }
.ac-timer[data-state="warning"] .ac-timer__lbl { color: var(--flagged); }
.ac-timer[data-state="paused"] { background: var(--paused-tint); color: var(--paused); border-color: var(--paused); }
.ac-timer[data-state="paused"] .ac-timer__lbl { color: var(--paused); }
.ac-timer[data-state="expired"] { background: var(--incorrect-tint); color: var(--incorrect); border-color: var(--incorrect); }
.ac-timer[data-state="expired"] .ac-timer__lbl { color: var(--incorrect); }

/* ---------- question card ---------- */
.ac-q { display: flex; flex-direction: column; gap: var(--space-5); max-width: calc(var(--measure) + 32px); }
.ac-q__meta { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.ac-q__body { display: flex; flex-direction: column; gap: var(--space-3); }
.ac-q__stem { font-size: 18px; line-height: 28px; margin: 0; max-width: var(--measure); }
.ac-q__stem p { margin: 0 0 var(--space-3); }
.ac-q__stem p:last-child { margin-bottom: 0; }
.ac-code { border: 1px solid var(--line); background: var(--surface-code); border-radius: var(--radius-0); max-width: 100%; }
.ac-code__bar { display: flex; justify-content: space-between; align-items: center; padding: 6px var(--space-3); border-bottom: 1px solid var(--line); font-family: var(--font-mono); font-stretch: 87.5%; font-variation-settings: "wdth" 87.5; font-size: 12px; line-height: 16px; color: var(--ink-muted); letter-spacing: 0.04em; }
.ac-code pre { margin: 0; padding: var(--space-3) var(--space-4); overflow-x: auto; white-space: pre; font-family: var(--font-mono); font-stretch: 75%; font-variation-settings: "wdth" 75; font-size: 13px; line-height: 21px; color: var(--ink); tab-size: 4; }
.ac-code pre:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.ac-code pre code { all: unset; display: block; font: inherit; white-space: pre; }
.ac-code .l { display: block; min-height: 21px; }
.ac-code--num pre { counter-reset: ln; padding-left: 0; }
.ac-code--num .l::before { counter-increment: ln; content: counter(ln); display: inline-block; width: 32px; margin-right: 12px; padding-right: 8px; text-align: right; color: var(--ink-muted); border-right: 1px solid var(--line); position: sticky; left: 0; background: var(--surface-code); }
.ac-code .k { color: var(--ink-brand); font-weight: 600; }
.ac-code .s { color: var(--correct); }
.ac-code .c { color: var(--ink-muted); font-style: italic; }
.ac-code .hl { background: var(--flagged-tint); box-shadow: -16px 0 0 var(--flagged-tint), 2000px 0 0 var(--flagged-tint); }

/* ---------- option row ---------- */
.ac-options { display: flex; flex-direction: column; gap: var(--space-2); margin: 0; padding: 0; border: 0; min-width: 0; }
.ac-options legend { padding: 0; margin-bottom: var(--space-2); }
.ac-opt { position: relative; display: grid; grid-template-columns: 24px 20px 1fr; column-gap: var(--space-3); align-items: start; min-height: 56px; padding: var(--space-3) var(--space-4); background: var(--surface-raised); border: 1px solid var(--line-strong); border-radius: var(--radius-1); cursor: pointer; transition: border-color var(--dur-fast) var(--ease-standard), background-color var(--dur-fast) var(--ease-standard); }
.ac-opt:hover { border-color: var(--ink); }
.ac-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ac-opt:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.ac-opt__mark { width: 22px; height: 22px; margin-top: 1px; border: 2px solid var(--line-strong); background: var(--surface-raised); display: inline-flex; align-items: center; justify-content: center; color: var(--on-brand); }
.ac-opt--radio .ac-opt__mark { border-radius: var(--radius-round); }
.ac-opt--check .ac-opt__mark { border-radius: var(--radius-1); }
.ac-opt__letter { font-family: var(--font-mono); font-stretch: 87.5%; font-variation-settings: "wdth" 87.5; font-weight: 600; font-size: 15px; line-height: 24px; color: var(--ink-muted); }
.ac-opt__text { font-size: 16px; line-height: 24px; color: var(--ink); min-width: 0; }
.ac-opt__status { grid-column: 3; display: inline-flex; align-items: center; gap: var(--space-1); margin-top: var(--space-2); font-family: var(--font-mono); font-stretch: 87.5%; font-variation-settings: "wdth" 87.5; font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.ac-opt[data-state="disabled"] code { color: var(--ink-disabled); }
.ac-opt__status .ac-icon { flex: none; }
/* selected */
.ac-opt[data-state="selected"], .ac-opt:has(input:checked):not([data-state]) { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); background: var(--brand-tint); }
.ac-opt[data-state="selected"] .ac-opt__mark, .ac-opt:has(input:checked):not([data-state]) .ac-opt__mark { border-color: var(--brand); background: var(--brand); }
.ac-opt--radio[data-state="selected"] .ac-opt__mark, .ac-opt--radio:has(input:checked):not([data-state]) .ac-opt__mark { background: var(--surface-raised); box-shadow: inset 0 0 0 4px var(--surface-raised), inset 0 0 0 10px var(--brand); }
.ac-opt[data-state="selected"] .ac-opt__letter { color: var(--ink-brand); }
/* correct (user picked, right) */
.ac-opt[data-state="correct"] { border-color: var(--correct); box-shadow: inset 0 0 0 1px var(--correct); background: var(--correct-tint); cursor: default; }
.ac-opt[data-state="correct"] .ac-opt__mark { border-color: var(--correct); background: var(--correct); color: var(--surface-raised); }
.ac-opt[data-state="correct"] .ac-opt__letter, .ac-opt[data-state="correct"] .ac-opt__status { color: var(--correct); }
/* incorrect (user picked, wrong) */
.ac-opt[data-state="incorrect"] { border-color: var(--incorrect); box-shadow: inset 0 0 0 1px var(--incorrect); background: var(--incorrect-tint); cursor: default; }
.ac-opt[data-state="incorrect"] .ac-opt__mark { border-color: var(--incorrect); background: var(--incorrect); color: var(--surface-raised); }
.ac-opt[data-state="incorrect"] .ac-opt__letter, .ac-opt[data-state="incorrect"] .ac-opt__status { color: var(--incorrect); }
/* missed-correct (right answer the user did not pick) */
.ac-opt[data-state="missed"] { border: 2px dashed var(--correct); padding: 11px 15px; background: var(--surface-raised); cursor: default; }
.ac-opt[data-state="missed"] .ac-opt__mark { border-color: var(--correct); color: var(--correct); border-style: dashed; }
.ac-opt[data-state="missed"] .ac-opt__letter, .ac-opt[data-state="missed"] .ac-opt__status { color: var(--correct); }
/* neutral after reveal (not picked, not right) */
.ac-opt[data-state="rest"] { cursor: default; border-color: var(--line); }
.ac-opt[data-state="rest"]:hover { border-color: var(--line); }
/* disabled */
.ac-opt[data-state="disabled"] { background: var(--surface-sunken); border-color: var(--line); cursor: not-allowed; }
.ac-opt[data-state="disabled"] .ac-opt__text, .ac-opt[data-state="disabled"] .ac-opt__letter { color: var(--ink-disabled); }
.ac-opt[data-state="disabled"] .ac-opt__mark { border-color: var(--line); background: transparent; }

/* verdict line after Check answer */
.ac-verdict { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-3) var(--space-4); border: 2px solid currentColor; font-weight: 700; }
.ac-verdict span { font-weight: 400; color: var(--ink); display: block; }
.ac-verdict[data-v="correct"] { color: var(--correct); background: var(--correct-tint); }
.ac-verdict[data-v="incorrect"] { color: var(--incorrect); background: var(--incorrect-tint); }
.ac-verdict[data-v="partial"] { color: var(--flagged); background: var(--flagged-tint); }

/* ---------- scenario panel ---------- */
.ac-scenario { border: 1px solid var(--line-strong); background: var(--surface-raised); }
.ac-scenario summary { list-style: none; display: flex; align-items: center; gap: var(--space-3); min-height: var(--touch-min); padding: var(--space-2) var(--space-4); cursor: pointer; }
.ac-scenario summary::-webkit-details-marker { display: none; }
.ac-scenario__t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0; padding: 4px 0; }
.ac-scenario summary .t { font-weight: 700; }
.ac-scenario summary .chev { transition: transform var(--dur-base) var(--ease-standard); }
.ac-scenario[open] summary .chev { transform: rotate(180deg); }
.ac-scenario__body { padding: var(--space-4); background: var(--surface-sunken); border-top: 1px solid var(--line); max-width: none; }
.ac-scenario__body p { margin: 0 0 var(--space-2); max-width: var(--measure); }

/* ---------- explanation ---------- */
.ac-explain { display: flex; flex-direction: column; border-top: 3px solid var(--rule); max-width: var(--measure); }
.ac-explain__item { display: grid; grid-template-columns: 24px 1fr; column-gap: var(--space-3); row-gap: var(--space-2); padding: var(--space-4) 0; border-bottom: 1px solid var(--line); }
.ac-explain__ic { grid-row: 1 / span 3; padding-top: 2px; }
.ac-explain__item[data-kind="right"] .ac-explain__ic { color: var(--correct); }
.ac-explain__item[data-kind="weaker"] .ac-explain__ic { color: var(--flagged); }
.ac-explain__item[data-kind="wrong"] .ac-explain__ic { color: var(--incorrect); }
.ac-explain__head { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.ac-explain__head b { font-size: 16px; }
.ac-explain__item p { margin: 0; }
.ac-source { display: inline-flex; align-items: flex-start; text-wrap: pretty; gap: var(--space-1); font-size: 14px; line-height: 20px; min-height: 24px; }

/* ---------- model answer reveal ---------- */
.ac-field { display: flex; flex-direction: column; gap: var(--space-1); }
.ac-field label { font-weight: 700; font-size: 14px; line-height: 20px; }
.ac-field .hint { font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.ac-textarea { width: 100%; min-height: 120px; padding: var(--space-3); font: inherit; color: var(--ink); background: var(--surface-raised); border: 1px solid var(--line-strong); border-radius: var(--radius-1); resize: vertical; }
.ac-textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.ac-answer { display: flex; flex-direction: column; gap: var(--space-5); max-width: var(--measure); border-top: 3px solid var(--rule); padding-top: var(--space-4); }
.ac-answer section { display: flex; flex-direction: column; gap: var(--space-2); }
.ac-answer p { margin: 0; }
.ac-misc { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.ac-misc li { display: grid; grid-template-columns: 20px 1fr; gap: var(--space-2); }
.ac-misc li .ac-icon { color: var(--incorrect); margin-top: 2px; }
.ac-misc q { font-style: italic; quotes: "\201C" "\201D"; }
.ac-misc q::after { content: close-quote " \2014"; }
.ac-tagdefs { padding: var(--space-3) 0; font-size: 14px; line-height: 20px; }
.ac-tagdefs summary { cursor: pointer; color: var(--ink-brand); min-height: var(--touch-min); display: inline-flex; align-items: center; text-decoration: underline; text-underline-offset: 3px; }
.ac-tagdefs dl { display: grid; grid-template-columns: auto 1fr; gap: var(--space-2) var(--space-3); margin: var(--space-2) 0 0; align-items: baseline; }
.ac-tagdefs dd { margin: 0; color: var(--ink-muted); }
.ac-probe { border: 1px solid var(--ink); padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-2); background: var(--surface-raised); }
.ac-selfrate { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border: 1px solid var(--line-strong); border-radius: var(--radius-1); }
.ac-selfrate button { appearance: none; min-height: 48px; border: 0; border-left: 1px solid var(--line-strong); background: var(--surface-raised); color: var(--ink); font-family: var(--font-mono); font-stretch: 87.5%; font-variation-settings: "wdth" 87.5; font-weight: 600; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.ac-selfrate button:first-child { border-left: 0; }
.ac-selfrate button:hover { background: var(--surface-sunken); }
.ac-selfrate button[aria-pressed="true"] { background: var(--ink); color: var(--surface-raised); }

/* ---------- navigator ---------- */
.ac-nav { display: grid; grid-template-columns: repeat(6, 48px); gap: var(--space-2); }
.ac-nav button { position: relative; appearance: none; width: 48px; height: 48px; border: 1px solid var(--line-strong); background: var(--surface-raised); color: var(--ink); border-radius: var(--radius-1); font-family: var(--font-mono); font-stretch: 87.5%; font-variation-settings: "wdth" 87.5; font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.ac-nav button:hover { border-color: var(--ink); }
.ac-nav button[data-s~="answered"] { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.ac-nav button[data-s~="flagged"]::after { content: ""; position: absolute; top: -1px; right: -1px; border-style: solid; border-width: 0 14px 14px 0; border-color: transparent var(--flagged) transparent transparent; }
.ac-nav button[data-s~="flagged"] { border-color: var(--flagged); box-shadow: inset 0 0 0 1px var(--flagged); }
.ac-nav button[data-s~="answered"][data-s~="flagged"] { box-shadow: inset 0 0 0 2px var(--surface-raised); }
.ac-nav button[aria-current="step"] { outline: 3px solid var(--rule); outline-offset: 2px; font-weight: 700; }
.ac-nav button[data-s~="correct"] { background: var(--correct-tint); border-color: var(--correct); color: var(--correct); }
.ac-nav button[data-s~="incorrect"] { background: var(--incorrect-tint); border-color: var(--incorrect); color: var(--incorrect); }
.ac-nav button .mk { position: absolute; bottom: 2px; right: 3px; width: 12px; height: 12px; }
.ac-navgroups { display: flex; flex-direction: column; gap: var(--space-4); }
.ac-navgroup { display: flex; flex-direction: column; gap: var(--space-2); }
.ac-navgroup > p { margin: 0; }
.ac-legend { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.ac-legend span { display: inline-flex; align-items: center; gap: var(--space-2); }
.ac-legend i { position: relative; width: 16px; height: 16px; border: 1px solid var(--line-strong); background: var(--surface-raised); display: inline-block; }
.ac-legend i[data-s="answered"] { background: var(--brand); border-color: var(--brand); }
.ac-legend i[data-s="flagged"] { border-color: var(--flagged); }
.ac-legend i[data-s="flagged"]::after { content: ""; position: absolute; top: -1px; right: -1px; border-style: solid; border-width: 0 8px 8px 0; border-color: transparent var(--flagged) transparent transparent; }
.ac-legend i[data-s="current"] { outline: 2px solid var(--rule); outline-offset: 1px; }

/* ---------- bottom sheet ---------- */
.ac-scrim { position: absolute; inset: 0; background: var(--scrim); }
.ac-sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: 82%; display: flex; flex-direction: column; background: var(--surface-raised); box-shadow: var(--elev-sheet); border-top: 1px solid var(--line); animation: ac-sheet-in var(--dur-slow) var(--ease-standard); }
.ac-sheet__grip { width: 36px; height: 4px; background: var(--line-strong); margin: var(--space-2) auto 0; }
.ac-sheet__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4); border-bottom: 1px solid var(--line); }
.ac-sheet__body { padding: var(--space-4); overflow: auto; display: flex; flex-direction: column; gap: var(--space-4); }
.ac-sheet__foot { padding: var(--space-3) var(--space-4); border-top: 1px solid var(--line); display: flex; gap: var(--space-3); }
@keyframes ac-sheet-in { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- topic row ---------- */
.ac-topics { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.ac-topic { display: grid; grid-template-columns: 40px 1fr auto 20px; column-gap: var(--space-3); row-gap: var(--space-2); align-items: center; min-height: 64px; padding: var(--space-3) var(--space-2) var(--space-3) 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.ac-topic:hover { background: var(--surface-sunken); color: var(--ink); }
.ac-topic__id { font-family: var(--font-mono); font-stretch: 87.5%; font-variation-settings: "wdth" 87.5; font-weight: 600; font-size: 14px; color: var(--ink-muted); align-self: start; padding-top: 1px; }
.ac-topic__main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ac-topic__name { font-weight: 700; }
.ac-topic__meta { font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.ac-topic .ac-rbar { grid-column: 2 / 4; }
.ac-topic .chev { color: var(--ink-muted); grid-row: 1; grid-column: 4; }

/* ---------- domain row (progress board) ---------- */
.ac-domain { display: grid; grid-template-columns: 1fr auto; gap: var(--space-1) var(--space-3); padding: var(--space-3) 0; border-bottom: 1px solid var(--line); }
.ac-domain__name { font-weight: 700; }
.ac-domain__w { font-family: var(--font-mono); font-stretch: 87.5%; font-variation-settings: "wdth" 87.5; font-size: 12px; color: var(--ink-muted); }
.ac-domain__bar { grid-column: 1 / -1; height: 10px; background: var(--chart-track); position: relative; }
.ac-domain__bar i { position: absolute; inset: 0 auto 0 0; background: var(--chart-bar); }
.ac-domain__bar[data-level="none"] { background: transparent; border: 1px dashed var(--ready-none); }

/* ---------- heatmap ---------- */
.ac-heat__row { display: flex; flex-direction: column; gap: var(--space-1); }
.ac-heat__row + .ac-heat__row { margin-top: var(--space-2); }
.ac-heat__row > b { font-family: var(--font-mono); font-stretch: 87.5%; font-variation-settings: "wdth" 87.5; font-size: 12px; color: var(--ink-muted); }
.ac-heat__cells { display: grid; grid-template-columns: repeat(7, minmax(44px, 1fr)); gap: 3px; }
.ac-cell { position: relative; min-height: 44px; min-width: 44px; border-radius: var(--radius-1); display: flex; flex-direction: column; justify-content: space-between; padding: 4px 5px; font-family: var(--font-mono); font-stretch: 87.5%; font-variation-settings: "wdth" 87.5; font-size: 12px; line-height: 14px; font-weight: 600; text-decoration: none; border: 1px solid transparent; }
.ac-cell[data-level="0"] { background: var(--ready-0); color: var(--on-ready-0); }
.ac-cell[data-level="1"] { background: var(--ready-1); color: var(--on-ready-1); }
.ac-cell[data-level="2"] { background: var(--ready-2); color: var(--on-ready-2); }
.ac-cell[data-level="3"] { background: var(--ready-3); color: var(--on-ready-3); }
.ac-cell[data-level="none"] { background: transparent; color: var(--ink-muted); border: 1px dashed var(--ready-none); }
.ac-cell .p { display: flex; gap: 1px; align-self: flex-end; }
.ac-cell .p i { width: 4px; height: 7px; border: 1px solid currentColor; }
.ac-cell[data-level="1"] .p i:nth-child(-n+1), .ac-cell[data-level="2"] .p i:nth-child(-n+2), .ac-cell[data-level="3"] .p i { background: currentColor; }
.ac-cell:hover { border-color: var(--ink); }
.ac-cell--empty { visibility: hidden; }

/* ---------- charts ---------- */
.ac-chart { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--font-mono); font-stretch: 87.5%; font-variation-settings: "wdth" 87.5; }
.ac-chart text { fill: var(--ink-muted); font-size: 11px; }
.ac-chart .lbl { fill: var(--ink); font-size: 12px; font-weight: 500; }
.ac-chart .grid { stroke: var(--chart-grid); stroke-width: 1; }
.ac-chart .track { fill: var(--chart-track); }
.ac-chart .bar { fill: var(--chart-bar); }
.ac-chart .line { fill: none; stroke: var(--chart-bar); stroke-width: 2; }
.ac-chart .pt { fill: var(--surface-raised); stroke: var(--chart-bar); stroke-width: 2; }
.ac-chart .pass { stroke: var(--chart-pass); stroke-width: 2; stroke-dasharray: 6 4; }
.ac-chart .passlbl { fill: var(--chart-pass); font-weight: 600; font-size: 11px; }
.ac-chart .val { fill: var(--ink); font-size: 12px; font-weight: 600; }
.ac-gauge .arc { fill: none; stroke: var(--chart-track); stroke-width: 14; }
.ac-gauge .zone { fill: none; stroke: var(--brand-tint); stroke-width: 14; }
.ac-gauge .zone-edge { fill: none; stroke: var(--brand); stroke-width: 2; }
.ac-gauge .tick { stroke: var(--ink-muted); stroke-width: 1.5; }
.ac-gauge .tickpass { stroke: var(--chart-pass); stroke-width: 3; }
.ac-gauge .needle { stroke: var(--brand); stroke-width: 4; stroke-linecap: butt; transform-origin: 160px 150px; transition: transform var(--dur-slow) var(--ease-needle); }
.ac-gauge .hub { fill: var(--brand); }
.ac-gauge .score { fill: var(--ink); font-size: 44px; font-weight: 500; letter-spacing: -0.02em; }
.ac-gauge .sub { fill: var(--ink-muted); font-size: 11px; letter-spacing: 0.06em; }
.ac-gauge .verdict { fill: var(--ink); font-size: 12px; font-weight: 600; letter-spacing: 0.04em; }

/* ---------- promo ---------- */
.ac-promo-inline { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 14px; line-height: 20px; }
.ac-promo-inline p { margin: 0; flex: 1; }
.ac-promo-inline .ac-icon { color: var(--ink-muted); }
.ac-promo-card { background: var(--surface-raised); border: 1px solid var(--line); border-top: 3px solid var(--rule); padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-3); }
.ac-promo-card p { margin: 0; }
.ac-promo-strip { background: var(--surface-inverse); color: var(--on-inverse); padding: var(--space-4); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); font-size: 14px; line-height: 20px; }
.ac-promo-strip p { margin: 0; }
.ac-promo-strip a { color: var(--on-inverse); font-weight: 700; display: inline-flex; min-height: var(--touch-min); align-items: center; }

/* ---------- mock set cards ---------- */
.ac-set { position: relative; display: grid; grid-template-columns: 1fr auto; gap: var(--space-2) var(--space-3); padding: var(--space-4); background: var(--surface-raised); border: 1px solid var(--line-strong); color: var(--ink); text-decoration: none; }
.ac-set__title { font-family: var(--font-mono); font-stretch: 87.5%; font-variation-settings: "wdth" 87.5; font-weight: 600; font-size: 17px; line-height: 24px; }
.ac-set__meta { font-size: 14px; line-height: 20px; color: var(--ink-muted); grid-column: 1 / -1; }
.ac-set__act { grid-column: 1 / -1; }
.ac-set[data-state="locked"] { background: repeating-linear-gradient(135deg, var(--locked-tint) 0 6px, var(--surface-raised) 6px 12px); border-color: var(--line); border-style: dashed; color: var(--locked); }
.ac-set[data-state="locked"] .ac-set__title { color: var(--locked); }
.ac-set[data-state="locked"] .ac-set__meta { color: var(--locked); }
.ac-set__lock { display: inline-flex; align-items: center; gap: var(--space-1); font-family: var(--font-mono); font-stretch: 87.5%; font-variation-settings: "wdth" 87.5; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--locked); background: var(--surface-raised); padding: 2px 6px; border: 1px solid var(--locked); }

/* ---------- banners ---------- */
.ac-banner { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); border: 1px solid var(--ink); background: var(--surface-raised); }
.ac-banner p { margin: 0; flex: 1; font-size: 14px; line-height: 20px; }
.ac-banner p b { display: block; font-size: 16px; line-height: 24px; }
.ac-banner[data-tone="flagged"] { background: var(--flagged-tint); border-color: var(--flagged); }
.ac-banner[data-tone="flagged"] > .ac-icon { color: var(--flagged); }
.ac-banner[data-tone="paused"] { background: var(--paused-tint); border-color: var(--paused); }
.ac-banner[data-tone="paused"] > .ac-icon { color: var(--paused); }
.ac-banner[data-tone="error"] { background: var(--incorrect-tint); border-color: var(--incorrect); }
.ac-banner[data-tone="error"] > .ac-icon { color: var(--incorrect); }

/* ---------- states ---------- */
.ac-empty { display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-5) var(--space-4); border: 1px dashed var(--line-strong); background: var(--surface-raised); }
.ac-empty p { margin: 0; max-width: var(--measure); }
.ac-empty ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: var(--space-1); }
.ac-skel { background: var(--surface-sunken); position: relative; overflow: hidden; }
.ac-skel::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, var(--surface-raised), transparent); opacity: .6; transform: translateX(-100%); animation: ac-shimmer 1400ms linear infinite; }
@keyframes ac-shimmer { to { transform: translateX(100%); } }
.ac-pause { position: absolute; inset: 0; z-index: 5; background: var(--paused-tint); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-4); padding: var(--space-6) var(--space-4); text-align: center; color: var(--ink); }
.ac-pause .ac-icon { width: 40px; height: 40px; color: var(--paused); }

/* ---------- app shell & layout (container queries: works in any frame) ---------- */
.ac-app { container: app / inline-size; background: var(--surface); color: var(--ink); position: relative; display: flex; flex-direction: column; min-height: 100%; overflow: hidden; }
.ac-main { flex: 1; padding: var(--space-5) var(--space-4) var(--space-6); display: flex; flex-direction: column; gap: var(--space-5); width: 100%; max-width: var(--content-max); margin: 0 auto; }
.ac-stack { display: flex; flex-direction: column; gap: var(--space-4); }
.ac-stack-2 { display: flex; flex-direction: column; gap: var(--space-2); }
.ac-row { display: flex; align-items: center; gap: var(--space-3); }
.ac-between { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.ac-grid2 { display: grid; grid-template-columns: 1fr; gap: var(--space-4); }
.ac-examshell { display: flex; flex-direction: column; flex: 1; }
.ac-examhead { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4); background: var(--surface-raised); border-bottom: 1px solid var(--line); }
.ac-exambody { flex: 1; display: grid; grid-template-columns: 1fr; }
.ac-examaside { display: none; }
.ac-examfoot { position: sticky; bottom: 0; display: grid; grid-template-columns: 1fr auto 1fr; gap: var(--space-2); align-items: center; padding: var(--space-2) var(--space-3) calc(var(--space-2) + env(safe-area-inset-bottom)); background: var(--surface-raised); box-shadow: var(--elev-bar); }
.ac-examfoot > :last-child { justify-self: end; }
@container app (max-width: 719px) {
  .ac-examhead .ac-timer__lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}
@container app (min-width: 720px) {
  .ac-heat__row { display: grid; grid-template-columns: 32px 1fr; align-items: center; gap: var(--space-2); }
  .ac-heat__row + .ac-heat__row { margin-top: 3px; }
  .ac-main { padding: var(--space-6) var(--space-5) var(--space-7); }
  .ac-h1 { font-size: 40px; line-height: 44px; }
  .ac-grid2 { grid-template-columns: 1fr 1fr; gap: var(--space-5); }
  .ac-statgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ac-statgrid .ac-stat { border-left: 0; border-top: 1px solid var(--line); }
  .ac-statgrid .ac-stat:first-child { border-left: 1px solid var(--line); }
  .ac-account { display: inline-flex; }
}
@container app (min-width: 1080px) {
  .ac-topnav { display: flex; }
  .ac-tabbar { display: none; }
  .ac-main { padding: var(--space-7) var(--space-6) var(--space-8); }
  .ac-exambody { grid-template-columns: 1fr var(--exam-nav-width); }
  .ac-examaside { display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-5); border-left: 1px solid var(--line); background: var(--surface-raised); }
  .ac-examfoot { position: static; box-shadow: none; border-top: 1px solid var(--line); }
  .ac-navbtn { display: none !important; }
}

/* ---------- presentation frames (design system pages only) ---------- */
.ac-frames { display: flex; gap: 32px; align-items: flex-start; flex-wrap: wrap; padding: 24px; background: var(--surface); }
.ac-framewrap { display: flex; flex-direction: column; gap: 8px; }
.ac-framecap { font-family: var(--font-mono); font-stretch: 87.5%; font-variation-settings: "wdth" 87.5; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-muted); }
.ac-frame { position: relative; border: 1px solid var(--line-strong); overflow: hidden; background: var(--surface); }
.ac-frame > .ac-app { height: 100%; }
.ac-specnote { font-size: 13px; line-height: 18px; color: var(--ink-muted); max-width: 375px; margin: 0; }
.ac-specnote b { color: var(--ink); }
.ac-a11y { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 4px; background: var(--ink); color: var(--surface-raised); font-family: var(--font-mono); font-stretch: 87.5%; font-variation-settings: "wdth" 87.5; font-size: 11px; font-weight: 700; border-radius: var(--radius-1); }

/* ---------- wireframe kit (greyscale, structure only) ---------- */
.wf { --wf-ink: #3d4644; --wf-mid: #8d9693; --wf-line: #b9c0be; --wf-fill: #e7eaea; --wf-bg: #f7f8f8; font-family: var(--font-mono); font-stretch: 87.5%; font-variation-settings: "wdth" 87.5; color: var(--wf-ink); background: var(--wf-bg); font-size: 11px; line-height: 14px; display: flex; flex-direction: column; height: 100%; }
[data-theme="dark"] .wf { --wf-ink: #d6dcda; --wf-mid: #8a9592; --wf-line: #4a5553; --wf-fill: #262d2c; --wf-bg: #1a1f1e; }
.wf * { box-sizing: border-box; }
.wf-bar { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 0 10px; height: 40px; border-bottom: 1px solid var(--wf-line); flex: none; }
.wf-tabs { display: grid; grid-template-columns: repeat(4, 1fr); height: 48px; border-top: 1px solid var(--wf-line); flex: none; }
.wf-tabs span { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 9px; }
.wf-tabs span::before { content: ""; width: 14px; height: 14px; border: 1.5px solid var(--wf-mid); }
.wf-tabs span.on { font-weight: 700; border-top: 2px solid var(--wf-ink); }
.wf-tabs span.on::before { background: var(--wf-ink); border-color: var(--wf-ink); }
.wf-body { flex: 1; padding: 12px; display: flex; flex-direction: column; gap: 10px; overflow: hidden; }
.wf-h { font-weight: 700; font-size: 15px; line-height: 18px; color: var(--wf-ink); }
.wf-h2 { font-weight: 700; font-size: 12px; line-height: 16px; }
.wf-t { height: 7px; background: var(--wf-line); }
.wf-t.w9 { width: 90%; } .wf-t.w7 { width: 70%; } .wf-t.w5 { width: 50%; } .wf-t.w3 { width: 30%; }
.wf-box { border: 1px solid var(--wf-line); background: var(--wf-fill); padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.wf-out { border: 1px solid var(--wf-line); padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.wf-dash { border: 1px dashed var(--wf-mid); padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.wf-btn { display: flex; align-items: center; justify-content: center; height: 30px; border: 1.5px solid var(--wf-ink); font-weight: 700; font-size: 10px; padding: 0 8px; }
.wf-btn.p { background: var(--wf-ink); color: var(--wf-bg); }
.wf-row { display: flex; gap: 6px; align-items: center; }
.wf-row > * { flex: 1; }
.wf-row > .n { flex: none; }
.wf-opt { display: flex; gap: 6px; align-items: flex-start; border: 1px solid var(--wf-line); padding: 7px; }
.wf-opt::before { content: ""; width: 10px; height: 10px; border: 1.5px solid var(--wf-mid); border-radius: 50%; flex: none; }
.wf-opt.sq::before { border-radius: 0; }
.wf-opt.sel { border: 2px solid var(--wf-ink); }
.wf-opt.sel::before { background: var(--wf-ink); }
.wf-opt > div { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.wf-bars { display: flex; flex-direction: column; gap: 6px; }
.wf-meter { height: 6px; background: var(--wf-fill); border: 1px solid var(--wf-line); position: relative; }
.wf-meter i { position: absolute; inset: 0 auto 0 0; background: var(--wf-mid); }
.wf-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 40px)); gap: 4px; }
.wf-grid i { aspect-ratio: 1; border: 1px solid var(--wf-line); }
.wf-grid i.a { background: var(--wf-mid); }
.wf-grid i.c { outline: 2px solid var(--wf-ink); }
.wf-grid i.f { border: 2px solid var(--wf-ink); border-style: dashed; }
.wf-note { font-size: 10px; color: var(--wf-mid); }
.wf-code { background: var(--wf-fill); border: 1px solid var(--wf-line); padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.wf-code .wf-t { height: 5px; background: var(--wf-mid); }
.wf-tag { display: inline-block; border: 1px solid var(--wf-mid); padding: 1px 4px; font-size: 9px; }
.wf-cols { display: grid; gap: 10px; }
.wf-gauge { height: 70px; border: 1px solid var(--wf-line); border-radius: 70px 70px 0 0; border-bottom: 0; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 6px; font-weight: 700; font-size: 16px; }
.wf-scrim { position: absolute; inset: 0; background: rgba(0,0,0,.35); }
.wf-sheet { position: absolute; left: 0; right: 0; bottom: 0; background: var(--wf-bg); border-top: 2px solid var(--wf-ink); padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.wf-x { border: 1px solid var(--wf-line); background: linear-gradient(to top right, transparent calc(50% - 0.5px), var(--wf-line) 50%, transparent calc(50% + 0.5px)), linear-gradient(to top left, transparent calc(50% - 0.5px), var(--wf-line) 50%, transparent calc(50% + 0.5px)); }
.wf-anno { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; background: var(--ink); color: var(--surface-raised); font-size: 9px; font-weight: 700; flex: none; }
.wf-legend { display: flex; flex-direction: column; gap: 6px; font-family: var(--font-sans); font-size: 13px; line-height: 18px; color: var(--ink); max-width: 360px; }
.wf-legend li { display: grid; grid-template-columns: 20px 1fr; gap: 6px; }
.wf-legend ol { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0ms !important; animation-iteration-count: 1 !important; transition-duration: 0ms !important; scroll-behavior: auto !important; }
  .ac-skel::after { display: none; }
  .ac-busy i { height: 10px; }
}
