/* SPOC Control Room: tokens, layout and components.

   Brand: SPOC Style Guide 2026 (spoc-company_website app/globals.css): charcoal #323232, navy
   #1a263b, cool white #f0f1f4, surface #dfe0dc, orange #ff6c00 (the accent, used sparingly),
   soft orange #f79d54, sage #71a090, green #4f8875, small orange text #a34100; plus critical
   #d64545 and amber #c98a00 for states. Satoshi with a system fallback.
   Both themes are designed, not inverted: the dark theme is built on the brand navy, with its
   own steps of every colour (chart series validated for colour-blind separation per theme).
   Tokens live on :root; dark applies with data-theme="dark", or with the system setting when no
   theme is forced (data-theme absent). Charts read the same tokens (components/colors.js). */

@font-face { font-family: "Satoshi"; src: url("fonts/Satoshi-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Satoshi"; src: url("fonts/Satoshi-Medium.woff2") format("woff2"); font-weight: 500 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Satoshi"; src: url("fonts/Satoshi-Bold.woff2") format("woff2"); font-weight: 700 900; font-style: normal; font-display: swap; }

/* ───────── tokens: light ───────── */
:root {
  color-scheme: light;
  --font-ui: Satoshi, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --orange: #ff6c00; --navy: #1a263b; --charcoal: #323232; --cool-white: #f0f1f4;

  --bg: #f0f1f4;
  --panel: #ffffff;
  --panel-2: #f7f8f9;
  --panel-3: #eceef1;
  --nav-bg: #f0f1f4;
  --nav-hover: #e6e8ec;
  --nav-active: #ffffff;
  --line: #dfe0dc;
  --line-soft: #ecedeb;
  --line-strong: rgba(50, 50, 50, 0.28);

  --text: #323232;
  --text-2: #5b5f68;
  --text-3: #80848d;
  --accent: #ff6c00;
  --accent-text: #a34100;
  --focus: #ff6c00;

  --ok: #4f8875; --warn: #c98a00; --high: #e0612b; --crit: #d64545; --info: #4a6fa5;
  --muted-mark: #a7abb2; --neutral-mark: #8a8f98;
  --ok-text: #2e6b58;      --ok-bg: #e3efe9;
  --warn-text: #7a5200;    --warn-bg: #faf0d6;
  --crit-text: #ad2f2f;    --crit-bg: #fbe5e5;
  --info-text: #2b4c7e;    --info-bg: #e5ebf5;
  --neutral-text: #4b4f58; --neutral-bg: #eceef2;
  --muted-text: #80848d;   --muted-bg: #f1f2f4;
  --pos: #2b7a5e; --neg: #bf3535;

  /* chart series (brand order, stepped to pass the palette checks on white) */
  --s1: #f76614; --s2: #29548d; --s3: #3fa486; --s4: #897dc4; --s5: #b6900a; --s6: #598fd9; --s7: #7e2e59; --s8: #179696;
  --s-other: #6b6f73;
  --chart-grid: #eef0f2; --chart-axis: #80848d; --chart-ink: #323232;
  --chart-band: rgba(41, 84, 141, 0.065); --chart-select: rgba(41, 84, 141, 0.08); --chart-cursor: rgba(50, 50, 50, 0.32);
  --mk-deploy: #5b5f68; --mk-note: #29548d;
  --spark: #9aa0a8; --spark-fill: rgba(154, 160, 168, 0.13); --spark-dot: #ff6c00;
  --bar: #344a72;
  --heat-lo: #fbefe5; --heat-hi: #c25100; --heat-zero: #f5f6f7;
  --ret-lo: #edf1f7; --ret-hi: #29548d; --ret-hot-text: #ffffff;

  --tip-bg: #1a263b; --tip-text: #f0f1f4; --tip-dim: #a9b3c6; --tip-line: rgba(240, 241, 244, 0.12);
  --shadow-pop: 0 10px 28px rgba(26, 38, 59, 0.14), 0 1px 3px rgba(26, 38, 59, 0.08);
  --shadow-seg: 0 1px 2px rgba(26, 38, 59, 0.10), 0 0 0 1px rgba(26, 38, 59, 0.06);
  --mark-bg: #323232;
  --scrim: rgba(11, 16, 25, 0.38);
  --primary-bg: #323232; --primary-text: #f0f1f4; --primary-hover: #1a263b;
  --scroll-shadow: rgba(26, 38, 59, 0.16);

  --radius: 8px; --radius-sm: 6px;
  --topbar-h: 52px; --nav-w: 220px; --nav-w-collapsed: 56px;
  --sticky-top: var(--topbar-h);      /* sticky table headers sit under the sticky top bar */
}

/* ───────── tokens: dark (the brand navy as the ground) ───────── */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b1019; --panel: #111826; --panel-2: #151d2c; --panel-3: #1c2537;
    --nav-bg: #0b1019; --nav-hover: #151d2b; --nav-active: #182132;
    --line: #222c3d; --line-soft: #1a2333; --line-strong: rgba(232, 234, 239, 0.22);
    --text: #e8eaef; --text-2: #a7afbd; --text-3: #7b8597;
    --accent: #ff7a1a; --accent-text: #ff9a52; --focus: #ff8a33;
    --ok: #5fae93; --warn: #e0a526; --high: #f07a45; --crit: #ec6a6a; --info: #7f9fd6;
    --muted-mark: #5c6678; --neutral-mark: #7b8597;
    --ok-text: #86cdb3;      --ok-bg: rgba(95, 174, 147, 0.14);
    --warn-text: #f2c55c;    --warn-bg: rgba(224, 165, 38, 0.13);
    --crit-text: #f5a3a3;    --crit-bg: rgba(236, 106, 106, 0.14);
    --info-text: #a9c1ec;    --info-bg: rgba(127, 159, 214, 0.14);
    --neutral-text: #c3c8d2; --neutral-bg: rgba(195, 200, 210, 0.09);
    --muted-text: #7b8597;   --muted-bg: rgba(123, 133, 151, 0.10);
    --pos: #6cc4a0; --neg: #f08484;
    --s1: #ed6300; --s2: #486aab; --s3: #40a587; --s4: #887bc5; --s5: #b38f18; --s6: #5497d9; --s7: #9b467a; --s8: #10a49e;
    --s-other: #65696f;
    --chart-grid: #1b2433; --chart-axis: #7b8597; --chart-ink: #e8eaef;
    --chart-band: rgba(169, 193, 236, 0.085); --chart-select: rgba(169, 193, 236, 0.10); --chart-cursor: rgba(232, 234, 239, 0.32);
    --mk-deploy: #8d97a8; --mk-note: #7f9fd6;
    --spark: #6d7789; --spark-fill: rgba(109, 119, 137, 0.16); --spark-dot: #ff7a1a;
    --bar: #7f9ccf;
    --heat-lo: #1b2130; --heat-hi: #ff8a33; --heat-zero: #141b28;
    --ret-lo: #172032; --ret-hi: #7aa0e0; --ret-hot-text: #0b1019;
    --tip-bg: #1f2a3e; --tip-text: #e8eaef; --tip-dim: #a7afbd; --tip-line: rgba(255, 255, 255, 0.08);
    --shadow-pop: 0 12px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
    --shadow-seg: 0 1px 2px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.06);
    --mark-bg: #1f2a3e;
    --scrim: rgba(0, 0, 0, 0.55);
    --primary-bg: #e8eaef; --primary-text: #0b1019; --primary-hover: #ffffff;
    --scroll-shadow: rgba(0, 0, 0, 0.55);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1019; --panel: #111826; --panel-2: #151d2c; --panel-3: #1c2537;
  --nav-bg: #0b1019; --nav-hover: #151d2b; --nav-active: #182132;
  --line: #222c3d; --line-soft: #1a2333; --line-strong: rgba(232, 234, 239, 0.22);
  --text: #e8eaef; --text-2: #a7afbd; --text-3: #7b8597;
  --accent: #ff7a1a; --accent-text: #ff9a52; --focus: #ff8a33;
  --ok: #5fae93; --warn: #e0a526; --high: #f07a45; --crit: #ec6a6a; --info: #7f9fd6;
  --muted-mark: #5c6678; --neutral-mark: #7b8597;
  --ok-text: #86cdb3;      --ok-bg: rgba(95, 174, 147, 0.14);
  --warn-text: #f2c55c;    --warn-bg: rgba(224, 165, 38, 0.13);
  --crit-text: #f5a3a3;    --crit-bg: rgba(236, 106, 106, 0.14);
  --info-text: #a9c1ec;    --info-bg: rgba(127, 159, 214, 0.14);
  --neutral-text: #c3c8d2; --neutral-bg: rgba(195, 200, 210, 0.09);
  --muted-text: #7b8597;   --muted-bg: rgba(123, 133, 151, 0.10);
  --pos: #6cc4a0; --neg: #f08484;
  --s1: #ed6300; --s2: #486aab; --s3: #40a587; --s4: #887bc5; --s5: #b38f18; --s6: #5497d9; --s7: #9b467a; --s8: #10a49e;
  --s-other: #65696f;
  --chart-grid: #1b2433; --chart-axis: #7b8597; --chart-ink: #e8eaef;
  --chart-band: rgba(169, 193, 236, 0.085); --chart-select: rgba(169, 193, 236, 0.10); --chart-cursor: rgba(232, 234, 239, 0.32);
  --mk-deploy: #8d97a8; --mk-note: #7f9fd6;
  --spark: #6d7789; --spark-fill: rgba(109, 119, 137, 0.16); --spark-dot: #ff7a1a;
  --bar: #7f9ccf;
  --heat-lo: #1b2130; --heat-hi: #ff8a33; --heat-zero: #141b28;
  --ret-lo: #172032; --ret-hi: #7aa0e0; --ret-hot-text: #0b1019;
  --tip-bg: #1f2a3e; --tip-text: #e8eaef; --tip-dim: #a7afbd; --tip-line: rgba(255, 255, 255, 0.08);
  --shadow-pop: 0 12px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
  --shadow-seg: 0 1px 2px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.06);
  --mark-bg: #1f2a3e;
  --scrim: rgba(0, 0, 0, 0.55);
  --primary-bg: #e8eaef; --primary-text: #0b1019; --primary-hover: #ffffff;
  --scroll-shadow: rgba(0, 0, 0, 0.55);
}

/* ───────── base ───────── */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font: 400 13px/1.45 var(--font-ui); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "kern" 1;
}
h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
code, kbd { font-family: var(--font-mono); }
svg { flex: none; }
::selection { background: var(--orange); color: #fff; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px; }
.skip-link { position: absolute; left: 12px; top: 8px; z-index: 100; background: var(--panel); color: var(--text); padding: 8px 12px; border-radius: 6px; transform: translateY(-200%); }
.skip-link:focus { transform: none; box-shadow: var(--shadow-pop); }
.noscript { padding: 40px; text-align: center; }
.num, .tabnum { font-variant-numeric: tabular-nums; }

/* ───────── shell ───────── */
.app { display: grid; grid-template-columns: var(--nav-w) minmax(0, 1fr); min-height: 100vh; }
body.nav-collapsed .app, html.pre-collapsed .app { grid-template-columns: var(--nav-w-collapsed) minmax(0, 1fr); }
.main-col { min-width: 0; display: flex; flex-direction: column; }
.main { flex: 1; width: 100%; max-width: 1760px; margin: 0 auto; padding: 18px 24px 48px; outline: none; }
.scrim { display: none; }

/* navigation */
.nav { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--nav-bg); border-right: 1px solid var(--line); z-index: 30; min-width: 0; }
.nav-top { height: var(--topbar-h); display: flex; align-items: center; padding: 0 14px; flex: none; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; border-radius: 7px; }
.mark { display: block; }
.mark-bg { fill: var(--mark-bg); }
.mark-arc { fill: #f0f1f4; }
.mark-person { fill: #ff6c00; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.brand-name { font-weight: 700; font-size: 13.5px; letter-spacing: 0.04em; }
.brand-sub { font-size: 12px; color: var(--text-2); font-weight: 500; }
.nav-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 6px 8px 10px; scrollbar-width: thin; }
.nav-list, .nav-sub { list-style: none; margin: 0; padding: 0; }
.nav-list { display: grid; gap: 1px; }
.nav-item, .nav-subitem {
  position: relative; display: flex; align-items: center; gap: 10px; border-radius: 6px; color: var(--text-2);
  white-space: nowrap; transition: background-color .12s, color .12s;
}
.nav-item { height: 32px; padding: 0 9px; font-weight: 500; font-size: 13px; }
.nav-item .icon { color: var(--text-3); transition: color .12s; }
.nav-item:hover, .nav-subitem:hover { background: var(--nav-hover); color: var(--text); }
.nav-item:hover .icon { color: var(--text-2); }
.nav-item.active { background: var(--nav-active); color: var(--text); box-shadow: var(--shadow-seg); }
.nav-item.active .icon { color: var(--text); }
.nav-item.active::before { content: ""; position: absolute; left: -8px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav-label { overflow: hidden; text-overflow: ellipsis; }
.nav-end { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; }
.nav-sub { margin: 1px 0 5px; padding-left: 28px; display: grid; gap: 0; position: relative; }
.nav-sub::before { content: ""; position: absolute; left: 17px; top: 3px; bottom: 3px; width: 1px; background: var(--line); }
.nav-subitem { height: 26px; padding: 0 9px; font-size: 12.5px; color: var(--text-3); font-weight: 500; }
.nav-subitem.active { color: var(--text); background: var(--nav-active); box-shadow: var(--shadow-seg); }
.nav-badge { min-width: 19px; height: 18px; padding: 0 6px; border-radius: 9px; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums; }
.nav-badge.tone-crit { background: var(--crit); color: #fff; }
.nav-badge.tone-warn { background: var(--warn); color: #1f1600; }
.nav-badge.tone-info { background: var(--panel-3); color: var(--text-2); }
.nav-st { display: inline-flex; }
.nav-bottom { flex: none; padding: 8px; border-top: 1px solid var(--line); }
.nav-collapse { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 10px; width: 100%; height: 30px; padding: 0 9px; border-radius: 6px; color: var(--text-3); cursor: pointer; font-size: 12.5px; font-weight: 500; }
.nav-collapse:hover { background: var(--nav-hover); color: var(--text); }
.nav-collapse:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
body.nav-collapsed .nav-label, body.nav-collapsed .brand-text, body.nav-collapsed .nav-sub,
html.pre-collapsed .nav-label, html.pre-collapsed .brand-text, html.pre-collapsed .nav-sub { display: none; }
body.nav-collapsed .nav-top { padding: 0 15px; }
body.nav-collapsed .nav-item { justify-content: center; padding: 0; }
body.nav-collapsed .nav-item .nav-end { position: absolute; top: 2px; right: 2px; }
body.nav-collapsed .nav-badge { min-width: 15px; height: 15px; line-height: 15px; font-size: 9.5px; padding: 0 4px; }
body.nav-collapsed .nav-collapse { justify-content: center; padding: 0; }

/* top bar */
.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--topbar-h); display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 0 24px; background: color-mix(in srgb, var(--bg) 90%, transparent); border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(1.5) blur(12px); backdrop-filter: saturate(1.5) blur(12px);
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar .topbar-menu { display: none; }
.range-wrap { position: relative; }
.seg { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border-radius: 8px; background: var(--panel-3); }
.seg-btn {
  all: unset; box-sizing: border-box; display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 6px;
  font-size: 12.5px; font-weight: 500; color: var(--text-2); cursor: pointer; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.seg-btn:hover { color: var(--text); }
.seg-btn[aria-pressed="true"] { background: var(--panel); color: var(--text); box-shadow: var(--shadow-seg); }
.seg-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.seg-custom .icon { color: var(--text-3); }
.env-dot { width: 7px; height: 7px; border-radius: 50%; }
.env-prod { background: var(--accent); }
.env-qa { background: var(--info); }

.search {
  position: relative; display: flex; align-items: center; gap: 7px; width: 248px; height: 30px; padding: 0 6px 0 9px; border-radius: 7px;
  background: var(--panel); border: 1px solid var(--line); color: var(--text-3); transition: border-color .12s, box-shadow .12s;
}
.search:focus-within { border-color: color-mix(in srgb, var(--accent) 70%, var(--line)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.search-input { all: unset; flex: 1; min-width: 0; font-size: 12.5px; color: var(--text); }
.search-input::placeholder { color: var(--text-3); }
.search-input::-webkit-search-cancel-button { display: none; }
.search-kbd { font-size: 10.5px; font-weight: 500; color: var(--text-3); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; line-height: 15px; }
.search-list {
  position: absolute; top: calc(100% + 6px); left: -1px; right: -1px; z-index: 40; max-height: 380px; overflow-y: auto; margin: 0; padding: 4px; list-style: none;
  background: var(--panel); border: 1px solid var(--line); border-radius: 9px; box-shadow: var(--shadow-pop);
}
.search-item { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 7px 9px; border-radius: 6px; cursor: pointer; }
.search-item.active { background: var(--panel-3); }
.search-name { color: var(--text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-meta { color: var(--text-3); font-size: 11.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.search-empty { padding: 10px; color: var(--text-3); font-size: 12px; }

.fresh { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 9px; border-radius: 7px; font-size: 12px; font-weight: 500; color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.fresh:hover { background: var(--panel-3); color: var(--text); }
.fresh-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 22%, transparent); }
.fresh-warn .fresh-dot { background: var(--warn); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 25%, transparent); }
.fresh-warn .fresh-text { color: var(--warn-text); }
.fresh-crit .fresh-dot { background: var(--crit); box-shadow: 0 0 0 3px color-mix(in srgb, var(--crit) 22%, transparent); }
.fresh-crit .fresh-text { color: var(--crit-text); }
.busy { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--text-3); opacity: 0; transition: opacity .2s; }
.busy.on { opacity: 1; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.btn-icon { all: unset; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 7px; color: var(--text-2); cursor: pointer; }
.btn-icon:hover { background: var(--panel-3); color: var(--text); }
.btn-icon[aria-pressed="true"] { background: var(--panel-3); color: var(--text); }
.btn-icon:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.btn { all: unset; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 7px; font-size: 12.5px; font-weight: 500; cursor: pointer; background: var(--panel); border: 1px solid var(--line); color: var(--text); }
.btn:hover { border-color: var(--line-strong); }
.btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.btn-primary { background: var(--primary-bg); border-color: var(--primary-bg); color: var(--primary-text); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-sm { height: 28px; padding: 0 11px; }
.btn-xs { height: 24px; padding: 0 8px; font-size: 11.5px; border-radius: 6px; }
.btn-ghost { all: unset; box-sizing: border-box; display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px; border-radius: 6px; font-size: 11.5px; font-weight: 500; color: var(--text-2); cursor: pointer; }
.btn-ghost:hover { background: var(--panel-3); color: var(--text); }
.btn-ghost:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.chip-btn { all: unset; box-sizing: border-box; height: 24px; padding: 0 9px; border-radius: 12px; border: 1px solid var(--line); font-size: 11.5px; font-weight: 500; color: var(--text-2); cursor: pointer; }
.chip-btn:hover { color: var(--text); border-color: var(--line-strong); }
.chip-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }

/* custom range popover */
.pop {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 45; width: 300px; padding: 14px; border-radius: 10px; display: grid; gap: 12px;
  background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow-pop);
}
.pop-title { font-weight: 600; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.pop-sub { font-weight: 400; color: var(--text-3); font-size: 11.5px; }
.pop-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.pop-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pop-row label { display: grid; gap: 4px; font-size: 11.5px; color: var(--text-2); font-weight: 500; }
.date-input { font: inherit; font-size: 12.5px; height: 30px; padding: 0 8px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel); color: var(--text); color-scheme: inherit; font-variant-numeric: tabular-nums; }
.date-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.pop-err { color: var(--crit-text); font-size: 12px; min-height: 0; }
.pop-err:empty { display: none; }
.pop-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* banners */
.banners:empty { display: none; }
.banner { border-bottom: 1px solid var(--line); font-size: 12.5px; }
.banner-row { display: flex; align-items: flex-start; gap: 9px; max-width: 1760px; margin: 0 auto; padding: 7px 24px; }
.banner-row > .icon { margin-top: 2px; }
.banner-body { flex: 1; min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; line-height: 1.45; }
.banner-paused { background: var(--warn-bg); color: var(--warn-text); }
.banner-paused b { font-weight: 600; }
.banner-error { background: var(--panel); color: var(--text-2); box-shadow: inset 3px 0 0 var(--crit); }
.banner-error .banner-row > .icon { color: var(--crit); }
.banner .cmd { background: color-mix(in srgb, var(--panel) 75%, transparent); }

/* commands */
.cmd { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; padding: 0 2px 0 7px; border-radius: 5px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); font-family: var(--font-mono); font-size: 11.5px; line-height: 20px; vertical-align: baseline; }
.cmd code { font: inherit; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; user-select: all; }
.copy-btn { all: unset; display: inline-flex; padding: 3px; border-radius: 4px; color: var(--text-3); cursor: pointer; }
.copy-btn:hover { color: var(--text); background: var(--panel-3); }
.copy-btn.copied { color: var(--ok-text); }
.copy-btn:focus-visible { outline: 2px solid var(--focus); }
p code, li code, .panel-note code, .sec-note code { font-size: 0.92em; padding: 0 4px; border-radius: 4px; background: var(--panel-3); }

/* ───────── page ───────── */
.main.is-loading .page { opacity: .55; transition: opacity .18s ease .1s; }
.page-top { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-bottom: 4px; }
.page-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px; }
.ph-back { display: inline-flex; align-items: center; gap: 2px; width: max-content; margin: -2px 0 4px -3px; font-size: 12px; font-weight: 500; color: var(--text-3); border-radius: 5px; padding: 1px 4px 1px 1px; }
.ph-back:hover { color: var(--text); }
.ph-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-height: 28px; }
.ph-title { font-size: 21px; line-height: 1.2; font-weight: 700; letter-spacing: -0.015em; }
.ph-sub { color: var(--text-2); font-size: 12.5px; }
.ph-health { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ph-health-text { color: var(--text-2); font-size: 12.5px; }
.ph-facts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ph-fact { font-size: 12px; color: var(--text-2); padding: 0 8px; height: 20px; line-height: 20px; border-radius: 10px; background: var(--panel-3); }
.ph-report { display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.ph-report-label { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; color: var(--text-2); }

.tabs { display: flex; gap: 2px; margin-top: 12px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tab { display: inline-flex; align-items: center; gap: 6px; padding: 8px 11px 9px; margin-bottom: -1px; font-weight: 500; color: var(--text-2); border-bottom: 2px solid transparent; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }

.gaps { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); font-size: 12.5px; color: var(--text-2); }
.gaps summary { display: flex; align-items: center; gap: 8px; padding: 8px 12px; cursor: pointer; list-style: none; }
.gaps summary::-webkit-details-marker { display: none; }
.gaps summary .icon { color: var(--text-3); }
.gaps-sum { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gaps-first { color: var(--text-3); }
.gaps-more { font-size: 11.5px; font-weight: 500; color: var(--text-3); }
.gaps[open] .gaps-first { display: none; }
.gaps[open] .gaps-more { visibility: hidden; }
.gaps ul { margin: 0; padding: 0 12px 10px 33px; display: grid; gap: 4px; line-height: 1.5; }

.sec { margin-top: 22px; }
.sec-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 9px; }
.sec-title { font-size: 14px; font-weight: 700; letter-spacing: -0.005em; color: var(--text); }
.sec-note { font-size: 12px; color: var(--text-3); }

.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px; align-items: stretch; }
.panel {
  grid-column: span var(--w, 12); min-width: 0; display: flex; flex-direction: column; container-type: inline-size;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 14px 12px;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 22px; margin-bottom: 8px; }
.panel-head.no-title { justify-content: flex-end; }
.panel-title { font-size: 13px; font-weight: 600; line-height: 1.3; color: var(--text); min-width: 0; }
.panel-actions { display: flex; align-items: center; gap: 4px; flex: none; margin: -3px -6px -3px 0; }
.panel-body { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.panel-note { margin-top: auto; padding-top: 9px; font-size: 11.5px; line-height: 1.45; color: var(--text-3); }
.panel-note:empty { display: none; }

/* KPI tiles: one panel, tiles split by hairlines */
.p-kpis { padding: 0; overflow: hidden; }
.p-kpis .panel-head { padding: 11px 14px 0; margin-bottom: 0; }
.p-kpis .panel-note { padding: 0 14px 10px; }
.kpi-grid { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); margin: -1px 0 0 -1px; }
.kpi { position: relative; display: flex; flex-direction: column; min-width: 0; padding: 12px 14px 11px; border-left: 1px solid var(--line-soft); border-top: 1px solid var(--line-soft); }
.kpi-drill { cursor: pointer; transition: background-color .12s; }
.kpi-drill:hover { background: var(--panel-2); }
.kpi-drill:focus-visible { outline-offset: -2px; border-radius: 0; }
.kpi-top { display: flex; align-items: center; gap: 6px; min-height: 18px; }
.kpi-label { flex: 1; min-width: 0; font-size: 12px; font-weight: 500; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi-flags { display: inline-flex; align-items: center; gap: 4px; }
.kpi-grid.two-line .kpi-top { align-items: flex-start; }
.kpi-grid.two-line .kpi-label { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-height: 16px; min-height: 32px; }
.kpi-anom { display: inline-flex; padding: 2px; border-radius: 4px; }
.kpi-chip { display: inline-flex; align-items: center; gap: 3px; height: 17px; padding: 0 6px; border-radius: 9px; font-size: 10.5px; font-weight: 600; background: var(--warn-bg); color: var(--warn-text); }
.kpi-main { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 9px; margin-top: 3px; }
.kpi-value { display: inline-flex; align-items: baseline; min-width: 0; }
.kpi-num { font-size: 23px; line-height: 1.15; font-weight: 500; letter-spacing: -0.02em; color: var(--text); white-space: nowrap; }
.kpi-unit { margin-left: 3px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.kpi-unit.tight { margin-left: 1px; }
.kpi-missing .kpi-num { color: var(--text-3); font-weight: 400; }
.kpi-delta { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi-delta.pos, .delta.pos { color: var(--pos); }
.kpi-delta.neg, .delta.neg { color: var(--neg); }
.kpi-delta.flat, .delta.flat { color: var(--text-3); }
.delta-arrow { fill: currentColor; }
.kpi-spark { height: 26px; margin-top: 7px; }
.kpi-grid.no-sparks .kpi-spark-empty { display: none; }
.kpi-grid.no-sparks .kpi-foot { margin-top: 8px; }
.kpi-foot { margin-top: 6px; font-size: 11px; line-height: 1.4; color: var(--text-3); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.kpi-compare { color: var(--text-2); }
.kpi-compare + .kpi-note::before { content: " · "; }
.kpi-needs { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); font-weight: 500; }
.kpi-needs .icon { color: var(--text-3); }

/* sparklines */
.spark { display: block; width: 100%; height: 100%; overflow: visible; }
.spark-line { fill: none; stroke: var(--spark); stroke-width: 1.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.spark-area { fill: var(--spark-fill); stroke: none; }
.spark-dot { stroke: var(--spark-dot); stroke-width: 5; stroke-linecap: round; vector-effect: non-scaling-stroke; fill: none; }
.spark-cursor { stroke: var(--text); stroke-width: 6; stroke-linecap: round; vector-effect: non-scaling-stroke; fill: none; }
.spark-base { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; stroke-dasharray: 2 3; }
.spark-cell { width: 96px; height: 20px; }

/* charts */
.ts-legend { display: flex; flex-wrap: wrap; gap: 3px 14px; margin: -3px 0 7px; min-height: 16px; }
.lg-item { all: unset; display: inline-flex; align-items: center; gap: 6px; max-width: 240px; font-size: 11.5px; font-weight: 500; color: var(--text-2); cursor: pointer; line-height: 16px; border-radius: 3px; }
.lg-item > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg-item:hover { color: var(--text); }
.lg-item.off { opacity: .42; }
.lg-item:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.lg-static { cursor: default; color: var(--text-3); }
.lg-static:hover { color: var(--text-3); }
.lg-key, .tt-key { flex: none; display: inline-block; }
.key-line { width: 12px; height: 2.5px; border-radius: 2px; background: var(--c); }
.key-box { width: 9px; height: 9px; border-radius: 2px; background: var(--c); }
.key-band { width: 12px; height: 9px; border-radius: 2px; background: var(--chart-band); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text-3) 25%, transparent); }
.key-mark { width: 2px; height: 11px; border-radius: 1px; background: var(--mk-deploy); }
.key-mark.mk-deploy_failed, .key-mark.mk-incident { background: var(--crit); }
.key-mark.mk-note { background: var(--mk-note); }
.key-mark.mk-anomaly { background: var(--warn); }
.ts-plot { position: relative; min-width: 0; }
.ts-zero { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none;
  font-size: 12px; font-weight: 500; color: var(--text-3); }
.ts-table { max-height: 300px; margin: 0 -14px; }
.scroll-y { overflow: auto; }
.uplot { font-family: var(--font-ui); width: 100%; }
.u-select { background: var(--chart-select); }
.u-cursor-x { border-right: 1px solid var(--chart-cursor) !important; }
.u-cursor-pt { box-shadow: 0 0 0 1px color-mix(in srgb, var(--text) 15%, transparent); }
.u-over { cursor: crosshair; }

/* tooltip */
.tip {
  position: fixed; left: 0; top: 0; z-index: 1000; max-width: 300px; padding: 7px 10px; border-radius: 7px; pointer-events: none;
  background: var(--tip-bg); color: var(--tip-text); font-size: 12px; line-height: 1.4; box-shadow: var(--shadow-pop); will-change: transform;
}
.tip-wide { max-width: 420px; }
.tt { display: grid; gap: 2px; min-width: 150px; }
.tt-head { font-size: 11px; color: var(--tip-dim); margin-bottom: 3px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tt-row { display: grid; grid-template-columns: 12px auto minmax(0, 1fr); align-items: center; gap: 7px; }
.tt-val { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.tt-lab { color: var(--tip-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tt-total { border-top: 1px solid var(--tip-line); margin-top: 3px; padding-top: 3px; }
.tt-band .tt-lab { white-space: normal; grid-column: 2 / -1; }
.tt-ev { display: flex; gap: 7px; align-items: baseline; margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--tip-line); color: var(--tip-dim); }
.tt-ev b { color: var(--tip-text); font-weight: 600; }
.tt-mark { flex: none; width: 2px; height: 10px; background: var(--mk-deploy); border-radius: 1px; transform: translateY(1px); }
.tt-mark.mk-deploy { background: #c3c8d2; }
.tt-mark.mk-deploy_failed, .tt-mark.mk-incident { background: var(--crit); }
.tt-mark.mk-note { background: #a9c1ec; }
.tt-mark.mk-anomaly { background: var(--warn); }

/* tables */
.tbl-wrap {
  margin: 0 -14px; overflow-x: auto;
  /* scroll shadows: a hint that a wide table has more columns to the side */
  background: linear-gradient(to right, var(--panel) 30%, transparent) left center / 28px 100% no-repeat local,
              linear-gradient(to left, var(--panel) 30%, transparent) right center / 28px 100% no-repeat local,
              radial-gradient(farthest-side at 0 50%, var(--scroll-shadow), transparent) left center / 10px 100% no-repeat scroll,
              radial-gradient(farthest-side at 100% 50%, var(--scroll-shadow), transparent) right center / 10px 100% no-repeat scroll;
}
.tbl-wrap.tbl-tall { max-height: 640px; overflow-y: auto; }
.tbl-wrap.fits { overflow: visible; background: none; }
.tbl-wrap.fits thead th { top: var(--sticky-top, 0px); }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.tbl thead th { position: sticky; top: 0; z-index: 1; padding: 0; text-align: left; vertical-align: bottom; font-size: 11.5px; font-weight: 500; line-height: 1.3; color: var(--text-3); background: var(--panel); border-bottom: 1px solid var(--line); }
.tbl th.num { text-align: right; }
.th-btn { all: unset; box-sizing: border-box; display: flex; align-items: flex-end; gap: 3px; width: 100%; padding: 6px 8px; cursor: pointer; }
th.num .th-btn { justify-content: flex-end; }
.th-btn:hover, .th-btn.active { color: var(--text); }
.th-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.sort-ind { display: inline-flex; width: 11px; }
.tbl th:first-child .th-btn, .tbl td:first-child { padding-left: 14px; }
.tbl th:last-child .th-btn, .tbl td:last-child { padding-right: 14px; }
.tbl td { padding: 6px 8px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; vertical-align: middle; color: var(--text); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl td.num { text-align: right; }
.tbl td.cell-time { color: var(--text-2); }
.tbl td.cell-long { white-space: normal; min-width: 180px; max-width: 420px; line-height: 1.4; color: var(--text-2); }
.tbl td.cell-spark { padding-top: 3px; padding-bottom: 3px; width: 104px; }
.tbl tr.linked { cursor: pointer; }
.tbl tbody tr:hover td { background: var(--panel-2); }
.row-link { font-weight: 500; color: var(--text); }
.row-link:hover { text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.tbl td .badge { vertical-align: middle; }
.pos-text { color: var(--pos) !important; }
.neg-text { color: var(--neg) !important; }
.tbl-empty td { text-align: center; color: var(--text-3); padding: 22px 10px; }
.tbl-compact td { padding-top: 4px; padding-bottom: 4px; }
.tbl-dense { font-size: 12px; }
.tbl-dense td { padding: 5px 6px; }
.tbl-dense .th-btn { padding: 6px 6px; }
.tbl-dense td.cell-spark { width: 84px; }
.tbl-dense .spark-cell { width: 80px; }
.tbl-foot { padding-top: 8px; font-size: 11.5px; color: var(--text-3); }
.tbl-filter-box { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 8px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel); color: var(--text-3); }
.tbl-filter-box:focus-within { border-color: color-mix(in srgb, var(--accent) 70%, var(--line)); }
.tbl-filter { all: unset; width: 140px; font-size: 12px; color: var(--text); }
.tbl-filter::placeholder { color: var(--text-3); }
.filter-chip { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 6px 0 9px; border-radius: 12px; background: var(--panel-3); color: var(--text); font-size: 11.5px; font-weight: 500; }
.filter-chip:hover { background: var(--line); }

/* badges and status marks */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 8px 0 7px; border-radius: 10px; font-size: 11.5px; font-weight: 600; white-space: nowrap; line-height: 1; }
.badge-lg { height: 24px; padding: 0 10px 0 9px; border-radius: 12px; font-size: 12.5px; }
.badge.tone-ok { color: var(--ok-text); background: var(--ok-bg); }
.badge.tone-warn { color: var(--warn-text); background: var(--warn-bg); }
.badge.tone-crit, .badge.tone-high { color: var(--crit-text); background: var(--crit-bg); }
.badge.tone-info { color: var(--info-text); background: var(--info-bg); }
.badge.tone-neutral { color: var(--neutral-text); background: var(--neutral-bg); }
.badge.tone-muted, .badge.tone-paused { color: var(--muted-text); background: var(--muted-bg); }
.mark-st { display: inline-block; }
.mark-st.st-ok { fill: var(--ok); }
.mark-st.st-warn { fill: var(--warn); }
.mark-st.st-crit, .mark-st.st-high { fill: var(--crit); }
.mark-st.st-info { fill: var(--info); }
.mark-st.st-paused { fill: var(--muted-mark); }
.mark-st.st-unknown { fill: none; }
.mark-st .ring { fill: none; stroke: var(--muted-mark); stroke-width: 1.5; }
.badge.tone-neutral .mark-st { fill: var(--neutral-mark); }
.badge.tone-muted .mark-st .ring { stroke: var(--muted-mark); }

/* status grid */
.st-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(196px, 1fr)); gap: 8px; }
.st-grid:has(> :only-child) { grid-template-columns: minmax(196px, 420px); }
.st-item { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 8px 10px 9px; border-radius: 7px; border: 1px solid var(--line-soft); background: var(--panel-2); color: var(--text); transition: border-color .12s, background-color .12s; }
a.st-item:hover { border-color: var(--line-strong); background: var(--panel); }
.st-top { display: flex; align-items: center; gap: 7px; min-width: 0; }
.st-name { flex: 0 1 auto; min-width: 0; max-width: 78%; font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-val { flex: 1 1 0; min-width: 0; text-align: right; font-size: 12px; font-weight: 500; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.st-detail { font-size: 11.5px; line-height: 1.38; color: var(--text-3); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.st-warn { background: color-mix(in srgb, var(--warn-bg) 70%, var(--panel)); border-color: color-mix(in srgb, var(--warn) 28%, var(--line)); }
.st-crit { background: color-mix(in srgb, var(--crit-bg) 75%, var(--panel)); border-color: color-mix(in srgb, var(--crit) 32%, var(--line)); }
.st-warn .st-detail { color: var(--warn-text); }
.st-crit .st-detail { color: var(--crit-text); }
.st-paused .st-detail { color: var(--text-2); }
.st-overall { display: inline-flex; }

/* bars */
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; align-content: start; }
.bar-row { min-width: 0; }
.bar-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 12.5px; }
.bar-what { display: flex; align-items: baseline; gap: 7px; min-width: 0; overflow: hidden; }
.bar-label { flex: none; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
a.bar-label:hover { text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.bar-nums { display: inline-flex; gap: 10px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bar-value { font-weight: 600; }
.bar-share { min-width: 40px; text-align: right; color: var(--text-3); }
.bar-track { height: 6px; margin-top: 4px; border-radius: 3px; background: var(--panel-3); overflow: hidden; }
.bar-fill { height: 100%; min-width: 1px; border-radius: 3px; background: var(--bar); }
.bar-row.tone-ok .bar-fill { background: var(--ok); }
.bar-row.tone-warn .bar-fill { background: var(--warn); }
.bar-row.tone-crit .bar-fill { background: var(--crit); }
.bar-row.tone-info .bar-fill { background: var(--info); }
.bar-row.tone-neutral .bar-fill { background: var(--neutral-mark); }
.bar-row.tone-muted .bar-fill { background: var(--muted-mark); }
.bar-note { min-width: 0; font-size: 11px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* heatmap */
.hm { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.hm-grid { flex: 1; max-height: 330px; display: grid; grid-template-columns: 30px repeat(var(--cols, 24), minmax(0, 1fr));
  grid-template-rows: auto repeat(var(--rows, 7), minmax(20px, 1fr)); gap: 2px; outline: none; }
.hm-grid:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; border-radius: 4px; }
.hm-corner { }
.hm-x { font-size: 10.5px; color: var(--text-3); font-variant-numeric: tabular-nums; padding-bottom: 1px; }
.hm-y { font-size: 11px; color: var(--text-2); align-self: center; }
.hm-cell { min-height: 0; border-radius: 2.5px; background: var(--heat-lo); background: color-mix(in oklab, var(--heat-hi) calc(var(--t) * 100%), var(--heat-lo)); }
.hm-cell.zero { background: var(--heat-zero); }
.hm-cell:hover, .hm-cell.kb { outline: 2px solid var(--text); outline-offset: -1px; }
.hm-legend { display: flex; align-items: center; gap: 7px; margin-top: 9px; font-size: 11px; color: var(--text-3); }
.hm-ramp { width: 96px; height: 8px; border-radius: 2px; background: linear-gradient(90deg, var(--heat-lo), var(--heat-hi)); background: linear-gradient(90deg in oklab, var(--heat-lo), var(--heat-hi)); }
.hm-max { margin-left: auto; font-variant-numeric: tabular-nums; }

/* cohorts */
.co-wrap { overflow-x: auto; margin: 0 -4px; }
.co { width: 100%; border-collapse: separate; border-spacing: 2px; font-size: 11.5px; font-variant-numeric: tabular-nums; }
.co th { font-weight: 500; color: var(--text-3); font-size: 11px; padding: 2px 4px; white-space: nowrap; }
.co th.co-label { text-align: left; color: var(--text-2); }
.co thead th.co-label { color: var(--text-3); }
.co td.co-size { color: var(--text-2); padding: 0 6px; text-align: right; }
.co-cell { min-width: 30px; height: 22px; text-align: center; border-radius: 3px; color: var(--text); background: var(--ret-lo); background: color-mix(in oklab, var(--ret-hi) calc(var(--t) * 100%), var(--ret-lo)); }
.co-cell.hot { color: var(--ret-hot-text); }
.co-none { background: transparent; }
.co-running { box-shadow: inset 0 0 0 1px var(--line-strong); }

/* anomalies */
.an-list { list-style: none; margin: -2px -14px 0; padding: 0; }
.an-row { display: grid; grid-template-columns: 92px minmax(0, 1fr) minmax(120px, auto) 150px 92px; gap: 16px; align-items: center; padding: 8px 14px; border-top: 1px solid var(--line-soft); color: var(--text); }
.an-item:first-child .an-row { border-top: 0; }
a.an-row:hover { background: var(--panel-2); }
.an-sev { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.an-state { font-size: 10.5px; color: var(--text-3); padding-left: 2px; }
.an-main { min-width: 0; }
.an-what { display: flex; align-items: baseline; gap: 7px; min-width: 0; white-space: nowrap; }
.an-what b { font-weight: 600; font-size: 12.5px; }
.an-where { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; }
.an-det { color: var(--text-3); font-size: 11px; }
.an-msg { margin-top: 1px; color: var(--text-2); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-nums { display: grid; justify-items: end; font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; line-height: 1.4; }
.an-value { color: var(--text); font-weight: 600; }
.an-exp { color: var(--text-3); font-size: 11.5px; }
.an-when { display: grid; font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; line-height: 1.4; }
.an-dim { color: var(--text-3); font-size: 11.5px; }
.an-notify { justify-self: end; }
.an-mail { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
.an-mail.sent { color: var(--text-2); }
.is-resolved .an-what b, .is-resolved .an-msg { color: var(--text-2); }
.an-more { margin-top: 8px; align-self: flex-start; }
@container (max-width: 760px) {
  .an-row { grid-template-columns: 78px auto minmax(0, 1fr); grid-template-areas: "sev main main" "sev nums when"; gap: 2px 12px; align-items: start; }
  .an-sev { grid-area: sev; }
  .an-main { grid-area: main; }
  .an-nums { grid-area: nums; display: flex; gap: 6px; align-items: baseline; }
  .an-when { grid-area: when; display: flex; gap: 6px; min-width: 0; }
  .an-when .an-dim::before { content: "· "; }
  .an-row:has(> .an-nums:empty) { grid-template-areas: "sev main main" "sev when when"; }
  .an-notify { display: none; }
}

/* events */
.ev { display: grid; }
.ev-day { margin: 10px 0 3px; font-size: 11px; font-weight: 600; color: var(--text-3); letter-spacing: .03em; text-transform: uppercase; }
.ev-day:first-child { margin-top: 0; }
.ev-list { list-style: none; margin: 0; padding: 0; }
.ev-item { display: grid; grid-template-columns: 42px 10px minmax(0, 1fr); gap: 9px; align-items: start; padding: 4px 0; }
.ev-time { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; line-height: 18px; }
.ev-mark { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: var(--mk-deploy); }
.ev-deploy_failed .ev-mark { background: var(--crit); border-radius: 1px; transform: rotate(45deg) scale(.9); }
.ev-incident .ev-mark { background: var(--crit); }
.ev-note .ev-mark { background: var(--mk-note); border-radius: 2px; }
.ev-anomaly .ev-mark { background: var(--warn); }
.ev-body { min-width: 0; }
.ev-title { display: flex; gap: 7px; align-items: baseline; font-size: 12.5px; line-height: 18px; min-width: 0; }
.ev-title > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-kind { font-weight: 600; white-space: nowrap; }
.ev-deploy_failed .ev-kind, .ev-incident .ev-kind { color: var(--crit-text); }
.ev-detail { font-size: 11.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ev-more { margin-top: 6px; justify-self: start; }

/* notes, callouts and empty states */
.panel-callout { padding: 0; border: 0; background: transparent; }
.panel-callout .panel-head { display: none; }
.callout { display: flex; align-items: flex-start; gap: 9px; padding: 9px 12px; border-radius: var(--radius); font-size: 12.5px; line-height: 1.45; border: 1px solid transparent; }
.callout .icon { margin-top: 1px; }
.callout.tone-info { background: var(--info-bg); color: var(--info-text); border-color: color-mix(in srgb, var(--info) 18%, transparent); }
.callout.tone-warn { background: var(--warn-bg); color: var(--warn-text); border-color: color-mix(in srgb, var(--warn) 22%, transparent); }
.empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; min-height: 118px; padding: 16px 12px; text-align: center; color: var(--text-3); }
.empty .icon { color: var(--text-3); margin-bottom: 2px; }
.empty-sm { min-height: 64px; }
.empty-title { color: var(--text-2); font-weight: 600; font-size: 12.5px; }
.empty-text { max-width: min(58ch, 100%); font-size: 12px; line-height: 1.5; }
.empty-text .cmd { max-width: 100%; }
.empty-note { min-height: 150px; border-radius: 6px; background: repeating-linear-gradient(135deg, transparent 0 7px, color-mix(in srgb, var(--panel-3) 55%, transparent) 7px 8px); }
.empty-note .empty-text { color: var(--text-2); }
.empty-note.tone-warn .icon { color: var(--warn); }
.empty-ok { flex-direction: row; min-height: 52px; gap: 8px; }
.empty-ok .icon { color: var(--ok); margin: 0; }
.state-block { display: grid; justify-items: center; gap: 10px; max-width: 560px; margin: 12vh auto 0; text-align: center; color: var(--text-2); }
.state-block .icon { color: var(--text-3); }
.state-title { font-size: 18px; font-weight: 700; color: var(--text); }
.state-text { font-size: 13px; line-height: 1.55; }
.state-text.dim { color: var(--text-3); }
.stat { display: grid; gap: 2px; }
.stat-value { display: flex; align-items: baseline; gap: 3px; }
.stat-label { font-size: 12px; color: var(--text-2); }
.stat-sub { font-size: 11.5px; color: var(--text-3); }

/* skeleton */
.sk { border-radius: 5px; background: var(--panel-3); animation: pulse 1.6s ease-in-out infinite; }
.sk-title { width: 180px; height: 24px; }
.sk-sub { width: 320px; height: 14px; margin-top: 6px; }
.sk-panel { min-height: 120px; gap: 12px; }
.sk-panel .sk-line { width: 40%; height: 12px; }
.sk-panel .sk-block { flex: 1; min-height: 80px; }
.sk-k { min-height: 108px; }
.sk-c { min-height: 250px; }
.sk-t { min-height: 380px; }
.page-skeleton .sec { margin-top: 26px; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }

/* drill-down dialog */
dialog.drill { width: min(980px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--text); box-shadow: var(--shadow-pop); overflow: auto; }
dialog.drill::backdrop { background: var(--scrim); }
.drill-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 16px 18px 0; }
.drill-title { font-size: 16px; font-weight: 700; }
.drill-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; font-variant-numeric: tabular-nums; }
.drill-desc { padding: 8px 18px 0; color: var(--text-2); font-size: 12.5px; }
.drill-stats { display: flex; flex-wrap: wrap; gap: 6px 22px; padding: 12px 18px 0; }
.drill-stat { display: grid; gap: 1px; font-size: 11.5px; color: var(--text-3); }
.drill-stat b { font-size: 15px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.drill-body { padding: 8px 18px 16px; display: flex; flex-direction: column; }
.drill-tools { justify-content: flex-end; margin: 0 0 4px; min-height: 26px; }

/* ───────── responsive ───────── */
@media (max-width: 1180px) {
  .panel[data-w="3"] { grid-column: span 6; }
  .search { width: 200px; }
}
@media (max-width: 980px) {
  .panel[data-w="4"], .panel[data-w="5"], .panel[data-w="7"], .panel[data-w="8"] { grid-column: span 12; }
  .panel[data-w="3"] { grid-column: span 6; }
  .fresh-text { max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
}
@media (max-width: 760px) {
  .app, body.nav-collapsed .app, html.pre-collapsed .app { grid-template-columns: minmax(0, 1fr); }
  .nav { position: fixed; left: 0; top: 0; bottom: 0; width: 264px; height: auto; transform: translateX(-105%); transition: transform .2s ease; box-shadow: var(--shadow-pop); }
  body.nav-open .nav { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 25; background: var(--scrim); }
  body.nav-collapsed .nav-label, body.nav-collapsed .brand-text, body.nav-collapsed .nav-sub,
  html.pre-collapsed .nav-label, html.pre-collapsed .brand-text, html.pre-collapsed .nav-sub { display: revert; }
  body.nav-collapsed .nav-item { justify-content: flex-start; padding: 0 9px; }
  body.nav-collapsed .nav-item .nav-end { position: static; }
  .nav-bottom { display: none; }
  .topbar { position: static; height: auto; flex-wrap: wrap; gap: 8px; padding: 8px 16px; }
  :root { --sticky-top: 0px; }
  .topbar-left { width: 100%; flex-wrap: wrap; }
  .topbar-right { width: 100%; }
  .topbar .topbar-menu { display: inline-flex; }
  .range-wrap { order: 3; width: 100%; }
  .seg-range { width: 100%; display: flex; }
  .seg-range .seg-btn { flex: 1; justify-content: center; padding: 0 6px; }
  .topbar-search { flex: 1; min-width: 0; }
  .search { width: 100%; }
  .search-kbd { display: none; }
  .fresh { padding: 0 6px; }
  .pop { width: min(300px, calc(100vw - 32px)); }
  .main { padding: 14px 16px 40px; }
  .banner-row { padding: 7px 16px; }
  .grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .panel, .panel[data-w] { grid-column: 1 / -1; }
  .ph-title { font-size: 19px; }
  .sec { margin-top: 18px; }
  .an-row { grid-template-columns: minmax(0, 1fr); grid-template-areas: "sev" "main" "nums" "when"; }
  .an-sev { flex-direction: row; align-items: center; gap: 8px; }
  .tbl-filter { width: 100px; }
  .st-grid { grid-template-columns: repeat(auto-fill, minmax(138px, 1fr)); gap: 6px; }
  .st-item { padding: 7px 8px 8px; }
  .ph-health { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
  .panel, .st-item, .seg-btn[aria-pressed="true"] { border: 1px solid CanvasText; }
  .badge { border: 1px solid CanvasText; }
}

/* ───────── sign-in, lock, tunnel closed, account (views/signin.js, components/usermenu.js; auth.md 11) ───────── */
.gate { position: fixed; inset: 0; z-index: 80; overflow: auto; background: var(--bg); }
.gate-wrap { min-height: 100%; display: grid; place-items: center; padding: 32px 16px; }
.auth-card { width: min(440px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-pop); overflow: hidden; }
.auth-head { display: flex; gap: 12px; align-items: center; padding: 22px 24px 18px; border-bottom: 1px solid var(--line); }
.auth-head .mark { width: 40px; height: 40px; }
.auth-head h1 { font-size: 18px; line-height: 24px; font-weight: 700; }
.auth-head p { color: var(--text-2); font-size: 13px; }
.auth-body { padding: 20px 24px 22px; display: grid; gap: 14px; }
.auth-welcome { font-size: 15px; }
.auth-lead { color: var(--text); font-size: 14px; line-height: 1.5; display: block; }
.auth-lead .cmd { margin: 6px 0 0; }
.auth-help { color: var(--text-2); font-size: 13px; line-height: 1.45; }
.auth-link { all: unset; cursor: pointer; color: var(--text-2); font-size: 12.5px; text-decoration: underline; text-underline-offset: 2px; }
.auth-link:hover { color: var(--text); }
.auth-link:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
.auth-welcome .auth-link { font-size: 15px; }
.field { display: grid; gap: 6px; }
.field-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.field label { font-weight: 600; font-size: 13.5px; }
.field input { font: inherit; font-size: 16px; height: 44px; padding: 0 12px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong);
  background: var(--panel); color: var(--text); min-width: 0; }
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.auth-caps { color: var(--warn-text); font-size: 12.5px; display: flex; gap: 6px; align-items: center; }
.auth-msg:empty { display: none; }
.auth-msg { font-size: 13px; line-height: 1.45; border-radius: var(--radius-sm); padding: 8px 10px; color: var(--info-text); background: var(--info-bg); }
.auth-msg-crit { color: var(--crit-text); background: var(--crit-bg); }
.auth-msg-info { color: var(--info-text); background: var(--info-bg); }
.btn-wide { width: 100%; height: 42px; font-size: 14px; font-weight: 700; }
.btn[disabled] { opacity: .6; cursor: progress; }
.auth-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.auth-actions .btn { height: 38px; padding: 0 16px; font-size: 13.5px; }
.auth-checks { list-style: none; margin: -4px 0 0; padding: 0; display: grid; gap: 4px; font-size: 13px; color: var(--text-2); }
.auth-checks li { display: flex; align-items: center; gap: 8px; }
.auth-mark { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--line-strong); flex: none; position: relative; }
.auth-checks li[data-ok="true"] { color: var(--ok-text); }
.auth-checks li[data-ok="true"] .auth-mark { background: var(--ok); border-color: var(--ok); }
.auth-checks li[data-ok="true"] .auth-mark::after { content: ""; position: absolute; left: 4.5px; top: 1.5px; width: 4px; height: 8px;
  border: solid var(--panel); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.auth-checks li[data-ok="later"] .auth-mark { border-style: dashed; }
.auth-foot { padding: 12px 24px; background: var(--panel-2); border-top: 1px solid var(--line); color: var(--text-2); font-size: 12.5px;
  line-height: 18px; display: flex; gap: 8px; }
.auth-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); margin-top: 5px; flex: none; }
.auth-rtt { color: var(--text-3); display: block; min-height: 18px; }
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 90; display: grid; gap: 8px; }
.toast { padding: 10px 14px; border-radius: var(--radius); background: var(--tip-bg); color: var(--tip-text); box-shadow: var(--shadow-pop);
  font-size: 13px; line-height: 1.45; max-width: min(560px, calc(100vw - 32px)); }
.toast-warn { background: var(--warn-bg); color: var(--warn-text); border: 1px solid var(--warn); }
.banner-tunnel { background: var(--crit-bg); color: var(--crit-text); }
.banner-tunnel b { font-weight: 700; }
.banner-renew { background: var(--info-bg); color: var(--info-text); }
.banner-renew .dim { color: inherit; opacity: .8; }
.user-wrap { position: relative; }
.user-btn { all: unset; box-sizing: border-box; width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center;
  background: var(--primary-bg); color: var(--primary-text); font-size: 11.5px; font-weight: 700; letter-spacing: .02em; cursor: pointer; }
.user-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.user-pop { left: auto; right: 0; top: calc(100% + 8px); width: 280px; padding: 6px 0; gap: 0; display: block; }
.menu-sec { padding: 8px 14px; border-bottom: 1px solid var(--line-soft); }
.menu-sec:last-child { border-bottom: 0; }
.menu-id { display: flex; gap: 10px; align-items: center; }
.menu-id .dim { color: var(--text-3); }
.user-avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-3); font-weight: 700;
  font-size: 12px; flex: none; }
.menu-meta { margin-top: 6px; color: var(--text-2); font-size: 12.5px; line-height: 18px; font-variant-numeric: tabular-nums; }
.menu-item { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 10px; width: calc(100% + 28px); margin: 0 -14px;
  padding: 7px 14px; font-size: 13px; color: var(--text); cursor: pointer; }
.menu-item:hover, .menu-item:focus-visible { background: var(--panel-3); }
dialog.auth-dialog { width: min(440px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--panel);
  color: var(--text); box-shadow: var(--shadow-pop); }
dialog.auth-dialog::backdrop { background: var(--scrim); }
.auth-dialog-head { padding: 18px 24px 0; }
.auth-dialog-head h2 { font-size: 16px; font-weight: 700; }
@media (max-width: 760px) {
  .gate-wrap { padding: 16px; place-items: start center; }
  .auth-head, .auth-body, .auth-foot { padding-left: 18px; padding-right: 18px; }
  .user-pop { width: min(280px, calc(100vw - 32px)); }
}

/* two-step: the code field, the setup key, the recovery codes */
.field input.auth-code { font-size: 22px; letter-spacing: .28em; text-align: center; font-variant-numeric: tabular-nums; height: 52px; }
.field input.auth-code.auth-code-recovery { font-size: 17px; letter-spacing: .06em; }
.auth-steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 13.5px; line-height: 1.45; color: var(--text-2); }
.auth-open { display: flex; align-items: center; justify-content: center; text-decoration: none; min-height: 44px; }
.auth-key-row { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.auth-key { font-size: 15px; letter-spacing: .06em; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--panel-2);
  border: 1px solid var(--line); overflow-wrap: anywhere; user-select: all; }
.auth-recovery { list-style: none; margin: 0; padding: 12px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 14px; letter-spacing: .04em; user-select: all; }
.auth-check { display: flex; gap: 10px; align-items: center; font-size: 14px; min-height: 44px; cursor: pointer; }
.auth-check input { width: 22px; height: 22px; flex: none; }

/* a phone (390 px wide and up from 320): the top bar and the main navigation reach with a thumb, and nothing pushes the page sideways */
@media (max-width: 480px) {
  html { -webkit-text-size-adjust: 100%; }
  .main-col, .main, .topbar-left, .topbar-right { min-width: 0; }
  .main { overflow-wrap: anywhere; }
  .topbar { padding: 8px 12px; gap: 6px; }
  .topbar .topbar-menu, .user-btn, .topbar .btn-icon { min-width: 40px; min-height: 40px; }
  .topbar-right { flex-wrap: wrap; justify-content: space-between; gap: 6px; }
  .seg-btn { height: 34px; }
  .search { height: 40px; }
  .search-input { font-size: 16px; }
  .fresh { height: 36px; }
  .fresh-text { max-width: 96px; }
  .nav { width: min(280px, 88vw); }
  .nav-item { height: 44px; font-size: 14px; }
  .nav-top { padding: 0 12px; }
  .main { padding: 12px 12px 40px; }
  .banner-row { padding: 7px 12px; }
  .btn-wide, .auth-actions .btn { min-height: 44px; }
  .auth-head, .auth-body, .auth-foot { padding-left: 16px; padding-right: 16px; }
  .auth-recovery { grid-template-columns: minmax(0, 1fr); }
  .user-pop { width: min(280px, calc(100vw - 24px)); }
}
