/* LanCable Testing Server: one stylesheet, no inline styles anywhere (CSP style-src 'self'). */
:root {
  --pass: #1f5fbf; --pass-bg: #e3edfc; --warn: #8a5a00; --warn-bg: #fff1d0; --fail: #a3262c; --fail-bg: #fde4e4;
  --report: #3a4a63; --report-bg: #e6ebf3;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --pass: #8db4ff; --pass-bg: #16243d; --warn: #f0be5a; --warn-bg: #352a10; --fail: #ff8f94; --fail-bg: #3b1619;
    --report: #aebbd2; --report-bg: #1f2735;
  }
}
:root[data-theme="dark"] {
  --pass: #8db4ff; --pass-bg: #16243d; --warn: #f0be5a; --warn-bg: #352a10; --fail: #ff8f94; --fail-bg: #3b1619;
  --report: #aebbd2; --report-bg: #1f2735;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); }
main { margin: 0 auto; }
h2 { font-size: 1.15rem; margin: 0 0 10px; }
h3 { font-size: 1rem; margin: 14px 0 6px; }
a { color: var(--accent); }
code, pre, .mono { font-family: var(--mono); font-size: 0.9em; }
pre { overflow-x: auto; }
.lead { font-size: 1.05rem; color: var(--muted); max-width: 70ch; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.hint { color: var(--muted); font-size: 0.85rem; margin: 4px 0 0; }
.hidden { display: none !important; }
.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: 0; background: var(--panel); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; top: 8px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.who { color: var(--muted); font-size: 0.9rem; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 0 0 var(--gap); }
.card.narrow, .narrow { max-width: 460px; margin-left: auto; margin-right: auto; }
.card.warn { border-color: var(--warn); background: var(--warn-bg); }
.error-card { border-color: var(--fail); }
.stack > * + * { margin-top: var(--gap); }
.grid { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.step { display: inline-block; min-width: 1.6em; text-align: center; background: var(--accent); color: var(--accent-ink); border-radius: 999px; margin-right: 6px; }

.btn { display: inline-block; font: inherit; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); text-decoration: none; cursor: pointer; min-height: 40px; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.btn.danger { border-color: var(--fail); color: var(--fail); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.field { margin: 0 0 12px; }
label { display: block; font-weight: 600; margin-bottom: 4px; }
label.check, label.radio { font-weight: 400; display: flex; gap: 8px; align-items: flex-start; margin: 6px 0; }
fieldset { border: 0; margin: 0; padding: 0; }
legend { font-weight: 600; margin-bottom: 4px; padding: 0; }
input[type="text"], input[type="password"], input[type="number"], input[type="search"], select { width: 100%; max-width: 480px; font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); min-height: 40px; }
input[type="file"] { max-width: 100%; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: flex-end; }
.error { color: var(--fail); background: var(--fail-bg); border-radius: 8px; padding: 8px 12px; }
.ok-msg { color: var(--pass); background: var(--pass-bg); border-radius: 8px; padding: 8px 12px; }
.warn-msg { color: var(--warn); background: var(--warn-bg); border-radius: 8px; padding: 8px 12px; }
progress { width: 220px; max-width: 100%; }

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
caption { text-align: left; font-weight: 600; padding: 4px 0 8px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; white-space: nowrap; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.badge { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.02em; border: 1px solid transparent; white-space: nowrap; }
.badge-pass { color: var(--pass); background: var(--pass-bg); border-color: var(--pass); }
.badge-warn { color: var(--warn); background: var(--warn-bg); border-color: var(--warn); }
.badge-fail, .badge-error { color: var(--fail); background: var(--fail-bg); border-color: var(--fail); }
.badge-report { color: var(--report); background: var(--report-bg); border-color: var(--report); }
.badge-other { color: var(--muted); background: var(--other-bg); border-color: var(--line); }
.badge-state { color: var(--ink); background: var(--other-bg); border-color: var(--line); }
.stale { opacity: 0.7; }

.checklist { list-style: none; margin: 8px 0; padding: 8px; max-height: 280px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.checklist li { padding: 2px 0; }
.rows { list-style: none; padding: 0; margin: 0 0 12px; }
.rows li { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.token { display: block; padding: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; word-break: break-all; user-select: all; }
.code { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
video { width: 100%; max-width: 760px; border-radius: 8px; background: #000; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.cause { border-left: 4px solid var(--fail); padding: 6px 12px; margin: 10px 0; background: var(--bg); border-radius: 0 8px 8px 0; }
.cause.warnlvl { border-left-color: var(--warn); }
.cause .conf { font-size: 0.8rem; color: var(--muted); }
.legend dt { font-weight: 700; margin-top: 6px; }
.legend dd { margin: 0 0 4px; color: var(--muted); }
.foot { max-width: 1100px; margin: 24px auto; padding: 0 16px; color: var(--muted); font-size: 0.85rem; }

@media (max-width: 640px) {
  th, td { padding: 6px; }
  .kv { grid-template-columns: 1fr; }
  .kv dt { margin-top: 6px; }
  .btn { width: 100%; text-align: center; }
  .actions .btn, .inline-form .btn { width: auto; }
}
@media (prefers-reduced-motion: no-preference) { .btn { transition: background-color 0.15s; } }

/* A generated figure (the R7 motor curve): never wider than its card. */
.wide-img { display: block; max-width: 100%; height: auto; }

/* Two videos next to each other (Compare); one under the other on a phone. */
.vpair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.vpair video { width: 100%; }
details pre { max-height: 24rem; overflow: auto; }
@media (max-width: 640px) { .vpair { grid-template-columns: 1fr; } }

.searchbar { margin: 0.5rem 0; }
.sortlink { color: inherit; text-decoration: none; white-space: nowrap; }
.sortlink:hover, .sortlink:focus { text-decoration: underline; }
.pager .btn + .btn { margin-left: 0.5rem; }

/* Policy report card on the run page (bench/server/evalcard.py). */
.verdict { border-radius: 8px; padding: 12px 14px; margin: 8px 0 12px; border: 1px solid; font-size: 1.05rem; }
.verdict .small { display: block; margin-top: 2px; }
.verdict-fail { color: var(--fail); background: var(--fail-bg); border-color: var(--fail); }
.verdict-warn { color: var(--warn); background: var(--warn-bg); border-color: var(--warn); }
.verdict-pass { color: var(--pass); background: var(--pass-bg); border-color: var(--pass); }
.finding { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin: 8px 0; background: var(--bg); }
.finding > summary { cursor: pointer; list-style-position: outside; }
.finding[open] > summary { margin-bottom: 6px; }
.finding .train { border-left: 4px solid var(--accent); padding-left: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip-link { display: inline-block; padding: 1px 9px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; font-size: 0.85rem; }
.tiles { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.tile { border: 1px solid var(--line); border-left-width: 5px; border-radius: 8px; padding: 8px 10px; background: var(--bg); }
.tile-fail { border-left-color: var(--fail); }
.tile-warn { border-left-color: var(--warn); }
.tile-pass { border-left-color: var(--pass); }
.tile-report { border-left-color: var(--report); }
.tile-other { opacity: 0.75; }
.tile .reasons { color: var(--fail); }
.eval-steps { margin: 4px 0 12px; padding-left: 1.3em; }
.eval-steps li { margin: 2px 0; }
/* Submit page: the four test depths as cards (templates/submit.html). */
.depths { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin: 8px 0 12px; }
.depth { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; border: 2px solid var(--line); border-radius: 10px; padding: 12px; cursor: pointer; background: var(--bg); margin: 0; }
.depth:hover { border-color: var(--accent); }
.depth:has(input:checked) { border-color: var(--accent); background: var(--panel); box-shadow: 0 0 0 1px var(--accent) inset; }
.depth input[type="radio"] { margin-top: 4px; }
.depth-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.depth-title { font-weight: 700; font-size: 1.02rem; }
.depth-meta { color: var(--accent); font-size: 0.85rem; font-weight: 600; }
.depth-text { color: var(--muted); font-size: 0.88rem; }
.depth-pick select { max-width: 100%; margin-top: 4px; }
.depths.inactive { opacity: 0.55; }
.advanced { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 4px; }
.advanced > summary { cursor: pointer; color: var(--muted); }
.advanced[open] > summary { margin-bottom: 10px; }
/* Run page: the recommended next step and per-area buttons. */
.next-step { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin: 4px 0 12px; }
.tile .btn { margin-top: 6px; min-height: 32px; padding: 4px 10px; font-size: 0.85rem; }

/* Shared workspace shell */
:root {
  color-scheme: light;
  --bg: #f4f6f9;
  --panel: #fff;
  --ink: #172033;
  --muted: #5a6478;
  --line: #d9dee7;
  --accent: #4a3fc0;
  --accent-ink: #fff;
  --focus: #b56d00;
  --other-bg: #eef1f7;
  --nav-bg: #1a2238;
  --nav-ink: #f2f5fb;
  --nav-muted: #aab4cc;
  --nav-line: #34405e;
  --nav-selected: #2c385a;
  --rail: 216px;
  --radius: 14px;
  --gap: 20px;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1420;
  --panel: #171e2d;
  --ink: #e8edf7;
  --muted: #aab4c8;
  --line: #2f3a50;
  --accent: #a8a0ff;
  --accent-ink: #16133a;
  --focus: #f5ca73;
  --other-bg: #1f2839;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0f1420;
    --panel: #171e2d;
    --ink: #e8edf7;
    --muted: #aab4c8;
    --line: #2f3a50;
    --accent: #a8a0ff;
    --accent-ink: #16133a;
    --focus: #f5ca73;
    --other-bg: #1f2839;
  }
}
body { font: 15px/1.55 "Inter", "Segoe UI", system-ui, sans-serif; }
main { max-width: 1400px; padding: 36px clamp(20px, 4vw, 58px) 12px; min-height: 78vh; }
h1 { font-size: clamp(1.8rem, 4vw, 2.65rem); font-weight: 720; letter-spacing: -.045em; line-height: 1.11; margin: 0 0 9px; }
h2 { font-size: 1.16rem; letter-spacing: -.02em; }
h3 { letter-spacing: -.01em; }
.lead { margin: 0 0 20px; font-size: .98rem; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 24px; }
.page-heading .lead { margin: 0; }
.breadcrumb { font-size: .84rem; margin-bottom: 10px; }
.public-header { max-width: 1400px; margin: 0 auto; padding: 22px clamp(20px, 4vw, 58px) 0; }
.brand { display: flex; gap: 11px; align-items: center; margin: 0; width: fit-content; text-decoration: none; color: var(--ink); }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: #c3bdff; color: #1d1850; font: 750 .8rem var(--mono); letter-spacing: -.06em; }
.brand-name { font-size: 1rem; font-weight: 720; letter-spacing: -.02em; }
.topbar { background: var(--nav-bg); color: var(--nav-ink); border: 0; }
.topbar-in { align-items: stretch; }
.topbar .brand { color: var(--nav-ink); }
.topbar a.nav { color: var(--nav-ink); display: block; border: none; text-decoration: none; padding: 8px 11px; border-radius: 8px; }
.topbar a.nav:hover, .topbar a.nav[aria-current="page"] { background: var(--nav-selected); color: #fff; }
.topbar a.nav[aria-current="page"] { box-shadow: inset 3px 0 #c3bdff; }
.topbar .btn { background: transparent; color: var(--nav-ink); border-color: var(--nav-line); }
.topbar .btn.primary { background: #c3bdff; color: #1d1850; border-color: #c3bdff; }
.topbar .btn:hover { border-color: #c3bdff; }
.topbar .btn.primary:hover { background: #e2deff; }
.sidebar-head { display: flex; justify-content: space-between; align-items: center; padding: 18px; }
.nav-label { margin: 0 0 5px 11px; color: var(--nav-muted); font-size: .75rem; font-weight: 650; }
.nav-group { display: grid; gap: 3px; min-width: 0; }
.sidebar-account { display: grid; gap: 5px; border-top: 1px solid var(--nav-line); padding-top: 12px; }
.sidebar-account .who { color: var(--nav-muted); padding-inline: 11px; overflow-wrap: anywhere; }
.topbar .theme-toggle { font-size: .83rem; }
.foot { max-width: 1400px; margin: 10px auto 0; padding: 16px clamp(20px, 4vw, 58px) 24px; font-size: .8rem; }
@media (min-width: 980px) {
  body:has(> .topbar) { padding-left: var(--rail); }
  .topbar { position: fixed; inset: 0 auto 0 0; width: var(--rail); display: flex; flex-direction: column; overflow: auto; }
  .topbar-in { width: 100%; padding: 7px 15px 18px; display: flex; flex-direction: column; flex: 1; gap: 23px; }
  .sidebar-account { margin-top: auto; }
  .sidebar-head { padding-top: 26px; padding-bottom: 24px; }
  .menu-toggle { display: none !important; }
}
@media (max-width: 979px) {
  .topbar-in { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding: 0 18px 16px; }
  .topbar-in .nav-submit { grid-column: 1 / -1; justify-self: start; }
  .topbar .sidebar-account { border: none; padding-top: 0; align-content: start; }
  .topbar[data-collapsible="true"] .topbar-in { display: none; }
  .topbar[data-collapsible="true"].menu-open .topbar-in { display: grid; }
}
@media (max-width: 580px) {
  main { padding: 25px 13px 8px; min-height: 70vh; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 13px; }
  .sidebar-head { padding: 10px 13px; }
  .sidebar-head .btn { width: auto; }
  .topbar-in { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar .sidebar-account { grid-column: 1 / -1; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; }
  .sidebar-account .who { grid-column: 1 / -1; }
}

.card { padding: clamp(14px, 2.4vw, 23px); box-shadow: 0 2px 4px #14203308; min-width: 0; }
.card.narrow { margin-top: clamp(15px, 7vh, 85px); padding: clamp(18px, 5vw, 35px); }
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.stack > * + * { margin-top: 0; }
summary { cursor: pointer; font-weight: 615; }
details[open] > summary { margin-bottom: 10px; }
.btn { font-weight: 610; }
.btn:hover:not(:disabled), .btn:focus-visible { border-color: var(--accent); }
.btn.primary:hover { filter: brightness(.93); }
.btn.danger:hover { background: var(--fail-bg); }
.btn, input, select, button { touch-action: manipulation; }
input, select { accent-color: var(--accent); }
input[type="file"]::file-selector-button { border: 1px solid var(--line); background: var(--other-bg); color: var(--ink); padding: 8px 10px; border-radius: 6px; margin-right: 8px; cursor: pointer; }
.searchbar { display: flex; align-items: end; flex-wrap: wrap; gap: 10px 13px; margin: 12px 0 18px; }
.searchbar label { margin: 0; font-size: .85rem; min-width: 0; }
.searchbar label:first-child { flex: 1 1 220px; max-width: 380px; }
.searchbar label :is(input, select) { display: block; margin-top: 4px; }
.searchbar a { padding: 8px 4px; }
.inline-form { gap: 10px; margin-bottom: 16px; }
.inline-form .field { margin-bottom: 0; }
.empty { background: var(--bg); color: var(--muted); border: 1px dashed var(--line); border-radius: 10px; padding: 22px; margin: 10px 0 0; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: var(--gap); }
.stat { color: var(--ink); display: flex; flex-direction: column; align-items: flex-start; justify-content: start; gap: 4px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; min-width: 0; text-decoration: none; }
a.stat:hover { border-color: var(--accent); background: var(--other-bg); }
a.stat .stat-label { text-decoration: underline; text-underline-offset: 3px; }
.stat-label { color: var(--muted); font-weight: 630; font-size: .82rem; line-height: 1.4; }
.stat-value { font-size: clamp(1.55rem, 3vw, 2.25rem); line-height: 1.15; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.stat small { color: var(--muted); font-size: .75rem; }
.stat[data-tone="fail"] .stat-value { color: var(--fail); }
.stat[data-tone="warn"] .stat-value { color: var(--warn); }
.stat[data-tone="active"] .stat-value { color: var(--accent); }
.stat[data-tone="pass"] .stat-value { color: var(--pass); }
.run-overview .stats-grid { margin: 15px 0 0; }
.run-overview .stat { background: var(--bg); }
.run-config { background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 10px 13px; }
.run-progress { display: flex; align-items: center; gap: 7px; margin-top: 5px; min-width: 90px; }
.run-progress progress { width: 58px; height: 6px; accent-color: var(--accent); }
.run-progress small { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .73rem; }
#job-progress { accent-color: var(--accent); }
.table-wrap { border: 1px solid var(--line); border-radius: 9px; margin-bottom: 10px; }
.table-wrap:focus-visible { outline-offset: 1px; }
table { font-size: .87rem; }
th, td { padding: 10px 11px; }
th { background: var(--other-bg); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: color-mix(in srgb, var(--other-bg) 55%, var(--panel)); }
caption { color: var(--muted); font-size: .83rem; padding: 8px 11px; }
.run-link { font-weight: 650; text-decoration: none; }
.run-link:hover { text-decoration: underline; }
.badge { border-color: transparent; font-size: .73rem; padding: 2px 8px; }
.badge-state { text-transform: capitalize; }
.badge-state[data-state="done"] { background: var(--pass-bg); color: var(--pass); }
.badge-state:is([data-state="failed"], [data-state="timeout"], [data-state="rejected"]) { background: var(--fail-bg); color: var(--fail); }
.badge-state:is([data-state="running"], [data-state="starting"], [data-state="ingesting"]) { background: var(--other-bg); color: var(--accent); }
.finding { padding: 12px 14px; }
.depths { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.depth { min-height: 112px; }
.depth:has(input:checked) { background: var(--other-bg); }
#submit-form > section:first-of-type .field { max-width: 100%; }
#results { scroll-margin-top: 12px; }
@media (max-width: 680px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .stat { padding: 12px; }
  .searchbar .btn { width: auto; }
  .searchbar label:first-child { flex-basis: 100%; }
  .depths { grid-template-columns: 1fr; }
}
.submit-review { border-top: 3px solid var(--accent); }
.submit-review #estimate { margin-bottom: 12px; }

/* readiness scorecard (bench/server/readiness_view.py) */
.gate-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 12px 0; }
.gate { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1px solid var(--line); border-left-width: 6px;
        border-radius: 12px; background: var(--bg); color: var(--ink); text-decoration: none; min-width: 0; }
.gate:hover { border-color: var(--accent); }
.gate-title { color: var(--muted); font-weight: 630; font-size: .85rem; }
.gate-verdict { font-size: clamp(1.3rem, 2.6vw, 1.8rem); line-height: 1.15; letter-spacing: -.02em; }
.gate small { font-size: .8rem; }
.gate[data-verdict="pass"] { border-left-color: var(--pass); } .gate[data-verdict="pass"] .gate-verdict { color: var(--pass); }
.gate[data-verdict="warn"] { border-left-color: var(--warn); } .gate[data-verdict="warn"] .gate-verdict { color: var(--warn); }
.gate[data-verdict="fail"] { border-left-color: var(--fail); } .gate[data-verdict="fail"] .gate-verdict { color: var(--fail); }
.gate[data-verdict="other"] .gate-verdict { color: var(--muted); }
.readiness-gate h3 { margin-top: 18px; color: var(--muted); font-size: .9rem; text-transform: uppercase; letter-spacing: .04em; }
details.req { border-top: 1px solid var(--line); padding: 8px 0; }
details.req > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; cursor: pointer; list-style: none; }
details.req > summary::-webkit-details-marker { display: none; }
details.req > summary .badge { min-width: 9.5em; text-align: center; }
.req-title { font-weight: 630; flex: 1 1 18em; min-width: 0; }
.req-summary { color: var(--muted); font-size: .9rem; }
details.req[open] > summary { margin-bottom: 6px; }
@media (max-width: 680px) {
  .gate-grid { grid-template-columns: 1fr; }
  details.req > summary .badge { min-width: 0; }
}

/* "i" explanations (readiness_view.info): a native <details>, opens in place */
details.info { display: inline; font-weight: 400; letter-spacing: 0; text-transform: none; }
details.info > summary { display: inline-grid; place-items: center; width: 1.25em; height: 1.25em; border-radius: 50%; cursor: pointer;
  list-style: none; vertical-align: .1em; font: 700 .72rem/1 Georgia, "Times New Roman", serif; font-style: italic;
  color: var(--accent); border: 1.5px solid var(--accent); background: var(--panel); }
details.info > summary::-webkit-details-marker { display: none; }
details.info > summary:hover, details.info[open] > summary { color: var(--accent-ink); background: var(--accent); }
details.info[open] > summary { margin: 0; }
.info-pop { display: block; max-width: 34rem; margin: 6px 0 8px; padding: 10px 12px; border-left: 3px solid var(--accent);
  border-radius: 8px; background: var(--other-bg); color: var(--ink); font-size: .86rem; font-weight: 400; line-height: 1.5;
  white-space: normal; text-align: left; }
.info-pop p { margin: 4px 0 0; }
th .info-pop { min-width: 16rem; }
.explain { background: var(--other-bg); border-radius: 10px; padding: 10px 14px; margin: 4px 0 12px; font-size: .9rem; }
.explain p { margin: 4px 0; }
ul.reasons { margin: 0; padding-left: 1.1em; }
ul.reasons li + li { margin-top: 4px; }

/* Dash numbers and Motor physics: the quantity column keeps a fixed width; value headers wrap onto two short lines */
table.perf { table-layout: auto; }
table.perf th { white-space: normal; vertical-align: bottom; line-height: 1.25; min-width: 6.5rem; }
table.perf th:first-child, table.perf td:first-child { width: 20rem; min-width: 20rem; }
table.perf td.num, table.perf th.num { text-align: right; white-space: nowrap; }
table.perf .th-main { display: block; font-weight: 700; }
table.perf .th-sub { display: block; font-weight: 400; font-size: .85em; }
.scroll-hint { display: none; }
@media (max-width: 760px) {
  .scroll-hint { display: block; margin: 0 0 4px; }
  table.perf th:first-child, table.perf td:first-child { width: 12rem; min-width: 12rem; position: sticky; left: 0; background: var(--panel, #fff); z-index: 1; }
  table.perf th { min-width: 5.5rem; }
}

/* One dash-number / motor-physics table for every motor curve: a coloured band per curve, a heavier line between curves.
   Fixed layout: the Quantity column has one width (--q) and every value column shares the rest equally, so all value columns
   are the same width.  The physics table (4 value columns) is cut to 4/9 of the dash table's value area, so its columns are
   exactly as wide as the dash table's and the two tables line up.  Below --c per value column the table scrolls sideways. */
.grid-wrap { --q: clamp(14rem, 26vw, 22rem); --c: 5.4rem; }      /* --q: Quantity column, --c: narrowest value column */
.grid-wrap.n4 { width: max(calc(var(--q) + (100% - var(--q)) * 4 / 9), calc(var(--q) + 4 * var(--c) + 2px)); max-width: 100%; margin-left: auto; margin-right: auto; }   /* centred in its card */
table.perf-grid { table-layout: fixed; width: 100%; border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; }
.grid-wrap.n9 table.perf-grid { min-width: calc(var(--q) + 9 * var(--c)); }   /* narrower than this: scroll sideways, Quantity stays */
.grid-wrap.n4 table.perf-grid { min-width: calc(var(--q) + 4 * var(--c)); }
table.perf-grid th, table.perf-grid td { padding: 7px 10px; line-height: 1.3; min-width: 0; }
table.perf-grid th.num, table.perf-grid th.grp { width: auto; }            /* undo table.perf's 20rem first-child width */
table.perf-grid th.q, table.perf-grid td.q { width: var(--q); text-align: left; white-space: normal; padding-left: 14px;
  position: sticky; left: 0; z-index: 1; }
table.perf-grid td.q { background: var(--panel); text-wrap: pretty; }   /* opaque for sticky scrolling; pretty: no lone (i) on line 2 */
table.perf-grid tbody tr:hover td.q { background: color-mix(in srgb, var(--other-bg) 55%, var(--panel)); }
table.perf-grid th.q { vertical-align: bottom; background: var(--other-bg); }
/* every row one height (room for a two-line label), so wrapped labels do not make the rows uneven */
table.perf-grid td { vertical-align: middle; height: 3.15rem; }
table.perf-grid th.grp { text-align: center; white-space: normal; font-size: .85rem; line-height: 1.25; height: 3.1rem;
  letter-spacing: .01em; padding: 6px 6px; border-bottom: 2px solid currentColor; vertical-align: middle; }
table.perf-grid th.grp .th-sub { font-weight: 500; font-size: .72rem; opacity: .85; text-transform: uppercase; letter-spacing: .04em; margin-top: 2px; }
table.perf-grid th.grp[colspan="1"] { font-size: .8rem; letter-spacing: 0; padding: 6px 4px; }   /* one-column band (Linear): two lines, not three */
table.perf-grid th.grp[colspan="1"] .th-sub { font-size: .68rem; letter-spacing: .01em; }
table.perf-grid th.num, table.perf-grid td.num { text-align: right; white-space: nowrap; }
table.perf-grid th.num { font-size: .8rem; height: 2.3rem; padding-top: 6px; padding-bottom: 6px; vertical-align: middle; }
table.perf-grid tbody tr:last-child td { border-bottom: 0; }
table.perf-grid .gstart { border-left: 2px solid var(--line); }
table.perf-grid .g-p6 { background: color-mix(in srgb, #2563eb 7%, transparent); }
table.perf-grid th.grp.g-p6 { background: color-mix(in srgb, #2563eb 16%, transparent); color: #1d4ed8; }
table.perf-grid .g-t { background: color-mix(in srgb, #d97706 8%, transparent); }
table.perf-grid th.grp.g-t { background: color-mix(in srgb, #d97706 18%, transparent); color: #b45309; }
table.perf-grid .g-lin { background: color-mix(in srgb, #6b7280 7%, transparent); }
table.perf-grid th.grp.g-lin { background: color-mix(in srgb, #6b7280 16%, transparent); color: #4b5563; }
@media (prefers-color-scheme: dark) {
  table.perf-grid th.grp.g-p6 { color: #93c5fd; } table.perf-grid th.grp.g-t { color: #fcd34d; } table.perf-grid th.grp.g-lin { color: #d1d5db; }
}
details.motor-key { margin-top: 10px; font-size: .9rem; }
details.motor-key summary { cursor: pointer; color: var(--muted); }
@media (max-width: 760px) {
  /* phones: the table scrolls sideways under the sticky Quantity column */
  .grid-wrap { --q: 11.5rem; }
  .grid-wrap.n4 { width: auto; }
  table.perf-grid th, table.perf-grid td { padding: 7px 8px; }
  table.perf-grid th.q, table.perf-grid td.q { padding-left: 10px; }
  table.perf-grid td.q { font-size: .8rem; line-height: 1.25; }      /* labels in two lines, rarely three */
}

/* Dash numbers: the key row (top speed) stands out; compare bar and pop-up card */
table.perf-grid tr.key-row td, table.perf tr.key-row td { background: color-mix(in srgb, #facc15 32%, transparent); font-weight: 700; }
table.perf-grid tr.key-row td.q, table.perf tr.key-row td.q { box-shadow: inset 4px 0 0 #ca8a04; }
.cmp-bar { margin: 8px 0 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cmp-bar select { max-width: 100%; }
.cmp-pop { position: fixed; inset: 0; background: #0f172a8c; display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.cmp-pop.hidden { display: none !important; }
.cmp-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; max-width: 920px; width: 100%; max-height: 90vh; overflow: auto; box-shadow: 0 12px 40px #0f172a55; }
.cmp-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.cmp-head h3 { margin: 0; }
.cmp-card td.cmp-win { background: color-mix(in srgb, #16a34a 22%, transparent); font-weight: 700; }
