/* Virginia Court Outcomes — design tokens, layout and components.
   Chart colors follow the dataviz method: categorical slots --s1..--s8 (reference order), outcome buckets --b-*,
   active time --t0..--t2, record classes --rc0..--rc4 (ordinal), sequential --seq-*. Every set below was run through
   validate_palette for light (#fcfcfb) and dark (#1a1a19) surfaces. */
:root {
  color-scheme: light;
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Source Serif 4", Georgia, "Times New Roman", serif;
  --page: #f6f5f1; --surface: #fcfcfb; --surface-2: #f1f0eb; --surface-3: #e8e6df; --wash: rgba(17, 17, 16, 0.045);
  --ink: #111110; --ink-2: #47463f; --muted: #6b6962; --grid: #e6e4dd; --axis: #c3c2b7;
  --border: rgba(17, 17, 16, 0.10); --border-2: rgba(17, 17, 16, 0.18);
  --accent: #1c5cab; --accent-ink: #ffffff; --accent-wash: rgba(28, 92, 171, 0.09); --focus: #1c5cab;
  --shadow: 0 1px 2px rgba(17, 17, 16, 0.04), 0 2px 8px rgba(17, 17, 16, 0.04);
  --shadow-pop: 0 12px 32px rgba(17, 17, 16, 0.16), 0 2px 6px rgba(17, 17, 16, 0.08);
  /* categorical reference palette */
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #6250d6; --s8: #e34948;
  /* outcome buckets (contract families: as charged + fewer counts = greens; drops = blues; neutrals for pending/Unknown*) */
  --b-asch: #008300; --b-fewer: #6fb47a; --b-reduced: #e98916; --b-lesser: #88416c;
  --b-dropo: #4d92ca; --b-drop: #014da8; --b-ngri: #7f6cb4; --b-pend: #c3c1b8; --b-unk: #8a887f;
  /* active time (ordinal: none -> under 1 year -> 1 year or more) */
  --t0: #caaf4f; --t1: #db551d; --t2: #88303d; --b-trinf: #2a8c86; --t-unk: #b3ab98;
  /* defendant record classes (ordinal blue ramp) */
  --rc0: #86b6ef; --rc1: #5598e7; --rc2: #2a78d6; --rc3: #1c5cab; --rc4: #104281;
  --seq-0: #f0efec; --seq-1: #cde2fb; --seq-2: #9ec5f4; --seq-3: #6da7ec; --seq-4: #3987e5; --seq-5: #256abf; --seq-6: #184f95; --seq-7: #0d366b;
  --good: #006300; --crit: #d03b3b; --note-bg: #fbf3df; --note-rule: #d9a514;
  --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5l3 3 3-3' fill='none' stroke='%236b6962' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --r-card: 12px; --r-ctl: 8px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #10100f; --surface: #1a1a19; --surface-2: #232321; --surface-3: #2d2d2a; --wash: rgba(255, 255, 255, 0.05);
    --ink: #f0efec; --ink-2: #c9c8be; --muted: #9c9a91; --grid: #2c2c2a; --axis: #45453f;
    --border: rgba(255, 255, 255, 0.10); --border-2: rgba(255, 255, 255, 0.18);
    --accent: #6da7ec; --accent-ink: #0b0b0b; --accent-wash: rgba(109, 167, 236, 0.14); --focus: #86b6ef;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3); --shadow-pop: 0 12px 32px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.3);
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
    --b-asch: #7cc487; --b-fewer: #2f8a3f; --b-reduced: #c47905; --b-lesser: #b0628f;
    --b-dropo: #2f78d0; --b-drop: #8ec0ea; --b-ngri: #9483c9; --b-pend: #6b6a63; --b-unk: #8a887f;
    --t0: #9b932e; --t1: #9e3e06; --t2: #fd4460; --b-trinf: #4fb8b0; --t-unk: #6f6a5e;
    --rc0: #184f95; --rc1: #256abf; --rc2: #3987e5; --rc3: #6da7ec; --rc4: #9ec5f4;
    --seq-0: #2a2a28; --seq-1: #0d366b; --seq-2: #104281; --seq-3: #184f95; --seq-4: #256abf; --seq-5: #3987e5; --seq-6: #6da7ec; --seq-7: #b7d3f6;
    --good: #0ca30c; --crit: #e66767; --note-bg: #2b2414; --note-rule: #a37a0e;
    --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5l3 3 3-3' fill='none' stroke='%239c9a91' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #10100f; --surface: #1a1a19; --surface-2: #232321; --surface-3: #2d2d2a; --wash: rgba(255, 255, 255, 0.05);
  --ink: #f0efec; --ink-2: #c9c8be; --muted: #9c9a91; --grid: #2c2c2a; --axis: #45453f;
  --border: rgba(255, 255, 255, 0.10); --border-2: rgba(255, 255, 255, 0.18);
  --accent: #6da7ec; --accent-ink: #0b0b0b; --accent-wash: rgba(109, 167, 236, 0.14); --focus: #86b6ef;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3); --shadow-pop: 0 12px 32px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.3);
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
  --b-asch: #7cc487; --b-fewer: #2f8a3f; --b-reduced: #c47905; --b-lesser: #b0628f;
  --b-dropo: #2f78d0; --b-drop: #8ec0ea; --b-ngri: #9483c9; --b-pend: #6b6a63; --b-unk: #8a887f;
  --t0: #9b932e; --t1: #9e3e06; --t2: #fd4460; --b-trinf: #4fb8b0; --t-unk: #6f6a5e;
  --rc0: #184f95; --rc1: #256abf; --rc2: #3987e5; --rc3: #6da7ec; --rc4: #9ec5f4;
  --seq-0: #2a2a28; --seq-1: #0d366b; --seq-2: #104281; --seq-3: #184f95; --seq-4: #256abf; --seq-5: #3987e5; --seq-6: #6da7ec; --seq-7: #b7d3f6;
  --good: #0ca30c; --crit: #e66767; --note-bg: #2b2414; --note-rule: #a37a0e;
  --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5l3 3 3-3' fill='none' stroke='%239c9a91' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; background: var(--page); color: var(--ink); }
body { font: 15px/1.55 var(--font-ui); font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; overflow-x: hidden; }
body.noscroll { overflow: hidden; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
svg :focus-visible { outline: none; }
svg .hit:focus-visible, svg [tabindex]:focus-visible { outline: none; stroke: var(--focus); stroke-width: 2px; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: 8px; top: -48px; z-index: 100; background: var(--ink); color: var(--page); padding: 8px 12px; border-radius: 6px; text-decoration: none; }
.skip:focus { top: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- masthead & navigation ---------- */
header.top { background: var(--surface); border-bottom: 1px solid var(--border); }
.mast { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); min-width: 0; }
.brand-mark { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 8px; background: var(--ink); color: var(--surface); display: grid; place-items: center;
  font: 700 14px/1 var(--font-display); letter-spacing: 0.02em; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font: 650 19px/1.15 var(--font-display); letter-spacing: -0.01em; white-space: nowrap; }
.brand-org { font-size: 12px; color: var(--muted); letter-spacing: 0.01em; white-space: nowrap; }
.mast-meta { margin-left: auto; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-ctl); border: 1px solid var(--border); background: var(--surface);
  color: var(--ink-2); padding: 0; transition: background-color .15s, border-color .15s; }
.icon-btn:hover { background: var(--surface-2); border-color: var(--border-2); color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }
.theme-btn .ic-sun { display: none; }
:root[data-theme="dark"] .theme-btn .ic-sun { display: block; } :root[data-theme="dark"] .theme-btn .ic-moon { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .theme-btn .ic-sun { display: block; } :root:not([data-theme="light"]) .theme-btn .ic-moon { display: none; } }
nav.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
nav.tabs::-webkit-scrollbar { display: none; }
nav.tabs a { position: relative; flex: 0 0 auto; padding: 11px 12px 13px; font-size: 14px; font-weight: 500; color: var(--ink-2); text-decoration: none; white-space: nowrap; border-radius: 6px 6px 0 0; }
nav.tabs a:first-child { margin-left: -12px; }
nav.tabs a:hover { color: var(--ink); background: var(--wash); }
nav.tabs a.on { color: var(--ink); font-weight: 650; }
nav.tabs a.on::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--accent); }

/* ---------- filter bar (sticky) ---------- */
.filters { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--border); }
.filters[hidden] { display: none; }
.fbar { display: flex; align-items: center; gap: 12px; padding-top: 10px; padding-bottom: 10px; }
.fbar-toggle { display: none; }
.fpanel { display: flex; align-items: flex-end; gap: 12px; flex: 1; min-width: 0; }
.fpanel-head, .fpanel-foot #f_done { display: none; }
.fpanel-foot { margin-left: auto; }
.fgrid { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; min-width: 0; }
.f { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); min-width: 0; }
.f .row { display: flex; gap: 6px; align-items: center; color: var(--muted); text-transform: none; letter-spacing: 0; }
select, input[type=number], input[type=search], input[type=text], .f select, .f input {
  height: 36px; border: 1px solid var(--border-2); background-color: var(--surface); border-radius: var(--r-ctl); padding: 0 10px;
  font-size: 14px; font-weight: 450; letter-spacing: 0; text-transform: none; color: var(--ink); min-width: 0; transition: border-color .15s, box-shadow .15s; }
select { -webkit-appearance: none; appearance: none; padding-right: 30px; background-image: var(--chev); background-repeat: no-repeat; background-position: right 10px center; max-width: 100%; text-overflow: ellipsis; }
select:hover, input:hover { border-color: var(--axis); }
select:focus-visible, input:focus-visible { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px var(--accent-wash); }
input[type=number] { width: 74px; font-variant-numeric: tabular-nums; }
#f_basis { width: 146px; } #f_lvl { width: 204px; } #f_off { width: 180px; } #f_jur { width: 160px; } #f_rec { width: 182px; }
.fscrim { display: none; }

/* ---------- buttons, chips, segmented controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 18px; border-radius: var(--r-ctl); border: 1px solid transparent;
  background: var(--ink); color: var(--page); font-weight: 600; font-size: 14px; white-space: nowrap; transition: opacity .15s, background-color .15s; }
.btn:hover { opacity: .88; }
.btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--border-2); }
.btn.ghost:hover { background: var(--surface-2); opacity: 1; }
.chip-btn { border: 1px solid var(--border-2); background: var(--surface); border-radius: 999px; padding: 6px 12px; font-size: 13px; line-height: 1.3; color: var(--ink-2);
  text-align: left; transition: background-color .15s, border-color .15s, color .15s; }
.chip-btn:hover { background: var(--surface-2); color: var(--ink); border-color: var(--axis); }
.reset { align-self: flex-end; }
#f_reset { height: 36px; font-size: 13px; padding: 0 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.seg { display: inline-flex; padding: 2px; gap: 2px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: 0 0 auto; border: 0; background: none; border-radius: 7px; padding: 5px 11px; font-size: 13px; font-weight: 500; color: var(--ink-2); white-space: nowrap; transition: background-color .15s, color .15s; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 0 0 1px var(--border); }

/* ---------- page layout ---------- */
main { max-width: 1240px; margin: 0 auto; padding: 8px 24px 80px; outline: none; }
main [id], main h2 { scroll-margin-top: 96px; }
main.stale > * { opacity: .5; transition: opacity .2s; pointer-events: none; }
.takeaways:empty { display: none; }
.takeaways { margin: 24px 0 0; }

/* ---------- key takeaways carousel (takeaways.js) ---------- */
:root { --tk-na: var(--surface-3); }
.tk { position: relative; border: 1px solid var(--border); border-radius: 16px; padding: 16px 24px 12px; box-shadow: var(--shadow); overflow: hidden;
  background: radial-gradient(120% 150% at 100% 0%, var(--accent-wash), transparent 58%), var(--surface); }
.tk::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: linear-gradient(var(--accent), color-mix(in srgb, var(--accent) 20%, transparent)); }
.tk-wait { min-height: 300px; }
.tk-wait .loading { padding: 16px 0; }
.tk-top { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 14px; }
.tk-title { margin: 0; font-size: 11.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink); }
.tk-note { font-size: 12.5px; color: var(--muted); }
.tk-nav { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.tk-count { min-width: 3.2em; text-align: right; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; margin-right: 4px; }
.tk-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; border-radius: 999px; border: 1px solid var(--border-2); background: var(--surface);
  color: var(--ink-2); transition: background-color .15s, color .15s, border-color .15s; }
.tk-btn:hover { background: var(--surface-2); color: var(--ink); border-color: var(--axis); }
.tk-btn svg { width: 16px; height: 16px; }
.tk-track { display: grid; margin-top: 14px; touch-action: pan-y; }
.tk-slide { grid-area: 1 / 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px 40px; align-items: center; min-width: 0;
  visibility: hidden; opacity: 0; transform: translateX(var(--tk-dx, 18px)); transition: opacity .3s ease, transform .3s ease, visibility 0s linear .3s; }
.tk-slide.on { visibility: visible; opacity: 1; transform: none; transition: opacity .3s ease, transform .3s ease; }
.tk-slide.no-viz { grid-template-columns: minmax(0, 1fr); }
.tk-slide.wide { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); }
.tk-text { min-width: 0; }
.tk-kicker { margin: 0 0 8px; font-size: 12px; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.tk-fact { margin: 0; }
.tk-big { display: block; margin-bottom: 8px; font: 700 clamp(40px, 4.6vw, 56px)/1 var(--font-ui); letter-spacing: -0.03em; color: var(--ink); font-variant-numeric: proportional-nums; }
.tk-head { display: block; font: 600 clamp(18px, 1.7vw, 21px)/1.3 var(--font-display); letter-spacing: -0.006em; color: var(--ink); text-wrap: balance; }
.tk-ctx { margin: 10px 0 0; font-size: 14.5px; line-height: 1.55; color: var(--ink-2); max-width: 64ch; text-wrap: pretty; }
.tk-src { margin: 12px 0 0; font-size: 12px; line-height: 1.45; color: var(--muted); max-width: 72ch; }
.tk-viz { min-width: 0; }
.tk-dots { display: flex; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.tk-d { display: grid; place-items: center; min-width: 26px; height: 26px; padding: 0 3px; border: 0; background: none; border-radius: 999px; }
.tk-d::before { content: ""; width: 8px; height: 8px; border-radius: 999px; background: var(--axis); transition: width .25s ease, background-color .25s; }
.tk-d:hover::before { background: var(--muted); }
.tk-d[aria-current="true"]::before { width: 24px; background: var(--accent); }
.tk-foot { margin: 8px 0 0; padding-top: 8px; border-top: 1px solid var(--border); font-size: 11.5px; line-height: 1.45; color: var(--muted); }
/* mini bars */
.tk-bars { display: grid; gap: 7px; margin-top: 4px; font-size: 13px; }
.tk-text .tk-bars { margin-top: 14px; max-width: 520px; }
.tk-bar { display: grid; grid-template-columns: 13.5em minmax(40px, 1fr) minmax(3.2em, auto); gap: 10px; align-items: center; color: var(--ink-2); }
.tk-bars.sm { gap: 5px; font-size: 12.5px; }
.tk-bars.sm .tk-bar { grid-template-columns: 14.2em minmax(40px, 1fr) 3.2em; }
.tk-bl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-bt { position: relative; height: 10px; border-radius: 999px; background: var(--wash); overflow: hidden; }
.tk-bars.sm .tk-bt { height: 8px; }
.tk-bt i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; }
.tk-bar b { font-weight: 650; color: var(--ink-2); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.tk-bar.on .tk-bl, .tk-bar.on b { color: var(--ink); font-weight: 650; }
.tk-bars:has(.on) .tk-bar:not(.on) .tk-bt i { opacity: .55; }
.tk-div .tk-bt { overflow: visible; }
.tk-div .tk-bt::before { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--axis); }
.tk-div .tk-bt i { border-radius: 3px; }
/* donut */
.tk-donut { display: flex; align-items: center; gap: 22px; }
.tk-donut svg { flex: 0 0 auto; width: 148px; height: 148px; }
.tk-donut path { stroke: var(--surface); stroke-width: 1; }
.tk-dc { text-anchor: middle; font: 700 19px var(--font-ui); fill: var(--ink); }
.tk-ds { text-anchor: middle; font: 500 9.5px var(--font-ui); fill: var(--muted); }
.tk-leg { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; font-size: 12.5px; min-width: 0; flex: 1; }
.tk-leg li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 8px; align-items: center; color: var(--ink-2); }
.tk-leg i { width: 10px; height: 10px; border-radius: 3px; }
.tk-leg span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-leg b { color: var(--ink); font-weight: 650; font-variant-numeric: tabular-nums; }
/* histogram columns */
.tk-cols { display: flex; align-items: stretch; gap: 6px; height: 170px; }
.tk-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; min-width: 0; }
.tk-col i { display: block; width: 100%; max-width: 30px; border-radius: 4px 4px 0 0; background: var(--s1); opacity: .75; }
.tk-col.on i { background: var(--s2); opacity: 1; }
.tk-col b { font-size: 12px; font-weight: 650; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.tk-col span { font-size: 11px; color: var(--muted); border-top: 1px solid var(--axis); width: 100%; text-align: center; padding-top: 3px; }
.tk-col span::after { content: "%"; }
/* sparkline */
.tk-spark svg { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--font-ui); }
.tk-line { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.tk-base { stroke: var(--axis); }
.tk-pk { fill: var(--surface); stroke-width: 2; }
.tk-sv { font-size: 12px; font-weight: 600; fill: var(--ink-2); font-variant-numeric: tabular-nums; }
.tk-sv.on { font-size: 13px; font-weight: 700; fill: var(--ink); }
.tk-sx { font-size: 11.5px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.tk-cross { stroke: var(--axis); stroke-dasharray: 3 3; }
.tk-hit { fill: transparent; cursor: crosshair; }
/* map */
.tk-map-svg { position: relative; aspect-ratio: 2.17; display: grid; place-items: center; }
.tk-map-svg svg { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--font-ui); }
.tk-map-svg path[data-c] { stroke-width: 0.6; stroke-linejoin: round; }
.tk-map-svg path[data-c]:hover { filter: brightness(1.08) saturate(1.1); }
.tk-map-load { font-size: 12.5px; color: var(--muted); }
.tk-in { fill: none; stroke: var(--surface); stroke-width: 0.9; stroke-linejoin: round; pointer-events: none; }
.tk-out { fill: none; stroke: var(--axis); stroke-width: 0.8; pointer-events: none; }
.tk-mk { fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linejoin: round; pointer-events: none; }
.tk-mk.sel { stroke: var(--s2); stroke-width: 2.4; }
.tk-ml { font-weight: 700; fill: var(--ink); paint-order: stroke; stroke: var(--surface); stroke-width: 3.5px; stroke-linejoin: round; pointer-events: none; }
.tk-mleg { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tk-mleg span { display: inline-flex; align-items: center; gap: 5px; }
.tk-mleg i { width: 14px; height: 10px; border-radius: 2px; }
.tk-mleg i.na { background: var(--tk-na); }
.tk-mleg i.sel { background: none; border: 2px solid var(--s2); }
/* statute card: a clean excerpt of the Code of Virginia */
.tk-law { position: relative; margin: 0; padding: 16px 18px 14px 20px; border: 1px solid var(--border-2); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow); }
.tk-law::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--note-rule); }
.tk-law-sec + .tk-law-sec { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border-2); }
.tk-law-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.tk-law-code { font-size: 10.5px; font-weight: 650; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.tk-law-n { font: 700 17px/1.2 var(--font-display); color: var(--ink); white-space: nowrap; }
.tk-law-t { margin: 3px 0 8px; font: 500 13px/1.35 var(--font-display); color: var(--ink-2); }
.tk-law blockquote { margin: 0; font: 400 14px/1.55 var(--font-display); color: var(--ink); quotes: "\201C" "\201D"; text-wrap: pretty; }
.tk-law blockquote::before { content: open-quote; } .tk-law blockquote::after { content: close-quote; }
.tk-law-a { display: inline-block; margin-top: 8px; font-size: 12px; font-weight: 600; }
@media (max-width: 899px) {
  .tk-slide, .tk-slide.wide { grid-template-columns: minmax(0, 1fr); align-items: start; gap: 16px; }
}
@media (max-width: 720px) {
  .takeaways { margin-top: 16px; }
  .tk { padding: 14px 16px 10px; border-radius: 14px; }
  .tk-note { display: none; }
  .tk-big { font-size: 40px; }
  .tk-head { font-size: 18px; }
  .tk-ctx { font-size: 14px; }
  .tk-bar, .tk-bars.sm .tk-bar { grid-template-columns: minmax(0, 12.5em) minmax(32px, 1fr) minmax(2.8em, auto); gap: 8px; }
  .tk-donut { gap: 14px; }
  .tk-donut svg { width: 116px; height: 116px; }
  .tk-cols { height: 130px; }
  .tk-law { padding: 12px 14px 12px 16px; }
  .tk-law-t { margin-bottom: 6px; }
  /* Phones: the statute shows its opening lines (the link has the full text), and the outcome bars beside a statute give
     way to the sentence that carries the same comparison, so every slide fits about one screen. */
  .tk-law blockquote { font-size: 13px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 5; line-clamp: 5; overflow: hidden; }
  .tk-law-sec + .tk-law-sec { margin-top: 8px; padding-top: 8px; }
  .tk-law-sec + .tk-law-sec blockquote, .tk-law:has(.tk-law-sec + .tk-law-sec) blockquote { -webkit-line-clamp: 3; line-clamp: 3; }
  .tk-law:has(.tk-law-sec + .tk-law-sec) .tk-law-t { display: none; }
  .tk-law:has(.tk-law-sec + .tk-law-sec) .tk-law-h { margin-bottom: 4px; }
  .tk-text .tk-bars { display: none; }
  .tk-src { margin-top: 10px; font-size: 11.5px; }
  .tk-foot { font-size: 11px; }
  .tk-slide, .tk-slide.wide { gap: 12px; }
}
@media (prefers-reduced-motion: reduce) { .tk-slide { transform: none !important; } }
@media print { .tk-nav, .tk-dots { display: none; } }
.phead { padding: 32px 0 24px; margin-bottom: 24px; border-bottom: 1px solid var(--border); }
.kicker { margin: 0 0 10px; font-size: 12px; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
h1, h2 { font-family: var(--font-display); font-weight: 650; letter-spacing: -0.012em; color: var(--ink); }
h1 { font-size: clamp(30px, 3.6vw, 42px); line-height: 1.1; margin: 0 0 12px; text-wrap: balance; }
h2 { font-size: 24px; line-height: 1.2; margin: 48px 0 14px; }
h3 { font-size: 15.5px; font-weight: 650; line-height: 1.35; margin: 0 0 4px; letter-spacing: -0.003em; }
.lede { font-size: 18px; line-height: 1.5; color: var(--ink-2); max-width: 760px; margin: 0; text-wrap: pretty; }
.intro { font-size: 14px; color: var(--ink-2); max-width: 820px; margin: 14px 0 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
p.small, p.muted.small { line-height: 1.5; }
.card p.muted.small:last-child { margin-bottom: 0; }
.fchips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.fchip-wrap { display: inline-flex; align-items: stretch; border: 1px solid var(--border-2); border-radius: 999px; background: var(--surface); overflow: hidden; }
.fchip { display: inline-flex; align-items: baseline; gap: 6px; border: 0; background: none; padding: 5px 12px; font-size: 13px; color: var(--ink); line-height: 1.35; text-align: left; }
.fchip .k { font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
button.fchip:hover { background: var(--surface-2); }
.fchip-wrap.on { border-color: var(--accent); background: var(--accent-wash); }
.fchip-wrap.on .fchip { padding-right: 6px; }
.fchip-x { border: 0; background: none; color: var(--ink-2); padding: 0 10px 0 4px; font-size: 15px; line-height: 1; }
.fchip-x:hover { color: var(--ink); }
.fchip-wrap.fixed { background: var(--surface-2); }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); }

/* ---------- cards & tiles ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: 20px 22px; min-width: 0; box-shadow: var(--shadow); }
.card > h3:first-child, .card > h2:first-child { margin-top: 0; }
.card > h3 + .muted.small, .card > h3 + p.small { margin-top: 0; }
.card > h3 + div, .card > h2 + div { margin-top: 12px; }
.card.link { text-decoration: none; color: inherit; display: flex; flex-direction: column; transition: border-color .15s, transform .15s, box-shadow .15s; }
.card.link h3 { font-family: var(--font-display); font-size: 19px; font-weight: 650; margin-bottom: 6px; }
.card.link:hover { border-color: var(--border-2); box-shadow: var(--shadow-pop); transform: translateY(-1px); }
.card.link p { flex: 1; }
.card .go { color: var(--accent); font-size: 13.5px; font-weight: 600; margin-top: 8px; }
.tile { display: flex; flex-direction: column; gap: 4px; padding: 18px 20px; }
.tile .l { order: -1; color: var(--ink-2); font-size: 13px; font-weight: 600; line-height: 1.35; }
.tile .v { font-size: 34px; font-weight: 650; line-height: 1.05; letter-spacing: -0.02em; color: var(--ink); font-variant-numeric: proportional-nums; }
.tile .s { color: var(--muted); font-size: 12.5px; line-height: 1.45; margin-top: 2px; }
.tile.click { cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.tile.click:hover { border-color: var(--border-2); box-shadow: var(--shadow-pop); }
.note { background: var(--note-bg); border-left: 3px solid var(--note-rule); border-radius: 0 8px 8px 0; padding: 10px 14px; font-size: 13.5px; color: var(--ink-2); margin: 12px 0; max-width: 900px; }
.pill { display: inline-block; border-radius: 999px; padding: 1px 9px; font-size: 12px; font-weight: 500; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; vertical-align: 2px; }
.pill.crit { background: color-mix(in srgb, var(--crit) 16%, transparent); color: var(--ink); }
.loading { color: var(--muted); padding: 40px 0; font-size: 14px; }
.loading::before { content: ""; display: inline-block; width: 14px; height: 14px; margin-right: 10px; vertical-align: -2px; border-radius: 50%;
  border: 2px solid var(--grid); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
main.enter > * { animation: rise .28s ease-out both; }

/* page-level controls inside a card (Trends, Compare courts, Murder, Fairfax) */
.spec { display: flex; flex-wrap: wrap; gap: 10px 14px; margin: 8px 0; align-items: center; font-size: 13px; }
.card > .spec { margin: 0; }
.spec label { color: var(--muted); font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; }
.spec select, .spec input { height: 34px; font-size: 13.5px; }
.spec input[type=number] { width: 76px; }

/* ---------- home hero & Ask ---------- */
.phead.hero { padding: 44px 0 32px; }
.phead.hero h1 { font-size: clamp(34px, 4.6vw, 54px); max-width: 860px; }
.phead.hero .lede { font-size: 19px; }
.askbox { display: flex; gap: 8px; margin-top: 22px; max-width: 860px; }
.askbox input { flex: 1; height: 52px; border: 1px solid var(--border-2); border-radius: 10px; padding: 0 16px; font-size: 16px; background: var(--surface); min-width: 0; box-shadow: var(--shadow); }
.askbox input:focus-visible { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px var(--accent-wash); }
.askbox .btn { height: 52px; padding: 0 22px; border-radius: 10px; }
.askbox.sm input, .askbox.sm .btn { height: 44px; }
.hero .chips { max-width: 860px; }
.chat { display: flex; flex-direction: column; gap: 16px; }
.msg.q { align-self: flex-end; background: var(--ink); color: var(--page); border-radius: 16px 16px 4px 16px; padding: 10px 16px; max-width: min(80%, 680px); font-weight: 500; }
.msg.a { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: 20px 22px; box-shadow: var(--shadow); min-width: 0; }
.msg.a .headline { font-size: 19px; font-weight: 600; line-height: 1.4; margin: 0 0 10px; }
.big { font-size: 38px; font-weight: 700; line-height: 1.05; letter-spacing: -0.02em; margin-right: 4px; }
.msg.a .spec { gap: 8px 10px; }
.msg.a .spec label { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; }
.ans-tools { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin: 16px 0 4px; font-size: 13px; }
.ans-tools select { height: 32px; font-size: 13px; }
.viz-title { font-weight: 650; font-size: 15.5px; margin: 14px 0 0; }
.viz-sub { color: var(--muted); font-size: 12.5px; margin: 2px 0 10px; }
.hc { border-radius: 4px; padding: 3px 7px; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
details > summary { cursor: pointer; }
details > summary:focus-visible { outline-offset: 4px; }

/* ---------- charts ---------- */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--font-ui); }
.chart text { fill: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.chart .grid line { stroke: var(--grid); shape-rendering: crispEdges; }
.chart .grid text { fill: var(--muted); }
.chart .domain { stroke: var(--axis); shape-rendering: crispEdges; }
.chart .tick line { stroke: var(--grid); }
.chart .xaxis .tick line { display: none; }
.chart .lbl { fill: var(--ink-2); font-size: 12.5px; }
.chart .val { fill: var(--ink-2); font-size: 12px; font-weight: 600; }
.chart .endlbl { fill: var(--ink-2); font-size: 12px; font-weight: 600; }
.chart .hl { fill: var(--wash); }
.chart .row:hover .hl, .chart .row:focus-within .hl, .chart .col.on .hl { fill: var(--wash); opacity: 1; }
.chart .row .hl, .chart .col .hl { opacity: 0; transition: opacity .12s; }
.chart .row.click { cursor: pointer; }
.chart .bar { transition: opacity .12s; }
.chart .row:hover .bar, .chart .row:focus .bar { opacity: .82; }
.chart .hit { fill: transparent; }
.chart.scroll { overflow-x: auto; }
.vz-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 16px; margin: 4px 0 10px; }
.vz-head .legend { margin: 0; flex: 1 1 260px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--ink-2); margin: 4px 0 10px; line-height: 1.4; }
.legend > span { display: inline-flex; align-items: center; }
.legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 7px; flex: 0 0 auto; }
.legend .sw-line { width: 14px; height: 3px; border-radius: 2px; }
.tip { position: fixed; pointer-events: none; z-index: 60; background: var(--surface); color: var(--ink); border: 1px solid var(--border-2); border-radius: 10px; padding: 10px 12px;
  font-size: 12.5px; line-height: 1.45; box-shadow: var(--shadow-pop); max-width: 320px; display: none; }
.tip b { font-variant-numeric: tabular-nums; font-weight: 650; }
.tip .muted { color: var(--muted); }
.tt-h { font-weight: 650; margin-bottom: 6px; color: var(--ink); }
.tt-v { font-size: 18px; font-weight: 650; line-height: 1.2; }
.tt-r { display: grid; grid-template-columns: 12px auto 1fr; gap: 8px; align-items: center; padding: 1px 0; color: var(--ink-2); }
.tt-r i { width: 12px; height: 3px; border-radius: 2px; }
.tt-r b { color: var(--ink); text-align: right; min-width: 3.2em; }
.tt-r.on span { color: var(--ink); font-weight: 600; }
.tt-r.on { background: var(--wash); margin: 0 -6px; padding: 1px 6px; border-radius: 4px; }
.tt-f { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; }
.heat { border-collapse: separate; border-spacing: 3px; }
.heat td.cell { text-align: center; font-variant-numeric: tabular-nums; border-radius: 6px; padding: 10px 6px; min-width: 66px; font-size: 13px; font-weight: 500; cursor: default; transition: box-shadow .12s; }
.heat td.cell:hover { box-shadow: 0 0 0 2px var(--ink); }
.heat th { font-size: 12px; color: var(--ink-2); font-weight: 600; padding: 4px 6px; text-align: center; white-space: nowrap; }

/* donut */
.donut { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.donut .chart { flex: 0 0 auto; width: auto; }
.donut .chart svg { width: 100%; }
.donut path { transition: opacity .15s; }
.donut.dim path:not(.on) { opacity: .3; }
.dleg { list-style: none; margin: 0; padding: 0; flex: 1 1 220px; font-size: 13px; min-width: 0; }
.dleg li { display: grid; grid-template-columns: 10px 1fr auto 4.2em; gap: 10px; align-items: center; padding: 5px 8px; border-radius: 6px; color: var(--ink-2); transition: background-color .12s; }
.dleg li:hover, .dleg li.on { background: var(--wash); color: var(--ink); }
.dleg li.click { cursor: pointer; }
.dleg i { width: 10px; height: 10px; border-radius: 3px; }
.dleg b { font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 650; }
.dleg em { font-style: normal; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; font-size: 12px; }
.sankey path.link { transition: opacity .12s; }

/* ---------- tables ---------- */
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl { border: 1px solid var(--border); border-radius: 10px; }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.t th { text-align: left; font-weight: 600; color: var(--ink-2); background: var(--surface-2); border-bottom: 1px solid var(--border-2); padding: 0; font-size: 12.5px; line-height: 1.3; vertical-align: bottom; min-width: 4.5em; }
table.t th.n { max-width: 8.5em; }
table.t td:not(.n) { min-width: 8em; }
table.t th button { display: flex; align-items: center; gap: 4px; width: 100%; border: 0; background: none; padding: 9px 10px; font: inherit; color: inherit; text-align: inherit; }
table.t th.n button { justify-content: flex-end; }
table.t th button:hover { color: var(--ink); }
table.t th[aria-sort="ascending"], table.t th[aria-sort="descending"] { color: var(--ink); }
table.t th .si { font-size: 10px; color: var(--accent); min-width: 8px; }
table.t:not(.chron) th:not(:has(button)) { padding: 9px 10px; }
table.t td { border-bottom: 1px solid var(--grid); padding: 8px 10px; vertical-align: top; }
table.t tbody tr:last-child td { border-bottom: 0; }
table.t td.n, table.t th.n { text-align: right; font-variant-numeric: tabular-nums; }
table.t tr.click { cursor: pointer; }
table.t tbody tr:hover td { background: var(--wash); }
table.t tr.click:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.chron th { padding: 9px 10px; }
.chron td { font-size: 13px; }

/* ---------- Fairfax homicides ---------- */
.fx h2 { font-size: 21px; margin: 0 0 4px; }
.fx h2.sec { font-size: 26px; margin: 48px 0 14px; }
.fx .card > h2 + .muted { margin-top: 0; }
.fx .case h3, .fx .ng h3 { font-family: var(--font-display); font-weight: 600; }
.fx-controls { margin-bottom: 16px; }
.fx-tiles { grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); }
.fx-tools { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.fx-tools input { flex: 1 1 240px; }
.fx-table .scroll { max-height: 560px; overflow: auto; }
.fx-table th { position: sticky; top: 0; z-index: 1; }
.fx-table td:nth-child(2), .fx-table td:nth-child(4) { white-space: nowrap; }
.who { display: flex; gap: 10px; align-items: center; min-width: 220px; }
.who > span { display: flex; flex-direction: column; }
.thumb { width: 34px; height: 42px; flex: 0 0 34px; border-radius: 5px; object-fit: cover; object-position: top; background: var(--surface-2); }
.noimg { display: inline-flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; font-weight: 600; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.case { display: grid; grid-template-columns: 180px 1fr; gap: 24px; }
.case figure { margin: 0; }
.case figcaption { font-size: 11px; color: var(--muted); margin-top: 4px; }
.mug { display: flex; width: 180px; height: 225px; border-radius: 8px; object-fit: cover; object-position: top; background: var(--surface-2); font-size: 36px; }
.mug.sm { width: 96px; height: 120px; font-size: 22px; }
.case h3 { font-size: 26px; margin: 0 0 2px; }
.case .summary { max-width: 75ch; margin: 0 0 12px; }
dl.kv { display: grid; grid-template-columns: minmax(8rem, max-content) 1fr; gap: 5px 16px; margin: 0; font-size: 13px; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.ng { display: grid; grid-template-columns: 96px 1fr; gap: 16px; }
.ng h3 { font-size: 19px; }

/* ---------- defendants ---------- */
.person { border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface); padding: 20px 22px; margin-top: 16px; box-shadow: var(--shadow); }
.person h3 { font-family: var(--font-display); }
.badge-rec { font-size: 12px; }

/* ---------- method page ---------- */
.prose { max-width: 820px; font-size: 15.5px; line-height: 1.65; }
.prose h3 { font-family: var(--font-display); font-size: 20px; font-weight: 650; margin: 28px 0 6px; }
.prose h3:first-child { margin-top: 0; }
.prose li { margin: 6px 0; }

/* ---------- footer & Method shortcut ---------- */
footer.site { border-top: 1px solid var(--border); background: var(--surface); margin-top: 24px; }
.foot { display: grid; grid-template-columns: 1.1fr 1.6fr 1fr; gap: 24px 40px; padding-top: 36px; padding-bottom: 40px; font-size: 13.5px; color: var(--ink-2); }
.foot h2 { font-family: var(--font-ui); font-size: 11.5px; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.foot p { margin: 0; }
.foot-brand b { font: 650 18px/1.2 var(--font-display); color: var(--ink); display: block; margin-bottom: 6px; }
.foot-nav { display: flex; flex-direction: column; gap: 6px; }
.foot-nav a { color: var(--ink); text-decoration: none; }
.foot-nav a:hover { text-decoration: underline; }
.method-fab { position: fixed; right: 20px; bottom: 20px; z-index: 15; display: inline-flex; align-items: center; gap: 6px; background: var(--surface); color: var(--ink-2);
  border: 1px solid var(--border-2); border-radius: 999px; padding: 8px 14px; font-size: 13px; font-weight: 600; text-decoration: none; box-shadow: var(--shadow-pop); transition: color .15s; }
.method-fab:hover { color: var(--ink); }
body[data-page="method"] .method-fab, body[data-page="ask"] .method-fab { display: none; }

/* ---------- tablet & phone ---------- */
@media (max-width: 1099px) {
  .fbar { padding-top: 8px; padding-bottom: 8px; }
  .fbar-toggle { display: flex; align-items: center; gap: 8px; width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--border-2); border-radius: var(--r-ctl);
    background: var(--surface); font-size: 14px; font-weight: 600; color: var(--ink); text-align: left; min-width: 0; }
  .fbar-toggle .ic { width: 16px; height: 16px; flex: 0 0 auto; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; }
  .fbar-n { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 11.5px; font-weight: 700; }
  .fbar-sum { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 400; color: var(--muted); font-size: 13px; }
  .fpanel { position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; max-height: 86vh; overflow-y: auto; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--surface); border-radius: 16px 16px 0 0; box-shadow: var(--shadow-pop); transform: translateY(105%); visibility: hidden;
    transition: transform .24s ease, visibility 0s linear .24s; padding: 0 16px calc(16px + env(safe-area-inset-bottom)); }
  .fpanel.open { transform: none; visibility: visible; transition: transform .24s ease; }
  .fpanel-head { display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; background: var(--surface); padding: 14px 0 10px; border-bottom: 1px solid var(--border); font-size: 16px; z-index: 1; }
  .fgrid { flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: 14px; padding: 16px 0; }
  .fgrid .f select, .fgrid .f input, #f_basis, #f_lvl, #f_off, #f_jur, #f_rec { width: 100%; max-width: none; height: 44px; font-size: 16px; }
  .fgrid .f .row input { flex: 1; }
  .fpanel-foot { display: flex; gap: 10px; margin: 0; padding-top: 12px; border-top: 1px solid var(--border); position: sticky; bottom: 0; background: var(--surface); }
  .fpanel-foot .btn, .fpanel-foot #f_done { display: inline-flex; flex: 1; height: 44px; }
  .fscrim { display: block; position: fixed; inset: 0; z-index: 65; background: rgba(0, 0, 0, .38); opacity: 0; visibility: hidden; transition: opacity .2s, visibility 0s linear .2s; }
  .filters.open .fscrim { opacity: 1; visibility: visible; transition: opacity .2s; }
  .filters { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--surface); }
  .mast-meta { display: none; }
  .theme-btn { margin-left: auto; }
}
@media (max-width: 720px) {
  .wrap, main { padding-left: 16px; padding-right: 16px; }
  body { font-size: 15px; }
  .mast { min-height: 56px; gap: 12px; }
  .brand-mark { width: 30px; height: 30px; font-size: 12.5px; }
  .brand-name { font-size: 17px; }
  .brand-org { display: none; }
  nav.tabs a { padding: 10px 10px 12px; font-size: 13.5px; }
  nav.tabs a:first-child { margin-left: -10px; }
  nav.tabs a.on::after { left: 10px; right: 10px; }
  nav.tabs { -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
  .phead { padding: 22px 0 18px; margin-bottom: 18px; }
  .phead.hero { padding: 28px 0 22px; }
  .lede, .phead.hero .lede { font-size: 16.5px; }
  h2 { font-size: 21px; margin-top: 36px; }
  .card, .msg.a, .person { padding: 16px; }
  .tile { padding: 14px 16px; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .fx-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile .v { font-size: 26px; }
  .askbox { flex-direction: column; }
  .askbox input, .askbox .btn { height: 48px; flex: none; }
  .case { grid-template-columns: 1fr; } .mug { width: 140px; height: 175px; }
  .ng { grid-template-columns: 72px 1fr; } .mug.sm { width: 72px; height: 90px; }
  .method-fab { display: none; }
  .foot { grid-template-columns: 1fr; gap: 20px; }
  .donut { gap: 14px; }
  .donut .chart { margin: 0 auto; }
  .card > .spec label { flex: 1 1 100%; justify-content: space-between; min-width: 0; }
  .card > .spec label select { flex: 1 1 0; width: 0; min-width: 0; max-width: 72%; }
  .spec select { max-width: 100%; }
  .msg.q { max-width: 92%; }
  .big { font-size: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) { .legend .sw, .dleg i, .tt-r i { forced-color-adjust: none; } }
@media print {
  .filters, .theme-btn, .method-fab, nav.tabs, .fbar-toggle { display: none !important; }
  .card { box-shadow: none; break-inside: avoid; }
  body { background: #fff; }
}
