/* web/app/app.css — Kinoxi product pages (2026-11-10 restyle: quiet, dark-first).
   Every colour is a token on :root. Dark is the base; light comes from
   prefers-color-scheme or the sidebar toggle (html[data-theme]). System fonts
   only (Inter if installed); nothing is fetched from a CDN.
   Old token names (--navy --magenta --cyan --data …) are kept because page
   scripts and story_model.js SVGs read them. */
:root {
  /* surfaces */
  --bg: #0B0C0E; --bg-side: #0E0F11; --card: #141518; --card-2: #1A1B1F; --inset: #101113;
  --line: rgba(255, 255, 255, .07); --line-2: rgba(255, 255, 255, .12);
  --hover: rgba(255, 255, 255, .04); --hover-2: rgba(255, 255, 255, .07);
  /* text */
  --ink: #E6E7EA; --ink2: #8A8F98; --ink3: #62666D;
  /* one accent */
  --accent: #5E6AD2; --accent-2: #7C86E0; --accent-ink: #FFFFFF;
  --accent-soft: rgba(94, 106, 210, .16); --accent-line: rgba(124, 134, 224, .45);
  --focus: rgba(124, 134, 224, .65);
  /* calm 3-step risk palette + "no value" */
  --green: #4D9C78; --amber: #C39A45; --red: #C9615A; --none: #2A2C31;
  --green-ink: #7FC6A2; --amber-ink: #DDB96E; --red-ink: #E58B84;
  /* provenance tones */
  --violet: #9A86D8; --violet-ink: #B9A9EC;
  /* data + legacy names (read by page scripts / story SVG) */
  --data: #7C86E0; --cyan: var(--accent-2); --navy: #0B0C0E;
  --magenta: var(--accent-2);   /* legacy name; story's worker band now uses --accent */
  --on-tone: #0B0C0E;
  --side-r: #8C95EA; --side-l: #9A9EA6;
  --grid: rgba(255, 255, 255, .05); --zone-alpha: .07;
  --video-bg: #000000;
  /* shape + motion */
  --radius: 8px; --radius-sm: 6px; --pill: 999px;
  --sidebar-w: 216px; --topbar-h: 48px;
  --ease: 120ms ease;
  --shadow: none;
  --font: Inter, -apple-system, "SF Pro Text", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;
  font-family: var(--font);
  color-scheme: dark;
}
/* light theme — OS preference unless the toggle pinned dark … */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #FBFBFC; --bg-side: #F4F5F7; --card: #FFFFFF; --card-2: #F7F7F9; --inset: #F4F5F7;
    --line: rgba(15, 18, 30, .08); --line-2: rgba(15, 18, 30, .14);
    --hover: rgba(15, 18, 30, .04); --hover-2: rgba(15, 18, 30, .07);
    --ink: #1B1C1F; --ink2: #6B6F76; --ink3: #9A9DA3;
    --accent: #5E6AD2; --accent-2: #5E6AD2; --accent-soft: rgba(94, 106, 210, .10); --accent-line: rgba(94, 106, 210, .40);
    --focus: rgba(94, 106, 210, .55);
    --green: #5A9E7E; --amber: #C69B47; --red: #C8625B; --none: #E4E5E9;
    --green-ink: #2F7454; --amber-ink: #8A6416; --red-ink: #A8423B;
    --violet: #7A66C0; --violet-ink: #5B479F;
    --data: #5E6AD2; --magenta: #5E6AD2; --navy: #1B1C1F; --on-tone: #1B1C1F;
    --side-r: #5E6AD2; --side-l: #8E929A;
    --grid: rgba(15, 18, 30, .06); --zone-alpha: .08;
    color-scheme: light;
  }
}
/* … or the toggle pinned light. Same values as the block above. */
:root[data-theme="light"] {
  --bg: #FBFBFC; --bg-side: #F4F5F7; --card: #FFFFFF; --card-2: #F7F7F9; --inset: #F4F5F7;
  --line: rgba(15, 18, 30, .08); --line-2: rgba(15, 18, 30, .14);
  --hover: rgba(15, 18, 30, .04); --hover-2: rgba(15, 18, 30, .07);
  --ink: #1B1C1F; --ink2: #6B6F76; --ink3: #9A9DA3;
  --accent: #5E6AD2; --accent-2: #5E6AD2; --accent-soft: rgba(94, 106, 210, .10); --accent-line: rgba(94, 106, 210, .40);
  --focus: rgba(94, 106, 210, .55);
  --green: #5A9E7E; --amber: #C69B47; --red: #C8625B; --none: #E4E5E9;
  --green-ink: #2F7454; --amber-ink: #8A6416; --red-ink: #A8423B;
  --violet: #7A66C0; --violet-ink: #5B479F;
  --data: #5E6AD2; --magenta: #5E6AD2; --navy: #1B1C1F; --on-tone: #1B1C1F;
  --side-r: #5E6AD2; --side-l: #8E929A;
  --grid: rgba(15, 18, 30, .06); --zone-alpha: .08;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font-size: 13.5px; line-height: 1.5; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  padding-left: var(--sidebar-w); font-feature-settings: "cv11", "ss01"; }
a { color: inherit; }
::selection { background: var(--accent-soft); }
h1, h2, h3 { color: var(--ink); line-height: 1.3; margin: 0 0 .5em; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 20px; } h2 { font-size: 14px; } h3 { font-size: 13px; }
b, strong { font-weight: 600; }
.num { font-variant-numeric: tabular-nums; }
.big { font-size: 26px; font-weight: 600; letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.2; }
.note { color: var(--ink2); font-size: 12.5px; margin: .5em 0; }
.small { font-size: 12px; color: var(--ink2); }
.muted { color: var(--ink2); }
[hidden] { display: none !important; }   /* element rules set display; hidden must still win */

/* ── shell: sidebar ─────────────────────────────────────────────── */
#nav { display: contents; }
.sidebar { position: fixed; z-index: 20; left: 0; top: 0; bottom: 0; width: var(--sidebar-w);
  display: flex; flex-direction: column; gap: 2px; padding: 12px 10px;
  background: var(--bg-side); border-right: 1px solid var(--line); overflow-y: auto; }
.sidebar .brand { display: flex; align-items: center; gap: 9px; padding: 6px 8px 14px; font-weight: 600; font-size: 14px;
  text-decoration: none; color: var(--ink); letter-spacing: -.01em; }
.sidebar .brand .mark { width: 20px; height: 20px; border-radius: 5px; background: var(--accent); color: var(--accent-ink);
  display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; flex: 0 0 auto; }
.sidebar .sect { font-size: 11px; color: var(--ink3); font-weight: 500; padding: 10px 8px 4px; }
.sidebar .item { display: flex; align-items: center; gap: 10px; height: 30px; padding: 0 8px; border-radius: var(--radius-sm);
  color: var(--ink2); text-decoration: none; font-size: 13px; font-weight: 500; white-space: nowrap;
  transition: background var(--ease), color var(--ease); }
.sidebar .item:hover { background: var(--hover); color: var(--ink); }
.sidebar .item.on { background: var(--hover-2); color: var(--ink); }
.sidebar .item.on .ico { color: var(--accent-2); }
.sidebar .ico { display: inline-grid; place-items: center; width: 16px; height: 16px; flex: 0 0 auto; color: var(--ink3); transition: color var(--ease); }
.sidebar .item:hover .ico { color: var(--ink2); }
.sidebar .ico svg { display: block; }
.sidebar .spacer { flex: 1; }
.sidebar .themebtn { justify-content: flex-start; width: 100%; border: 0; background: none; cursor: pointer; }
.sidebar .account .who { color: var(--ink2); cursor: default; }
.sidebar .account .who .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.sidebar .foot { font-size: 11px; color: var(--ink3); padding: 6px 8px 2px; }
.sidebar .item.quiet { color: var(--ink3); font-size: 12.5px; }
.sidebar .item.quiet:hover { color: var(--ink); }
/* phone drawer: menu button in the top bar + backdrop (shown only ≤ 640 px) */
.menubtn { display: none; flex: 0 0 auto; width: 32px; height: 32px; min-height: 0; padding: 0; margin-left: -6px; place-items: center;
  border: 0; background: none; color: var(--ink2); }
.menubtn:hover { background: var(--hover); color: var(--ink); }
.menubtn .ico { display: inline-grid; place-items: center; }
.navscrim { display: none; }

/* ── shell: top bar (breadcrumb · provenance · mode) ───────────── */
.topbar { position: sticky; top: 0; z-index: 10; height: var(--topbar-h); display: flex; align-items: center; gap: 12px;
  padding: 0 28px; background: color-mix(in srgb, var(--bg) 88%, transparent); border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(140%) blur(8px); backdrop-filter: saturate(140%) blur(8px); }
.crumbs { display: flex; align-items: center; gap: 6px; list-style: none; margin: 0; padding: 0; min-width: 0;
  font-size: 13px; color: var(--ink2); overflow: hidden; }
.crumbs li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs li + li::before { content: "›"; color: var(--ink3); margin-right: 6px; }
.crumbs li:last-child { color: var(--ink); font-weight: 500; }
.crumbs a { text-decoration: none; transition: color var(--ease); } .crumbs a:hover { color: var(--ink); }
.topbar .tb-right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: 0 1 auto; min-width: 0; flex-wrap: nowrap; }
.modepill { font-size: 11.5px; color: var(--ink2); padding: 2px 8px; border: 1px solid var(--line); border-radius: var(--pill);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 280px; }

main { max-width: 1200px; margin: 0 auto; padding: 28px 28px 40px; }
main.narrow { max-width: 600px; padding: 20px 16px 40px; }
.pagehead { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-bottom: 22px; }
.pagehead h1 { margin: 0; }
.pagehead p { margin: 0; color: var(--ink2); max-width: 760px; font-size: 13.5px; }

/* ── provenance pill (label text is verbatim from core.provBadge) ── */
.prov { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 500; letter-spacing: .02em;
  padding: 2px 8px 2px 7px; border-radius: var(--pill); border: 1px solid var(--line-2); white-space: nowrap; vertical-align: middle;
  color: var(--ink2); background: var(--card); line-height: 1.5; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.prov::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
.prov-sim { color: var(--amber-ink); border-color: color-mix(in srgb, var(--amber) 35%, transparent); }
.prov-hw { color: var(--green-ink); border-color: color-mix(in srgb, var(--green) 35%, transparent); }
.prov-vs { color: var(--violet-ink); border-color: color-mix(in srgb, var(--violet) 35%, transparent); }
.prov-live { color: var(--accent-2); border-color: var(--accent-line); }
.prov-unknown { color: var(--red-ink); border-color: color-mix(in srgb, var(--red) 45%, transparent); }

/* ── cards + grid ──────────────────────────────────────────────── */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; }
.card h2 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card.err { border-color: color-mix(in srgb, var(--red) 50%, transparent); }
.card.err h3 { color: var(--red-ink); }
.card.empty { border-style: dashed; border-color: var(--line-2); background: transparent; color: var(--ink2); }
.card.empty h3 { color: var(--ink); }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.row { display: flex; gap: 12px 28px; align-items: center; flex-wrap: wrap; }

/* ── tones (calm 3-step) ───────────────────────────────────────── */
.tone-green { background: var(--green); } .tone-amber { background: var(--amber); }
.tone-red { background: var(--red); } .tone-none { background: var(--none); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }

/* region tiles (worker) */
.regions { display: grid; gap: 8px; }
.region { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--inset); }
.region .dot { width: 12px; height: 12px; }
.region .rl { font-weight: 600; }
.region .rw { color: var(--ink2); font-size: 12.5px; }
.region .rv { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; text-align: right; }
.region.off { opacity: .55; }

/* stacked band bars */
.stack { display: flex; gap: 2px; height: 8px; border-radius: 4px; overflow: hidden; background: var(--none); min-width: 120px; }
.stack .seg { height: 100%; }
.stack .seg:first-child { border-radius: 4px 0 0 4px; } .stack .seg:last-child { border-radius: 0 4px 4px 0; }
.stackfig { margin: 4px 0 10px; }
.stackfig figcaption { font-size: 12px; color: var(--ink2); margin-top: 4px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink2); margin: 8px 0; }
.legend .sw { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; vertical-align: 1px; }
.chanrow { display: grid; grid-template-columns: 120px 1fr auto; gap: 10px; align-items: center; margin: 6px 0; font-size: 13px; }
.chanrow .v { font-variant-numeric: tabular-nums; color: var(--ink2); font-size: 12px; white-space: nowrap; }
td .chanrow { grid-template-columns: 84px minmax(120px, 1fr) auto; min-width: 340px; }

/* compare */
.cmp { display: grid; grid-template-columns: 1fr auto auto auto; gap: 6px 16px; align-items: baseline; font-size: 13px; }
.cmp .hd { font-size: 11.5px; color: var(--ink3); font-weight: 500; }
.up { color: var(--red-ink); } .down { color: var(--green-ink); }

/* nudge + privacy */
.nudge { border-left: 2px solid var(--line-2); }
.nudge.active { border-left-color: var(--accent); }
.nudge p.main { font-size: 15px; font-weight: 500; margin: 0; }
.privacy ul { margin: 0; padding-left: 1.1em; } .privacy li { margin: 4px 0; }

/* ── tables ────────────────────────────────────────────────────── */
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 11.5px; color: var(--ink3); font-weight: 500; letter-spacing: .01em; border-bottom-color: var(--line-2); }
th .small { color: var(--ink3); font-size: 11px; }
tbody tr { transition: background var(--ease); }
tbody tr:hover td { background: var(--hover); }
tbody tr:last-child td { border-bottom: 0; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
tr.sel td { background: var(--accent-soft); }
tr.suppressed td { color: var(--ink3); font-style: italic; }
.tablewrap { overflow-x: auto; margin: 0 -10px; padding: 0 10px; }

/* verdict chips */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: var(--pill); font-size: 11.5px; font-weight: 500;
  border: 1px solid var(--line-2); white-space: nowrap; color: var(--ink2); }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.pass { color: var(--green-ink); border-color: color-mix(in srgb, var(--green) 35%, transparent); }
.chip.fail { color: var(--red-ink); border-color: color-mix(in srgb, var(--red) 35%, transparent); }
.chip.unknown { color: var(--amber-ink); border-color: color-mix(in srgb, var(--amber) 35%, transparent); }
.flag { color: var(--ink3); font-size: 11.5px; }

/* ── controls ──────────────────────────────────────────────────── */
.controls { display: flex; gap: 8px 12px; flex-wrap: wrap; align-items: center; margin: 10px 0; }
.controls label, label { color: var(--ink2); font-size: 12.5px; display: inline-flex; align-items: center; gap: 6px; }
button, select, input { font: inherit; font-size: 13px; color: var(--ink); background: var(--card-2); border: 1px solid var(--line-2);
  border-radius: var(--radius-sm); padding: 4px 10px; min-height: 28px;
  transition: background var(--ease), border-color var(--ease), color var(--ease), box-shadow var(--ease); }
select { padding-right: 26px; appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink2) 50%), linear-gradient(135deg, var(--ink2) 50%, transparent 50%);
  background-position: calc(100% - 13px) 50%, calc(100% - 9px) 50%; background-size: 4px 4px; background-repeat: no-repeat; }
button { cursor: pointer; font-weight: 500; }
button:hover, select:hover { background-color: var(--hover-2); border-color: var(--line-2); }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
button.primary:hover { background: color-mix(in srgb, var(--accent) 88%, #fff); }
button:disabled { opacity: .5; cursor: default; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
button:focus-visible, select:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
input[type=number] { width: 90px; }
input[type=file] { padding: 3px 6px; font-size: 12px; color: var(--ink2); }
input[type=file]::file-selector-button { font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line-2);
  border-radius: 5px; padding: 2px 8px; margin-right: 8px; cursor: pointer; }
input[type=range] { accent-color: var(--accent); background: none; border: 0; padding: 0; }
details summary { cursor: pointer; color: var(--ink2); font-size: 13px; font-weight: 500; list-style: none;
  display: flex; align-items: center; gap: 8px; transition: color var(--ease); }
details summary::-webkit-details-marker { display: none; }
details summary::before { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg); transition: transform var(--ease); flex: 0 0 auto; margin: 0 2px; }
details[open] summary::before { transform: rotate(45deg); }
details summary:hover { color: var(--ink); }
details[open] summary { margin-bottom: 10px; }

/* segmented control (play · speed · restart) + keyboard hints */
.segmented { display: inline-flex; align-items: stretch; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--card-2); overflow: hidden; }
.segmented > button, .segmented > select, .segmented > label { border: 0; border-radius: 0; background: transparent; min-height: 28px; margin: 0; }
.segmented > * + * { border-left: 1px solid var(--line-2) !important; }
.segmented > button:hover, .segmented > select:hover { background: var(--hover-2); }
.segmented > button.primary { background: var(--accent-soft); color: var(--ink); }
.segmented > button.primary:hover { background: color-mix(in srgb, var(--accent) 26%, transparent); }
.segmented > button.on { background: var(--hover-2); color: var(--ink); }
.kbdhint { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--ink3); }
kbd { font: 500 11px/1 var(--font); color: var(--ink2); background: var(--card-2); border: 1px solid var(--line-2);
  border-bottom-width: 2px; border-radius: 4px; padding: 2px 5px; min-width: 18px; text-align: center; display: inline-block; }

/* ── blueprint ─────────────────────────────────────────────────── */
.bpgrid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(320px, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .bpgrid { grid-template-columns: 1fr; } }
.timeline { position: relative; height: 44px; border-radius: var(--radius-sm); background: var(--inset); border: 1px solid var(--line);
  cursor: pointer; user-select: none; transition: border-color var(--ease); }
.timeline:hover { border-color: var(--line-2); }
.timeline .st { position: absolute; top: 6px; bottom: 6px; border-radius: 4px; display: flex; align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: 500; overflow: hidden; white-space: nowrap; padding: 0 4px; min-width: 0; color: var(--ink2);
  background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line); margin-left: 1px;
  container-type: inline-size; transition: background var(--ease), color var(--ease); }
.timeline .st .lbl { overflow: hidden; text-overflow: ellipsis; }
@container (max-width: 34px) { .timeline .st .lbl { display: none; } }
.timeline .st:hover { background: color-mix(in srgb, var(--accent) 26%, transparent); color: var(--ink); }
.timeline .st.sel { background: color-mix(in srgb, var(--accent) 45%, transparent); color: var(--ink); box-shadow: inset 0 0 0 1px var(--accent-2); }
.timeline .cursor { position: absolute; top: -3px; bottom: -3px; width: 2px; border-radius: 1px; background: var(--ink); pointer-events: none; }
.axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink3); margin-top: 4px; font-variant-numeric: tabular-nums; }
video { width: 100%; max-height: 300px; background: var(--video-bg); border-radius: var(--radius-sm); display: block; }
.videobox .empty { border: 1px dashed var(--line-2); border-radius: var(--radius-sm); padding: 26px; text-align: center; color: var(--ink2); font-size: 12.5px; }
/* robot panel: solid 3D render (g1_3d.js) on a soft studio floor; 2D drawing as the fallback */
.g1stage { position: relative; width: 100%; height: 100%; min-height: 280px; border-radius: var(--radius-sm); overflow: hidden;
  background: radial-gradient(120% 80% at 50% 92%, var(--card-2) 0%, var(--inset) 55%, var(--card) 100%); cursor: grab; touch-action: pan-y; }
.g1stage:active { cursor: grabbing; }
.g1stage canvas { display: block; width: 100%; height: 100%; }
.g1svg { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.g1svg svg { width: 100%; height: 100%; display: block; }
.g1status { position: absolute; left: 0; right: 0; top: 50%; text-align: center; font-size: 12.5px; color: var(--ink2); pointer-events: none; }
.g1status.off { position: static; font-size: 11.5px; margin-top: 4px; }
.svgbox:has(> .g1stage) { position: relative; align-items: stretch; }
.robot { margin: 8px 0 0; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--inset); border: 1px solid var(--line); }
.robot .rn { font-weight: 600; margin-right: 6px; }
.gates { display: flex; gap: 4px; flex-wrap: wrap; margin: 5px 0; }
.delta { font-variant-numeric: tabular-nums; font-weight: 600; }
.toggle { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--radius-sm); overflow: hidden; }
.toggle a, .toggle span { padding: 4px 12px; font-size: 12.5px; text-decoration: none; color: var(--ink2); transition: background var(--ease); }
.toggle a:hover { background: var(--hover); }
.toggle .on { background: var(--hover-2); color: var(--ink); font-weight: 500; }
.whybox h3 { margin: 12px 0 4px; font-size: 13px; }
.whybox ul { margin: 0; padding-left: 1.1em; } .whybox li { margin: 3px 0; font-size: 13px; }
td.why { min-width: 260px; font-size: 12.5px; }
tr.why td:first-child { box-shadow: inset 2px 0 0 var(--accent); }
.lever { border-left: 2px solid var(--accent-line) !important; }

/* loading row with a spinner (job + story pages; element #loadBox, toggled by [hidden]) */
.loading { display: flex; gap: 10px; align-items: center; margin: 10px 0; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--inset); color: var(--ink2); font-size: 12.5px; }
.loading::before { content: ""; width: 14px; height: 14px; flex: none; border-radius: 50%;
  border: 1.5px solid var(--line-2); border-top-color: var(--accent-2); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* job by task */
th.robot { background: none; border: 0; border-bottom: 1px solid var(--line-2); border-radius: 0; margin: 0; padding: 9px 10px; }
.rebacell { justify-content: flex-end; gap: 6px; flex-wrap: nowrap; white-space: nowrap; }
a.seeit { color: var(--accent-2); text-decoration: none; margin-left: 4px; white-space: nowrap; }
a.seeit:hover { text-decoration: underline; }
td details summary { font-size: 12px; }
td details[open] summary { margin-bottom: 6px; }
td details ul { margin: 4px 0; padding-left: 1.1em; }

/* ── KPI tiles (overview dashboard + blueprint header) ──────────── */
.kpis { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.kpi { margin: 0; padding: 11px 13px; display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1 1 150px; }
.kpi.robots { flex: 1.6 1 270px; }
.kpi .k { font-size: 11.5px; color: var(--ink3); font-weight: 500; }
.kpi .v { font-size: 19px; font-weight: 600; letter-spacing: -.01em; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .v.txt { font-size: 14px; }
.kpi .s { font-size: 11.5px; color: var(--ink2); line-height: 1.35; }
.kpi .rvs { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 4px; }
.kpi .rv { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; cursor: help; line-height: 1.6; white-space: nowrap; }
.kpi .rv b { font-weight: 500; }

/* ── overview dashboard ────────────────────────────────────────── */
.dashgrid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .dashgrid { grid-template-columns: 1fr; } }
.dashgrid > .card { margin: 0; }
.card .cardhead { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.card .cardhead h2 { margin: 0; }
.card .cardhead a { margin-left: auto; font-size: 12.5px; color: var(--accent-2); text-decoration: none; }
.card .cardhead a:hover { text-decoration: underline; }
td a.rowlink { text-decoration: none; color: var(--ink); font-weight: 500; }
td a.rowlink:hover { color: var(--accent-2); }
.sharebar { display: inline-block; width: 56px; height: 6px; border-radius: 3px; background: var(--none); vertical-align: 1px; margin-right: 6px; overflow: hidden; }
.sharebar > i { display: block; height: 100%; background: var(--accent); }
ul.sources { margin: 0; padding-left: 1.1em; font-size: 12.5px; color: var(--ink2); }
ul.sources li { margin: 5px 0; } ul.sources b { color: var(--ink); font-weight: 500; }
ul.sources a { color: var(--accent-2); text-decoration: none; } ul.sources a:hover { text-decoration: underline; }
ul.sources .lic { color: var(--ink); }
footer.boot { display: flex; align-items: baseline; gap: 12px; }
footer.boot a.credits { margin-left: auto; color: var(--ink3); opacity: .7; text-decoration: none; font: 11px var(--font); }
footer.boot a.credits:hover { opacity: 1; text-decoration: underline; }
main.credits { max-width: 720px; }

footer.boot { max-width: 1200px; margin: 0 auto; padding: 8px 28px 30px; font: 11px/1.4 var(--mono); color: var(--ink3); }
footer.boot .fail, footer.boot.fail { color: var(--red-ink); }
#bootLine.fail { color: var(--red-ink); }

/* ── responsive: icon rail ≤ 1024 px, top strip ≤ 640 px ─────── */
@media (max-width: 1024px) {
  :root { --sidebar-w: 56px; }
  .sidebar { padding: 12px 8px; align-items: center; }
  .sidebar .brand { padding: 6px 0 14px; } .sidebar .brand .bt, .sidebar .lbl, .sidebar .sect, .sidebar .foot { display: none; }
  .sidebar .item { width: 36px; height: 34px; padding: 0; justify-content: center; }
  .topbar { padding: 0 20px; }
  main { padding: 24px 20px 40px; } footer.boot { padding: 8px 20px 30px; }
}
@media (max-width: 640px) {
  /* phone: the sidebar is an off-canvas drawer (full labels), opened by the top-bar menu button */
  :root { --sidebar-w: 0px; }
  .sidebar { width: 248px; padding: 12px 10px; align-items: stretch; transform: translateX(-100%); transition: transform 180ms ease;
    box-shadow: none; z-index: 40; }
  .sidebar .brand { padding: 6px 8px 14px; } .sidebar .brand .bt, .sidebar .lbl, .sidebar .sect, .sidebar .foot { display: initial; }
  .sidebar .item { width: auto; height: 36px; padding: 0 8px; justify-content: flex-start; }
  body.nav-open .sidebar { transform: none; box-shadow: 0 0 0 1px var(--line), 0 12px 40px rgba(0, 0, 0, .35); }
  .navscrim { display: block; position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, .4); opacity: 0; pointer-events: none; transition: opacity 180ms ease; }
  body.nav-open .navscrim { opacity: 1; pointer-events: auto; }
  body.nav-open { overflow: hidden; }
  .menubtn { display: inline-grid; }
  .topbar { height: auto; min-height: 48px; padding: 8px 14px; flex-wrap: wrap; }
  .topbar .tb-right { flex-wrap: wrap; }
  .modepill { max-width: 100%; }
  main { padding: 18px 14px 40px; }
  .big { font-size: 22px; }
  .chanrow { grid-template-columns: 90px 1fr auto; }
}
@media (prefers-reduced-motion: reduce) { *, .sidebar, .navscrim { transition: none !important; } .loading::before { animation-duration: 3s; } }
