/* Al-Rased — console design system.
   Dark graphite by default, cyan for action and focus, violet for anything a
   model wrote, status colours reserved for state and always paired with a
   word. Data (ids, counts, hashes, times) is set in monospace. Server-rendered,
   no build step, nothing loaded from outside this machine. */

/* ------------------------------------------------------------------ tokens -- */
:root {
  --bg: #080b0f;
  --bg-2: #06080b;
  --surface: #0d1218;
  --surface-2: #111821;
  --raised: #16202b;
  --line: #1c2631;
  --line-2: #243140;
  --line-strong: #2f3e50;
  --ink: #dce5ef;
  --ink-2: #b2bfcc;
  --muted: #7c8c9f;
  --faint: #56677a;
  --accent: #22d3ee;
  --accent-2: #06b6d4;
  --accent-ink: #02161b;
  --accent-soft: rgba(34, 211, 238, .09);
  --accent-line: rgba(34, 211, 238, .32);
  --ai: #a78bfa;
  --ai-soft: rgba(167, 139, 250, .1);
  --ai-line: rgba(167, 139, 250, .35);
  /* Status: fixed steps, never reused for a series, always with a word. */
  --good: #22c55e;   --good-soft: rgba(34, 197, 94, .1);   --good-line: rgba(34, 197, 94, .35);
  --warn: #fab219;   --warn-soft: rgba(250, 178, 25, .1);  --warn-line: rgba(250, 178, 25, .38);
  --bad: #ef5350;    --bad-soft: rgba(239, 83, 80, .1);    --bad-line: rgba(239, 83, 80, .38);
  --info: #60a5fa;   --info-soft: rgba(96, 165, 250, .1);  --info-line: rgba(96, 165, 250, .35);
  /* Charts: diverging tone (negative / grey midpoint / positive); one hue for magnitude. */
  --neg: #e66767; --mid: #4d5866; --pos: #3987e5; --seq: #22d3ee;
  --radius: 8px;
  --radius-sm: 6px;
  --shadow: 0 0 0 1px rgba(0, 0, 0, .25), 0 12px 32px -16px rgba(0, 0, 0, .9);
  --glow: 0 0 0 1px var(--accent-line), 0 0 24px -8px rgba(34, 211, 238, .45);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "DejaVu Sans Mono", "Liberation Mono", monospace;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #eef1f5; --bg-2: #e7ebf0; --surface: #ffffff; --surface-2: #f5f7fa; --raised: #edf1f5;
  --line: #e1e6ed; --line-2: #d6dde6; --line-strong: #bfc9d5;
  --ink: #0b1420; --ink-2: #2c3a4b; --muted: #5d6c7e; --faint: #8592a3;
  --accent: #0891b2; --accent-2: #0e7490; --accent-ink: #ffffff;
  --accent-soft: rgba(8, 145, 178, .08); --accent-line: rgba(8, 145, 178, .35);
  --ai: #7c3aed; --ai-soft: rgba(124, 58, 237, .07); --ai-line: rgba(124, 58, 237, .3);
  --good: #15803d; --good-soft: rgba(22, 163, 74, .08); --good-line: rgba(22, 163, 74, .32);
  --warn: #b45309; --warn-soft: rgba(217, 119, 6, .08); --warn-line: rgba(217, 119, 6, .34);
  --bad: #c62828; --bad-soft: rgba(208, 59, 59, .07); --bad-line: rgba(208, 59, 59, .3);
  --info: #2563eb; --info-soft: rgba(37, 99, 235, .07); --info-line: rgba(37, 99, 235, .3);
  --neg: #e34948; --mid: #c3cad3; --pos: #2a78d6; --seq: #0891b2;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 8px 24px -14px rgba(15, 23, 42, .25);
  --glow: 0 0 0 1px var(--accent-line), 0 6px 20px -12px rgba(8, 145, 178, .5);
  color-scheme: light;
}

/* -------------------------------------------------------------------- base -- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 13.5px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
code, kbd, .mono { font-family: var(--mono); font-size: .9em; }
code { background: var(--surface-2); border: 1px solid var(--line); padding: 0 5px; border-radius: 4px; color: var(--ink-2); }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.25; margin: 0; }
h1 { font-size: 21px; font-weight: 650; letter-spacing: -.015em; }
h2 { font-size: 15px; font-weight: 650; margin: 26px 0 10px; }
h3 { font-size: 13.5px; font-weight: 650; margin: 16px 0 8px; }
p { margin: 0 0 10px; }
img { max-width: 100%; }
::selection { background: rgba(34, 211, 238, .25); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.xsmall { font-size: 11.5px; }
.nowrap { white-space: nowrap; }
.break { word-break: break-word; overflow-wrap: anywhere; }
.right { text-align: right; }
.center { text-align: center; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.eyebrow {
  font: 600 10.5px/1.3 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--accent);
  display: inline-flex; align-items: center; gap: 7px; margin-bottom: 7px;
}

/* Icons: every sprite icon is sized here, by context. */
svg { flex: none; }
.eyebrow svg { width: 12px; height: 12px; }
.xsmall svg, .small svg, .badge svg, .tag svg { width: 12px; height: 12px; }

/* ---------------------------------------------------------------- app shell -- */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  background: var(--bg-2); border-right: 1px solid var(--line); position: sticky; top: 0; height: 100vh;
  overflow-y: auto; display: flex; flex-direction: column; padding: 14px 10px 12px; z-index: 2;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; color: var(--ink); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 8px; flex: none; display: grid; place-items: center; color: var(--accent);
  background: radial-gradient(circle at 30% 25%, rgba(34, 211, 238, .28), transparent 62%), var(--surface-2);
  border: 1px solid var(--accent-line); box-shadow: 0 0 20px -6px rgba(34, 211, 238, .65);
}
.brand-mark svg { width: 17px; height: 17px; }
.brand-name { display: block; font: 700 13px/1.1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--ink); }
.brand-sub { display: block; font: 500 10px/1.3 var(--mono); color: var(--faint); letter-spacing: .05em; margin-top: 4px; }
.nav-group { margin-top: 16px; }
.nav-label { font: 600 10px/1 var(--mono); text-transform: uppercase; letter-spacing: .14em; color: var(--faint); padding: 0 10px 7px; }
.nav-link {
  position: relative; display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 6px;
  color: var(--ink-2); font-size: 13px; font-weight: 500; text-decoration: none; transition: background .12s ease, color .12s ease;
}
.nav-link svg { width: 16px; height: 16px; opacity: .65; }
.nav-link:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.nav-link.active { background: var(--accent-soft); color: var(--accent); }
.nav-link.active::before { content: ""; position: absolute; left: -10px; top: 6px; bottom: 6px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.nav-link.active svg { opacity: 1; }
.nav-link .count { margin-left: auto; font: 600 10.5px/1.5 var(--mono); color: var(--warn); background: var(--warn-soft); border: 1px solid var(--warn-line); border-radius: 4px; padding: 0 5px; }
.sys { margin-top: 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); padding: 10px 11px 11px; }
.sys-head { display: flex; align-items: center; gap: 7px; font: 600 10px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.sys-head .live { margin-left: auto; width: 6px; height: 6px; border-radius: 50%; background: var(--good); box-shadow: 0 0 8px var(--good); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.sys-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 8px; align-items: center; font: 10.5px/1.3 var(--mono); color: var(--muted); margin-top: 9px; text-decoration: none; }
.sys-row:hover { text-decoration: none; color: var(--ink-2); }
.sys-row .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sys-row .v { color: var(--ink-2); }
.sys-row .bar { grid-column: 1 / -1; height: 3px; border-radius: 3px; background: var(--line); overflow: hidden; }
.sys-row .bar span { display: block; height: 100%; border-radius: 3px; background: var(--seq); }
.sys-row.warn .v { color: var(--warn); } .sys-row.warn .bar span { background: var(--warn); }
.sys-row.bad .v { color: var(--bad); } .sys-row.bad .bar span { background: var(--bad); }
.sys-note { font: 10px/1.45 var(--mono); color: var(--faint); margin-top: 10px; }
.side-foot { margin-top: auto; padding: 14px 4px 0; display: grid; gap: 8px; }
.theme-toggle { background: transparent; border: 1px solid var(--line); color: var(--muted); padding: 6px 9px; border-radius: 6px; font: 500 11px var(--mono); cursor: pointer; display: inline-flex; gap: 7px; align-items: center; justify-content: flex-start; width: 100%; box-shadow: none; }
.theme-toggle:hover { color: var(--ink); border-color: var(--line-strong); background: var(--surface-2); }
.theme-toggle svg { width: 13px; height: 13px; }
.side-foot .fine { font: 10px/1.5 var(--mono); color: var(--faint); padding: 0 2px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; height: 52px; padding: 0 24px;
  background: color-mix(in srgb, var(--bg) 84%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.where { font: 500 12px var(--mono); color: var(--muted); display: flex; align-items: center; gap: 8px; min-width: 0; white-space: nowrap; overflow: hidden; }
.where a { color: var(--muted); }
.where a:hover { color: var(--accent); text-decoration: none; }
.where .sep { color: var(--faint); }
.where .here { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; }
.topbar .spacer { flex: 1; }
.search { position: relative; width: min(320px, 30vw); margin: 0; }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--faint); pointer-events: none; }
.search input[type=search] { padding: 6px 40px 6px 31px; font-size: 12.5px; background: var(--surface); border-color: var(--line-2); }
.search kbd { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font: 500 10px/1.5 var(--mono); color: var(--faint); border: 1px solid var(--line-2); border-radius: 4px; padding: 0 5px; background: var(--surface-2); pointer-events: none; }
.new-menu { position: relative; }
.new-menu > summary { list-style: none; }
.new-menu > summary::-webkit-details-marker { display: none; }
.new-menu .menu {
  position: absolute; right: 0; top: calc(100% + 8px); width: 280px; background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 9px; box-shadow: var(--shadow); padding: 6px; z-index: 40;
}
.menu a { display: flex; gap: 11px; align-items: flex-start; padding: 9px 10px; border-radius: 6px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 13px; }
.menu a:hover { background: var(--surface-2); text-decoration: none; }
.menu a svg { width: 16px; height: 16px; margin-top: 2px; color: var(--accent); }
.menu a span span { display: block; font-weight: 400; font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.nav-toggle { display: none; background: transparent; border: 0; color: var(--ink); padding: 4px; cursor: pointer; box-shadow: none; }
.nav-toggle:hover { background: var(--surface-2); }
.nav-toggle svg { width: 20px; height: 20px; }
.content { width: 100%; max-width: 1360px; margin: 0 auto; padding: 22px 24px 56px; flex: 1; }
.page-foot { max-width: 1360px; margin: 0 auto; width: 100%; padding: 14px 24px 22px; color: var(--faint); font: 11px/1.6 var(--mono); border-top: 1px solid var(--line); }
.page-foot a { color: var(--muted); }
.scrim { display: none; }

@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 264px; z-index: 60; transform: translateX(-100%); transition: transform .2s ease; }
  .shell.nav-open .sidebar { transform: none; box-shadow: var(--shadow); }
  .shell.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 55; }
  .nav-toggle { display: inline-flex; }
  .topbar { padding: 0 12px; gap: 8px; }
  .search { display: none; }
  .content { padding: 18px 14px 48px; }
  .page-foot { padding: 12px 14px 20px; }
}
@media (max-width: 560px) { .new-menu .btn .lbl { display: none; } }

/* ------------------------------------------------------------- page header -- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head .titles { min-width: 0; flex: 1 1 440px; }
.page-head h1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; overflow-wrap: anywhere; }
.lede { color: var(--muted); font-size: 13.5px; max-width: 86ch; margin: 7px 0 0; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.meta-row { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin-top: 9px; color: var(--muted); font: 12px var(--mono); }
.meta-row .sep { color: var(--faint); }
.meta-row strong { color: var(--ink-2); font-weight: 600; }
.crumbs { font: 11.5px var(--mono); color: var(--faint); margin-bottom: 7px; letter-spacing: .02em; }
.crumbs a { color: var(--muted); }

/* ---------------------------------------------------------------- surfaces -- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; min-width: 0; position: relative; }
.card.flush { padding: 0; overflow: hidden; }
.card.glow { box-shadow: var(--glow); border-color: var(--accent-line); }
.card.ai { border-color: var(--ai-line); background: linear-gradient(180deg, var(--ai-soft), transparent 70%), var(--surface); }
.card.call {
  border-color: var(--accent-line); box-shadow: var(--glow);
  background: radial-gradient(600px 160px at 0% 0%, var(--accent-soft), transparent 70%), var(--surface);
}
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap;
  margin: -16px -16px 14px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); border-radius: var(--radius) var(--radius) 0 0;
}
.card.flush > .card-head { margin: 0; }
.card.call > .card-head { background: transparent; }
.card-title { font: 600 11px/1.3 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.card-title .icon { display: inline-flex; color: var(--accent); }
.card-title svg { width: 14px; height: 14px; }
.card.ai .card-title .icon { color: var(--ai); }
.card-head .sub { color: var(--muted); font-size: 11.5px; letter-spacing: 0; text-transform: none; margin-top: 4px; }
.card-head > a, .card-head .small { font: 11.5px var(--mono); }
.card > h3:first-child, .card h3.mt-0 { font: 600 11px/1.3 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); margin: 0 0 12px; }
.section-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 24px 0 10px; }
.section-title h2 { margin: 0; font: 600 11.5px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
.section-title h2::before { content: "//"; color: var(--accent); margin-right: 8px; }
.section-title .sub { color: var(--muted); font-size: 12px; }

.grid { display: grid; gap: 14px; }
.grid > * { min-width: 0; }
.grid.two { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); }
.grid.even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.side { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
@media (max-width: 1140px) { .grid.side { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .grid.two, .grid.even, .grid.three { grid-template-columns: 1fr; } }
.grid > .card { margin-bottom: 0; }
.stack > * + * { margin-top: 8px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > .field { flex: 1 1 140px; }
.sticky { position: sticky; top: 66px; }
@media (max-width: 1140px) { .sticky { position: static; } }

/* KPI tiles. */
.grid.stats, .kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 14px 12px; position: relative; overflow: hidden; min-width: 0; text-decoration: none; color: var(--ink); display: block; }
a.stat:hover { border-color: var(--line-strong); text-decoration: none; background: var(--surface-2); }
.stat .k { font: 600 10px/1.35 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.stat .n { font: 600 23px/1.2 var(--mono); letter-spacing: -.02em; color: var(--ink); margin: 0 0 3px; font-variant-numeric: tabular-nums; }
.stat .sub { font: 10.5px var(--mono); color: var(--faint); margin-top: 3px; }
.stat::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--line-strong); }
.stat.accent { border-color: var(--accent-line); background: linear-gradient(160deg, var(--accent-soft), transparent 70%), var(--surface); }
.stat.accent::after { background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.stat.accent .n { color: var(--accent); }
.stat.good::after { background: var(--good); } .stat.good .n { color: var(--good); }
.stat.warn::after { background: var(--warn); } .stat.warn .n { color: var(--warn); }
.stat.bad::after { background: var(--bad); } .stat.bad .n { color: var(--bad); }
.stat.ai::after { background: var(--ai); } .stat.ai .n { color: var(--ai); }
.spark { position: absolute; right: 12px; top: 12px; display: flex; gap: 2px; align-items: flex-end; height: 26px; }
.spark i { width: 4px; border-radius: 2px 2px 0 0; background: var(--seq); opacity: .55; display: block; min-height: 1px; }
.spark i:last-child { opacity: 1; }

/* ----------------------------------------------------------------- buttons -- */
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; font: 600 12.5px/1.2 var(--font);
  cursor: pointer; padding: 8px 13px; border-radius: var(--radius-sm); border: 1px solid transparent;
  background: var(--accent); color: var(--accent-ink); text-decoration: none; white-space: nowrap;
  box-shadow: 0 0 0 1px rgba(34, 211, 238, .15), 0 6px 18px -10px var(--accent);
  transition: background .12s ease, border-color .12s ease, box-shadow .12s ease, color .12s ease, transform .06s ease;
}
button:hover, .btn:hover { background: var(--accent-2); text-decoration: none; box-shadow: 0 0 0 1px rgba(34, 211, 238, .3), 0 8px 22px -10px var(--accent); }
button:active, .btn:active { transform: translateY(1px); }
button svg, .btn svg { width: 14px; height: 14px; }
.btn { background: var(--surface-2); color: var(--ink); border-color: var(--line-strong); box-shadow: none; }
.btn:hover { background: var(--raised); border-color: var(--faint); box-shadow: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; box-shadow: 0 0 0 1px rgba(34, 211, 238, .15), 0 6px 18px -10px var(--accent); }
.btn.primary:hover { background: var(--accent-2); }
button.secondary, .btn.secondary { background: var(--surface-2); color: var(--ink); border-color: var(--line-strong); box-shadow: none; }
button.secondary:hover, .btn.secondary:hover { background: var(--raised); border-color: var(--faint); }
button.ghost, .btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); box-shadow: none; }
button.ghost:hover, .btn.ghost:hover { background: var(--surface-2); color: var(--ink); border-color: var(--line); }
button.danger, .btn.danger { background: var(--bad-soft); color: var(--bad); border-color: var(--bad-line); box-shadow: none; }
button.danger:hover, .btn.danger:hover { background: var(--bad); color: #fff; }
button.ai, .btn.ai { background: var(--ai-soft); color: var(--ai); border-color: var(--ai-line); box-shadow: none; }
button.link { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 500; box-shadow: none; }
button.sm, .btn.sm { padding: 5px 9px; font-size: 12px; border-radius: 5px; }
button.lg, .btn.lg { padding: 10px 18px; font-size: 13.5px; }
button:disabled, button[disabled] { opacity: .45; cursor: not-allowed; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0 0 14px; }
.actions form { margin: 0; }
form.inline { display: inline-flex; gap: 6px; align-items: center; margin: 0; flex-wrap: wrap; }
form.inline input[type=text], form.inline input[type=number], form.inline input:not([type]) { width: auto; min-width: 150px; padding: 6px 9px; font-size: 12.5px; }

/* ------------------------------------------------------------------- forms -- */
label { display: block; font-weight: 600; font-size: 12.5px; margin-bottom: 6px; color: var(--ink-2); }
.hint { display: block; font-weight: 400; color: var(--muted); font-size: 11.5px; margin-top: 2px; line-height: 1.45; }
input[type=text], input[type=number], input[type=search], input[type=file], input[type=url],
input[type=date], input[type=datetime-local], input[type=email], input[type=password], input:not([type]),
textarea, select {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--ink); font: inherit; font-size: 13px; transition: border-color .12s ease, box-shadow .12s ease;
}
input[type=number], .mono-input { font-family: var(--mono); font-size: 12.5px; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input[type=text]:hover, input[type=number]:hover, input[type=search]:hover, input[type=url]:hover,
input[type=date]:hover, input[type=datetime-local]:hover, input:not([type]):hover, textarea:hover, select:hover { border-color: var(--faint); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), 0 0 14px -6px var(--accent); }
textarea { min-height: 72px; resize: vertical; line-height: 1.5; }
select {
  appearance: none; -webkit-appearance: none; padding-right: 30px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%; background-size: 5px 5px; background-repeat: no-repeat;
}
input[type=file] { padding: 6px; background: var(--surface-2); font-size: 12px; cursor: pointer; }
input[type=file]::file-selector-button {
  font: 600 12px var(--font); margin-right: 10px; padding: 6px 11px; border-radius: 5px; cursor: pointer;
  border: 1px solid var(--accent-line); background: var(--accent-soft); color: var(--accent);
}
.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }

/* Checkboxes and radios: drawn, not native. A checked box lights up cyan with a
   tick that springs in; a radio's dot glows; both lift on hover and focus. */
input[type=checkbox], input[type=radio] {
  appearance: none; -webkit-appearance: none; flex: none; margin: 0; position: relative;
  width: 17px; height: 17px; display: inline-grid; place-content: center; vertical-align: -4px; cursor: pointer;
  border: 1.5px solid var(--line-strong); border-radius: 5px; background: var(--bg);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .35);
  transition: border-color .15s ease, background .15s ease, box-shadow .2s ease, transform .1s ease;
}
input[type=radio] { border-radius: 50%; }
input[type=checkbox]::before {
  content: ""; width: 10px; height: 10px; background: var(--accent-ink);
  clip-path: polygon(13% 52%, 0 66%, 38% 100%, 100% 22%, 86% 9%, 37% 72%);
  transform: scale(0) rotate(-12deg); transition: transform .18s cubic-bezier(.3, 1.7, .55, 1);
}
input[type=radio]::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 8px var(--accent); transform: scale(0); transition: transform .18s cubic-bezier(.3, 1.7, .55, 1);
}
input[type=checkbox]:hover, input[type=radio]:hover { border-color: var(--accent); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .35), 0 0 0 3px var(--accent-soft); }
input[type=checkbox]:active, input[type=radio]:active { transform: scale(.9); }
input[type=checkbox]:checked {
  background: linear-gradient(180deg, #67e8f9, var(--accent) 55%, var(--accent-2)); border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft), 0 0 14px -2px var(--accent);
}
input[type=checkbox]:checked::before { transform: scale(1) rotate(0); }
input[type=checkbox]:indeterminate { background: var(--accent); border-color: var(--accent); }
input[type=checkbox]:indeterminate::before { clip-path: none; height: 2px; transform: scale(1); }
input[type=radio]:checked { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=radio]:checked::before { transform: scale(1); }
input[type=checkbox]:focus-visible, input[type=radio]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input[type=checkbox]:disabled, input[type=radio]:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }
:root[data-theme="light"] input[type=checkbox], :root[data-theme="light"] input[type=radio] { background: #fff; box-shadow: inset 0 1px 1px rgba(15, 23, 42, .06); }
:root[data-theme="light"] input[type=checkbox]:checked { background: linear-gradient(180deg, #22d3ee, var(--accent)); box-shadow: 0 0 0 3px var(--accent-soft); }
:root[data-theme="light"] input[type=radio]:checked { background: var(--accent-soft); }
input[type=checkbox].override:checked { background: linear-gradient(180deg, #fcd34d, var(--warn)); border-color: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft), 0 0 14px -2px var(--warn); }

/* A checkbox with its sentence: the whole line is the target. */
.checkline, label.check, .ack-check {
  display: flex; gap: 10px; align-items: center; cursor: pointer; font-weight: 500; color: var(--ink-2); margin: 0;
  padding: 8px 11px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg);
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.checkline:hover, label.check:hover, .ack-check:hover { border-color: var(--line-strong); color: var(--ink); }
.checkline:has(input:checked), label.check:has(input:checked), .ack-check:has(input:checked) { border-color: var(--accent-line); background: var(--accent-soft); color: var(--ink); }
.field.checkline { margin-bottom: 14px; }
.checkline label { margin: 0; font-weight: 500; cursor: pointer; color: inherit; }
label.check { display: inline-flex; padding: 5px 10px; font-size: 12.5px; }
.radio-line {
  display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 13px; margin-bottom: 7px; cursor: pointer; color: var(--ink-2);
  padding: 9px 11px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); transition: border-color .15s ease, background .15s ease;
}
.radio-line:hover { border-color: var(--line-strong); }
.radio-line:has(input:checked) { border-color: var(--accent-line); background: var(--accent-soft); color: var(--ink); }
.radio-line input { margin-top: 1px; }

/* A form in numbered sections. */
.form-step { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 0 14px; padding: 18px 0; border-top: 1px dashed var(--line-2); position: relative; }
.form-step:first-child { border-top: 0; padding-top: 2px; }
.step-dot { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; font: 700 11px var(--mono); background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-line); box-shadow: 0 0 14px -6px var(--accent); }
.form-step h3 { margin: 3px 0 3px; font-size: 14px; }
.form-step .step-sub { color: var(--muted); font-size: 12px; margin-bottom: 13px; max-width: 80ch; }
.submit-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 16px; border-top: 1px solid var(--line); margin-top: 6px; }
.submit-bar .muted { font-size: 12px; }

/* Selectable cards (sources, methods, providers). */
.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
.source-option {
  position: relative; display: flex; gap: 11px; align-items: flex-start; padding: 11px 12px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--bg); cursor: pointer; margin: 0 0 8px; font-weight: 400; overflow: hidden;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.choices .source-option { margin: 0; }
.source-option::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: transparent; transition: background .15s ease, box-shadow .15s ease; }
.source-option:hover { border-color: var(--line-strong); background: var(--surface-2); }
.source-option:has(input:checked) { border-color: var(--accent-line); background: linear-gradient(90deg, var(--accent-soft), transparent 80%), var(--surface); box-shadow: 0 0 22px -14px var(--accent); }
.source-option:has(input:checked)::before { background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.source-option:has(input:checked) .name { color: var(--accent); }
.source-option:has(input:disabled) { opacity: .5; cursor: not-allowed; }
.source-option input { margin-top: 1px; }
.source-option > div { min-width: 0; flex: 1; }
.source-option .name { font-weight: 600; font-size: 12.5px; margin: 0; cursor: pointer; color: var(--ink); display: block; transition: color .15s ease; }
.source-option .meta { color: var(--muted); font-size: 11px; margin-top: 5px; display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.source-option .meta a { font: 11px var(--mono); }

/* Switches. */
.toggle-row { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; padding: 12px 0; border-top: 1px solid var(--line); margin: 0; }
.toggle-row:first-child { border-top: 0; }
.toggle-copy { flex: 1 1 auto; min-width: 0; }
.toggle-copy label { margin-bottom: 3px; color: var(--ink); }
.switch { flex: none; margin: 2px 0 0; cursor: pointer; position: relative; }
.switch input[type=checkbox] { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.switch .track {
  display: block; width: 42px; height: 23px; border-radius: 999px; position: relative; background: var(--surface-2);
  border: 1px solid var(--line-strong); box-shadow: inset 0 1px 3px rgba(0, 0, 0, .45); transition: background .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.switch .track::after { content: "OFF"; position: absolute; right: 6px; top: 50%; transform: translateY(-50%); font: 700 7.5px var(--mono); letter-spacing: .06em; color: var(--faint); transition: opacity .15s ease; }
.switch .thumb { position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: 50%; background: linear-gradient(180deg, #e9eff6, #b7c3d0); box-shadow: 0 1px 3px rgba(0, 0, 0, .5); transition: transform .22s cubic-bezier(.3, 1.4, .55, 1), background .2s ease; z-index: 1; }
.switch:hover .track { border-color: var(--accent); }
.switch input:checked + .track { background: linear-gradient(90deg, var(--accent-2), var(--accent)); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), 0 0 16px -4px var(--accent); }
.switch input:checked + .track::after { content: "ON"; left: 7px; right: auto; color: var(--accent-ink); }
.switch input:checked + .track .thumb { transform: translateX(19px); background: #fff; }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
/* An override (robots, anti-bot) lights amber when on; a protection stays cyan. */
.switch.override input:checked + .track { background: linear-gradient(90deg, #d97706, var(--warn)); border-color: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft), 0 0 16px -4px var(--warn); }
:root[data-theme="light"] .switch .track { background: #e3e8ee; box-shadow: inset 0 1px 2px rgba(15, 23, 42, .12); }
:root[data-theme="light"] .switch .thumb { background: #fff; }

details.disclosure { border: 1px solid var(--line); border-radius: 8px; background: var(--bg); margin: 12px 0 0; }
details.disclosure > summary { list-style: none; cursor: pointer; padding: 10px 12px; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; font-weight: 600; font-size: 12.5px; color: var(--ink-2); border-radius: 8px; }
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure > summary::before { content: ""; width: 6px; height: 6px; border-right: 1.5px solid var(--accent); border-bottom: 1.5px solid var(--accent); transform: rotate(-45deg); transition: transform .15s ease; flex: none; }
details.disclosure[open] > summary::before { transform: rotate(45deg); }
details.disclosure > summary:hover { color: var(--ink); background: var(--surface-2); }
details.disclosure > summary .sub { font-weight: 400; color: var(--muted); font-size: 11.5px; }
details.disclosure > summary svg { width: 14px; height: 14px; }
details.disclosure > .disclosure-body { padding: 4px 14px 12px; }
details.disclosure.danger-zone { border-color: var(--warn-line); background: linear-gradient(180deg, var(--warn-soft), transparent 80%), var(--bg); }
details.disclosure.danger-zone > summary { color: var(--warn); }
details.disclosure.danger-zone > summary:hover { background: var(--warn-soft); }

.filters { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.filters .field { margin-bottom: 0; flex: 1 1 160px; }
.filters .filter-actions { flex: 0 0 auto; display: flex; gap: 10px; align-items: center; }

/* ------------------------------------------------------------ tags & status -- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 0 7px; border-radius: 4px;
  font: 600 11px/1.75 var(--mono); white-space: nowrap; letter-spacing: .01em; vertical-align: 1px;
  background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line-2);
}
.badge.ok { background: var(--good-soft); color: var(--good); border-color: var(--good-line); }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.badge.bad { background: var(--bad-soft); color: var(--bad); border-color: var(--bad-line); }
.badge.neutral, .badge.info { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }
.badge.ai { background: var(--ai-soft); color: var(--ai); border-color: var(--ai-line); }
.badge.muted { background: transparent; color: var(--muted); border-color: var(--line-2); }
/* Status: a lit bar beside the state in words, never colour alone. */
.badge.dot::before { content: ""; width: 3px; height: 10px; border-radius: 2px; background: currentColor; box-shadow: 0 0 6px currentColor; }
.badge.live::before { animation: pulse 1.4s ease-in-out infinite; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
@media (max-width: 560px) { .badge { white-space: normal; } }

/* ----------------------------------------------------------------- notices -- */
.notice {
  display: flex; gap: 11px; align-items: flex-start; border: 1px solid var(--info-line); background: var(--info-soft);
  color: var(--ink-2); padding: 10px 13px; border-radius: 8px; margin-bottom: 12px; font-size: 13px;
}
.notice::before { content: ""; flex: none; width: 3px; align-self: stretch; border-radius: 3px; background: var(--info); box-shadow: 0 0 8px var(--info); }
.notice > div { min-width: 0; flex: 1; }
.notice.warn { border-color: var(--warn-line); background: var(--warn-soft); }
.notice.warn::before { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
.notice.bad { border-color: var(--bad-line); background: var(--bad-soft); }
.notice.bad::before { background: var(--bad); box-shadow: 0 0 8px var(--bad); }
.notice.ok { border-color: var(--good-line); background: var(--good-soft); }
.notice.ok::before { background: var(--good); box-shadow: 0 0 8px var(--good); }
.notice.plain { border-color: var(--line); background: var(--surface); }
.notice.plain::before { background: var(--accent); box-shadow: none; }
.notice strong { color: var(--ink); }
.notice ul { margin: 6px 0 0; padding-left: 18px; }
.alert-stack { display: grid; gap: 8px; margin-bottom: 14px; }
.alert-stack .notice { margin: 0; }

/* ----------------------------------------------------------------- tables -- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { font: 600 10px/1.3 var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); background: var(--surface-2); white-space: nowrap; padding-top: 9px; padding-bottom: 9px; }
tbody tr { transition: background .1s ease; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--surface-2); }
td.mono { color: var(--ink-2); }
td.right, th.right { text-align: right; font-variant-numeric: tabular-nums; }
td.right { font-family: var(--mono); font-size: 12.5px; }
td.id { font: 600 12px var(--mono); color: var(--accent); }
td.coverage { max-width: 320px; font-size: 12px; color: var(--muted); }
.title-cell { max-width: 560px; }
.title-cell strong { font-weight: 600; color: var(--ink); }
.title-cell a:hover { text-decoration: none; }
.title-cell a:hover strong { color: var(--accent); }
.title-cell .sum { color: var(--muted); font-size: 12px; margin-top: 3px; }
.url { color: var(--faint); font: 11px var(--mono); word-break: break-all; }
.label-cell { white-space: nowrap; }
.label-cell .badge { margin-right: 4px; }
table.cues td, table.cues th { padding: 6px 10px; }
.ckpt { max-width: 160px; overflow-wrap: anywhere; }
.col-why { min-width: 240px; max-width: 420px; }
.col-gate { max-width: 240px; }
.empty-row td { text-align: center; padding: 30px 12px; color: var(--muted); }
td form input[type=text] { padding: 6px 9px; font-size: 12px; }
/* A count drawn in its cell: one hue, the number beside it in text. */
.cellbar { display: flex; align-items: center; gap: 8px; min-width: 110px; }
.cellbar .bar { flex: 1; height: 5px; background: var(--line); border-radius: 0 3px 3px 0; overflow: hidden; min-width: 40px; }
.cellbar .bar span { display: block; height: 100%; background: var(--seq); border-radius: 0 3px 3px 0; min-width: 2px; }
.cellbar .num { min-width: 34px; text-align: right; color: var(--ink-2); font-size: 12px; }
.cellbar.warn .bar span { background: var(--warn); } .cellbar.bad .bar span { background: var(--bad); }

/* -------------------------------------------------------------------- tabs -- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 4px 0 16px; overflow-x: auto; }
.tab {
  appearance: none; background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0; box-shadow: none;
  padding: 10px 13px; font: 600 11.5px var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--muted); cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 7px; margin-bottom: -1px;
}
.tab:hover { color: var(--ink); background: var(--surface-2); box-shadow: none; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); background: linear-gradient(0deg, var(--accent-soft), transparent); }
.tab svg { width: 13px; height: 13px; }
.tab .count { font: 600 10.5px/1.5 var(--mono); background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 4px; padding: 0 5px; color: var(--muted); letter-spacing: 0; }
.tab.active .count { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.tab.tab-ai.active { color: var(--ai); border-bottom-color: var(--ai); background: linear-gradient(0deg, var(--ai-soft), transparent); }
.tab.tab-ai.active .count { color: var(--ai); border-color: var(--ai-line); background: var(--ai-soft); }
html.js [data-panel]:not(.active) { display: none; }

/* --------------------------------------------------------------- key–value -- */
dl.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 7px 16px; margin: 0; font-size: 12.5px; }
dl.kv dt { color: var(--muted); font: 11px/1.6 var(--mono); text-transform: uppercase; letter-spacing: .06em; }
dl.kv dd { margin: 0; word-break: break-word; overflow-wrap: anywhere; color: var(--ink-2); }
@media (max-width: 560px) { dl.kv { grid-template-columns: 1fr; gap: 2px; } dl.kv dd { margin-bottom: 8px; } }
pre.json { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; overflow-x: auto; font: 11.5px/1.55 var(--mono); margin: 0; max-height: 420px; color: var(--ink-2); }
img.shot { max-width: 100%; border: 1px solid var(--line); border-radius: 7px; display: block; }
.thumb { width: 60px; height: 60px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); display: block; background: var(--surface-2); }

/* -------------------------------------------------------------------- lists -- */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 9px 0; border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; padding-top: 2px; }
.list .grow { flex: 1 1 auto; min-width: 0; }
.list .title { font-weight: 600; font-size: 13px; color: var(--ink); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list a.title:hover { color: var(--accent); text-decoration: none; }
.list .sub { color: var(--muted); font: 11px var(--mono); display: block; margin-top: 2px; }
.empty { text-align: center; padding: 28px 16px; color: var(--muted); }
.empty-icon { width: 42px; height: 42px; margin: 0 auto 10px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-line); box-shadow: 0 0 20px -8px var(--accent); }
.empty-icon svg { width: 19px; height: 19px; }
.empty h3 { margin: 0 0 4px; color: var(--ink); }
.empty p { margin: 0 auto 12px; max-width: 54ch; font-size: 12.5px; }

/* Activity feed: time, a lit dot for the outcome, the action. */
.feed { list-style: none; margin: 0; padding: 0; position: relative; }
.feed::before { content: ""; position: absolute; left: 63px; top: 10px; bottom: 10px; border-left: 1px dashed var(--line-strong); }
.feed li { display: grid; grid-template-columns: 52px 9px minmax(0, 1fr); gap: 0 10px; padding: 5px 0; align-items: start; }
.feed .t { font: 11px/1.5 var(--mono); color: var(--faint); text-align: right; }
.feed .d { width: 9px; height: 9px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-strong); margin-top: 4px; position: relative; z-index: 1; }
.feed li.ok .d { border-color: var(--good); box-shadow: 0 0 6px var(--good); }
.feed li.blocked .d { border-color: var(--warn); background: var(--warn); box-shadow: 0 0 6px var(--warn); }
.feed li.error .d { border-color: var(--bad); background: var(--bad); box-shadow: 0 0 6px var(--bad); }
.feed .a { font: 11.5px/1.5 var(--mono); color: var(--ink-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed .a a { color: var(--ink-2); }
.feed .a a:hover { color: var(--accent); }
.feed .a .o { color: var(--faint); }
.feed li.blocked .a .o { color: var(--warn); } .feed li.error .a .o { color: var(--bad); }

/* ------------------------------------------------------------------ charts -- */
/* Bars for magnitude: one hue, the value in text beside each. */
.hbars { display: grid; gap: 6px; }
.hbar { display: grid; grid-template-columns: minmax(70px, 34%) minmax(0, 1fr) 52px; gap: 10px; align-items: center; font-size: 12px; color: var(--ink-2); text-decoration: none; padding: 1px 0; border-radius: 4px; }
a.hbar:hover { text-decoration: none; background: var(--surface-2); }
.hbar .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .track { height: 8px; background: var(--surface-2); border-radius: 0 3px 3px 0; overflow: hidden; }
.hbar .fill { height: 100%; background: var(--seq); border-radius: 0 4px 4px 0; min-width: 2px; opacity: .85; transition: opacity .12s ease; }
.hbar:hover .fill { opacity: 1; }
.hbars.wide .hbar { grid-template-columns: minmax(90px, 38%) minmax(0, 1fr) 84px; }
.hbar .v { font: 11.5px var(--mono); color: var(--ink-2); text-align: right; font-variant-numeric: tabular-nums; }
/* Tone as one diverging stacked bar: negative, neutral, positive, unrated — with gaps. */
.stackbar { display: flex; height: 10px; gap: 2px; border-radius: 3px; overflow: hidden; margin: 4px 0 10px; background: transparent; }
.stackbar span { display: block; height: 100%; min-width: 3px; }
.stackbar span:first-child { border-radius: 3px 0 0 3px; } .stackbar span:last-child { border-radius: 0 3px 3px 0; }
.s-negative { background: var(--neg); } .s-neutral { background: var(--mid); } .s-positive { background: var(--pos); } .s-unrated { background: var(--line-2); }
.s-done { background: var(--good); } .s-waiting { background: var(--warn); } .s-refused, .s-failed { background: var(--bad); }
.s-running { background: var(--accent); } .s-proposed, .s-approved { background: var(--line-strong); } .s-skipped, .s-found_nothing { background: var(--mid); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 11.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.legend b { color: var(--ink-2); font: 600 11.5px var(--mono); }
/* A thin progress line. */
.progress { height: 4px; background: var(--line); border-radius: 4px; overflow: hidden; display: flex; gap: 1px; }
.progress span { display: block; height: 100%; }

/* --------------------------------------------------------- launch tiles -- */
.launch { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
@media (max-width: 1000px) { .launch { grid-template-columns: 1fr; } }
.tile {
  position: relative; display: flex; flex-direction: column; gap: 8px; padding: 16px 16px 14px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; overflow: hidden;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.tile::after { content: ""; position: absolute; inset: 0; background: radial-gradient(420px 120px at 0% 0%, var(--tint), transparent 70%); pointer-events: none; }
.tile::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: linear-gradient(90deg, var(--tc), transparent 70%); opacity: .8; }
.tile:hover { border-color: var(--tc); box-shadow: 0 0 0 1px var(--tc), 0 0 28px -12px var(--tc); text-decoration: none; transform: translateY(-1px); }
.tile .tile-top { display: flex; align-items: center; gap: 10px; }
.tile .glyph { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; color: var(--tc); background: var(--surface-2); border: 1px solid var(--line-2); box-shadow: 0 0 18px -8px var(--tc); }
.tile .glyph svg { width: 18px; height: 18px; }
.tile h3 { margin: 0; font-size: 14.5px; }
.tile .tag { margin-left: auto; font: 600 10px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.tile p { margin: 0; color: var(--muted); font-size: 12.5px; position: relative; z-index: 1; }
.tile .facts { display: flex; gap: 6px 14px; flex-wrap: wrap; font: 11px var(--mono); color: var(--faint); margin-top: auto; padding-top: 4px; position: relative; z-index: 1; }
.tile .facts b { color: var(--ink-2); font-weight: 600; }
.tile .go { font: 600 11.5px var(--mono); color: var(--tc); display: inline-flex; align-items: center; gap: 6px; letter-spacing: .06em; text-transform: uppercase; position: relative; z-index: 1; }
.tile .go svg { width: 13px; height: 13px; transition: transform .15s ease; }
.tile:hover .go svg { transform: translateX(3px); }
.t-cyan { --tc: #22d3ee; --tint: rgba(34, 211, 238, .08); }
.t-violet { --tc: #a78bfa; --tint: rgba(167, 139, 250, .09); }
.t-amber { --tc: #fbbf24; --tint: rgba(251, 191, 36, .07); }
:root[data-theme="light"] .t-cyan { --tc: #0891b2; } :root[data-theme="light"] .t-violet { --tc: #7c3aed; } :root[data-theme="light"] .t-amber { --tc: #b45309; }

/* ------------------------------------------------------------- console hero -- */
.console-hero {
  position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 14px;
  background:
    radial-gradient(700px 220px at 88% -30%, rgba(34, 211, 238, .16), transparent 70%),
    radial-gradient(520px 220px at 6% 130%, rgba(167, 139, 250, .13), transparent 70%),
    linear-gradient(90deg, transparent calc(100% - 1px), rgba(34, 211, 238, .055) 0) 0 0 / 28px 28px,
    linear-gradient(0deg, transparent calc(100% - 1px), rgba(34, 211, 238, .055) 0) 0 0 / 28px 28px, var(--surface);
}
.console-hero h1 { font-size: 23px; }
.console-hero .lede { color: var(--ink-2); }
.console-hero .prompt { font: 600 11px var(--mono); color: var(--accent); letter-spacing: .08em; margin-bottom: 8px; }
.console-hero .prompt .cursor { display: inline-block; width: 7px; height: 13px; background: var(--accent); vertical-align: -2px; margin-left: 4px; animation: blink 1.1s steps(1) infinite; box-shadow: 0 0 8px var(--accent); }
@keyframes blink { 50% { opacity: 0; } }
.status-strip { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line-2); font: 11.5px var(--mono); color: var(--muted); }
.status-strip span { display: inline-flex; align-items: center; gap: 7px; }
.status-strip i { width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 8px var(--good); display: inline-block; }
.status-strip i.warn { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
.status-strip i.bad { background: var(--bad); box-shadow: 0 0 8px var(--bad); }
.status-strip b { color: var(--ink); font-weight: 600; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ----------------------------------------------------------- numbered steps -- */
.steps-list { list-style: none; margin: 0 0 10px; padding: 0; counter-reset: s; }
.steps-list > li { position: relative; padding: 0 0 13px 36px; counter-increment: s; }
.steps-list > li::before { content: counter(s, decimal-leading-zero); position: absolute; left: 0; top: 0; width: 25px; height: 22px; border-radius: 5px; display: grid; place-items: center; font: 700 10px var(--mono); background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-line); }
.steps-list > li::after { content: ""; position: absolute; left: 12px; top: 24px; bottom: 2px; border-left: 1px dashed var(--line-strong); }
.steps-list > li:last-child { padding-bottom: 2px; }
.steps-list > li:last-child::after { display: none; }
.steps-list > li strong { display: block; font-size: 12.5px; color: var(--ink); }
.steps-list > li span { color: var(--muted); font-size: 12px; }

/* An investigation's plan, drawn as a pipeline of steps. */
.pipeline { list-style: none; margin: 0; padding: 0; position: relative; }
.pipeline::before { content: ""; position: absolute; left: 16px; top: 18px; bottom: 18px; border-left: 1px solid var(--line-strong); }
.pipe { position: relative; display: grid; grid-template-columns: 33px minmax(0, 1fr); gap: 12px; padding: 5px 0; }
.pipe .node { width: 33px; height: 33px; border-radius: 9px; display: grid; place-items: center; font: 700 11px var(--mono); background: var(--surface); border: 1px solid var(--line-strong); color: var(--muted); position: relative; z-index: 1; }
.pipe.done .node { border-color: var(--good-line); color: var(--good); background: color-mix(in srgb, var(--good) 12%, var(--surface)); }
.pipe.running .node { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); box-shadow: 0 0 16px -2px var(--accent); animation: pulse 1.6s ease-in-out infinite; }
.pipe.waiting .node { border-color: var(--warn); color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, var(--surface)); box-shadow: 0 0 16px -4px var(--warn); }
.pipe.refused .node, .pipe.failed .node { border-color: var(--bad-line); color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, var(--surface)); }
.pipe.skipped .node, .pipe.found_nothing .node { border-style: dashed; }
.pipe .body { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 13px; min-width: 0; }
.pipe.waiting .body { border-color: var(--warn-line); background: linear-gradient(90deg, var(--warn-soft), transparent 60%), var(--surface); }
.pipe.running .body { border-color: var(--accent-line); }
.pipe .head { display: flex; align-items: center; gap: 6px 8px; flex-wrap: wrap; }
.pipe .act { font: 600 11px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.pipe .kw { color: var(--ink); font-weight: 600; font-size: 13.5px; }
.pipe .head .spacer { flex: 1 1 auto; }
.pipe .srcs { font: 11px var(--mono); color: var(--faint); margin-top: 3px; overflow-wrap: anywhere; }
.pipe .why { color: var(--muted); font-size: 12px; margin-top: 6px; }
.pipe .why.model { color: var(--ink-2); border-left: 2px solid var(--ai-line); padding-left: 8px; }
.auto-approve { display: inline-flex; gap: 6px; align-items: center; }
.auto-approve input[type=text] { width: 120px; padding: 6px 9px; font-size: 12px; }
/* Pictures found, for review. */
.pic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.pic { position: relative; display: grid; gap: 6px; align-content: start; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px; cursor: pointer; font-weight: 400; }
.pic:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 0 18px -6px var(--accent); }
.pic.related { border-color: var(--good-line); }
.pic.unsure { border-style: dashed; }
.pic > input { position: absolute; top: 12px; left: 12px; z-index: 1; }
.pic .frame { display: grid; place-items: center; background: var(--surface-2); border-radius: 6px; aspect-ratio: 4 / 3; overflow: hidden; }
.pic .frame img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.pic .nothumb { font: 11px var(--mono); color: var(--faint); }
.pic .cap { font-size: 12.5px; color: var(--ink-2); overflow-wrap: anywhere; }
.pic .chips { display: flex; flex-wrap: wrap; gap: 4px; }
.pic .links { color: var(--faint); overflow-wrap: anywhere; }
.pic-bar { position: sticky; bottom: 0; background: var(--surface); padding: 10px 0; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pic-bar input[type=text] { width: auto; flex: 0 1 160px; }
/* People who share a name. */
.card.people .person { border-top: 1px solid var(--line); padding: 12px 0 4px; }
.card.people .person:first-of-type { border-top: 0; padding-top: 4px; }
.card.people .person-head { font-size: 14px; }
details.pgroup { margin-top: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
details.pgroup > summary { cursor: pointer; padding: 7px 11px; font-size: 13px; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
details.pgroup.namesake { border-color: var(--bad-line); }
details.pgroup.target { border-color: var(--good-line); }
details.pgroup.undecided { border-color: var(--warn-line); }
details.pgroup > p, details.pgroup > ul, details.pgroup > form { margin: 0; padding: 0 12px 10px; }
details.pgroup .quote { color: var(--ink); font-style: italic; }
ul.pdocs { list-style: none; display: grid; gap: 3px; }
ul.pdocs li { overflow-wrap: anywhere; }
.identity-form { display: grid; gap: 6px; }
.identity-form > p { margin: 0; }
.identity-form .pdocs { margin: 0; padding: 0; }
.identity-form .pdocs .checkline { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; }
.identity-form .flex { gap: 6px; flex-wrap: wrap; align-items: center; }
.identity-form input[type=text] { width: auto; flex: 0 1 150px; padding: 5px 9px; font-size: 12px; }
/* Consecutive skipped steps, folded into one row. */
.pipe-group .node { border-style: dashed; color: var(--faint); }
.pipe-group .node svg { width: 14px; height: 14px; }
details.skipped-group { padding: 0; background: transparent; border-style: dashed; }
details.skipped-group > summary { list-style: none; cursor: pointer; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; padding: 8px 13px; color: var(--muted); font-size: 12.5px; }
details.skipped-group > summary::-webkit-details-marker { display: none; }
details.skipped-group > summary:hover { color: var(--ink-2); }
details.skipped-group > summary .steps-range { font-size: 11px; color: var(--faint); }
details.skipped-group > summary .names { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 0 1 auto; max-width: 100%; color: var(--muted); }
details.skipped-group > summary .spacer { flex: 1 1 auto; }
details.skipped-group > summary .toggle { font: 11px var(--mono); color: var(--accent); }
details.skipped-group > summary .toggle .hide, details.skipped-group[open] > summary .toggle .show { display: none; }
details.skipped-group[open] > summary .toggle .hide { display: inline; }
details.skipped-group[open] > summary { border-bottom: 1px dashed var(--line); }
.pipeline.nested { padding: 6px 10px 4px 6px; }
.pipeline.nested::before { left: 22px; }
/* The page updates itself while an investigation runs. */
.live-pill { display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; font: 10.5px var(--mono); color: var(--muted); border: 1px solid var(--line-2); border-radius: 999px; padding: 1px 8px; vertical-align: middle; }
.live-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--faint); }
.live-pill.on { color: var(--good); border-color: var(--good-line); }
.live-pill.on::before { background: var(--good); box-shadow: 0 0 8px var(--good); animation: pulse 1.6s ease-in-out infinite; }
.live-pill.off { color: var(--warn); border-color: var(--warn-line); }
.live-pill.off::before { background: var(--warn); }
.pipe.off-track > .body { opacity: .62; }
.pipe.off-track > .node { border-style: dashed; }
details.recal { margin-top: 8px; }
details.recal > summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ai); border: 1px solid var(--ai-line); background: var(--ai-soft); border-radius: 6px; padding: 3px 9px; }
details.recal > summary::-webkit-details-marker { display: none; }
details.recal > summary svg { width: 13px; height: 13px; }
details.recal[open] > summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.recal-body { border: 1px solid var(--ai-line); border-radius: 0 6px 6px 6px; padding: 10px; display: grid; gap: 8px; background: var(--surface); }
.recal-body textarea { min-height: 56px; }
.recal-body .flex { gap: 8px; flex-wrap: wrap; }
.recal-body .flex input { flex: 1 1 160px; }
.steer-force { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; border-top: 1px solid var(--line); }
.force-form { display: inline-flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.force-form input { width: 150px; }
button.warn-btn { background: var(--warn); color: #1a1205; border-color: transparent; box-shadow: 0 0 14px -4px var(--warn); }
button.warn-btn:hover { filter: brightness(1.08); }
:root[data-theme="light"] button.warn-btn { color: #fff; }
.card.ai .critique { border-left: 2px solid var(--warn); padding: 2px 0 2px 10px; margin: 6px 0 10px; }
.card.ai .critique p { margin: 2px 0 0; color: var(--ink); }
.card.ai .critique .mono { color: var(--warn); letter-spacing: .04em; }
.card.ai ul.options { margin: 4px 0 10px; padding-left: 0; list-style: none; display: grid; gap: 6px; font-size: 13px; }
.budget-meters { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 4px 18px; }
.budget-meters .meter { margin-top: 0; }
.budget-meters .meter .meter-value { font-size: 16px; }
.card.ai .assessment { margin: 4px 0 8px; line-height: 1.55; color: var(--ink); white-space: pre-line; }
ol.assessments { margin: 0; padding-left: 18px; display: grid; gap: 10px; font-size: 13px; }
.pipe .gate-why { font: 11px/1.5 var(--mono); color: var(--warn); margin-top: 6px; }
.pipe.refused .gate-why { color: var(--bad); }
.pipe .foot { display: flex; gap: 6px 14px; flex-wrap: wrap; align-items: center; margin-top: 8px; font: 11px var(--mono); color: var(--faint); }
.pipe .foot a { font: 11px var(--mono); }
.pipe .decide { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--warn-line); }
.pipe .decide input[type=text] { width: auto; flex: 1 1 140px; padding: 6px 9px; font-size: 12px; }

/* The analyst's interrupt. */
details.steer { padding: 0; border-color: var(--ai-line); background: linear-gradient(90deg, var(--ai-soft), transparent 60%), var(--surface); }
details.steer > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; padding: 12px 16px; }
details.steer > summary::-webkit-details-marker { display: none; }
details.steer > summary .card-title .icon { color: var(--ai); }
details.steer > summary .sub { color: var(--muted); font-size: 12px; flex: 1 1 260px; }
details.steer > summary .steer-open { background: var(--ai-soft); color: var(--ai); border-color: var(--ai-line); }
details.steer[open] > summary .steer-open { display: none; }
details.steer[open] > summary { border-bottom: 1px solid var(--line); }
details.steer .steer-body { padding: 14px 16px 16px; }
details.steer textarea { min-height: 84px; }

/* A horizontal flow of stages (the guide). */
.flow { display: flex; flex-wrap: wrap; align-items: stretch; gap: 6px; margin: 12px 0 8px; }
.flow .stage { flex: 1 1 120px; min-width: 120px; background: var(--surface); border: 1px solid var(--line); border-radius: 7px; padding: 9px 11px; position: relative; }
.flow .stage .num { font: 700 10px/1 var(--mono); color: var(--accent); letter-spacing: .08em; }
.flow .stage strong { display: block; font-size: 12.5px; margin-top: 5px; color: var(--ink); }
.flow .stage span:last-child { display: block; color: var(--muted); font-size: 11.5px; margin-top: 3px; line-height: 1.4; }
.flow .stage.gate { border-color: var(--warn-line); background: var(--warn-soft); }
.flow .stage.gate .num { color: var(--warn); }
.flow .stage.store { border-color: var(--good-line); background: var(--good-soft); }
.flow .stage.store .num { color: var(--good); }
.flow .stage.model { border-color: var(--ai-line); background: var(--ai-soft); }
.flow .stage.model .num { color: var(--ai); }
.flow .arrow { align-self: center; color: var(--faint); font: 13px var(--mono); flex: none; }

/* ----------------------------------------------------------------- the guide -- */
.doc { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 28px; align-items: start; }
@media (max-width: 1000px) { .doc { grid-template-columns: minmax(0, 1fr); } .doc-toc { position: static !important; max-height: none !important; } }
.doc-toc { position: sticky; top: 68px; font-size: 12.5px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); padding: 12px 8px; max-height: calc(100vh - 88px); overflow-y: auto; }
.doc-toc .nav-label { padding: 0 8px 8px; }
.doc-toc a { display: block; padding: 4px 8px; border-radius: 5px; color: var(--muted); border-left: 2px solid transparent; }
.doc-toc a:hover { color: var(--accent); background: var(--surface-2); text-decoration: none; border-left-color: var(--accent); }
.doc-toc a.sub { padding-left: 20px; font-size: 12px; }
.doc-body section { scroll-margin-top: 66px; margin-bottom: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.doc-body section > h2 { font-size: 17px; margin: 0 0 6px; display: flex; align-items: center; gap: 10px; }
.doc-body section > h2 .icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--accent); }
.doc-body section > h2 .icon svg { width: 15px; height: 15px; }
.doc-body section > .lede { margin-bottom: 12px; }
.doc-body h3 { font-size: 13.5px; margin: 20px 0 8px; color: var(--ink); }
.doc-body h3::before { content: "› "; color: var(--accent); font-family: var(--mono); }
.doc-body p, .doc-body li { color: var(--ink-2); font-size: 13.5px; }
.doc-body ul, .doc-body ol { padding-left: 20px; margin: 6px 0 12px; }
.doc-body li { margin-bottom: 5px; }
.doc-body li::marker { color: var(--accent); }
.doc-body table { font-size: 12.5px; border: 1px solid var(--line); border-radius: 7px; }
.doc-body .table-wrap { border: 1px solid var(--line); border-radius: 7px; margin: 8px 0 12px; }
.doc-body .table-wrap table { border: 0; }
.doc-body .card > strong:first-child { display: block; margin-bottom: 6px; color: var(--ink); }
.callout { border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 7px 7px 0; padding: 10px 14px; margin: 12px 0; font-size: 13px; color: var(--ink-2); }
.callout.warn { border-left-color: var(--warn); background: var(--warn-soft); }
.legend-chips { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 8px 0; font-size: 11.5px; color: var(--muted); }
.legend-chips span { display: inline-flex; align-items: center; gap: 6px; }
.legend-chips i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; border: 1px solid var(--line-strong); }
.legend-chips i.gate { background: var(--warn-soft); border-color: var(--warn-line); }
.legend-chips i.store { background: var(--good-soft); border-color: var(--good-line); }
.legend-chips i.model { background: var(--ai-soft); border-color: var(--ai-line); }

/* ----------------------------------------------------------------- labels -- */
.labels-summary { display: grid; gap: 12px; }
.labels-summary .k { font: 600 10px var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 5px; }
.labels-summary p { margin: 0; }
.breakdown { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.breakdown .small { margin-right: 10px; font-family: var(--mono); }

/* ------------------------------------------------------------------ meter -- */
.meter { margin: 12px 0 0; }
.meter .meter-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.meter .meter-value { font: 600 19px var(--mono); color: var(--ink); }
.meter .meter-of { color: var(--muted); font: 12px var(--mono); }
.meter .meter-note { margin-left: auto; }
.meter .track { height: 7px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--line); margin: 8px 0 6px; overflow: hidden; }
.meter .fill { height: 100%; min-width: 4px; background: linear-gradient(90deg, var(--accent-2), var(--seq)); border-radius: 7px; box-shadow: 0 0 10px -2px var(--seq); }
.meter.warn .fill { background: var(--warn); box-shadow: 0 0 10px -2px var(--warn); } .meter.bad .fill { background: var(--bad); box-shadow: 0 0 10px -2px var(--bad); }
.meter .meter-foot { display: flex; gap: 6px; flex-wrap: wrap; color: var(--muted); font-size: 11.5px; }
.counter { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; font: 10.5px/1.5 var(--mono); color: var(--muted); border: 1px solid var(--line-2); background: var(--surface-2); border-radius: 4px; padding: 1px 7px; margin: 4px 4px 0 0; }
.counter .mono { color: var(--ink-2); font-size: 10.5px; }
.counter strong { color: var(--good); font-weight: 600; }
.counter.warn { border-color: var(--warn-line); background: var(--warn-soft); color: var(--warn); }
.counter.warn strong { color: var(--warn); }
.counter.bad { border-color: var(--bad-line); background: var(--bad-soft); color: var(--bad); }
.counter.bad strong { color: var(--bad); }
.counter .cbar { width: 34px; height: 4px; border-radius: 4px; background: var(--line-strong); overflow: hidden; display: inline-block; flex: none; }
.counter .cbar i { display: block; height: 100%; background: var(--seq); min-width: 1px; }
.counter.warn .cbar i { background: var(--warn); } .counter.bad .cbar i { background: var(--bad); }
.counters { margin-top: 6px; }
.unavailable { margin-top: 10px; font-size: 12px; color: var(--muted); }
.unavailable ul { margin: 6px 0 0; padding-left: 18px; }

/* -------------------------------------------------------------- evidence -- */
.evidence-item { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin-bottom: 10px; background: var(--surface); }
.evidence-item .head { display: flex; gap: 6px 8px; align-items: center; flex-wrap: wrap; margin-bottom: 9px; }
.evidence-item .head strong { font: 600 11px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); margin-right: 4px; }
.claim { border: 1px solid var(--line); border-left: 3px solid var(--line-strong); border-radius: 7px; padding: 10px 13px; margin-bottom: 8px; background: var(--surface); }
.claim .claim-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.claim .claim-head strong { font-weight: 600; color: var(--ink); }
.claim .claim-id { font: 700 11px var(--mono); color: var(--muted); min-width: 30px; }
.claim.verified { border-left-color: var(--good); } .claim.verified .claim-id { color: var(--good); }
.claim.contested { border-left-color: var(--warn); } .claim.contested .claim-id { color: var(--warn); }
.claim.hypothesis { border-left-color: var(--ai); border-color: var(--ai-line); background: linear-gradient(90deg, var(--ai-soft), var(--surface) 50%); }
.claim.hypothesis .claim-id { color: var(--ai); }
.claim ul { margin: 6px 0 0; padding-left: 18px; color: var(--ink-2); }
.repeats { margin-top: 5px; }
.repeats summary { cursor: pointer; color: var(--muted); font: 11.5px var(--mono); }
.repeats summary:hover { color: var(--accent); }
.repeats ul { margin: 4px 0 0; padding-left: 16px; }
.repeats li { margin-bottom: 4px; }

/* --------------------------------------------------------------- images -- */
.image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.image-card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; color: var(--ink); text-decoration: none; display: flex; flex-direction: column; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.image-card:hover { border-color: var(--accent-line); box-shadow: var(--glow); text-decoration: none; transform: translateY(-1px); }
.image-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--surface-2); filter: saturate(.85) brightness(.92); transition: filter .2s ease; }
.image-card:hover img { filter: none; }
.image-card .id-tag { position: absolute; top: 8px; left: 8px; font: 600 10.5px/1.6 var(--mono); background: rgba(6, 8, 11, .8); color: var(--accent); border: 1px solid var(--accent-line); border-radius: 4px; padding: 0 6px; backdrop-filter: blur(4px); }
.image-card .kind-tag { position: absolute; top: 8px; right: 8px; font: 600 10px/1.6 var(--mono); background: rgba(6, 8, 11, .8); color: #c6d2de; border: 1px solid rgba(255, 255, 255, .14); border-radius: 4px; padding: 0 6px; text-transform: uppercase; letter-spacing: .06em; }
.image-card .body { padding: 9px 11px; font: 11px var(--mono); color: var(--muted); border-top: 1px solid var(--line); }
.image-card .body strong { color: var(--ink); font: 600 12.5px var(--font); display: block; margin-bottom: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropzone { border: 1.5px dashed var(--line-strong); border-radius: 9px; padding: 20px; text-align: center; background: var(--bg); transition: border-color .15s ease, background .15s ease; }
.dropzone:hover, .dropzone:focus-within { border-color: var(--accent); background: var(--accent-soft); }
.dropzone input[type=file] { max-width: 440px; margin: 10px auto 0; display: block; }
.preview { position: relative; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: repeating-conic-gradient(var(--surface-2) 0% 25%, var(--surface) 0% 50%) 0 0 / 16px 16px; }
.preview img { display: block; width: 100%; max-height: 440px; object-fit: contain; }
.preview .corner { position: absolute; left: 8px; bottom: 8px; font: 600 10.5px var(--mono); color: #c6d2de; background: rgba(6, 8, 11, .78); border: 1px solid rgba(255, 255, 255, .14); border-radius: 4px; padding: 1px 6px; }

/* Timeline of where an image appeared. */
ul.tl { list-style: none; margin: 0 0 18px; padding: 0 0 0 24px; border-left: 1px solid var(--line-strong); }
ul.tl li { position: relative; margin: 0 0 12px; padding: 11px 13px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
ul.tl li::before { content: ""; position: absolute; left: -30px; top: 15px; width: 11px; height: 11px; border-radius: 50%; background: var(--faint); border: 2px solid var(--bg); }
ul.tl li.confirmed::before { background: var(--good); box-shadow: 0 0 8px var(--good); }
ul.tl li.estimated::before { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
ul.tl li.tl-root { background: linear-gradient(90deg, var(--accent-soft), var(--surface) 70%); border-color: var(--accent-line); }
ul.tl li.tl-root::before { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
ul.tl li.tl-divider { background: transparent; border: 0; padding: 4px 0; font: 11px var(--mono); color: var(--faint); text-transform: uppercase; letter-spacing: .1em; }
ul.tl li.tl-divider::before { display: none; }
.tl-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.tl-head strong { font: 600 12.5px var(--mono); }
.tl-node { font: 600 11px var(--mono); color: var(--muted); }
.when { margin-top: 6px; display: grid; gap: 3px; font-size: 12.5px; color: var(--ink-2); }
.copies { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.copy { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); }
.locmap { height: 360px; border-radius: 8px; border: 1px solid var(--line); margin-bottom: 8px; background: var(--surface-2); }
.leaflet-container { background: var(--surface-2) !important; font: 12px var(--font) !important; }
.loc-method { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.loc-method:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.loc-rows, .loc-outcomes { margin: 6px 0 0; padding-left: 18px; color: var(--ink-2); }
.loc-rows li { margin-bottom: 6px; }
.hist-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-top: 8px; }
.hist-grid figure { margin: 0; }
.hist-grid img { width: 100%; height: auto; border-radius: 7px; border: 1px solid var(--line); display: block; }

/* ------------------------------------------------------ investigation graph -- */
.graph-controls { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; padding: 10px 14px; }
.graph-controls > label:not(.check) { margin: 0; font-weight: 500; font-size: 12.5px; display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-family: var(--mono); }
.graph-controls select { width: auto; padding: 5px 28px 5px 9px; font-size: 12.5px; }
.graph-export { margin-left: auto; font: 11.5px var(--mono); color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.graph-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 14px; }
@media (max-width: 1140px) { .graph-layout { grid-template-columns: 1fr; } }
.graph-canvas { padding: 0; overflow: hidden; }
#graph { width: 100%; height: 680px; display: block; cursor: grab; touch-action: none;
  background: radial-gradient(circle at 1px 1px, var(--line-2) 1px, transparent 0) 0 0 / 22px 22px, var(--bg); }
@media (max-width: 700px) { #graph { height: 460px; } }
.graph-status { margin: 0; padding: 8px 14px; border-top: 1px solid var(--line); font: 11.5px var(--mono); color: var(--muted); }
.graph-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 0 14px 12px; color: var(--muted); font-size: 11.5px; }
.graph-legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); vertical-align: middle; }
.graph-legend .shape-result { border-radius: 2px; }
.graph-legend .shape-image { transform: rotate(45deg); border-radius: 1px; }
.graph-legend .private { background: transparent; border: 2px solid var(--warn); }
.graph-legend .line { display: inline-block; width: 22px; border-top: 2px solid var(--muted); vertical-align: middle; }
.graph-legend .line.dashed { border-top-style: dashed; }
.graph-legend .line.dotted { border-top-style: dotted; }
.gk { width: 10px; height: 10px; border-radius: 50%; display: inline-block; vertical-align: middle; }
.gk.blue { background: #3987e5; } .gk.orange { background: #d95926; } .gk.aqua { background: #199e70; } .gk.yellow { background: #c98500; }
.gk.magenta { background: #d55181; } .gk.green { background: #008300; } .gk.violet { background: #9085e9; } .gk.red { background: #e66767; } .gk.grey { background: #56677a; }
:root[data-theme="light"] .gk.blue { background: #2a78d6; } :root[data-theme="light"] .gk.orange { background: #eb6834; } :root[data-theme="light"] .gk.aqua { background: #1baf7a; }
:root[data-theme="light"] .gk.yellow { background: #eda100; } :root[data-theme="light"] .gk.magenta { background: #e87ba4; } :root[data-theme="light"] .gk.violet { background: #6250d6; }
:root[data-theme="light"] .gk.red { background: #e34948; } :root[data-theme="light"] .gk.grey { background: #8592a3; }
.graph-side { max-height: 780px; overflow: auto; }
.graph-side h2 { font-size: 15px; margin: 0 0 6px; }
.graph-side h3 { font: 600 10.5px var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 16px 0 6px; }
.graph-side ul { padding-left: 18px; margin: 6px 0; color: var(--ink-2); }
.graph-side blockquote { margin: 4px 0; padding: 4px 8px; border-left: 2px solid var(--accent-line); font-size: 12.5px; color: var(--ink-2); }
.graph-side .actions .btn { margin: 2px 4px 2px 0; padding: 4px 9px; font-size: 12px; }
.graph-side form.retract { display: flex; gap: 6px; margin: 4px 0 8px; }
.graph-side form.retract input { padding: 4px 8px; font-size: 12px; }
.graph-side form.retract button { padding: 4px 9px; font-size: 12px; }
#graph .edge { stroke: var(--faint); stroke-opacity: .6; cursor: pointer; }
#graph .edge:hover { stroke: var(--accent); stroke-opacity: 1; }
#graph .edge.cls-extracted { stroke-dasharray: 6 4; }
#graph .edge.cls-resolution, #graph .edge.cls-context { stroke-dasharray: 2 4; }
#graph .edge.gated { stroke: var(--bad); }
#graph .node { cursor: pointer; }
#graph .node text { font: 10.5px var(--font); fill: var(--ink-2); paint-order: stroke; stroke: var(--bg); stroke-width: 3px; pointer-events: none; }
#graph .node .private-ring { fill: none; stroke: var(--warn); stroke-width: 2.5; }
#graph .node:hover circle, #graph .node:hover rect, #graph .node:hover polygon { stroke: var(--accent); stroke-width: 2; }

/* --------------------------------------------------------------- workspace -- */
.workspace-layout { grid-template-columns: minmax(0, 1fr) 380px; }
.ws-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.ws-side .graph-side { max-height: 460px; }
.ws-filter { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 14px; }
.ws-filter-kinds { display: flex; gap: 6px 14px; flex-wrap: wrap; }
.ws-filter-kinds .check { margin: 0; text-transform: capitalize; }
.ws-history h2 { font-size: 14px; margin: 0 0 10px; display: flex; align-items: center; gap: 7px; }
.ws-history h2 svg { color: var(--accent); }
.ws-history-list { list-style: none; padding: 0; margin: 0; max-height: 320px; overflow: auto; }
.ws-hist-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 6px 0; border-top: 1px solid var(--line); }
.ws-hist-row:first-child { border-top: 0; }
.ws-waiting { margin-bottom: 10px; }
.ws-waiting-head { font: 600 11px var(--mono); color: var(--warn); margin-bottom: 8px; text-transform: uppercase; letter-spacing: .08em; }
.ws-wait-row { border: 1px solid var(--warn); border-radius: 8px; padding: 9px 11px; margin-bottom: 8px; background: color-mix(in srgb, var(--warn) 7%, transparent); }
.ws-wait-actions { display: flex; gap: 8px; margin-top: 8px; }
.btn.small { padding: 4px 10px; font-size: 12px; }
.ws-menu { position: fixed; z-index: 60; width: 268px; max-height: 60vh; overflow: auto; padding: 8px; box-shadow: var(--glow); }
.ws-menu-head { font-weight: 600; font-size: 13px; padding: 4px 6px 8px; border-bottom: 1px solid var(--line); margin-bottom: 6px; overflow-wrap: anywhere; }
.ws-menu-group { padding: 8px 6px 3px; font: 600 10px var(--mono); text-transform: uppercase; letter-spacing: .1em; }
.ws-tf { display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%; text-align: left;
  background: transparent; border: 0; border-radius: 6px; padding: 7px 8px; color: var(--ink); cursor: pointer; font-size: 12.5px; }
.ws-tf:hover:not([disabled]) { background: var(--accent-soft); color: var(--accent); }
.ws-tf[disabled] { opacity: .5; cursor: not-allowed; }

/* --------------------------------------------------------- acknowledgement -- */
.gate-page { min-height: 100vh; display: grid; place-items: start center; padding: 48px 16px;
  background: radial-gradient(900px 300px at 50% -10%, rgba(34, 211, 238, .15), transparent 70%),
              linear-gradient(90deg, transparent calc(100% - 1px), rgba(34, 211, 238, .045) 0) 0 0 / 32px 32px,
              linear-gradient(0deg, transparent calc(100% - 1px), rgba(34, 211, 238, .045) 0) 0 0 / 32px 32px, var(--bg); }
.gate-card { width: 100%; max-width: 780px; }
.ack-terms { white-space: pre-wrap; font: 12.5px/1.65 var(--mono); border: 1px solid var(--line); border-radius: 7px; padding: 14px 16px; background: var(--bg); max-height: 26rem; overflow-y: auto; color: var(--ink-2); }
.ack-meta { font: 11px var(--mono); color: var(--muted); margin-top: 8px; overflow-wrap: anywhere; }
.ack-check { margin-top: 14px; padding: 12px 14px; }
.ack-hist { font: 11.5px var(--mono); color: var(--muted); margin-top: 22px; }
.ack-hist td { padding: 4px 12px 4px 0; border: 0; }

/* -------------------------------------------------------------- utilities -- */
.mt-0 { margin-top: 0 !important; } .mb-0 { margin-bottom: 0 !important; }
.mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 18px; }
.gap-sm { gap: 6px; }
.flex { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1 1 auto; }
.divider { height: 1px; background: var(--line); margin: 12px 0; }


/* ----------------------------------------------------------------- toolbox -- */
.tool-jump { margin: 0 0 6px; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; margin-bottom: 18px; }
.tool-grid > .card { margin-bottom: 0; display: flex; flex-direction: column; gap: 10px; }
.tool-card.off { opacity: .62; }
.tool-card.chosen { box-shadow: var(--glow); }
.tool-card.linkout { border-style: dashed; }
.tool-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.tool-top h3 { font-size: 14.5px; }
.tool-sum { margin: 0; color: var(--ink-2); }
dl.kv.tool-kv { margin: 0; font-size: 12px; }
.tool-form { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.tool-run { display: flex; gap: 8px; }
.tool-run input { flex: 1; min-width: 0; }
.tool-more .disclosure-body { padding-top: 6px; }
.text-block { white-space: pre-line; overflow-wrap: anywhere; }
@media (max-width: 560px) { .tool-grid { grid-template-columns: 1fr; } }

/* -------------------------------------------------------------- live globe -- */
.globe-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 14px; align-items: start; }
.globe-frame { overflow: hidden; min-height: 420px; }
.globe-frame iframe { display: block; width: 100%; height: calc(100vh - 210px); min-height: 420px; border: 0; background: #000; }
.globe-side > .card { margin-bottom: 14px; }
.globe-side .list .btn { flex: none; }
@media (max-width: 1140px) {
  .globe-layout { grid-template-columns: 1fr; }
  .globe-frame iframe { height: 62vh; }
}
.inline-form { display: inline; margin: 0; }

/* ---------------------------------------------------------- watches (C8) -- */
fieldset.watch-kind { border: 0; padding: 0; margin: 0; min-width: 0; }
.watch-chart { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; align-items: stretch; }
.watch-chart svg { width: 100%; height: 150px; display: block; overflow: visible; }
.watch-chart-axis { display: flex; flex-direction: column; justify-content: space-between; font-size: 10px; color: var(--faint); text-align: right; font-family: var(--mono); padding: 0; height: 150px; }
.watch-chart-axis span { line-height: 1; transform: translateY(-1px); }
.watch-chart .grid-line { stroke: var(--line); stroke-width: 1; }
.watch-chart .bar .hit { fill: transparent; }
.watch-chart .bar .mark { fill: var(--line-strong); }
.watch-chart .bar.risk-critical .mark { fill: var(--bad); }
.watch-chart .bar.risk-high .mark { fill: var(--warn); }
.watch-chart .bar.risk-medium .mark { fill: var(--info); }
.watch-chart .bar.risk-low .mark { fill: var(--muted); }
.watch-chart .bar.baseline .mark { fill-opacity: .35; stroke: var(--ink); stroke-width: 1; vector-effect: non-scaling-stroke; }
.watch-chart .bar:hover .mark { filter: brightness(1.25); }
.watch-chart .bar:hover .hit { fill: var(--accent-soft); }
.finding-list { display: grid; gap: 10px; }
.finding { border-left: 3px solid var(--line-strong); padding-top: 12px; padding-bottom: 12px; }
.finding.risk-edge-critical { border-left-color: var(--bad); }
.finding.risk-edge-high { border-left-color: var(--warn); }
.finding.risk-edge-medium { border-left-color: var(--info); }
.finding-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.finding-head .spacer { flex: 1; }
.finding-title { margin: 8px 0 4px; font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.finding-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ai-note { margin: 6px 0; padding: 7px 10px; border: 1px solid var(--ai-line); background: var(--ai-soft); border-radius: var(--radius-sm); }
.diff-before, .diff-after { white-space: pre-wrap; overflow-wrap: anywhere; margin: 4px 0 0; padding: 8px; border-radius: var(--radius-sm); max-height: 240px; overflow: auto; }
.diff-before { background: var(--bad-soft); border: 1px solid var(--bad-line); }
.diff-after { background: var(--good-soft); border: 1px solid var(--good-line); }
.alert-toasts { position: fixed; right: 16px; bottom: 16px; z-index: 60; display: grid; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.alert-toast { background: var(--surface); border: 1px solid var(--line-strong); border-left: 3px solid var(--warn); border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px 12px; font-size: 13px; }
.alert-toast.critical { border-left-color: var(--bad); }
.alert-toast a { color: var(--ink); text-decoration: none; display: block; }
.alert-toast .xsmall { color: var(--muted); }
/* The live globe's answer card and form (2026-10-27). */
.globe-answer .answer-text { white-space: pre-wrap; unicode-bidi: plaintext; max-height: 260px; overflow: auto; font-size: 12.5px; line-height: 1.5; margin: 8px 0; }
.globe-answer .answer-rows { margin: 6px 0 0; padding-left: 18px; font-size: 12.5px; }
.globe-answer .answer-shots { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.globe-answer .answer-shots img { max-width: 100%; border-radius: 6px; }
.globe-answer .actions, #globe-ask .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.globe-side .or { text-align: center; font-size: 12px; margin: 4px 0; }
#g-problem:empty { display: none; }

/* Cases (C9). */
.finding-row, .note-row { border-top: 1px solid var(--line); padding: 10px 0; }
.finding-row:first-of-type, .note-row:first-of-type { border-top: 0; padding-top: 2px; }
.finding-row details, .note-row form { margin-top: 4px; }
details.picker { margin: 4px 0 8px; }
details.picker > summary { cursor: pointer; }
.choices.compact { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 4px 12px; max-height: 260px; overflow-y: auto; padding: 8px 2px; }
.choices.compact label { display: flex; gap: 6px; align-items: baseline; margin: 0; font-weight: 400; }
form.add-to-case select { width: auto; max-width: 220px; padding: 5px 8px; font-size: 12px; }

/* C10: who is signed in, at the foot of the sidebar. */
.side-user { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 8px 14px; border-top: 1px solid var(--line); }
.side-user a { color: var(--ink); font-weight: 600; }
