/* Quorum design system. Vendored variable fonts (OFL) and icons (ISC); nothing loads from a CDN.
   Brand: indigo for action, a rose "signal" for the one thing that needs you, warm paper, calm ink. */
@font-face { font-family: "Inter"; src: url("../fonts/inter-var.260c81a4759b.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("../fonts/fraunces-var.eb2486760f75.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/jetbrains-mono-var.b058178d7f30.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }
:root {
  --paper: #faf9f6; --panel: #ffffff; --sunk: #f3f1ec; --line: #e7e3db; --line-strong: #cfc9bd; --field: #8a857b;
  --ink: #14161b; --ink-2: #3a3f4a; --muted: #5f6573; --faint: #9aa0ab;
  --accent: #3a3fd9; --accent-ink: #ffffff; --accent-soft: #ecedfd; --accent-line: #c3c5f6; --accent-strong: #2b2fb3;
  --signal: #d63a62; --signal-soft: #fde8ee;
  --good: #1c7547; --good-soft: #e2f3e9; --warn: #8f5400; --warn-soft: #fbf0dc; --bad: #b3261e; --bad-soft: #fbe6e4;
  --tie: #7042c9; --tie-soft: #efe8fc;
  --q: var(--accent); --q-signal: #e5486e;
  --shadow: 0 1px 2px rgba(20, 22, 30, .05), 0 6px 20px -8px rgba(20, 22, 30, .10);
  --shadow-lg: 0 2px 4px rgba(20, 22, 30, .06), 0 24px 48px -16px rgba(20, 22, 30, .22);
  --ring: 0 0 0 3px var(--accent-soft);
  --radius: 12px; --radius-sm: 8px;
  --sans: "Inter", ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --serif: "Fraunces", ui-serif, "New York", "Iowan Old Style", Georgia, Cambria, serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0d0f14; --panel: #151821; --sunk: #1b1f2a; --line: #262b37; --line-strong: #363c4a; --field: #6c7487;
    --ink: #eceef2; --ink-2: #c7cbd4; --muted: #9ba2b1; --faint: #6c7383;
    --accent: #9aa0ff; --accent-ink: #0d0f14; --accent-soft: #1e2244; --accent-line: #3a4180; --accent-strong: #b8bcff;
    --signal: #ff7a98; --signal-soft: #36161f;
    --good: #5fd39a; --good-soft: #13291f; --warn: #f0b457; --warn-soft: #2b2212; --bad: #ff8a80; --bad-soft: #2d1616;
    --tie: #b79bff; --tie-soft: #241b3b; --q-signal: #ff7a98;
    --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-lg: 0 24px 48px -12px rgba(0,0,0,.6); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0d0f14; --panel: #151821; --sunk: #1b1f2a; --line: #262b37; --line-strong: #363c4a; --field: #6c7487;
  --ink: #eceef2; --ink-2: #c7cbd4; --muted: #9ba2b1; --faint: #6c7383;
  --accent: #9aa0ff; --accent-ink: #0d0f14; --accent-soft: #1e2244; --accent-line: #3a4180; --accent-strong: #b8bcff;
  --signal: #ff7a98; --signal-soft: #36161f;
  --good: #5fd39a; --good-soft: #13291f; --warn: #f0b457; --warn-soft: #2b2212; --bad: #ff8a80; --bad-soft: #2d1616;
  --tie: #b79bff; --tie-soft: #241b3b; --q-signal: #ff7a98;
  --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-lg: 0 24px 48px -12px rgba(0,0,0,.6); color-scheme: dark;
}
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .18s; animation-timing-function: var(--ease); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.55 var(--sans); font-feature-settings: "cv11", "ss01"; }
a { color: var(--accent); text-decoration: none; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1, .title { font: 620 32px/1.12 var(--serif); letter-spacing: -.022em; font-variation-settings: "opsz" 72; }
h2 { font-size: 20px; font-weight: 650; letter-spacing: -.015em; }
h3 { font-size: 16px; font-weight: 650; }
p { margin: 0 0 .8em; }
code, .mono { font-family: var(--mono); font-size: .86em; }
.num, td.num, .stat .v { font-variant-numeric: tabular-nums; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--accent-soft); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: 6px; z-index: 50; }
.skip:focus { left: 8px; }
.icon { display: inline-block; flex: none; vertical-align: -0.18em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* layout */
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.wrap-wide { max-width: 1400px; margin: 0 auto; padding: 0 20px; }
main { padding: 28px 0 64px; min-height: 70vh; }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 12px; }
.stack-lg > * + * { margin-top: 24px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
@media (max-width: 900px) { .cols-3, .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .split { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; } h1, .title { font-size: 24px; } }

/* header */
.top { background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top .wrap-wide { display: flex; align-items: center; gap: 18px; height: 56px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 750; color: var(--ink); letter-spacing: -.02em; font-size: 17px; }
.brand:hover { text-decoration: none; }
.brand svg { display: block; }
.nav { display: flex; gap: 2px; flex: 1; overflow-x: auto; }
.nav a { color: var(--ink-2); padding: 6px 10px; border-radius: 6px; font-size: 14px; white-space: nowrap; }
.nav a:hover, .nav a[aria-current="page"] { background: var(--sunk); color: var(--ink); text-decoration: none; }
.who { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.demo-bar { background: var(--warn-soft); color: var(--warn); font-size: 12.5px; text-align: center; padding: 5px 12px; border-bottom: 1px solid var(--line); }
.demo-bar code { color: inherit; }

/* surfaces */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card.flush { padding: 0; overflow: hidden; }
.card h2 { font-size: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.card-head h2, .card-head h3 { margin: 0; }
.card-body { padding: 18px; }
.sunk { background: var(--sunk); border-radius: var(--radius-sm); padding: 12px 14px; }
.hero { padding: 8px 0 18px; }
.hero .eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: 11.5px; color: var(--muted); font-weight: 650; }
.hero p.lead { font-size: 17px; color: var(--ink-2); max-width: 760px; }

/* buttons & forms */
.btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink);
  padding: 7px 13px; border-radius: 8px; font: 550 14px/1.2 var(--sans); cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--sunk); text-decoration: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--bad); border-color: var(--bad); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { padding: 4px 9px; font-size: 12.5px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 5px; }
.help { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=search], input[type=number],
input[type=datetime-local], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--field); border-radius: 8px; background: var(--panel); color: var(--ink); font: 14px/1.4 var(--sans);
}
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-line); border-color: var(--accent); }
.field { margin-bottom: 14px; }
.field.error input, .field.error textarea, .field.error select { border-color: var(--bad); }
.field .err { color: var(--bad); font-size: 12.5px; margin-top: 4px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 500; }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 650;
  background: var(--sunk); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.badge.accent { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }
.badge.good { background: var(--good-soft); color: var(--good); border-color: transparent; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.badge.tie { background: var(--tie-soft); color: var(--tie); border-color: transparent; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: currentColor; }
.chip { display: inline-block; padding: 1px 7px; border-radius: 5px; background: var(--sunk); font-size: 12px; color: var(--ink-2); }

/* callouts */
.callout { border: 1px solid var(--line); border-left: 4px solid var(--accent); background: var(--panel); border-radius: var(--radius-sm); padding: 12px 16px; }
.callout.warn { border-left-color: var(--warn); background: var(--warn-soft); }
.callout.bad { border-left-color: var(--bad); background: var(--bad-soft); }
.callout.good { border-left-color: var(--good); background: var(--good-soft); }
.callout.tie { border-left-color: var(--tie); background: var(--tie-soft); }
.callout h3 { margin-bottom: 4px; }
.messages { list-style: none; padding: 0; margin: 0 0 16px; }
.messages li { padding: 10px 14px; border-radius: 8px; background: var(--good-soft); color: var(--good); margin-bottom: 8px; }
.messages li.error { background: var(--bad-soft); color: var(--bad); }
.messages li.warning { background: var(--warn-soft); color: var(--warn); }

/* tables */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 650; padding: 9px 12px; border-bottom: 1px solid var(--line); background: var(--sunk); }
td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: color-mix(in srgb, var(--sunk) 55%, transparent); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }
tr.tie-start td { border-top: 2px dashed var(--tie); }

/* stats */
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat .k { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 650; }
.stat .v { font: 700 26px/1.2 var(--sans); font-variant-numeric: tabular-nums; margin-top: 4px; letter-spacing: -.02em; }
.stat .s { font-size: 12.5px; color: var(--muted); }
.stat.warn .v { color: var(--warn); } .stat.bad .v { color: var(--bad); } .stat.good .v { color: var(--good); }
.bar { height: 8px; background: var(--sunk); border-radius: 99px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.bar.good > span { background: var(--good); } .bar.warn > span { background: var(--warn); } .bar.bad > span { background: var(--bad); }

/* gallery */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.filters input[type=search] { max-width: 340px; }
.filters select { width: auto; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.pcard { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); color: var(--ink); transition: transform .12s ease, border-color .12s; }
.pcard:hover { transform: translateY(-2px); border-color: var(--accent-line); text-decoration: none; }
.pcard .thumb { aspect-ratio: 16 / 9; background: var(--sunk); display: grid; place-items: center; overflow: hidden; }
.pcard .thumb img { width: 100%; height: 100%; object-fit: cover; }
.pcard .thumb .mono-thumb { font: 700 42px var(--serif); color: var(--faint); letter-spacing: -.03em; }
.pcard .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.pcard h3 { margin: 0; font-size: 16px; }
.pcard .tag { font-size: 13px; color: var(--ink-2); }
.pcard .meta { margin-top: auto; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--muted); }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--radius); }

/* timeline (audit) */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 70px 150px 1fr; gap: 12px; padding: 9px 14px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.timeline li:last-child { border-bottom: 0; }
.timeline .seq { font-family: var(--mono); color: var(--faint); font-size: 12px; }
.timeline .when { color: var(--muted); font-size: 12.5px; }
.timeline .act { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.hash { font-family: var(--mono); font-size: 11.5px; color: var(--muted); word-break: break-all; }

/* judge console */
.console { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(360px, 1fr); gap: 20px; align-items: start; }
.console .pane { position: sticky; top: 76px; }
@media (max-width: 980px) { .console { grid-template-columns: 1fr; } .console .pane { position: static; } }
.crit { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; margin-bottom: 10px; background: var(--panel); }
.crit.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.crit .head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.scale { display: flex; gap: 6px; margin: 8px 0 4px; }
.scale input { position: absolute; opacity: 0; pointer-events: none; }
.scale label { flex: 1; margin: 0; text-align: center; padding: 8px 0; border: 1px solid var(--field); border-radius: 7px; cursor: pointer; font: 650 15px var(--sans); font-variant-numeric: tabular-nums; }
.scale input:checked + label { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.scale input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }
.anchor { font-size: 12.5px; color: var(--muted); min-height: 18px; }
kbd { font: 600 11px var(--mono); padding: 1px 5px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 4px; background: var(--panel); color: var(--ink-2); }
.meter { font-size: 12px; color: var(--muted); }
.meter.ok { color: var(--good); }
.saved { font-size: 12px; color: var(--muted); }

/* explanation waterfall */
.wf { width: 100%; }
.wf text { font: 12px var(--sans); fill: var(--ink-2); }
.wf .lbl { fill: var(--muted); }
.wf .pos { fill: var(--good); } .wf .neg { fill: var(--bad); } .wf .base { fill: var(--accent); } .wf .excl { fill: var(--warn); }
.wf .axis { stroke: var(--line-strong); }

/* rank interval whisker */
.whisker { display: block; width: 120px; height: 16px; }
.whisker .track { stroke: var(--line); stroke-width: 6; stroke-linecap: round; }
.whisker .range { stroke: var(--accent-line); stroke-width: 6; stroke-linecap: round; }
.whisker .pt { fill: var(--accent); }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 9px 12px; color: var(--muted); border-bottom: 2px solid transparent; font-weight: 600; font-size: 14px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.prose { max-width: 72ch; }
.prose h2, .prose h3 { margin-top: 1.2em; }
.prose pre { background: var(--sunk); padding: 12px; border-radius: 8px; overflow-x: auto; }
footer.site { border-top: 1px solid var(--line); padding: 20px 0 40px; color: var(--muted); font-size: 13px; }
.htmx-indicator { opacity: 0; transition: opacity .2s; } .htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 14px; align-items: end; }
.podium .place { text-align: center; padding: 18px 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); }
.podium .place.p1 { border-color: var(--accent-line); background: var(--accent-soft); padding-top: 28px; }
.podium .medal { font: 700 13px var(--mono); color: var(--muted); }
@media (max-width: 700px) { .podium { grid-template-columns: 1fr; } }
.steps { display: flex; gap: 0; counter-reset: s; margin: 0; padding: 0; list-style: none; overflow-x: auto; }
.steps li { flex: 1; min-width: 110px; padding: 8px 10px; border-top: 3px solid var(--line); font-size: 12.5px; color: var(--muted); }
.steps li.done { border-top-color: var(--good); color: var(--ink-2); }
.steps li.now { border-top-color: var(--accent); color: var(--ink); font-weight: 650; }
.card.prose { max-width: none; }
.pcard .thumb[style*="--h"] { background: linear-gradient(135deg, hsl(var(--h) 70% 93%), hsl(calc(var(--h) + 45) 65% 84%)); }
.pcard .thumb[style*="--h"] .mono-thumb { color: hsl(var(--h) 45% 38%); opacity: .85; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pcard .thumb[style*="--h"] { background: linear-gradient(135deg, hsl(var(--h) 35% 20%), hsl(calc(var(--h) + 45) 35% 14%)); } :root:not([data-theme="light"]) .pcard .thumb[style*="--h"] .mono-thumb { color: hsl(var(--h) 60% 75%); } }
:root[data-theme="dark"] .pcard .thumb[style*="--h"] { background: linear-gradient(135deg, hsl(var(--h) 35% 20%), hsl(calc(var(--h) + 45) 35% 14%)); }
:root[data-theme="dark"] .pcard .thumb[style*="--h"] .mono-thumb { color: hsl(var(--h) 60% 75%); }
tr.flag td { background: var(--warn-soft); }

/* ======================================================================= v2 components */
/* buttons: calmer, tactile */
.btn { transition: background .15s var(--ease), border-color .15s var(--ease), box-shadow .15s var(--ease), transform .06s; border-radius: 9px; }
.btn:active { transform: translateY(1px); }
.btn.primary { box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 1px 2px rgba(20,22,40,.2); }
.btn.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); filter: none; }
.btn .icon { margin: 0 -1px; }
.btn.lg { padding: 10px 18px; font-size: 15px; border-radius: 10px; }
.btn.signal { background: var(--signal); border-color: var(--signal); color: #fff; }

/* header */
.top { background: color-mix(in srgb, var(--panel) 82%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); }
.brand { font: 640 19px/1 var(--serif); letter-spacing: -.02em; gap: 8px; }
.brand .mark { width: 28px; height: 28px; }
.nav a { display: inline-flex; align-items: center; gap: 6px; font-weight: 520; }
.nav a .icon { color: var(--muted); }
.nav a[aria-current="page"] .icon { color: var(--accent); }
.kbar { display: inline-flex; align-items: center; gap: 8px; min-width: 210px; padding: 6px 8px 6px 10px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--sunk); color: var(--muted); font: 450 13.5px var(--sans); cursor: pointer; }
.kbar:hover { border-color: var(--line-strong); color: var(--ink-2); }
.kbar .k { margin-left: auto; display: inline-flex; gap: 3px; }
@media (max-width: 1100px) { .kbar { min-width: 0; } .kbar .lbl, .kbar .k { display: none; } .nav a .t { display: none; } }
@media (max-width: 720px) { .who .name { display: none; } }

/* toasts (django messages become toasts; also used by JS) */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 60; display: flex; flex-direction: column; gap: 10px; max-width: min(420px, calc(100vw - 36px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--panel); color: var(--ink);
  border: 1px solid var(--line); box-shadow: var(--shadow-lg); font-size: 14px; animation: toast-in .28s var(--ease); }
.toast .icon { margin-top: 2px; }
.toast.success .icon, .toast.info .icon { color: var(--good); }
.toast.error { border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); } .toast.error .icon { color: var(--bad); }
.toast.warning .icon { color: var(--warn); }
.toast button { margin-left: auto; background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0 2px; font-size: 16px; line-height: 1; }
.toast.out { animation: toast-out .2s var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }

/* command palette */
dialog.palette { width: min(680px, calc(100vw - 24px)); max-height: min(560px, calc(100vh - 80px)); padding: 0; border: 1px solid var(--line); border-radius: 16px;
  background: var(--panel); color: var(--ink); box-shadow: var(--shadow-lg); margin-top: 10vh; overflow: hidden; }
dialog.palette::backdrop { background: rgba(10, 12, 20, .42); backdrop-filter: blur(3px); }
dialog.palette[open] { animation: pal-in .18s var(--ease); display: flex; flex-direction: column; }
@keyframes pal-in { from { opacity: 0; transform: translateY(-6px) scale(.985); } to { opacity: 1; transform: none; } }
.palette .q { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.palette .q input { border: 0; outline: 0; background: transparent; font: 450 17px var(--sans); padding: 2px 0; box-shadow: none; }
.palette .q input:focus { outline: 0; }
.palette .res { overflow-y: auto; padding: 6px; }
.palette .grp { font: 650 11px var(--sans); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 10px 10px 4px; }
.palette .item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; color: var(--ink); cursor: pointer; }
.palette .item .icon { color: var(--muted); }
.palette .item .sub { color: var(--muted); font-size: 12.5px; margin-left: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.palette .item[aria-selected="true"], .palette .item:hover { background: var(--accent-soft); text-decoration: none; }
.palette .item[aria-selected="true"] .icon { color: var(--accent); }
.palette .answer { margin: 6px; padding: 14px 16px; border-radius: 12px; background: var(--sunk); border: 1px solid var(--line); }
.palette .answer .how { font-size: 12px; color: var(--muted); margin-top: 8px; }
.palette .foot { display: flex; gap: 14px; align-items: center; padding: 9px 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; background: var(--sunk); }
.palette .empty-pal { padding: 26px; text-align: center; color: var(--muted); }

/* organizer console: left rail on wide screens, scrolling tabs on narrow ones */
.console-shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 28px; align-items: start; }
.rail { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 2px; }
.rail .ev { padding: 4px 10px 14px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.rail .ev .name { font: 620 18px/1.2 var(--serif); letter-spacing: -.015em; color: var(--ink); }
.rail a.sect { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; color: var(--ink-2); font-weight: 520; font-size: 14px; }
.rail a.sect .icon { color: var(--muted); }
.rail a.sect:hover { background: var(--sunk); text-decoration: none; }
.rail a.sect[aria-current="page"] { background: var(--accent-soft); color: var(--accent-strong); }
.rail a.sect[aria-current="page"] .icon { color: var(--accent); }
.rail .count { margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 99px; background: var(--signal); color: #fff; font: 650 11px/18px var(--sans); text-align: center; }
.rail .foot { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
@media (max-width: 1000px) {
  .console-shell { grid-template-columns: 1fr; gap: 12px; }
  .rail { position: static; flex-direction: row; overflow-x: auto; gap: 4px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
  .rail .ev, .rail .foot { display: none; }
  .rail a.sect { white-space: nowrap; }
}

/* glossary popovers: every statistic can explain itself in plain words */
.gl { display: inline-flex; align-items: center; justify-content: center; width: 17px; height: 17px; margin-left: 3px; border-radius: 50%;
  border: 1px solid var(--line-strong); background: var(--panel); color: var(--muted); font: 650 10.5px/1 var(--sans); cursor: help; vertical-align: 1px; padding: 0; }
.gl:hover, .gl[aria-expanded="true"] { color: var(--accent); border-color: var(--accent-line); }
.pop { position: absolute; z-index: 70; max-width: 320px; padding: 12px 14px; border-radius: 12px; background: var(--ink); color: var(--paper);
  font: 450 13px/1.5 var(--sans); box-shadow: var(--shadow-lg); animation: toast-in .16s var(--ease); text-transform: none; letter-spacing: 0; }
.pop strong { color: inherit; }
.pop .src { display: block; margin-top: 6px; opacity: .72; font-size: 12px; }

/* progress ring */
.ring { --p: 0; --size: 44px; width: var(--size); height: var(--size); border-radius: 50%; flex: none;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--sunk) 0); display: grid; place-items: center; }
.ring::before { content: attr(data-label); width: calc(var(--size) - 10px); height: calc(var(--size) - 10px); border-radius: 50%; background: var(--panel);
  display: grid; place-items: center; font: 650 11.5px var(--sans); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ring.good { background: conic-gradient(var(--good) calc(var(--p) * 1%), var(--sunk) 0); }

/* checklist (guided setup) */
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.checklist li:last-child { border-bottom: 0; }
.checklist .tick { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-strong); flex: none; display: grid; place-items: center; margin-top: 1px; }
.checklist li.done .tick { background: var(--good); border-color: var(--good); color: #fff; }
.checklist li.done .what { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.checklist li.next .tick { border-color: var(--accent); box-shadow: var(--ring); }
.checklist .what { font-weight: 560; }
.checklist .why { font-size: 13px; color: var(--muted); }

/* decision cards */
.decision { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 16px 18px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--panel); box-shadow: var(--shadow); }
.decision .ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.decision.urgent .ic { background: var(--signal-soft); color: var(--signal); }
.decision.warn .ic { background: var(--warn-soft); color: var(--warn); }
.decision.tie .ic { background: var(--tie-soft); color: var(--tie); }
.decision.ok .ic { background: var(--good-soft); color: var(--good); }
.decision h3 { margin: 0 0 2px; font-size: 15.5px; }
.decision p { margin: 0; font-size: 13.5px; color: var(--muted); }
@media (max-width: 640px) { .decision { grid-template-columns: auto 1fr; } .decision > :last-child { grid-column: 1 / -1; } }

/* skeleton + empty states */
.skeleton { background: linear-gradient(90deg, var(--sunk) 25%, color-mix(in srgb, var(--sunk) 55%, var(--panel)) 37%, var(--sunk) 63%); background-size: 400% 100%;
  animation: shimmer 1.2s ease infinite; border-radius: 6px; min-height: 14px; }
@keyframes shimmer { from { background-position: 100% 50%; } to { background-position: 0 50%; } }
.empty .icon { color: var(--faint); margin-bottom: 8px; }
.empty h3 { color: var(--ink-2); margin-bottom: 4px; }

/* segmented control */
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--sunk); border: 1px solid var(--line); }
.seg a, .seg button, .seg label { margin: 0; padding: 5px 11px; border-radius: 7px; border: 0; background: none; color: var(--muted); font: 550 13px var(--sans); cursor: pointer; }
.seg [aria-current="page"], .seg [aria-pressed="true"], .seg input:checked + label { background: var(--panel); color: var(--ink); box-shadow: var(--shadow); text-decoration: none; }

/* cards: gentle lift where they are links */
a.card:hover, .pcard:hover { box-shadow: var(--shadow-lg); }
.pcard { transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: 11.5px; font-weight: 650; color: var(--muted); }
.lede { font-size: 17px; color: var(--ink-2); max-width: 760px; }
.assist { display: inline-flex; align-items: center; gap: 6px; font: 600 11.5px var(--sans); color: var(--accent); background: var(--accent-soft);
  border: 1px solid var(--accent-line); border-radius: 99px; padding: 2px 9px; }
.console-head { margin-bottom: 18px; }
.console-head h1 { margin: 2px 0 0; }

/* landing */
.landing-hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 40px; align-items: center; padding: 18px 0 8px; }
.landing-hero h1 { font-size: clamp(34px, 4.4vw, 52px); line-height: 1.04; letter-spacing: -.03em; margin: 8px 0 14px; font-variation-settings: "opsz" 144; }
.landing-hero .accent-word { color: var(--accent); }
.certainty-art { margin: 0; padding: 20px 20px 14px; background: linear-gradient(180deg, var(--panel), color-mix(in srgb, var(--accent-soft) 35%, var(--panel))); }
.certainty-art svg { width: 100%; height: auto; display: block; }
.certainty-art .lbl { font: 560 12.5px var(--sans); fill: var(--ink-2); dominant-baseline: middle; }
.certainty-art .track { stroke: var(--line); stroke-width: 8; stroke-linecap: round; }
.certainty-art .range { stroke: var(--accent-line); stroke-width: 8; stroke-linecap: round; }
.certainty-art .range.tie { stroke: color-mix(in srgb, var(--tie) 45%, transparent); }
.certainty-art .pt { fill: var(--accent); }
.certainty-art .pt.tie { fill: var(--tie); }
.certainty-art .tieband { fill: var(--tie-soft); stroke: color-mix(in srgb, var(--tie) 40%, transparent); stroke-dasharray: 4 4; }
.certainty-art .tielbl { font: 650 11.5px var(--sans); fill: var(--tie); }
.certainty-art .axis text { font: 500 11px var(--sans); fill: var(--muted); }
.certainty-art figcaption { margin-top: 8px; }
@media (max-width: 900px) { .landing-hero { grid-template-columns: 1fr; gap: 20px; } }
.demo-roles { margin-top: 28px; background: linear-gradient(135deg, var(--panel), color-mix(in srgb, var(--accent-soft) 45%, var(--panel))); }
.demo-roles .role { display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.demo-roles .role .ic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.demo-roles .role h3 { margin: 0 0 2px; }
.demo-roles .role p { margin: 0; }
.demo-roles .role .btn { align-self: flex-start; margin-top: auto; }
.lifecycle { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; counter-reset: life; }
.lifecycle li { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); counter-increment: life; }
.lifecycle li .icon { color: var(--accent); }
.lifecycle li::after { content: counter(life); position: absolute; top: 12px; right: 14px; font: 600 12px var(--mono); color: var(--faint); }
.lifecycle li span { font-size: 13px; color: var(--muted); }
@media (max-width: 1000px) { .lifecycle { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .lifecycle { grid-template-columns: 1fr; } }
.feature .icon { color: var(--accent); margin-bottom: 8px; }
.feature h3 { margin: 4px 0 6px; }
.trust { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 36px 0 8px; }
.trust a { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius); border: 1px dashed var(--line-strong); color: var(--ink); }
.trust a:hover { border-style: solid; border-color: var(--accent-line); text-decoration: none; background: var(--panel); }
.trust a .icon { color: var(--accent); margin-top: 2px; }
@media (max-width: 900px) { .trust { grid-template-columns: 1fr 1fr; } }

/* judge console v2 */
.console-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 16px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); position: sticky; top: 64px; z-index: 5; }
.save-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); padding: 3px 10px; border-radius: 99px; background: var(--sunk); }
.save-chip.ok { color: var(--good); background: var(--good-soft); }
.save-chip.err { color: var(--bad); background: var(--bad-soft); }
.project-head .banner { height: 120px; display: grid; place-items: center; overflow: hidden;
  background: linear-gradient(120deg, hsl(var(--h) 70% 92%), hsl(calc(var(--h) + 50) 65% 82%)); }
.project-head .banner img { width: 100%; height: 100%; object-fit: cover; }
.project-head .banner .mono-thumb { font: 700 54px var(--serif); color: hsl(var(--h) 45% 36%); opacity: .8; letter-spacing: -.03em; }
:root[data-theme="dark"] .project-head .banner { background: linear-gradient(120deg, hsl(var(--h) 35% 20%), hsl(calc(var(--h) + 50) 35% 13%)); }
:root[data-theme="dark"] .project-head .banner .mono-thumb { color: hsl(var(--h) 60% 76%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .project-head .banner { background: linear-gradient(120deg, hsl(var(--h) 35% 20%), hsl(calc(var(--h) + 50) 35% 13%)); }
  :root:not([data-theme="light"]) .project-head .banner .mono-thumb { color: hsl(var(--h) 60% 76%); } }
.rubric .crit { border: 1px solid var(--line); transition: border-color .15s, box-shadow .15s; }
.rubric legend { font-weight: 650; padding: 0; }
.weighted { font: 650 13px var(--sans); color: var(--accent); background: var(--accent-soft); border-radius: 99px; padding: 2px 10px; font-variant-numeric: tabular-nums; }
.weighted:empty { display: none; }
.scale label { transition: background .12s, border-color .12s, transform .06s; }
.scale label:hover { border-color: var(--accent); }
.scale input:checked + label { box-shadow: 0 2px 8px -2px color-mix(in srgb, var(--accent) 60%, transparent); }
.coach { margin-top: 8px; }
.coach-card { border: 1px solid var(--accent-line); background: color-mix(in srgb, var(--accent-soft) 45%, var(--panel)); border-radius: 10px; padding: 10px 12px; }
.coach-list { list-style: none; margin: 8px 0 6px; padding: 0; display: grid; gap: 5px; }
.coach-list li { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--ink-2); }
.coach-list li .icon { margin-top: 2px; color: var(--faint); }
.coach-list li.ok .icon { color: var(--good); }
.coach-list .tip { display: block; font-size: 12px; color: var(--muted); }
.coach .cov { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.coach .chip { display: inline-flex; align-items: center; gap: 3px; opacity: .7; }
.coach .chip.on { opacity: 1; background: var(--good-soft); color: var(--good); }
details.more { margin: 4px 0 12px; }
details.more summary { cursor: pointer; color: var(--muted); }
.actionbar { position: sticky; bottom: 0; display: flex; justify-content: space-between; align-items: center; gap: 10px;
  margin: 12px -18px -18px; padding: 12px 18px; background: color-mix(in srgb, var(--panel) 92%, transparent); backdrop-filter: blur(6px);
  border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); }

/* judge inbox */
.nextup { display: grid; grid-template-columns: auto 1fr auto; gap: 22px; align-items: center; padding: 22px;
  background: linear-gradient(120deg, var(--panel), color-mix(in srgb, var(--accent-soft) 50%, var(--panel))); }
.nextup .ring::before { font-size: 15px; }
.nextup .go { text-align: right; }
@media (max-width: 720px) { .nextup { grid-template-columns: auto 1fr; } .nextup .go { grid-column: 1 / -1; text-align: left; } }
.task { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 16px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--panel); box-shadow: var(--shadow); }
.task .ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.task.tie .ic { background: var(--tie-soft); color: var(--tie); }
.task h3 { margin: 0 0 2px; font-size: 15px; }
.task p { margin: 0 0 6px; }
details.card > summary { cursor: pointer; list-style: none; }
details.card > summary::-webkit-details-marker { display: none; }

/* gallery v2 */
.gal-head { margin-bottom: 16px; }
.gal-search { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.gal-search select { width: auto; }
.searchbox { position: relative; flex: 1 1 360px; }
.searchbox .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.searchbox input { padding: 11px 14px 11px 40px; font-size: 15px; border-radius: 11px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; margin-bottom: 8px; }
.chips a { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line);
  background: var(--panel); color: var(--ink-2); font-size: 13.5px; font-weight: 520; }
.chips a span { font: 600 11.5px var(--sans); color: var(--muted); background: var(--sunk); border-radius: 99px; padding: 0 7px; }
.chips a:hover { border-color: var(--accent-line); text-decoration: none; }
.chips a[aria-current="page"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chips a[aria-current="page"] span { background: color-mix(in srgb, var(--paper) 20%, transparent); color: var(--paper); }
.pcard .tags { display: flex; flex-wrap: wrap; gap: 4px; }
.pcard .tags span { font: 500 11.5px var(--mono); color: var(--muted); background: var(--sunk); border-radius: 5px; padding: 1px 6px; }

/* inside the console, layouts respond to the space next to the rail, not the viewport */
.console-main { container-type: inline-size; min-width: 0; }
@container (max-width: 980px) {
  .split { grid-template-columns: 1fr; }
  .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container (max-width: 560px) { .decision { grid-template-columns: auto 1fr; } .decision > :last-child { grid-column: 1 / -1; justify-self: start; } }
.decision h3 { font-weight: 560; }

/* certainty chart */
.certainty { width: 100%; height: auto; display: block; }
.certainty .band { fill: var(--tie-soft); }
.certainty .cut { stroke: var(--signal); stroke-dasharray: 4 4; stroke-width: 1.5; }
.certainty .cutlbl { font: 600 11px var(--sans); fill: var(--signal); }
.certainty .lbl { font: 520 12px var(--sans); fill: var(--ink-2); }
.certainty .track { stroke: var(--line); stroke-width: 7; stroke-linecap: round; }
.certainty .range { stroke: var(--line-strong); stroke-width: 7; stroke-linecap: round; }
.certainty .range.paid { stroke: var(--accent-line); }
.certainty .pt { fill: var(--muted); }
.certainty .pt.paid { fill: var(--accent); }
.certainty .tick { font: 500 11px var(--sans); fill: var(--muted); }
.steps.path { margin: 4px 0 18px; }
.steps.path li { display: flex; flex-direction: column; gap: 2px; }
.steps.path li span { font-size: 12px; color: var(--muted); font-weight: 400; }
.pcard.preview { pointer-events: none; box-shadow: none; }
.pcard.preview .thumb { aspect-ratio: 21 / 9; }
.quote { margin: 6px 0; padding: 8px 12px; border-left: 3px solid var(--accent-line); background: var(--sunk); border-radius: 0 8px 8px 0; font-size: 14px; }
@media (max-width: 720px) {
  .top .wrap-wide { flex-wrap: wrap; height: auto; padding-top: 8px; padding-bottom: 6px; row-gap: 6px; }
  .top .nav { order: 3; flex-basis: 100%; }
  .top .kbar { margin-left: auto; }
  .nav a .t { display: inline; }
}
