:root {
  /* Apple dark (owner, 2026-09-19): iOS elevation layering — black canvas, each raised
     surface the next-lighter gray instead of a shadow — with apple.com's dark inks and
     the iOS system colors for status. Light companions live in build_light_theme.py. */
  --bg: #000000;
  --panel: #1c1c1e;
  --panel-2: #2c2c2e;
  --line: #38383a;
  --line-2: #48484a;
  --text: #f5f5f7;
  --dim: #a1a1a6;
  --dimmer: #939396;
  --accent: #2997ff;
  --accent-dim: #0a2042;
  --bar: #16395e;
  --warn: #ff9f0a;
  --bad: #ff453a;
  --good: #30d158;
  /* Chart chrome, read by the inline SVG that charts.py emits. Same names are
     redefined for light mode in style-light.css's companion block below. */
  --chart-ink-muted: #a1a1a6;
  --chart-ink-sec: #d1d1d6;
  --chart-grid: #2c2c2e;
  --chart-axis: #3a3a3c;
  --chart-debug: #48484a;
  --chart-hm-empty: #1c1c1e;
  --chart-marker-ring: #1c1c1e;
  /* The translucent nav. A token, not a literal, because the light-theme generator reads
     any near-black rgba as a shadow and clamps it; a token it looks up instead. */
  --topbar-bg: rgba(22, 22, 23, 0.8);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ease-out: cubic-bezier(0, 0, 0.5, 1);
  /* THE STACKING ORDER — one scale, and every z-index in the app reads from it. Ad-hoc
     numbers let the time picker (z 60) render UNDER the stat tiles: it lived inside a
     top bar that was itself a stacking context at level 0, so its 60 never left the bar.
     A layer is chosen by role, not by trying numbers until something wins; a value
     inside a component that is its own stacking context (the dock, a menu) only needs
     --z-raised to sit above its siblings there. */
  --z-raised: 1;      /* above its siblings inside one block (a hovered tile, a step badge) */
  --z-sticky: 2;      /* sticky table headers and bars that scroll with the content */
  --z-dropdown: 20;   /* a menu or bubble anchored to a control in the page */
  --z-header: 40;     /* the top bar — its picker and bell panels ride on this layer */
  --z-drawer: 45;     /* the sidebar, its rail flyouts, and (one below) the mobile scrim */
  --z-dock: 60;       /* the Ask X-ray dock */
  --z-popover: 65;    /* pointer tooltips positioned against the viewport */
  --z-modal: 80;      /* a dialog's scrim; the dialog itself is +1 */
  --z-toast: 90;      /* transient notices, readable over a dialog */
  --z-overlay: 100;   /* a full-screen takeover the reader summoned (the palette) */
  --z-top: 1000;      /* skip links, the guided tour, the navigation progress bar */
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); font-size: 0.92em; }

/* Appearance control. Shows the state it is IN, not the state it would move to:
   a control labelled with its next action makes the reader work out where they are. */
/* Appearance control: three segments in one pill. The pressed segment is chosen by
   CSS from data-theme on <html> (absent = follow the system), so it is correct on
   first paint and never disagrees with the theme actually applied. */
.themeseg { padding: 2px; display: inline-flex; align-items: center; gap: 2px; }
.themeseg button {
  appearance: none; -webkit-appearance: none; border: 0; background: transparent;
  color: var(--dimmer); font: inherit; font-size: 11.5px; line-height: 1.3;
  padding: 2px 8px; border-radius: 999px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px;
}
.themeseg button svg { width: 12px; height: 12px; flex: 0 0 auto; }
.themeseg button:hover { color: var(--text); }
.themeseg button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
:root:not([data-theme]) .themeseg [data-theme-choice="system"],
:root[data-theme="light"] .themeseg [data-theme-choice="light"],
:root[data-theme="dark"]  .themeseg [data-theme-choice="dark"] {
  background: var(--accent-dim); color: var(--text);
}

/* ── accessibility utilities ──────────────────────────────────────────────────
   Available to text that must exist for a screen reader without occupying space:
   a table's accessible name, the word "sorted" next to an arrow glyph, the count
   after a fragment swap. Clipping rather than display:none, because a hidden
   element is not announced at all. */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Skip link. The header carries a cluster picker, a range picker, a theme control
   and an eleven-group nav before the content starts — about forty tab stops on
   every page. Keyboard users should be able to step over all of it. */
.skiplink {
  position: absolute; left: 8px; top: -48px; z-index: var(--z-top);
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--accent); border-radius: 6px;
  padding: 8px 14px; font-size: 13px; text-decoration: none;
  transition: top .12s ease-out;
}
.skiplink:focus { top: 8px; }

/* One visible focus ring, everywhere. There was one :focus-visible rule in the
   whole stylesheet, so tabbing through a table of links showed nothing at all and
   a keyboard user could not tell where they were. */
:where(a, button, select, input, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}
@media (prefers-reduced-motion: reduce) { .skiplink { transition: none; } }

/* ── provenance strip ─────────────────────────────────────────────────────────
   Sits under a panel heading, not inside the data. Quiet by default: the reader
   should notice it only when looking for it, or when it turns amber because the
   panel is truncated or the collector behind it is late. */
.prov { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 2px 0 10px; }
.prov-i {
  font-size: 11px; color: var(--dimmer); background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 999px; padding: 1.5px 8px;
  white-space: nowrap; cursor: help;
}
.prov-i.prov-src { color: var(--dim); border-color: var(--line-2); }
.prov-i.warn { color: var(--warn); border-color: var(--warn); background: transparent; }
.prov-i.prov-note { cursor: default; font-style: italic; }

/* ── change timeline ─────────────────────────────────────────────────────────── */
.chg {
  font-size: 11px; padding: 1.5px 7px; border-radius: 3px; white-space: nowrap;
  border: 1px solid currentColor;
}
.chg-deploy { color: var(--accent); }
.chg-ran { color: var(--dim); }
.chg-hand { color: var(--bad); }
.chgtable td { vertical-align: middle; }
.imgtag { color: var(--text); }
.small { font-size: 12px; }

/* Before/after chips. Colour says direction, and the word says which measure — the
   research is consistent that status must never be carried by colour alone. */
.bas { display: inline-flex; gap: 5px; flex-wrap: wrap; }
.ba {
  font-size: 11px; padding: 1.5px 7px; border-radius: 999px; white-space: nowrap;
  border: 1px solid currentColor; cursor: help;
}
.ba-worse { color: var(--bad); }
.ba-better { color: var(--good); }
.ba-flat { color: var(--dimmer); }

/* ── verdicts, budget bars, small multiples ─────────────────────────────────── */
.verdict {
  font-size: 11px; padding: 1.5px 8px; border-radius: 999px; white-space: nowrap;
  border: 1px solid currentColor;
}
.v-healthy { color: var(--good); }
.v-budget-low { color: var(--warn); }
.v-below-objective { color: var(--warn); }
.v-burning { color: var(--bad); }
.v-burning-fast { color: var(--bad); font-weight: 600; }
.src-tag { font-size: 9.5px; margin-left: 4px; letter-spacing: -0.01em; }

.budgetbar {
  display: inline-block; width: 46px; height: 6px; border-radius: 3px;
  background: var(--panel-2); border: 1px solid var(--line);
  vertical-align: middle; margin-right: 6px; overflow: hidden;
}
.budgetbar-fill { display: block; height: 100%; }
.budgetbar-fill.good { background: var(--good); }
.budgetbar-fill.warn { background: var(--warn); }
.budgetbar-fill.bad { background: var(--bad); }

.smallmults {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(236px, 1fr));
  gap: 10px; margin-top: 12px;
}
.sm-card {
  display: block; text-decoration: none; color: inherit;
  background: var(--panel); border: 1px solid var(--line); border-radius: 6px;
  padding: 9px 11px 7px;
}
.sm-card:hover { border-color: var(--accent-dim); background: var(--panel-2); text-decoration: none; }
.sm-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.sm-name { font-size: 13px; font-weight: 600; }
.sm-val { font-size: 12px; font-variant-numeric: tabular-nums; }
.sm-chart { margin: 4px -2px 2px; }
.sm-foot { display: flex; justify-content: space-between; font-size: 11px; color: var(--dimmer); }
.sm-peak { margin-top: 1px; opacity: .8; }

/* A service with nothing to plot for the selected measure. Present, quieter, and never
   dropped — hiding it made the grid show 12 of 20 with no way to know which eight. */
.sm-card.sm-nodata { opacity: .62; }
.sm-card.sm-nodata:hover { opacity: 1; }
.sm-card.sm-nodata .sm-chart { filter: saturate(0.25); }
.head-note { font-size: 12.5px; margin: 2px 0 0; max-width: 90ch; }

/* A quiet action that is clearly a control. Export sits beside filters, so it must not
   look like the primary thing on the page. */
.btn-quiet {
  font-size: 12px; padding: 3px 10px; border-radius: 4px;
  border: 1px solid var(--line-2); color: var(--dim); background: var(--panel-2);
  text-decoration: none; white-space: nowrap;
}
.btn-quiet:hover { color: var(--text); border-color: var(--accent-dim); text-decoration: none; }

/* An inline caveat that belongs with the data, not in a tooltip. Used where a page would
   otherwise imply more authority than it has. */
.note-inline {
  font-size: 12.5px; line-height: 1.5; color: var(--dim);
  background: var(--panel); border-left: 3px solid var(--warn);
  padding: 9px 13px; margin: 0 0 14px; border-radius: 0 4px 4px 0;
}
.note-inline b { color: var(--text); }

/* ── table tools ──────────────────────────────────────────────────────────────── */
.tabletools { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; margin: 0 0 9px; }
.tt-menu { position: relative; }
.tt-menu > summary { cursor: pointer; list-style: none; display: inline-block; }
.tt-menu > summary::-webkit-details-marker { display: none; }
.tt-body {
  position: absolute; z-index: var(--z-dropdown); top: calc(100% + 4px); left: 0; min-width: 210px;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 6px;
  padding: 8px; display: flex; flex-direction: column; gap: 3px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45); max-height: 60vh; overflow: auto;
}
.colopt { font-size: 12.5px; display: flex; gap: 7px; align-items: center; cursor: pointer; }
.colreset, .viewsave {
  margin-top: 6px; font: inherit; font-size: 12px; cursor: pointer;
  background: var(--panel-2); color: var(--dim);
  border: 1px solid var(--line-2); border-radius: 4px; padding: 3px 8px;
}
.colreset:hover, .viewsave:hover { color: var(--text); }
.viewrow { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12.5px; }
.viewdel { background: none; border: 0; color: var(--dimmer); cursor: pointer; font-size: 14px; line-height: 1; }
.viewdel:hover { color: var(--bad); }
.viewempty { font-size: 12px; color: var(--dimmer); line-height: 1.45; }
.viewempty.bad { color: var(--bad); }   /* a saved-views request that failed */
/* a new X-ray build is live (fragments.js): a small bar at the top centre — clear of the Ask dock along the bottom */
.xr-update { position: fixed; left: 50%; top: 12px; transform: translateX(-50%); z-index: var(--z-toast);
  display: flex; align-items: center; gap: 10px; max-width: calc(100vw - 32px); padding: 8px 8px 8px 14px;
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line-2); border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .35); font-size: 13px; animation: frag-in .2s ease-out; }
.xr-update-x { background: none; border: 0; color: var(--dim); font-size: 18px; line-height: 1; padding: 0 6px; cursor: pointer; }
.xr-update-x:hover { color: var(--text); }
@media (max-width: 520px) { .xr-update { left: 16px; right: 16px; transform: none; top: 10px; } .xr-update span { flex: 1; } }

/* A hidden column, hidden for this reader only. */
.col-off { display: none; }

/* Density. `dense` is a body class so one toggle reaches every table on the page. */
body.dense table.grid th, body.dense table.grid td { padding-top: 3px; padding-bottom: 3px; font-size: 12.5px; }
body.dense .jprev { font-size: 11.5px; }
#xr-density .d-dense { display: none; }
body.dense #xr-density .d-normal { display: none; }
body.dense #xr-density .d-dense { display: inline; }

/* Sticky headers. A 300-row table scrolled to row 200 with no header is a table of
   unlabelled numbers, which is where most misreadings come from.
   A sticky cell sticks to its nearest SCROLL CONTAINER, and .tablewrap is one (overflow-x
   for wide tables makes overflow-y auto as well) — a box as tall as its table, which never
   scrolls, so the header used to scroll away with the page. A long table's wrapper is
   therefore bounded to the viewport and scrolls itself: the page scrolls until the table
   fills the screen, then the rows scroll under a header that stays. Short tables keep
   their natural height — a box with its own scrollbar for twelve rows is just friction. */
table.grid thead th {
  position: sticky; top: 0; z-index: var(--z-sticky);
  background: var(--panel-2);
}
.tablewrap:has(> table > tbody > tr:nth-child(25)) { max-height: calc(100vh - 48px - var(--dock-h)); overflow-y: auto; }

/* ── matrix / panels ─────────────────────────────────────────────────────────── */
.matrixwrap { overflow-x: auto; padding: 4px 0 2px; }
.matrixwrap svg.matrix { max-width: 100%; height: auto; min-width: 460px; }
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: 6px;
  padding: 12px 14px; margin: 0 0 14px;
}
.panel-h { font-size: 14px; margin: 0 0 2px; font-weight: 600; }
.panel-sub { font-size: 12.5px; margin: 0 0 10px; max-width: 78ch; }

/* ── journey drop-off ─────────────────────────────────────────────────────────── */
.dropgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }
.dh { font-size: 12px; font-weight: 600; color: var(--dim); margin: 0 0 6px; text-transform: none; letter-spacing: -0.01em; }
table.funnel { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.funnel th, table.funnel td { padding: 3px 6px; text-align: left; font-weight: 400; }
.fn-step, .fn-screen { color: var(--dim); white-space: nowrap; max-width: 190px; overflow: hidden; text-overflow: ellipsis; }
.fn-bar { width: 45%; }
.fn-fill { display: block; height: 9px; border-radius: 2px; background: var(--accent); opacity: .75; min-width: 1px; }
.fn-fill.alt { background: var(--bar); opacity: 1; }
.fn-n { text-align: right; width: 52px; }
.fn-pct { text-align: right; width: 46px; }
.fn-lost { text-align: right; width: 52px; }
.trans { margin-right: 12px; white-space: nowrap; }

/* ── what's different ─────────────────────────────────────────────────────────── */
.wd .panel-sub { max-width: 92ch; }
.wdrows { display: flex; flex-direction: column; gap: 3px; }
.wdrow { display: grid; grid-template-columns: 120px minmax(0, 1fr) 26% 44px 68px; gap: 9px; align-items: center; font-size: 12.5px; }
.wd-field { color: var(--dimmer); text-transform: none; font-size: 10px; letter-spacing: -0.01em; }
.wd-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wd-bar { background: var(--panel-2); border: 1px solid var(--line); border-radius: 2px; height: 10px; overflow: hidden; }
.wd-fill { display: block; height: 100%; background: var(--warn); opacity: .8; }
.wd-share { text-align: right; }
.wd-lift { text-align: right; }
@media (max-width: 760px) { .wdrow { grid-template-columns: 1fr auto; } .wd-bar, .wd-field { display: none; } }

/* A skeleton, so a pending number reads as loading rather than as zero. */
.skel {
  background: linear-gradient(90deg, var(--panel-2) 25%, var(--line) 37%, var(--panel-2) 63%);
  background-size: 400% 100%; border-radius: 4px; min-height: 1.2em; min-width: 3.5em;
  animation: skelshine 1.4s ease-in-out infinite;
}
@keyframes skelshine { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }

/* Sample-data banner. Deliberately not styleable away into a quiet pill: the whole point
   is that a reader cannot mistake a fixture for history. */
.seedbar {
  background: var(--warn); color: #1c1c1e;
  padding: 7px 20px; font-size: 13px; line-height: 1.45;
  border-bottom: 1px solid var(--line);
}
.seedbar b { font-weight: 700; }
.seedbar code { background: rgba(0, 0, 0, 0.14); padding: 0 4px; border-radius: 3px; color: inherit; }

/* An identifier that says what kind of identifier it is. A bare truncated sha in a table
   is indistinguishable from any other hex string — someone asked if one was a process id,
   which is a fair question when nothing on the page answers it. */
.idchip {
  display: inline-flex; align-items: baseline; gap: 5px;
  font-size: 11.5px; padding: 1px 7px; margin: 1px 3px 1px 0;
  border: 1px solid var(--line-2); border-radius: 3px;
  background: var(--panel-2); color: var(--dim); text-decoration: none; white-space: nowrap;
}
a.idchip:hover { border-color: var(--accent-dim); color: var(--text); text-decoration: none; }
.idchip .idlbl {
  font-size: 9px; letter-spacing: -0.01em; text-transform: none; color: var(--dimmer);
}
.idchip .mono { font-family: var(--mono); color: var(--text); }
.idchip.warn { color: var(--warn); border-color: var(--warn); }

/* ── how-to-read panel ───────────────────────────────────────────────────────── */
.howto { margin: 0 0 14px; }
.howto > summary {
  cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; color: var(--dim);
  border: 1px solid var(--line-2); border-radius: 999px; padding: 3px 12px 3px 8px;
  background: var(--panel-2);
}
.howto > summary::-webkit-details-marker { display: none; }
.howto > summary:hover { color: var(--text); border-color: var(--accent-dim); }
.howto-q {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--accent-dim); color: var(--text); font-size: 10px; font-weight: 700;
}
.howto[open] > summary { border-radius: 6px 6px 0 0; }
.howto-body {
  border: 1px solid var(--line-2); border-top: 0; border-radius: 0 6px 6px 6px;
  background: var(--panel); padding: 12px 16px; max-width: 108ch;
}
.howto-lead { font-size: 13px; line-height: 1.55; margin: 0 0 10px; color: var(--text); }
.howto-dl { display: grid; grid-template-columns: minmax(120px, 190px) 1fr; gap: 5px 14px; margin: 0; font-size: 12.5px; }
.howto-dl dt { color: var(--accent); font-family: var(--mono); font-size: 11.5px; }
.howto-dl dd { margin: 0; color: var(--dim); line-height: 1.5; }
.howto-h {
  font-size: 10.5px; letter-spacing: -0.01em; text-transform: none; color: var(--dimmer);
  margin: 14px 0 5px;
}
.howto-ul { margin: 0; padding-left: 18px; font-size: 12.5px; color: var(--dim); line-height: 1.5; }
.howto-ul li { margin-bottom: 4px; }

/* ── status filter bar ───────────────────────────────────────────────────────────
   Each filter carries its own count: a filter whose size you cannot see is a filter
   nobody clicks, and the point of this bar is that three 401s inside a wall of 200s are
   visible without having to guess to go looking. A class with none is shown disabled
   rather than hidden, so the ABSENCE of 5xx is readable too. */
.statusbar { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.sfilter {
  display: inline-flex; align-items: baseline; gap: 6px;
  font-size: 12.5px; padding: 3px 11px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--panel-2); color: var(--dim);
  text-decoration: none; white-space: nowrap;
}
a.sfilter:hover { color: var(--text); border-color: var(--accent-dim); text-decoration: none; }
.sfilter.on { border-color: var(--accent); color: var(--text); background: var(--accent-dim); }
.sfilter.off { opacity: .45; cursor: default; }
.sfilter .sfn { font-family: var(--mono); font-size: 11px; color: var(--dimmer); }
.sfilter.on .sfn { color: var(--text); }
.sfilter.sf-failed:not(.off):not(.on) { border-color: var(--bad); color: var(--bad); }
.sfilter.sf-5xx:not(.off):not(.on) { border-color: var(--bad); color: var(--bad); }
.sfilter.sf-4xx:not(.off):not(.on) { border-color: var(--warn); color: var(--warn); }

/* An HTTP status code, coloured by class so a 401 cannot hide inside a column of 200s. */
.code {
  font-family: var(--mono); font-size: 12px; padding: 1px 7px; border-radius: 3px;
  border: 1px solid currentColor;
}
.code.c-2xx { color: var(--good); }
.code.c-3xx { color: var(--dim); }
.code.c-4xx { color: var(--warn); }
.code.c-5xx { color: var(--bad); }
.code.c-none { color: var(--dimmer); }

/* ── pinned attributes on the AI log list ─────────────────────────────────────────
   A summary line holds about eight facts before it stops being scannable, so the rest
   live behind an expand — and the expand is per row. Pinning promotes an attribute to
   every row at once, which is what turns a readable list into one you can interrogate. */
.pinbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 10px; }
.pinchip {
  font-size: 12px; padding: 2px 9px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--panel-2); color: var(--dim);
  text-decoration: none; white-space: nowrap;
}
a.pinchip:hover { color: var(--text); border-color: var(--accent-dim); text-decoration: none; }
.pinchip.on { border-color: var(--accent); color: var(--text); background: var(--accent-dim); }
.pinchip.clear { border-style: dashed; }
.pin-hint { font-size: 11.5px; }

/* A pinned value on a summary line. The KEY is shown next to the value because a bare
   email in a row of numbers does not say whether it is the end user or the org owner. */
.pinned { display: inline-flex; flex-wrap: wrap; gap: 5px; margin-left: 8px; }
.pv {
  display: inline-flex; align-items: baseline; gap: 5px; max-width: 34ch;
  font-size: 11.5px; padding: 0 7px; border-radius: 3px;
  border: 1px solid var(--line); background: var(--panel-2);
}
.pv .pk {
  font-size: 9px; letter-spacing: -0.01em; text-transform: none; color: var(--dimmer);
  flex: none;
}
.pv .pval {
  font-family: var(--mono); color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* Missing is its own state, and quieter than a value — the row is still readable at a
   glance as "this one has none" without the dash competing with real data. */
.pv.pv-missing { border-style: dashed; }
.pv .pd { font-family: var(--mono); color: var(--dimmer); }

/* The pin control inside a row's attribute table. */
.attr-t td.apin { text-align: right; white-space: nowrap; padding-left: 8px; }
.pinbtn {
  font-size: 10px; letter-spacing: -0.01em; text-transform: none;
  color: var(--dimmer); text-decoration: none;
  border: 1px solid transparent; border-radius: 3px; padding: 0 5px;
}
.attr-t tr:hover .pinbtn { border-color: var(--line-2); color: var(--dim); }
.pinbtn:hover { color: var(--accent) !important; border-color: var(--accent) !important; text-decoration: none; }
.pinbtn.on { color: var(--accent); border-color: var(--accent-dim); }

/* ---- top bar ---- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px;
  background: var(--topbar-bg);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap; row-gap: 8px;
  /* The blur makes this bar a stacking context, so whatever opens from it (time picker,
     bell) can only ever be as high as the bar itself: it needs its own layer above the
     content, or a stat tile further down the page paints over the open panel. */
  position: relative; z-index: var(--z-header);
}
.brand { font-weight: 600; letter-spacing: -0.016em; font-size: 15px; display: flex; align-items: center; }
.brand .logo { color: var(--accent); margin-right: 7px; display: inline-flex; }
.brand .logo svg { width: 21px; height: 21px; }
.brand .dim { color: var(--dimmer); font-weight: 400; }
.status { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pill {
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 3px 11px; font-size: 12px; color: var(--dim);
}
.pill b { color: var(--text); font-weight: 600; }
.pill-accent { border-color: var(--accent-dim); color: #2997ff; }
.pill.dim { color: var(--dimmer); }
/* tz selector styled as a pill */
.tz-pick { padding: 0; display: inline-flex; cursor: pointer; }
.tz-pick select {
  appearance: none; -webkit-appearance: none; background: transparent; border: none;
  color: var(--dim); font-size: 12px; font-family: var(--sans); padding: 3px 22px 3px 11px;
  cursor: pointer; border-radius: 999px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='8' height='6' viewBox='0 0 8 6'><path d='M0 0l4 6 4-6z' fill='%238b94a7'/></svg>");
  background-repeat: no-repeat; background-position: right 9px center;
}
.tz-pick:hover { border-color: var(--line-2); }
.tz-pick select:focus { outline: none; color: var(--text); }
.tz-pick select option { background: var(--panel-2); color: var(--text); }
/* reliability incident timeline */
.timeline { margin: 10px 0 6px; }
.incident {
  display: flex; gap: 14px; padding: 11px 14px; margin-bottom: 9px;
  background: var(--panel); border: 1px solid var(--line);
  border-left: 3px solid var(--dimmer); border-radius: 10px;
}
.incident.inc-spot { border-left-color: #2997ff; }
.incident.inc-maintenance { border-left-color: var(--warn); }
.incident.spiked { border-left-color: var(--bad); background: rgba(255, 69, 58, 0.06); }
.inc-when { flex: none; width: 118px; text-align: right; }
.inc-ago { font-size: 12.5px; color: var(--text); font-weight: 600; }
.inc-abs { font-size: 10.5px; color: var(--dimmer); margin-top: 2px; }
.inc-body { flex: 1; min-width: 0; }
.inc-head { display: flex; gap: 12px; align-items: baseline; justify-content: space-between; }
.inc-label { font-weight: 600; color: var(--text); }
.inc-node { font-size: 11px; color: var(--dimmer); }
.inc-line { font-size: 12.5px; margin-top: 5px; color: var(--dim); line-height: 1.5; }
.inc-line b { color: var(--text); }
.podchip {
  display: inline-block; font-size: 11px; font-family: var(--mono);
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 5px;
  padding: 1px 6px; margin: 2px 4px 2px 0; color: var(--dim); white-space: nowrap;
}
@media (max-width: 720px) { .incident { flex-direction: column; gap: 4px; } .inc-when { width: auto; text-align: left; } }

/* clickable chart bars (hbar with href) */
.barlink { cursor: pointer; }
.barlink text { pointer-events: none; }
.barlink:hover rect { opacity: 0.82; }

/* cluster selector — the top-level dimension */
.cluster-select {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent-dim); border: 1px solid var(--accent-dim);
  border-radius: 999px; padding: 2px 6px 2px 11px;
}
.cluster-select .cs-label { font-size: 11px; color: #2997ff; text-transform: none; letter-spacing: -0.01em; }
.cluster-select select {
  background: transparent; color: #f5f5f7; border: 0; font-weight: 650;
  font-size: 13px; font-family: var(--sans); cursor: pointer; padding: 2px 4px;
}
.cluster-select select option { background: var(--panel-2); color: var(--text); }

/* ---- tabs ---- */
.tabs {
  display: flex; align-items: center; gap: 4px;
  padding: 0 16px; background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.tab {
  padding: 9px 14px; color: var(--dim); font-weight: 550; font-size: 13px;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }
.spacer { flex: 1; }
.ranges {
  display: flex; gap: 2px; align-items: center;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 2px 4px;
}
.range {
  padding: 3px 9px; font-size: 12px; color: var(--dim); border-radius: 999px;
  font-variant-numeric: tabular-nums; cursor: pointer;
}
.range:hover { background: var(--panel); text-decoration: none; color: var(--text); }
.range.on { background: var(--accent-dim); color: #f5f5f7; }

/* ---- time picker: pan arrows + a window dropdown (relative / start-end) ---- */
.tpwrap { display: flex; align-items: center; gap: 1px; margin-left: 4px;
          padding-left: 5px; border-left: 1px solid var(--line-2); }
.tp-pan {
  padding: 2px 6px; font-size: 13px; line-height: 1.1; color: var(--dim);
  border-radius: 5px; cursor: pointer; user-select: none;
}
.tp-pan:hover { background: var(--panel); color: var(--text); text-decoration: none; }
/* Its own literal, not the structural grey: this glyph is faint on purpose but must still
   clear 3:1 on --panel-2 in BOTH themes, and build_light_theme.py maps it deliberately. */
.tp-pan.off { color: #757578; cursor: default; }
.tp-pan.tp-now { font-size: 11px; letter-spacing: -1px; }

.tp { position: relative; }
.tp > summary { list-style: none; }
.tp > summary::-webkit-details-marker { display: none; }
.tp-btn {
  display: inline-flex; align-items: center; gap: 5px; cursor: pointer;
  padding: 3px 9px; border-radius: 999px; font-size: 12px; color: var(--text);
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.tp-btn:hover { background: var(--panel); }
.tp[open] .tp-btn { background: var(--accent-dim); color: #f5f5f7; }
.tp-btn svg { opacity: .75; flex: none; }
.tp-caret { color: var(--dim); font-size: 9px; }

.tp-panel {
  position: absolute; right: 0; top: calc(100% + 7px); z-index: var(--z-dropdown);
  background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 10px;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.55); width: 288px; overflow: hidden;
  text-align: left;
}
.tp-sec { padding: 11px 12px; }
.tp-presets { display: none; flex-wrap: wrap; gap: 4px; }
.tp-presets .tp-lab { flex: 0 0 100%; margin-bottom: 2px; }
.tp-presets .range { border: 1px solid var(--line); }
.tp-sec + .tp-sec { border-top: 1px solid var(--line); }
.tp-lab {
  display: block; font-size: 10px; color: var(--dim); text-transform: none;
  letter-spacing: -0.01em; font-weight: 700; margin-bottom: 6px;
}
.tp-row { display: flex; gap: 6px; }
.tp-row input {
  flex: 1; min-width: 0; background: var(--panel); color: var(--text);
  border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px;
  font-size: 12.5px; font-family: var(--mono);
}
.tp-row input:focus, .tp-field input:focus { outline: none; border-color: var(--accent); }
.tp-hint { font-size: 10.5px; color: var(--dimmer); line-height: 1.45; margin-top: 6px; }
.tp-hint code { color: var(--dim); }

.tp-dt { display: block; margin-bottom: 8px; }
.tp-dt > span:first-child {
  display: block; font-size: 10.5px; color: var(--dim); margin-bottom: 3px;
}
.tp-field { display: flex; gap: 5px; }
.tp-field input[type="datetime-local"] {
  flex: 1; min-width: 0; background: var(--panel); color: var(--text);
  border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px;
  font-size: 12.5px; font-family: var(--sans); color-scheme: dark;
}
/* hide the built-in indicator: we drive the native picker from .tp-cal so the
   affordance matches the rest of the panel */
.tp-field input::-webkit-calendar-picker-indicator { display: none; }
.tp-cal {
  background: var(--panel); border: 1px solid var(--line); border-radius: 6px;
  color: var(--dim); padding: 0 7px; cursor: pointer; display: flex; align-items: center;
}
.tp-cal:hover { color: var(--text); border-color: var(--line-2); }

.tp-act { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 10px; }
.tp-cancel { font-size: 12px; color: var(--dim); }
.tp-apply {
  background: var(--accent-dim); color: #f5f5f7; border: 1px solid var(--accent-dim);
  border-radius: 6px; padding: 5px 14px; font-size: 12.5px; font-weight: 600;
  cursor: pointer; font-family: var(--sans);
}
.tp-apply:hover, .tp-row button:hover { filter: brightness(1.18); }
.tp-row button {
  background: var(--accent-dim); color: #f5f5f7; border: 1px solid var(--accent-dim);
  border-radius: 6px; padding: 5px 11px; font-size: 12.5px; cursor: pointer; font-family: var(--sans);
}

/* ---- page ---- */
main { padding: 22px 20px 60px; max-width: 1220px; margin: 0 auto; }
.page-head { margin-bottom: 16px; }
.page-head h1 { font-size: 19px; font-weight: 650; margin: 0 0 2px; }
/* one count-pill everywhere a heading carries a count — page h1s, section h2s,
   and expandable summaries — so "Services (17)" and "NODE INVENTORY 6" don't
   read as two different systems */
.page-head .count, h2.sec .count, summary .count {
  font-size: 12px; font-weight: 500; color: var(--dim);
  background: var(--panel-2); border: 1px solid var(--line);
  padding: 1px 8px; border-radius: 999px; margin-left: 6px; vertical-align: middle;
  letter-spacing: 0; text-transform: none;
}
.page-head .sub { color: var(--dim); margin: 0; font-size: 13.5px; max-width: 980px; }
.page-head .back { font-size: 12px; color: var(--dim); }
.filters, .chip { font-size: 12px; }
.chip {
  display: inline-block; margin-left: 4px; padding: 2px 9px; border-radius: 999px;
  background: transparent; border: 1px solid var(--line); color: var(--dimmer);
  cursor: pointer;
}
.chip:hover { color: var(--text); border-color: var(--line-2); }
/* SELECTED must be unmistakable — the old accent-dim wash read identical to
   the base chip on this theme, so nobody could tell which source was active */
.chip.on {
  background: var(--accent); border-color: var(--accent);
  color: #000000; font-weight: 700;
}
.svc-select {
  margin-left: 8px; background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px;
  font-size: 12px; font-family: var(--sans); cursor: pointer;
}
.svc-select:hover { border-color: var(--line-2); }

/* ---- table ---- */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
table.grid { border-collapse: collapse; width: 100%; }
table.grid thead th {
  position: sticky; top: 0; background: var(--panel-2);
  text-align: right; font-size: 12px; font-weight: 600; letter-spacing: -0.01em;
  text-transform: none; color: var(--dim);
  padding: 9px 12px; border-bottom: 1px solid var(--line-2); white-space: normal; line-height: 1.25;   /* a two-line header beats a column as wide as its title */
}
table.grid thead th.txt { text-align: left; }
table.grid thead th a { color: inherit; display: inline-block; }
/* click-to-filter user cells: quiet until hovered, so 60 rows of emails don't scream */
td .uflt { color: var(--dim); }
td .uflt:hover { color: var(--accent); text-decoration: underline; }
table.grid thead th a:hover { color: var(--text); text-decoration: none; }
table.grid thead th.sorted { color: var(--text); }
table.grid thead th .arrow { color: var(--accent); }
table.grid tbody td {
  padding: 8px 12px; border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
  /* text wraps so a table fits its container (owner: "I don't want horiz scroll"); numbers,
     monospaced ids and anything marked .nowrap stay on one line */
  white-space: normal; overflow-wrap: break-word;
}
table.grid tbody td code, table.grid tbody td .path { overflow-wrap: anywhere; }   /* long paths and queries may break anywhere */
table.grid tbody td.num, table.grid tbody td.mono, table.grid tbody td.nowrap { white-space: nowrap; overflow-wrap: normal; }
table.grid tbody tr:last-child td { border-bottom: none; }
table.grid tbody tr:hover { background: #2c2c2e; }
td.num { text-align: right; font-family: var(--mono); font-size: 13px; }
/* a latency that is only a lower bound (past the histogram's top edge): "≥ 2.0 min" with a tooltip */
.floor { cursor: help; border-bottom: 1px dotted var(--dim); white-space: nowrap; }
td.txt { text-align: left; }
td.dim, .dim { color: var(--dim); }
.dimmer { color: var(--dimmer); }
td.warn { color: var(--warn); }
td.bad { color: var(--bad); font-weight: 600; }
.svc { font-weight: 600; }
.ep { font-family: var(--mono); font-size: 13px; color: #d1d1d6; }
tr.bg td.ep, tr.bg td { color: var(--dimmer); font-style: italic; }

/* micro bar behind counts */
td.barcell { position: relative; }
td.barcell .barfill {
  position: absolute; left: 0; bottom: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  opacity: 0.85; border-radius: 0 2px 2px 0;
}
td.barcell .v { position: relative; }
.sub-pct { color: var(--dimmer); font-size: 11px; }
.ep-title { font-family: var(--mono); font-size: 15px; color: #f5f5f7; }
/* drill-down query table: fixed layout so the long query column is bounded and
   scrolls horizontally on its own, keeping the timing columns aligned */
table.qtable { table-layout: fixed; width: 100%; }
table.qtable col.c-n { width: 104px; }
td.qshape { overflow: hidden; vertical-align: middle; }
.qscroll { overflow-x: auto; white-space: nowrap; padding-bottom: 3px; }
.qscroll code { color: #c7c7cc; font-size: 12.5px; white-space: nowrap; }
.qscroll::-webkit-scrollbar { height: 7px; }
.qscroll::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 4px; }
.qscroll::-webkit-scrollbar-track { background: transparent; }
.rw-w { font-size: 10px; color: var(--warn); border: 1px solid #5c4400; border-radius: 4px; padding: 0 4px; margin-left: 6px; vertical-align: middle; }
td.ep a { color: #d1d1d6; }
td.ep a:hover { color: var(--accent); }

.legend { color: var(--dim); font-size: 12.5px; margin: 12px 2px 0; max-width: 980px; }
.legend b { color: var(--dim); }
.empty {
  padding: 28px; text-align: center; color: var(--dim);
  border: 1px dashed var(--line-2); border-radius: 10px; background: var(--panel);
}
.empty b { color: var(--text); }

/* slow */
.src { font-family: var(--mono); font-size: 11px; padding: 1px 6px; border-radius: 5px; }
.src-neo4j { background: #0a2440; color: #2997ff; }
.src-api { background: #0c2f1a; color: #30d158; }
.src-read { background: #0a2440; color: #2997ff; }
.src-write { background: rgba(255, 159, 10,0.15); color: #ff9f0a; }
.nowrap { white-space: nowrap; }
td.detail { white-space: normal; max-width: 640px; }
td.detail code { color: #aeaeb2; }

/* endpoint sub-nav */
.subnav { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
.subtab {
  padding: 4px 12px; font-size: 12px; font-weight: 550; color: var(--dim);
  border: 1px solid var(--line); border-radius: 999px;
}
.subtab:hover { color: var(--text); text-decoration: none; border-color: var(--line-2); }
.subtab.active { background: var(--accent-dim); color: #f5f5f7; border-color: var(--accent-dim); }

.sec-sub { color: var(--dim); font-size: 12.5px; margin: -2px 2px 10px; max-width: 980px; }
h2.sec { font-size: 13px; font-weight: 600; color: var(--dim); margin: 20px 2px 8px; text-transform: none; letter-spacing: -0.01em; }

/* traces */
tr.click { cursor: pointer; }
tr.click:hover { background: #2c2c2e; }
.tlabel { font-weight: 600; color: var(--text); }
.go { color: var(--accent); font-size: 11px; margin-left: 6px; }
td.dur { font-weight: 600; }
.mono { font-family: var(--mono); }
.outcome { font-size: 11px; padding: 1px 8px; border-radius: 999px; text-transform: lowercase; }
.o-success { background: #0c2f1a; color: #30d158; }
.o-error { background: #4a1214; color: #ff6961; }
.o-unset { background: #2c2c2e; color: #8e8e93; }
.mark { font-size: 10.5px; padding: 1px 7px; border-radius: 999px; font-weight: 600; text-transform: none; letter-spacing: -0.01em; }
.mark-fastest { background: #0c2f1a; color: #30d158; }
.mark-slowest { background: #4a1214; color: #ff6961; }
.drift { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; white-space: nowrap; }
.drift.warn { background: rgba(255, 159, 10,0.12); color: var(--warn); }
.drift.bad  { background: rgba(255, 69, 58,0.16); color: #ff6961; }
.drift.good { background: #0c2f1a; color: #30d158; }
.shape-svc { display: block; font-size: 10.5px; margin-top: 3px; }
.trace-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.trace-meta .mm { font-size: 13px; color: var(--text); }
.trace-meta code { color: #d1d1d6; }
.tid { font-size: 11px; color: var(--dimmer); margin-top: 6px; }

/* logs explorer */
.logfilter {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; margin-bottom: 14px;
}
.logfilter label { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--dim); }
.logfilter select, .logfilter input {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 6px; padding: 5px 9px; font-size: 12px; font-family: var(--sans);
}
.logfilter .tracebox { flex: 1; min-width: 220px; }
.logfilter .tracebox input { width: 100%; font-family: var(--mono); }
.logfilter .searchbox { flex: 1.6; min-width: 260px; }
.logfilter .searchbox input { width: 100%; font-family: var(--mono); }
.logfilter .searchbox input:focus { outline: none; border-color: var(--accent); }

/* ---- logs timeline (volume over time, severity-stacked) ---- */
.logtl-wrap {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px 4px; margin-bottom: 12px;
}
.logtl-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; font-size: 11.5px; }
.logtl-title { font-weight: 700; font-size: 12.5px; letter-spacing: .02em; }
.logtl-key { display: flex; gap: 10px; margin-left: auto; flex-wrap: wrap; }
.logtl-key .tlk { display: inline-flex; align-items: center; gap: 4px; color: var(--dim); }
.logtl-key .tlk i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.logtl-wrap svg.logtl { width: 100%; height: auto; display: block; margin-top: 2px; }
/* the whole column is a hit target — the transparent full-height rect in each
   bar group makes a 3px-tall bucket clickable too */
.logtl-wrap a.tlbar { cursor: pointer; }
.logtl-wrap a.tlbar:hover rect { fill-opacity: .78; }
.logtl-wrap a.tlbar:hover rect:first-child { fill: #2c2c2e; fill-opacity: 1; }
.logtl-foot { margin: 2px 0 4px; font-size: 11px; color: var(--dimmer); line-height: 1.5; }
.logtl-q { margin: 0 0 2px; }
.logtl-q .qmodal { margin: 0; }
.logtl-foot .tl-warn { color: var(--warn); }
.logtl-none { margin-bottom: 12px; }
/* "found on another cluster" — the empty-search rescue */
.els {
  margin-top: 10px; padding: 10px 12px; text-align: left;
  background: #2c2c2e; border: 1px solid #0a2042; border-radius: 8px; font-size: 12.5px;
}
.els-list { display: inline-flex; gap: 6px; flex-wrap: wrap; margin-left: 4px; }
.els-hit {
  background: var(--accent-dim); color: #f5f5f7; border-radius: 999px;
  padding: 2px 10px; font-size: 12px; white-space: nowrap;
}
.els-hit:hover { filter: brightness(1.2); text-decoration: none; }
.els-hit b { color: #fff; }

/* "this trace outlives its request" — a fire-and-forget handler's background work
   sharing the trace id. Amber, not red: the data is correct, the naive reading isn't. */
.async-warn {
  background: #3a2a00; border: 1px solid #5c4400; border-left: 3px solid var(--warn);
  border-radius: 8px; padding: 11px 13px; margin-bottom: 14px; font-size: 13px; line-height: 1.5;
}
.async-warn b { color: #ffd60a; }
.pill.warn { background: #3a2a00; color: #ffd60a; }
/* skeleton: bars breathing while Monitoring answers, so the strip doesn't pop
   the rows down the page when it lands */
.logtl-skel {
  display: flex; align-items: flex-end; gap: 5px; height: 132px; padding: 10px 12px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 12px;
}
.logtl-skel span { flex: 1; background: var(--panel-2); border-radius: 2px; animation: tlpulse 1.4s ease-in-out infinite; }
.logtl-skel span:nth-child(odd) { height: 45%; }
.logtl-skel span:nth-child(even) { height: 70%; }
.logtl-skel span:nth-child(3n) { height: 30%; animation-delay: .2s; }
.logtl-skel span:nth-child(4n) { height: 85%; animation-delay: .4s; }
@keyframes tlpulse { 0%, 100% { opacity: .35; } 50% { opacity: .8; } }

/* free-text search hits. Amber-on-dark rather than the canvas default yellow,
   which is unreadable on this surface and fights the status hues (green/amber/red
   are reserved for state). Inline-block would break the nowrap ellipsis on a
   collapsed row, so the mark stays a plain inline run. */
mark.hl {
  background: #5c4400; color: #ffd60a; border-radius: 2px;
  padding: 0 1px; box-shadow: 0 0 0 1px #6b5200;
}
.codeblock mark.hl, pre mark.hl { background: #5c4400; color: #ffd60a; }
.hitq { color: #ffd60a; }
.logfilter button {
  background: var(--accent-dim); color: #f5f5f7; border: 1px solid var(--accent-dim);
  border-radius: 6px; padding: 6px 14px; font-size: 12px; font-weight: 600; cursor: pointer;
}
.logfilter .clear { font-size: 12px; color: var(--dim); align-self: center; }

.loglist { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--panel); }
.logrow { border-bottom: 1px solid var(--line); border-left: 2px solid transparent; }
.logrow:last-child { border-bottom: none; }
.logrow > summary {
  display: flex; align-items: baseline; gap: 10px; padding: 6px 12px; cursor: pointer;
  font-family: var(--mono); font-size: 12px; list-style: none;
}
.logrow > summary::-webkit-details-marker { display: none; }
.logrow > summary:hover { background: #2c2c2e; }
.logrow[open] > summary { background: #2c2c2e; }
.logrow .ts { color: var(--dimmer); white-space: nowrap; min-width: 62px; }
/* relative ⇄ absolute timestamp toggle */
.loglist .ts-abs { display: none; }
.loglist.abs-time .ts-rel { display: none; }
.loglist.abs-time .ts-abs { display: inline; }
.loglist.abs-time .logrow .ts { min-width: 150px; }
.ts-toggle { margin-left: 8px; }
.ts-toggle .tt-label { font-size: 11px; margin-right: 3px; }
.ts-toggle .chip { cursor: pointer; }
.logrow .svc { color: var(--accent); white-space: nowrap; } /* never wrap "virtual-assistant" mid-name */
/* a row that belongs to a Jenkins run: the run id, highlighted, one click to every line of that run */
.logrow .runchip { font-size: 11px; font-weight: 600; padding: 0 8px; border-radius: 999px; border: 1px solid var(--accent);
  color: var(--accent); background: var(--accent-dim); white-space: nowrap; text-decoration: none; margin: 0 6px 0 0; }
.logrow .runchip:hover { background: var(--accent); color: var(--bg); }
.logrow .lmsg { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sev { font-size: 10px; padding: 0 6px; border-radius: 4px; white-space: nowrap; }
.sev-INFO, .sev-DEFAULT { background: #2c2c2e; color: #8e8e93; }
.sev-WARNING { background: #3a2a00; color: #ffd60a; }
.sev-ERROR, .sev-CRITICAL { background: #4a1214; color: #ff6961; }
.logrow.sev-b-ERROR, .logrow.sev-b-CRITICAL { border-left-color: var(--bad); }
.logrow.sev-b-WARNING { border-left-color: var(--warn); }
.logrow.is-neo4j { border-left-color: var(--accent); }
.kind { font-size: 10px; padding: 1px 7px; border-radius: 999px; font-weight: 600; text-transform: none; letter-spacing: -0.01em; white-space: nowrap; }
.kind-neo4j { background: rgba(10, 132, 255,0.16); color: #2997ff; }
.kind-ok { background: rgba(48, 209, 88,0.16); color: #30d158; }
.kind-fail { background: rgba(255, 69, 58,0.16); color: #ff6961; }
.logdetail { padding: 8px 14px 12px 24px; background: #1c1c1e; }
.filterable { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; align-items: center; }
.fl-label { font-size: 10px; color: var(--dimmer); text-transform: none; }
.filterable a {
  font-family: var(--mono); font-size: 11px; color: var(--dim); background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 5px; padding: 1px 7px;
}
.filterable a:hover { border-color: var(--accent-dim); color: #f5f5f7; text-decoration: none; }
.filterable a b { color: var(--dimmer); font-weight: 500; }
/* expanded-row field grid: label/value pairs for every field */
.lf-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 4px 18px; margin-bottom: 10px;
}
.lf { display: flex; gap: 8px; font-size: 12px; align-items: baseline; min-width: 0; }
.lf-k {
  color: var(--dimmer); text-transform: none; font-size: 10px; letter-spacing: -0.01em;
  min-width: 58px; flex: none; text-align: right;
}
.lf-v { color: var(--text); overflow-wrap: anywhere; }
.lf-v.mono { font-family: var(--mono); font-size: 11.5px; color: #c7c7cc; }

/* grouped expanded log line — a small label over each cluster of fields */
.lb-grp { margin-bottom: 10px; }
.lb-grp .lf-grid { margin-bottom: 0; }
.lb-gk {
  display: block; font-size: 10px; text-transform: none; letter-spacing: -0.01em;
  color: var(--dimmer); opacity: 0.85; margin: 0 0 4px;
}
.lb-err {
  display: flex; gap: 10px; align-items: baseline; margin: 0 0 10px;
  padding: 6px 10px; border-left: 2px solid var(--bad); border-radius: 3px;
}
.lb-ek {
  color: var(--bad); text-transform: none; font-size: 10px; letter-spacing: -0.01em;
  flex: none; font-weight: 600;
}
.lb-ev { color: var(--text); font-family: var(--mono); font-size: 11.5px; overflow-wrap: anywhere; }

.lb-label {
  font-size: 10px; color: var(--dimmer); text-transform: none; letter-spacing: -0.01em;
  margin: 8px 0 3px;
}
/* code blocks — msg & cypher PRESERVE newlines and wrap (no clipping); json scrolls */
pre.codeblock {
  margin: 0; padding: 10px 12px; background: #000000; border: 1px solid var(--line);
  border-radius: 6px; font-family: var(--mono); font-size: 11.5px; color: #c7c7cc;
  tab-size: 2;
}
pre.msg, pre.cypher { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 420px; overflow-y: auto; }
pre.cypher { color: #f5f5f7; }
pre.json { white-space: pre; overflow-x: auto; max-height: 360px; }
.rawjson { margin-top: 8px; }
.rawjson > summary {
  cursor: pointer; font-size: 10.5px; color: var(--dimmer); text-transform: none;
  letter-spacing: -0.01em; list-style: none; padding: 2px 0;
}
.rawjson > summary::-webkit-details-marker { display: none; }
.rawjson > summary:hover { color: var(--dim); }
.rawjson > summary::before { content: "▸ "; }
.rawjson[open] > summary::before { content: "▾ "; }
.rawjson[open] > summary { margin-bottom: 6px; }

/* dashboard stat tiles */
.stat-grid {
  /* 178px fits six tiles across at the 1180px content width — the AI, Auth0,
     placement & drill-down pages all have exactly six, and 212px stranded the
     sixth alone on a second row */
  display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
  gap: 12px; margin-bottom: 24px;
}
/* NOT overflow:hidden. That clipped the "?" explainers (.tip-body opens upward, out of
   the tile) to a sliver. The only things that need the rounded clip are the full-bleed
   strips along the bottom edge, so they clip themselves (.stat-spark, .sevbar-wrap). */
.stat-tile {
  position: relative; display: flex; flex-direction: column;
  background:
    radial-gradient(260px 90px at 12% -10%, rgba(41, 151, 255,0.07), transparent 65%),
    linear-gradient(180deg, #1c1c1e 0%, var(--panel) 55%);
  border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px 0; min-height: 116px;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.stat-tile:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,0,0,0.35); }
.stat-tile:hover { border-color: var(--line-2); }
/* the lift makes the tile a stacking context; raise it so its open explainer is not
   painted under the next tile along */
.stat-tile:hover, .stat-tile:focus-within { z-index: var(--z-raised); }
.linktile { text-decoration: none; color: inherit; cursor: pointer; transition: border-color .1s, background .1s; }
.linktile:hover { border-color: var(--accent-dim); background: var(--panel-2); }
.linktile .stat-sub { color: var(--accent); opacity: .85; }
/* Logs (severity) tile: header links to all logs; legend items + bar segments link per-severity */
.sevtile:hover { border-color: var(--line-2); }
.tile-head { text-decoration: none; color: inherit; display: block; cursor: pointer; }
.tile-head .stat-sub { color: var(--accent); opacity: .85; }
.sevleg a.sl { text-decoration: none; color: inherit; cursor: pointer; border-radius: 4px; }
.sevleg a.sl:hover { color: var(--text); }
.sevbar-wrap .barlink:hover rect { opacity: 0.7; stroke: var(--text); stroke-width: 0.5; }
.stat-label { font-size: 11px; text-transform: none; letter-spacing: -0.01em; color: var(--dim); }
.stat-big {
  font-size: 32px; font-weight: 680; line-height: 1.12; color: var(--text);
  margin-top: 6px; font-variant-numeric: tabular-nums;
}
.stat-sub { font-size: 12px; color: var(--dimmer); margin-top: 3px; }
.stat-spark { margin: 10px -16px 0; margin-top: auto; height: 40px; }
.stat-spark, .sevbar-wrap { overflow: hidden; border-radius: 0 0 11px 11px; }   /* the tile's 12px corner, inside its 1px border */
.stat-spark .spark { width: 100%; height: 40px; display: block; }
/* severity split (Logs tile) */
.sevleg { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: auto; padding-top: 10px; font-size: 10.5px; color: var(--dim); }
.sevleg .sl { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.sevleg .sl i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; flex: none; }
.sevbar-wrap { margin: 7px -16px 0; height: 9px; }
.sevbar { width: 100%; height: 9px; display: block; }

/* charts */
.charts-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px;
}
@media (max-width: 900px) { .charts-grid { grid-template-columns: 1fr; } }

/* gauges / donuts / status grid */
.chart-body.center { display: flex; justify-content: center; align-items: center; }
.gauge { max-width: 210px; width: 100%; height: auto; }
.donut { display: block; margin: 4px auto; }
.statusgrid { display: flex; flex-wrap: wrap; gap: 3px; padding-top: 8px; }
.statusgrid .sq { width: 12px; height: 12px; border-radius: 2px; }

/* trace heatmap */
.hm-stats { display: flex; flex-wrap: wrap; gap: 16px; font-size: 12.5px; color: var(--dim); margin-bottom: 12px; }
.hm-stats b { color: var(--text); font-variant-numeric: tabular-nums; }
.hm-stats .bad { color: #ff6961; }
.hm-wrap {
  overflow-x: auto; border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel); padding: 10px 10px 4px;
}
.heatmap { width: 100%; min-width: 760px; height: auto; display: block; }
.heatmap a { cursor: pointer; }
.heatmap a:hover rect { stroke: #f5f5f7; stroke-width: 1.3; }

/* async fragments — branded Xray loader: the mark "scans" while data loads.
   Ring = a sweeping aperture arc, wave = the tilde signal drawing itself,
   dot = the focal point pulsing. */
.frag { margin-bottom: 18px; }
.frag-loading {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  color: var(--dim); font-size: 13px; padding: 34px 16px;
  border: 1px dashed var(--line-2); border-radius: 12px;
  background:
    radial-gradient(420px 120px at 50% 0%, rgba(41, 151, 255, 0.05), transparent 70%),
    var(--panel);
}
.xloader svg { width: 30px; height: 30px; color: var(--accent); }
.xloader .xl-text { letter-spacing: 0.01em; }
.xl-ring {
  opacity: 0.55; stroke-dasharray: 17 49;           /* ~a quarter of the ring lit */
  transform-box: fill-box; transform-origin: center;
  animation: xl-sweep 1.6s linear infinite;
}
.xl-wave {
  stroke-dasharray: 30; stroke-dashoffset: 30;
  animation: xl-draw 2.4s ease-in-out infinite;
}
.xl-dot { animation: xl-pulse 1.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes xl-sweep { to { transform: rotate(360deg); } }
@keyframes xl-draw {
  0% { stroke-dashoffset: 30; opacity: 0.35; }
  45% { stroke-dashoffset: 0; opacity: 1; }
  70% { stroke-dashoffset: 0; opacity: 1; }
  100% { stroke-dashoffset: -30; opacity: 0.35; }
}
@keyframes xl-pulse { 0%, 100% { transform: scale(1); opacity: 0.7; } 50% { transform: scale(1.7); opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .xl-ring, .xl-wave, .xl-dot { animation-duration: 4.5s; }
}
/* fragment content fades up when it lands */
.frag-in { animation: frag-in 0.28s ease-out; }
@keyframes frag-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
/* fragment failure card */
/* Archive-coverage note. Sits at the very top of a fragment, because it changes how
   every number below it should be read — a 7-day tab that only reached 3 days must not
   be discovered after the reader has drawn a conclusion. */
/* Collector freshness, under a claim that is only as current as the last run. */
.fresh { margin-top: 6px; font-size: 11.5px; color: var(--dim); line-height: 1.5; }
.fresh b { color: var(--text); }
.fresh-stale { color: var(--warn); }
.fresh-stale b { color: var(--warn); }

/* BETA markers. Loud on purpose: the failure this guards against is someone taking a
   provisional number into a meeting, so it has to be legible before the number is. */
.beta-tag {
  display: inline-block; margin-left: 6px; padding: 1px 5px;
  font-family: var(--mono); font-size: 9px; font-weight: 700; letter-spacing: -0.01em;
  line-height: 1.5; vertical-align: 2px; border-radius: 3px;
  color: var(--bg); background: var(--warn);
}
.beta-big {
  display: inline-block; margin: 0 4px 0 2px; padding: 3px 10px;
  font-family: var(--mono); font-size: 13px; font-weight: 800; letter-spacing: -0.01em;
  vertical-align: 5px; border-radius: 5px;
  color: var(--bg); background: var(--warn);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 22%, transparent);
}

.arch-note {
  margin: 0 0 12px; padding: 9px 12px; border-radius: 8px;
  font-size: 12.5px; line-height: 1.5;
  border: 1px solid var(--line); background: var(--panel); color: var(--dim);
}
.arch-note b { color: var(--text); }
.arch-ok   { border-color: color-mix(in srgb, var(--good) 40%, var(--line)); }
.arch-warn { border-color: color-mix(in srgb, var(--warn) 55%, var(--line));
             background: color-mix(in srgb, var(--warn) 7%, var(--panel)); }
.arch-bad  { border-color: color-mix(in srgb, var(--bad) 55%, var(--line));
             background: color-mix(in srgb, var(--bad) 8%, var(--panel)); }
.arch-note[data-archive-scanning] b::after {
  content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 7px;
  border-radius: 50%; background: var(--warn); animation: arch-pulse 1.4s infinite;
}
@keyframes arch-pulse { 0%,100% { opacity: .25 } 50% { opacity: 1 } }
@media (prefers-reduced-motion: reduce) {
  .arch-note[data-archive-scanning] b::after { animation: none; opacity: .8 }
}

.frag-err {
  display: flex; align-items: center; gap: 10px; color: var(--dim); font-size: 13px;
  padding: 22px 16px; border: 1px dashed rgba(255, 69, 58, 0.35); border-radius: 12px;
  background: rgba(255, 69, 58, 0.05);
}
.frag-err code { color: var(--bad); }
.frag-note {
  font-size: 12px; color: var(--warn); background: rgba(255, 159, 10,0.08);
  border: 1px solid rgba(255, 159, 10,0.25); border-radius: 8px; padding: 7px 11px; margin-bottom: 12px;
}
.frag-foot { font-size: 11.5px; color: var(--dimmer); text-align: right; margin-top: 8px; }

/* logs pager */
.pager { display: flex; gap: 8px; align-items: center; justify-content: center; margin: 16px 0 4px; }
.pg {
  font-size: 13px; padding: 6px 13px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
}
a.pg:hover { border-color: var(--accent-dim); color: #f5f5f7; text-decoration: none; }
.pg.cur { background: var(--accent-dim); color: #f5f5f7; border-color: var(--accent-dim); font-weight: 600; }
.pg.off { color: var(--dimmer); opacity: 0.45; }
.chart-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px 10px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.chart-card:hover { border-color: var(--line-2); box-shadow: 0 8px 26px rgba(0,0,0,0.30); }
.chart-title { font-size: 14px; font-weight: 600; color: var(--text); }
.chart-sub { font-size: 12.5px; color: var(--dim); margin-bottom: 6px; }

/* ---- explainers -------------------------------------------------------
   "Open file descriptors". "Vector tombstones by class". These are Weaviate's
   words, precise to Weaviate and meaningless to the person who opened this
   page because search felt slow. The subtitle has room for a clause; what is
   missing is WHAT IT MEANS WHEN THE LINE MOVES, which is the only reason to
   look at a chart at all. So every chart carries one, one hop away: a chip
   that costs nothing when you already know, and answers the question in place
   when you don't — instead of in a runbook nobody opens mid-incident.
   Hover OR keyboard focus, because a tooltip reachable only by mouse is a
   tooltip half the fleet can't read. */
.tip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px; border-radius: 50%; margin-left: 6px;
  border: 1px solid var(--line-2); background: var(--panel-2);
  color: var(--dimmer); font-size: 10px; font-weight: 700; line-height: 1;
  cursor: help; vertical-align: 1px; position: relative; user-select: none;
}
.tip:hover, .tip:focus-visible { color: #f5f5f7; border-color: var(--accent-dim); outline: none; }
.tip > .tip-body {
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  width: max-content; max-width: 340px; z-index: var(--z-dropdown);
  background: #000000; border: 1px solid var(--line-2); border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.55);
  padding: 9px 11px; font-size: 12px; font-weight: 400; line-height: 1.5;
  color: var(--text); text-align: left; white-space: normal;
  max-width: min(340px, calc(100vw - 24px));
  display: none;
}
.tip:hover > .tip-body, .tip:focus-visible > .tip-body,
.tip:focus-within > .tip-body { display: block; animation: tip-in 0.12s ease-out; }
@keyframes tip-in { from { opacity: 0; } to { opacity: 1; } }
.tip > .tip-body b { color: #f5f5f7; font-weight: 600; }
.tip > .tip-body .tip-worry { display: block; margin-top: 6px; color: var(--warn); }
/* first/last column cards would push the bubble off-screen */
.charts-grid > .chart-card:first-child .tip > .tip-body { left: 0; transform: none; }
.charts-grid > .chart-card:last-child .tip > .tip-body { left: auto; right: 0; transform: none; }
.chart-body { width: 100%; }
svg.chart { width: 100%; height: auto; display: block; }
.legend-row { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; padding-left: 4px; }
.legend-solo .lg { background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; border-radius: 4px; }
.legend-solo .lg:hover { text-decoration: underline; }
.legend-solo .lg:focus-visible { outline: 2px solid var(--accent, #0a84ff); outline-offset: 2px; }
.legend-solo .lg.off { opacity: .35; }
.legend-solo .lg[aria-pressed="true"] { font-weight: 600; }
.legend-solo .lg-hint { font-size: 11.5px; align-self: center; margin-left: auto; }
.legend-solo .lg-more { text-decoration: none; color: var(--accent, #0a84ff); }
.legend-solo .lg-more:hover { text-decoration: underline; }
.lg { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--dim); }
.lg .sw { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }

.foot {
  color: var(--dimmer); font-size: 11.5px; text-align: center;
  padding: 16px; border-top: 1px solid var(--line); margin-top: 30px;
}
.foot code { color: var(--dim); }

/* auth0 tab additions */
td.good { color: var(--good); font-weight: 600; }
.stat-big.good { color: var(--good); }
.stat-big.bad { color: var(--bad); }
.stat-big.warn { color: var(--warn); }   /* tiles pass tone="warn" too; it used to fall through to plain ink */
.stat-big.sm { font-size: 17px; font-weight: 600; line-height: 1.3; }
.auth0-filters, .api-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.q-input {
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
  border-radius: 6px; padding: 5px 9px; font-size: 12px; font-family: var(--sans);
  min-width: 190px;
}
.q-input:focus { outline: none; border-color: var(--accent-dim); }
.legend.meta { margin: 4px 0 14px; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; align-items: start; }
.two-col .sec { margin-top: 0; }
.empty.sm { padding: 14px 16px; min-height: 0; font-size: 12.5px; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }

/* ---- AI call log: the every-attribute detail table ---------------------
   The point of expanding a call is to see EVERYTHING the record carries, so
   this is a plain key/value dump grouped by what the field is for, not a
   curated subset. Two columns on wide screens, one on narrow; keys stay
   readable at a glance because the value column is the one that wraps. */
.attr-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 12px 20px; align-items: start;
}
.attr-group {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 11px; min-width: 0;
}
.attr-h {
  font-size: 11px; font-weight: 700; letter-spacing: -0.01em; text-transform: none;
  color: var(--dim); margin-bottom: 6px;
}
.attr-t { width: 100%; border-collapse: collapse; table-layout: fixed; }
.attr-t td { padding: 3px 0; vertical-align: top; border-bottom: 1px solid var(--line); font-size: 12px; }
.attr-t tr:last-child td { border-bottom: 0; }
.attr-t td.ak { width: 44%; color: var(--dim); padding-right: 10px; word-break: break-word; }
.attr-t td.av { color: var(--text); word-break: break-word; font-size: 11.5px; }
/* one-click routes into the views people actually want, above the filter bar */
.quickf { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; margin: 12px 0 6px; }
.quickf .fl-label { color: var(--dimmer); font-size: 11.5px; }
a.qf {
  font-size: 12px; padding: 3px 10px; border-radius: 12px; white-space: nowrap;
  border: 1px solid var(--line); background: var(--panel); color: var(--dim);
}
a.qf:hover { border-color: var(--accent-dim); color: #f5f5f7; text-decoration: none; }
a.qf.on { background: var(--accent-dim); color: #f5f5f7; border-color: var(--accent-dim); font-weight: 600; }

/* checkbox filters sit in the same bar as the selects */
.logfilter label.cbox {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--dim);
  white-space: nowrap;
}
.logfilter label.cbox input { accent-color: var(--accent); }

/* reliability "why" chips */
.why-chip {
  display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 10px;
  margin: 1px 3px 1px 0; border: 1px solid var(--line-2); color: var(--dim);
  white-space: nowrap;
}
.why-chip.bad  { background: rgba(255, 69, 58,0.16); color: #ff6961; border-color: transparent; }
.why-chip.warn { background: rgba(255, 159, 10,0.15); color: #ff9f0a; border-color: transparent; }
.why-chip.info { background: rgba(10, 132, 255,0.16); color: #2997ff; border-color: transparent; }
.why-chip.dim  { color: var(--dimmer); }

/* ---- placement: spot/on-demand chips, node inventory grid ---- */
.chip.spot { background: rgba(255, 159, 10,0.16); color: #ff9f0a; border-color: transparent; }
.chip.std  { background: rgba(10, 132, 255,0.16); color: #2997ff; border-color: transparent; }
.chip.unk  { background: var(--panel-2); color: var(--dimmer); border-color: var(--line); }
.node-key { margin-left: 12px; color: var(--dim); font-size: 12px; }
.node-key .sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }
.node-key .sw.spot { background: var(--warn); }
.node-key .sw.std  { background: var(--accent); }

.node-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(184px, 1fr));
  gap: 10px; margin: 4px 0 6px;
}
.node-card {
  background: var(--panel); border: 1px solid var(--line);
  border-left: 3px solid var(--dimmer); border-radius: 9px; padding: 9px 11px;
}
.node-card.spot { border-left-color: var(--warn); }
.node-card.std  { border-left-color: var(--accent); }
.node-card.unk  { border-left-color: var(--dimmer); }
.nc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; }
.nc-pool { font-family: var(--mono); font-size: 12px; color: var(--text); font-weight: 600; }
.nc-head .chip { margin-left: 0; }
.nc-metric { display: flex; align-items: center; gap: 7px; margin: 3px 0; }
.nc-k { font-size: 10.5px; color: var(--dim); width: 24px; text-transform: none; letter-spacing: -0.01em; }
.nc-metric .bar {
  flex: 1; height: 6px; background: var(--panel-2); border-radius: 3px;
  overflow: hidden; border: 1px solid var(--line);
}
.nc-metric .bar .fill { display: block; height: 100%; border-radius: 3px; }
.nc-metric .bar .fill.ok   { background: var(--good); }
.nc-metric .bar .fill.warn { background: var(--warn); }
.nc-metric .bar .fill.crit { background: var(--bad); }
.nc-v { font-family: var(--mono); font-size: 11px; color: var(--dim); width: 34px; text-align: right; }
.nc-node { font-size: 10px; margin-top: 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- pods: resource buckets ---- */
.node-key .sw.ok   { background: var(--good); }
.node-key .sw.over { background: var(--warn); }
.node-key .sw.hot  { background: var(--bad); }

.pod-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 10px; margin: 6px 0;
}
.pod-box {
  display: block; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 11px 13px; color: var(--text);
}
a.pod-box:hover { border-color: var(--line-2); background: var(--panel-2); }
.pod-box.static { cursor: default; }
.pb-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 9px; }
.pb-name { font-weight: 650; font-size: 13px; }
.pb-pods { font-size: 11px; color: var(--dim); }
.pb-hint { font-size: 11px; color: var(--dim); margin-top: 6px; }

.bkt { display: flex; align-items: center; gap: 9px; margin: 5px 0; }
.bkt-k { width: 30px; font-size: 10.5px; color: var(--dim); text-transform: none; letter-spacing: -0.01em; }
.bkt-track {
  position: relative; flex: 1; height: 12px; background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 3px; overflow: hidden;
}
.bkt-fill { position: absolute; left: 0; top: 0; height: 100%; border-radius: 3px 0 0 3px; }
.bkt.ok    .bkt-fill { background: var(--good); }
.bkt.over  .bkt-fill { background: var(--warn); }
.bkt.burst .bkt-fill { background: #ff9f0a; }
.bkt.hot   .bkt-fill { background: var(--bad); }
/* request marker — a tick line the fill is read against */
.bkt-req { position: absolute; top: -1px; width: 2px; height: 14px; background: var(--text); opacity: 0.72; }
.bkt-req::after {
  content: ""; position: absolute; top: -3px; left: -2px; width: 6px; height: 6px;
  border-radius: 50%; background: var(--text); opacity: 0.9;
}
.bkt-v { width: 150px; text-align: right; font-family: var(--mono); font-size: 11px; color: var(--text); }
.bkt-v .dim { color: var(--dimmer); }

.pod-detail-buckets { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 4px 0 14px; }
.pod-detail-buckets .pod-box { padding: 13px 15px; }
@media (max-width: 720px) { .pod-detail-buckets { grid-template-columns: 1fr; } }

/* restart & why banner */
.restart-banner {
  display: flex; align-items: center; gap: 18px; margin: 4px 0 10px;
  background: var(--panel); border: 1px solid var(--line);
  border-left: 3px solid var(--dimmer); border-radius: 10px; padding: 12px 16px;
}
.restart-banner.has-fail { border-left-color: var(--bad); }
.rb-num { text-align: center; min-width: 74px; }
.rb-count { font-size: 34px; font-weight: 700; line-height: 1; }
.rb-count.bad { color: var(--bad); }
.rb-label { font-size: 11px; color: var(--dim); margin-top: 4px; }
.rb-why { flex: 1; }
.rb-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.rb-note { font-size: 12px; color: var(--dim); }
.restart-events { margin: 0 0 14px; }
.restart-events > summary { cursor: pointer; font-size: 12px; color: var(--dim); padding: 4px 0; }
.restart-events > summary:hover { color: var(--text); }

/* pods head tiles — used/requested with a utilization bar + colored percent */
.res-head { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 12px 0 8px; }
@media (max-width: 760px) { .res-head { grid-template-columns: 1fr; } }
.res-tile { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 13px 16px; }
.res-tile.accent { border-left: 3px solid var(--accent); }
.res-big { font-size: 33px; font-weight: 700; line-height: 1.1; margin-top: 5px; }
.res-val { font-size: 21px; font-weight: 650; margin-top: 5px; white-space: nowrap; }
.res-val .res-slash, .res-val .res-req { color: var(--dimmer); font-weight: 500; }
.res-bar { height: 6px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 3px; overflow: hidden; margin: 9px 0 7px; }
.res-fill { display: block; height: 100%; border-radius: 3px; background: var(--good); min-width: 2px; }
.res-fill.warn { background: var(--warn); }
.res-fill.bad { background: var(--bad); }
.res-fill.good { background: var(--good); }
.res-pct { font-size: 12px; color: var(--dim); }
.res-pct.warn { color: var(--warn); }
.res-pct.bad { color: var(--bad); }
.res-pct.good { color: var(--good); }

/* pod box node-type accent + meta row */
.pod-box.node-spot { border-left: 3px solid var(--warn); }
.pod-box.node-std  { border-left: 3px solid var(--accent); }
.pb-meta { display: inline-flex; align-items: center; gap: 6px; }
.pb-meta .chip { margin-left: 0; }


/* ---- finish: selection, scrollbars, focus, row hover ---- */
::selection { background: rgba(41, 151, 255, 0.32); color: #f5f5f7; }
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 6px; border: 2px solid var(--bg); }
*::-webkit-scrollbar-thumb:hover { background: #48484a; }
*::-webkit-scrollbar-track { background: transparent; }
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 2px solid rgba(41, 151, 255, 0.55); outline-offset: 1px; border-radius: 4px;
}
table.grid tbody tr { transition: background 0.08s; }
table.grid tbody tr:hover { background: rgba(41, 151, 255, 0.045); }
.tab { transition: color 0.12s, border-bottom-color 0.12s; }
.range, .chip, .pill { transition: background 0.12s, color 0.12s, border-color 0.12s; }

/* ---- "queries behind this view" modal (full verifiability) ---- */
.qmodal { display: flex; justify-content: flex-end; margin: 6px 0 2px; position: relative; }
.qmodal.qm-left { justify-content: flex-start; }
.qmodal > summary { list-style: none; }
.qmodal > summary::-webkit-details-marker { display: none; }
.qm-chip {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  font-size: 11.5px; color: var(--dim); background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 11px;
  transition: color 0.12s, border-color 0.12s;
}
.qm-chip svg { opacity: 0.8; }
.qm-chip:hover { color: #2997ff; border-color: var(--accent-dim); }
.qmodal[open] .qm-chip { color: #2997ff; border-color: var(--accent-dim); }
.qmodal[open]::before {  /* dimmed backdrop */
  content: ""; position: fixed; inset: 0; z-index: var(--z-modal); background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(2px);
}
.qm-panel {
  position: fixed; z-index: calc(var(--z-modal) + 1); left: 50%; top: 7vh; transform: translateX(-50%);
  width: min(980px, 94vw); max-height: 84vh; overflow-y: auto;
  background: linear-gradient(180deg, #1c1c1e 0%, var(--panel) 60%);
  border: 1px solid var(--line-2); border-radius: 14px; padding: 18px 20px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
  animation: frag-in 0.18s ease-out;
}
.qm-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.qm-head b { font-size: 15px; }
.qm-sub { color: var(--dim); font-size: 12.5px; margin-top: 3px; max-width: 720px; }
.qm-close {
  flex: none; background: var(--panel-2); color: var(--dim); border: 1px solid var(--line);
  border-radius: 8px; width: 28px; height: 28px; cursor: pointer; font-size: 13px;
}
.qm-close:hover { color: var(--text); border-color: var(--line-2); }
.qm-item { margin-bottom: 14px; }
.qm-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 5px; font-size: 12px; }
.qm-note { font-size: 11.5px; }
.qm-actions { margin-left: auto; display: inline-flex; gap: 8px; align-items: center; }
.qm-kind {
  font-size: 10.5px; font-weight: 650; letter-spacing: -0.01em; text-transform: none;
  padding: 1px 8px; border-radius: 999px; border: 1px solid transparent;
}
.k-cloud-logging { color: #2997ff; background: rgba(41, 151, 255, 0.12); border-color: rgba(41, 151, 255, 0.35); }
.k-bigquery { color: #ffb340; background: rgba(255, 159, 10, 0.14); border-color: rgba(255, 159, 10, 0.4); }
.k-cloud-monitoring { color: #6ee7a0; background: rgba(48, 209, 88, 0.12); border-color: rgba(48, 209, 88, 0.35); }
.k-promql { color: #d0a8ff; background: rgba(191, 90, 242, 0.14); border-color: rgba(191, 90, 242, 0.4); }
.qm-q {
  font-family: var(--mono); font-size: 12px; line-height: 1.55; color: #f5f5f7;
  background: #1c1c1e; border: 1px solid var(--line); border-radius: 9px;
  padding: 10px 12px; margin: 0; white-space: pre-wrap; word-break: break-word;
  max-height: 300px; overflow-y: auto;
}
.qcopy {
  background: var(--accent-dim); color: #f5f5f7; border: 1px solid var(--accent-dim);
  border-radius: 6px; padding: 2px 10px; font-size: 11.5px; cursor: pointer; font-family: var(--sans);
}
.qcopy:hover { filter: brightness(1.2); }
.qopen { font-size: 11.5px; white-space: nowrap; }
.qm-foot { font-size: 11.5px; margin-top: 2px; }

/* attribution tab */
.attr-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; font-size: 12px; }
.grid tfoot tr.tot td { border-top: 1px solid var(--line-2); color: var(--text); }
.grid tr.hl-row { background: #1c1c1e; }

/* errors tab — grouped recurring errors */
.errlist { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--panel); }
.errgroup { border-bottom: 1px solid var(--line); border-left: 2px solid var(--bad); }
.errgroup:last-child { border-bottom: none; }
.errgroup > summary {
  display: flex; align-items: baseline; gap: 10px; padding: 8px 12px; cursor: pointer;
  font-size: 12.5px; list-style: none;
}
.errgroup > summary::-webkit-details-marker { display: none; }
.errgroup > summary:hover, .errgroup[open] > summary { background: #2c2c2e; }
.err-count {
  flex: none; min-width: 44px; text-align: right; font-weight: 700; color: #ff6961;
  font-variant-numeric: tabular-nums;
}
.err-rate { flex: none; min-width: 62px; font-size: 11px; color: var(--dimmer); font-variant-numeric: tabular-nums; }
.errgroup .err-caller { flex: none; color: var(--dimmer); font-size: 11px; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.err-shape { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }


/* ── Test-suite heatmap ─────────────────────────────────────────────────────
   State is carried by the LETTER, not the colour: these get screenshotted into
   Slack, printed, and read by people who cannot separate red from green. Colour
   is the fast scan, the glyph is the fact. Cells are deliberately small — 35
   columns must fit without horizontal scroll on a laptop. */
table.heat th.hcol { padding: 2px 0; font-size: 10px; color: #8e8e93; text-align: center; }
table.heat td.hcell {
  width: 18px; min-width: 18px; padding: 3px 0; text-align: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px;
  font-weight: 600; border-radius: 2px;
}
.st { display: inline-block; min-width: 16px; padding: 0 4px; margin: 0 2px;
      border-radius: 3px; font-family: ui-monospace, Menlo, monospace; font-weight: 600; }
.st-passed,  td.st-passed  { background: #0c2f1a; color: #30d158; }
.st-partial, td.st-partial { background: #3a2a00; color: #ffd60a; }
.st-failed,  td.st-failed  { background: #4a1214; color: #ff453a; }
.st-no-run,  td.st-no-run  { background: #1c1c1e; color: #939396; }
.st-unknown, td.st-unknown { background: #2a1a3d; color: #bf5af2; }

.cards { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0 20px; }
.card { background: #1c1c1e; border: 1px solid #2c2c2e; border-radius: 6px;
        padding: 10px 14px; min-width: 190px; }
.card-k { font-size: 11px; color: #8e8e93; font-family: ui-monospace, Menlo, monospace; }
.card-v { font-size: 22px; font-weight: 600; line-height: 1.3; }
.card-v.bad { color: #ff453a; } .card-v.warn { color: #ffd60a; }
.card-sub { font-size: 11px; color: #939396; }

/* Date partition rows in the runs table: a heading that still carries the day's
   totals, so scanning by date does not mean losing the numbers. */
table.grid tr.daterow > td { background: #1c1c1e; border-top: 1px solid #2c2c2e; }
table.grid tr.daterow b { color: #d1d1d6; }

/* ── grouped navigation ──────────────────────────────────────────────────────
   Fifteen flat tabs became six groups plus Admin. A group with one page is a
   plain link; the rest are <details>, so open/close is native — no JS, works
   with the keyboard, and survives a failed script load. The dropdown carries a
   one-line description per item, which is the whole point of grouping: the bar
   can now say what a page is for instead of just naming it. */
.tabs { position: relative; z-index: var(--z-header); flex-wrap: wrap; }
.tab-spacer { flex: 1; }
.tab.quiet { color: var(--dim); font-weight: 500; }
.tab.quiet:hover { color: var(--text); }
.tab.ver {
  font-variant-numeric: tabular-nums; font-size: 12px; letter-spacing: 0.02em;
  opacity: 0.85;
}

.tab-menu { position: relative; }
.tab-menu > summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 5px;
}
.tab-menu > summary::-webkit-details-marker { display: none; }
.tab-menu .caret { font-size: 9px; opacity: 0.55; transform: translateY(1px); }
.tab-menu[open] > summary { color: var(--text); }
.tab-menu[open] .caret { opacity: 0.9; }

.tab-menu .menu {
  position: absolute; top: calc(100% + 1px); left: 0; z-index: var(--z-dropdown);
  min-width: 310px; max-width: 380px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.55);
  padding: 6px; overflow: hidden;
}
.tab-menu.right .menu { left: auto; right: 0; }
.tab-menu .menu-head {
  padding: 7px 10px 9px; font-size: 11.5px; line-height: 1.45; color: var(--dim);
  border-bottom: 1px solid var(--line); margin-bottom: 5px;
}
.menu-item {
  display: block; padding: 8px 10px; border-radius: 7px; color: var(--text);
}
.menu-item:hover { background: var(--panel-2); text-decoration: none; }
.menu-item.on { background: var(--accent-dim); }
.menu-item.on .mi-label { color: #f5f5f7; }
.mi-label { display: block; font-size: 13px; font-weight: 600; }
.mi-blurb {
  display: block; font-size: 11.5px; line-height: 1.45; color: var(--dim);
  margin-top: 2px;
}

/* ── first-run note ──────────────────────────────────────────────────────── */
/* A card in the corner, not a modal (see base.html): no scrim, nothing intercepting
   clicks outside it. It sits above the dock's bar on the dock's layer, and never
   outgrows the viewport — the group list is folded and scrolls inside the card. */
.tour {
  position: fixed; z-index: var(--z-dock);
  left: calc(var(--side-w) + 16px); bottom: 16px;
  width: min(400px, calc(100vw - var(--side-w) - 32px));
}
body.has-dock .tour { bottom: calc(var(--dock-h) + 12px); }
.tour-card {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px;
  padding: 16px 18px 14px;
  max-height: calc(100vh - 120px);
  max-height: calc(100dvh - 120px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}
.tour-card h2 { padding-right: 36px; }   /* room for the × */
.tour-more { min-height: 0; display: flex; flex-direction: column; margin-bottom: 12px; }
.tour-more > summary { cursor: pointer; font-size: 12.5px; color: var(--accent); }
.tour-more[open] > summary { margin-bottom: 10px; }
.tour-card .tour-grid { overflow-y: auto; min-height: 0; max-height: 46vh; padding-right: 4px; margin-bottom: 0; }
.tour-card .tour-act { flex: 0 0 auto; padding-top: 12px; border-top: 1px solid var(--line); }
.tour-x {
  position: absolute; top: 8px; right: 10px; width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid transparent; border-radius: 8px;
  color: var(--dim); font-size: 22px; line-height: 1; cursor: pointer;
}
.tour-x:hover, .tour-x:focus-visible { color: var(--text); border-color: var(--line); background: var(--bg, transparent); }
.tour-card h2 { margin: 0 0 4px; font-size: 16px; }
.tour-card .tour-sub { color: var(--dim); font-size: 13px; margin: 0 0 10px; }
.tour-grid { display: grid; grid-template-columns: 1fr; gap: 8px; margin: 0; }
.tour-grid dt { font-size: 12.5px; font-weight: 650; color: var(--text); }
.tour-grid dd { margin: 2px 0 0; font-size: 12px; line-height: 1.5; color: var(--dim); }
.tour-act { display: flex; align-items: center; gap: 12px; justify-content: flex-end; }
.tour-act .btn {
  background: var(--accent-dim); color: #f5f5f7; border: 1px solid var(--line);
  border-radius: 8px; padding: 7px 14px; font-size: 13px; cursor: pointer;
}
.tour-act .btn:hover { text-decoration: none; filter: brightness(1.15); }
.tour-act .lnk { color: var(--dim); font-size: 12.5px; cursor: pointer; }

/* ── guide & releases ────────────────────────────────────────────────────── */
.guide-grp { margin: 26px 0 0; }
.guide-grp > h3 { margin: 0 0 2px; font-size: 15px; }
.guide-grp > .gg-blurb { color: var(--dim); font-size: 12.5px; margin: 0 0 12px; }
.guide-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 10px; }
.guide-card {
  display: block; border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; background: var(--panel);
}
.guide-card:hover { background: var(--panel-2); text-decoration: none; border-color: #3a3a3c; }
.guide-card .gc-label { font-size: 13.5px; font-weight: 650; color: var(--text); }
.guide-card .gc-path { font-size: 11px; color: var(--dim); font-family: ui-monospace, monospace; margin-left: 6px; }
/* block, or the path and blurb run on as one sentence with the title */
.guide-card .gc-blurb { display: block; font-size: 12px; line-height: 1.5; color: var(--dim); margin-top: 5px; }

.recipe { border-left: 2px solid var(--accent); padding: 2px 0 2px 16px; margin: 14px 0 20px; }
.recipe h4 { margin: 0 0 6px; font-size: 13.5px; }
.recipe ol { margin: 0; padding-left: 18px; }
.recipe li { font-size: 12.5px; line-height: 1.65; color: var(--dim); margin-bottom: 3px; }
.recipe li b, .recipe li a { color: var(--text); }

/* Release-notes pager. Page 1 is the newest release, so the arrows read as time:
   "newer" to the left, "older" to the right. */
.pager { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 14px 0 24px; }
.pager a.pill { text-decoration: none; color: var(--dim); }
.pager a.pill:hover { color: var(--text); border-color: var(--accent-dim); }
.pager .pill.on { color: var(--text); border-color: var(--accent); font-weight: 600; }
.pager .pill.dim { opacity: 0.55; }
.pager-gap { color: var(--dimmer); padding: 0 2px; }
.pager-meta { margin-left: auto; font-size: 12px; color: var(--dimmer); }
.pager-meta a { color: var(--dim); }
.rel { border-left: 2px solid var(--line); padding-left: 18px; margin-bottom: 30px; }
.rel.latest { border-left-color: var(--accent); }
.rel-h { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.rel-v { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rel-d { font-size: 12px; color: var(--dim); font-variant-numeric: tabular-nums; }
.rel-tag {
  font-size: 10.5px; text-transform: none; letter-spacing: -0.01em;
  background: var(--accent-dim); color: #f5f5f7; border-radius: 999px; padding: 2px 8px;
}
.rel-head { font-size: 13px; color: var(--text); margin-bottom: 12px; }
.rel h4 { margin: 14px 0 6px; font-size: 12px; text-transform: none;
          letter-spacing: -0.01em; color: var(--dim); }
.rel ul { margin: 0; padding-left: 18px; }
.rel li { font-size: 12.5px; line-height: 1.65; margin-bottom: 5px; color: var(--dim); }
.rel li b, .rel li strong { color: var(--text); font-weight: 600; }
.rel li code, .rel-note code { font-size: 11.5px; }
.rel-note { font-size: 12.5px; line-height: 1.6; color: var(--dim); margin-top: 12px;
            padding-top: 10px; border-top: 1px solid var(--line); }

.buildbox {
  display: flex; gap: 26px; flex-wrap: wrap; border: 1px solid var(--line);
  border-radius: 10px; padding: 12px 16px; margin-bottom: 8px; background: var(--panel);
}
.buildbox div { font-size: 12px; }
.buildbox .bk { color: var(--dim); display: block; margin-bottom: 2px; }
.buildbox .bv { font-family: ui-monospace, monospace; font-size: 12.5px; color: var(--text); }

@media (max-width: 760px) {
  .tour-grid { grid-template-columns: 1fr; }
  .tab-menu .menu { min-width: 260px; }
}

/* ── skip link ───────────────────────────────────────────────────────────── */
.skip {
  position: absolute; left: -9999px; top: 0; z-index: var(--z-top);
  background: var(--accent-dim); color: #f5f5f7; padding: 9px 14px;
  border-radius: 0 0 8px 0; font-size: 13px;
}
.skip:focus { left: 0; text-decoration: none; }
main:focus { outline: none; }

/* ── command palette ─────────────────────────────────────────────────────── */
.pal {
  position: fixed; inset: 0; z-index: var(--z-overlay); display: flex;
  align-items: flex-start; justify-content: center;
  background: rgba(0, 0, 0, 0.6); padding: 90px 20px 20px;
}
.pal[hidden] { display: none; }
.pal-box {
  width: 100%; max-width: 620px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.62);
}
.pal-box > input {
  width: 100%; box-sizing: border-box; background: transparent; border: 0;
  border-bottom: 1px solid var(--line); color: var(--text);
  padding: 15px 18px; font-size: 15px; outline: none;
}
.pal-box > input::placeholder { color: var(--dim); }
.pal-list { max-height: 340px; overflow-y: auto; padding: 6px; }
.pal-item {
  display: grid; grid-template-columns: 78px 1fr; grid-template-rows: auto auto;
  gap: 0 12px; padding: 9px 12px; border-radius: 8px; color: var(--text);
  align-items: baseline;
}
.pal-item:hover { text-decoration: none; }
.pal-item.on { background: var(--accent-dim); }
.pal-item .pi-g {
  grid-row: 1 / span 2; font-size: 10.5px; text-transform: none;
  letter-spacing: -0.01em; color: var(--dim); padding-top: 2px;
}
.pal-item.on .pi-g { color: #2997ff; }
.pal-item .pi-l { font-size: 13.5px; font-weight: 620; }
.pal-item.on .pi-l { color: #f5f5f7; }
.pal-item .pi-b {
  grid-column: 2; font-size: 11.5px; line-height: 1.45; color: var(--dim);
  margin-top: 2px;
}
.pal-none { padding: 18px; text-align: center; color: var(--dim); font-size: 13px; }
.pal-foot {
  display: flex; gap: 16px; padding: 9px 16px; border-top: 1px solid var(--line);
  font-size: 11px; color: var(--dim); background: var(--panel-2);
}
.pal-foot kbd {
  background: var(--panel); border: 1px solid var(--line); border-radius: 4px;
  padding: 1px 5px; margin-right: 3px; font-family: ui-monospace, monospace;
  font-size: 10.5px;
}

/* ── 404 ─────────────────────────────────────────────────────────────────── */
.nf { max-width: 620px; margin: 60px auto; text-align: center; }
.nf h2 { font-size: 22px; margin-bottom: 6px; }
.nf .nf-path {
  font-family: ui-monospace, monospace; font-size: 13px; color: var(--dim);
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 6px; padding: 4px 10px; display: inline-block; margin-bottom: 18px;
}
.nf p { color: var(--dim); font-size: 13px; line-height: 1.6; }
.nf-links { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 22px; }
.nf-links a {
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px;
  font-size: 13px; background: var(--panel);
}
.nf-links a:hover { background: var(--panel-2); text-decoration: none; }

/* ── evals ───────────────────────────────────────────────────────────────── */
.split2 { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; align-items: start; }
@media (max-width: 900px) { .split2 { grid-template-columns: 1fr; } }

.cards.small .card { min-width: 120px; }
.cards.small .card-v { font-size: 20px; }

.chiprow { display: flex; flex-wrap: wrap; gap: 7px; margin: 4px 0 20px; }
.chip {
  display: inline-flex; align-items: baseline; gap: 5px;
  background: var(--accent-dim); color: #f5f5f7; border-radius: 999px;
  padding: 2px 10px; font-size: 11.5px; font-family: ui-monospace, monospace;
}
.chip b { font-family: inherit; font-weight: 600; opacity: 0.65; font-size: 10.5px;
          text-transform: none; letter-spacing: -0.01em; }
.chip.judge { background: #4a3200; color: #ffb340; }
.chip.warn  { background: #4a2c00; color: #ffb340; }
.chip.dimchip { background: var(--panel-2); color: var(--dim); }

/* one failed item, expanded — expectation beside what actually came back */
.evitem {
  border: 1px solid var(--line); border-left-width: 2px; border-radius: 10px;
  padding: 12px 14px; margin-bottom: 10px; background: var(--panel);
}
.evitem.bad { border-left-color: #d9382e; }
.ev-h { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.ev-id { font-size: 12px; color: var(--dim); }
.ev-t { font-size: 13.5px; font-weight: 600; }
.ev-cmp { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 8px; }
@media (max-width: 760px) { .ev-cmp { grid-template-columns: 1fr; } }
.ev-k {
  display: block; font-size: 10.5px; text-transform: none; color: var(--dim);
  letter-spacing: -0.01em; margin-bottom: 3px;
}
.ev-cmp pre, .ev-raw pre {
  margin: 0; background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 7px; padding: 8px 10px; font-size: 11.5px; line-height: 1.5;
  max-height: 220px; overflow: auto; white-space: pre-wrap; word-break: break-word;
}
.ev-cmp > div:first-child pre { border-left: 2px solid #248a3d; }
.ev-cmp > div:last-child  pre { border-left: 2px solid #d9382e; }
.ev-why { font-size: 12px; line-height: 1.55; color: var(--dim); margin-bottom: 6px; }
.ev-why.bad { color: #ff6961; }
.ev-raw summary { cursor: pointer; font-size: 11.5px; color: var(--dim); }
.ev-raw[open] summary { margin-bottom: 6px; }

code.exp { color: #30d158; }
code.act { color: var(--dim); }
code.act-bad { color: #ff6961; }
.small { font-size: 11.5px; }
.barfill.good { background: rgba(48, 209, 88, 0.28); }

/* ── Journey: a session as the path someone walked ────────────────────────
   The SCREEN is the unit and its calls are the detail, so each screen is a
   collapsible rather than a heading above yet another table. Flat, a
   twelve-screen session was a wall of rows you had to scroll to count; here the
   route is readable at a glance and you expand the one you came for. */
.jlist { display: flex; flex-direction: column; gap: 8px; }

.jscreen { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.jscreen[open] { border-color: var(--line-2); }
.jscreen > summary {
  display: flex; align-items: baseline; gap: 10px; padding: 10px 14px;
  cursor: pointer; list-style: none; font-size: 12.5px;
}
.jscreen > summary::-webkit-details-marker { display: none; }
.jscreen > summary:hover { background: var(--panel-2); border-radius: 10px; }
.jscreen[open] > summary { border-bottom: 1px solid var(--line); border-radius: 10px 10px 0 0; }
.jscreen > summary::before {
  content: "▸"; color: var(--dimmer); font-size: 10px; width: 10px; flex: none;
}
.jscreen[open] > summary::before { content: "▾"; }

/* The step number: this screen's place in the route. */
.jstep {
  flex: none; min-width: 20px; height: 20px; padding: 0 5px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 5px; background: var(--panel-2); border: 1px solid var(--line-2);
  color: var(--dim); font-size: 11px; font-variant-numeric: tabular-nums;
}

/* The path is the headline — it is what the reader is scanning for. */
.jpath {
  font-family: var(--mono); font-size: 13px; color: var(--text);
  overflow-wrap: anywhere;
}

/* Cost, pushed right so the numbers line up down the list and the expensive
   screen is findable without reading a single path. */
.jstats {
  margin-left: auto; flex: none; color: var(--dim); font-size: 12px;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.jstats b { color: var(--text); }

.jbody { padding: 12px 14px 14px; }
.jbody .tablewrap { border-radius: 8px; }

@media (max-width: 900px) {
  /* Stacked, the cost line keeps its own row rather than crushing the path. */
  .jscreen > summary { flex-wrap: wrap; }
  .jstats { margin-left: 30px; width: 100%; white-space: normal; }
}

/* One chip per TIME a call was made, with the Cypher that occurrence issued —
   so a repeat can be judged, not just counted. */
.jocc a {
  display: inline-block; margin-right: 5px; padding: 0 5px; border-radius: 4px;
  border: 1px solid var(--line-2); background: var(--panel-2);
  font-variant-numeric: tabular-nums; font-size: 11px; text-decoration: none;
}
.jocc a:hover { border-color: var(--accent-dim); background: #1c1c1e; }
.jocc .jocc-n { color: var(--dimmer); }
/* The heaviest occurrence — the one worth opening first. */
.jocc a.jheavy { border-color: var(--warn); }
.jocc a.jheavy .jocc-n { color: var(--warn); }

/* `#2 4cy` — the ordinal and its cost, deliberately not separated by a middot:
   `2·4` was read as "2 of 4". The unit suffix removes the ambiguity. */
.jocc .jocc-n { margin-left: 4px; }

/* Real values — query strings and Cypher parameters. Legible rather than dimmed
   into unreadability: they are the difference between "this endpoint is slow"
   and "this endpoint is slow for THIS id", which is the whole reason to look. */
.jparam {
  font-family: var(--mono); font-size: 11px; color: #aeaeb2;
  overflow-wrap: anywhere;
}

/* The navigation marker in the sequence view: where the screen changed. */
.jseq tr.jnav td { background: #1c1c1e; border-top: 1px solid var(--line-2); padding-top: 8px; }
.jseq tr.jnav .jpath { font-size: 12px; }

/* Both journey views are rendered once; the toggle only flips which is shown,
   so switching costs nothing rather than re-running an 8-17s log join. */
/* four readings of one dataset: exactly one is displayed, the switch is a
   class flip, and nothing re-fetches */
.jviews .jview-screens, .jviews .jview-seq,
.jviews .jview-graph, .jviews .jview-tree, .jviews .jview-story { display: none; }
.jviews.show-story .jview-story { display: block; }
.jviews.show-screens .jview-screens { display: block; }
.jviews.show-seq .jview-seq { display: block; }
.jviews.show-graph .jview-graph { display: block; }
.jviews.show-tree .jview-tree { display: block; }
.jview-btn { cursor: pointer; font: inherit; }

/* ── Journey polish: compact, wrapped, collapsible, copyable ──────────────
   The first live sessions read as a wall: every statement expanded, params
   pushing the table into horizontal scroll, everything the same grey. The
   rules below are that feedback, applied:
   - NOTHING scrolls sideways: every long token wraps inside its cell.
   - Cypher is a one-line summary you OPEN when you care, with a copy button
     that yields the full runnable statement (the visible text is the grouped
     shape; copy gives the untruncated original plus params).
   - What the user DID is a row of tinted chips, one hue per kind of act, so
     a journey reads as person-did-thing, not log-line. */

/* the statements column: bounded, wrapped, collapsed by default */
.jstmt-col { max-width: 460px; }

/* One statement = one card. The run-count is a BADGE, never fused into the
   text — "9×WITH…" read as if the cipher started with 9× — and the cipher
   prints IN FULL underneath, pre-wrapped. Each card collapses on its own:
   closed, its summary shows the badge plus a one-line ellipsized preview. */
.jstmt2 {
  margin: 6px 0; border: 1px solid var(--line); border-radius: 7px;
  background: var(--bg); overflow: hidden;
}
.jstmt2 > summary {
  display: flex; align-items: center; gap: 7px; padding: 5px 8px;
  cursor: pointer; list-style: none; user-select: none; min-width: 0;
}
.jstmt2 > summary::-webkit-details-marker { display: none; }
.jstmt2 > summary::before {
  content: "▸"; font-size: 9px; color: var(--dimmer); flex: none;
}
.jstmt2[open] > summary::before { content: "▾"; }
.jstmt2 > summary:hover { background: var(--panel-2); }
.jmult {
  flex: none; font-family: var(--mono); font-size: 10.5px; line-height: 1;
  padding: 3px 7px; border-radius: 999px;
  background: var(--accent-dim); border: 1px solid var(--accent-dim);
  color: #2997ff; font-variant-numeric: tabular-nums;
}
/* the one-line preview exists only while the card is CLOSED */
.jprev {
  flex: 1; min-width: 0; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; font-size: 11px; color: var(--dim);
}
.jstmt2[open] .jprev { visibility: hidden; }
.jstmt2 .jcopy { flex: none; margin-left: auto; position: static; }
.jfull {
  margin: 0; padding: 7px 9px 8px 9px; border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 11px; line-height: 1.55;
  color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere;
}
.jfull-params { padding: 0 9px 8px; }
.jseq td, .jview-screens td { vertical-align: top; }
.jseq td.txt, .jview-screens td.txt { overflow-wrap: anywhere; }

/* tighter rows: the journey is read top to bottom, density is kindness */
.jbody table.grid td { padding: 7px 10px; font-size: 12.5px; }
.jbody table.grid thead th { padding: 7px 10px; font-size: 11px; }
/* The base grid forbids wrapping (white-space: nowrap) — correct for compact
   numeric tables, fatal under fixed layout here: a long path or a +6989s
   offset PAINTS ACROSS its neighbour cells instead of wrapping. Journey cells
   wrap; numeric cells stay on one line (their columns are sized for their
   worst case below). */
.jbody table.grid td.txt { white-space: normal; overflow-wrap: anywhere; }
.jbody table.grid td.num { white-space: nowrap; }

/* FIXED layout is what actually kills horizontal scroll: with auto layout a
   percent-encoded query string sets the column's minimum width and the numbers
   walk off the right edge. Fixed, the widths below are law and every long
   token wraps inside its own cell. */
.jbody table.grid { table-layout: fixed; }
.jbody table.grid th.jc-t { width: 80px; }
.jbody table.grid th.jc-n { width: 58px; }
.jbody table.grid th.jc-ms { width: 86px; }
.jbody table.grid th.jc-st { width: 66px; }
.jbody table.grid th.jstmt-col { width: 34%; }
.jq { word-break: break-all; }

/* the collapsible statements block */
.jcy > summary {
  cursor: pointer; list-style: none; display: inline-flex; align-items: center;
  gap: 5px; padding: 1px 8px; border: 1px solid var(--line);
  border-radius: 999px; font-size: 11px; color: var(--dim);
  background: var(--panel-2); user-select: none; white-space: nowrap;
}
.jcy > summary::-webkit-details-marker { display: none; }
.jcy > summary::before { content: "▸"; font-size: 9px; color: var(--dimmer); }
.jcy[open] > summary::before { content: "▾"; }
.jcy > summary:hover { border-color: var(--accent-dim); color: var(--text); }
.jcy[open] { display: block; }
.jcy[open] > summary { margin-bottom: 2px; }

/* copy: one button per statement, full text + params on the clipboard */
.jcopy {
  position: absolute; top: 0; right: 0;
  width: 20px; height: 20px; display: inline-flex; align-items: center;
  justify-content: center; padding: 0;
  background: var(--panel-2); color: var(--dim);
  border: 1px solid var(--line); border-radius: 5px;
  font-size: 11px; cursor: pointer; line-height: 1;
}
.jcopy:hover { border-color: var(--accent-dim); color: var(--accent); }
.jcopy.ok { border-color: var(--good); color: var(--good); }

/* what the user did: tinted chips, one hue per kind of act.
   In the SEQUENCE view they stack vertically, oldest first — the page reads
   top-down, so the interactions must too; each row carries its own time so
   the order is stated, not implied. The grouped view's screen-level chips
   stay horizontal: that is a deduped summary set, not a timeline. */
.jacts { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; margin: 0 0 6px; }
.jact-row { display: flex; align-items: center; gap: 7px; }
.jact-t { font-size: 10px; color: var(--dimmer); font-variant-numeric: tabular-nums; white-space: nowrap; }
.jacts-screen { flex-direction: row; flex-wrap: wrap; gap: 4px; margin: 0 0 10px; }
.jact {
  font-family: var(--mono); font-size: 10.5px; line-height: 1;
  padding: 3px 7px; border-radius: 999px; border: 1px solid var(--line-2);
  color: var(--dim); background: var(--panel-2); overflow-wrap: anywhere;
}
.jact-press  { background: #0c2f1a; border-color: #1a5235; color: #30d158; }
.jact-nav    { background: #0a2440; border-color: #1a4b80; color: #2997ff; }
.jact-type   { background: #2a1a3d; border-color: #3d2a63; color: #d0a8ff; }
.jact-scroll { background: var(--panel-2); border-color: var(--line-2); color: var(--dim); }
.jact-entity { background: #3a2a00; border-color: #5c4400; color: #ffd60a; }

/* method, tinted like the rest of the industry so the eye already knows it */
.meth { font-family: var(--mono); font-size: 10.5px; font-weight: 650; letter-spacing: -0.01em; }
.meth-get { color: #2997ff; }
.meth-post { color: #30d158; }
.meth-put, .meth-patch { color: #ff9f0a; }
.meth-delete { color: #ff453a; }

/* query strings: wrapped to the cell, clamped to two lines, full text on hover */
.jq {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}

/* the session header: who, then the numbers, no more pale dot-line */
.jhead { margin: 2px 0 6px; display: flex; flex-direction: column; gap: 8px; }
.jhead-who { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.jhead-user { font-size: 15px; font-weight: 650; }
.jhead-stats { display: flex; gap: 6px; flex-wrap: wrap; }
.jstat {
  border: 1px solid var(--line); background: var(--panel);
  border-radius: 7px; padding: 3px 9px; font-size: 12px; color: var(--dim);
  font-variant-numeric: tabular-nums;
}
.jstat b { color: var(--text); font-weight: 650; }
.jjoin { font-size: 11.5px; margin: 0 0 12px; }

/* legends fold away: the explanation is there the first time and gone after */
.legend-fold { margin-top: 10px; }
.legend-fold > summary {
  cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; color: var(--dimmer); user-select: none;
}
.legend-fold > summary::-webkit-details-marker { display: none; }
.legend-fold > summary::before { content: "▸"; font-size: 9px; }
.legend-fold[open] > summary::before { content: "▾"; }
.legend-fold > summary:hover { color: var(--dim); }
.legend-fold .legend { margin-top: 6px; }

/* ── the rail: a journey should LOOK like one ─────────────────────────────
   The sequence view gets a vertical line with a numbered node per navigation,
   so the path someone walked reads as a path — not another stack of cards. */
.jview-screens .jlist, .jview-seq .jlist { position: relative; margin-left: 4px; padding-left: 30px; }
.jview-screens .jlist::before, .jview-seq .jlist::before {
  content: ""; position: absolute; left: 14px; top: 16px; bottom: 16px; width: 2px;
  background: linear-gradient(180deg, var(--accent-dim), var(--line-2));
  border-radius: 2px;
}
.jview-screens .jscreen, .jview-seq .jscreen { position: relative; }
.jview-screens .jscreen > summary .jstep, .jview-seq .jscreen > summary .jstep {
  position: absolute; left: -26px; top: 9px;
  width: 22px; height: 22px; min-width: 22px; padding: 0;
  border-radius: 50%; border-color: var(--accent-dim);
  background: var(--panel-2); color: #2997ff; z-index: var(--z-raised);
}
.jview-screens .jscreen[open] > summary .jstep, .jview-seq .jscreen[open] > summary .jstep {
  background: var(--accent-dim); color: #f5f5f7; border-color: var(--accent);
}
.jview-screens .jscreen[open], .jview-seq .jscreen[open] { border-color: var(--accent-dim); }
.dimmer { color: var(--dimmer); }

/* a session with activity in the last five minutes — the row the reader who
   just used the app is looking for */
.jlive { color: var(--good); font-weight: 600; }
.jlive::before { content: "●"; font-size: 8px; margin-right: 5px; vertical-align: 1px; }


/* long-lived request badges: a WS/SSE row is a CONNECTION, not a call, and its
   duration is a lifetime, not latency — say so wherever such a row appears */
.sbadge {
  display: inline-block; font-family: var(--mono); font-size: 9.5px;
  font-weight: 700; letter-spacing: -0.01em; line-height: 1;
  padding: 2px 5px; border-radius: 4px; vertical-align: 1px;
}
.sbadge-ws  { background: #0a2e38; border: 1px solid #14606e; color: #64d2ff; }
.sbadge-sse { background: #0c2f1a; border: 1px solid #1a6b48; color: #30d158; }
.sbadge-job { background: #2a1a3d; border: 1px solid #545060; color: #bf5af2; }

/* cypher_card inside table cells: the collapsed line needs real width, and the
   expanded text must wrap inside the cell rather than widen the table */
td.qshape { min-width: 200px; max-width: 640px; overflow-wrap: anywhere; }   /* was 320: forced a sideways scroll at 1440px */
.qcard { margin: 0; }
.qcard .jprev { max-width: 100%; }

/* the expanded statement list scrolls by itself: all N shapes are present
   (they SUM to the fold's statement count), and the page stays put */
.jcy-list { max-height: 460px; overflow-y: auto; padding-right: 4px; }
.jcy-list::-webkit-scrollbar { width: 7px; }
.jcy-list::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 4px; }


/* interactions as their own table row: user acts are a different KIND of event
   than requests — tinted ground, no bottom border so the row visually attaches
   to the request it led to */
.jact-tr td { border-bottom: none !important; padding-top: 8px !important; padding-bottom: 2px !important; background: rgba(41, 151, 255,0.03); }

/* ── guided walkthrough (xrTour) ──────────────────────────────────────────── */
.xtour-launch {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--accent-dim); color: #f5f5f7;
  border: 1px solid var(--accent); border-radius: 8px;
  padding: 7px 16px; font-size: 13.5px; font-weight: 650; cursor: pointer;
}
.xtour-launch:hover { background: #1a4b80; text-decoration: none; }
/* the spotlight: a fixed box whose gigantic shadow dims everything else —
   works in every engine, no clip-path required */
.xtour-spot {
  position: fixed; z-index: var(--z-top); pointer-events: none;
  border: 2px solid var(--accent); border-radius: 9px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.72);
  transition: all 0.25s ease;
}
.xtour-pop {
  position: fixed; z-index: calc(var(--z-top) + 1);
  background: var(--panel-2); border: 1px solid var(--accent-dim);
  border-radius: 11px; padding: 14px 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}
.xtour-step { font-size: 10.5px; color: var(--dimmer); letter-spacing: -0.01em; }
.xtour-title { margin: 4px 0 6px; font-size: 15px; }
.xtour-body { font-size: 12.5px; color: var(--dim); line-height: 1.55; }
.xtour-body b { color: var(--text); }
.xtour-body .jact { font-size: 10px; }
.xtour-act { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }
.xtour-btn {
  background: var(--panel); border: 1px solid var(--line-2); color: var(--dim);
  border-radius: 7px; padding: 5px 12px; font-size: 12px; cursor: pointer;
}
.xtour-btn:hover { color: var(--text); border-color: var(--accent-dim); }
.xtour-next { background: var(--accent-dim); color: #f5f5f7; border-color: var(--accent); }

/* the repeated-calls pill is a real control, and its evidence flashes */
.jrep-jump { cursor: pointer; font: inherit; }
.jhelp {
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px; margin-left: 4px; border-radius: 50%;
  border: 1px solid currentColor; font-size: 9.5px; cursor: help; opacity: 0.85;
}
.jrep-flash td { animation: jrepflash 2.6s ease-out; }
@keyframes jrepflash {
  0%, 60% { background: rgba(255, 159, 10, 0.18); }
  100% { background: transparent; }
}

/* ── journey visualizations (heartbeat, step graph, cost map) ─────────────── */
.jheart { margin: 2px 0 14px; }
.jheart svg { display: block; width: 100%; height: auto; }
.jhb-hit { cursor: pointer; }
.jhb-hit:hover { filter: brightness(1.25); }
.jhb-ax { font: 500 10px ui-monospace, Menlo, Consolas, monospace; fill: var(--dim); }

.jviz-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center;
  font-size: 11.5px; color: var(--dim); margin: 0 0 10px; }
.jviz-sw { display: inline-block; width: 9px; height: 9px; border-radius: 3px;
  vertical-align: -1px; margin-right: 5px; }
.jviz-mono { font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 11px; overflow-wrap: anywhere; }
.jviz-err { color: var(--bad); font-weight: 600; }
.jviz-tip { position: fixed; z-index: var(--z-popover); pointer-events: none; display: none;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 7px;
  padding: 7px 10px; font-size: 12px; max-width: 360px; color: var(--dim);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .45); }
.jviz-tip b { color: var(--text); }
.jviz-flash > summary { animation: jrepflash 2.4s ease-out; }

.vizwrap { border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; background: var(--panel); }
.vizwrap svg { display: block; width: 100%; height: auto; }

/* step graph */
.jsg-node { stroke: var(--bg); stroke-width: 2; }
.jsg-lbl { font: 500 10.5px ui-monospace, Menlo, Consolas, monospace; fill: var(--dim); }
.jsg-edge { stroke: var(--line-2); stroke-width: 1.4; }
.jsg-chev { fill: var(--dim); }
.jsg-ring { stroke: var(--text); stroke-width: 1.8; }
.jsg-panel { position: sticky; bottom: 10px; z-index: var(--z-sticky); margin-top: 10px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 14px; box-shadow: 0 -6px 24px rgba(0, 0, 0, .35); }
.jsg-ph { display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.jsg-ph .pill { cursor: pointer; font: inherit; }
.jsg-ph .pill:disabled { opacity: .4; cursor: default; }
.jsg-prog { font-weight: 600; font-variant-numeric: tabular-nums; margin-right: auto; }
.jsg-now { margin-top: 8px; font-size: 13px; }
.jsg-badges { color: var(--dim); font-size: 12.5px; margin-top: 3px;
  font-variant-numeric: tabular-nums; }
.jsg-badges b { color: var(--text); }
.jsg-top { font: 500 11.5px ui-monospace, Menlo, Consolas, monospace;
  color: var(--dim); margin-top: 3px; overflow-wrap: anywhere; }
.jsg-up { margin-top: 8px; padding-top: 7px; border-top: 1px dashed var(--line);
  color: var(--dim); font-size: 12.5px; }
.jsg-go { color: var(--accent); font-weight: 600; }

/* cost map */
.jtm { position: relative; height: 460px; }
.jtm-g { position: absolute; border: 1.5px solid; border-radius: 4px;
  overflow: hidden; cursor: pointer; }
.jtm-h { font: 600 11px ui-monospace, Menlo, Consolas, monospace;
  padding: 1px 6px; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; color: var(--bg); }
.jtm-c { position: absolute; overflow: hidden; cursor: pointer;
  border: 1px solid var(--bg); }
.jtm-c:hover { filter: brightness(1.2); }
.jtm-c span { display: block; font: 500 10.5px ui-monospace, Menlo, Consolas, monospace;
  color: var(--text); padding: 1px 4px; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; text-shadow: 0 1px 2px rgba(0, 0, 0, .55); }

/* the visits-vs-screens caption above the sequence list */
.jseq-cap { color: var(--dim); font-size: 12.5px; margin: 0 0 10px 4px; max-width: 78ch; }
.jseq-cap b { color: var(--text); }

/* ── the screen list's nested folds: visits (the story) and deduped calls
     (the audit) live INSIDE their screen's block ─────────────────────────── */
.jvisit {
  margin: 8px 0 8px 6px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent-dim);
  border-radius: 7px;
  background: var(--panel);
}
.jvisit > summary {
  cursor: pointer; padding: 6px 12px; list-style: none;
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
}
.jvisit > summary::-webkit-details-marker { display: none; }
.jvisit > summary::before { content: "▸"; color: var(--dimmer); }
.jvisit[open] > summary::before { content: "▾"; }
.jvisit[open] { border-left-color: var(--accent); }
.jvisit-n {
  font: 600 11px var(--mono); color: var(--accent);
  border: 1px solid var(--accent-dim); border-radius: 10px; padding: 1px 8px;
  white-space: nowrap;
}
.jvisit .tablewrap { padding: 0 10px 10px; }


/* trigger folds inside a visit: "on arrival", then one per interaction */
.jburst {
  margin: 8px 8px 8px 14px;
  border: 1px solid var(--line); border-radius: 6px;
  background: rgba(255, 255, 255, 0.012);
}
.jburst > summary {
  cursor: pointer; padding: 5px 10px; list-style: none;
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  font-size: 12.5px;
}
.jburst > summary::-webkit-details-marker { display: none; }
.jburst > summary::before { content: "▸"; color: var(--dimmer); }
.jburst[open] > summary::before { content: "▾"; }
.jburst-t { color: var(--dimmer); font-size: 12px; }
.jburst .tablewrap { padding: 0 8px 8px; }
.jburst .jstats { margin-left: auto; }

/* arrival context on a collapsed visit fold */
.jfrom { color: var(--dim); font-size: 12px; }
.jfrom code { font-size: 11.5px; color: var(--dim); }

/* a repeat, marked in place on its own row */
.jrep-mark {
  display: inline-block; margin-top: 2px; padding: 0 7px;
  border: 1px solid var(--line); border-radius: 9px;
  font-size: 11px; color: var(--dim);
}
.jrep-mark.warn { color: var(--warn); border-color: rgba(255, 159, 10, 0.45); }

/* numbered circles on the sequence rows — the step's place in the journey */
.jview-seq .jvisit { position: relative; }
.jview-seq .jvisit > summary .jstep {
  position: absolute; left: -26px; top: 8px;
  width: 22px; height: 22px; min-width: 22px; padding: 0;
  border-radius: 50%; border-color: var(--accent-dim);
  background: var(--panel-2); color: #2997ff; z-index: var(--z-raised);
}
.jview-seq .jvisit[open] > summary .jstep {
  background: var(--accent-dim); color: #f5f5f7; border-color: var(--accent);
}

/* same page, different org — say it instead of making the reader diff URLs */
.jorg-switch {
  font-size: 12px; color: var(--warn);
  border: 1px solid rgba(255, 159, 10, 0.4); border-radius: 10px; padding: 0 8px;
}
.jorg-switch code { font-size: 11.5px; color: var(--warn); }
.jauto { color: var(--dimmer); font-style: italic; }
.jauto code { color: var(--dim); }

/* the by-screen rollup, folded onto the row: n of m appearances + total */
.jsib {
  font: 500 11.5px var(--mono); color: var(--dim); cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 1px 9px;
}
.jsib b { color: var(--text); }
.jsib:hover { border-color: var(--accent-dim); color: var(--text); }
.jlogs-link { color: var(--accent) !important; border-color: var(--accent-dim) !important; }


/* ── Eval accuracy over time ─────────────────────────────────────────────────── */
.es-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 16px; }
.es-lab {
  font-size: 10px; text-transform: none; letter-spacing: -0.01em;
  color: var(--dimmer); margin-left: 10px;
}
.es-lab:first-child { margin-left: 0; }
.es-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border: 1px solid var(--line); border-radius: 20px;
  background: var(--panel); color: var(--dim); font-size: 11.5px; text-decoration: none;
  transition: border-color .12s ease, color .12s ease;
}
.es-chip:hover { border-color: var(--line-2); color: var(--text); }
.es-chip.on { border-color: var(--accent); color: var(--text);
              background: color-mix(in srgb, var(--accent) 10%, var(--panel)); }
.es-chip i { font-style: normal; color: var(--dimmer); font-size: 10px; }
.es-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }

/* Every run in the cell, not an average: a bake-off puts seven models on one date and
   collapsing them would hide the comparison that was the point of running it. */
.es-matrix td.num { white-space: normal; }
.es-cell {
  display: inline-flex; align-items: center; gap: 4px; margin: 1px 3px 1px 0;
  padding: 1px 5px; border-radius: 4px; background: var(--panel-2);
  font-size: 11px; font-variant-numeric: tabular-nums;
}
.es-cell.es-partial { opacity: .5; text-decoration: line-through; }
.es-cell.es-super { opacity: .6; }
.es-cell.es-low { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warn) 55%, transparent); }

.es-spend {
  display: flex; flex-wrap: wrap; gap: 18px; margin: 4px 0 18px;
  padding: 9px 13px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel); font-size: 12px; color: var(--dim);
}
.es-spend b { color: var(--text); font-variant-numeric: tabular-nums; }
/* "unpriced" is not "$0.00": LiteLLM reports zero for a provider it has no rate card
   for, and showing that beside a real dollar figure invites the wrong comparison. */
.es-unpriced { color: var(--warn); }
.es-part { color: var(--warn); margin-left: 1px; }

/* Segmented filter, so the choice reads as one control with two states rather than as
   two links that happen to be adjacent. */
.es-seg { display: inline-flex; margin-left: 10px; border: 1px solid var(--line);
          border-radius: 6px; overflow: hidden; vertical-align: 2px; }
.es-seg a { padding: 2px 9px; font-size: 11px; font-weight: 400; color: var(--dim);
            text-decoration: none; background: var(--panel); }
.es-seg a + a { border-left: 1px solid var(--line); }
.es-seg a:hover { color: var(--text); }
.es-seg a.on { color: var(--text); background: color-mix(in srgb, var(--accent) 16%, var(--panel)); }

/* Eval run detail: the per-item and per-call tables carry a lot of rows, and the
   ledger for one run is routinely 400+ calls. Capping its height keeps the page
   navigable without hiding anything -- the box scrolls, the data is all there. */
.tiny { font-size: 11px; }
.scrollbox { max-height: 34rem; overflow: auto; }
.scrollbox thead th { position: sticky; top: 0; background: var(--panel); z-index: var(--z-sticky); }
/* Transcript cells hold whole model messages; wrap them rather than letting one
   message stretch the table past the viewport. */
pre.tx { white-space: pre-wrap; word-break: break-word; max-height: 16rem; overflow: auto; margin: 0; }
.logblock { margin: 0.75rem 0 1.25rem; }
pre.logtext { max-height: 30rem; overflow: auto; white-space: pre-wrap; word-break: break-word; font-size: 11px; }

/* Eval scores: the three filter rows reach different distances, so each says how far it
   goes and each section says what was applied to it. Quiet by default — this is a
   correction to a misreading, not a headline. */
.es-reach { font-style: normal; font-size: 10px; opacity: .55; margin-left: .25rem;
            letter-spacing: .02em; }
.es-applies { display: block; margin-top: .25rem; font-size: 11px; opacity: .7; }
.es-applies b { font-weight: 600; opacity: .95; }
td.es-sel { font-weight: 600; }

/* The "off by default" explanation on the Skills tab. Prose, not a legend: the one-line
   version ("wired but withheld by resolve_access()") was accurate and unreadable. */
.sg-explain { margin: 1.25rem 0; padding: .9rem 1.1rem; border-radius: 8px;
              background: var(--panel); border: 1px solid var(--border);
              max-width: 64rem; }
.sg-explain h3 { margin: 0 0 .5rem; font-size: 14px; }
.sg-explain p { margin: .45rem 0; font-size: 13px; line-height: 1.55; }

/* ── v3: findings ──────────────────────────────────────────────────────────────
   Cards, not rows: a finding is read, not scanned. The coloured strip is severity, the bar
   is impact (0–100), the pills are where and what. */
.nav-badge { display:inline-block; margin-left:6px; min-width:18px; padding:0 6px; border-radius:999px;
  font-size:11px; line-height:18px; text-align:center; background:var(--warn); color:#1c1c1e; font-weight:700; vertical-align:1px; }
.nav-badge.crit { background:var(--bad); color:#fff; }
.fx-filters { display:flex; flex-wrap:wrap; gap:8px 18px; align-items:center; margin:0 0 14px; font-size:12.5px; }
.fx-filters .fl { display:inline-flex; gap:4px; align-items:center; flex-wrap:wrap; }
.fx-filters .fl-k { color:var(--dimmer); margin-right:2px; }
.fx-filters .fl a { padding:2px 9px; border:1px solid var(--line); border-radius:999px; color:var(--dim); }
.fx-filters .fl a.on { color:var(--text); border-color:var(--accent-dim); background:var(--panel-2); }
.fx-list { display:flex; flex-direction:column; gap:10px; }
.fx-card { display:flex; background:var(--panel); border:1px solid var(--line); border-radius:8px; overflow:hidden; }
.fx-strip { width:6px; flex:none; background:var(--dimmer); }
.sev-critical .fx-strip { background:var(--bad); } .sev-warning .fx-strip { background:var(--warn); } .sev-info .fx-strip { background:var(--accent); }
.st-acked, .st-snoozed { opacity:.75; } .st-resolved { opacity:.55; }
.fx-body { padding:10px 14px; flex:1; min-width:0; }
.fx-top { display:flex; flex-wrap:wrap; gap:6px; align-items:center; font-size:11.5px; color:var(--dim); }
.fx-sev { font-weight:700; text-transform:none; letter-spacing:-0.01em; font-size:10.5px; padding:1px 7px; border-radius:4px; background:var(--panel-2); }
.sev-critical .fx-sev, .sev-critical-txt { color:var(--bad); } .sev-warning .fx-sev, .sev-warning-txt { color:var(--warn); } .sev-info .fx-sev, .sev-info-txt { color:var(--accent); }
.fx-kind { color:var(--text); }
.fx-age { margin-left:auto; color:var(--dimmer); }
.fx-title { margin:6px 0 4px; font-size:15px; font-weight:600; line-height:1.35; }
.fx-title a { color:var(--text); } .fx-title a:hover { color:var(--accent); }
.fx-narr { margin:0 0 8px; color:var(--dim); font-size:13px; line-height:1.5; max-width:110ch; }
.fx-foot { display:flex; flex-wrap:wrap; gap:6px; align-items:center; }
.fx-impact { display:inline-block; width:120px; height:8px; background:var(--panel-2); border-radius:4px; position:relative; margin-right:34px; }
.fx-impact i { display:block; height:100%; border-radius:4px; background:linear-gradient(90deg, var(--accent), var(--warn), var(--bad)); }
.fx-impact b { position:absolute; right:-30px; top:-5px; font-size:11px; color:var(--dim); font-weight:600; }
.fx-detail { display:grid; grid-template-columns:minmax(0, 1.4fr) minmax(0, 1fr); gap:14px; }
@media (max-width: 900px) { .fx-detail { grid-template-columns:1fr; } }
.fx-panel { background:var(--panel); border:1px solid var(--line); border-radius:8px; padding:12px 14px; }
.fx-panel h2 { margin:0 0 8px; font-size:12px; text-transform:none; letter-spacing:-0.01em; color:var(--dim); font-weight:600; }
.fx-facts { width:100%; font-size:12.5px; border-collapse:collapse; }
.fx-facts td { padding:3px 8px 3px 0; vertical-align:top; border-bottom:1px solid var(--line); }
.fx-facts td:first-child { color:var(--dim); font-family:var(--mono); font-size:11.5px; white-space:nowrap; width:1%; }
.fx-narr-big { font-size:14.5px; line-height:1.6; margin:0; }
.fx-actions { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.fx-actions form { display:inline-flex; gap:6px; align-items:center; }
.fx-actions button, .fx-actions select, .fx-actions input[type=text] { font:inherit; font-size:12.5px; padding:4px 10px; border-radius:6px;
  border:1px solid var(--line-2); background:var(--panel-2); color:var(--text); }
.fx-actions button { cursor:pointer; } .fx-actions button:hover { border-color:var(--accent); }
.fx-tl { list-style:none; margin:0; padding:0; font-size:12.5px; }
.fx-tl li { display:flex; gap:10px; padding:4px 0; border-bottom:1px solid var(--line); flex-wrap:wrap; }
.fx-tl .t { color:var(--dimmer); font-family:var(--mono); font-size:11.5px; white-space:nowrap; min-width:150px; }
.fx-tl .e { font-weight:600; min-width:80px; }
.fx-ev a { margin:0 6px 6px 0; display:inline-block; }
.det-ok { color:var(--good); } .det-err { color:var(--bad); font-size:12px; }
/* Slack Block Kit preview on Admin → Notifications */
.sk { background:var(--panel-2); border:1px solid var(--line); border-radius:6px; padding:8px 10px; max-width:64ch; font-size:12.5px; margin-top:6px; }
.sk-h { font-weight:700; font-size:13.5px; margin-bottom:4px; }
.sk-p { margin:4px 0; line-height:1.45; white-space:pre-wrap; }
.sk-f { display:grid; grid-template-columns:1fr 1fr; gap:4px 10px; margin:6px 0; font-size:12px; }
.sk-c { color:var(--dim); font-size:11px; margin:6px 0; }
.sk-a a { margin-right:6px; }
/* ── v3: home ── */
.hm-strip { display:flex; flex-wrap:wrap; gap:10px; margin:0 0 14px; }
.hm-tile { display:flex; flex-direction:column; gap:2px; padding:8px 12px; background:var(--panel); border:1px solid var(--line); border-radius:8px; min-width:200px; color:var(--text); }
.hm-tile:hover { border-color:var(--accent-dim); text-decoration:none; }
.hm-k { font-size:11px; color:var(--dim); font-family:var(--mono); } .hm-v { font-size:15px; font-weight:650; } .hm-s { font-size:11px; color:var(--dimmer); }
.hm-grid { display:grid; grid-template-columns:minmax(0, 1.7fr) minmax(280px, 1fr); gap:16px; align-items:start; }
@media (max-width: 1000px) { .hm-grid { grid-template-columns:1fr; } }
.hm-fleet { display:grid; grid-template-columns:repeat(auto-fill, minmax(96px, 1fr)); gap:6px; }
.hm-cell { display:flex; flex-direction:column; align-items:flex-start; gap:2px; padding:8px 10px; border-radius:6px; border:1px solid var(--line); background:var(--panel-2); color:var(--text); position:relative; }
.hm-cell:hover { text-decoration:none; border-color:var(--accent-dim); }
.hm-cell.st-bad { border-left:4px solid var(--bad); } .hm-cell.st-warning { border-left:4px solid var(--warn); } .hm-cell.st-good { border-left:4px solid var(--good); } .hm-cell.st-idle { border-left:4px solid var(--dimmer); opacity:.7; }
.hm-cell.on { border-color:var(--accent); box-shadow:inset 0 0 0 1px var(--accent); background:var(--panel); }
.hm-sub { font-size:10.5px; color:var(--dimmer); }
.hm-scope { margin:4px 0 10px; }
.hm-cl { font-size:12px; font-weight:600; } .hm-n { font-size:18px; font-weight:700; line-height:1; } .hm-stale { position:absolute; right:6px; top:6px; font-size:10px; color:var(--warn); }
.hm-q { list-style:none; margin:0; padding:0; font-size:12.5px; } .hm-q li { padding:4px 0; border-bottom:1px solid var(--line); }
.hm-prefs { display:flex; flex-wrap:wrap; gap:6px 12px; align-items:center; font-size:12.5px; }
.fx-spark { float:right; margin:0 0 0 12px; opacity:.9; }
/* ── v3: ask ── */
.ask-layout { display:grid; grid-template-columns:220px minmax(0, 1fr); gap:16px; align-items:start; }
@media (max-width: 900px) { .ask-layout { grid-template-columns:1fr; } .ask-rail { order:2; } }
.ask-rail { position:sticky; top:12px; }
.ask-chats { list-style:none; margin:10px 0; padding:0; font-size:12.5px; }
.ask-chats li { display:flex; justify-content:space-between; gap:8px; padding:5px 6px; border-radius:6px; }
.ask-chats li.on { background:var(--panel-2); } .ask-chats li a { color:var(--text); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ask-toolbox ul { list-style:none; margin:6px 0 0; padding:0; font-size:11.5px; max-height:220px; overflow:auto; } .ask-toolbox li { padding:2px 0; }
.ask-thread { display:flex; flex-direction:column; gap:12px; min-height:120px; }
.ask-msg { max-width:100ch; }
.ask-user { align-self:flex-end; text-align:right; }
/* group chat (a shared Ask chat others have joined): who asked is the first thing you read */
.ask-group { display:flex; flex-direction:column; gap:4px; max-width:min(100ch, 82%); }
.ask-group.ask-mine { align-self:flex-end; align-items:flex-end; }
.ask-group.ask-theirs { align-self:flex-start; align-items:flex-start; text-align:left; }
.ask-who { display:flex; align-items:center; gap:7px; font-size:12.5px; color:var(--text); }
.ask-group.ask-mine .ask-who { flex-direction:row-reverse; }
.ask-who b { font-weight:600; }
.ask-when { font-size:11px; color:var(--dimmer); }
.ask-role { font-size:10px; text-transform:uppercase; letter-spacing:.04em; color:var(--dim); border:1px solid var(--line); border-radius:999px; padding:0 6px; }
.ask-avatar { display:inline-flex; align-items:center; justify-content:center; width:24px; height:24px; border-radius:50%; flex:none;
  font-size:10.5px; font-weight:700; letter-spacing:.02em; color:hsl(var(--hue, 210) 60% 97%); background:hsl(var(--hue, 210) 55% 38%); }
.ask-group.ask-theirs .ask-bubble { background:var(--panel-2); border-left:3px solid hsl(var(--hue, 210) 55% 50%); border-radius:2px 12px 12px 12px; }
.ask-group.ask-mine .ask-bubble { border-radius:12px 2px 12px 12px; }
.ask-people { display:inline-flex; align-items:center; gap:0; margin-left:6px; font-size:11.5px; }
.ask-people .ask-avatar { width:22px; height:22px; font-size:9px; margin-left:-3px; box-shadow:0 0 0 2px var(--panel, #1c1c1e); }
.ask-people .ask-avatar:first-child { margin-left:0; }
.ask-people .dim { margin-left:8px; }
.ask-for { color:var(--text); font-weight:600; display:inline-flex; align-items:center; gap:5px; }
.ask-for::before { content:''; width:8px; height:8px; border-radius:50%; background:hsl(var(--hue, 210) 55% 45%); }
.ask-bubble { display:inline-block; background:var(--accent-dim); color:var(--text); padding:8px 12px; border-radius:12px 12px 2px 12px; white-space:pre-wrap; text-align:left; font-size:13.5px; }
.ask-assistant { background:var(--panel); border:1px solid var(--line); border-radius:8px; padding:10px 14px; }
.ask-answer { font-size:14px; line-height:1.55; } .ask-answer p { margin:0 0 8px; } .ask-answer ul { margin:0 0 8px 18px; } .ask-answer.ask-err { color:var(--warn); }
.ask-meta { font-size:11.5px; color:var(--dimmer); margin-top:6px; display:flex; gap:6px; align-items:center; flex-wrap:wrap; }
.ask-retry { background: none; border: 0; padding: 0; margin: 0; font: inherit; color: var(--accent); cursor: pointer; }
.ask-retry:hover { text-decoration: underline; }
.ask-retry-btn { margin-top: 4px; }
/* answer feedback (ask-feedback.js): two quiet thumbs at the end of the meta line; the pressed one is filled */
.ask-fb { display: inline-flex; align-items: center; gap: 2px; margin-left: auto; }
.ask-fb-btn { background: none; border: 1px solid transparent; border-radius: 6px; padding: 1px 5px; font: inherit; font-size: 13px;
  line-height: 1.3; cursor: pointer; filter: grayscale(1); opacity: .7; transition: opacity .12s var(--ease-out), background .12s var(--ease-out); }
.ask-fb-btn:hover, .ask-fb-btn:focus-visible { opacity: 1; filter: none; border-color: var(--line-2); }
.ask-fb-btn[aria-pressed="true"] { opacity: 1; filter: none; background: var(--accent-dim); border-color: var(--accent); }
.ask-fb-btn:disabled { cursor: progress; }
.ask-fb-said { background: none; border: 0; padding: 0 0 0 4px; font: inherit; color: var(--dim); cursor: pointer; max-width: 260px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ask-fb-said:hover { color: var(--text); text-decoration: underline; }
.ask-fb-err { color: var(--bad); padding-left: 6px; }
.ask-fb-note { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.ask-fb-note[hidden] { display: none; }
.ask-fb-note input { flex: 1 1 220px; min-width: 0; font: inherit; font-size: 12.5px; padding: 5px 8px; color: var(--text);
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 6px; }
.ask-fb-note input:focus { outline: none; border-color: var(--accent); }
.ask-fb-status { font-size: 11.5px; color: var(--dim); }
@media (max-width: 520px) { .ask-fb-note input { flex-basis: 100%; } }   /* the note full width, its buttons together below */
.ask-tools { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:8px; }
.ask-chip { font-size:11px; padding:2px 8px; border-radius:999px; border:1px solid var(--line); color:var(--dim); font-family:var(--mono); }
.ask-chip b { color:var(--accent); margin-right:2px; } .ask-chip.live { border-color:var(--accent-dim); } .ask-chip.err { border-color:var(--bad); color:var(--bad); }
.ask-cite { display:inline-block; font-size:10px; line-height:14px; min-width:14px; text-align:center; padding:0 4px; margin:0 1px; border-radius:7px; background:var(--accent-dim); color:#2997ff; vertical-align:super; }
mark.unverified { background:#5c4400; color:#ffb340; border-radius:3px; padding:0 3px; border-bottom:1px dashed var(--warn); }
.ask-status { font-size:12px; margin-bottom:6px; } .ask-note { font-size:12.5px; margin-top:6px; padding:6px 8px; border-radius:6px; background:var(--panel-2); }
.ask-note.error, .ask-note.refusal { color:var(--warn); }
.ask-decision { font-size:12.5px; margin:4px 0 8px; padding:6px 9px; border-radius:6px; background:var(--panel-2); border-left:3px solid var(--line); }
.ask-decision.ok { border-left-color:var(--ok); } .ask-decision.bad { border-left-color:var(--warn); }
.ask-composer { display:flex; gap:8px; margin-top:12px; align-items:flex-end; }
.ask-composer textarea { flex:1; font:inherit; font-size:13.5px; padding:8px 10px; border-radius:8px; border:1px solid var(--line-2); background:var(--panel); color:var(--text); resize:vertical; min-height:44px; }
.ask-composer button { font:inherit; padding:9px 16px; border-radius:8px; border:1px solid var(--accent-dim); background:var(--accent-dim); color:#f5f5f7; cursor:pointer; }
.ask-composer button:disabled { opacity:.5; cursor:not-allowed; }
.ask-empty { color:var(--dim); font-size:13px; padding:12px 14px; background:var(--panel); border:1px dashed var(--line-2); border-radius:8px; }
.ask-empty ul { margin:6px 0 0 18px; } .ask-empty li { padding:2px 0; }
.ask-setup { border-color:var(--warn); margin-bottom:14px; } .ask-setup h2 { color:var(--warn); }
/* notification rule forms */
.nf-form { display:grid; grid-template-columns:repeat(auto-fit, minmax(150px, 1fr)); gap:8px 10px; margin-top:10px; font-size:12.5px; color:var(--dim); align-items:end; }
.nf-form label { display:flex; flex-direction:column; gap:3px; }
.nf-form input, .nf-form select { font:inherit; font-size:12.5px; padding:4px 8px; border-radius:6px; border:1px solid var(--line-2); background:var(--panel-2); color:var(--text); }
.nf-form button { font:inherit; font-size:12.5px; padding:6px 12px; border-radius:6px; border:1px solid var(--accent-dim); background:var(--accent-dim); color:#f5f5f7; cursor:pointer; }
.nf-set { grid-column:1 / -1; border:1px solid var(--line); border-radius:6px; padding:6px 10px; display:flex; flex-wrap:wrap; gap:4px 12px; }
.nf-set legend { padding:0 4px; color:var(--dim); }
.nf-chk { display:inline-flex !important; flex-direction:row !important; align-items:center; gap:4px; color:var(--text); }
.nf-grp { width:100%; font-size:10.5px; text-transform:none; letter-spacing:-0.01em; color:var(--dimmer); margin-top:4px; }
.nf-wide { grid-column:1 / -1; }
.nf-proposal { margin-top:12px; padding:10px 12px; border:1px solid var(--accent-dim); border-radius:8px; background:var(--panel); }
.nf-reading { font-size:13px; }
.sk-sec { font-size:10.5px; text-transform:none; letter-spacing:-0.01em; color:var(--dimmer); margin-top:6px; }
/* baselines: report cards in words, the picker, the week grid (7 day strips × 24 hours) with its axis and
   legend, and the coverage matrix. Unknown hours are the quietest thing on the grid — they used to be hatched,
   which made a half-learnt week look broken. */
.bl-facts { display:flex; flex-wrap:wrap; gap:6px 18px; font-size:12.5px; color:var(--dim); margin:0 0 14px; }
.bl-facts b { color:var(--text); font-weight:600; }
.bl-pick { display:flex; flex-wrap:wrap; gap:10px 26px; align-items:center; margin:0 0 16px; font-size:12.5px; }
.bl-pick > span { display:inline-flex; align-items:center; gap:8px; }
.bl-pick label { color:var(--dimmer); }
.bl-pick select { font:inherit; font-size:13px; padding:6px 10px; border-radius:8px; border:1px solid var(--line-2); background:var(--panel-2); color:var(--text); min-width:220px; }
.bl-seg { display:inline-flex; border:1px solid var(--line-2); border-radius:8px; overflow:hidden; background:var(--panel); }
.bl-seg a { padding:5px 14px; color:var(--dim); border-right:1px solid var(--line); line-height:1.25; }
.bl-seg a:last-child { border-right:0; }
.bl-seg a:hover { color:var(--text); text-decoration:none; background:var(--panel-2); }
.bl-seg a.on { color:var(--text); background:var(--panel-2); font-weight:600; box-shadow:inset 0 -2px 0 var(--accent); }
.bl-seg a small { display:block; font-size:10.5px; color:var(--dimmer); font-weight:400; }
.bl-report { display:grid; grid-template-columns:repeat(auto-fit, minmax(260px, 1fr)); gap:10px; margin:0 0 14px; }
.bl-card { background:var(--panel); border:1px solid var(--line); border-radius:10px; padding:12px 14px; min-width:0; }
.bl-card .k { font-size:11px; letter-spacing:-0.01em; text-transform:none; color:var(--dimmer); margin-bottom:6px; font-weight:600; }
.bl-card .v { font-size:17px; font-weight:600; }
.bl-card .v.bad { color:var(--bad); }
.bl-card p { margin:5px 0 0; font-size:12.5px; color:var(--dim); line-height:1.5; }
.bl-card p b { color:var(--text); font-weight:600; }
.bl-far { list-style:none; margin:8px 0 0; padding:0; font-size:12.5px; }
.bl-far li { display:flex; gap:10px; flex-wrap:wrap; align-items:baseline; padding:5px 0; border-top:1px solid var(--line); }
.bl-far .when { font-family:var(--mono); color:var(--text); }
.bl-far .how { color:var(--bad); font-weight:600; }
.bl-legend { display:flex; flex-wrap:wrap; gap:6px 18px; font-size:12px; color:var(--dim); margin:0 0 10px; align-items:center; }
.bl-legend span { display:inline-flex; align-items:center; gap:6px; }
.bl-legend .sw { width:14px; height:14px; border-radius:2px; background:var(--panel-2); position:relative; overflow:hidden; display:inline-block; flex:none; }
.bl-legend .sw.bar::after { content:""; position:absolute; left:0; right:0; bottom:0; height:60%; background:var(--accent-dim); }
.bl-legend .sw.dot::after, .bl-legend .sw.hot::after { content:""; position:absolute; left:3.5px; top:3.5px; width:7px; height:7px; border-radius:50%; background:var(--text); }
.bl-legend .sw.hot::after { background:var(--bad); }
.bl-legend .sw.now { box-shadow:inset 0 0 0 1.5px var(--accent); }
.bl-legend .sw.none { background:transparent; border:1px dashed var(--line-2); }
.bl-legend .cv { width:14px; height:14px; border-radius:3px; display:inline-block; flex:none; }
.bl-legend .cv.full, .bl-matrix .cov a.full { background:#0c2f1a; color:#30d158; }
.bl-legend .cv.part, .bl-matrix .cov a.part { background:#3a2a00; color:#ffd60a; }
.bl-legend .cv.thin, .bl-matrix .cov a.thin { background:var(--panel-2); color:var(--dim); }
.bl-legend .cv.none { background:transparent; border:1px dashed var(--line-2); }
.bl-week { display:flex; flex-direction:column; gap:4px; }
.bl-axis, .bl-day { display:flex; align-items:flex-end; gap:8px; }
.bl-dn { width:32px; font-size:11px; color:var(--dim); font-family:var(--mono); flex:none; }
.bl-axis .bl-dn { color:var(--dimmer); }
.bl-ticks { display:grid; grid-template-columns:repeat(24, 1fr); gap:2px; flex:1; font-size:10.5px; color:var(--dimmer); font-family:var(--mono); }
.bl-ticks span { grid-column:span 3; }
.bl-strip { display:grid; grid-template-columns:repeat(24, 1fr); gap:2px; flex:1; height:36px; }
.bl-cell { position:relative; background:var(--panel-2); border-radius:2px; overflow:hidden; }
.bl-cell.unknown { background:transparent; box-shadow:inset 0 0 0 1px var(--line); }
.bl-cell.now { box-shadow:inset 0 0 0 1.5px var(--accent); }
.bl-cell i { position:absolute; left:0; right:0; bottom:0; background:var(--accent-dim); display:block; }
.bl-cell.thin i { opacity:.45; }
.bl-cell b { position:absolute; left:50%; width:7px; height:7px; margin-left:-3.5px; margin-bottom:-3.5px; border-radius:50%; background:var(--text); box-shadow:0 0 0 1.5px var(--panel); }
.bl-cell b.hot { background:var(--bad); }
.bl-note { font-size:12px; color:var(--dim); margin:10px 0 0; line-height:1.55; }
.bl-matrix th.cov, .bl-matrix td.cov { text-align:center; }
.bl-matrix th.cov .sub { display:block; font-weight:400; color:var(--dimmer); font-size:10.5px; text-transform:none; letter-spacing:0; }
.bl-matrix .cov a { display:inline-block; min-width:74px; padding:3px 8px; border-radius:6px; font-family:var(--mono); font-size:12px; }
.bl-matrix .cov a:hover { text-decoration:none; filter:brightness(1.15); }
.bl-matrix .cov .of { color:var(--dimmer); font-size:10.5px; }
.bl-matrix .cov .none { color:var(--dimmer); }
.fx-tl li.st-me .e, .fx-tl li.st-me b { color:var(--accent); }
/* board */
.bd { display:flex; flex-direction:column; gap:8px; }
.bd-row { display:flex; gap:10px; align-items:flex-start; }
.bd-cl { min-width:110px; padding:6px 10px; border-radius:6px; background:var(--panel-2); border:1px solid var(--line); color:var(--text); font-weight:600; font-size:12.5px; display:flex; justify-content:space-between; gap:8px; }
.bd-cl.st-critical { border-color:var(--bad); } .bd-cl.st-warning { border-color:var(--warn); }
.bd-n { color:var(--dim); font-weight:400; }
.bd-cells { display:flex; flex-wrap:wrap; gap:4px; }
.bd-cell { font-size:11.5px; padding:4px 8px; border-radius:4px; color:var(--text); background:var(--panel-2); border-left:3px solid var(--good); }
.bd-cell.st-warning { border-left-color:var(--warn); background:#3a2a00; } .bd-cell.st-bad { border-left-color:var(--bad); background:#4a1214; }
.bd-cell:hover { text-decoration:none; outline:1px solid var(--accent-dim); }
.sg { padding:8px 0; border-bottom:1px solid var(--line); font-size:13px; }
.sc-row .card { min-width:160px; flex:1; }
/* ── v3.3/3.4 UX: crosshair, brush, live pill, replay ── */
.xr-hair { stroke: var(--chart-ink-sec); stroke-width: 1; stroke-dasharray: 3 3; pointer-events: none; }
.xr-brush { fill: var(--accent); fill-opacity: .18; stroke: var(--accent); stroke-opacity: .6; pointer-events: none; }
svg.chart[data-xs] { cursor: crosshair; user-select: none; }
.xr-tip { position: fixed; z-index: var(--z-popover); background: var(--panel); border: 1px solid var(--line-2); border-radius: 6px; padding: 6px 9px;
  font-size: 12px; box-shadow: 0 6px 20px rgba(0,0,0,.35); pointer-events: none; display: grid; grid-template-columns: auto auto; gap: 2px 10px; }
.xr-tip[hidden] { display: none !important; }   /* .xr-tip's own display:grid beats the UA's [hidden]; without this the tooltip never left the screen */
.xr-tip .t { grid-column: 1 / -1; color: var(--dim); font-family: var(--mono); font-size: 11px; margin-bottom: 2px; }
.xr-tip .k { color: var(--dim); }
.xr-tip .sw { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 7px; vertical-align: 0; }
.jreplay { display: flex; gap: 10px; align-items: center; margin: 6px 0 10px; }
.jhb-cursor { stroke: var(--bad); stroke-width: 2; pointer-events: none; }
.viewlink { margin: 0 4px; text-decoration: none; }
/* ── v3.6 tablet / on-call layout ── */
@media (max-width: 900px) {
  .tabs { overflow-x: auto; white-space: nowrap; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
  .tabs .tab-spacer { display: none; }
  .topbar { flex-wrap: wrap; }
  .stat-grid, .cards { display: grid; grid-template-columns: 1fr 1fr; }
  .fx-detail, .hm-grid, .ask-layout { grid-template-columns: 1fr; }
  .tablewrap { overflow-x: auto; }
  .tablewrap table th:first-child, .tablewrap table td:first-child { position: sticky; left: 0; background: var(--panel); z-index: var(--z-raised); }
  .fx-card .fx-foot { gap: 4px; } .fx-impact { width: 80px; }
  .page-head .sub { font-size: 13px; }
  .xr-tip { display: none; }   /* no hover on touch; tap targets stay */
}
@media (max-width: 600px) {
  .stat-grid, .cards { grid-template-columns: 1fr; }
  .hm-fleet { grid-template-columns: repeat(2, 1fr); }
  .nf-form { grid-template-columns: 1fr 1fr; }
}
/* ── alerts, bell, toasts ── */
.bell { position: relative; }
.bell > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.bell > summary::-webkit-details-marker { display: none; }
.bell-n { background: var(--bad); color: #fff; border-radius: 999px; font-size: 10.5px; line-height: 16px; min-width: 16px; padding: 0 5px; text-align: center; font-weight: 700; }
.bell-panel { position: absolute; right: 0; top: 30px; width: min(380px, calc(100vw - 24px)); background: var(--panel); border: 1px solid var(--line-2); border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.4); z-index: var(--z-dropdown); font-size: 12.5px; max-height: calc(100vh - 90px); display: flex; flex-direction: column; overflow: hidden; }
/* ── the header on a phone ──
   The status row is a wrapping flex row, but the range bar inside it was one unbreakable
   line of thirteen presets plus the picker, ~630px — wider than a phone, so every page
   scrolled sideways. Below 900px the bar keeps only ‹ [window ▾] › →| and the presets
   move into the picker's panel. The panels then hang from the whole header (the nearest
   positioned box once .tp/.bell are static) and span it, instead of hanging off a
   control that may sit anywhere in a wrapped row and running off one edge. */
@media (max-width: 900px) {
  .ranges > .range { display: none; }
  .ranges .tpwrap { margin-left: 0; padding-left: 0; border-left: 0; }
  .tp-presets { display: flex; }
  .tp { position: static; }
  .tp-panel { left: 12px; right: 12px; top: calc(100% + 4px); width: auto; max-width: 420px; max-height: calc(100vh - 140px); overflow-y: auto; }
}
@media (max-width: 720px) {
  .bell { position: static; }
  .bell-panel { left: 12px; right: 12px; top: calc(100% + 4px); width: auto; max-height: calc(100vh - 140px); }
}
@media (max-width: 600px) {
  .themeseg button span { display: none; }   /* icons only: the pressed state still says which */
}
/* ── nothing on a phone may be wider than the phone ──
   html clips sideways overflow, so anything wider than the screen was not scrollable
   either — just cut off. Each wide thing scrolls in its own box instead:
   * a table already in a .tablewrap scrolls there; any other table becomes its own
     horizontal scroller (display:block keeps the rows in an anonymous table box);
   * tab and chip rows wrap; a segmented control scrolls in its own box. */
/* A grid track of `1fr` is minmax(auto, 1fr), and `auto` is the item's min-content width —
   so one wide table inside a column held the whole column (and the page) at the table's
   width, however the table itself scrolled. The page's two-column layouts let their
   columns shrink; whatever is wide inside then scrolls in its own box. */
:is(.hm-grid, .two-col, .split2, .fx-detail, .ask-layout, .charts-grid, .lr-grid, .lr-row2, .co-fam-body,
    .llmtrace, .ev-cmp, .res-head, .pm-g2, .pm-g3, .nf-form, .dropgrid) > * { min-width: 0; }
@media (max-width: 900px) {
  main table:not(.tablewrap > table, .ask-tablewrap > table) { display: block; max-width: 100%; overflow-x: auto; }
  main :is(input, select, textarea) { max-width: 100%; }
  /* a table-tools menu hangs from its button, which can sit mid-row: span the screen instead */
  .tt-body { position: fixed; left: 12px; right: 12px; top: auto; min-width: 0; }
  .al-subnav { flex-wrap: wrap; }
  .bl-pick > span { max-width: 100%; }
  .bl-seg { min-width: 0; max-width: 100%; overflow-x: auto; }
  pre { max-width: 100%; overflow-x: auto; }
}
.ib-list { flex: 1 1 auto; min-height: 0; }
.ib-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.ib-list { list-style: none; margin: 0; padding: 0; max-height: min(420px, 60vh); overflow: auto; }
.ib-row { display: flex; align-items: flex-start; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--line); border-left: 3px solid transparent; }
.ib-row.unread { background: var(--panel-2); } .ib-row.sev-critical { border-left-color: var(--bad); } .ib-row.sev-warning { border-left-color: var(--warn); } .ib-row.sev-info { border-left-color: var(--accent); }
.ib-row > a { color: var(--text); flex: 1; display: flex; flex-direction: column; gap: 2px; } .ib-t { font-weight: 600; } .ib-m { color: var(--dimmer); font-size: 11px; }
.ib-x { color: var(--dim); text-decoration: none; padding: 0 4px; }
.ib-foot { padding: 8px 10px; font-size: 12px; }
.xr-toast { position: fixed; right: 16px; bottom: 16px; z-index: var(--z-toast); max-width: 380px; background: var(--panel); border: 1px solid var(--line-2); border-left: 4px solid var(--accent); border-radius: 8px; padding: 10px 14px; font-size: 13px; color: var(--text); box-shadow: 0 10px 30px rgba(0,0,0,.45); text-decoration: none; transition: opacity .4s, transform .4s; }
.xr-toast.sev-critical { border-left-color: var(--bad); } .xr-toast.sev-warning { border-left-color: var(--warn); }
.xr-toast.out { opacity: 0; transform: translateY(8px); }
.xr-toast b { color: var(--accent); margin-right: 6px; }
.al-kind { display: flex; gap: 14px; }
.al-form fieldset { margin-top: 4px; }
.al-filter, .al-condition { transition: none; }

/* ── Alerts section: three plain pages, tables that wrap, buttons that look like buttons ──
   One thing per page (Alerts · Channels · Notifications). The shared table.grid rule is
   nowrap for numeric tables; these tables carry sentences, so .al-table wraps. */
.btn { display:inline-flex; align-items:center; gap:6px; font:inherit; font-size:12.5px; font-weight:500; line-height:1.2; padding:6px 12px;
  border-radius:7px; border:1px solid var(--line-2); background:var(--panel-2); color:var(--text); cursor:pointer; text-decoration:none; white-space:nowrap; }
.btn:hover { border-color:var(--accent-dim); background:#2c2c2e; color:var(--text); text-decoration:none; }
.btn-primary { background:#0071e3; border-color:#0a84ff; color:#ffffff; }
.btn-primary:hover { background:#0071e3; border-color:#0a84ff; color:#ffffff; }
.btn-danger { background:#3a1416; border-color:#6b2a2c; color:#ff6961; }
.btn-danger:hover { background:#4a1214; border-color:#a03a38; color:#ff6961; }
.btn-warn { background:#3a2a00; border-color:#6b5200; color:#ffd60a; }
.btn-warn:hover { background:#4a3200; border-color:#8a6a00; color:#ffd60a; }
.btn-ok { background:#0c2f1a; border-color:#1a5235; color:#30d158; }
.btn-ok:hover { background:#0f3520; border-color:#248a3d; color:#30d158; }
.btn-sm { padding:3px 9px; font-size:12px; border-radius:6px; }
.btn[disabled], .btn:disabled { opacity:.45; cursor:not-allowed; }
.al-head { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; flex-wrap:wrap; }
.al-head .page-head { margin-bottom:0; }
.al-head > .btn { margin-top:4px; }
.al-subnav { display:flex; gap:2px; margin:12px 0 16px; border-bottom:1px solid var(--line); }
.al-subnav a { padding:7px 12px; font-size:13px; color:var(--dim); border-bottom:2px solid transparent; margin-bottom:-1px; }
.al-subnav a:hover { color:var(--text); text-decoration:none; }
.al-subnav a.on { color:var(--text); border-bottom-color:var(--accent); font-weight:600; }
.al-subnav .n { font-size:11px; color:var(--dimmer); margin-left:5px; }
.al-flash { padding:8px 12px; border-radius:8px; border:1px solid var(--accent-dim); background:#2c2c2e; color:var(--text); font-size:13px; margin-bottom:14px; }
table.grid.al-table tbody td, table.grid.al-table thead th { white-space:normal; vertical-align:top; }
table.grid.al-table tbody td { overflow-wrap:anywhere; line-height:1.4; font-variant-numeric:normal; }
table.grid.al-table td.al-act { white-space:nowrap; text-align:right; }
.al-actions { display:inline-flex; gap:6px; flex-wrap:wrap; justify-content:flex-end; align-items:center; }
.al-actions form { display:inline-flex; gap:6px; align-items:center; margin:0; }
.al-mute select { font:inherit; font-size:12.5px; padding:5px 8px; border-radius:7px; border:1px solid var(--line-2); background:var(--panel-2); color:var(--text); }
.al-desc { color:var(--dim); font-size:11.5px; margin-top:3px; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.al-meta { color:var(--dim); font-size:12px; }
.al-off td { opacity:.6; }
.al-nl { display:flex; gap:10px; align-items:stretch; }
.al-nl textarea { flex:1; min-width:320px; font:inherit; font-size:13.5px; padding:10px 12px; border-radius:8px; border:1px solid var(--line-2); background:var(--panel-2); color:var(--text); resize:vertical; }
.al-filters { display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin:0 0 12px; }
.al-filters input[type=search], .al-filters input[type=text], .al-filters input[type=url], .al-filters select { font:inherit; font-size:12.5px; padding:5px 9px;
  border-radius:7px; border:1px solid var(--line-2); background:var(--panel-2); color:var(--text); }
.al-status { display:inline-block; padding:2px 9px; border-radius:999px; font-size:11.5px; font-weight:600; border:1px solid var(--line-2); background:var(--panel-2); color:var(--dim); }
.al-status.sent, .al-status.delivered { background:#0c2f1a; color:#30d158; border-color:#1a5235; }
.al-status.dry-run { background:#2c2c2e; color:#2997ff; border-color:#0a2042; }
.al-status.failed { background:#3a1416; color:#ff6961; border-color:#6b2a2c; }
.al-kind { display:inline-block; padding:1px 7px; border-radius:5px; font-size:10.5px; font-weight:600; text-transform:none; letter-spacing:-0.01em;
  background:var(--panel-2); border:1px solid var(--line-2); color:var(--dim); vertical-align:middle; }
.al-kind.condition { color:#d0a8ff; border-color:#4d3a80; background:#2a1a3d; }
.al-kind.filter { color:#2997ff; border-color:#0a2042; background:#2c2c2e; }
.al-byhand > summary { cursor:pointer; font-size:12px; text-transform:none; letter-spacing:-0.01em; color:var(--dim); font-weight:600; }
.al-byhand[open] > summary { margin-bottom:8px; }
/* the channel picker: a dropdown that shows what is chosen, never chooses for you */
.al-pick { position:relative; display:block; }
.al-pick > summary { list-style:none; display:flex; align-items:center; justify-content:space-between; gap:8px; cursor:pointer; font:inherit; font-size:12.5px;
  padding:5px 9px; border-radius:6px; border:1px solid var(--line-2); background:var(--panel-2); color:var(--text); min-width:260px; }
.al-pick > summary::-webkit-details-marker { display:none; }
.al-pick > summary .caret { font-size:9px; opacity:.6; }
.al-pick[open] > summary { border-color:var(--accent-dim); }
.al-pick.is-empty > summary { color:var(--dim); border-style:dashed; }
.al-pick.is-empty[open] > summary, .al-pick-err:not([hidden]) ~ .al-pick.is-empty > summary { border-color:#a03a38; }
.al-pick-menu { position:absolute; z-index:var(--z-dropdown); top:calc(100% + 4px); left:0; min-width:100%; max-width:420px; background:var(--panel); border:1px solid var(--line-2);
  border-radius:8px; padding:6px; box-shadow:0 10px 30px rgba(0,0,0,.45); display:flex; flex-direction:column; gap:2px; }
.al-pick-row { display:flex; align-items:center; gap:8px; padding:6px 8px; border-radius:6px; font-size:12.5px; color:var(--text); cursor:pointer; white-space:nowrap; }
.al-pick-row:hover { background:var(--panel-2); }
.al-pick-row input { margin:0; }
.al-pick-add { padding:6px 8px; font-size:12px; color:var(--accent); border-top:1px solid var(--line); margin-top:4px; }
.al-pick-err { color:#ff6961; font-size:12px; margin-left:8px; }
.al-two { margin:12px 0 6px; font-size:13px; color:var(--text); }
.al-two-n { font-size:11px; text-transform:none; letter-spacing:-0.01em; color:var(--dim); margin-bottom:6px; }
.nf-proposal + .nf-proposal { margin-top:14px; border-top:1px solid var(--line); padding-top:12px; }
/* query alerts: the SQL and its rows */
.al-sql { font-family:var(--mono); font-size:12px; line-height:1.45; width:100%; min-height:110px; padding:8px 10px; border-radius:7px; border:1px solid var(--line-2); background:var(--panel-2); color:var(--text); resize:vertical; }
.al-sqlbox { margin:8px 0 10px; }
.al-sqlv { font-family:var(--mono); font-size:12px; line-height:1.45; white-space:pre-wrap; overflow-wrap:anywhere; margin:0; padding:10px 12px; border-radius:8px; border:1px solid var(--line-2); background:var(--panel-2); color:var(--text); }
.al-rows td, .al-rows th { font-size:12px; padding:5px 10px !important; }
.al-try-out { font-size:12.5px; }
.al-try-out.warn { color:#ffd60a; }
/* a proposal as a rule: WHEN / THEN / HOW OFTEN, everything else folded */
.rule { margin-top:12px; border:1px solid var(--line-2); border-radius:10px; background:var(--panel); padding:12px 14px 14px; }
.rule + .rule { margin-top:14px; }
.rule-head { display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-bottom:8px; }
.rule-row { display:flex; gap:14px; align-items:flex-start; padding:9px 0; border-top:1px solid var(--line); }
.rule-row:first-of-type { border-top:none; }
.rule-k { flex:0 0 78px; font-size:11px; font-weight:700; letter-spacing:-0.01em; text-transform:none; color:var(--accent); padding-top:6px; }
.rule-v { flex:1; min-width:0; font-size:13.5px; line-height:1.5; }
.rule-when { font-weight:600; color:var(--text); }
.rule-now { font-size:12.5px; margin-top:4px; }
.rule-sql { margin-top:6px; }
.rule-sql > summary { cursor:pointer; font-size:12px; color:var(--dim); }
.rule-sql[open] > summary { margin-bottom:6px; }
.rule-then, .rule-how { display:flex; flex-wrap:wrap; gap:8px 18px; align-items:center; }
.rule-inline { display:inline-flex; align-items:center; gap:6px; white-space:nowrap; font-size:13px; color:var(--dim); }
.rule-inline select, .rule-inline input[type=number], .rule-inline input[type=text] { font:inherit; font-size:12.5px; padding:4px 8px; border-radius:6px; border:1px solid var(--line-2); background:var(--panel-2); color:var(--text); }
.rule-inline input[type=number] { width:64px; }
.rule-grow { flex:1; min-width:240px; white-space:normal; }
.rule-grow input { width:100%; }
.rule-more { margin-top:6px; border-top:1px solid var(--line); padding-top:8px; }
.rule-more > summary { cursor:pointer; font-size:12px; color:var(--dim); }
.rule-more[open] > summary { margin-bottom:8px; }
.rule-submit { display:block; margin-top:12px; }
form.al-form.al-compact { display:block; }
form.al-form.al-compact > .rule-row { border-top:1px solid var(--line); }
.al-progress { display:inline-flex; align-items:center; gap:8px; margin-top:10px; font-size:13px; color:var(--text); padding:6px 10px; border-radius:8px; border:1px solid var(--accent-dim); background:#2c2c2e; }
.al-progress[hidden] { display:none; }   /* an author display: rule beats the UA's [hidden]; say it explicitly */
.al-spin { width:14px; height:14px; border-radius:50%; border:2px solid var(--accent-dim); border-top-color:var(--accent); animation:al-spin .8s linear infinite; display:inline-block; }
@keyframes al-spin { to { transform:rotate(360deg); } }
button[disabled].btn-primary { opacity:.6; cursor:progress; }
.al-steps { margin:6px 0 0; padding-left:18px; font-size:12.5px; }
.al-steps li { margin:4px 0; }
.al-steps .al-sqlv { margin:4px 0; font-size:11.5px; }
/* the cluster picker on Findings reuses the alert channel picker; the filter row's pill links must not restyle its tools */
.xr-pickform { display:inline-block; }
.fx-filters .fl .xr-pick .al-pick-row, .fx-filters .fl .xr-pick-tools a { border:0; border-radius:6px; }
.xr-pick-tools { padding:4px 8px 6px; font-size:12px; color:var(--dim); border-bottom:1px solid var(--line); margin-bottom:4px; }
.xr-pick-tools a { color:var(--accent); padding:0 !important; background:none !important; }
.xr-pick-foot { display:flex; gap:8px; align-items:center; padding:6px 8px 2px; border-top:1px solid var(--line); margin-top:4px; }
.fx-filters .fl .xr-pick > summary { padding:3px 9px; border-radius:999px; min-width:0; font-size:12.5px; }
/* ── the Ask X-ray dock, Linear's shape: a bar at the bottom, a floating panel bottom-right, context chips above the composer ── */
/* The dock is fixed over the bottom of the viewport, so the page reserves its height: the
   column ends that much higher (the last card and the footer clear it when scrolled to the
   end), and anything scrolled into view — an expanded card, a focused row — stops above it. */
:root { --dock-h: 46px; }
body.has-dock .shell-main { padding-bottom: var(--dock-h); }
html:has(body.has-dock) { scroll-padding-bottom: calc(var(--dock-h) + 8px); }
body.has-dock .xr-toast { bottom: calc(var(--dock-h) + 12px); }   /* above the bar, not over its buttons */
.dock [hidden] { display: none !important; }   /* author display: rules on the panel and chips must never beat the hidden attribute */
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-dock); pointer-events: none; }
.dock > * { pointer-events: auto; }
.dock-bar { display: flex; align-items: center; justify-content: flex-end; gap: 10px; height: var(--dock-h); padding: 0 14px; background: var(--panel); border-top: 1px solid var(--line-2); box-shadow: 0 -8px 30px rgba(0,0,0,.35); }
.dock-last { min-width: 0; flex-shrink: 1; color: var(--dim); font-size: 13px; max-width: 42ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dock-cost{font:11px ui-monospace,monospace;opacity:.65;margin-right:10px;text-decoration:none;
  border:1px solid rgba(142, 142, 147,.3);border-radius:10px;padding:3px 9px;color:inherit;
  align-self:center;white-space:nowrap}
.dock-cost:hover{opacity:1}
.dock-open { flex-shrink: 0; white-space: nowrap; font: inherit; font-size: 13px; font-weight: 600; padding: 6px 14px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); cursor: pointer; }
.dock-open:hover, .dock.open .dock-open { border-color: var(--accent-dim); background: #2c2c2e; }
.dock-iconbtn { font-size: 15px; padding: 4px 8px; border-radius: 8px; border: 1px solid transparent; cursor: pointer; color: var(--dim); }
.dock-iconbtn:hover { border-color: var(--line-2); color: var(--text); }
.dock-tabs { display: flex; gap: 4px; overflow: hidden; min-width: 0; margin-right: auto; }
.dock-tab { display: inline-flex; align-items: center; gap: 6px; max-width: 220px; font: inherit; font-size: 12px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--dim); cursor: pointer; white-space: nowrap; }
.dock-tab .t { overflow: hidden; text-overflow: ellipsis; }
.dock-tab.on { color: var(--text); border-color: var(--accent-dim); background: #2c2c2e; }
.dock-tab .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); display: inline-block; }
.dock-tab .al-spin { width: 11px; height: 11px; border-width: 2px; }
.dock-dd { position: relative; }
.dock-dd > summary { list-style: none; cursor: pointer; }
.dock-dd > summary::-webkit-details-marker { display: none; }
.dock-menu { position: absolute; bottom: calc(100% + 6px); right: 0; min-width: 260px; max-width: 380px; max-height: 60vh; overflow: auto; background: var(--panel); border: 1px solid var(--line-2); border-radius: 10px; padding: 6px; box-shadow: 0 10px 30px rgba(0,0,0,.45); z-index: var(--z-raised); }
#dock-skills .dock-menu, .ask-skills .dock-menu { right: auto; left: 0; }
.dock-menu-h { font-size: 10.5px; text-transform: none; letter-spacing: -0.01em; color: var(--dimmer); padding: 6px 8px 2px; }
.dock-menu-row { display: flex; justify-content: space-between; gap: 10px; padding: 6px 8px; border-radius: 6px; color: var(--text); font-size: 12.5px; text-decoration: none; }
.dock-menu-row .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dock-menu-row:hover { background: var(--panel-2); text-decoration: none; }
.dock-menu-row.on { background: var(--accent-dim); }
.dock-menu-new { color: var(--accent); border-top: 1px solid var(--line); margin-top: 4px; }
/* the panel */
.dock-panel { position: fixed; right: 16px; bottom: calc(var(--dock-h) + 12px); width: min(540px, calc(100vw - 32px)); height: min(74vh, 780px); display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: 0 18px 60px rgba(0,0,0,.55); overflow: hidden; }
.dock-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px 10px; }
.dock-head-title { font-size: 15px; font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dock-head-btns { display: flex; gap: 2px; }
.dock-head-btns a { color: var(--dim); font-size: 16px; line-height: 1; padding: 4px 8px; border-radius: 6px; text-decoration: none; }
.dock-head-btns a:hover { color: var(--text); background: var(--panel-2); }
.dock-body { flex: 1; min-height: 0; overflow: auto; margin: 0 10px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); padding: 12px; position: relative; }
.dock-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; color: var(--dim);
  background-image: radial-gradient(circle at center, rgba(41, 151, 255,.08) 0, transparent 60%); }
.dock-empty[hidden] { display: none; }
.dock-empty b { color: var(--text); font-size: 17px; margin-top: 10px; }
.dock-empty p { font-size: 13px; max-width: 38ch; margin: 6px 0 14px; }
.dock-mark { font-size: 26px; color: var(--accent); opacity: .8; }
.dock-sugg { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.dock-suggest { font: inherit; font-size: 13px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--panel); color: var(--text); cursor: pointer; }
.dock-suggest:hover { border-color: var(--accent-dim); background: var(--panel-2); }
.dock-thread.ask-thread { gap: 10px; }
.dock-live { margin-top: 10px; }
.dock-foot { padding: 10px 10px 12px; }
/* the context chips: what the model will be told */
.dock-ctx { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 2px 6px; min-height: 22px; }
.dock-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; font-size: 12.5px; padding: 4px 10px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); text-decoration: none; }
.dock-chip .k { color: var(--accent); font-size: 11px; }
.dock-chip .l { font-weight: 600; white-space: nowrap; }
.dock-chip .s { color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 30ch; }
.dock-chip a { color: var(--dimmer); text-decoration: none; padding-left: 4px; font-size: 14px; line-height: 1; }
.dock-chip a:hover { color: var(--text); }
.dock-chip-off { color: var(--dim); border-style: dashed; }
.dock-sel .k { color: var(--warn); }
/* the composer */
.dock-compose { border: 1px solid var(--line-2); border-radius: 12px; background: var(--panel-2); padding: 8px 10px 6px; }
.dock-compose:focus-within { border-color: var(--accent-dim); }
.dock-compose textarea { width: 100%; resize: none; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 14px; line-height: 1.45; padding: 2px 2px 6px; min-height: 24px; max-height: 140px; }
.dock-compose-row { display: flex; align-items: center; gap: 8px; }
.dock-compose-row summary { font-size: 12.5px; color: var(--dim); padding: 4px 8px; border-radius: 6px; }
.dock-compose-row summary:hover { color: var(--text); background: var(--panel); }
.dock-spacer { flex: 1; }
.dock-sendbtn { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--accent-dim); background: #0071e3; color: #fff; font-size: 15px; cursor: pointer; }
.dock-sendbtn:disabled { opacity: .5; cursor: progress; }
.ask-rail-h { font-size: 10.5px; text-transform: none; letter-spacing: -0.01em; color: var(--dimmer); margin: 12px 6px 2px; }
.ask-composer .dock-dd > summary { padding: 8px 10px; }
@media (max-width: 720px) { .dock-tabs, .dock-last { display: none; } .dock-panel { right: 8px; left: 8px; width: auto; height: min(80vh, 760px); } }
/* answers: tables, code, headings, entity links */
.ask-tablewrap { overflow-x: auto; margin: 6px 0 10px; }
.ask-table { border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; min-width: 60%; }
.ask-table th { text-align: left; font-weight: 600; color: var(--dim); font-size: 11.5px; text-transform: none; letter-spacing: -0.01em; padding: 5px 10px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.ask-table td { padding: 5px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ask-table tr:last-child td { border-bottom: none; }
.ask-code { font-family: var(--mono); font-size: 12px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; margin: 6px 0 10px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel-2); }
.ask-answer h4 { font-size: 13.5px; font-weight: 650; margin: 10px 0 4px; }
.ask-answer ol { margin: 0 0 8px 20px; }
.ask-link { color: var(--accent); border-bottom: 1px dotted var(--accent-dim); text-decoration: none; }
.ask-link:hover { border-bottom-style: solid; text-decoration: none; }

/* ── the sidebar: navigation on the left, scope on top, collapsible to a rail ── */
:root { --side-w: 232px; }
html[data-side="rail"] { --side-w: 56px; }
.shell { display: flex; min-height: 100vh; align-items: stretch; }
.side { position: sticky; top: 0; align-self: flex-start; height: 100vh; width: var(--side-w); flex: 0 0 var(--side-w); display: flex; flex-direction: column;
  background: var(--panel); border-right: 1px solid var(--line-2); z-index: var(--z-drawer); transition: width .15s ease, flex-basis .15s ease; }
.shell-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
/* A flex item's default min-width is its widest unbreakable content, so one no-wrap table
   used to stretch <main> past the window and scroll the whole page sideways. */
/* width: 100%, not auto — with auto side margins a flex item is sized shrink-to-fit, i.e. as
   wide as its widest child, which is how a wide table or chart grid pushed <main> past the
   window. A definite width fills the column and still centres under max-width. */
.shell-main > main { flex: 1 0 auto; min-width: 0; width: 100%; }
html { overflow-x: clip; }   /* the page never scrolls sideways; wide things scroll inside their own box */
main { max-width: 1400px; }
.side-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 12px 8px 8px 14px; }
.side-brand { text-decoration: none; color: var(--text); }
.side-brand:hover { text-decoration: none; }
.side-toggle { font: inherit; font-size: 13px; background: none; border: 1px solid transparent; color: var(--dim); border-radius: 6px; padding: 2px 8px; cursor: pointer; line-height: 1.3; }
.side-toggle:hover { border-color: var(--line-2); color: var(--text); }
.side-nav { flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; padding: 4px 8px 12px; }
.side-item { display: flex; align-items: center; gap: 12px; padding: 6px 10px; border-radius: 8px; color: var(--dim); font-size: 14px; text-decoration: none; cursor: pointer; white-space: nowrap; }
.side-item:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.side-item.on { color: var(--text); background: #2c2c2e; }
.side-group.on > summary.side-item { color: var(--text); }
.side-ico { flex: 0 0 30px; width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; color: var(--accent); font-size: 22px; line-height: 1; border-radius: 8px; background: rgba(41, 151, 255,.08); }
.side-item.on .side-ico, .side-group.on > summary .side-ico { background: rgba(41, 151, 255,.18); }
.side-foot .side-ico { width: 26px; height: 26px; flex-basis: 26px; font-size: 16px; }
.side-lab { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; }
/* navigation feedback — the owner: "show a spinner every time I am changing a page". A fixed bar under the
   top edge plus a small spinner; shown from the moment a navigation starts (beforeunload, or the click on a
   same-origin link) until the new page paints, so a slow page never looks like a dead click. */
/* no fade-IN: Safari freezes rendering the instant a navigation starts, so whatever is painted by then is what
   the person sees for the whole wait — it must be fully on in one frame. The fade-out is harmless. */
#nav-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: calc(var(--z-top) + 2); pointer-events: none; opacity: 0; transition: opacity .2s; }
html.is-navigating #nav-progress { transition: none; }
#nav-progress .bar { height: 100%; width: 30%; background: var(--accent); border-radius: 0 2px 2px 0; animation: navslide 1.1s ease-in-out infinite; }
#nav-progress .pill { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 9px; padding: 8px 14px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line-2); color: var(--text); font-size: 13px; font-weight: 600; box-shadow: 0 6px 24px rgba(0,0,0,.35); pointer-events: none; }
#nav-progress .spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--accent); animation: navspin .8s linear infinite; flex: none; }
html.is-navigating #nav-progress { opacity: 1; }
html.is-navigating body { cursor: progress; }
@keyframes navslide { 0% { margin-left: -30%; } 100% { margin-left: 100%; } }
@keyframes navspin { to { transform: rotate(360deg); } }
.side-count { font-size: 11px; line-height: 16px; padding: 0 7px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line-2); color: var(--dim); font-variant-numeric: tabular-nums; }
.side-count.crit { background: var(--bad); color: #fff; border-color: var(--bad); }
.al-subnav .n.hot { background: var(--bad); color: #fff; border-color: var(--bad); }
.al-section { margin-top: 26px; }
.al-section .sec { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.al-sec-sub { font-size: 12.5px; font-weight: 400; }
.al-fold > summary { cursor: pointer; font-size: 12.5px; margin: 6px 0; }
.al-scope { font-size: 13px; font-weight: 400; margin-left: 10px; }
.al-table tr.ib-unread td { background: rgba(10, 132, 255,.06); }
.al-msgs { list-style: none; margin: 0; padding: 0; }
.al-msg { padding: 9px 0; border-top: 1px solid var(--line-2); }
.al-msg:first-child { border-top: 0; }
.al-msg-h { font-size: 12px; color: var(--dim); display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: baseline; }
.al-msg-h .t { font-family: var(--mono); }
.al-msg-t { font-size: 13.5px; margin: 3px 0 2px; }
.al-msg-b { font-size: 12.5px; }
.al-msg-b ul { margin: 2px 0 4px; padding-left: 18px; }
.al-msg-b li { margin: 2px 0; }
.al-because li { margin: 4px 0; }
/* message numbers — the same #N on the card, the bell row and the page */
.al-mid { font-family: var(--mono); font-size: 11.5px; color: var(--dim); text-decoration: none; border: 1px solid var(--line-2); border-radius: 4px; padding: 0 5px; white-space: nowrap; }
.al-mid:hover { color: var(--text); border-color: var(--dim); }
.ib-mid { font-family: var(--mono); font-size: 10.5px; color: var(--dim); text-decoration: none; padding: 0 4px; align-self: center; }
.al-msg.hit { box-shadow: inset 3px 0 0 var(--accent); background: var(--panel-2); padding-left: 10px; border-radius: 4px; }
.al-focus { font-size: 12.5px; margin: 0 0 10px; padding: 6px 10px; border-left: 3px solid var(--accent); background: var(--panel-2); }
.al-now { color: var(--warn); font-size: 12px; white-space: nowrap; }
.al-card summary { cursor: pointer; font-size: 12px; margin-top: 4px; }
.al-stories { list-style: none; margin: 0; padding: 0; }
.al-story { padding: 8px 0; border-top: 1px solid var(--line-2); }
.al-story:first-child { border-top: 0; }
.al-story-t { font-size: 13px; }
.al-story-l { font-size: 12px; color: var(--dim); margin-top: 3px; display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: baseline; }
.al-story-l .t { font-family: var(--mono); }
.al-arrow { color: var(--dimmer); }
.al-earlier { margin-top: 4px; font-size: 12px; }
.al-earlier > summary { cursor: pointer; }
.al-earlier ul { margin: 4px 0 0; padding-left: 16px; }
.al-earlier li { margin: 2px 0; }
details.al-fold > summary { cursor: pointer; list-style: none; }
details.al-fold > summary h2 { margin: 0; }
.side-group > summary { list-style: none; }
.side-group > summary::-webkit-details-marker { display: none; }
.side-caret { font-size: 9px; opacity: .55; transition: transform .12s; }
.side-group[open] > summary .side-caret { transform: rotate(180deg); }
.side-items { padding: 2px 0 6px; }
.side-sub { padding: 5px 10px 5px 52px; font-size: 13px; }
.side-fly { display: none; }
.side-foot { border-top: 1px solid var(--line); padding: 8px; }
.side-foot .side-item { padding: 5px 10px; font-size: 12.5px; }
.side .beta-tag { margin-left: 4px; }
.topbar-brand { display: none; }
.side-mobile { display: none; font: inherit; font-size: 18px; background: none; border: 1px solid transparent; color: var(--dim); border-radius: 6px; padding: 2px 8px; cursor: pointer; }
.side-overlay { display: none; }
.topbar { padding: 10px 20px; }
.topbar .status { flex: 1 1 auto; }
.dock { left: var(--side-w); }
/* the rail: one glyph per group, items on hover */
@media (min-width: 901px) {
  html[data-side="rail"] .side-lab, html[data-side="rail"] .side-count, html[data-side="rail"] .side-caret, html[data-side="rail"] .side-brand-t, html[data-side="rail"] .side .beta-tag, html[data-side="rail"] .side-items { display: none; }
  html[data-side="rail"] .side-head { padding: 12px 0 8px; flex-direction: column; gap: 6px; }
  html[data-side="rail"] .side-item { justify-content: center; padding: 7px 0; gap: 0; }
  html[data-side="rail"] .side-ico { width: 36px; height: 36px; flex-basis: 36px; font-size: 24px; }
  html[data-side="rail"] .side-nav { padding: 4px 6px 12px; }
  html[data-side="rail"] .side-gwrap:hover > .side-fly, html[data-side="rail"] .side-gwrap:focus-within > .side-fly { display: block; }
  html[data-side="rail"] .side-gwrap[data-fly-off] > .side-fly { display: none; }   /* Esc closed it */
  html[data-side="rail"] .side-toggle { transform: rotate(180deg); }
  /* FIXED, not absolute: the nav scrolls (overflow-y:auto, which forces overflow-x to clip
     too), so an absolutely placed flyout was cut at the 56px rail — "Inciden…". A fixed box
     escapes the scroller; base.html places it beside its group (left/top) as it opens.
     It stays inside .side, so it rides the sidebar's layer above the header and content. */
  .side-fly { position: fixed; left: calc(var(--side-w) + 6px); top: 0; min-width: 220px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 10px; padding: 6px; box-shadow: 0 10px 30px rgba(0,0,0,.45); z-index: var(--z-raised); }
  /* a bridge over the gap between the rail and the flyout, so the pointer can cross it
     without leaving the group and closing the menu it is heading for */
  .side-fly::before { content: ""; position: absolute; top: 0; bottom: 0; left: -14px; width: 14px; }
  .side-fly-h { font-size: 10.5px; text-transform: none; letter-spacing: -0.01em; color: var(--dimmer); padding: 4px 8px; }
  .side-fly-item { display: block; padding: 6px 8px; border-radius: 6px; color: var(--text); font-size: 12.5px; text-decoration: none; white-space: nowrap; }
  .side-fly-item:hover, .side-fly-item.on { background: var(--panel-2); text-decoration: none; }
}
/* a narrow window: the sidebar is a drawer */
@media (max-width: 900px) {
  :root, html[data-side="rail"] { --side-w: 0px; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; height: auto; width: 264px; flex-basis: 264px; transform: translateX(-100%); transition: transform .18s ease; box-shadow: 0 0 40px rgba(0,0,0,.5); }
  .side.open { transform: none; }
  .side-toggle { display: none; }
  .side-mobile, .topbar-brand { display: inline-flex; align-items: center; }
  .side-overlay:not([hidden]) { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: calc(var(--z-drawer) - 1); }
  .topbar { padding: 8px 12px; }
  main { padding-left: 12px; padding-right: 12px; }
  .dock { left: 0; }
}
.xr-pick-all { border-bottom: 1px solid var(--line); border-radius: 0 !important; margin-bottom: 2px; padding-bottom: 8px !important; }
.xr-pick-all b { color: var(--text); }
/* the Ask page: rail + thread + a composer that stays in reach */
.ask-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.ask-head-pills { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.ask-layout { grid-template-columns: 240px minmax(0, 1fr); gap: 20px; }
.ask-rail { position: sticky; top: 12px; max-height: calc(100vh - 100px); overflow: auto; padding-right: 4px; }
.ask-new { display: inline-flex; width: 100%; justify-content: center; }
.ask-chats li { padding: 6px 8px; align-items: baseline; }
.ask-chats li a { font-size: 13px; }
.ask-when { color: var(--dimmer); font-size: 11px; white-space: nowrap; }
.ask-main { display: flex; flex-direction: column; min-height: calc(100vh - 220px); }
.ask-scroll { flex: 1 1 auto; }
.ask-empty-page { position: relative; inset: auto; min-height: 320px; border: 1px dashed var(--line-2); border-radius: 12px; background: var(--panel); }
.ask-composer.dock-compose { position: sticky; bottom: 12px; margin-top: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.35); display: block; }
.ask-composer.dock-compose textarea { font-size: 14px; }
.ask-composer .dock-menu { bottom: calc(100% + 8px); }
@media (max-width: 900px) { .ask-layout { grid-template-columns: 1fr; } .ask-rail { position: static; max-height: none; } }

/* ── Home cards (homewidgets): an ordered 12-column grid, masonry spans from home.js, and the editor ── */
.hw-head { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; flex-wrap:wrap; }
.hw-actions { display:flex; gap:8px; align-items:center; padding-top:4px; }
.hw-grid { display:grid; grid-template-columns:repeat(12, minmax(0, 1fr)); grid-auto-rows:8px; grid-auto-flow:dense; column-gap:14px; row-gap:0; align-items:start; }
.hw { grid-column:span 12; min-width:0; position:relative; }
.hw-inner { background:var(--panel); border:1px solid var(--line); border-radius:10px; padding:12px 14px; margin-bottom:14px; display:flex; flex-direction:column; min-height:0; }
@media (min-width: 1101px) { .hw { grid-column:span var(--w, 4); } }
@media (min-width: 701px) and (max-width: 1100px) { .hw { grid-column:span var(--wm, 6); } }
.hw.x { grid-column:1 / -1 !important; }
.hw.x .hw-inner { height:auto !important; }
.hw-b { flex:1 1 auto; min-height:0; overflow:auto; }
.hw-inner[style*="height"] .hw-b { padding-right:2px; }
.hw-x { margin-left:2px; }
.hw-rs { position:absolute; right:7px; bottom:21px; width:14px; height:14px; cursor:nwse-resize; border-right:2px solid var(--line-2); border-bottom:2px solid var(--line-2); border-radius:0 0 4px 0; opacity:.9; touch-action:none; }
.hw-rs:hover { border-color:var(--accent); }
.hw.rs .hw-inner { outline:1px dashed var(--accent); outline-offset:2px; user-select:none; }
.hw.rs .hw-b { pointer-events:none; }
.hw-h { display:flex; align-items:center; justify-content:space-between; gap:6px 8px; margin-bottom:8px; flex-wrap:wrap; }
.hw-h .hw-tools { margin-left:auto; }   /* on a narrow card the tools wrap under the title instead of squeezing it */
.hw-t { margin:0; font-size:12px; text-transform:none; letter-spacing:-0.01em; color:var(--dim); font-weight:600; }
.hw-tools { display:flex; gap:3px; align-items:center; flex-wrap:wrap; }
.hw-tools button { font:inherit; font-size:11px; line-height:1; padding:4px 6px; border:1px solid var(--line-2); border-radius:5px; background:var(--panel-2); color:var(--dim); cursor:pointer; }
.hw-tools button:hover { color:var(--text); border-color:var(--accent-dim); }
.hw-tools button.on { color:var(--text); border-color:var(--accent); background:var(--panel); font-weight:600; }
.hw-sep { width:1px; height:14px; background:var(--line-2); margin:0 3px; }
.hw[draggable="true"] .hw-h { cursor:grab; }
.hw.drag .hw-inner { opacity:.45; }
.hw.over .hw-inner { outline:2px dashed var(--accent); outline-offset:2px; }
.hw-cfg { border:1px dashed var(--line-2); border-radius:8px; padding:10px 12px; margin-bottom:10px; background:var(--panel-2); }
.hw-form { display:grid; grid-template-columns:1fr 1fr; gap:8px 12px; font-size:12.5px; }
.hw-form label { display:flex; flex-direction:column; gap:3px; color:var(--dim); min-width:0; }
.hw-form label small { color:var(--dimmer); font-size:11px; }
.hw-form input, .hw-form select, .hw-form textarea { font:inherit; font-size:12.5px; padding:5px 8px; border-radius:6px; border:1px solid var(--line-2); background:var(--panel); color:var(--text); min-width:0; }
.hw-form .full { grid-column:1 / -1; }
.hw-linkrow { display:grid; grid-template-columns:minmax(0, 1fr) minmax(0, 2fr); gap:6px; margin-bottom:4px; }
.hw-formact { display:flex; gap:8px; }
.hw-toolbar { display:flex; flex-wrap:wrap; gap:10px 16px; align-items:center; padding:10px 12px; border:1px dashed var(--accent-dim); border-radius:10px; margin:0 0 14px; background:var(--panel); font-size:12.5px; }
.hw-toolbar form { margin:0; }
.hw-add { position:relative; }
.hw-add > summary { list-style:none; display:inline-flex; }
.hw-add > summary::-webkit-details-marker { display:none; }
.hw-cat { position:absolute; z-index:var(--z-dropdown); top:100%; left:0; margin-top:6px; width:min(780px, 92vw); max-height:70vh; overflow:auto; background:var(--panel); border:1px solid var(--line-2); border-radius:10px; box-shadow:0 12px 32px rgba(0,0,0,.35); padding:6px; }
.hw-cat-q { position:sticky; top:0; z-index:var(--z-raised); width:100%; font:inherit; font-size:13px; padding:7px 10px; border-radius:8px; border:1px solid var(--line-2); background:var(--panel-2); color:var(--text); margin-bottom:6px; }
.hw-cat-gh { font-size:11px; text-transform:none; letter-spacing:-0.01em; color:var(--dimmer); padding:10px 10px 4px; font-weight:600; }
.hw-cat-items { display:grid; grid-template-columns:1fr 1fr 1fr; gap:4px; }
@media (max-width: 800px) { .hw-cat-items { grid-template-columns:1fr; } }
.hw-cat button { text-align:left; font:inherit; padding:8px 10px; border-radius:8px; border:1px solid transparent; background:transparent; color:var(--text); cursor:pointer; }
.hw-cat button:hover { background:var(--panel-2); border-color:var(--line); }
.hw-cat b { display:block; font-size:12.5px; } .hw-cat small { color:var(--dim); font-size:11.5px; line-height:1.35; display:block; }
/* build-your-own widget: the plain-words box at the top of the Add menu */
.hw-gen { border:1px solid var(--accent-dim); border-radius:9px; background:var(--panel-2); padding:10px; margin:2px 0 8px; }
.hw-gen-h { font-size:13px; font-weight:600; color:var(--text); }
.hw-gen-blurb { font-size:11.5px; color:var(--dim); line-height:1.4; margin:3px 0 7px; }
.hw-gen-text { width:100%; font:inherit; font-size:13px; padding:7px 9px; border-radius:7px; border:1px solid var(--line-2); background:var(--panel); color:var(--text); resize:vertical; min-height:38px; }
.hw-gen-row { display:flex; align-items:center; gap:10px; margin-top:7px; flex-wrap:wrap; }
.hw-gen-status { font-size:11.5px; line-height:1.35; }
.hw-gen-out { margin-top:9px; border-top:1px solid var(--line); padding-top:9px; }
.hw-gen-preview { border:1px solid var(--line); border-radius:8px; padding:6px; background:var(--panel); max-height:340px; overflow:auto; }
.hw-cat-pages { border-top:1px solid var(--line); margin-top:6px; }
.hw-cat-pages > summary { list-style:none; cursor:pointer; }
.hw-cat-pages > summary::-webkit-details-marker { display:none; }
.hw-cat-pages > summary::before { content:"▸ "; color:var(--dimmer); }
.hw-cat-pages[open] > summary::before { content:"▾ "; }
/* X-ray usage widget: a compact stat row, a spark, the busiest pages — no scrolling page */
.hw-ustats { display:flex; flex-wrap:wrap; gap:10px 22px; }
.hw-ustats > div { display:flex; flex-direction:column; }
.hw-ustats b { font-size:22px; font-weight:700; line-height:1.1; font-variant-numeric:tabular-nums; }
.hw-ustats small { font-size:11px; color:var(--dim); margin-top:1px; }
.hw-utop { margin-top:8px; display:flex; flex-wrap:wrap; gap:6px 8px; align-items:center; font-size:11.5px; }
.hw-utop .pill { font-family:var(--mono); font-size:10.5px; }
.hw-fragbox { min-height:60px; }
.hw-frag .page-head, .hw-frag h1 { display:none; }
.hw-frag > .hw-fragbox > * { max-width:100%; }
.hw-loading { color:var(--dimmer); font-size:12px; padding:8px 0; margin:0; }
.hw-foot { font-size:11.5px; margin:8px 0 0; }
.hw-toast { position:fixed; bottom:72px; right:18px; background:var(--panel); border:1px solid var(--line-2); border-radius:8px; padding:6px 10px; font-size:12px; color:var(--dim); box-shadow:0 8px 24px rgba(0,0,0,.3); opacity:0; transition:opacity .2s; z-index:var(--z-toast); pointer-events:none; }
.hw-toast.show { opacity:1; } .hw-toast.bad { color:var(--bad); }
.hw-mine { display:inline-block; position:relative; font-size:12px; } .hw-mine > summary { cursor:pointer; list-style:none; padding:2px 6px; }
.hw-minebox { position:absolute; z-index:var(--z-dropdown); top:100%; left:0; margin-top:4px; background:var(--panel); border:1px solid var(--line-2); border-radius:8px; padding:8px 10px; box-shadow:0 8px 24px rgba(0,0,0,.3); white-space:nowrap; }
.hw-sub { margin:-4px 0 8px; font-size:12.5px; color:var(--dim); }
.hw-pills { display:flex; flex-wrap:wrap; gap:6px 8px; align-items:center; }
.hw-statbox .stat-label { font-size:11px; }
.hw-statbox .stat-big { font-size:26px; font-weight:700; line-height:1.15; margin-top:2px; }
.hw-statbox .stat-big.warn { color:var(--warn); }
.hw-spark { margin-top:6px; } .hw-spark svg { width:100%; height:auto; display:block; }
.hw-links { list-style:none; margin:0; padding:0; } .hw-links li { padding:5px 0; border-bottom:1px solid var(--line); font-size:13px; } .hw-links li:last-child { border-bottom:0; }
.hw-links li small { display:block; color:var(--dimmer); font-family:var(--mono); font-size:10.5px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.hw-rows { width:100%; border-collapse:collapse; font-size:12.5px; } .hw-rows td { padding:5px 6px 5px 0; border-bottom:1px solid var(--line); vertical-align:top; }
.hw-rows tr:last-child td { border-bottom:0; } .hw-rows td.num { text-align:right; font-family:var(--mono); white-space:nowrap; }
.hw-rows td.good { color:var(--good); } .hw-rows td.warn { color:var(--warn); } .hw-rows td.bad { color:var(--bad); }
.hw-empty { color:var(--dim); font-size:12.5px; padding:6px 0; margin:0; }
.hw-note { font-size:13px; line-height:1.5; white-space:pre-wrap; }
.hw-chart svg { width:100%; height:auto; display:block; }
.hw-strip.hm-strip { margin:0; }

/* system alerts: typed settings (a multi is a row of checkboxes), a changed setting is marked */
.al-multi { display:inline-flex; flex-wrap:wrap; gap:4px 12px; }
.al-check { display:inline-flex; align-items:center; gap:5px; font-size:12.5px; color:var(--text); text-transform:none; letter-spacing:0; }
.nf-form label.al-changed { border-left:3px solid var(--warn); padding-left:8px; }

/* business areas: dots, share bars, chips, the expandable area rows */
.ar-dot { display:inline-block; width:9px; height:9px; border-radius:50%; margin-right:6px; vertical-align:middle; }
.ar-bar { display:inline-block; width:90px; height:8px; background:var(--panel-2); border-radius:4px; overflow:hidden; vertical-align:middle; }
.ar-bar i { display:block; height:100%; background:var(--accent-dim); }
.ar-bar.sm { width:70px; }
.ar-legend { display:flex; flex-wrap:wrap; gap:4px 14px; font-size:12px; color:var(--dim); margin:6px 0 8px; }
.ar-legend span { display:inline-flex; align-items:center; }
.ar-open { font:inherit; background:none; border:0; padding:0; color:var(--text); cursor:pointer; text-align:left; display:inline-flex; align-items:center; gap:2px; }
.ar-open:hover b, .ar-row.ar-on .ar-open b { color:var(--accent); }
.ar-caret { color:var(--dimmer); font-size:11px; margin-left:4px; transition:transform .12s; display:inline-block; }
.ar-row.ar-on .ar-caret { transform:rotate(90deg); }
.ar-detail td { padding:0 12px 10px !important; border-bottom:1px solid var(--line); }
.ar-detail[hidden] { display:none; }
.ar-screens { margin:0; padding:8px 10px; background:var(--panel-2); border-radius:8px; font-size:12px; }
.ar-screens table.hw-rows td:first-child code { white-space:normal; overflow-wrap:anywhere; }
.ar-chart { margin-bottom:8px; } .ar-chart svg { width:100%; height:auto; display:block; }
.ar-chip { display:inline-block; font-size:11px; line-height:1.5; padding:0 7px; border-radius:999px; border:1px solid var(--line-2); border-left:3px solid var(--c, var(--line-2)); margin:1px 3px 1px 0; color:var(--text); white-space:nowrap; }
.ar-sc td { font-size:12px; }

/* an org's landing page: the grid of everything tied to it */
.org-links { display:grid; grid-template-columns:repeat(auto-fill, minmax(200px, 1fr)); gap:8px; margin:0 0 16px; }
.org-links a { display:flex; flex-direction:column; gap:3px; padding:10px 12px; border:1px solid var(--line); border-radius:9px; background:var(--panel); color:var(--text); text-decoration:none; min-width:0; }
.org-links a:hover { border-color:var(--accent); text-decoration:none; }
.org-links a b { font-size:13px; }
.org-links a span { font-size:11.5px; color:var(--dim); line-height:1.4; }

/* ── Costs (3.2) ─────────────────────────────────────────────────────────────────────── */
.co-nav { margin: 4px 0 8px; }
.co-period { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 6px 0 10px; }
.co-period .chip.on { background: var(--accent-soft, rgba(10, 132, 255,.18)); border-color: var(--accent, #0a84ff); color: var(--ink, #eee); }
.co-custom { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; }
.co-custom input[type=date] { font: inherit; font-size: 12px; padding: 2px 6px; background: var(--surface-2, #1c1c1e); color: inherit; border: 1px solid var(--line, #2c2c2e); border-radius: 6px; }
.co-through { margin-left: auto; font-size: 12px; }
.co-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 4px 0 10px; }
.co-groupform label { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.co-groupform select { font: inherit; font-size: 13px; padding: 3px 8px; border-radius: 6px; background: var(--surface-2, #1c1c1e); color: inherit; border: 1px solid var(--line, #2c2c2e); }
.co-chips { margin: 2px 0 6px; }
.co-chip { display: inline-flex; align-items: center; gap: 6px; }
.co-chip-x { color: inherit; opacity: .7; text-decoration: none; font-weight: 700; padding: 0 2px; }
.co-chip-x:hover { opacity: 1; color: var(--bad, #d9382e); }
.co-tiles .stat-tile { text-decoration: none; color: inherit; }
.co-tiles a.stat-tile:hover { border-color: var(--accent, #0a84ff); }
.co-tiles .co-bad .stat-big { color: var(--bad, #ff453a); }
.co-tiles .co-warn .stat-big { color: var(--warn, #ff9f0a); }
.co-tiles .co-good .stat-big { color: var(--good, #30d158); }
.co-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 12px; margin-top: 12px; }
.co-table td, .co-table th { vertical-align: top; }
.co-table.small td, .co-table.small th { font-size: 12px; padding: 4px 6px; }
.co-list { margin: 6px 0 0; padding-left: 18px; }
.co-list li { margin: 3px 0; }
/* Cost direction: UP is bad (red), a DECREASE is good (green, .co-good via the delta macro).
   .co-down stays red — it marks bad states elsewhere (over budget, last error, wasted commitment). */
.co-up { color: var(--bad, #ff453a); font-weight: 600; }
.co-down { color: var(--bad, #ff453a); }
.co-good { color: var(--good, #30d158); }
/* Amber counterpart to .co-good: a degraded-but-not-broken state, e.g. a data source X-ray
   cannot read. Distinct from .co-down, which means "bad value" rather than "no value". */
.co-warn { color: var(--warn, #ff9f0a); }
.co-anom .co-anom-dir.up { color: var(--bad, #ff453a); }
.co-anom .co-anom-dir.down { color: var(--good, #30d158); }
.co-summary { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; font-size: 14px; margin: 2px 0 8px; }
.co-share { display: inline-block; min-width: 96px; position: relative; height: 18px; border-radius: 4px; background: var(--surface-2, #1c1c1e); overflow: hidden; text-align: right; }
.co-share::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: var(--w); background: var(--accent-soft, rgba(10, 132, 255,.35)); }
.co-share span { position: relative; padding: 0 6px; font-size: 12px; line-height: 18px; }
.co-spark svg { display: block; width: 120px; height: 28px; }
.co-spark-h { width: 130px; }
.co-foot { margin-top: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.co-inline { display: inline; }
.co-running { color: var(--warn, #ff9f0a); }
.co-tops { display: inline-flex; gap: 4px; vertical-align: middle; }
.co-tops .chip { padding: 0 7px; font-size: 11.5px; }
.co-fams { display: grid; gap: 12px; margin-top: 12px; }
.co-fam-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.co-gauge svg { width: 150px; height: auto; }
.co-fam-body { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-top: 8px; }
@media (max-width: 900px) { .co-fam-body { grid-template-columns: 1fr; } }
.co-day { margin-top: 10px; }
.co-anom { border-top: 1px solid var(--line, #2c2c2e); padding: 6px 0; }
.co-anom summary { cursor: pointer; }
.co-anom-body { padding: 8px 0 4px 18px; }
.co-explain-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 6px; }
.co-drivers { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.co-corr { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.co-targetform { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: flex-end; margin-top: 8px; }
.co-targetform label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; }
.co-targetform input, .co-targetform select { font: inherit; font-size: 13px; padding: 4px 8px; border-radius: 6px; background: var(--surface-2, #1c1c1e); color: inherit; border: 1px solid var(--line, #2c2c2e); min-width: 220px; }
.co-desc { max-width: 520px; }
.co-actions form { margin-right: 4px; }
.co-note { margin: 6px 0 10px; }
.co-cat-cost { background: rgba(48, 209, 88,.18); }
.co-cat-reliability { background: rgba(255, 159, 10,.18); }
.co-cat-security { background: rgba(255, 69, 58,.18); }
.co-recos { margin-top: 12px; }

/* AI · Documents: the page opens with what the window means, in sentences, before any table.
   Body-sized text (not .sec-sub's 12.5px) because this is the answer, not a caption. */
.docs-lede { max-width: 980px; margin: 6px 2px 16px; }
.docs-lede p { margin: 0 0 6px; font-size: 14.5px; line-height: 1.5; color: var(--text); }
.docs-lede p b { font-weight: 600; }

/* the alert form's reason a submit did nothing — next to the button, in the warning ink */
.al-invalid-err { color: var(--warn, #ff9f0a); font-size: 12.5px; margin-left: 8px; }

/* Costs · Search: the box and the blank-state suggestions */
.co-searchform { display: flex; gap: 8px; align-items: center; flex: 1 1 420px; }
.co-searchform input[type="search"] {
  flex: 1 1 auto; min-width: 220px; padding: 7px 11px; font-size: 13.5px;
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line-2); border-radius: 6px;
}
.co-searchform input[type="search"]:focus { outline: 2px solid var(--accent, #0a84ff); outline-offset: 1px; border-color: var(--accent-dim); }
.co-suggest { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 2px 4px; }
.co-search-blank { max-width: 980px; }

/* ── ArgoCD · In sync? ───────────────────────────────────────────────────────
   The verdict is meant to be readable from across the room: one line that says
   whether anything is wrong, in a colour that says the same thing again. Green
   is the common case and it should look restful, not merely "not red". */
.sync-verdict {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 18px 20px; margin: 4px 2px 22px;
  border: 1px solid var(--line); border-left-width: 4px; border-radius: 12px;
  background: var(--panel);
}
.sync-verdict.sync-clean, .sync-verdict.sync-capacity { border-left-color: var(--good); }
.sync-verdict.sync-drifted { border-left-color: var(--warn); }
.sync-mark {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; font-weight: 700; line-height: 1;
}
.sync-clean .sync-mark, .sync-capacity .sync-mark { color: var(--good); background: rgba(48, 209, 88, 0.12); }
.sync-drifted .sync-mark { color: var(--warn); background: rgba(255, 159, 10, 0.13); }
.sync-head { margin: 2px 0 0; font-size: 19px; font-weight: 600; color: var(--text); line-height: 1.35; }
.sync-sub { margin: 7px 0 0; font-size: 13px; color: var(--dim); line-height: 1.55; max-width: 74ch; }

.sync-envs { display: grid; grid-template-columns: repeat(auto-fit, minmax(268px, 1fr)); gap: 12px; margin: 0 2px 26px; }
.sync-env {
  padding: 14px 15px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel);
}
.sync-env-top { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.sync-env-top b { font-size: 14px; color: var(--text); }
.sync-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--dimmer); }
.sync-env.sync-clean .sync-dot, .sync-env.sync-capacity .sync-dot { background: var(--good); }
.sync-env.sync-drifted .sync-dot { background: var(--warn); }
.sync-state { margin-left: auto; font-size: 11px; text-transform: none; letter-spacing: -0.01em; color: var(--dim); }
.sync-env.sync-drifted .sync-state { color: var(--warn); }
.sync-line { margin: 0; font-size: 13px; color: var(--dim); line-height: 1.55; }

.sync-more { margin: 18px 2px 8px; }
.sync-more > summary {
  cursor: pointer; font-size: 13px; color: var(--dim); padding: 8px 0;
  border-top: 1px solid var(--line);
}
.sync-more > summary:hover { color: var(--text); }
/* A card is a link to that environment on its own — "go to the production tab" — so it has
   to look pressable without turning into a blue underlined block. */
a.sync-env { display: block; text-decoration: none; color: inherit; transition: border-color .12s, background .12s; }
a.sync-env:hover { border-color: var(--line-2); background: var(--panel-2); }
a.sync-env:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* The reassurance inside an alarm banner. It has to read as the good news it is without
   competing with the headline, so: the good colour, but not the headline's weight or size. */
.sync-calm { color: var(--good); font-weight: 600; }

/* ── Findings: one alert about many targets ──────────────────────────────────
   A labelled query alert emits one finding per target, which is right for acking and
   wrong for reading: on the live fleet one alert was 40 of 69 open findings. The group
   reads as a single row until you want the members. */
.fcard-group { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); margin-bottom: 10px; }
.fcard-group > details > summary {
  cursor: pointer; padding: 13px 15px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
}
.fcard-group > details > summary:hover { background: var(--panel-2); }
.fcard-group > details > summary b { font-size: 14px; color: var(--text); }
.fcard-group-sample { font-size: 12px; }
.fcard-group-body { padding: 0 12px 12px; border-top: 1px solid var(--line); }
.fcard-group[open] { border-color: var(--line-2); }
/* per-response cost, in the footer and the "queries behind this view" modal */
.qcost { font-variant-numeric: tabular-nums; }
.qcost b { font-weight: 600; }
.foot-cost { display: block; margin-top: 4px; opacity: 0.85; }
.qm-foot .qcost b { color: var(--accent, #0c8577); }

.fx-pager { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 18px 0 4px; font-size: 13px; }
.fx-pager .fx-pager-count { color: var(--dim); margin-right: 8px; font-variant-numeric: tabular-nums; }
.fx-pager a, .fx-pager .on, .fx-pager .off { padding: 4px 10px; border: 1px solid var(--line-2); border-radius: 6px; text-decoration: none; color: var(--text); min-width: 20px; text-align: center; }
.fx-pager a:hover { border-color: var(--accent-dim); }
.fx-pager .on { border-color: var(--accent); background: var(--panel-2); font-weight: 600; }
.fx-pager .off { opacity: .4; }
.fx-pager .gap { color: var(--dim); padding: 4px 2px; }

/* Ask answers: GitHub/Linear/URL references as compact icon chips that open in a new tab
 * (owner, 2026-09-04 — a naked URL is noise; a click should not lose the chat). Tokens only. */
.ask-reflink { display:inline-flex; align-items:center; gap:4px; padding:1px 6px 1px 5px; margin:0 1px;
  border:1px solid var(--line); border-radius:5px; background:var(--panel-2); color:var(--text);
  font-size:12px; line-height:1.5; text-decoration:none; white-space:nowrap; vertical-align:baseline;
  font-variant-numeric:tabular-nums; }
.ask-reflink:hover { border-color:var(--accent-dim); text-decoration:none; }
.ask-ico { width:12px; height:12px; flex:none; display:inline-block; vertical-align:-2px; }

/* Conversations rail: search, per-chat cost, delete-on-hover (owner, 2026-09-04). Tokens only. */
.ask-search { width:100%; box-sizing:border-box; margin:8px 0 2px; padding:6px 9px;
  border:1px solid var(--line); border-radius:6px; background:var(--panel-2); color:var(--text);
  font:inherit; font-size:12.5px; }
.ask-search::placeholder { color:var(--dimmer); }
.ask-search:focus { outline:none; border-color:var(--accent-dim); }
.ask-chats li { position:relative; }
.ask-when .ask-cost { font-variant-numeric:tabular-nums; }
.ask-del { flex:none; border:none; background:transparent; color:var(--dimmer); cursor:pointer;
  font-size:15px; line-height:1; padding:0 2px; opacity:0; transition:opacity .1s; }
.ask-chats li:hover .ask-del, .ask-del:focus-visible { opacity:1; }
.ask-del:hover { color:var(--bad); }
.ask-rail-empty { font-size:12.5px; margin:12px 6px; }

/* Chat trace: collapsible turns — the header is the summary (stays visible), the steps collapse,
 * the answer stays shown. Focus on one turn without losing the others (owner, 2026-09-04). */
.turn { border-top: 1px solid var(--line); }
.turn > summary.turnhead { cursor: pointer; list-style: none; display: flex; flex-wrap: wrap;
  align-items: baseline; gap: 8px; padding: 11px 6px; border-radius: 6px; }
.turn > summary.turnhead::-webkit-details-marker { display: none; }
.turn > summary.turnhead::before { content: "\25B8"; color: var(--dimmer); font-size: 11px;
  display: inline-block; transition: transform .12s; }
.turn[open] > summary.turnhead::before { transform: rotate(90deg); }
.turn > summary.turnhead:hover { background: var(--panel-2); }
.turn-t { font-size: 14px; }
.turn-q { overflow: hidden; text-overflow: ellipsis; max-width: 60ch; white-space: nowrap; }
.turn-meta { margin-left: auto; white-space: nowrap; }
.turnanswer { border: 1px solid var(--line); border-radius: 8px; margin: 4px 0 16px; padding: 10px 12px; }
.turn-anchor { position: relative; top: -64px; display: block; height: 0; }
.turnanswer-h { font-size: 10.5px; text-transform: none; letter-spacing: -0.01em; color: var(--dimmer); margin-bottom: 6px; }

/* Alert edit: the title itself is renamable — a heading-styled input; Rename appears on change. */
.al-title-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.al-rename { display: inline-flex; align-items: baseline; gap: 8px; }
.al-title-in { font: inherit; font-weight: 600; color: var(--text); background: transparent;
  border: none; border-bottom: 1px dashed var(--line-2); padding: 0 2px; min-width: 12ch; max-width: 70vw; border-radius: 3px; cursor: text; }
.al-title-in:hover { border-bottom-color: var(--dim); }
.al-title-in:focus { outline: none; border-bottom-color: var(--accent); background: var(--panel-2); }
.al-rename-btn { font-size: 12px; padding: 3px 12px; align-self: center; }
.al-rename-btn:disabled { opacity: .4; cursor: default; }

/* ── Perimeter (Cloudflare edge) ─────────────────────────────────────────────────────────
   Everything pm- prefixed so it can't collide with X-ray's cascade. Extra colours are derived
   from the existing themed tokens with color-mix, so both themes resolve for free. */
:root {
  --pm-orange: var(--warn);
  --pm-grid: var(--chart-grid, var(--line));
  --pm-land: color-mix(in srgb, var(--accent) 22%, var(--line-2));
  --pm-grat: var(--line);
  --pm-mapbg: var(--bg);
  --pm-soft: color-mix(in srgb, var(--accent) 12%, transparent);
}
.pm-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
.pm-controls { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.pm-seg { display: inline-flex; flex-wrap: wrap; gap: 3px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; padding: 3px; }
.pm-seg button { font: inherit; font-size: 12.5px; font-weight: 550; border: 0; background: transparent; color: var(--dim); padding: 5px 12px; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.pm-seg button[aria-pressed="true"] { background: var(--panel); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.pm-stamp { font-size: 11.5px; color: var(--dimmer); }
.pm-num { font-variant-numeric: tabular-nums; } .pm-mono { font-family: var(--mono); }
.pm-empty { color: var(--dim); font-size: 12.5px; padding: 8px 0; margin: 0; }

.pm-state { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; color: var(--dim); padding: 60px 20px; }
/* a class `display` beats the [hidden] attribute's UA display:none, so re-assert it at higher specificity */
.pm-state[hidden], .pm-app[hidden] { display: none; }
.pm-state code { font-family: var(--mono); font-size: 12px; background: var(--panel-2); padding: 1px 5px; border-radius: 4px; }
.pm-spinner { width: 26px; height: 26px; border: 3px solid var(--line-2); border-top-color: var(--accent); border-radius: 50%; animation: pm-spin .8s linear infinite; }
@keyframes pm-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .pm-spinner { animation: none; } }

.pm-app { display: flex; flex-direction: column; gap: 14px; }
.pm-collect { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--dim); background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; padding: 8px 13px; }
.pm-collect b { color: var(--text); }
.pm-collect a { color: var(--accent); }
.pm-live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 22%, transparent); flex: none; }
.pm-kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.pm-kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 11px; padding: 13px 15px; }
.pm-k-label { font-size: 11.5px; color: var(--dim); }
.pm-k-val { font-size: 27px; font-weight: 680; line-height: 1.1; margin-top: 4px; letter-spacing: -.02em; }
.pm-k-foot { font-size: 11.5px; color: var(--dimmer); margin-top: 3px; }
.pm-kpi.alert .pm-k-val { color: var(--bad); }

.pm-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px 17px; }
.pm-h2 { font-size: 12px; font-weight: 650; letter-spacing: -0.01em; text-transform: none; color: var(--dim); margin: 0 0 2px; }
.pm-cap { font-size: 11.5px; color: var(--dimmer); margin: 2px 0 12px; }
.pm-grid { display: grid; gap: 14px; }
.pm-g2 { grid-template-columns: 1.35fr 1fr; } .pm-g3 { grid-template-columns: 1fr 1fr 1fr; }
.pm-app svg { display: block; width: 100%; height: auto; overflow: visible; }

.pm-maphead { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.pm-mapstat { font-size: 11.5px; color: var(--dim); } .pm-mapstat b { color: var(--text); font-variant-numeric: tabular-nums; }
.pm-mapbox { margin-top: 10px; border-radius: 10px; background: var(--pm-mapbg); border: 1px solid var(--line); overflow: hidden; }
.pm-node { cursor: pointer; }
.pm-origin-ring { transform-origin: center; animation: pm-ping 2.6s ease-out infinite; }
@keyframes pm-ping { 0% { r: 6; opacity: .55; } 70% { r: 26; opacity: 0; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .pm-origin-ring { animation: none; opacity: 0; } }

.pm-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 11.5px; color: var(--dim); margin-top: 8px; }
.pm-legend span { display: inline-flex; align-items: center; gap: 6px; }
.pm-sw { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.pm-ln { width: 14px; height: 0; border-top: 2px solid var(--accent); display: inline-block; }
.pm-tip { position: fixed; pointer-events: none; z-index: var(--z-popover); background: var(--panel); border: 1px solid var(--line-2); border-radius: 8px; padding: 7px 10px; font-size: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.3); opacity: 0; transition: opacity .08s; white-space: nowrap; max-width: 260px; }
.pm-tip b { font-variant-numeric: tabular-nums; }

.pm-bars { display: flex; flex-direction: column; gap: 8px; }
.pm-bar { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; font-size: 12.5px; }
.pm-lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-track { grid-column: 1 / -1; height: 6px; border-radius: 4px; background: var(--panel-2); overflow: hidden; }
.pm-fill { height: 100%; border-radius: 4px; background: var(--accent); }
.pm-v { color: var(--dim); font-variant-numeric: tabular-nums; font-size: 12px; }

.pm-wrapbox { overflow-x: auto; }
.pm-tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.pm-tbl th { text-align: left; font-weight: 600; color: var(--dimmer); font-size: 11px; text-transform: none; letter-spacing: -0.01em; padding: 0 10px 7px 0; border-bottom: 1px solid var(--line); }
.pm-tbl td { padding: 7px 10px 7px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.pm-tbl tr:last-child td { border-bottom: 0; }
.pm-tbl td.r, .pm-tbl th.r { text-align: right; font-variant-numeric: tabular-nums; }
.pm-ipbtn { cursor: pointer; font-family: var(--mono); color: var(--text); }
.pm-click { cursor: pointer; } .pm-click:hover td { background: var(--pm-soft); } .pm-on td { background: var(--pm-soft); }
.pm-cc { display: inline-block; min-width: 22px; font-family: var(--mono); font-size: 11px; color: var(--dim); padding: 1px 5px; border: 1px solid var(--line); border-radius: 4px; }
.pm-pill { display: inline-block; font-size: 10.5px; font-weight: 650; letter-spacing: -0.01em; padding: 2px 7px; border-radius: 999px; }
.pm-pill.block { color: var(--bad); background: color-mix(in srgb, var(--bad) 14%, transparent); }
.pm-pill.chal { color: var(--warn); background: color-mix(in srgb, var(--warn) 16%, transparent); }
.pm-meth { font-family: var(--mono); font-size: 11px; color: var(--dim); }
.pm-filterbar { display: flex; align-items: center; gap: 9px; font-size: 12px; color: var(--dim); margin-bottom: 9px; }
.pm-clearx { cursor: pointer; border: 1px solid var(--line-2); background: var(--panel-2); border-radius: 6px; padding: 2px 9px; font: inherit; font-size: 11.5px; color: var(--text); }
.pm-note { font-size: 12px; color: var(--dim); background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; padding: 10px 13px; }
.pm-note b { color: var(--text); }

.pm-rulesum { display: flex; gap: 20px; flex-wrap: wrap; font-size: 12.5px; color: var(--dim); margin: 2px 0 14px; }
.pm-rulesum b { color: var(--text); font-variant-numeric: tabular-nums; }
.pm-rulegrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.pm-rulecard { position: relative; text-align: left; background: var(--panel-2); border: 1px solid var(--line); border-left: 3px solid var(--bad); border-radius: 9px; padding: 11px 13px; cursor: pointer; font: inherit; color: var(--text); transition: border-color .1s, transform .05s; }
.pm-rulecard:hover { border-color: var(--line-2); border-left-color: var(--bad); transform: translateY(-1px); }
.pm-rulecard.warn { border-left-color: var(--pm-orange); } .pm-rulecard.info { border-left-color: var(--accent); }
.pm-rc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.pm-rc-name { font-size: 13px; font-weight: 600; line-height: 1.3; }
.pm-rc-cve { font-family: var(--mono); font-size: 10.5px; color: var(--bad); margin-top: 2px; }
.pm-rc-count { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.pm-rc-count small { display: block; font-size: 9.5px; font-weight: 600; color: var(--dimmer); text-transform: none; letter-spacing: -0.01em; text-align: right; margin-top: 2px; }
.pm-rc-meta { font-size: 11px; color: var(--dim); margin-top: 8px; display: flex; gap: 8px; align-items: center; }
.pm-rc-example { font-family: var(--mono); font-size: 11px; color: var(--dim); margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-tag { display: inline-block; font-size: 10px; font-weight: 650; letter-spacing: -0.01em; padding: 1px 7px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line-2); color: var(--dim); }
.pm-armed { margin-top: 14px; }
.pm-armed h3 { font-size: 11.5px; color: var(--dim); font-weight: 600; margin: 0 0 8px; }
.pm-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pm-achip { font-size: 11px; color: var(--dim); background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px; }
.pm-achip.custom { color: var(--good); border-color: color-mix(in srgb, var(--good) 40%, var(--line)); }

.pm-scrim { position: fixed; inset: 0; background: rgba(0, 0, 0,.5); opacity: 0; pointer-events: none; transition: opacity .16s; z-index: var(--z-modal); }
.pm-scrim.open { opacity: 1; pointer-events: auto; }
.pm-drawer { position: fixed; top: 0; right: 0; height: 100%; width: min(460px, 94vw); background: var(--panel); border-left: 1px solid var(--line-2); box-shadow: -16px 0 40px rgba(0,0,0,.28); transform: translateX(100%); transition: transform .2s cubic-bezier(.4,0,.2,1); z-index: calc(var(--z-modal) + 1); overflow-y: auto; }
.pm-drawer.open { transform: translateX(0); }
.pm-dh { position: sticky; top: 0; background: var(--panel); border-bottom: 1px solid var(--line); padding: 16px 18px; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.pm-dh h3 { margin: 0; font-size: 16px; font-weight: 650; line-height: 1.3; }
.pm-close { cursor: pointer; border: 1px solid var(--line-2); background: var(--panel-2); border-radius: 7px; width: 28px; height: 28px; font-size: 15px; color: var(--text); flex: none; }
.pm-db { padding: 16px 18px 40px; }
.pm-drow { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.pm-kv { font-size: 12px; color: var(--dim); margin: 0 0 3px; }
.pm-big { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.pm-sec { margin-top: 18px; } .pm-sec h4 { font-size: 11px; text-transform: none; letter-spacing: -0.01em; color: var(--dimmer); margin: 0 0 8px; }
.pm-drawer pre { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-family: var(--mono); font-size: 11.5px; color: var(--text); white-space: pre-wrap; word-break: break-word; margin: 0; }
@media (max-width: 900px) { .pm-kpis { grid-template-columns: repeat(2, 1fr); } .pm-g2, .pm-g3, .pm-rulegrid { grid-template-columns: 1fr; } }

/* ══ Apple design pass (owner, 2026-09-19) ══════════════════════════════════════
   The owner asked for apple.com's look and tone across the whole instrument: flat
   surfaces, no glows or gradients, SF-style type with Apple's tracking, 980px pill
   controls, 18px cards, sentence case everywhere. The tokens above (and the palette
   in scripts/build_light_theme.py) carry the color system — apple.com light, iOS
   dark layering; this section re-skins the chrome tokens alone can't reach. Values
   verified against apple.com's shipped CSS (overview.built.css, globalheader.css). */

body { letter-spacing: -0.016em; }
code, pre, kbd, samp { letter-spacing: 0; }

/* Page titles use Apple's display scale: 28px/600 with the slight positive
   tracking apple.com gives 19–24px+ display sizes. */
.page-head h1 { font-size: 28px; font-weight: 600; letter-spacing: 0.007em; line-height: 1.14; }

/* Cards are flat, borderless surfaces separated from the ground by tone, not
   hairlines — apple.com tiles on the gray canvas, iOS elevation in dark. */
.fx-card, .fx-panel, .tablewrap, .hm-tile { border-color: transparent; border-radius: 18px; }
.fx-body { padding: 14px 18px; }
.fx-list { gap: 12px; }

/* Sentence case everywhere: hierarchy comes from size, weight and color — never caps. */
.fx-sev { text-transform: capitalize; letter-spacing: 0; font-size: 12px; border-radius: 980px; padding: 2px 10px; }
.fx-panel h2, .pm-sec h4 { text-transform: none; letter-spacing: 0; font-size: 13px; }

/* Filter chips are apple.com's: full pills, and selection is an inversion of the
   ground, not a hue — the same rule reads right in both themes. */
.chip, .fx-filters .fl a { border-radius: 980px; transition: background 100ms var(--ease-out), color 100ms var(--ease-out), border-color 100ms var(--ease-out); }
.chip.on, .fx-filters .fl a.on { background: var(--text); border-color: var(--text); color: var(--bg); font-weight: 600; }

/* Buttons are the Apple pill: no border, no shadow, no caps; hover changes color only. */
.btn-quiet { border-radius: 980px; padding: 4px 12px; background: var(--panel-2); border-color: transparent; color: var(--text); letter-spacing: -0.016em; transition: background 100ms var(--ease-out); }
.btn-quiet:hover { background: var(--line); border-color: transparent; color: var(--text); }
.fx-actions button, .fx-actions select { border-radius: 980px; border-color: transparent; }
.fx-actions button:hover { border-color: transparent; background: var(--line); }
.fx-actions input[type=text] { border-radius: 10px; }
.range.on { color: var(--text); }
.pill-accent { color: var(--accent); }

/* One calm tint for the impact bar — a gauge, not a rainbow. */
.fx-impact i { background: var(--accent); }

/* ── type scale ──────────────────────────────────────────────────────────────
   apple.com sets body copy at 17px/1.47 and "compact" UI text at 14px/-0.016em.
   A dense operational table is the compact case, so the base is 14px — but it
   keeps Apple's body leading, because these pages carry real paragraphs and
   1.29 is too tight to read a narrative in. Headline sizes step by weight and
   size alone; the sheet no longer contains a single uppercase label. */
body { font-size: 14px; line-height: 1.47; }
h2.sec { font-size: 17px; font-weight: 600; letter-spacing: -0.022em; color: var(--text); }
.fx-title { font-size: 19px; font-weight: 600; letter-spacing: 0.011em; line-height: 1.19; }
.fx-narr { font-size: 14px; line-height: 1.47; color: var(--dim); }
.page-head .sub { font-size: 15px; line-height: 1.47; }

/* ── controls ────────────────────────────────────────────────────────────────
   The canonical Apple pill: 980px radius, no border, no shadow, sentence case,
   and a hover that changes colour only — never a transform or a lift. */
.btn-primary {
  border-radius: 980px; border: 1px solid transparent; padding: 8px 16px;
  font-size: 14px; font-weight: 400; letter-spacing: -0.016em;
  transition: background 100ms var(--ease-out);
}
.btn-primary:hover { background: #0076df; border-color: transparent; }
.btn-primary:active { background: #006edb; }
.btn-primary:disabled { opacity: 0.36; }
input[type=text], input[type=search], input[type=number], textarea, select { border-radius: 12px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ── tables ──────────────────────────────────────────────────────────────────
   Apple's list style: no vertical rules, no zebra, one hairline between rows,
   and emphasis carried by weight rather than colour. */
table.grid tbody tr:nth-child(even) { background: transparent; }
table.grid th {
  font-size: 12px; font-weight: 600; color: var(--dim);
  text-transform: none; letter-spacing: -0.01em;
}
table.grid td, table.grid th { padding-top: 10px; padding-bottom: 10px; }

/* ── motion ──────────────────────────────────────────────────────────────────
   apple.com's ease-out and its 100/300 ms pair. Opacity and small translations
   only: no springs, no bounces, and nothing at all when the reader opts out. */
.tab, .range, .pill, .fx-card, .hm-tile, .hm-cell {
  transition: background 100ms var(--ease-out), color 100ms var(--ease-out),
              border-color 100ms var(--ease-out);
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important; }
}

/* "Run anyway" under a priced BigQuery refusal */
.bq-approve-row { margin-top: 12px; display: flex; justify-content: center; }


/* ── the story: what the person did and saw, in the app's words (uistory.py) ── */
.jtabs .pill { margin-right: 6px; }
.jstory { list-style: none; margin: 0; padding: 0; }
.jst-screen { margin: 16px 0 4px; font-size: 12px; color: var(--dim); }
.jst-screen:first-child { margin-top: 4px; }
.jst {
  display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; gap: 10px;
  align-items: baseline; padding: 5px 10px; border-left: 2px solid var(--line);
}
.jst + .jst { border-top: 1px solid var(--panel-2); }
.jst-t { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 12px; color: var(--dimmer); }
.jst-body { min-width: 0; }
.jst-text { color: var(--text); overflow-wrap: anywhere; }
.jst-saw .jst-text, .jst-nav .jst-text { color: var(--dim); }
.jst-warn { border-left-color: var(--warn); }
.jst-warn .jst-text { color: var(--warn); }
.jst-bad { border-left-color: var(--bad); background: color-mix(in srgb, var(--bad) 8%, transparent); }
.jst-bad .jst-text { color: var(--bad); }
.jst-cause { margin-left: 6px; font-size: 12px; color: var(--dim); }
.jst-reqs { display: flex; flex-wrap: wrap; gap: 3px 12px; margin-top: 3px; }
.jst-req { font-family: var(--mono); font-size: 12px; color: var(--dim); text-decoration: none; overflow-wrap: anywhere; }
.jst-body > .jst-req { margin-left: 8px; }
a.jst-req:hover { color: var(--accent); }
.jst-req.bad, .jst-req.bad b { color: var(--bad); }
.jst-ctl {
  font-size: 11px; color: var(--dimmer); white-space: nowrap; max-width: 240px;
  overflow: hidden; text-overflow: ellipsis;
}
/* the story's folds: a screen visit (closed = the UI changing, screen to screen)
   and, under an act, the calls it caused — the same table as "as it happened" */
.jst-toolbar { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.jst-toolbar .jseq-cap { flex: 1 1 520px; }
.jst-foldall { display: flex; gap: 6px; margin-left: auto; }
.jst-visit {
  margin: 8px 0; border: 1px solid var(--line); border-left: 3px solid var(--accent-dim);
  border-radius: 7px; background: var(--panel);
}
.jst-visit[open] { border-left-color: var(--accent); }
.jst-visit > summary {
  cursor: pointer; padding: 7px 12px; list-style: none;
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
}
.jst-visit > summary::-webkit-details-marker { display: none; }
.jst-visit > summary::before { content: "▸"; color: var(--dimmer); }
.jst-visit[open] > summary::before { content: "▾"; }
.jst-visit > summary .jstats { margin-left: auto; font-size: 12px; }
.jst-vname { font-size: 13px; }
.jst-vname code { font-size: 11.5px; }
.jst-vmeta { font-size: 12px; color: var(--dim); font-family: var(--mono); }
.jst-visit > .jstory { padding: 0 6px 6px; }
.jst-calls {
  grid-column: 2 / -1; min-width: 0;
  margin: 2px 0 2px; border: 1px solid var(--line); border-radius: 6px;
  background: rgba(255, 255, 255, 0.012);
}
.jst-calls .jseq td.txt:nth-child(2) { min-width: 260px; overflow-wrap: anywhere; }
.jst-calls .jseq .jstmt-col { width: 46%; }
.jst-calls > summary {
  cursor: pointer; padding: 3px 9px; list-style: none; font-size: 12px;
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
}
.jst-calls > summary::-webkit-details-marker { display: none; }
.jst-calls > summary::before { content: "▸"; color: var(--dimmer); }
.jst-calls[open] > summary::before { content: "▾"; }
.jst-calls > summary .jstats { margin-left: auto; }
.jst-calls .tablewrap { padding: 0 6px 6px; }
.jst-loose { margin: 6px 6px 8px; grid-column: auto; }
.jst-more { margin: 0 10px 8px; }
/* a statement's time beside its count: in all, and the slowest single run */
.jcyms {
  flex: none; font: 11px var(--mono); color: var(--dim); white-space: nowrap;
  border: 1px solid var(--line); border-radius: 9px; padding: 0 6px;
}
.jcyms.warn { color: var(--warn); border-color: rgba(255, 159, 10, 0.45); }
.jcyms.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.jwrong { border-left: 3px solid var(--bad); }
.jwrong .dh { margin: 12px 0 2px; }
.jwrong-list { margin: 6px 0 0; padding-left: 18px; }
.jwrong-list li { margin: 4px 0; }
.jw-bad a { color: var(--bad); }
.jw-warn a { color: var(--warn); }
@media (max-width: 720px) {
  .jst { grid-template-columns: 44px minmax(0, 1fr); }
  .jst-ctl { display: none; }
}

/* As it happened: the words lead; what each cost is folded and quieter. */
.jst-vcost { opacity: .7; font-size: .92em; }
.jbody-fold { margin-top: 2px; }
.jbody-fold > summary { cursor: pointer; list-style: none; }
.jbody-fold > summary::-webkit-details-marker { display: none; }
.jbody-fold > summary::before { content: "▸ "; color: var(--dimmer); }
.jbody-fold[open] > summary::before { content: "▾ "; }
.jbody-json { margin: 4px 0 0; padding: 8px 10px; max-height: 360px; overflow: auto;
  background: var(--panel-2, rgba(127,127,127,.08)); border-radius: 6px; font-size: 11.5px;
  white-space: pre; }
.jbody-none { margin: 4px 0 0; max-width: 52ch; white-space: normal; }
.jwrong-more > summary { cursor: pointer; margin: 2px 0 4px; }
.jinsights li { margin: 2px 0; }

/* As it happened, read by people: a summary, quiet screen headers with a
   health dot, pauses, repeats, struggle on its line, machine names on demand. */
.jst-summary { margin: 4px 0 12px; font-size: 14px; line-height: 1.55; color: var(--text); max-width: 110ch; }
.jhealth { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; align-self: center; }
.jhealth-ok { background: var(--good, #30d158); }
.jhealth-warn { background: var(--warn); }
.jhealth-bad { background: var(--bad); }
.jst-pause { list-style: none; padding: 2px 10px 2px 78px; font-size: 11.5px; color: var(--dimmer); font-style: italic; }
.jst-times { margin-left: 4px; font-size: 11px; }
.jst-struggle { display: inline-block; margin-top: 2px; font-size: 12px; color: var(--warn); }
.jst-struggle::before { content: "⚠ "; }
.jst-replay { margin-left: 8px; font-size: 11.5px; color: var(--dim); text-decoration: none; white-space: nowrap; }
.jst-replay:hover { color: var(--accent); }
.jst-vcost-line { margin: 2px 12px 8px; font-size: 12px; color: var(--dim); display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.jst-vcost-line .jstats { margin-left: 0; }
.jview-story:not(.show-ctl) .jst-ctl, .jview-story-only:not(.show-ctl) .jst-ctl { display: none; }
.jst-signin > summary { color: var(--dim); }

/* ── levels (levels.py): what an incident means for people ─────────────────────────── */
.lv { display:inline-block; padding:1px 7px; border-radius:9px; font-size:11px; font-weight:600; letter-spacing:.02em;
      text-transform:uppercase; white-space:nowrap; }
.lv-critical { background:#4a1214; color:#ff6961; }
.lv-high     { background:#3d2410; color:#ff9f45; }
.lv-medium   { background:#3a2a00; color:#ffd60a; }
.lv-low      { background:#2c2c2e; color:#8e8e93; }
.ib-row.sev-high { border-left-color:#ff9f45; } .ib-row.sev-medium { border-left-color:var(--warn); } .ib-row.sev-low { border-left-color:var(--dim); }
.xr-toast.sev-high { border-left-color:#ff9f45; } .xr-toast.sev-medium { border-left-color:var(--warn); }
.al-mode { display:flex; align-items:center; gap:12px; justify-content:space-between; margin:0 0 14px;
           padding:8px 12px; border-radius:8px; font-size:13px; border:1px solid var(--line); }
.al-mode.dry { background:rgba(255,214,10,.06); } .al-mode.live { background:rgba(48,209,88,.07); }
.inc-levels { display:flex; gap:8px; flex-wrap:wrap; margin:0 0 14px; }
.inc-levels a { display:flex; align-items:center; gap:8px; padding:6px 12px; border:1px solid var(--line); border-radius:8px;
                text-decoration:none; color:var(--text); }
.inc-levels a.on { border-color:var(--accent); } .inc-levels b { font-size:18px; }
.inc-row.stale td { opacity:.55; }
.inc-actions { display:flex; gap:4px; } .inc-actions form { display:inline; }
.nz-budget { display:grid; grid-template-columns:repeat(4, minmax(160px,1fr)); gap:10px; margin:0 0 16px; }
.nz-budget > div { border:1px solid var(--line); border-radius:10px; padding:10px 12px; }
.nz-budget .big { font-size:22px; font-weight:600; } .nz-budget .over { color:var(--bad); } .nz-budget .ok { color:var(--good); }

/* ── Log alerts (alert_logs.html) ──────────────────────────────────────────────── */
.lr-list { display:flex; flex-direction:column; gap:10px; margin:0 0 22px; }
.lr-rule { background:var(--panel); border:1px solid var(--line); border-left:3px solid var(--line-2); border-radius:12px; padding:14px 16px; }
.lr-rule.off { opacity:.6; }
.lv-edge-critical { border-left-color:#ff6961; } .lv-edge-high { border-left-color:#ff9f45; }
.lv-edge-medium { border-left-color:#ffd60a; } .lv-edge-low { border-left-color:var(--line-2); }
.lr-rule-head { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.lr-rule-title { display:flex; align-items:center; gap:10px; font-size:15px; font-weight:600; }
.lr-rule-title a { color:var(--text); } .lr-rule-title a:hover { color:var(--accent); text-decoration:none; }
.lr-stats { display:flex; align-items:center; gap:8px; }
.lr-stat { font-size:12px; color:var(--dim); background:var(--panel-2); border-radius:999px; padding:3px 10px; }
.lr-stat b { color:var(--text); font-weight:600; } .lr-stat.hot { background:rgba(255,159,69,.14); color:#ff9f45; } .lr-stat.hot b { color:#ff9f45; }
.lr-reading { margin:8px 0 0; font-size:13.5px; line-height:1.5; color:var(--text); }
.lr-reading.bad { color:var(--bad); }
.lr-desc { margin:4px 0 0; font-size:12.5px; color:var(--dim); }
.lr-incidents { list-style:none; margin:10px 0 0; padding:10px 0 0; border-top:1px solid var(--line); font-size:13px; display:flex; flex-direction:column; gap:4px; }
.lr-more { margin-top:10px; } .lr-more > summary { cursor:pointer; font-size:12.5px; color:var(--dim); }
.lr-lines { margin-top:8px; border:1px solid var(--line); border-radius:8px; max-height:300px; overflow:auto; }
.lr-line { display:grid; grid-template-columns:78px 130px 74px 1fr; gap:10px; align-items:center; padding:5px 10px;
           border-bottom:1px solid var(--panel-2); font-size:12px; }
.lr-line:last-child { border-bottom:0; }
.lr-when { color:var(--dimmer); } .lr-svc { font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.lr-msg { font-family:var(--mono); color:var(--dim); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.sev-pill { font-size:10.5px; border-radius:6px; padding:1px 6px; text-align:center; }

.lr-compose { margin:6px 0 24px; }
.lr-grid { display:grid; grid-template-columns:minmax(0, 1fr) 380px; gap:18px; align-items:start; }
@media (max-width: 1100px) { .lr-grid { grid-template-columns:1fr; } }
.lr-form { display:flex; flex-direction:column; gap:12px; }
.lr-step { margin:0; border:1px solid var(--line); border-radius:12px; padding:14px 16px 16px; background:var(--panel); display:flex; flex-direction:column; gap:12px; }
.lr-step legend { padding:0 6px; margin-left:-6px; font-size:13px; font-weight:600; color:var(--text); display:flex; align-items:center; gap:8px; }
.lr-n { display:inline-grid; place-items:center; width:20px; height:20px; border-radius:50%; background:var(--accent-dim); color:var(--accent); font-size:11px; font-weight:700; }
.lr-field { display:flex; flex-direction:column; gap:6px; min-width:0; }
.lr-lab { font-size:12px; color:var(--dim); } .lr-lab .dimmer { font-size:11.5px; }
.lr-row2 { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
@media (max-width: 760px) { .lr-row2 { grid-template-columns:1fr; } }
.lr-input, .lr-num { font:inherit; font-size:13px; color:var(--text); background:var(--panel-2); border:1px solid var(--line-2);
                     border-radius:8px; padding:8px 10px; outline:none; transition:border-color .15s var(--ease-out), box-shadow .15s var(--ease-out); }
.lr-input { width:100%; box-sizing:border-box; }
.lr-input::placeholder { color:var(--dimmer); }
.lr-input:focus, .lr-num:focus { border-color:var(--accent); box-shadow:0 0 0 3px rgba(41,151,255,.18); }
.lr-input:disabled { opacity:.45; }
.lr-mono { font-family:var(--mono); font-size:12.5px; }
.lr-num { width:72px; padding:5px 8px; text-align:center; }
.lr-sentence { margin:0; font-size:13.5px; line-height:2.2; color:var(--text); }
.lr-chips { display:flex; flex-wrap:wrap; gap:6px; }
.lr-chip input, .lr-seg input, .lr-level input { position:absolute; opacity:0; pointer-events:none; }
.lr-chip span { display:inline-block; padding:5px 12px; border-radius:999px; border:1px solid var(--line-2); background:var(--panel-2);
                color:var(--dim); font-size:12.5px; cursor:pointer; user-select:none; transition:all .12s var(--ease-out); }
.lr-chip span:hover { color:var(--text); border-color:var(--dim); }
.lr-chip input:checked + span { background:var(--accent-dim); border-color:var(--accent); color:var(--text); }
.lr-chip input:focus-visible + span, .lr-seg input:focus-visible + span, .lr-level input:focus-visible + .lr-level-body { box-shadow:0 0 0 3px rgba(41,151,255,.3); }
.lr-seg { display:inline-flex; background:var(--panel-2); border:1px solid var(--line-2); border-radius:9px; padding:2px; align-self:flex-start; }
.lr-seg label { position:relative; }
.lr-seg span { display:inline-block; padding:6px 14px; border-radius:7px; font-size:12.5px; color:var(--dim); cursor:pointer; user-select:none; }
.lr-seg input:checked + span { background:var(--panel); color:var(--text); box-shadow:0 1px 3px rgba(0,0,0,.35); }
.lr-levels { display:grid; grid-template-columns:repeat(4, minmax(0, 1fr)); gap:8px; }
@media (max-width: 900px) { .lr-levels { grid-template-columns:repeat(2, minmax(0, 1fr)); } }
.lr-level { position:relative; cursor:pointer; }
.lr-level-body { display:flex; flex-direction:column; gap:6px; height:100%; box-sizing:border-box; padding:10px 12px; border-radius:10px;
                 border:1px solid var(--line-2); background:var(--panel-2); font-size:12px; transition:all .12s var(--ease-out); }
.lr-level-what { color:var(--text); font-size:12.5px; line-height:1.35; }
.lr-level:hover .lr-level-body { border-color:var(--dim); }
.lv-card-critical input:checked + .lr-level-body { border-color:#ff6961; background:rgba(255,105,97,.10); }
.lv-card-high input:checked + .lr-level-body { border-color:#ff9f45; background:rgba(255,159,69,.10); }
.lv-card-medium input:checked + .lr-level-body { border-color:#ffd60a; background:rgba(255,214,10,.08); }
.lv-card-low input:checked + .lr-level-body { border-color:var(--dim); background:var(--panel); }
.lr-submit { display:flex; align-items:center; gap:12px; }
.lr-preview { position:sticky; top:84px; background:var(--panel); border:1px solid var(--line); border-radius:12px; padding:14px 16px; font-size:13px; }
.lr-preview-head { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.lr-preview .lr-reading { padding:10px 12px; background:var(--panel-2); border-radius:8px; }
#lr-result { margin-top:12px; font-size:12.5px; line-height:1.5; }
#lr-result p { margin:0 0 8px; }
.lr-pv-groups { display:flex; flex-direction:column; gap:8px; max-height:420px; overflow:auto; }
.lr-pv-g { border:1px solid var(--line); border-radius:8px; padding:7px 9px; }
.lr-pv-shape { margin-top:3px; color:var(--dim); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.lr-legacy .lr-list { margin-top:10px; }
/* a test's requests on a run page: one line per call, its body expandable */
.reqitem { margin: 3px 0; }
.reqitem .reqbody { margin: 2px 0 6px; }
.reqitem .reqbody pre { max-height: 220px; overflow: auto; white-space: pre-wrap; margin: 4px 0 0; }
.reqtoggle { cursor: pointer; }
/* the run-log page: one filterable stream across both clusters */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 10px 0; }
.toolbar .chk { display: inline-flex; gap: 4px; align-items: center; }
.toolbar input[type="search"] { min-width: 260px; }
#rltable th.sortable { cursor: pointer; }
#rltable tr.rlerr td.txt { color: var(--bad); }
#rltable details pre { max-height: 200px; overflow: auto; white-space: pre-wrap; }
/* collapsible run-page sections: expanded on demand, collapsed by default */
details.runsect { margin: 14px 0; }
details.runsect > summary { cursor: pointer; font-weight: 600; font-size: 1.05em; padding: 4px 0; }
details.runsect > summary::before { content: "▸ "; color: var(--dim); }
details.runsect[open] > summary::before { content: "▾ "; }

/* ── AI traces: whole chat-agent conversations, Langfuse-style (ENG-7348) ────────── */

.tracelist { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; }
.tracerow {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px;
  padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel); color: var(--text); text-decoration: none;
}
.tracerow:hover { border-color: var(--accent); background: var(--panel-2); }
.tracerow .ts { flex: 0 0 92px; }
.trtitle { flex: 1 1 320px; font-weight: 600; }
.trmeta { flex: 1 1 420px; font-size: 12px; }
.trstats { flex: 0 0 auto; font-size: 12px; white-space: nowrap; }

.llm-run-head {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px;
  margin: 12px 0 16px; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--panel);
}
.llm-run-pills { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.llm-pill {
  padding: 3px 10px; border-radius: 999px; font-size: 12px;
  background: var(--accent-dim); color: var(--text); border: 1px solid var(--bar);
  text-decoration: none;
}
.llm-pill.dim { background: var(--panel-2); border-color: var(--line-2); }
.llm-pill.info { background: var(--bar); }
.llm-run-stats { display: flex; gap: 18px; align-items: center; }
.llm-stat { display: flex; flex-direction: column; align-items: flex-end; }
.llm-stat b { font-size: 16px; font-weight: 700; }
.llm-stat span { font-size: 11px; color: var(--dim); }

/* Two-pane: the call tree left, the conversation right (call tree first on narrow). */
.llmtrace { display: grid; grid-template-columns: minmax(300px, 5fr) minmax(340px, 7fr); gap: 14px; align-items: start; }
@media (max-width: 980px) { .llmtrace { grid-template-columns: 1fr; } }
.llm-col-h { margin: 2px 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--dim); }

.llm-call {
  margin-bottom: 8px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel); overflow: hidden;
}
.llm-call.bad { border-color: var(--bad); }
.llm-call > summary {
  display: flex; align-items: baseline; gap: 10px; padding: 8px 12px;
  cursor: pointer; list-style: none;
}
.llm-call > summary::-webkit-details-marker { display: none; }
.llm-call-n {
  flex: 0 0 20px; text-align: center; font-size: 11px; color: var(--dimmer);
  border: 1px solid var(--line-2); border-radius: 999px;
}
.llm-call-main { flex: 1 1 auto; font-size: 13px; }
.llm-call-stats { flex: 0 0 auto; font-size: 12px; white-space: nowrap; }
.llm-call-body { padding: 4px 12px 12px 42px; border-top: 1px solid var(--line); }
.llm-call-sec { margin: 10px 0; }
.llm-call-sec-h { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--dim); margin-bottom: 6px; }
.llm-tool { margin-bottom: 6px; }
.llm-tool > summary { cursor: pointer; font-size: 13px; }
.llm-json {
  margin: 6px 0 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--bg); color: var(--text); font: 12px/1.45 var(--mono);
  white-space: pre-wrap; word-break: break-word; max-height: 320px; overflow: auto;
}
.llm-params { display: flex; flex-wrap: wrap; gap: 6px; }
.llm-param {
  padding: 2px 8px; border-radius: 6px; font-size: 12px;
  background: var(--panel-2); border: 1px solid var(--line-2); font-family: var(--mono);
}
.llm-resp { font-size: 13px; line-height: 1.5; white-space: pre-wrap; }
.llm-toolcall { margin: 8px 0; }
.llm-tc-name { font-size: 13px; }
.llm-raw { margin: 10px 0 4px; }
.llm-raw > summary { cursor: pointer; font-size: 12px; color: var(--dim); }
.llm-err { border-color: var(--bad); color: var(--bad); }

/* The transcript: one role-styled block per message. */
.llm-msg { margin: 0 0 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.llm-msg-h { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; font-size: 12px; }
.llm-role {
  padding: 1px 8px; border-radius: 999px; font-size: 11px; text-transform: uppercase;
  letter-spacing: .04em; border: 1px solid var(--line-2); color: var(--dim);
}
.llm-role.user { background: var(--accent-dim); border-color: var(--bar); color: var(--accent); }
.llm-role.assistant { background: #12281a; border-color: #1d4d2c; color: var(--good); }
.llm-role.tool { background: #2b2107; border-color: #5c470f; color: var(--warn); }
.llm-role.system { background: var(--panel-2); color: var(--dimmer); }
.llm-content { font-size: 13.5px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.llm-role-tool .llm-content { font: 12px/1.45 var(--mono); color: var(--warn); }
.llm-sysprompt > summary { cursor: pointer; font-size: 12px; color: var(--dim); }
.llm-sysprompt .llm-content { max-height: 300px; overflow: auto; margin-top: 8px; color: var(--dimmer); font: 12px/1.5 var(--mono); }
.llm-fold { margin-bottom: 12px; }
.llm-fold > summary { cursor: pointer; font-size: 12px; color: var(--dim); padding: 4px 0; }
.llm-history { opacity: .72; }

/* Trace page timeline tables (traces.timeline): one row per API call, LLM call and
   query, chronological. A call row is the header of its service's work, so it gets the
   panel tint and an accent rule; queries are indented under it. A waterfall bar links to
   its row (#q-<anchor>), which lights up on arrival. */
table.qtable col.c-s { width: 132px; }
table.qtable col.c-rw { width: 64px; }
.qtable td.ev-svc { font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qtable tr.ev-call td { background: var(--panel-2); }
.qtable tr.ev-call td:first-child { border-left: 3px solid var(--accent); }
.qtable tr.ev-call .ev-ep { word-break: break-all; }
.qtable tr.ev-query td.qshape { padding-left: 26px; }
.qtable tr.ev-llm td.qshape { padding-left: 26px; }
.why-chip.ev-llm-chip { background: rgba(175, 82, 222, 0.16); color: #bf5af2; border-color: transparent; }
.qtable tr:target { background: var(--accent-dim); outline: 2px solid var(--accent); outline-offset: -2px; }
.qtable tr:target td { color: var(--text); }
.llm-tools > summary { cursor: pointer; list-style: none; }
.llm-tools > summary::before { content: "▸ "; color: var(--dimmer); }
.llm-tools[open] > summary::before { content: "▾ "; }
.llm-role.context { background: var(--panel-2); color: var(--dimmer); border-style: dashed; }
.llm-msg.llm-role-context { border-style: dashed; background: transparent; }

/* AI chats (Langfuse's sessions): the chat list and one chat read back and forth. */
.chat-table .chat-row:hover td { background: var(--panel-2); }
.chat-table td.chat-title { font-weight: 600; max-width: 520px; }
.chat-table td.chat-title a { color: var(--text); text-decoration: none; display: block; }
.chat-table td.chat-title a:hover { color: var(--accent); }
.chat-table .dimmer { color: var(--dimmer); font-size: 11px; }
.chat-thread { display: flex; flex-direction: column; gap: 14px; max-width: 980px; }
.chat-turn { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); padding: 12px 16px 14px; }
.chat-turn:target { border-color: var(--accent); }
.chat-turn-h { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; margin-bottom: 10px; font-size: 12px; }
.chat-turn-n { font-weight: 700; color: var(--text); text-decoration: none; font-size: 13px; }
.chat-turn-stats { margin-left: auto; display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.chat-turn-link { margin-left: 8px; font-weight: 600; }
.chat-msg { display: grid; grid-template-columns: 84px 1fr; gap: 10px; margin: 8px 0; }
.chat-who { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--dim); padding-top: 3px; }
.chat-user .chat-who { color: var(--accent); }
.chat-assistant .chat-who { color: var(--good); }
.chat-body { font-size: 14px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.chat-user .chat-body { font-weight: 600; }
.chat-work { margin: 6px 0 6px 94px; font-size: 13px; }
.chat-work > summary { cursor: pointer; color: var(--dim); }
.chat-work-body { margin-top: 6px; padding-left: 10px; border-left: 2px solid var(--line-2); }
.chat-tool-result { margin: 6px 0; }
.chat-gap { text-align: center; font-size: 11px; color: var(--dimmer); }
.chat-gap span { padding: 2px 10px; border: 1px dashed var(--line-2); border-radius: 999px; }
/* rendered markdown answers (the `md` filter): normal flow, not pre-wrap */
.chat-md { white-space: normal; }
.chat-md p { margin: 0 0 8px; }
.chat-md table { border-collapse: collapse; margin: 6px 0; font-size: 13px; }
.chat-md th, .chat-md td { border: 1px solid var(--line); padding: 3px 8px; text-align: left; }
.chat-md ul, .chat-md ol { margin: 4px 0 8px 20px; }

/* ── One message list for AI threads and runs (_llm_stream.html) ─────────────────── */
.llm-stream { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); padding: 4px 0 8px; }
.stream-bar { position: sticky; top: 0; z-index: var(--z-sticky); display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center;
  padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--panel); border-radius: 12px 12px 0 0; font-size: 12px; }
.stream-toggle { display: inline-flex; gap: 4px; align-items: center; cursor: pointer; white-space: nowrap; }
.stream-presets { margin-left: auto; display: inline-flex; gap: 6px; flex-wrap: wrap; }
.stream-run { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; padding: 12px 14px 6px;
  margin-top: 6px; border-top: 2px solid var(--line); font-size: 12px; }
.stream-run:target { border-top-color: var(--accent); }
.stream-run-n { font-weight: 700; font-size: 13px; color: var(--text); text-decoration: none; }
.stream-run-stats { margin-left: auto; display: inline-flex; gap: 6px; flex-wrap: wrap; align-items: baseline; }
.stream-row { display: grid; grid-template-columns: 34px 170px minmax(0, 1fr); gap: 10px; padding: 6px 14px; align-items: start; }
.stream-row + .stream-row { border-top: 1px solid var(--line); }
.stream-when { color: var(--dimmer); font-size: 11px; padding-top: 3px; }
.stream-kind { display: flex; flex-direction: column; gap: 3px; font-size: 11px; min-width: 0; overflow-wrap: anywhere; }
.stream-chip { align-self: flex-start; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  padding: 1px 6px; border-radius: 5px; border: 1px solid var(--line); background: var(--panel-2); color: var(--dim); }
.stream-chip.t-query { background: var(--accent-dim); color: var(--accent); border-color: var(--bar); }
.stream-chip.t-assistant { background: #12281a; color: var(--good); border-color: #1d4d2c; }
.stream-chip.t-tool_call, .stream-chip.t-tool_result { background: #2b2107; color: var(--warn); border-color: #5c470f; }
.stream-chip.t-context, .stream-chip.t-aux { border-style: dashed; color: var(--dimmer); }
.stream-content { min-width: 0; font-size: 13px; line-height: 1.5; }
.stream-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.t-query .stream-text { font-weight: 600; }
.stream-pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; max-height: 420px; overflow: auto;
  background: var(--panel-2); border-radius: 6px; padding: 6px 8px; }
.stream-long > summary { cursor: pointer; list-style: none; }
.stream-long > summary::-webkit-details-marker { display: none; }
.stream-preview { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--dim); font-size: 12px; }
.stream-long[open] .stream-preview { display: none; }
.stream-call { background: var(--panel-2); font-size: 11px; color: var(--dim); padding: 4px 14px; }
.stream-callline { grid-column: 2 / 4; display: flex; flex-wrap: wrap; gap: 4px; align-items: baseline; }
.llm-stream.hide-query .stream-row[data-type="query"],
.llm-stream.hide-assistant .stream-row[data-type="assistant"],
.llm-stream.hide-tool_call .stream-row[data-type="tool_call"],
.llm-stream.hide-tool_result .stream-row[data-type="tool_result"],
.llm-stream.hide-context .stream-row[data-type="context"],
.llm-stream.hide-system .stream-row[data-type="system"],
.llm-stream.hide-call .stream-row[data-type="call"],
.llm-stream.hide-aux .stream-row[data-type="aux"] { display: none; }
@media (max-width: 720px) {
  .stream-row { grid-template-columns: 28px minmax(0, 1fr); }
  .stream-content { grid-column: 1 / 3; }
  .stream-callline { grid-column: 2 / 3; }
}
.llmtrace.llmtrace-single { grid-template-columns: 1fr; }

/* ── Evals tab (evaltable) ─────────────────────────────────────────────────── */
.ev-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.ev-filters { margin-bottom: 8px; }
.ev-filters + .cards { margin-top: 14px; }
.ev-group { margin: 0 0 22px; }
.ev-compare { max-width: 900px; margin: 4px 0 6px; }
.ev-compare .chart-title { margin-bottom: 8px; }
.ev-bars a:hover rect:last-of-type { opacity: 1; }
.ev-group-head { margin: 0 0 8px; font-size: 13.5px; }
.ev-charts { margin-top: 12px; }
.ev-charts .chart-title { font-size: 12.5px; color: var(--dim); font-weight: 500; margin: 0 0 4px; }
.ev-spark svg { width: 90px; height: 22px; display: block; }
.ev-src { font-size: 12px; padding: 1px 6px; border-radius: 4px; white-space: nowrap; }
.ev-src.jenkins { background: rgba(10, 132, 255, 0.14); color: #4ea1ff; }
.ev-src.laptop { background: rgba(255, 159, 10, 0.14); color: #ffb340; }
.ev-floor { color: #ffb340; }
.ev-bad { color: var(--bad); font-size: 12.5px; }
.ev-runs tr.ev-broken td { background: rgba(255, 69, 58, 0.05); }
table.grid.ev-runs tbody td.ev-nw { white-space: nowrap; overflow-wrap: normal; }
.ev-form { display: grid; gap: 16px; max-width: 620px; margin-top: 8px; }
.ev-field { display: grid; gap: 6px; border: 0; padding: 0; margin: 0; }
.ev-field > span:first-child, .ev-field legend { font-weight: 600; font-size: 13px; }
.ev-field input, .ev-field select { font: inherit; padding: 6px 8px; border-radius: 6px;
  border: 1px solid var(--line); background: var(--panel); color: var(--text); }
.ev-check { display: inline-flex; gap: 6px; align-items: center; margin-right: 14px; font-size: 13px; }
.ev-actions { display: flex; gap: 12px; align-items: center; }
.ev-runner-off { margin-bottom: 14px; }
