/* ============================================================================
   ReqAI design system — TIMEHOUSE IT Team
   Dark-first application shell with a validated data-visualisation palette.

   Series colours are the reference categorical slots 1-3, validated with
   scripts/validate_palette.js against BOTH surfaces used here:
     dark  #151b28 -> all checks PASS (worst adjacent CVD dE 9.4)
     light #ffffff -> all checks PASS (aqua carries a contrast WARN, so any
                      chart using slot 3 ships direct labels as relief)
   Status colours are reserved and never reused as a series colour.
   ========================================================================= */

:root {
  color-scheme: dark;

  /* Surfaces */
  --plane: #0b0f18;
  --surface: #151b28;
  --surface-2: #1c2434;
  --surface-3: #232d40;
  --sidebar: #0e1320;
  --sidebar-text: #b3bdd0;
  --sidebar-strong: #ffffff;
  --sidebar-muted: #7f8ca4;
  --sidebar-label: #5c6880;
  --sidebar-hover: rgba(255, 255, 255, 0.05);
  --sidebar-border: rgba(255, 255, 255, 0.06);
  --sidebar-chip: rgba(255, 255, 255, 0.12);
  --sidebar-chip-text: #cfd8e6;
  --shadow-pop: rgba(0, 0, 0, 0.7);
  --sheen: rgba(255, 255, 255, 0.05);

  /* Ink */
  --text: #eef2f8;
  --text-2: #a4b0c4;
  --muted: #6e7c93;

  /* Lines */
  --border: #263043;
  --border-soft: #1e2636;
  --grid: #212b3d;

  /* Brand / accent — TIMEHOUSE red #a61e22.
     The brand hex is only 2.32:1 on this surface, so dark mode uses a lighter
     step of the same hue for anything that carries text (#e2585d, 4.75:1) and
     keeps a deep step for button fills, where the label is white (6.74:1). */
  --accent: #e2585d;
  --accent-2: #a61e22;
  --accent-fill: #b02328;
  --accent-fill-2: #7a1519;
  --accent-soft: rgba(226, 88, 93, 0.15);
  --accent-ring: rgba(226, 88, 93, 0.38);
  --glow: radial-gradient(120% 120% at 0% 0%, rgba(226, 88, 93, 0.15), transparent 60%),
    radial-gradient(100% 100% at 100% 0%, rgba(166, 30, 34, 0.14), transparent 55%);

  /* Data-viz categorical slots (dark steps) */
  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70;

  /* Status — reserved, never a series */
  --good: #0ca30c;
  --warning: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;
  --good-soft: rgba(12, 163, 12, 0.16);
  --warning-soft: rgba(250, 178, 25, 0.16);
  --serious-soft: rgba(236, 131, 90, 0.16);
  --critical-soft: rgba(208, 59, 59, 0.18);

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

:root[data-theme='light'],
html.theme-light {
  color-scheme: light;
  --plane: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #f4f6fa;
  --surface-3: #e9edf4;
  --sidebar: #ffffff;
  --sidebar-text: #47536a;
  --sidebar-strong: #101725;
  --sidebar-muted: #74809a;
  --sidebar-label: #8a94a8;
  --sidebar-hover: rgba(16, 23, 37, 0.055);
  --sidebar-border: rgba(16, 23, 37, 0.09);
  --sidebar-chip: rgba(16, 23, 37, 0.08);
  --sidebar-chip-text: #47536a;
  --shadow-pop: rgba(16, 23, 37, 0.2);
  --sheen: rgba(16, 23, 37, 0.05);

  --text: #101725;
  --text-2: #47536a;
  --muted: #74809a;

  --border: #dde3ec;
  --border-soft: #e8edf4;
  --grid: #eaeff6;

  /* The brand hex reads at 7.42:1 on white — usable directly. */
  --accent: #a61e22;
  --accent-2: #7a1519;
  --accent-fill: #a61e22;
  --accent-fill-2: #7a1519;
  --accent-soft: rgba(166, 30, 34, 0.09);
  --accent-ring: rgba(166, 30, 34, 0.30);
  --glow: radial-gradient(120% 120% at 0% 0%, rgba(166, 30, 34, 0.07), transparent 60%);

  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;

  --shadow: 0 1px 2px rgba(16, 23, 37, 0.06), 0 8px 24px -16px rgba(16, 23, 37, 0.24);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--plane);
  color: var(--text);
  font: 14.5px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { letter-spacing: -0.015em; }

/* ── App shell ───────────────────────────────────────────── */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 232px;
  flex: 0 0 232px;
  background: var(--sidebar);
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 18px 16px;
  color: var(--sidebar-strong);
}
.sidebar__mark {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent-fill), var(--accent-fill-2));
  display: grid; place-items: center;
  font-weight: 700; font-size: 14px; color: #fff;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.08), 0 6px 16px -6px var(--accent);
}
.sidebar__name { font-weight: 680; font-size: 16px; line-height: 1.1; }
.sidebar__name small {
  display: block; font-size: 10px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--sidebar-muted); margin-top: 2px;
}
.sidebar__group { padding: 10px 12px 4px; }
.sidebar__label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--sidebar-label); padding: 0 8px 6px;
}
.sidebar a.navlink {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  color: var(--sidebar-text); font-weight: 550; font-size: 14px;
  margin-bottom: 1px;
}
.sidebar a.navlink:hover { background: var(--sidebar-hover); color: var(--sidebar-strong); text-decoration: none; }
.sidebar a.navlink.is-active {
  background: linear-gradient(90deg, var(--accent-soft), transparent);
  color: var(--sidebar-strong);
  box-shadow: inset 2px 0 0 var(--accent);
}
.navlink__icon { width: 17px; text-align: center; opacity: 0.85; flex: 0 0 17px; }
.navlink__count {
  margin-left: auto; font-size: 11px; font-weight: 700;
  background: var(--critical); color: #fff;
  padding: 1px 6px; border-radius: 999px;
}
.navlink__count--soft { background: var(--sidebar-chip); color: var(--sidebar-chip-text); }
.sidebar__foot { margin-top: auto; padding: 14px; border-top: 1px solid var(--sidebar-border); }

.app__main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 58px;
  display: flex; align-items: center; gap: 14px;
  padding: 0 22px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
  position: sticky; top: 0; z-index: 30;
}
.topbar__search { flex: 1; max-width: 420px; position: relative; }
.topbar__search input[type="search"] { padding-left: 38px; background: var(--surface-2); }
.topbar__search::before {
  content: "⌕"; position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: 17px; line-height: 1; pointer-events: none; z-index: 1;
}
.topbar__spacer { flex: 1; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-fill), var(--accent-fill-2));
  color: #fff; font-size: 12px; font-weight: 700;
  display: grid; place-items: center;
}

.page { padding: 22px; max-width: 1560px; width: 100%; }
.page__head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 18px;
}
.page__head h1 { margin: 0 0 3px; font-size: 21px; font-weight: 680; }
.page__head p { margin: 0; color: var(--text-2); font-size: 13.5px; }
.page__actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  overflow: hidden;
}
.card__head {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-soft);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
.card__head h2 { margin: 0; font-size: 14px; font-weight: 650; }
.card__head .sub { font-size: 12px; color: var(--muted); font-weight: 500; }
.card__body { padding: 16px; }
.card__body--flush { padding: 0; }
.card__foot {
  padding: 10px 16px; border-top: 1px solid var(--border-soft);
  background: var(--surface-2); font-size: 13px;
}

.pager {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; border-top: 1px solid var(--border-soft);
  background: var(--surface-2);
}
.pager__info { font-size: 12.5px; color: var(--muted); }
.pager__nav { display: flex; gap: 8px; }
.pager .is-disabled { opacity: .4; pointer-events: none; }

.grid { display: grid; gap: 16px; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(440px, 1fr)); }
.grid { align-items: start; }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.grid--wide { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 1100px) { .grid--wide { grid-template-columns: 1fr; } }

/* ── Stat tiles (hero numbers, no chart) ─────────────────── */
.stat {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px 16px 13px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.stat::before {
  content: ""; position: absolute; inset: 0; background: var(--glow);
  pointer-events: none; opacity: 0.7;
}
.stat > * { position: relative; }
.stat__label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--muted); font-weight: 650; margin-bottom: 8px;
  display: flex; align-items: center; gap: 6px;
}
.stat__value { font-size: 30px; font-weight: 700; line-height: 1; letter-spacing: -0.03em; }
.stat__value small { font-size: 14px; font-weight: 600; color: var(--muted); margin-left: 4px; }
.stat__hint { font-size: 12px; color: var(--text-2); margin-top: 7px; }
.stat__row { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.stat--danger { border-color: color-mix(in srgb, var(--critical) 40%, var(--border)); }
.stat--danger .stat__value { color: var(--critical); }
.stat--warn .stat__value { color: var(--warning); }
.stat--ok .stat__value { color: var(--good); }

.delta { font-size: 12px; font-weight: 650; display: inline-flex; align-items: center; gap: 3px; }
.delta--up { color: var(--good); }
.delta--down { color: var(--critical); }
.delta--flat { color: var(--muted); }

/* ── Charts ──────────────────────────────────────────────── */
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-empty { color: var(--muted); font-size: 13px; text-align: center; padding: 28px 0; margin: 0; }

.ch-grid { stroke: var(--grid); stroke-width: 1; }
.ch-tick { fill: var(--muted); font-size: 10.5px; font-family: var(--sans); }
.ch-line { fill: none; stroke: var(--c); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ch-area { fill: var(--c); opacity: 0.09; }
.ch-end { fill: var(--c); stroke: var(--surface); stroke-width: 2; }
.ch-endlabel { fill: var(--text-2); font-size: 11.5px; font-weight: 650; font-family: var(--sans); }
.ch-dot { cursor: crosshair; }
.ch-dot:hover { fill: var(--c); fill-opacity: 0.25; }

.ch-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.ch-key {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-2); font-weight: 550;
}
.ch-key i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }

/* Horizontal bar list */
.barlist { list-style: none; margin: 0; padding: 0; }
.barlist li { margin-bottom: 8px; }
.barlist li:last-child { margin-bottom: 0; }
.barlist a { color: inherit; text-decoration: none; }
.barlist li > *,
.barlist a { display: grid; grid-template-columns: 92px 1fr 62px; align-items: center; gap: 10px; }
.barlist__label { font-size: 12.5px; color: var(--text-2); }
.barlist__track { background: var(--surface-3); border-radius: 4px; height: 9px; overflow: hidden; }
.barlist__bar { display: block; height: 100%; border-radius: 0 4px 4px 0; }
.barlist__value {
  font-size: 13px; font-weight: 650; text-align: right;
  font-variant-numeric: tabular-nums;
}
.barlist__value small { color: var(--muted); font-weight: 550; margin-left: 5px; font-size: 11px; }
.barlist li:hover .barlist__label { color: var(--text); }

/* Sparkline */
.spark { width: 100%; height: 28px; display: block; }
.spark__line { fill: none; stroke: var(--c); stroke-width: 2; vector-effect: non-scaling-stroke; }
.spark__area { fill: var(--c); opacity: 0.12; }

/* Progress ring */
.ring__track { fill: none; stroke: var(--surface-3); }
.ring__value { fill: none; stroke: var(--accent); stroke-linecap: round; transition: stroke-dasharray .4s ease; }
.ring--good .ring__value { stroke: var(--good); }
.ring--warning .ring__value { stroke: var(--warning); }
.ring--critical .ring__value { stroke: var(--critical); }
.ring__text { fill: var(--text); font-size: 18px; font-weight: 700; font-family: var(--sans); }

/* Release timeline */
.tl { position: relative; font-size: 12.5px; }
.tl__row { display: grid; grid-template-columns: 150px 1fr 44px; align-items: center; gap: 12px; padding: 5px 0; }
.tl__row--axis { padding-bottom: 10px; }
.tl__name { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl__name small { display: block; color: var(--muted); font-weight: 500; font-size: 11px; }
.tl__track { position: relative; height: 22px; background: var(--surface-2); border-radius: 6px; }
.tl__track::after {
  content: ""; position: absolute; top: -4px; bottom: -4px; left: var(--now);
  width: 2px; background: var(--warning); opacity: 0.75;
}
.tl__track--axis { background: none; height: 30px; }
.tl__track--axis::after { top: 0; bottom: -6px; }
.tl__month { position: absolute; top: 0; font-size: 10.5px; color: var(--muted); transform: translateX(-50%); }
.tl__nowlabel {
  position: absolute; left: var(--now); bottom: 0; transform: translateX(-50%);
  font-size: 10px; font-weight: 700; color: var(--warning); background: var(--surface);
  padding: 0 5px; border-radius: 3px; z-index: 2; line-height: 14px;
}
.tl__bar {
  position: absolute; top: 0; height: 22px; border-radius: 6px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  overflow: hidden; min-width: 26px;
}
.tl__fill { position: absolute; inset: 0 auto 0 0; background: var(--series-1); opacity: 0.9; }
.tl__bar--released .tl__fill { background: var(--good); }
.tl__bar--testing .tl__fill { background: var(--series-1); }
.tl__bar--in-development .tl__fill { background: var(--series-2); }
.tl__bar--planning .tl__fill { background: var(--muted); }
.tl__bar.is-overdue { border-color: var(--critical); box-shadow: 0 0 0 1px var(--critical); }
.tl__pct {
  font-size: 12px; font-weight: 700; color: var(--text-2); text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ── Tables ──────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th {
  text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); font-weight: 700; padding: 9px 14px;
  border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface-2);
  position: sticky; top: 0;
}
table.data td { padding: 10px 14px; border-bottom: 1px solid var(--border-soft); vertical-align: top; }
.card--compact table.data th, .card--compact table.data td { padding: 8px 12px; }
.card--compact table.data td { vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: var(--surface-2); }
.ref { font-family: var(--mono); font-size: 12px; font-weight: 650; white-space: nowrap; }

/* ── Badges ──────────────────────────────────────────────── */
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 6px;
  font-size: 11px; font-weight: 650; line-height: 1.55;
  background: var(--surface-3); color: var(--text-2);
  border: 1px solid transparent; white-space: nowrap;
}
.badge--done, .badge--released, .badge--approved, .badge--delivered, .badge--active, .badge--low {
  background: var(--good-soft); color: var(--good);
}
.badge--in-progress, .badge--in-development, .badge--review, .badge--testing,
.badge--under-review, .badge--medium, .badge--planned, .badge--feature {
  background: var(--accent-soft); color: var(--accent);
}
.badge--blocked, .badge--critical, .badge--rejected, .badge--blocker, .badge--bug {
  background: var(--critical-soft); color: var(--critical);
}
.badge--high, .badge--on-hold, .badge--pending, .badge--major, .badge--triggered,
.badge--submitted, .badge--public, .badge--change-request {
  background: var(--warning-soft); color: var(--warning);
}
.badge--cancelled { background: var(--surface-3); color: var(--muted); text-decoration: line-through; }
.badge--admin { background: var(--accent-soft); color: var(--accent); }

/* ── Progress bar ────────────────────────────────────────── */
.progress { height: 6px; background: var(--surface-3); border-radius: 999px; overflow: hidden; min-width: 64px; }
.progress__bar { height: 100%; background: var(--accent); border-radius: 999px; }
.progress__bar--ok { background: var(--good); }
.progress__bar--warn { background: var(--warning); }
.progress__bar--danger { background: var(--critical); }
.progress-row { display: flex; align-items: center; gap: 8px; }
.progress-row span { font-size: 12px; color: var(--muted); min-width: 32px; font-variant-numeric: tabular-nums; }

/* ── Forms ───────────────────────────────────────────────── */
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.field { display: flex; flex-direction: column; gap: 5px; }
.field--full { grid-column: 1 / -1; }
.field label { font-size: 12px; font-weight: 650; color: var(--text-2); }
.field small { font-size: 11.5px; color: var(--muted); }

/* Match by exclusion, not by listing types: an <input> with no type attribute
   behaves as text but matches none of input[type="..."], which silently left
   two dozen fields across the app rendering with browser defaults. */
input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="image"]),
select, textarea {
  width: 100%; padding: 8px 11px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text);
  font: inherit; font-size: 13.5px;
}
input:disabled, select:disabled, textarea:disabled,
input[readonly] { opacity: 0.65; cursor: not-allowed; }
textarea { min-height: 92px; resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring);
}
input::placeholder, textarea::placeholder { color: var(--muted); }

/* Chrome paints autofilled fields with its own opaque background, which reads
   as a tan block on a dark surface. There is no property to disable it, so
   overpaint with an inset shadow and hold it with an effectively-infinite
   transition. */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active,
textarea:-webkit-autofill,
select:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px var(--surface-2) inset;
  box-shadow: 0 0 0 1000px var(--surface-2) inset;
  caret-color: var(--text);
  transition: background-color 100000s ease-in-out 0s;
}
.checkbox { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.checkbox input { width: auto; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  font: inherit; font-size: 13.5px; font-weight: 620; cursor: pointer; white-space: nowrap;
  transition: background .12s ease, border-color .12s ease;
}
.btn:hover { background: var(--surface-3); text-decoration: none; }
.btn--primary {
  background: linear-gradient(135deg, var(--accent-fill), var(--accent-fill-2));
  border-color: transparent; color: #fff;
  box-shadow: 0 4px 14px -6px var(--accent);
}
.btn--primary:hover { filter: brightness(1.08); }
.btn--danger { color: var(--critical); border-color: color-mix(in srgb, var(--critical) 50%, var(--border)); }
.btn--sm { padding: 5px 10px; font-size: 12.5px; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.filters .field { min-width: 132px; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; }

/* ── Alerts ──────────────────────────────────────────────── */
.flash { margin-bottom: 14px; }
.alert {
  padding: 11px 14px; border-radius: var(--radius);
  border: 1px solid var(--border); font-size: 13.5px; margin-bottom: 8px;
}
.alert--success { background: var(--good-soft); color: var(--good); border-color: transparent; }
.alert--error { background: var(--critical-soft); color: var(--critical); border-color: transparent; }
.alert--info { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

/* ── Board ───────────────────────────────────────────────── */
.board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; }
.board__col { min-width: 262px; flex: 1 0 262px; }
.board__head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 11px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0;
  font-size: 11.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--text-2);
}
.board__body {
  background: var(--surface); border: 1px solid var(--border); border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 8px; min-height: 120px; display: flex; flex-direction: column; gap: 8px;
}
.board-card {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px; background: var(--surface-2);
  transition: transform .12s ease, border-color .12s ease;
}
.board-card:hover { transform: translateY(-1px); border-color: var(--accent); }
.board-card__ref { display: flex; justify-content: space-between; gap: 6px; margin-bottom: 5px; }
.board-card__title { font-size: 13px; line-height: 1.4; margin-bottom: 7px; }
.board-card__meta { display: flex; gap: 6px; flex-wrap: wrap; font-size: 11px; color: var(--muted); }

/* ── AI panel ────────────────────────────────────────────── */
.ai-panel {
  position: relative;
  border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--border));
  background: linear-gradient(135deg, rgba(226,88,93,0.10), rgba(166,30,34,0.07)), var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
}
.ai-panel__head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 13px 16px; border-bottom: 1px solid var(--border-soft);
}
.ai-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px; color: #fff;
  background: linear-gradient(135deg, var(--accent-fill), var(--accent-fill-2));
}
.ai-panel__body { padding: 16px; }
.ai-panel__headline { font-size: 16px; font-weight: 650; margin: 0 0 8px; }

.provider-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--border); font-size: 12px; background: var(--surface-2);
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); flex: none; }
.dot--ok { background: var(--good); box-shadow: 0 0 0 3px var(--good-soft); }
.dot--warn { background: var(--warning); box-shadow: 0 0 0 3px var(--warning-soft); }
.dot--off { background: var(--critical); box-shadow: 0 0 0 3px var(--critical-soft); }

/* ── Misc ────────────────────────────────────────────────── */
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.empty { padding: 30px; text-align: center; color: var(--muted); font-size: 13.5px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row--between { justify-content: space-between; }
.stack > * + * { margin-top: 12px; }
.tag {
  display: inline-block; padding: 1px 7px; border-radius: 5px;
  background: var(--surface-3); color: var(--text-2); font-size: 11px;
}
.overdue { color: var(--critical); font-weight: 650; }

.kv { display: grid; grid-template-columns: minmax(110px, max-content) 1fr; gap: 7px 16px; font-size: 13.5px; }
.kv dt { color: var(--muted); font-size: 12px; font-weight: 650; }
.kv dd { margin: 0; }

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li {
  padding: 8px 0 8px 16px; border-left: 2px solid var(--border);
  position: relative; font-size: 13px;
}
.timeline li::before {
  content: ""; position: absolute; left: -5px; top: 14px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--border);
}
.timeline li.is-risk::before { background: var(--critical); }
.timeline li.is-done::before { background: var(--good); }

.prose { font-size: 14px; line-height: 1.68; color: var(--text-2); }
.prose p { margin: 0 0 10px; }

.risk { border-left: 3px solid var(--border); padding: 10px 0 10px 14px; margin-bottom: 12px; }
.risk--critical { border-color: var(--critical); }
.risk--high { border-color: var(--warning); }
.risk--medium { border-color: var(--accent); }
.risk--low { border-color: var(--good); }
.risk h4 { margin: 0 0 4px; font-size: 14px; }
.risk p { margin: 0 0 4px; font-size: 13px; color: var(--text-2); }

/* Attention feed */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 16px; border-bottom: 1px solid var(--border-soft);
}
.feed li:last-child { border-bottom: 0; }
.feed li:hover { background: var(--surface-2); }
.feed__sev { width: 3px; align-self: stretch; border-radius: 2px; background: var(--muted); flex: none; }
.feed__sev--critical { background: var(--critical); }
.feed__sev--serious { background: var(--serious); }
.feed__sev--warning { background: var(--warning); }
.feed__main { flex: 1; min-width: 0; }
.feed__title { font-size: 13.5px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed__meta { font-size: 11.5px; color: var(--muted); }
.feed__value { font-size: 12px; font-weight: 700; white-space: nowrap; }

.public-hero {
  background: linear-gradient(135deg, rgba(226,88,93,0.12), rgba(166,30,34,0.08)), var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 30px; margin-bottom: 20px;
}
.public-hero h1 { margin: 0 0 8px; font-size: 25px; }
.public-hero p { margin: 0; color: var(--text-2); max-width: 62ch; }

/* ── Responsive ──────────────────────────────────────────── */
/* ── Mobile: sidebar becomes an off-canvas drawer ─────────── */
.nav-toggle { display: none; }
.scrim { display: none; }
/* Both are mobile-only; the media query below turns them on. */
.topbar__brand { display: none; align-items: center; gap: 8px; font-weight: 700;
  color: inherit; text-decoration: none; white-space: nowrap; }
.topbar__brand:hover { text-decoration: none; }
.topbar__mark {
  width: 26px; height: 26px; border-radius: 7px; font-size: 12px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--accent-fill), var(--accent-fill-2));
  display: grid; place-items: center;
}
.nav-only-mobile { display: none; }

@media (max-width: 900px) {
  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; padding: 0; flex: none;
  }

  .sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 60;
    width: 268px; max-width: 84vw; height: 100dvh;
    transform: translateX(-100%);
    transition: transform 260ms var(--ease-out);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.45);
    overscroll-behavior: contain;
  }
  .app.nav-open .sidebar { transform: none; }

  .scrim {
    display: block; position: fixed; inset: 0; z-index: 55;
    background: rgba(4, 7, 13, 0.55);
    backdrop-filter: blur(2px);
    opacity: 0; visibility: hidden;
    transition: opacity 220ms var(--ease-out), visibility 220ms;
  }
  .app.nav-open .scrim { opacity: 1; visibility: visible; }

  /* Stop the page scrolling behind an open drawer. */
  body.nav-locked { overflow: hidden; }

  .app__main { width: 100%; }

  .topbar { padding: 0 12px; gap: 8px; }
  .topbar__search { display: none; }         /* search lives in the drawer */
  .topbar__brand { display: flex; }
  .nav-only-mobile { display: block; }
  .topbar__user-text { display: none; }      /* avatar only — the name wrapped */
  .topbar .btn--primary { padding: 7px 11px; }

  .page { padding: 16px 14px 44px; }
  .page__head h1 { font-size: 19px; }
  .page__actions { width: 100%; }
  .page__actions .btn { flex: 1 1 auto; justify-content: center; }

  .grid--2, .grid--3, .grid--4, .grid--wide { grid-template-columns: 1fr; }

  /* A 12-week line chart squeezed to 360px is unreadable — let it keep a
     legible width and scroll instead. */
  .chart { overflow-x: auto; }
  .chart svg { min-width: 480px; }

  .barlist li > *, .barlist a { grid-template-columns: 74px 1fr 56px; }
  .tl { overflow-x: auto; }
  .tl__row { grid-template-columns: 92px minmax(320px, 1fr) 40px; }

  .board__col { min-width: 82vw; flex-basis: 82vw; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dd { margin-bottom: 8px; }
  .card__head { padding: 12px 14px; }
  .card__body { padding: 14px; }
  .stat__value { font-size: 26px; }
}

@media (max-width: 560px) {
  .page__head { gap: 10px; }
  .filters { gap: 8px; }
  .filters .field { min-width: 100%; }
  .filters .btn { width: 100%; justify-content: center; }
  .form-grid { grid-template-columns: 1fr; }
  table.data th, table.data td { padding: 8px 10px; }
}

/* Wider desktop: the drawer bits never apply. */
@media (min-width: 901px) {
  .topbar__brand, .nav-only-mobile { display: none; }
}

@media print {
  .sidebar, .topbar, .page__actions { display: none; }
  .card { break-inside: avoid; box-shadow: none; }
}

/* ============================================================================
   MOTION & DEPTH LAYER
   Everything below is presentation only — no layout depends on it, so with
   `prefers-reduced-motion: reduce` (handled at the end) the UI is identical,
   just still. Durations stay under 300ms: this is feedback, not decoration.
   ========================================================================= */

:root {
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
  --dur-fast: 140ms;
  --dur: 220ms;
  --dur-slow: 420ms;
}

/* ── Entrance ───────────────────────────────────────────────── */
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
@keyframes fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: none; }
}
@keyframes popIn {
  0%   { opacity: 0; transform: scale(0.94); }
  60%  { opacity: 1; transform: scale(1.01); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes fadeArea {
  from { opacity: 0; }
  to   { opacity: 0.09; }
}
@keyframes shimmer {
  from { background-position: -180% 0; }
  to   { background-position: 180% 0; }
}
@keyframes pulseRing {
  0%   { box-shadow: 0 0 0 0 currentColor; opacity: 0.55; }
  70%  { box-shadow: 0 0 0 7px transparent; opacity: 0; }
  100% { box-shadow: 0 0 0 0 transparent; opacity: 0; }
}
@keyframes drawLine {
  from { stroke-dashoffset: var(--len, 1200); }
  to   { stroke-dashoffset: 0; }
}
@keyframes growWidth {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

/* Cards and tiles rise in, lightly staggered down the page. */
.page > .card,
.page > .ai-panel,
.page > section.card,
.page > .grid > .card,
.page > .grid > section.card,
.page > .grid > .stat {
  animation: rise var(--dur-slow) var(--ease-out) both;
}
.page > .grid > *:nth-child(1) { animation-delay: 0ms; }
.page > .grid > *:nth-child(2) { animation-delay: 45ms; }
.page > .grid > *:nth-child(3) { animation-delay: 90ms; }
.page > .grid > *:nth-child(4) { animation-delay: 135ms; }
.page > .grid > *:nth-child(5) { animation-delay: 180ms; }
.page > .grid > *:nth-child(6) { animation-delay: 215ms; }
.page__head { animation: fade var(--dur) var(--ease-out) both; }

/* ── Surfaces & hover ───────────────────────────────────────── */
.card {
  transition: border-color var(--dur) var(--ease-out),
              box-shadow var(--dur) var(--ease-out),
              transform var(--dur) var(--ease-out);
}
.card:hover {
  border-color: color-mix(in srgb, var(--accent) 26%, var(--border));
  box-shadow: var(--shadow), 0 0 0 1px color-mix(in srgb, var(--accent) 10%, transparent);
}

.stat {
  transition: transform var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow), 0 12px 28px -18px var(--accent); }
/* Sheen that sweeps once on hover. */
.stat::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 38%, var(--sheen) 50%, transparent 62%);
  background-size: 220% 100%; background-position: -180% 0;
}
.stat:hover::after { animation: shimmer 900ms var(--ease-out); }

/* ── Navigation ─────────────────────────────────────────────── */
.sidebar a.navlink {
  transition: background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              padding-left var(--dur) var(--ease-spring);
  animation: slideInLeft 320ms var(--ease-out) both;
}
.sidebar__group a.navlink:nth-child(2) { animation-delay: 20ms; }
.sidebar__group a.navlink:nth-child(3) { animation-delay: 40ms; }
.sidebar__group a.navlink:nth-child(4) { animation-delay: 60ms; }
.sidebar a.navlink:hover { padding-left: 14px; }
.sidebar a.navlink.is-active { animation: none; }
.navlink__icon { transition: transform var(--dur) var(--ease-spring); }
.sidebar a.navlink:hover .navlink__icon { transform: scale(1.18); }
.navlink__count { animation: popIn 360ms var(--ease-spring) both; }
.sidebar__mark { transition: transform var(--dur) var(--ease-spring), box-shadow var(--dur) var(--ease-out); }
.sidebar__brand:hover .sidebar__mark { transform: rotate(-6deg) scale(1.06); }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  position: relative; overflow: hidden;
  transition: background var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur) var(--ease-out);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.985); }
.btn--primary:hover { box-shadow: 0 8px 22px -8px var(--accent-fill); }
/* Click ripple, positioned by app.js. */
.btn .ripple {
  position: absolute; border-radius: 50%; transform: scale(0);
  background: currentColor; opacity: 0.28; pointer-events: none;
  animation: rippleOut 520ms var(--ease-out) forwards;
}
.btn--primary .ripple { background: #fff; opacity: 0.34; }
@keyframes rippleOut { to { transform: scale(2.6); opacity: 0; } }

/* Busy state while a form posts. */
.btn.is-busy { pointer-events: none; color: transparent !important; }
.btn.is-busy::after {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid currentColor; border-top-color: transparent;
  color: #fff; animation: spin 620ms linear infinite;
}
.btn:not(.btn--primary).is-busy::after { color: var(--text); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Inputs ─────────────────────────────────────────────────── */
input, select, textarea {
  transition: border-color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out);
}
.field { position: relative; }
.field label { transition: color var(--dur-fast) var(--ease-out); }
.field:focus-within label { color: var(--accent); }

/* ── Tables & rows ──────────────────────────────────────────── */
table.data tbody tr { transition: background var(--dur-fast) var(--ease-out); }
table.data tbody tr:hover td:first-child { box-shadow: inset 2px 0 0 var(--accent); }
.feed li { transition: background var(--dur-fast) var(--ease-out), padding-left var(--dur) var(--ease-out); }
.feed li:hover { padding-left: 20px; }
.timeline li { animation: fade 360ms var(--ease-out) both; }

/* ── Board ──────────────────────────────────────────────────── */
.board-card { animation: rise 320ms var(--ease-out) both; }
.board-card:hover { box-shadow: 0 10px 24px -14px var(--shadow-pop); }
.board__body { transition: background var(--dur) var(--ease-out); }

/* ── Badges & chips ─────────────────────────────────────────── */
.badge { transition: transform var(--dur-fast) var(--ease-spring); }
tr:hover .badge, li:hover .badge { transform: translateY(-1px); }
.dot--ok, .dot--warn, .dot--off { position: relative; }
.dot--ok::after, .dot--warn::after, .dot--off::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  color: inherit; animation: pulseRing 2.4s var(--ease-out) infinite;
}
.dot--ok::after { color: var(--good); }
.dot--warn::after { color: var(--warning); }
.dot--off::after { color: var(--critical); }

/* ── Charts ─────────────────────────────────────────────────── */
/* Lines draw themselves in; areas and bars grow from the baseline.
   The dash trick needs the real path length, which only JS can measure — so the
   animation is opt-in via .is-drawing. Without JS the line is simply solid. */
.ch-line.is-drawing {
  stroke-dasharray: var(--len);
  animation: drawLine 1100ms var(--ease-out) both;
}
.ch-area { animation: fadeArea 900ms var(--ease-out) 260ms both; }
.ch-end, .ch-endlabel { animation: popIn 380ms var(--ease-spring) 950ms both; }
.barlist__bar { transform-origin: left center; animation: growWidth 620ms var(--ease-out) both; }
.barlist li:nth-child(2) .barlist__bar { animation-delay: 60ms; }
.barlist li:nth-child(3) .barlist__bar { animation-delay: 120ms; }
.barlist li:nth-child(4) .barlist__bar { animation-delay: 180ms; }
.barlist li:nth-child(5) .barlist__bar { animation-delay: 240ms; }
.barlist li:nth-child(6) .barlist__bar { animation-delay: 300ms; }
.barlist li:nth-child(7) .barlist__bar { animation-delay: 360ms; }
.barlist li { transition: transform var(--dur-fast) var(--ease-out); }
.barlist li:hover { transform: translateX(2px); }
.ring__value { animation: fade 500ms var(--ease-out) both; }
.tl__fill { transform-origin: left center; animation: growWidth 700ms var(--ease-out) 160ms both; }
.tl__bar { transition: box-shadow var(--dur) var(--ease-out), transform var(--dur) var(--ease-out); }
.tl__bar:hover { transform: translateY(-1px); box-shadow: 0 6px 16px -8px var(--shadow-pop); }

/* ── AI panel: living accent ────────────────────────────────── */
.ai-panel::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, color-mix(in srgb, var(--accent) 9%, transparent) 50%, transparent 70%);
  background-size: 260% 100%;
  animation: shimmer 7s linear infinite;
}
.ai-panel > * { position: relative; }
.ai-chip { position: relative; overflow: hidden; }
.ai-chip::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 35%, rgba(255,255,255,0.4) 50%, transparent 65%);
  background-size: 250% 100%;
  animation: shimmer 3.4s linear infinite;
}

/* ── Alerts ─────────────────────────────────────────────────── */
.alert { animation: rise 320ms var(--ease-out) both; }

/* ── Progress ───────────────────────────────────────────────── */
.progress__bar { transform-origin: left center; animation: growWidth 640ms var(--ease-out) both; }

/* ── Reduced motion: keep every end-state, drop the movement ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .ch-line { stroke-dasharray: none; }
}

/* ============================================================================
   AUTH SPLIT LAYOUT
   A branded panel beside the form. The decoration is pure CSS — gradients and
   transforms, no images — so it costs nothing to load and cannot trip the CSP.
   ========================================================================= */
.auth {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  min-height: calc(100dvh - 58px);
}

.auth__brand {
  position: relative;
  overflow: hidden;
  padding: 46px 46px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--sidebar);
  color: #eef2f8;
  isolation: isolate;
}
/* Engineering-drawing grid, drifting slowly. */
.auth__brand::before {
  content: "";
  position: absolute; inset: -50%;
  background-image:
    linear-gradient(rgba(226, 130, 133, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(226, 130, 133, 0.08) 1px, transparent 1px);
  background-size: 46px 46px;
  transform: rotate(-1.5deg);
  animation: gridDrift 26s linear infinite;
  z-index: -2;
}
/* Two slow-moving colour fields for depth. */
.auth__brand::after {
  content: "";
  position: absolute; inset: -30%;
  background:
    radial-gradient(38% 38% at 22% 28%, rgba(226, 88, 93, 0.30), transparent 70%),
    radial-gradient(34% 34% at 78% 72%, rgba(140, 25, 29, 0.34), transparent 70%);
  filter: blur(14px);
  animation: orbFloat 20s ease-in-out infinite alternate;
  z-index: -1;
}
@keyframes gridDrift { to { background-position: 46px 46px; } }
@keyframes orbFloat {
  from { transform: translate3d(-2%, -1%, 0) scale(1); }
  to   { transform: translate3d(3%, 2%, 0) scale(1.06); }
}

.auth__logo { display: flex; align-items: center; gap: 12px; margin-bottom: 30px; }
.auth__logo .sidebar__mark { width: 40px; height: 40px; border-radius: 11px; font-size: 17px; }
.auth__logo b { font-size: 21px; font-weight: 700; letter-spacing: -0.02em; }
.auth__logo small {
  display: block; font-size: 10.5px; letter-spacing: 0.1em;
  text-transform: uppercase; color: #8b98b0; font-weight: 600;
}

.auth__title { font-size: 30px; line-height: 1.2; margin: 0 0 12px; letter-spacing: -0.03em; max-width: 16ch; }
.auth__title em { font-style: normal; background: linear-gradient(100deg, #f08a8e, #d1454a);
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth__lead { margin: 0 0 26px; color: #a9b6cc; font-size: 15px; max-width: 44ch; line-height: 1.6; }

.auth__points { list-style: none; margin: 0 0 30px; padding: 0; display: grid; gap: 11px; max-width: 46ch; }
.auth__points li { display: flex; gap: 11px; align-items: flex-start; font-size: 14px; color: #c6d0e0; }
.auth__points i {
  flex: none; width: 22px; height: 22px; border-radius: 7px; font-style: normal;
  display: grid; place-items: center; font-size: 11px;
  background: rgba(226, 88, 93, 0.16); color: #ef9497;
}

/* Live status strip — reads as instrumentation, not decoration. */
.auth__status {
  display: flex; gap: 16px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 11.5px; color: #8b98b0;
  padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.auth__status span { display: inline-flex; align-items: center; gap: 6px; }

.auth__form {
  display: flex; align-items: center; justify-content: center;
  padding: 40px 24px; background: var(--plane);
}
.auth__form-inner { width: 100%; max-width: 380px; }

@media (max-width: 940px) {
  .auth { grid-template-columns: 1fr; min-height: 0; }
  .auth__brand { padding: 30px 20px; }
  .auth__title { font-size: 24px; max-width: none; }
  .auth__lead { margin-bottom: 18px; }
  .auth__points { display: none; }        /* keep the fold short on a phone */
  .auth__status { padding-top: 14px; }
  .auth__form { padding: 26px 16px 40px; }
}

/* Auth screens run full-bleed: no sidebar, just a slim bar. */
.app__main--auth { width: 100%; }
.topbar--auth { background: transparent; border-bottom: 0; backdrop-filter: none; }
.topbar--auth .topbar__brand { display: flex !important; }
.app__main--auth ~ .sidebar, .app__main--auth ~ .scrim { display: none; }

/* ── Dashboard system rail ───────────────────────────────────
   Instrumentation for the operator: what the app itself is doing right now.
   Monospace on purpose — it should read as telemetry, not as marketing. */
.sysrail {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 9px 14px; margin-bottom: 16px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(100deg, color-mix(in srgb, var(--accent) 26%, transparent), transparent 60%) border-box;
  font-family: var(--mono); font-size: 11.5px; color: var(--text-2);
  position: relative; overflow: hidden;
}
.sysrail::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(color-mix(in srgb, var(--accent) 7%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--accent) 7%, transparent) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(90deg, rgba(0,0,0,.5), transparent 55%);
  -webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,.5), transparent 55%);
}
.sysrail > * { position: relative; }
.sysrail__item { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.sysrail__sep { color: var(--border); }
.sysrail__k { color: var(--muted); }
.sysrail__v { color: var(--text); font-weight: 600; }
.sysrail__spacer { flex: 1 1 auto; min-width: 8px; }
@media (max-width: 700px) {
  .sysrail { font-size: 11px; gap: 6px 10px; }
  .sysrail__sep, .sysrail__spacer { display: none; }
}
