/* VisorVolt sandbox — brand design system.
   Palette, type and radii are taken from the VisorVolt website (visorvolt-site/css/styles.css):
   navy #0E1520 / #131D2E / #192438, steel blue #5A8DB5 / #4677A0, orange #BF7B30 / #D49040,
   off-white #F2F5FA / #E2E8F2 / #EEF2F8, slate #8AAAC2, border rgba(140,180,210,.13).
   DM Sans is the UI face, DM Mono carries every number, ID and code span. Both are self-hosted
   under /static/fonts (CSP is default-src 'self'; nothing is fetched from a third party).
   Light is the product surface; dark is the navy family, not an inversion. */

@font-face {
  font-family: "DM Sans"; font-style: normal; font-weight: 300 700; font-display: swap;
  src: url("/static/fonts/dm-sans.woff2") format("woff2");
}
@font-face {
  font-family: "DM Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/static/fonts/dm-mono-400.woff2") format("woff2");
}
@font-face {
  font-family: "DM Mono"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("/static/fonts/dm-mono-500.woff2") format("woff2");
}

:root {
  color-scheme: light;
  /* brand */
  --navy: #0E1520; --navy2: #131D2E; --navy3: #0A1018; --navy-mid: #192438;
  --brand-orange: #BF7B30; --brand-orange-lt: #D49040;
  --brand-steel: #5A8DB5; --brand-steel-dk: #4677A0;

  /* light surface */
  --bg: #EFF3F9;
  --bg-2: #E4EAF3;
  --surface: #FFFFFF;
  --surface-2: #F1F5FA;
  --surface-3: #E7EDF6;
  --border: rgba(25, 46, 76, .12);
  --border-strong: rgba(25, 46, 76, .22);
  --grid: rgba(25, 46, 76, .10);

  --text: #101A28;
  --text-2: #3C4C63;
  --text-3: #5B6C85;

  --accent: #4677A0;          /* interactive / chart series */
  --accent-ink: #33648C;      /* link + on-light text */
  --accent-wash: rgba(70, 119, 160, .10);
  --accent-ring: #33648C;   /* opaque: a focus ring must clear 3:1, .35 alpha was ~1.3:1 */
  --accent-stripe: rgba(70, 119, 160, .35);  /* the barber-pole, which wants to stay soft */

  --orange: #BF7B30;          /* the single energy accent — key action only */
  --orange-hi: #A96824;
  --orange-ink: #8A5415;
  --orange-wash: rgba(191, 123, 48, .12);
  --on-orange: #16202E;   /* navy on orange, as on the website: 5.0:1, AA for 14px bold */

  --ok: #1B6B45;   --ok-wash: #E1EFE7;
  --warn: #8A5A00; --warn-wash: #F8EEDA;
  --bad: #A62B22;  --bad-wash: #FAE7E5;
  --fake: #6B3A8C; --fake-wash: #F0E8F7;

  --radius: 12px;
  --radius-md: 10px;
  --radius-sm: 4px;
  --shadow: 0 1px 1px rgba(16, 26, 40, .03), 0 4px 14px rgba(16, 26, 40, .05);
  --shadow-lift: 0 2px 4px rgba(16, 26, 40, .05), 0 10px 28px rgba(16, 26, 40, .10);

  --font: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "DM Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* brand mark, inline SVG in the header */
  --mark-struct: #2C4568;
  --mark-bolt: #16283F;
  --wordmark: #101A28;
}

/* Dark: the brand navy family. Deliberate, not inverted. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0E1520; --bg-2: #0A1018;
    --surface: #131D2E; --surface-2: #192438; --surface-3: #1F2C43;
    --border: rgba(140, 180, 210, .13);
    --border-strong: rgba(140, 180, 210, .28);
    --grid: rgba(140, 180, 210, .12);
    --text: #EEF2F8; --text-2: #AFC2D6; --text-3: #8AAAC2;
    --accent: #5A8DB5; --accent-ink: #8FB8D8;
    --accent-wash: rgba(90, 141, 181, .16);
    --accent-ring: #9CC4E4;
    --accent-stripe: rgba(122, 170, 210, .55);
    --orange: #C0792C; --orange-hi: #D49040; --orange-ink: #E0A45C;
    --orange-wash: rgba(212, 144, 64, .14);
    --on-orange: #0E1520;
    --ok: #6FCFA0;   --ok-wash: #12291F;
    --warn: #E0A44A; --warn-wash: #2E2413;
    --bad: #F0928A;  --bad-wash: #331A19;
    --fake: #C9A3E8; --fake-wash: #261B33;
    --shadow: 0 1px 0 rgba(140, 180, 210, .04);
    --shadow-lift: 0 10px 30px rgba(0, 0, 0, .45);
    --mark-struct: #6E93BB;
    --mark-bolt: #D49040;
    --wordmark: #EEF2F8;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0E1520; --bg-2: #0A1018;
  --surface: #131D2E; --surface-2: #192438; --surface-3: #1F2C43;
  --border: rgba(140, 180, 210, .13);
  --border-strong: rgba(140, 180, 210, .28);
  --grid: rgba(140, 180, 210, .12);
  --text: #EEF2F8; --text-2: #AFC2D6; --text-3: #8AAAC2;
  --accent: #5A8DB5; --accent-ink: #8FB8D8;
  --accent-wash: rgba(90, 141, 181, .16);
  --accent-ring: #9CC4E4;
  --accent-stripe: rgba(122, 170, 210, .55);
  --orange: #C0792C; --orange-hi: #D49040; --orange-ink: #E0A45C;
  --orange-wash: rgba(212, 144, 64, .14);
  --on-orange: #0E1520;
  --ok: #6FCFA0;   --ok-wash: #12291F;
  --warn: #E0A44A; --warn-wash: #2E2413;
  --bad: #F0928A;  --bad-wash: #331A19;
  --fake: #C9A3E8; --fake-wash: #261B33;
  --shadow: 0 1px 0 rgba(140, 180, 210, .04);
  --shadow-lift: 0 10px 30px rgba(0, 0, 0, .45);
  --mark-struct: #6E93BB;
  --mark-bolt: #D49040;
  --wordmark: #EEF2F8;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  min-height: 100vh; display: flex; flex-direction: column;
  font: 400 15px/1.6 var(--font);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11";
}

a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--accent-ring); outline-offset: 2px; border-radius: 3px; }

/* Nine header controls sit before the content on every page; a keyboard or screen-reader user
   had to walk all of them on every navigation. */
.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 50;
  background: var(--surface); color: var(--accent-ink); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 9px 14px; font-size: .875rem; font-weight: 600;
  transition: top .12s ease;
}
.skip-link:focus { top: 12px; text-decoration: none; }
main.wrap:focus { outline: none; }

/* ── type scale ── */
h1 { font-size: 1.8rem; line-height: 1.2; font-weight: 600; letter-spacing: -.022em; margin: 0 0 .35em; color: var(--text); }
h2 { font-size: 1.0625rem; line-height: 1.35; font-weight: 600; letter-spacing: -.008em; margin: 0 0 .5em; }
h3 { font-size: .9375rem; font-weight: 600; margin: 1em 0 .3em; }
p { margin: .5em 0; }
strong { font-weight: 600; }
code, .mono { font-family: var(--mono); font-size: .86em; font-variant-ligatures: none; }
code { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .05em .35em; }
.mono { letter-spacing: -.01em; }
.num, .tabular { font-variant-numeric: tabular-nums; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--text-2); }
.small { font-size: .8125rem; line-height: 1.55; }
.bad { color: var(--bad); }
.lede { font-size: 1.0625rem; line-height: 1.6; color: var(--text-2); max-width: 74ch; margin: 0 0 4px; }
.crumbs {
  font-family: var(--mono); font-size: .75rem; letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-3); margin: 0 0 14px;
}
.crumbs a { color: var(--text-3); }
.crumbs a:hover { color: var(--accent-ink); }
.eyebrow {
  font-family: var(--mono); font-size: .6875rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--text-3); font-weight: 500;
}

/* ── header ── */
.devbar {
  width: 100%;
  background: var(--fake-wash); color: var(--fake); text-align: center;
  padding: 7px 24px; font-size: .8125rem; border-bottom: 1px solid var(--border);
}
.top {
  width: 100%;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.top-inner { display: flex; align-items: center; gap: 12px 28px; min-height: 66px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }

.brand { display: flex; align-items: center; gap: 10px; color: var(--text); flex: none; }
.brand:hover { text-decoration: none; }
.brand:hover .brand-mark { color: var(--accent-ink); }
.brand-icon { width: 32px; height: 32px; flex: none; display: block; }
.brand-icon .bm-struct { stroke: var(--mark-struct); fill: none; }
.brand-icon .bm-energy { stroke: var(--orange-hi); fill: none; }
.brand-icon .bm-dot-a { fill: var(--orange-hi); }
.brand-icon .bm-dot-b { fill: var(--mark-struct); stroke: var(--orange-hi); }
.brand-icon .bm-flash { fill: var(--mark-bolt); stroke: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.12; min-width: 0; }
.brand-mark { font-size: 1.0625rem; font-weight: 600; letter-spacing: -.02em; color: var(--wordmark); }
.brand-mark .volt { color: var(--orange-ink); }
.brand-sub {
  font-family: var(--mono); font-size: .625rem; letter-spacing: .13em; text-transform: uppercase;
  color: var(--text-3); margin-top: 3px;
}

.nav { display: flex; gap: 2px; flex-wrap: wrap; }
.nav a {
  color: var(--text-2); padding: 7px 12px; border-radius: var(--radius-sm);
  font-size: .875rem; font-weight: 500; position: relative;
}
.nav a:hover { text-decoration: none; background: var(--surface-2); color: var(--text); }
.nav a[aria-current="page"] { color: var(--text); background: var(--accent-wash); }
.nav a[aria-current="page"] { font-weight: 600; }
.who { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: .8125rem; color: var(--text-2); min-width: 0; }
.email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; color: var(--text-2); }
.theme-btn {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-2); width: 32px; height: 32px; cursor: pointer; font-size: .9rem; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; flex: none;
}
.theme-btn:hover { border-color: var(--border-strong); color: var(--text); }

.foot {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px;
  color: var(--text-3); font-size: .78125rem; margin-top: 56px;
  padding-top: 22px; padding-bottom: 44px; border-top: 1px solid var(--border);
}
.foot a { color: var(--text-3); text-decoration: underline; text-underline-offset: 2px; }
.foot a:hover { color: var(--accent-ink); }

main.wrap { padding-top: 26px; padding-bottom: 8px; flex: 1 0 auto; width: 100%; }
.foot { flex: none; width: 100%; }

/* ── surfaces ── */
.panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px 24px; margin: 18px 0; box-shadow: var(--shadow); min-width: 0;
}
.panel > h2 { margin-top: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px 24px; flex-wrap: wrap; }
.panel-head > div { min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.grid2.wide-left { grid-template-columns: 3fr 2fr; }
@media (max-width: 860px) { .grid2, .grid2.wide-left { grid-template-columns: 1fr; } }
.title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between; }
.title-row h1 { margin-right: auto; margin-bottom: 0; }
.section-h { margin-top: 44px; margin-bottom: 4px; }
.scroll-x { overflow-x: auto; }
/* narrow screens: let a table scroll inside its panel rather than crush a column to one
   character per line */
.scroll-x > .tbl { min-width: 520px; }

/* ── home ── */
.hero { padding: 4px 0; }
.hero h1 { font-size: clamp(1.75rem, 1.15rem + 1.9vw, 2.4rem); max-width: 22ch; letter-spacing: -.028em; }
.hero .lede { margin-top: 12px; }
.scope {
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--accent); border-radius: var(--radius);
  padding: 18px 22px; margin-top: 26px; max-width: 900px; box-shadow: var(--shadow);
}
.scope h2 { font-size: .6875rem; font-family: var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); font-weight: 500; margin-bottom: 10px; }
.scope ul { margin: 0; padding-left: 18px; }
.scope li { margin: 6px 0; color: var(--text-2); }
.scope li strong { color: var(--text); }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 18px; margin-top: 16px; }
.card {
  display: flex; flex-direction: column; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px;
  color: var(--text); box-shadow: var(--shadow);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.card:hover { text-decoration: none; border-color: var(--border-strong); box-shadow: var(--shadow-lift); transform: translateY(-1px); }
.card h3 { margin: 12px 0 2px; font-size: 1.0625rem; letter-spacing: -.012em; }
.card p { margin: 6px 0; color: var(--text-2); }
.card .muted { color: var(--text-3); font-size: .8125rem; }
.card-top { display: flex; gap: 6px; flex-wrap: wrap; }
.card-cta { margin-top: auto; padding-top: 14px; color: var(--accent-ink); font-size: .875rem; font-weight: 500; }
.card:hover .card-cta { color: var(--orange-ink); }

.callout {
  display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap;
  margin-top: 32px; background: var(--surface-2); border-color: var(--border);
}
.callout h2 { margin-bottom: 4px; }
.callout p { margin: 0; max-width: 70ch; color: var(--text-2); }

/* ── pills, tags, banners ── */
.pill {
  display: inline-block; font-size: .6875rem; font-weight: 600; letter-spacing: .03em;
  padding: 3px 9px; border-radius: 999px;
  background: var(--surface-3); color: var(--text-2); white-space: nowrap;
}
.pill-ok, .st-validated, .st-done, .st-run_launched, .st-run_done { background: var(--ok-wash); color: var(--ok); }
.pill-wait, .st-validating, .st-preparing, .st-queued, .st-running, .st-preparing_run, .st-awaiting_upload, .st-deleting { background: var(--warn-wash); color: var(--warn); }
.pill-bad, .st-validation_failed, .st-failed, .st-error, .st-delete_failed, .st-run_failed, .st-no_results, .st-run_no_results, .st-delete_incomplete { background: var(--bad-wash); color: var(--bad); }
.pill-fake { background: var(--fake-wash); color: var(--fake); }
.tag {
  display: inline-block; font-family: var(--mono); font-size: .75rem; padding: 2px 8px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); margin: 2px 0;
  background: var(--surface-2); color: var(--text-2);
}
.banner { border-radius: var(--radius-md); padding: 11px 16px; margin: 14px 0; font-size: .875rem; }
.banner-fake { background: var(--fake-wash); color: var(--fake); border: 1px solid color-mix(in srgb, var(--fake) 35%, transparent); }
.banner-bad { background: var(--bad-wash); color: var(--bad); border: 1px solid color-mix(in srgb, var(--bad) 35%, transparent); }
.banner-warn { background: var(--warn-wash); color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); }
.error { color: var(--bad); background: var(--bad-wash); padding: 9px 14px; border-radius: var(--radius-md); border: 1px solid color-mix(in srgb, var(--bad) 28%, transparent); }
.notice { color: var(--ok); background: var(--ok-wash); padding: 9px 14px; border-radius: var(--radius-md); border: 1px solid color-mix(in srgb, var(--ok) 28%, transparent); }

/* ── key-value lists, tables ── */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 9px 22px; margin: 0; }
.kv dt { color: var(--text-3); font-size: .8125rem; padding-top: 1px; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; color: var(--text-2); }
.kv dd strong { color: var(--text); }
@media (max-width: 560px) { .kv { grid-template-columns: 1fr; gap: 2px 0; } .kv dd { margin-bottom: 10px; } }

.tbl { width: 100%; border-collapse: collapse; font-size: .875rem; }
.tbl th, .tbl td { text-align: left; padding: 9px 12px; vertical-align: top; }
.tbl thead th {
  color: var(--text-3); font-weight: 500; font-size: .65rem; letter-spacing: .07em;
  text-transform: uppercase; font-family: var(--mono);
  border-bottom: 1px solid var(--border-strong); white-space: nowrap;
}
.tbl tbody tr + tr td { border-top: 1px solid var(--border); }
.tbl tbody tr:hover td { background: var(--surface-2); }
.tbl td:first-child, .tbl th:first-child { padding-left: 2px; }
.tbl td:last-child, .tbl th:last-child { padding-right: 2px; }
.tbl .num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl thead th.num { text-align: right; }
.row-off td { color: var(--text-3); }
details { margin: 12px 0 0; }
details summary { cursor: pointer; color: var(--accent-ink); margin: 6px 0; font-size: .875rem; font-weight: 500; }
details summary:hover { text-decoration: underline; text-underline-offset: 2px; }
details[open] summary { margin-bottom: 10px; }

/* ── forms ── */
.field { display: block; margin: 0 0 16px; }
.field span { display: block; font-size: .8125rem; font-weight: 500; color: var(--text-2); margin-bottom: 6px; }
input[type=text], input[type=file], input[type=email], input[type=password], select, textarea {
  width: 100%; font: inherit; font-size: .9375rem; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 9px 11px;
  transition: border-color .12s ease, box-shadow .12s ease;
}
input[type=file] { padding: 7px 10px; font-size: .875rem; }
input::placeholder { color: var(--text-3); }
input[type=text]:focus, input[type=email]:focus, input[type=password]:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash), 0 0 0 1px var(--accent-ring);
}
input[type=file]:focus-visible { outline: 2px solid var(--accent-ring); outline-offset: 2px; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); }
select { width: auto; font-size: .875rem; padding: 8px 10px; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px; margin: 0 0 16px; background: var(--surface-2); }
fieldset::after { content: ""; display: table; clear: both; }
legend { float: left; width: 100%; padding: 0; margin-bottom: 2px; font-size: .875rem; font-weight: 600; line-height: 1.4; }
.radio { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0; font-size: .875rem; color: var(--text-2); }
.radio input { margin-top: 4px; flex: none; width: auto; }
.radio strong { color: var(--text); }
.regex-row { padding-left: 28px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: .875rem; padding: 9px 18px;
  border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); cursor: pointer; text-decoration: none;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.btn:hover { text-decoration: none; background: var(--surface-2); border-color: var(--text-3); }
.btn:disabled, .btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn:disabled:hover { background: var(--surface); border-color: var(--border-strong); }
/* Orange is the brand's energy colour: it marks the one action that matters on a page. */
.btn-primary { background: var(--orange); border-color: var(--orange); color: var(--on-orange); }
.btn-primary:hover { background: var(--orange-hi); border-color: var(--orange-hi); color: var(--on-orange); }
.btn-danger { background: var(--surface); border-color: var(--bad); color: var(--bad); }
.btn-danger:hover { background: var(--bad-wash); border-color: var(--bad); color: var(--bad); }
.btn-sm { font-size: .78125rem; padding: 6px 12px; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline-form input { flex: 1 1 220px; width: auto; }
.danger { border-color: color-mix(in srgb, var(--bad) 30%, var(--border)); }
.progress .bar { height: 6px; background: var(--surface-3); border-radius: 999px; overflow: hidden; margin-top: 14px; }
.progress .bar span { width: 0; display: block; height: 100%; background: var(--accent); transition: width .2s; }

/* segmented control */
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); flex: none; }
.seg label { padding: 6px 14px; font-size: .8125rem; font-weight: 500; cursor: pointer; color: var(--text-2); font-variant-numeric: tabular-nums; }
.seg label + label { border-left: 1px solid var(--border); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); }
.seg label:has(input:focus-visible) { outline: 2px solid var(--accent-ring); outline-offset: -2px; }

/* metric switching */
.results[data-metric="mAP50"] .m-mAP { display: none; }
.results[data-metric="mAP"] .m-mAP50 { display: none; }

/* checks */
.chk-todo { margin-top: 4px; font-size: .8125rem; color: var(--text-2); }
.chk-todo strong { color: var(--text); }
.checks { list-style: none; padding: 0; margin: 12px 0 0; }
.chk { display: flex; gap: 10px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; font-size: .875rem; }
.chk:last-child { border-bottom: 0; }
.chk-icon { display: inline-flex; width: 20px; height: 20px; border-radius: 50%; align-items: center; justify-content: center; font-size: .75rem; font-weight: 700; flex: none; transform: translateY(3px); }
.chk-status { font-family: var(--mono); font-size: .6875rem; font-weight: 500; letter-spacing: .08em; width: 40px; flex: none; }
.chk-pass .chk-icon { background: var(--ok-wash); color: var(--ok); } .chk-pass .chk-status { color: var(--ok); }
.chk-warn .chk-icon { background: var(--warn-wash); color: var(--warn); } .chk-warn .chk-status { color: var(--warn); }
.chk-fail .chk-icon { background: var(--bad-wash); color: var(--bad); } .chk-fail .chk-status { color: var(--bad); }

.working { display: flex; gap: 16px; align-items: flex-start; }
.working p { margin: 4px 0 0; }
.spinner { width: 22px; height: 22px; border: 2.5px solid var(--surface-3); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; flex: none; margin-top: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } .card { transition: none; } }

/* ── run progress: percentage, ETA, per-step list ──
   One fill colour only (the steel-blue --accent). State is carried by the word in .step-state and
   by the icon, never by colour alone. Every number is mono. */
.prog { display: block; }
.prog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.prog-head-text { min-width: 0; }
.prog-head strong { font-size: 18px; }
.prog-head p { margin: 2px 0 0; }
.prog-pct { font-size: 30px; font-weight: 500; line-height: 1; font-variant-numeric: tabular-nums;
            color: var(--accent-ink); flex: none; }
/* Native <progress>: the CSP here is style-src 'self', so a bar whose width came from an inline
   style attribute would be silently dropped and every bar would render full. The value lives in
   an attribute instead. */
progress.prog-track, progress.step-bar { -webkit-appearance: none; appearance: none; border: 0;
              display: block; width: 100%; color: var(--accent); }
progress.prog-track { height: 12px; margin: 14px 0 8px; border-radius: 999px;
              background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--border); }
progress.prog-track::-webkit-progress-bar { background: transparent; border-radius: 999px; }
progress.prog-track::-webkit-progress-value { background: var(--accent); border-radius: 999px; }
progress.prog-track::-moz-progress-bar { background: var(--accent); border-radius: 999px; }
/* No value attribute = indeterminate. A moving barber-pole in the SAME steel blue: every frame
   reads as "working", unlike a single travelling block that can be off-screen when you look. */
progress.prog-track:indeterminate {
  background-image: repeating-linear-gradient(115deg,
      var(--accent-stripe) 0 11px, var(--surface-3) 11px 22px);
  background-size: 200% 100%; animation: prog-stripes 1.1s linear infinite; }
progress.prog-track:indeterminate::-webkit-progress-bar { background: transparent; }
@keyframes prog-stripes { from { background-position: 0 0; } to { background-position: 48.6px 0; } }
@media (prefers-reduced-motion: reduce) {
  progress.prog-track:indeterminate { animation: none; }
}
.prog-eta { margin: 0 0 4px; color: var(--text-2); }
.prog-eta.prog-over { color: var(--warn); font-weight: 500; }
.prog-warn-icon { display: inline-block; width: 16px; height: 16px; border-radius: 50%;
                  background: var(--warn-wash); color: var(--warn); text-align: center;
                  line-height: 16px; font-weight: 700; font-size: 11px; }
.prog-foot { margin: 10px 0 0; }

.steps { list-style: none; margin: 14px 0 0; padding: 0; }
.step { display: grid; grid-template-columns: 20px 74px 1fr auto; align-items: center;
        gap: 10px; padding: 7px 2px; border-top: 1px solid var(--border); font-size: 14px; }
.step:first-child { border-top: 0; }
.step-icon { width: 20px; height: 20px; border-radius: 50%; text-align: center; line-height: 20px;
             font-size: 12px; background: var(--surface-3); color: var(--text-3); }
.step-state { font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
              color: var(--text-3); }
.step-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step-time { color: var(--text-3); font-size: 13px; font-variant-numeric: tabular-nums;
             white-space: nowrap; }
progress.step-bar { display: none; height: 4px; margin-top: 4px; border-radius: 999px;
             background: var(--surface-3); }
progress.step-bar::-webkit-progress-bar { background: transparent; border-radius: 999px; }
progress.step-bar::-webkit-progress-value { background: var(--accent); border-radius: 999px; }
progress.step-bar::-moz-progress-bar { background: var(--accent); border-radius: 999px; }
.step-done .step-icon { background: var(--accent-wash); color: var(--accent-ink); }
.step-done .step-label { color: var(--text-2); }
.step-running { font-weight: 500; }
.step-running .step-icon { background: var(--accent); color: var(--surface); }
.step-running .step-state { color: var(--accent-ink); }
.step-running progress.step-bar { display: block; grid-column: 3 / -1; }
.step-queued .step-icon, .step-todo .step-icon { background: transparent; border: 1px dashed var(--border-strong); }
.step-queued .step-label, .step-queued .step-time,
.step-todo .step-label, .step-todo .step-time { color: var(--text-3); }
/* Elapsed time and the heartbeat. Quiet by design: they answer "is this alive?", which should be
   reassuring at a glance and never compete with the step the reader actually cares about. */
.prog-meta { margin: 0 0 10px; font-variant-numeric: tabular-nums; }

@media (max-width: 560px) {
  .prog-head { flex-direction: column-reverse; align-items: flex-start; gap: 4px; }
  .prog-pct { font-size: 26px; }
  .step { grid-template-columns: 20px 1fr auto; gap: 8px; }
  .step-state { grid-column: 2 / -1; grid-row: 2; margin-top: -4px; }
  .step-running progress.step-bar { grid-column: 2 / -1; }
}

/* ── chart ── */
.chart { position: relative; margin: 6px 0 4px; }
.viz { width: 100%; height: auto; display: block; font-family: var(--font); }
.viz-plot { fill: var(--surface-2); opacity: .5; }
.viz-grid { stroke: var(--grid); stroke-width: 1; }
.viz-axis { stroke: var(--border-strong); stroke-width: 1; }
.viz-tick { fill: var(--text-2); font-family: var(--mono); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.viz-tick.muted { fill: var(--text-3); font-size: 10.5px; }
.viz-axis-label { fill: var(--text-3); font-size: 11.5px; letter-spacing: .02em; font-weight: 500; }
.viz-line { fill: none; stroke: var(--accent); stroke-width: 2.25; stroke-linejoin: round; stroke-linecap: round; }
.viz-band { fill: var(--accent); opacity: .08; }
.viz-pt { fill: var(--accent); stroke: var(--surface); stroke-width: 2.5; transition: r .12s ease; }
.viz-full { fill: var(--orange); stroke: var(--surface); stroke-width: 2.5; transition: r .12s ease; }
.viz-draw { fill: var(--accent); opacity: .38; }
.viz-err { stroke: var(--accent); stroke-width: 1.5; opacity: .75; }
.viz-ref { stroke: var(--orange); stroke-width: 1.5; stroke-dasharray: 5 4; opacity: .9; }
.viz-ref-label { fill: var(--orange-ink); font-family: var(--mono); font-size: 11px; font-variant-numeric: tabular-nums; }
.viz-val { fill: var(--text); font-family: var(--mono); font-size: 11.5px; font-weight: 500; font-variant-numeric: tabular-nums; }
.viz-hit { cursor: default; outline: none; }
.viz-hit:focus .viz-pt, .viz-hit:hover .viz-pt, .viz-hit:hover .viz-full, .viz-hit:focus .viz-full { r: 7; }
.viz-hit:focus .viz-focus { stroke: var(--accent-ring); stroke-width: 2; fill: none; }
.tip {
  position: absolute; pointer-events: none; background: var(--navy); color: #EEF2F8;
  font-size: .78125rem; line-height: 1.5; padding: 8px 11px; border-radius: var(--radius-sm);
  max-width: 320px; z-index: 5; box-shadow: 0 6px 22px rgba(10, 16, 24, .35);
  border: 1px solid rgba(140, 180, 210, .18); font-variant-numeric: tabular-nums;
}

/* ── gallery ── */
.gallery { margin-top: 14px; }
.gal-row { margin: 0 0 22px; }
.gal-row:last-child { margin-bottom: 0; }
.gal-row figcaption {
  font-family: var(--mono); font-size: .75rem; color: var(--text-3);
  margin-bottom: 8px; overflow-wrap: anywhere;
}
/* auto-fit, so a row of 2 cells (full supervision hidden) fills the width instead of
   leaving an empty third column */
.gal-cells { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
@media (max-width: 640px) { .gal-cells { grid-template-columns: 1fr; } }
.gal-link { display: block; cursor: zoom-in; }
.gal-link:focus-visible { outline: 2px solid var(--accent-ring); outline-offset: 3px; }
.gal-cell { position: relative; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.gal-cell img { width: 100%; height: auto; display: block; aspect-ratio: 4/3; object-fit: contain; background: var(--navy3); }
.gal-label {
  position: absolute; left: 8px; top: 8px; background: rgba(10, 16, 24, .78); color: #EEF2F8;
  font-family: var(--mono); font-size: .6875rem; letter-spacing: .04em;
  padding: 3px 8px; border-radius: var(--radius-sm);
}
/* lightbox: click a gallery image to enlarge it on the SAME page (no new tab) */
.lightbox { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px; padding: 24px;
  background: rgba(10, 16, 24, .86); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: min(1200px, 96vw); max-height: 82vh; width: auto; height: auto;
  border-radius: var(--radius-md); background: var(--navy3); box-shadow: 0 8px 40px rgba(0, 0, 0, .55); }
.lightbox-cap { color: #EEF2F8; font-size: .8125rem; text-align: center; max-width: 90vw;
  overflow-wrap: anywhere; }
.lightbox-close { position: absolute; top: 16px; right: 16px; width: 40px; height: 40px;
  font-size: 1.1rem; line-height: 1; border-radius: var(--radius-sm); cursor: pointer;
  border: 1px solid rgba(140, 180, 210, .3); background: rgba(19, 29, 46, .9); color: #EEF2F8; }
.lightbox-close:hover { background: var(--navy-mid); }
.lightbox-close:focus-visible { outline: 2px solid var(--accent-ring); outline-offset: 2px; }
body.lightbox-open { overflow: hidden; }

/* ── downloadable sample datasets ── */
.dl-list { display: grid; gap: 14px; margin-top: 16px; }
.dl-item { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2);
  padding: 18px 20px; }
.dl-body { flex: 1 1 320px; min-width: 0; }
.dl-body h3 { margin: 0 0 3px; font-size: 1rem; letter-spacing: -.012em; }
.dl-body p { margin: 5px 0; }
.dl-facts { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; color: var(--text-2); font-family: var(--mono); font-size: .75rem; font-variant-numeric: tabular-nums; }
.dl-facts span { white-space: nowrap; }
.dl-btn { flex: none; align-self: center; }
.dl-inline { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 14px 0 0; }

.caveats { border-left: 3px solid var(--warn); }
.caveats ul { margin: 0; padding-left: 18px; color: var(--text-2); }
.caveats li { margin: 5px 0; }
.metric-name { font-weight: 400; margin-left: 6px; color: var(--text-3); }

.chk-body { flex: 1 1 260px; min-width: 0; }
#run-form .tbl td:nth-child(2) { min-width: 13ch; }
.prompt-cell { width: 32%; }
.prompt-cell input { min-width: 150px; }
.grid2.wide-left > .panel { min-width: 0; }
.action-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.action-row .btn { flex: none; }
.action-row span { flex: 1 1 220px; }

/* ── sign-in / account / users ── */
.signin-body { display: flex; flex-direction: row; min-height: 100vh; align-items: center; justify-content: center; padding: 40px 20px; background: var(--bg); }
.signin-body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(760px 420px at 50% -8%, var(--accent-wash), transparent 70%),
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 56px 56px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 56px 56px;
  opacity: .5;
  -webkit-mask-image: radial-gradient(660px 480px at 50% 30%, #000, transparent 72%);
  mask-image: radial-gradient(660px 480px at 50% 30%, #000, transparent 72%);
}
.signin { width: 100%; max-width: 396px; position: relative; z-index: 1; }
.signin-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; justify-content: center; }
.signin-brand .brand-icon { width: 38px; height: 38px; }
.signin-brand .brand-mark { font-size: 1.3125rem; }
.signin-panel { margin: 0; padding: 28px 28px 26px; box-shadow: var(--shadow-lift); }
.signin-panel h1 { margin: 0 0 4px; font-size: 1.3125rem; }
.signin-panel .signin-kicker { margin: 0 0 20px; color: var(--text-3); font-size: .875rem; }
.signin-panel form button { width: 100%; margin-top: 6px; }
.signin-panel .error, .signin-panel .notice { margin-bottom: 16px; font-size: .875rem; }
.signin-note { margin: 18px 0 0; padding-top: 16px; border-top: 1px solid var(--border); color: var(--text-3); }
.signin-foot { display: block; text-align: center; color: var(--text-3); font-size: .75rem; margin-top: 22px; font-family: var(--mono); letter-spacing: .04em; }
.logout-form { margin: 0; }
.temp-pw { font-size: 1.0625rem; background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 11px 15px; display: inline-block; user-select: all; overflow-wrap: anywhere; letter-spacing: .02em; }
.who .email { max-width: 220px; }

/* error page */
.errpage { padding: 64px 0 40px; max-width: 60ch; }
.errpage .code { font-family: var(--mono); font-size: 3rem; font-weight: 500; color: var(--text-3); line-height: 1; letter-spacing: -.02em; }
.errpage h1 { margin: 14px 0 8px; }
.errpage p { color: var(--text-2); }
.errpage .btn { margin-top: 20px; }

/* ── narrow screens ── */
@media (max-width: 720px) {
  .wrap { padding: 0 16px; }
  .top-inner { gap: 10px 16px; min-height: 0; padding-top: 12px; padding-bottom: 10px; }
  .brand { order: 1; }
  .who { order: 2; }
  .nav { order: 3; flex-basis: 100%; gap: 2px; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none;
         padding-right: 20px; margin-right: -16px;
         -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent);
         mask-image: linear-gradient(90deg, #000 88%, transparent); }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { white-space: nowrap; }
  .panel { padding: 18px 16px; border-radius: var(--radius-md); }
  .signin-panel { padding: 24px 20px; }
  h1 { font-size: 1.5rem; }
  .who .email { max-width: 150px; }
  .dl-item { padding: 16px; }
  .dl-btn { width: 100%; }
  .foot { margin-top: 40px; }
}

/* Under ~430px the horizontally scrolling nav hid up to 36px of its last item (an admin lost
   "Users") behind a fade that reads as decoration. Wrap onto two rows instead: nothing is hidden
   and nothing needs discovering. */
@media (max-width: 430px) {
  .nav { flex-wrap: wrap; overflow-x: visible; padding-right: 0; margin-right: 0;
         -webkit-mask-image: none; mask-image: none; row-gap: 4px; }
}

/* In-page confirmation for an expensive action (the Run button). Warm, not alarming: this is a
   "are you sure you want to spend this" step, not an error. */
.confirm {
  margin: 14px 0 0; padding: 14px 16px; border-radius: var(--radius-md);
  background: var(--warn-wash); border: 1px solid color-mix(in srgb, var(--warn) 32%, transparent);
  color: var(--warn);
}
.confirm > strong { display: block; margin-bottom: 4px; font-size: .9375rem; }
.confirm p { color: inherit; }
.confirm .action-row { margin-top: 10px; }

/* Utility used by the sign-out form on /account. Inline style= is blocked by our CSP
   (style-src 'self'), which silently dropped the margin and logged a console error. */
.mt-14 { margin-top: 14px; }

/* Cancel sits with its explanation, not alone: a bare "Cancel this run" invites the reader to
   wonder what it destroys. It is a secondary button, not a danger one -- it stops work, it does
   not lose data, and styling it red would make stopping a mistake feel like another mistake. */
.cancel-run { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 18px; }
