/* Layout: a painted warm room as the backdrop, one frosted stage over it, pill bar on top, pill dock of views at the bottom.
   Swap one room object for something from the subject (the football page put a TV showing a field on the wall). */
:root {
  --wall: #cdb9a3; --wall-2: #e9ddcf; --wood: #6b4a33; --wood-2: #8a6447; --floor: #b89a80; --glow: #fff6e6; --leaf: #6f7f52; --sofa-1: #4a3a30; --sofa-2: #2c221c;
  --ink: #2a2019; --ink-2: rgba(42, 32, 25, .62); --ink-3: rgba(42, 32, 25, .38);
  --glass: rgba(255, 250, 244, .20); --glass-edge: rgba(255, 255, 255, .55); --card: rgba(255, 252, 248, .52); --card-hi: rgba(255, 255, 255, .78); --solidcard: rgba(255, 252, 248, .82);
  --shadow: rgba(70, 40, 20, .22);
  --me: #e2583a; --good: #1f9a72; --good-bg: rgba(31, 154, 114, .14); --bad: #c8452c; --bad-bg: rgba(226, 88, 58, .14); --warn: #a8670f; --warn-bg: rgba(200, 130, 20, .15);
  --solid: #2a2019; --solid-fg: #fbf5ee; --orb-hi: #fff; --orb-lo: #3f6532;
  --f-ui: "Onest", "Segoe UI", system-ui, sans-serif; --f-num: "Geist Mono", ui-monospace, "Cascadia Mono", monospace;
  --r-lg: 28px; --r-md: 18px; --r-pill: 999px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --wall: #2a1f19; --wall-2: #3b2c22; --wood: #1d140e; --wood-2: #33241a; --floor: #241a14; --glow: #ffb867; --leaf: #2f3a24;
  --ink: #f6ece2; --ink-2: rgba(246, 236, 226, .66); --ink-3: rgba(246, 236, 226, .38);
  --glass: rgba(34, 24, 18, .32); --glass-edge: rgba(255, 255, 255, .14); --card: rgba(48, 36, 28, .55); --card-hi: rgba(70, 54, 42, .75); --solidcard: rgba(40, 30, 23, .88);
  --shadow: rgba(0, 0, 0, .45); --me: #ff7a55; --good: #4fd1a1; --good-bg: rgba(79, 209, 161, .14); --bad: #ff8a6a; --bad-bg: rgba(255, 122, 85, .16); --warn: #f0b45a; --warn-bg: rgba(240, 180, 90, .15);
  --solid: #f6ece2; --solid-fg: #2a2019; color-scheme: dark } }
:root[data-theme="dark"] {
  --wall: #2a1f19; --wall-2: #3b2c22; --wood: #1d140e; --wood-2: #33241a; --floor: #241a14; --glow: #ffb867; --leaf: #2f3a24;
  --ink: #f6ece2; --ink-2: rgba(246, 236, 226, .66); --ink-3: rgba(246, 236, 226, .38);
  --glass: rgba(34, 24, 18, .32); --glass-edge: rgba(255, 255, 255, .14); --card: rgba(48, 36, 28, .55); --card-hi: rgba(70, 54, 42, .75); --solidcard: rgba(40, 30, 23, .88);
  --shadow: rgba(0, 0, 0, .45); --me: #ff7a55; --good: #4fd1a1; --good-bg: rgba(79, 209, 161, .14); --bad: #ff8a6a; --bad-bg: rgba(255, 122, 85, .16); --warn: #f0b45a; --warn-bg: rgba(240, 180, 90, .15);
  --solid: #f6ece2; --solid-fg: #2a2019; color-scheme: dark }

* { box-sizing: border-box }
html, body { min-height: 100% }
body { background: var(--wall); color: var(--ink); font-family: var(--f-ui); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased }
.num { font-family: var(--f-num); font-variant-numeric: tabular-nums; letter-spacing: -.02em }

.room { position: fixed; inset: 0; z-index: 0; overflow: hidden;
  background: radial-gradient(60% 50% at 78% 18%, var(--glow), transparent 70%), linear-gradient(180deg, var(--wall-2) 0%, var(--wall) 62%, var(--floor) 62.2%, var(--floor) 100%) }
.room i { position: absolute; display: block }
.room .panel { left: 0; top: 0; width: 13%; height: 70%; background: repeating-linear-gradient(90deg, var(--wood) 0 18px, var(--wood-2) 18px 22px) }
.room .shelf { right: 6%; top: 8%; width: 30%; height: 46%; border-radius: 6px; background: linear-gradient(180deg, var(--wood-2), var(--wood)); box-shadow: inset 0 -14px 0 rgba(0,0,0,.18) }
.room .window { right: 9%; top: 11%; width: 24%; height: 34%; border-radius: 4px; background: linear-gradient(160deg, var(--glow), var(--wall-2)); opacity: .9 }
.room .sofa { left: -4%; bottom: 8%; width: 34%; height: 22%; border-radius: 40px 40px 12px 12px; background: linear-gradient(180deg, var(--sofa-1), var(--sofa-2)) }
.room .lamp { left: 26%; top: 18%; width: 160px; height: 160px; border-radius: 50%; background: radial-gradient(circle, var(--glow) 0%, transparent 65%) }
.room .plant { right: 2%; bottom: 14%; width: 120px; height: 240px; border-radius: 60px 60px 20px 20px; background: radial-gradient(ellipse at 50% 30%, var(--leaf), transparent 70%) }
.room .table { left: 40%; bottom: 4%; width: 26%; height: 9%; border-radius: 50%; background: radial-gradient(ellipse, var(--wood-2), var(--wood) 70%, transparent 72%) }

.glass { background: var(--glass); -webkit-backdrop-filter: blur(26px) saturate(150%); backdrop-filter: blur(26px) saturate(150%);
  border: 1px solid var(--glass-edge); box-shadow: inset 0 1px 0 var(--glass-edge), 0 24px 60px -20px var(--shadow) }
.card { background: var(--card); border: 1px solid var(--glass-edge); border-radius: var(--r-md); box-shadow: inset 0 1px 0 var(--glass-edge);
  transition: transform .25s cubic-bezier(.2,.8,.2,1), background .25s }
.card.lift:hover { transform: translateY(-4px); background: var(--card-hi) }
.card.solid-read { background: var(--solidcard) }

.app { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px;
  padding-block: 18px 110px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)) }

.bar { display: flex; align-items: center; gap: 12px; padding: 7px 8px; border-radius: var(--r-pill) }
.who { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 13px; white-space: nowrap }
.who b { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--solid); color: var(--solid-fg); font-size: 11px; letter-spacing: .04em }
.mid { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; max-width: 440px; margin: 0 auto; padding: 7px 14px; border-radius: var(--r-pill); background: var(--card); font-size: 13px; color: var(--ink-2); overflow: hidden; white-space: nowrap; text-overflow: ellipsis }
.mid .orb { flex: none; width: 14px; height: 14px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, var(--orb-hi), var(--me) 55%, var(--orb-lo)) }
.chip { font-size: 12px; padding: 6px 12px; border-radius: var(--r-pill); background: var(--card); white-space: nowrap; color: var(--ink-2) }

.stage { border-radius: var(--r-lg); padding: clamp(18px, 3vw, 30px); min-height: 60vh }
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 20px }
h1 { margin: 0; font-size: clamp(24px, 3.4vw, 32px); font-weight: 600; letter-spacing: -.025em; text-wrap: balance }
.sub { margin: 4px 0 0; color: var(--ink-2); max-width: 66ch }
.tag { font-family: var(--f-num); font-size: 11px; padding: 7px 12px; border-radius: var(--r-pill); background: var(--solid); color: var(--solid-fg); white-space: nowrap }

.view { animation: unfrost .45s cubic-bezier(.2,.8,.2,1) both; display: flex; flex-direction: column; gap: 14px }
@keyframes unfrost { from { filter: blur(14px); opacity: .25; transform: scale(.985) } to { filter: none; opacity: 1; transform: none } }

.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px }
.tile { padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; min-width: 0 }
.tile .lbl { font-size: 12px; color: var(--ink-2); display: flex; align-items: center; gap: 6px }
.tile .big { font-size: 30px; font-weight: 500 }
.tile .big small { font-size: 16px; opacity: .5 }
.tile.solid { background: var(--solid); color: var(--solid-fg); border-color: transparent }
.tile.solid .lbl, .tile.solid .note { color: inherit; opacity: .75 }
.note { font-size: 12px; color: var(--ink-2) }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: var(--r-pill); width: fit-content; white-space: nowrap }
.pill.good { background: var(--good-bg); color: var(--good) }
.pill.bad { background: var(--bad-bg); color: var(--bad) }
.pill.warn { background: var(--warn-bg); color: var(--warn) }
.pill.flat { background: var(--card); color: var(--ink-2) }

.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 14px }
.panel-card { padding: 18px 20px; min-width: 0 }
.panel-card h2 { margin: 0 0 8px; font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap }
.panel-card p { margin: 0 0 10px; max-width: 68ch }
.panel-card p:last-child { margin-bottom: 0 }
.row-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 14px }
.row-head h2 { margin: 0 }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--ink-2); flex-wrap: wrap }
.legend span { display: inline-flex; align-items: center; gap: 6px }
.legend .sw { width: 14px; height: 8px; border-radius: 3px; background: var(--c) }
.legend .tk { width: 2px; height: 12px; border-radius: 1px; background: var(--ink) }

/* Field chart: bar = model, tick = always-guess baseline */
.fc { display: grid; grid-template-columns: minmax(130px, 220px) minmax(0, 1fr) auto; column-gap: 14px; row-gap: 4px; align-items: center }
.fc .row { display: contents }
.fc .name { font-size: 13px; padding: 4px 0; min-width: 0 }
.fc .name small { display: block; font-size: 11px; color: var(--ink-3) }
.fc .row:hover .name, .fc .row:focus-visible .name { color: var(--me) }
.fc .row:focus-visible { outline: none }
.ftrack { position: relative; height: 26px; border-radius: 6px }
.fc .row:hover .ftrack, .fc .row:focus-visible .ftrack { background: var(--card) }
.ftrack::before { content: ""; position: absolute; inset: 11px 0 auto; height: 4px; background: var(--ink-3); opacity: .25; border-radius: 4px }
.ftrack .fill { position: absolute; left: 0; top: 7px; height: 12px; border-radius: 0 4px 4px 0; background: var(--c) }
.ftrack .base { position: absolute; top: 2px; width: 3px; height: 22px; margin-left: -1.5px; border-radius: 2px; background: var(--ink); box-shadow: 0 0 0 2px var(--card-hi) }
.fc .val { font-size: 12px; white-space: nowrap; text-align: right }
.axis { position: relative; height: 16px; font-size: 10.5px; color: var(--ink-3); margin-top: 4px }
.axis span { position: absolute; transform: translateX(-50%) }

table { width: 100%; border-collapse: collapse; font-size: 13px }
th { text-align: left; font-weight: 500; color: var(--ink-2); font-size: 12px; padding: 0 10px 10px; white-space: nowrap }
th .i { margin-left: 4px; vertical-align: -2px }
td { padding: 10px 10px; border-top: 1px solid var(--glass-edge); vertical-align: top }
tbody tr:hover td { background: var(--card) }
td.n, th.n { text-align: right; white-space: nowrap }
tr.total td { font-weight: 600 }
.scroll { overflow-x: auto }
.scroll table { min-width: 400px }

.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; max-width: 70ch }
.qs { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; font-size: 14.5px }
.flow { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; counter-reset: s }
.flow div { padding: 12px 14px; font-size: 12.5px; line-height: 1.45 }
.flow b { display: block; font-size: 13px; margin-bottom: 2px }
.flow div::before { counter-increment: s; content: counter(s); font-family: var(--f-num); font-size: 11px; color: var(--me); display: block; margin-bottom: 4px }
pre { margin: 0; font: 12px/1.55 var(--f-num); overflow-x: auto; white-space: pre }
.hint { font-size: 11.5px; color: var(--ink-3); margin-top: 12px }

/* Hover details */
[data-tip], [data-f] { cursor: help }
.i { flex: none; display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; font-size: 10px; font-weight: 700; line-height: 1;
  border: 1px solid currentColor; opacity: .7; font-family: var(--f-ui) }
.i:hover, .i:focus-visible { opacity: 1 }
.tip { position: fixed; z-index: 30; left: 0; top: 0; max-width: min(300px, calc(100vw - 24px)); padding: 11px 13px; border-radius: 14px;
  background: var(--solid); color: var(--solid-fg); font-size: 12.5px; line-height: 1.5; box-shadow: 0 14px 34px -10px var(--shadow);
  pointer-events: none; opacity: 0; transform: translateY(4px); transition: opacity .15s, transform .15s }
.tip.on { opacity: 1; transform: none }
.tip b { font-weight: 600 }
.tip .t { display: block; font-weight: 600; margin-bottom: 3px }
.tip .r { display: flex; justify-content: space-between; gap: 14px }
.tip .v { font-family: var(--f-num); font-variant-numeric: tabular-nums }
.tip hr { border: 0; border-top: 1px solid currentColor; opacity: .2; margin: 7px 0 }

.dock { position: fixed; z-index: 5; left: 50%; transform: translateX(-50%); bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  display: flex; gap: 4px; padding: 6px; border-radius: var(--r-pill); max-width: calc(100vw - 24px); overflow-x: auto }
.dock button { font: inherit; font-size: 13px; font-weight: 500; color: var(--ink-2); background: transparent; border: 0; padding: 9px 15px; border-radius: var(--r-pill); cursor: pointer; transition: background .2s, color .2s; white-space: nowrap }
.dock button:hover { color: var(--ink) }
.dock button[aria-current="page"] { background: var(--card-hi); color: var(--ink); box-shadow: 0 4px 14px -6px var(--shadow) }
button:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--me); outline-offset: 2px }

@media (prefers-reduced-motion: reduce) { .view { animation: none } .card, .tip { transition: none } }
@media (max-width: 860px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)) } .bar .chip { display: none } }
@media (max-width: 520px) {
  .who span { display: none }
  .fc { grid-template-columns: minmax(0, 1fr) auto }
  .fc .name { grid-column: 1 / -1; margin-top: 6px }
  .tile .big { font-size: 24px }
  .dock button { padding: 9px 11px; font-size: 12.5px }
}

/* ---------- kev-radar additions ---------- */
/* Score components: validated categorical slots 1-6 (light and dark steps) */
:root { --c-kev: #257de0; --c-rw: #f47230; --c-epss: #00b894; --c-cvss: #f2a600; --c-rec: #ee7fac; --c-ven: #008a17; --c-old: #257de0; --c-new: #f47230 }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --c-kev: #338ced; --c-rw: #e76624; --c-epss: #00a888; --c-cvss: #d28e05; --c-rec: #e24d8b; --c-ven: #0aac23; --c-old: #338ced; --c-new: #e76624 } }
:root[data-theme="dark"] { --c-kev: #338ced; --c-rw: #e76624; --c-epss: #00a888; --c-cvss: #d28e05; --c-rec: #e24d8b; --c-ven: #0aac23; --c-old: #338ced; --c-new: #e76624 }

/* The room object for this subject: a radar scope where the window was */
.room .window { display: none }
.room .scope { right: 10%; top: 10%; width: min(26vw, 300px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, transparent 0 24%, rgba(31,154,114,.35) 24.5% 25%, transparent 25.5% 49%, rgba(31,154,114,.35) 49.5% 50%, transparent 50.5% 74%, rgba(31,154,114,.35) 74.5% 75%, transparent 75.5%),
    radial-gradient(circle, #20372c, #0f1d17 70%); box-shadow: 0 0 0 10px var(--wood), 0 0 60px -10px rgba(79,209,161,.5); overflow: hidden }
.room .scope::before { content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(79,209,161,.55), rgba(79,209,161,0) 22%, transparent); animation: sweep 6s linear infinite }
.room .scope::after { content: ""; position: absolute; left: 62%; top: 30%; width: 8px; height: 8px; border-radius: 50%; background: #ffb867; box-shadow: -90px 70px 0 -1px #ffb867, -40px 120px 0 -2px #4fd1a1 }
@keyframes sweep { to { transform: rotate(1turn) } }

a { color: inherit; text-decoration-color: var(--ink-3); text-underline-offset: 2px }
a:hover { color: var(--me) }
.bar .chip a { text-decoration: none }
.dock a { font-size: 13px; font-weight: 500; color: var(--ink-2); padding: 9px 15px; border-radius: var(--r-pill); text-decoration: none; white-space: nowrap }
.dock a:hover { color: var(--ink) }
.mono { font-family: var(--f-num); font-size: 12.5px }
.muted { color: var(--ink-2) }
.t-act-now { background: var(--bad-bg); color: var(--bad) }
.t-next { background: var(--warn-bg); color: var(--warn) }
.t-watch { background: var(--card); color: var(--ink-2) }

/* Stacked score bar: 0-100 scale, 2px surface gaps between segments */
.sbar { display: flex; gap: 2px; height: 12px; width: 100%; min-width: 120px; border-radius: 4px; background: transparent; position: relative }
.sbar i { display: block; height: 100%; background: var(--c); min-width: 0 }
.sbar i:first-child { border-radius: 4px 0 0 4px }
.sbar i:last-of-type { border-radius: 0 4px 4px 0 }
.sbar::after { content: ""; position: absolute; inset: 5px 0 auto; height: 2px; background: var(--ink-3); opacity: .2; z-index: -1 }
.top-row { display: grid; grid-template-columns: 2.2em minmax(140px, 1.1fr) minmax(160px, 2fr) 3.4em; gap: 12px; align-items: center; padding: 7px 6px; border-radius: 10px }
.top-row:hover, .top-row:focus-visible { background: var(--card) }
.top-row .who2 { min-width: 0 }
.top-row .who2 small { display: block; color: var(--ink-3); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }

/* SVG charts */
.chart { width: 100%; height: auto; display: block; overflow: visible }
.chart .grid line { stroke: var(--ink-3); stroke-opacity: .35; stroke-width: 1 }
.chart text { fill: var(--ink-2); font: 10.5px var(--f-num) }
.chart .hit { fill: transparent; cursor: help }
.chart .hit:hover, .chart .hit:focus { fill: var(--ink); fill-opacity: .06; outline: none }
.chart .ln { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round }
.chart .dot { stroke: var(--card-hi); stroke-width: 2 }

/* Controls */
.controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px }
.controls input[type=search], .controls select { font: inherit; font-size: 13px; color: var(--ink); background: var(--card-hi); border: 1px solid var(--glass-edge); border-radius: var(--r-pill); padding: 8px 14px; min-width: 0 }
.controls input[type=search] { flex: 1 1 240px }
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--r-pill); background: var(--card) }
.seg button { font: inherit; font-size: 12.5px; border: 0; background: transparent; color: var(--ink-2); padding: 6px 12px; border-radius: var(--r-pill); cursor: pointer }
.seg button[aria-pressed="true"] { background: var(--card-hi); color: var(--ink); box-shadow: 0 2px 8px -4px var(--shadow) }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 10px; font-size: 12.5px; color: var(--ink-2) }
.pager button, .btn { font: inherit; font-size: 12.5px; border: 1px solid var(--glass-edge); background: var(--card-hi); color: var(--ink); padding: 6px 12px; border-radius: var(--r-pill); cursor: pointer }
.pager button:disabled { opacity: .4; cursor: default }
th.sort { cursor: pointer; user-select: none }
th.sort[aria-sort]::after { content: " \2193"; color: var(--me) }
th.sort[aria-sort="ascending"]::after { content: " \2191" }
.empty { padding: 28px; text-align: center; color: var(--ink-2) }
.vlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px }
.vcard { padding: 12px 14px; cursor: pointer; text-align: left; font: inherit; color: inherit }
.vcard[aria-pressed="true"] { outline: 2px solid var(--me) }
.prose { max-width: 72ch; font-size: 14.5px; line-height: 1.65 }
.prose h2 { font-size: 17px; margin: 26px 0 8px }
.prose code, .prose .mono { font-family: var(--f-num); font-size: 12.5px; background: var(--card); padding: 1px 5px; border-radius: 5px }
.prose table { margin: 8px 0 14px }
.loading { padding: 40px; text-align: center; color: var(--ink-2) }
@media (prefers-reduced-motion: reduce) { .room .scope::before { animation: none } }
@media (max-width: 620px) { .top-row { grid-template-columns: 2em minmax(0, 1fr) 3em } .top-row .sbar { grid-column: 2 / -1 } }
td.num { white-space: nowrap }
.cvebtn { font: inherit; font-family: var(--f-num); font-size: 12.5px; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-decoration-color: var(--ink-3); text-underline-offset: 2px }
.cvebtn:hover { color: var(--me) }
dialog.detail { width: min(620px, calc(100vw - 24px)); max-height: calc(100vh - 40px); overflow-y: auto; border-radius: var(--r-lg); padding: 22px 24px; color: var(--ink); background: var(--solidcard) }
dialog.detail::backdrop { background: rgba(30, 20, 14, .35); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px) }
dialog.detail h3 { font-size: 14px; margin: 18px 0 6px }
.dhead { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start }
.dscore { display: flex; gap: 8px; align-items: center; margin: 12px 0 8px }
.dscore .big { font-size: 34px; font-weight: 500 }
.dlinks { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 14px; font-size: 13px }
.detail .tip { z-index: 40 }
