/* A&P Case Files: an open case-file folder inside the practice shell's stage (about 1066 × 628 at 1366 × 768).
 * Left page: the case (story, data figure or organ diagram). Right page: the worksheet (one task, its controls). */
html { --acf-ink: #1d2733; --acf-soft: #4a5868; --acf-desk1: #dfe7ea; --acf-desk2: #c9d6db; --acf-folder: #e2bf7d; --acf-folder2: #cfa560; --acf-folder-edge: #a77b35;
  --acf-paper: #fffdf8; --acf-paper2: #f6f0e2; --acf-line: #d9cdb4; --acf-rule: rgba(46, 104, 140, .12); --acf-accent: #185e71; --acf-accent-bg: #dff0f4;
  --acf-sel: #1f5fbf; --acf-sel-bg: #e7efff; --acf-ok: #17683a; --acf-ok-bg: #e2f5e8; --acf-bad: #b42318; --acf-bad-bg: #fde8e5; --acf-hi: #b54708; --acf-hi-bg: #fff1dc;
  --acf-stamp: #b42318; --acf-shadow: 0 8px 18px rgba(30, 40, 50, .18); --acf-plot: #ffffff; --acf-grid: #d5dde5; --acf-trace: #1d4f91;
  --acf-ecg-paper: #fff5f5; --acf-ecg-small: #f6c9c9; --acf-ecg-big: #e58f8f; --acf-ecg-trace: #1b1f24; --acf-lbl: #1d2733; --acf-lead: #55606d; --acf-glow: #f5b400; }
html[data-theme="dark"] { --acf-ink: #edf2f6; --acf-soft: #b8c5d1; --acf-desk1: #0f181e; --acf-desk2: #0a1116; --acf-folder: #6b532c; --acf-folder2: #57431f; --acf-folder-edge: #3a2c13;
  --acf-paper: #1b2530; --acf-paper2: #16202a; --acf-line: #3e4e5f; --acf-rule: rgba(140, 190, 220, .08); --acf-accent: #6fc3d6; --acf-accent-bg: #123642;
  --acf-sel: #8ab8ff; --acf-sel-bg: #1b2d4d; --acf-ok: #86e0a6; --acf-ok-bg: #153a25; --acf-bad: #ffb4a8; --acf-bad-bg: #4a1e1a; --acf-hi: #ffc58a; --acf-hi-bg: #3d2a12;
  --acf-stamp: #ff8f80; --acf-shadow: 0 8px 18px rgba(0, 0, 0, .55); --acf-plot: #121b23; --acf-grid: #2d3b48; --acf-trace: #8fc1ff;
  --acf-ecg-paper: #22181a; --acf-ecg-small: #4a2a2e; --acf-ecg-big: #7a3a40; --acf-ecg-trace: #f3f6f9; --acf-lbl: #edf2f6; --acf-lead: #9fb0bf; --acf-glow: #ffd24a; }

.acf { position: absolute; inset: 0; overflow: auto; padding: 10px 14px 12px; color: var(--acf-ink); font-size: 17px; line-height: 1.35;
  background: radial-gradient(120% 90% at 30% 0%, var(--acf-desk1), var(--acf-desk2)); }
.acf *, .acf *::before, .acf *::after { box-sizing: border-box; }
.acf p { margin: 0; }
.acf button { font: inherit; color: inherit; }
.acf button:focus-visible, .acf input:focus-visible, .acf summary:focus-visible, .acf .acf-part:focus-visible { outline: 3px solid var(--tlg-focus, #e0912a); outline-offset: 2px; }

/* the folder */
.acf-folder { position: relative; min-height: 100%; display: flex; flex-direction: column; gap: 8px; padding: 8px 10px 10px; border-radius: 6px 14px 14px 14px;
  background: linear-gradient(180deg, var(--acf-folder), var(--acf-folder2)); border: 2px solid var(--acf-folder-edge); box-shadow: var(--acf-shadow); }
.acf-folder.is-in { animation: acf-slide .38s cubic-bezier(.2, .8, .3, 1); }
.acf-folder.is-in .acf-work { animation: acf-open .46s cubic-bezier(.2, .8, .3, 1) .06s both; transform-origin: left center; }
@keyframes acf-slide { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes acf-open { from { opacity: 0; transform: perspective(1400px) rotateY(-24deg); } to { opacity: 1; transform: none; } }
.acf-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; flex: none; }
.acf-tab { display: inline-flex; align-items: baseline; gap: 8px; padding: 5px 14px; border-radius: 8px 8px 8px 2px; color: #fff; background: linear-gradient(180deg, #2a7f95, #185e71 60%, #114856); border: 2px solid #0d3a46; }
.acf-tab-k { font-size: 16px; letter-spacing: .08em; text-transform: uppercase; opacity: .92; }
.acf-tab-t { font-size: 18px; font-weight: 800; }
.acf-chip { font-size: 16px; font-weight: 700; padding: 3px 12px; border-radius: 999px; background: var(--acf-paper); color: var(--acf-accent); border: 1px solid var(--acf-accent); }
.acf-chip.is-sys { color: var(--acf-ink); border-color: var(--acf-folder-edge); }
.acf-stamp { font-size: 16px; font-weight: 800; letter-spacing: .1em; color: var(--acf-stamp); border: 2px solid var(--acf-stamp); padding: 1px 8px; border-radius: 5px; transform: rotate(-3deg); }
.acf-about { margin-left: auto; }
.acf-about summary { cursor: pointer; font-size: 16px; font-weight: 700; min-height: 44px; display: flex; align-items: center; padding: 0 10px; border-radius: 8px; list-style: none; }
.acf-about summary::-webkit-details-marker { display: none; }
.acf-about summary::before { content: 'ⓘ'; margin-right: 6px; }
.acf-about[open] { flex: 1 1 100%; margin-left: 0; order: 5; }
.acf-about[open] summary { margin-left: auto; width: max-content; }
.acf-about-box { padding: 10px 14px; background: var(--acf-paper); border: 1px solid var(--acf-line); border-radius: 10px; font-size: 16px; display: grid; gap: 6px; }
.acf-about-box ul { margin: 0; padding-left: 20px; }

.acf-pages { display: grid; grid-template-columns: minmax(0, 1.32fr) minmax(0, 1fr); gap: 10px; flex: 1 1 auto; min-height: 0; }
.acf-page { position: relative; border-radius: 10px; background: linear-gradient(180deg, var(--acf-paper), var(--acf-paper2)); border: 1px solid var(--acf-line); box-shadow: 0 2px 6px rgba(0, 0, 0, .12); padding: 10px 12px; min-width: 0; min-height: 0; }
.acf-evidence { display: flex; flex-direction: column; gap: 8px; }
.acf-evidence::before { content: ''; position: absolute; top: -9px; left: 26px; width: 22px; height: 46px; border: 4px solid #8d97a5; border-bottom: none; border-radius: 11px 11px 0 0; pointer-events: none; }
.acf-work { display: flex; flex-direction: column; gap: 10px; background: linear-gradient(var(--acf-rule) 1px, transparent 1px) 0 6px / 100% 28px, linear-gradient(180deg, var(--acf-paper), var(--acf-paper2)); }
.acf-story { font-size: 17px; padding-left: 40px; }
.acf-story b { font-weight: 800; }
.acf-k { font-size: 16px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--acf-accent); }

/* figures */
.acf-fig { margin: 0; position: relative; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 4px; }
.acf-fig-box { flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; }
.acf-fig-box > svg { display: block; width: 100%; height: 100%; max-height: 100%; }
.acf-note { font-size: 16px; color: var(--acf-soft); font-style: italic; }
.acf-legend { display: none; margin: 0; padding: 0; list-style: none; gap: 6px 14px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); font-size: 16px; }
.acf-legend li { display: flex; gap: 6px; align-items: center; }
.acf-legend .acf-num { flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--acf-accent); color: #fff; font-weight: 800; font-size: 16px; }
html[data-theme="dark"] .acf-legend .acf-num { color: #0b1a20; }
.acf-fig.is-compact .acf-legend { display: grid; }

.acf-svg { overflow: visible; font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; color: var(--acf-ink); }
.acf-svg text { font-size: calc(16px * var(--k, 1)); fill: var(--acf-lbl); }
.acf-lbl-t { font-weight: 700; paint-order: stroke; stroke: var(--acf-paper); stroke-width: calc(4px * var(--k, 1)); stroke-linejoin: round; }
.acf-lead { stroke: var(--acf-lead); stroke-width: calc(1.4px * var(--k, 1)); fill: none; }
.acf-lead-dot { fill: var(--acf-lead); }
.acf-ctx-in text { font-weight: 800; fill: rgba(255, 255, 255, .92); paint-order: stroke; stroke: rgba(0, 0, 0, .35); stroke-width: 3px; }
.acf-ctx-in.is-quiet text { fill: var(--acf-soft); stroke: none; font-weight: 700; }
.acf-badge { display: none; }
.acf-badge circle { r: calc(13px * var(--k, 1)); fill: var(--acf-accent); stroke: #fff; stroke-width: calc(2px * var(--k, 1)); }
.acf-badge text { fill: #fff; font-weight: 800; }
html[data-theme="dark"] .acf-badge text { fill: #0b1a20; }
.acf-fig.is-compact .acf-lbl, .acf-fig.is-compact .acf-gas-t, .acf-fig.is-compact .acf-ctx-in, .acf-fig.is-compact .acf-graph text, .acf-fig.is-compact .acf-band-t { display: none; }
.acf-fig.is-compact .acf-badge { display: inline; }
.acf-gas-t { font-weight: 800; }
.acf-gas-t.is-o2 { fill: #1f6f8b; } .acf-gas-t.is-co2 { fill: #7a5a12; }
.acf-hit * { fill: transparent; stroke: transparent; }
.acf-hit [fill="none"] { fill: none; }
.acf-organ:not(.is-select) .acf-hit { display: none; }
.acf-organ.is-select .acf-part { cursor: pointer; }
.acf-organ.is-select .acf-part:hover > :not(.acf-hit) { filter: drop-shadow(0 0 3px var(--acf-sel)); }
.acf-part.is-hl > :not(.acf-hit), .acf-part.is-hl > path, .acf-part.is-hl > ellipse { filter: drop-shadow(0 0 3px var(--acf-glow)) drop-shadow(0 0 7px var(--acf-glow)); }
.acf-part.is-hl { animation: acf-pulse 1.8s ease-in-out infinite; }
@keyframes acf-pulse { 50% { opacity: .78; } }
.acf-lbl.is-hl .acf-lbl-t { fill: var(--acf-hi); }
.acf-part.is-sel > :not(.acf-hit) { filter: drop-shadow(0 0 3px var(--acf-sel)) drop-shadow(0 0 8px var(--acf-sel)); }
.acf-lbl.is-sel .acf-lbl-t { fill: var(--acf-sel); text-decoration: underline; }
.acf-part.is-key > :not(.acf-hit) { filter: drop-shadow(0 0 3px #2fb36b) drop-shadow(0 0 9px #2fb36b); }
.acf-lbl.is-key .acf-lbl-t { fill: var(--acf-ok); }
.acf-part.is-miss > :not(.acf-hit) { filter: drop-shadow(0 0 3px #e5484d) drop-shadow(0 0 7px #e5484d); }
.acf-lbl.is-miss .acf-lbl-t { fill: var(--acf-bad); text-decoration: line-through; }
.acf-cell.is-deoxy { fill: #2f4fa0; stroke: #fff; stroke-width: 1; } .acf-cell.is-oxy { fill: #d92b20; stroke: #fff; stroke-width: 1; }
.acf-cell.is-filtrate { fill: #e9c64a; stroke: #7a5a12; stroke-width: 1; }
.acf-spike { fill: #ffe066; stroke: #e0565b; stroke-width: 2.5; filter: url(#acf-glow); }

/* data-figure styles */
.acf-plot { fill: var(--acf-plot); stroke: var(--acf-grid); stroke-width: 1.2; }
.acf-gridline { stroke: var(--acf-grid); stroke-width: 1; }
.acf-axisline { stroke: var(--acf-soft); stroke-width: 1.4; fill: none; }
.acf-dash { stroke: var(--acf-soft); stroke-width: 1.4; stroke-dasharray: 6 5; fill: none; }
.acf-zero { stroke: var(--acf-grid); stroke-width: 1; }
.acf-trace { fill: none; stroke: var(--acf-trace); stroke-width: 2.8; stroke-linejoin: round; stroke-linecap: round; }
.acf-trace.is-ecg { stroke: var(--acf-ecg-trace); stroke-width: 2.2; }
.acf-trace.is-ncs { stroke: #1d6f5f; } html[data-theme="dark"] .acf-trace.is-ncs { stroke: #7fe0c4; }
.acf-ecg-paper { fill: var(--acf-ecg-paper); }
.acf-grid-small { stroke: var(--acf-ecg-small); stroke-width: .7; }
.acf-grid-big { stroke: var(--acf-ecg-big); stroke-width: 1.3; }
.acf-ecg-l { font-weight: 800; fill: #9d1c1c !important; } html[data-theme="dark"] .acf-ecg-l { fill: #ffb3a8 !important; }
.acf-caliper { stroke: #1f5fbf; stroke-width: 2; fill: none; color: #1f5fbf; } html[data-theme="dark"] .acf-caliper { stroke: #8ab8ff; color: #8ab8ff; }
.acf-tick { fill: var(--acf-soft) !important; }
.acf-tick.is-strong, .acf-axis.is-strong { fill: var(--acf-ink) !important; font-weight: 700; }
.acf-axis { fill: var(--acf-soft) !important; font-style: italic; }
.acf-lowband { fill: rgba(229, 72, 77, .09); }
.acf-bpbar { stroke: var(--acf-trace); stroke-width: 6; stroke-linecap: round; }
.acf-bpcap { stroke: var(--acf-trace); stroke-width: 3; }
.acf-mark-s { fill: #c2410c; } .acf-mark-d { fill: #1d5bd8; }
html[data-theme="dark"] .acf-mark-s { fill: #ff9a6a; } html[data-theme="dark"] .acf-mark-d { fill: #8db4ff; }
.acf-brace { stroke: var(--acf-ink); stroke-width: 2; fill: none; color: var(--acf-ink); }
.acf-band-t { font-weight: 700; }
.acf-pt { fill: #c2410c; stroke: #fff; stroke-width: 2; }
.acf-chart-card { fill: var(--acf-plot); stroke: var(--acf-grid); }
.acf-swatch { stroke: rgba(0, 0, 0, .25); stroke-width: 1; }
.acf-swatch.is-match { stroke: var(--acf-ink); stroke-width: 3; }
.acf-strip { stroke: #b9c2cf; stroke-width: 2; }
.acf-arm { fill: #f1c9a5; stroke: #b98a62; stroke-width: 2; } html[data-theme="dark"] .acf-arm { fill: #8a6a50; stroke: #c49a76; }
.acf-bolt { fill: #f5c330; stroke: #8a6a09; stroke-width: 1.5; }
.acf-elec { fill: #3b4652; stroke: #111; }
.acf-start { width: 100%; height: auto; }
.acf-ex svg { width: 100%; height: auto; }

/* the worksheet controls */
.acf-q { font-size: 17px; font-weight: 700; }
.acf-opts { display: grid; gap: 8px; }
.acf-opt { display: flex; align-items: flex-start; gap: 10px; min-height: 48px; padding: 9px 12px; text-align: left; border-radius: 10px; border: 2px solid var(--acf-line); background: var(--acf-paper); cursor: pointer; transition: border-color .15s, background-color .15s, transform .12s; }
.acf-opt:hover:not(:disabled) { border-color: var(--acf-sel); }
.acf-opt:active:not(:disabled) { transform: scale(.99); }
.acf-dot { flex: none; width: 20px; height: 20px; margin-top: 2px; border-radius: 50%; border: 2px solid var(--acf-soft); position: relative; }
.acf-opt.is-on { border-color: var(--acf-sel); background: var(--acf-sel-bg); }
.acf-opt.is-on .acf-dot { border-color: var(--acf-sel); }
.acf-opt.is-on .acf-dot::after { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--acf-sel); }
.acf-opt.is-key { border-color: var(--acf-ok); background: var(--acf-ok-bg); }
.acf-opt.is-miss { border-color: var(--acf-bad); background: var(--acf-bad-bg); }
.acf-opt.is-key::after { content: '✓'; margin-left: auto; font-weight: 800; color: var(--acf-ok); }
.acf-opt.is-miss::after { content: '✗'; margin-left: auto; font-weight: 800; color: var(--acf-bad); }
.acf-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.acf-chips .acf-opt { min-height: 44px; padding: 8px 12px; align-items: center; }
.acf-chips .acf-dot { margin-top: 0; }

/* data rows (tap the abnormal value) */
.acf-rows { display: grid; gap: 6px; }
.acf-row { display: grid; grid-template-columns: minmax(0, 1.25fr) auto; grid-template-areas: 'l v' 'r r'; gap: 0 10px; align-items: baseline; text-align: left; min-height: 48px; padding: 7px 12px; border-radius: 10px; border: 2px solid var(--acf-line); background: var(--acf-paper); cursor: pointer; }
.acf-row:hover:not(:disabled) { border-color: var(--acf-sel); }
.acf-row-l { grid-area: l; font-weight: 700; }
.acf-row-v { grid-area: v; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.acf-row-r { grid-area: r; font-size: 16px; color: var(--acf-soft); }
.acf-row.is-on { border-color: var(--acf-sel); background: var(--acf-sel-bg); }
.acf-row.is-key { border-color: var(--acf-ok); background: var(--acf-ok-bg); }
.acf-row.is-miss { border-color: var(--acf-bad); background: var(--acf-bad-bg); }
.acf-flag { font-size: 16px; font-weight: 800; padding: 0 6px; border-radius: 5px; margin-left: 6px; color: var(--acf-hi); background: var(--acf-hi-bg); }
.acf-slip { display: grid; gap: 6px; }
.acf-slip-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'l v' 'r r'; gap: 2px 10px; padding: 8px 12px; border-radius: 8px; background: var(--acf-paper); border: 1px dashed var(--acf-line); }
.acf-slip-title { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 16px; color: var(--acf-soft); }

/* feedback */
.acf-loop { display: flex; align-items: stretch; gap: 6px; flex-wrap: wrap; padding-left: 40px; }
.acf-loop-b { flex: 1 1 120px; padding: 6px 10px; border-radius: 8px; background: var(--acf-accent-bg); border: 1px solid var(--acf-accent); font-size: 16px; }
.acf-loop-b b { display: block; font-size: 16px; color: var(--acf-accent); text-transform: uppercase; letter-spacing: .05em; }
.acf-loop-a { align-self: center; font-weight: 800; color: var(--acf-accent); }
.acf-vars { display: grid; gap: 8px; }
.acf-var { display: grid; gap: 6px; padding: 8px 10px; border-radius: 10px; background: var(--acf-paper); border: 1px solid var(--acf-line); }
.acf-var.is-key { border-color: var(--acf-ok); box-shadow: inset 4px 0 0 var(--acf-ok); }
.acf-var.is-miss { border-color: var(--acf-bad); box-shadow: inset 4px 0 0 var(--acf-bad); }
.acf-var-l { font-weight: 700; }
.acf-dirs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.acf-dir { min-height: 44px; display: flex; align-items: center; justify-content: center; gap: 6px; border-radius: 8px; border: 2px solid var(--acf-line); background: var(--acf-paper2); cursor: pointer; font-size: 16px; font-weight: 700; padding: 4px 6px; }
.acf-dir svg { width: 18px; height: 18px; flex: none; }
.acf-dir.is-on { border-color: var(--acf-sel); background: var(--acf-sel-bg); color: var(--acf-sel); }
.acf-dir.is-key { border-color: var(--acf-ok); background: var(--acf-ok-bg); color: var(--acf-ok); }
.acf-dir.is-miss { border-color: var(--acf-bad); background: var(--acf-bad-bg); color: var(--acf-bad); }
.acf-dir.is-on.is-key::after { content: '✓'; }

/* chain */
.acf-chain { display: grid; gap: 6px; counter-reset: step; }
.acf-step { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 6px 12px; border-radius: 10px; border: 2px solid var(--acf-line); background: var(--acf-paper); cursor: pointer; text-align: left; transition: transform .18s, border-color .15s, background-color .15s; }
.acf-step-n { flex: none; width: 28px; height: 28px; display: inline-grid; place-items: center; border-radius: 50%; font-weight: 800; font-size: 16px; border: 2px dashed var(--acf-soft); color: var(--acf-soft); }
.acf-step.is-placed { border-color: var(--acf-accent); background: var(--acf-accent-bg); }
.acf-step.is-placed .acf-step-n { border-style: solid; border-color: var(--acf-accent); background: var(--acf-accent); color: #fff; }
html[data-theme="dark"] .acf-step.is-placed .acf-step-n { color: #0b1a20; }
.acf-step.is-key { border-color: var(--acf-ok); background: var(--acf-ok-bg); }
.acf-step.is-miss { border-color: var(--acf-bad); background: var(--acf-bad-bg); }
.acf-step.is-pop { animation: acf-pop .22s ease-out; }
@keyframes acf-pop { from { transform: scale(.96); } to { transform: none; } }
.acf-tray-k { font-size: 16px; color: var(--acf-soft); font-weight: 700; }

/* flawed reasoning */
.acf-steps { display: grid; gap: 6px; }
.acf-wstep { display: flex; gap: 10px; align-items: flex-start; min-height: 46px; text-align: left; padding: 7px 12px; border-radius: 10px; border: 2px solid var(--acf-line); background: var(--acf-paper); cursor: pointer; font-family: 'Segoe Print', 'Bradley Hand', 'Comic Sans MS', system-ui, cursive; }
.acf-wstep b { flex: none; font-family: system-ui, sans-serif; color: var(--acf-soft); }
.acf-wstep.is-on { border-color: var(--acf-sel); background: var(--acf-sel-bg); }
.acf-wstep.is-key { border-color: var(--acf-ok); background: var(--acf-ok-bg); }
.acf-wstep.is-miss { border-color: var(--acf-bad); background: var(--acf-bad-bg); }

/* structure picker */
.acf-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.acf-pick .acf-opt { min-height: 44px; padding: 6px 10px; align-items: center; }
.acf-pick .acf-num { flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--acf-accent); color: #fff; font-weight: 800; font-size: 16px; }
html[data-theme="dark"] .acf-pick .acf-num { color: #0b1a20; }
.acf-picked { font-size: 17px; }

/* calc */
.acf-given { width: 100%; border-collapse: collapse; font-size: 17px; }
.acf-given td { padding: 6px 8px; border-bottom: 1px solid var(--acf-line); }
.acf-given td:last-child { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.acf-formula { font-size: 18px; font-weight: 700; padding: 8px 12px; border-radius: 10px; background: var(--acf-accent-bg); border: 1px solid var(--acf-accent); color: var(--acf-ink); }
.acf-ans { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.acf-ans label { font-weight: 800; }
.acf-ans-box { display: inline-flex; align-items: stretch; border: 2px solid var(--acf-accent); border-radius: 10px; overflow: hidden; background: var(--acf-paper); }
.acf-in { width: 9.5em; min-height: 48px; border: 0; padding: 6px 12px; font: 700 19px system-ui; color: var(--acf-ink); background: transparent; text-align: right; }
.acf-unit { display: flex; align-items: center; padding: 0 12px; font-weight: 800; background: var(--acf-paper2); border-left: 1px solid var(--acf-line); }
.acf-reveal { padding: 8px 12px; border-radius: 10px; background: var(--acf-ok-bg); border: 1px solid var(--acf-ok); font-size: 17px; }
.acf.is-wrong .acf-reveal { background: var(--acf-hi-bg); border-color: var(--acf-hi); }

/* example in the Briefing */
.acf-ex { background: #fff; border-radius: 8px; padding: 4px; }
html[data-theme="dark"] .acf-ex { background: #121b23; }

@media (min-width: 1101px) { .acf-folder { height: 100%; } .acf-work { overflow: auto; } }
/* narrower stages: stack the pages */
@media (max-width: 1100px) {
  .acf-pages { grid-template-columns: minmax(0, 1fr); }
  .acf-fig-box > svg { height: auto; }
  .acf-fig { flex: none; }
}
@media (max-width: 1100px) and (min-width: 700px) { .acf-evidence .acf-fig-box > svg { max-height: 480px; } }
@media (max-width: 600px) {
  .acf { padding: 6px; }
  .acf-folder { padding: 6px; }
  .acf-page { padding: 8px; }
  .acf-story, .acf-loop { padding-left: 0; padding-top: 30px; }
  .acf-evidence::before { left: 14px; }
  .acf-dirs { grid-template-columns: minmax(0, 1fr); }
  .acf-in { width: 7em; }
}
@media (prefers-reduced-motion: reduce) {
  .acf-folder.is-in, .acf-folder.is-in .acf-work, .acf-step.is-pop, .acf-part.is-hl { animation: none; }
}

/* identify: system cards with organ thumbnails */
.acf-sys { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.acf-sysbtn { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 4px 8px; min-height: 44px; border-radius: 12px; border: 2px solid var(--acf-line); background: var(--acf-paper); cursor: pointer; transition: border-color .15s, background-color .15s, transform .12s; }
.acf-sysbtn:hover:not(:disabled) { border-color: var(--acf-sel); transform: translateY(-1px); }
.acf-sysbtn.is-on { border-color: var(--acf-sel); background: var(--acf-sel-bg); box-shadow: 0 0 0 2px var(--acf-sel) inset; }
.acf-sysbtn.is-key { border-color: var(--acf-ok); background: var(--acf-ok-bg); }
.acf-sysbtn.is-miss { border-color: var(--acf-bad); background: var(--acf-bad-bg); }
.acf-thumb { display: block; width: 100%; height: 74px; pointer-events: none; overflow: hidden; border-radius: 8px; }
.acf-thumb svg { width: 100%; height: 100%; }
.acf-svg.is-thumb .acf-labels, .acf-svg.is-thumb .acf-ctx-in, .acf-svg.is-thumb .acf-graph, .acf-svg.is-thumb .acf-band-t, .acf-svg.is-thumb .acf-gas { display: none; }
.acf-sys-t { font-size: 16px; font-weight: 700; text-align: center; line-height: 1.15; }
.acf-calc-q { color: var(--acf-hi); }
@media (max-width: 600px) { .acf-sys { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* scrolling layouts (the shell stacks its panels at 900 px and below): let the page scroll, not the stage */
@media (max-width: 900px) {
  .acf { position: static; overflow: visible; min-height: 100%; }
  .acf-folder { height: auto; }
}
/* phones: data figures keep a readable scale and scroll sideways inside their box; organ diagrams switch to the numbered key */
@media (max-width: 600px) {
  .acf-fig-box { overflow-x: auto; justify-content: flex-start; }
  .acf-fig-box > svg:not(.acf-organ) { min-width: 560px; }
}

.acf--structure .acf-fig.is-compact .acf-legend { display: none; }   /* the name list on the worksheet is the key */
