
/* ---------------------------------------------------------------- tokens ---
   Light is the base definition; dark redefines only what changes. Both the media
   query and the explicit [data-theme] selector are present, so the in-console theme
   switch wins in either direction while a viewer who has chosen nothing still
   follows their operating system. */
:root {
  /* A white console. The ground is a hair cooler than the cards rather than a tinted
     grey, so panels separate without the page reading as off-white — and dark mode is
     a switch away rather than the default. */
  --bg: #fbfcfc;
  --surface: #ffffff;
  --surface-2: #f1f4f3;
  --surface-3: #e6ebe9;
  --ink: #0f1a15;
  --ink-2: #43524b;
  /* 5.1:1 on the page background and 4.8:1 on the tinted surface — secondary text
     is still text, and 4.5:1 is the floor for it at these sizes. */
  --muted: #606e68;
  --rule: #e2e7e5;
  --rule-2: #ccd5d1;
  /* A form control's boundary is the only thing telling you where it is, so it is
     held to the 3:1 non-text contrast floor. --rule-2 stays soft for table rules and
     separators, which carry no meaning on their own. Measured 3.1:1 on the surface. */
  --field-border: #84938c;
  --accent: #146b4d;
  --accent-hover: #0f5a40;
  --accent-ink: #ffffff;
  --accent-soft: #e2f0ea;
  --accent-line: #a8d0c0;
  --warn: #8a5710;
  --warn-soft: #f9f0dc;
  --danger: #97281f;
  --danger-soft: #fae9e7;
  /* Ink drawn ON --danger. It flips with the palette: in dark mode --danger is a
     light salmon, and white on it measures 2.6:1. */
  --danger-ink: #ffffff;
  --ok: #146b4d;
  --ok-soft: #e2f0ea;
  --shadow-sm: 0 1px 2px rgba(15, 26, 21, .05);
  --shadow-md: 0 4px 16px -6px rgba(15, 26, 21, .18), 0 1px 3px rgba(15, 26, 21, .06);
  --radius: 8px;
  --radius-sm: 6px;
  --radius-pill: 999px;
  --side-w: 246px;
  --top-h: 54px;
  /* Status palette for charts — fixed, never themed, never reused as a series colour.
     Validated against this surface: CVD deltaE 11.3, normal-vision deltaE 27.6.
     Warning yellow is 1.83:1 on the light surface, below 3:1, so every chart using it
     ships visible labels AND a table view (the "relief rule"). */
  --chart-good: #0ca30c;
  --chart-warning: #fab219;
  --chart-critical: #d03b3b;
  --chart-neutral: #9aa8a1;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0f0c;
    --surface: #111a15;
    --surface-2: #17221c;
    --surface-3: #1e2c25;
    --ink: #e9efeb;
    --ink-2: #b3c0ba;
    --muted: #859490;
    --rule: #22302a;
    --rule-2: #33443c;
    --field-border: #5b7369;
    --accent: #5fc49f;
    --accent-hover: #7ad3b3;
    --accent-ink: #06231a;
    --accent-soft: #13251e;
    --accent-line: #21463a;
    --warn: #dda856;
    --warn-soft: #241e10;
    --danger: #e8877e;
    --danger-soft: #2a1512;
    --danger-ink: #180605;
    --ok: #5fc49f;
    --ok-soft: #13251e;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 6px 20px -8px rgba(0, 0, 0, .7), 0 1px 3px rgba(0, 0, 0, .4);
    --chart-neutral: #7d8c85;
  }
}
:root[data-theme="dark"] {
  --bg: #0a0f0c;
  --surface: #111a15;
  --surface-2: #17221c;
  --surface-3: #1e2c25;
  --ink: #e9efeb;
  --ink-2: #b3c0ba;
  --muted: #859490;
  --rule: #22302a;
  --rule-2: #33443c;
  --field-border: #5b7369;
  --accent: #5fc49f;
  --accent-hover: #7ad3b3;
  --accent-ink: #06231a;
  --accent-soft: #13251e;
  --accent-line: #21463a;
  --warn: #dda856;
  --warn-soft: #241e10;
  --danger: #e8877e;
  --danger-soft: #2a1512;
  --danger-ink: #180605;
  --ok: #5fc49f;
  --ok-soft: #13251e;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 6px 20px -8px rgba(0, 0, 0, .7), 0 1px 3px rgba(0, 0, 0, .4);
  --chart-neutral: #7d8c85;
}

/* ------------------------------------------------------------------ base --- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Arabic", sans-serif;
  -webkit-font-smoothing: antialiased;
}
[dir="rtl"] body { font-family: "Noto Sans Arabic", system-ui, sans-serif; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
main:focus { outline: none; }
.ico { flex: none; vertical-align: -.15em; }
/* Motion here is decorative; anyone who has asked for less gets none of it. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
.skip {
  position: absolute; inset-inline-start: -9999px; top: 8px; z-index: 60;
  background: var(--surface); color: var(--ink); border: 1px solid var(--accent);
  padding: 9px 14px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600;
}
.skip:focus { inset-inline-start: 12px; }
.vh {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ----------------------------------------------------------------- shell --- */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.side {
  background: var(--surface); border-inline-end: 1px solid var(--rule);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; overscroll-behavior: contain;
}
.brand {
  display: flex; align-items: center; gap: 10px; padding: 15px 18px 13px;
  color: var(--accent); text-decoration: none;
}
.brand .wm { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand .wm b { font-size: 14.5px; letter-spacing: -.01em; color: var(--ink); }
.brand .wm span { font-size: 11px; color: var(--muted); }
.workspace {
  margin: 0 12px 10px; padding: 8px 11px; border: 1px solid var(--rule);
  border-radius: var(--radius-sm); background: var(--surface-2);
  display: flex; align-items: center; gap: 9px; min-width: 0;
}
.av {
  width: 26px; height: 26px; border-radius: var(--radius-sm); flex: none;
  background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font-size: 11.5px; font-weight: 700;
}
.wt { min-width: 0; line-height: 1.25; }
.wt b { display: block; font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wt span { font-size: 11px; color: var(--muted); }
.nav { padding: 2px 10px 14px; }
.nav-group { margin-top: 13px; }
.nav-group:first-child { margin-top: 0; }
.nav-group > h2 {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted);
  font-weight: 700; margin: 0 0 5px; padding-inline-start: 10px;
}
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; margin-bottom: 1px;
  color: var(--ink-2); text-decoration: none; font-size: 13.5px; border-radius: var(--radius-sm);
  transition: background .12s ease, color .12s ease;
}
.nav a .lbl { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current="page"] {
  background: var(--accent-soft); color: var(--accent); font-weight: 600;
  box-shadow: inset 2px 0 0 var(--accent);
}
[dir="rtl"] .nav a[aria-current="page"] { box-shadow: inset -2px 0 0 var(--accent); }
.badge {
  font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: var(--radius-pill);
  background: var(--danger); color: var(--danger-ink); font-variant-numeric: tabular-nums;
}
.side-foot { margin-top: auto; border-top: 1px solid var(--rule); padding: 10px; }

/* The user menu and the mobile navigation are <details>: disclosure without script. */
details.menu { position: relative; }
details.menu > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 9px;
  padding: 7px 9px; border-radius: var(--radius-sm); color: var(--ink-2); font-size: 13px;
}
details.menu > summary::-webkit-details-marker { display: none; }
details.menu > summary:hover { background: var(--surface-2); }
details.menu > summary .chev { margin-inline-start: auto; color: var(--muted); transition: transform .15s ease; }
details.menu[open] > summary .chev { transform: rotate(180deg); }
.sheet {
  position: absolute; bottom: calc(100% + 6px); inset-inline-start: 0; min-width: 236px; z-index: 40;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius);
  box-shadow: var(--shadow-md); padding: 7px;
}
.sheet a, .sheet button.item {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: start;
  padding: 7px 9px; border-radius: var(--radius-sm); font-size: 13px; color: var(--ink-2);
  text-decoration: none; background: none; border: none; cursor: pointer; font-weight: 400;
}
.sheet a:hover, .sheet button.item:hover { background: var(--surface-2); color: var(--ink); }
.sheet hr { border: none; border-top: 1px solid var(--rule); margin: 6px 2px; }
.sheet .head { padding: 7px 9px 8px; }
.sheet .head b { display: block; font-size: 13px; }
.sheet .head span { font-size: 11.5px; color: var(--muted); }
.sheet .lab { padding: 2px 9px 4px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.seg { display: flex; gap: 4px; padding: 2px 7px 6px; }
.seg a {
  flex: 1; justify-content: center; padding: 5px 4px; font-size: 12px;
  border: 1px solid var(--rule); border-radius: var(--radius-sm); color: var(--muted);
}
.seg a[aria-current="true"] { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); font-weight: 600; }

/* ---------------------------------------------------------------- top bar --- */
.top {
  position: sticky; top: 0; z-index: 30; min-height: var(--top-h);
  display: flex; align-items: center; gap: 14px; padding: 0 24px;
  background: var(--bg); border-bottom: 1px solid var(--rule);
}
.crumbs { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); min-width: 0; flex: 1 1 auto; }
.crumbs a { color: var(--muted); text-decoration: none; white-space: nowrap; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.crumbs .sep { opacity: .45; }
.crumbs .now { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.find { display: flex; align-items: center; }
.find input {
  width: 216px; height: 32px; padding: 0 11px; font-size: 13px;
  border: 1px solid var(--field-border); border-radius: var(--radius-pill);
  background: var(--surface); color: var(--ink);
}

/* ---------------------------------------------------------------- content --- */
main { padding: 24px 26px 80px; max-width: 1280px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head .acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
h1 { font-size: 23px; margin: 0 0 3px; letter-spacing: -.018em; font-weight: 650; }
h2 { font-size: 16px; margin: 30px 0 10px; letter-spacing: -.01em; font-weight: 650; }
h3 { font-size: 14px; margin: 0 0 6px; font-weight: 650; }
.sub { color: var(--muted); font-size: 13.5px; margin: 0; max-width: 80ch; }
.page-head .sub { margin-top: 4px; }
.card {
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 17px 19px; margin-bottom: 14px; box-shadow: var(--shadow-sm);
}
/* A grid child will happily grow past its track unless told not to, which is how a
   wide table inside a card pushes the whole page sideways on a phone. */
.card, .chart-card { min-width: 0; }
/* The wrapper for anything that is legitimately wider than the phone it is read on:
   a matrix, a chart with many columns. It scrolls itself rather than the page. */
.wide-scroll { overflow-x: auto; max-width: 100%; }
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.cols-2 { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); align-items: start; }

/* ---------------------------------------------------------------- sections ---
   One rhythm for the whole console. Before this, every page invented its own gap
   between a heading and the thing under it, and the pages read as a collection of
   screens rather than as one product. */
.section { margin-top: 34px; }
.section:first-of-type { margin-top: 0; }
.section > header {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  flex-wrap: wrap; margin-bottom: 12px; padding-bottom: 9px; border-bottom: 1px solid var(--rule);
}
.section > header h2 { margin: 0; }
.section > header .sub { margin-top: 4px; }
.section > header .acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.section .lead { color: var(--muted); font-size: 13.5px; margin: -4px 0 14px; max-width: 80ch; }

/* ------------------------------------------------------------------ stats --- */
.stat { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 15px 17px; box-shadow: var(--shadow-sm); }
.stat .n { font-size: 27px; font-weight: 640; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.stat.warn .n { color: var(--warn); } .stat.danger .n { color: var(--danger); } .stat.ok .n { color: var(--ok); }
.kpi-row { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(134px, 1fr)); }
.kpi {
  border: 1px solid var(--rule); border-radius: var(--radius); padding: 12px 14px;
  background: var(--surface); box-shadow: var(--shadow-sm); text-decoration: none; color: inherit;
  display: block; transition: border-color .12s ease, transform .12s ease;
}
a.kpi:hover { border-color: var(--accent-line); transform: translateY(-1px); color: inherit; }
.kpi .n { font-size: 21px; font-weight: 640; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .l { font-size: 11.5px; color: var(--muted); margin-top: 1px; line-height: 1.3; }
/* The sparkline sits under the number, never instead of it: the tile always states
   the current value in text, so the line is a second channel and not the only one. */
.kpi .spark { margin-top: 7px; height: 24px; opacity: .9; }
.kpi .top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.kpi .delta { font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--muted); }
.kpi .delta.up { color: var(--ok); }
.kpi .delta.down { color: var(--danger); }
.kpi.alert { border-color: var(--chart-critical); }
.kpi.alert .n { color: var(--chart-critical); }
.kpi.warn { border-color: var(--chart-warning); }

/* ----------------------------------------------------------------- tables --- */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.scroll {
  overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow-sm);
}
th {
  text-align: start; font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted); font-weight: 700; padding: 9px 14px; background: var(--surface-2);
  border-bottom: 1px solid var(--rule-2); white-space: nowrap;
}
th a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
th a:hover { color: var(--ink); }
th .dir { font-size: 9px; }
td { padding: 10px 14px; border-bottom: 1px solid var(--rule); vertical-align: top; }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background .1s ease; }
tbody tr:hover { background: var(--surface-2); }
td.num, th.num { text-align: end; font-variant-numeric: tabular-nums; }
.ttl { font-weight: 600; }
.ttl a { text-decoration: none; }
.ttl a:hover { text-decoration: underline; }
.nowrap { white-space: nowrap; }
/* A matrix table sizes to its content and scrolls, rather than crushing the labels. */
table.matrix { table-layout: auto; }
table.matrix td:not(:first-child), table.matrix th:not(:first-child) { text-align: center; }
table.matrix td:first-child { white-space: nowrap; }

/* ------------------------------------------------------------------ pills --- */
.pill {
  display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 700;
  letter-spacing: .045em; text-transform: uppercase; padding: 2px 8px;
  border-radius: var(--radius-pill); white-space: nowrap; border: 1px solid transparent;
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.pill.ok { color: var(--ok); background: var(--ok-soft); border-color: var(--accent-line); }
.pill.warn { color: var(--warn); background: var(--warn-soft); border-color: var(--rule-2); }
.pill.danger { color: var(--danger); background: var(--danger-soft); border-color: var(--rule-2); }
.pill.muted { color: var(--muted); background: var(--surface-2); border-color: var(--rule); }
.pill + .pill { margin-inline-start: 5px; }

/* ------------------------------------------------------------------ forms --- */
form.stack { display: flex; flex-direction: column; gap: 14px; max-width: 560px; }
form.stack.wide { max-width: 780px; }
.field-row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
label { display: block; font-size: 12.5px; font-weight: 640; margin-bottom: 5px; }
label .hint { font-weight: 400; color: var(--muted); }
.req { color: var(--danger); font-weight: 700; }
input, select, textarea {
  width: 100%; padding: 8px 11px; font: inherit; font-size: 14px;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--field-border); border-radius: var(--radius-sm);
  transition: border-color .12s ease, box-shadow .12s ease;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none;
}
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] {
  border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft);
}
.err { color: var(--danger); font-size: 12px; margin-top: 5px; font-weight: 600; }
textarea { min-height: 88px; resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--accent); }
fieldset { border: 1px solid var(--rule); border-radius: var(--radius-sm); padding: 13px 14px; margin: 0; }
legend { font-size: 12px; font-weight: 640; color: var(--ink-2); padding: 0 6px; }
.check { display: flex; align-items: flex-start; gap: 9px; margin-bottom: 8px; }
.check:last-child { margin-bottom: 0; }
.check label { margin: 0; font-weight: 400; font-size: 13.5px; line-height: 1.4; }
.check input { margin-top: 3px; }

button, .btn {
  font: inherit; font-size: 13.5px; font-weight: 640; cursor: pointer;
  padding: 8px 15px; border-radius: var(--radius-sm); border: 1px solid var(--accent);
  background: var(--accent); color: var(--accent-ink); text-decoration: none;
  display: inline-flex; align-items: center; gap: 7px; justify-content: center;
  white-space: nowrap; transition: background .12s ease, border-color .12s ease, color .12s ease;
}
button:hover, .btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-ink); }
button.ghost, .btn.ghost { background: transparent; color: var(--accent); }
button.ghost:hover, .btn.ghost:hover { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
button.subtle, .btn.subtle { background: var(--surface); color: var(--ink-2); border-color: var(--field-border); }
button.subtle:hover, .btn.subtle:hover { background: var(--surface-2); color: var(--ink); border-color: var(--field-border); }
button.danger, .btn.danger { background: var(--danger); border-color: var(--danger); color: var(--danger-ink); }
button.danger:hover, .btn.danger:hover { background: var(--danger); border-color: var(--danger); filter: brightness(1.1); color: var(--danger-ink); }
button.sm, .btn.sm { padding: 5px 10px; font-size: 12.5px; }
button[disabled] { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }

/* --------------------------------------------------------------- toolbars --- */
.toolbar {
  display: flex; gap: 9px; align-items: center; flex-wrap: wrap;
  padding: 11px 13px; margin-bottom: 13px;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.toolbar input, .toolbar select { width: auto; height: 33px; padding: 0 10px; font-size: 13px; }
.toolbar input[type="search"] { min-width: 210px; flex: 1 1 210px; }
.toolbar .spacer { flex: 1 1 auto; }
.toolbar .count { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------- feedback --- */
.flash {
  padding: 12px 15px; border-radius: var(--radius); margin-bottom: 18px; font-size: 13.5px;
  border: 1px solid;
}
.flash.ok { background: var(--ok-soft); border-color: var(--accent-line); color: var(--ok); }
.flash.warn { background: var(--warn-soft); border-color: var(--rule-2); color: var(--warn); }
.flash.error { background: var(--danger-soft); border-color: var(--rule-2); color: var(--danger); }
.flash strong { font-weight: 700; }
.note { font-size: 12.5px; color: var(--muted); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.empty { padding: 42px 24px; text-align: center; color: var(--muted); font-size: 13.5px; }
.empty .et { display: block; color: var(--ink); font-weight: 640; font-size: 15px; margin-bottom: 5px; }
.empty .btn { margin-top: 14px; }
code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12.5px;
  background: var(--surface-2); padding: 1.5px 5px; border-radius: 4px; color: var(--ink-2);
}
ul.clean { margin: 0; padding-inline-start: 18px; }
ul.clean li { margin-bottom: 5px; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 0; font-size: 13.5px; }
dl.kv dt { color: var(--muted); font-size: 12.5px; }
dl.kv dd { margin: 0; }

/* A vertical record of what happened to one item, in order. */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding-inline-start: 22px; padding-bottom: 15px; }
.timeline li::before {
  content: ""; position: absolute; inset-inline-start: 2px; top: 5px;
  width: 9px; height: 9px; border-radius: 50%; background: var(--accent); opacity: .55;
}
.timeline li::after {
  content: ""; position: absolute; inset-inline-start: 6px; top: 16px; bottom: 0;
  width: 1px; background: var(--rule);
}
.timeline li:last-child { padding-bottom: 0; }
.timeline li:last-child::after { display: none; }
.timeline .tw { font-size: 12px; color: var(--muted); }

/* ------------------------------------------------------------------- auth --- */
.auth-wrap { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.auth-card {
  width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--radius); padding: 30px 30px 26px; box-shadow: var(--shadow-md);
}
.auth-card .brand { padding: 0 0 20px; }
.auth-foot { margin-top: 20px; padding-top: 15px; border-top: 1px solid var(--rule); font-size: 12px; color: var(--muted); text-align: center; }

/* ---------------------------------------------------------------- charts --- */
.chart-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); margin-bottom: 14px; }
.chart-card {
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 17px 19px 15px; box-shadow: var(--shadow-sm);
}
.chart-card h3 { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 3px; }
.chart-card .cap { font-size: 12.5px; color: var(--muted); margin: 0 0 14px; }
.chart-card.wide { grid-column: 1 / -1; }
.chart-card > header { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.chart-card .figure { display: flex; justify-content: center; padding: 4px 0 2px; }
/* Two charts of the same subject side by side, sharing one caption. */
.chart-pair { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); align-items: center; }
.hero-card { display: flex; gap: 26px; align-items: center; flex-wrap: wrap; }
.hero-card .gauge { flex: 0 0 190px; max-width: 190px; }
.hero-card .hero-side { flex: 1 1 240px; min-width: 200px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 12px; font-size: 12.5px; color: var(--ink-2); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-swatch { width: 10px; height: 10px; border-radius: 2px; flex: none; }
.legend-item b { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
/* The table view that discharges the contrast relief rule — every charted number is
   also readable as text, so colour is never the only channel. */
.chart-table { width: 100%; margin-top: 12px; font-size: 12.5px; }
.chart-table td { padding: 5px 0; border: none; }
.chart-table tr:hover { background: none; }
.chart-table td:last-child { text-align: end; font-variant-numeric: tabular-nums; font-weight: 600; }
.chart-table .sw { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-inline-end: 7px; }
.chart-table th {
  position: static; background: none; border-bottom: 1px solid var(--rule);
  padding: 0 0 6px; font-size: 10px;
}
.chart-table td:first-child { width: 100%; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 4px 10px;
  border: 1px solid var(--rule-2); border-radius: var(--radius-pill); background: var(--surface);
  color: var(--ink-2); text-decoration: none;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.chip.advisory { border-style: dashed; }
/* Compliance bar: colour encodes the score, so a weak result reads as weak at a
   glance rather than only in the number beside it. */
.bar { display: inline-block; vertical-align: middle; width: 120px; height: 7px;
  background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; }
.bar-num { margin-inline-start: 8px; font-weight: 600; font-variant-numeric: tabular-nums; font-size: 13px; }
.inline-form { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.inline-form select { width: auto; min-width: 150px; padding: 6px 8px; font-size: 13px; }
.inline-form input { width: auto; flex: 1 1 150px; padding: 6px 8px; font-size: 13px; }

/* ------------------------------------------------------------ small screens --- */
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  main { padding: 18px 15px 70px; }
  .top { padding: 0 14px; gap: 10px; }
  .find input { width: 132px; }
  /* The whole navigation as a disclosure panel: no script, no overlay to trap focus
     inside, and it collapses on navigation because the page reloads. */
  .mobile-nav { background: var(--surface); border-bottom: 1px solid var(--rule); }
  .mobile-nav > details > .sheet {
    position: static; box-shadow: none; border: none; border-top: 1px solid var(--rule);
    border-radius: 0; padding: 0; min-width: 0; background: none;
  }
  .mobile-nav .nav { padding: 6px 12px 12px; }
}
@media (min-width: 901px) { .mobile-nav { display: none; } }

/* ------------------------------------------------------------------ print --- */
/* The console is printed into board packs and regulator submissions, so the printed
   page has to identify itself: which workspace, which page, generated when. */
@media print {
  .side, .top, .toolbar, .skip, .mobile-nav, .page-head .acts, .no-print { display: none !important; }
  .shell { grid-template-columns: 1fr; }
  main { padding: 0; max-width: none; }
  body { background: #fff; }
  .card, .kpi, .chart-card, .scroll { break-inside: avoid; box-shadow: none; }
  .print-head { display: block !important; margin-bottom: 18px; padding-bottom: 10px; border-bottom: 2px solid currentColor; }
  tbody tr:hover { background: none; }
}
.print-head { display: none; }
