/* Covin console. Light by default, one deep-green accent, four semantic colours used only for state.
   Borders separate things; shadows are reserved for what floats above the page. */
:root {
  /* surfaces and text */
  --bg: #f6f5f1;
  --panel: #ffffff;
  --panel-2: #f6f5f1;
  --line: #e6e3dc;
  --line-2: #c9c6bc;
  --ink: #1b1b1a;
  --ink-2: #55544f;
  --muted: #8a8880;

  /* one accent, from the Covin Local console */
  --accent: #2f5e4e;
  --accent-ink: #ffffff;
  --accent-soft: #e8f0ec;

  /* state, and nothing else */
  --critical: #b42318;
  --warning: #b45309;
  --ok: #1f7a4d;
  --info: #55544f;
  --critical-soft: #fbeceb;
  --warning-soft: #fbf1e3;
  --ok-soft: #e6f3ec;
  --info-soft: #f1efea;
  --yellow: #d9a400;
  --restart: #1d5fd1; --restart-soft: #e9f0fd;

  /* graph */
  --g-normal: #a8a69d;
  --g-lead: #b45309;
  --g-under: #2f5e4e;
  --g-corroborated: #b42318;
  --g-cleared: #1f7a4d;
  --g-bait: #2f5e4e;
  --g-bait-read: #b45309;
  --g-bait-used: #b42318;
  --g-read: #3b6fd4;
  --g-write: #b45309;
  --g-handoff: #b42318;
  --g-shared: #bdbab0;

  /* rhythm */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --r1: 6px; --r2: 8px;
  --shadow: 0 8px 28px rgba(27, 27, 26, .12);
  --row: 36px;

  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 13px;
  line-height: 1.5;
  color-scheme: light;
}

/* dark is the same tokens, restated: by choice, or by the OS when no choice was made */
:root[data-theme="dark"],
:root:not([data-theme="light"]):not([data-theme="dark"]) {
  --dark-ready: 1;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131312; --panel: #1b1b1a; --panel-2: #131312; --line: #2a2a27; --line-2: #3d3d39;
    --ink: #ecebe6; --ink-2: #b3b1a9; --muted: #7f7d75;
    --accent: #7fb59f; --accent-ink: #0f1a15; --accent-soft: #1f2d27;
    --critical: #f0776a; --warning: #f0a04b; --ok: #4cc38a; --info: #b3b1a9;
    --critical-soft: #2c1917; --warning-soft: #2a2013; --ok-soft: #12251c; --info-soft: #232321;
    --yellow: #e8c02e;
    --restart: #7aa7ff; --restart-soft: #16213a;
    --g-normal: #6f6d66; --g-lead: #f0a04b; --g-under: #7fb59f; --g-corroborated: #f0776a;
    --g-cleared: #4cc38a; --g-bait: #7fb59f; --g-bait-read: #f0a04b; --g-bait-used: #f0776a;
    --g-read: #7aa2ff; --g-write: #f0a04b; --g-handoff: #f0776a; --g-shared: #4a4a45;
    --shadow: 0 8px 28px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #131312; --panel: #1b1b1a; --panel-2: #131312; --line: #2a2a27; --line-2: #3d3d39;
  --ink: #ecebe6; --ink-2: #b3b1a9; --muted: #7f7d75;
  --accent: #7fb59f; --accent-ink: #0f1a15; --accent-soft: #1f2d27;
  --critical: #f0776a; --warning: #f0a04b; --ok: #4cc38a; --info: #b3b1a9;
  --critical-soft: #2c1917; --warning-soft: #2a2013; --ok-soft: #12251c; --info-soft: #232321;
  --yellow: #e8c02e;
  --restart: #7aa7ff; --restart-soft: #16213a;
  --g-normal: #6f6d66; --g-lead: #f0a04b; --g-under: #7fb59f; --g-corroborated: #f0776a;
  --g-cleared: #4cc38a; --g-bait: #7fb59f; --g-bait-read: #f0a04b; --g-bait-used: #f0776a;
  --g-read: #7aa2ff; --g-write: #f0a04b; --g-handoff: #f0776a; --g-shared: #4a4a45;
  --shadow: 0 8px 28px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 20px; } h2 { font-size: 15px; } h3 { font-size: 13px; }
p { margin: 0 0 var(--s2); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r1); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: var(--s2); top: var(--s2); z-index: 60; background: var(--panel); padding: var(--s2) var(--s3);
              border: 1px solid var(--line); border-radius: var(--r1); }

/* ---------------------------------------------------------------- shell */
/* The banner (stale telemetry, a contained agent and its Release) and the scope bar each get their own row: they
   used to share one grid area, and the scope bar painted over the banner. */
.shell { display: grid; grid-template-columns: 208px minmax(0, 1fr); grid-template-rows: 52px auto auto auto minmax(0, 1fr);
         grid-template-areas: "top top" "side banner" "side scope" "side toast" "side main"; min-height: 100vh; }
.topline { grid-area: top; display: flex; align-items: center; gap: var(--s3); padding: 0 var(--s4);
           background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: var(--s2); font-weight: 650; font-size: 15px; letter-spacing: -0.02em; }
.brand .mark { width: 22px; height: 22px; flex: none; }
.tenant { color: var(--muted); font-size: 12px; }
.topline .spacer { flex: 1; }
.search-btn { display: flex; align-items: center; gap: var(--s2); min-width: 220px; color: var(--muted);
              background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r1);
              height: 30px; padding: 0 var(--s2); cursor: pointer; font: inherit; }
.search-btn kbd { margin-left: auto; font: inherit; font-size: 11px; color: var(--muted); background: var(--panel);
                  border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; }
/* Command Center: "Needs you" and "Alerts" fold away; closed until opened. Only the count carries the colour. */
.fold { margin: var(--s5) 0 var(--s3); }
.fold > summary { list-style: none; display: flex; align-items: center; gap: var(--s2); padding: var(--s2) var(--s3);
                  border: 1px solid var(--line); border-radius: var(--r1); background: var(--panel); color: var(--ink-2);
                  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; user-select: none; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::before { content: "▸"; font-size: 12px; transition: transform .15s; }
.fold[open] > summary::before { transform: rotate(90deg); }
.fold[open] > summary { margin-bottom: var(--s2); }
.fold .fold-count { min-width: 24px; text-align: center; border-radius: 999px; padding: 1px 8px;
                    letter-spacing: 0; }
.fold.red .fold-count { background: var(--critical); color: var(--panel); }
.fold.yellow .fold-count { background: var(--yellow); color: #1f1800; }
.fold.grey .fold-count { background: var(--info-soft); color: var(--ink-2); }
.det-notes { display: grid; gap: var(--s4); }
.det-notes h3 { margin-bottom: 4px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--s2); }
.fold > summary:hover { background: var(--panel-2); }
.fold > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Investigations: the session this page runs on, in one line */
.session-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); padding: var(--s2) var(--s3);
               margin-bottom: var(--s3); border: 1px solid var(--line); border-radius: var(--r1); background: var(--panel);
               font-size: 13px; }
.session-bar .sess-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
                           color: var(--ink-2); margin-right: var(--s1, 4px); }
.session-bar .sess-chip { background: var(--info-soft); border-radius: 999px; padding: 2px 10px; white-space: nowrap; }
.session-bar .sess-chip b { font-weight: 600; color: var(--ink); }
.sess-form { display: grid; gap: var(--s3); margin: var(--s3) 0; }
.sess-form select { width: 100%; }
.modal .note + .acts { margin-top: var(--s3); }

.freshness { font-size: 12px; color: var(--muted); text-align: right; line-height: 1.35; }
.freshness b { color: var(--ink); font-weight: 600; }
/* The menu button on a wide screen: the sidebar slides shut and the page grows into its width. */
.shell { transition: grid-template-columns .22s ease; }
.shell.nav-collapsed { grid-template-columns: 0px minmax(0, 1fr); }
.shell .side { min-width: 0; overflow: hidden; transition: visibility 0s linear 0s; }
.shell .side nav a, .shell .side-foot { white-space: nowrap; }
.shell.nav-collapsed .side { visibility: hidden; border-right-width: 0; padding-left: 0; padding-right: 0;
                            transition: visibility 0s linear .22s; }
.main { transition: max-width .22s ease; }
.shell.nav-collapsed .main { max-width: 1528px; }

.side { grid-area: side; background: var(--panel); border-right: 1px solid var(--line); padding: var(--s3) var(--s2);
        display: flex; flex-direction: column; }
.side nav { display: grid; gap: 2px; }
.side nav a { display: flex; align-items: center; gap: var(--s2); padding: 7px var(--s3); border-radius: var(--r1);
              color: var(--ink-2); font-weight: 500; }
.side nav a:hover { background: var(--panel-2); text-decoration: none; color: var(--ink); }
.side nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.side nav .count { margin-left: auto; font-size: 11px; font-weight: 700; color: var(--accent-ink);
                   background: var(--accent); border-radius: 999px; padding: 0 6px; }
.side-foot { margin-top: auto; padding: var(--s3); border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }

.banner-slot { grid-area: banner; }
.banner-slot:empty { display: none; }
.telemetry { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s5);
             background: var(--warning-soft); border-bottom: 1px solid var(--line); font-size: 13px; flex-wrap: wrap; }
.telemetry.critical { background: var(--critical-soft); }
.telemetry b { font-weight: 650; }
.telemetry .muted { color: var(--ink-2); }

.main { grid-area: main; padding: var(--s5) var(--s5) var(--s7); max-width: 1320px; width: 100%; min-width: 0; }
.main:focus { outline: none; }

/* ---------------------------------------------------------------- page furniture */
.page-head { display: flex; align-items: flex-start; gap: var(--s3); margin-bottom: var(--s4); flex-wrap: wrap; }
.page-head .grow { flex: 1; min-width: 0; }
.page-head .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
/* a view switch next to the window picker lines up with the picker's box, not with its label */
.page-head > .seg { align-self: flex-end; }
.crumbs { display: flex; gap: var(--s2); align-items: center; color: var(--muted); font-size: 12px; margin-bottom: var(--s1); }
.crumbs a { color: var(--muted); } .crumbs a:hover { color: var(--ink); }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r2); }
.card + .card { margin-top: var(--s3); }
/* side-by-side cards start level: the grid spaces them, not the stacked-card margin */
.grid2 > .card + .card { margin-top: 0; }
.stats + * { margin-top: var(--s3); }
.note + .card, .note + section, .note + details, .note + .table-wrap { margin-top: var(--s3); }
.card + .grid2, .cc-top + .grid2, .table-wrap + .grid2 { margin-top: var(--s3); }
.card > header { display: flex; align-items: center; gap: var(--s2); padding: var(--s3) var(--s4);
                 border-bottom: 1px solid var(--line); }
.card > header h2 { flex: 1; }
.card .body { padding: var(--s4); }
.card .body.tight { padding: var(--s2) var(--s3); }
.section { margin: var(--s5) 0 var(--s3); color: var(--muted); font-size: 12px; font-weight: 600;
           text-transform: uppercase; letter-spacing: .06em; }

.stats { display: grid; gap: var(--s3); grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r2); padding: var(--s3) var(--s4); }
.stat .k { color: var(--muted); font-size: 12px; }
.stat .v { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .v .badge { font-size: 13px; vertical-align: 3px; }
.stat .h { color: var(--muted); font-size: 12px; margin-top: 2px; }

.grid2 { display: grid; gap: var(--s3); grid-template-columns: 1.7fr 1fr; align-items: start; }
.grid2 > * { min-width: 0; }
.row { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }
.col { display: grid; gap: var(--s2); }
.muted { color: var(--muted); } .small { font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; overflow-wrap: anywhere; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th { position: sticky; top: 0; z-index: 1; background: var(--panel-2); text-align: left; font-size: 12px;
           font-weight: 600; color: var(--muted); padding: 0 var(--s3); height: 34px; white-space: nowrap;
           border-bottom: 1px solid var(--line); }
th.num, td.num { text-align: right; }
th button { background: none; border: 0; font: inherit; color: inherit; cursor: pointer; padding: 0; }
th button:hover { color: var(--ink); }
tbody td { padding: 0 var(--s3); height: var(--row); border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.pick { cursor: pointer; }
tbody tr.pick:hover td { background: var(--panel-2); }
tbody tr.on td { background: var(--accent-soft); }
td .stack { display: grid; gap: 2px; padding: 6px 0; }
/* rows whose main cell runs to several lines: every cell starts on the same first line */
table.top tbody td { vertical-align: top; height: auto; padding-top: 10px; padding-bottom: 10px; }
.badge-pair { display: inline-flex; gap: 4px; white-space: nowrap; }
/* approve / decline side by side in a table cell, never wrapped onto two lines */
.decide { display: inline-flex; align-items: center; gap: var(--s2); flex-wrap: nowrap; white-space: nowrap; }
.bulk-acts { margin-top: var(--s3); }
/* Command Center: the most urgent issues as cards */
.urgent-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s3); }
.urgent-item { border: 1px solid var(--line); border-left: 4px solid var(--info); border-radius: var(--r1);
               padding: var(--s3) var(--s4); display: grid; gap: var(--s2); background: var(--panel); }
.urgent-item.tone-critical { border-left-color: var(--critical); }
.urgent-item.tone-warning { border-left-color: var(--warning); }
.urgent-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s3); }
.urgent-head .title { font-weight: 600; font-size: 15px; }
.urgent-head .btn { flex: none; text-decoration: none; }
.urgent-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px var(--s2); }
.urgent-meta .sep { width: 1px; height: 16px; background: var(--line-2); margin: 0 2px; }
.urgent-why { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 13px; display: grid; gap: 2px; }
/* rows of small, equal tiles inside a card */
.tiles { display: grid; gap: var(--s3); }
.tiles.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tile { border: 1px solid var(--line); border-radius: var(--r1); padding: var(--s3); background: var(--panel-2);
        display: grid; gap: 4px; align-content: start; }
.tile.warn { border-left: 3px solid var(--warning); }
@media (max-width: 900px) { .tiles.three { grid-template-columns: minmax(0, 1fr); } }
/* Issue page: overview sections, and the four risk dimensions colour-coded by level */
.issue-overview { display: grid; gap: var(--s4); }
.issue-overview h3 { margin-bottom: var(--s2); }
ol.steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
ol.steps li::marker { font-weight: 700; color: var(--accent); }
.path-group { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.path-group a.badge { text-decoration: none; }
.risk-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
.risk-card { border: 1px solid var(--line); border-left: 4px solid var(--line-2); border-radius: var(--r1);
             padding: var(--s3); background: var(--panel-2); display: grid; gap: 4px; align-content: start; }
.risk-card .risk-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); }
.risk-card.tone-critical { border-left-color: var(--critical); }
.risk-card.tone-warning { border-left-color: var(--warning); }
.risk-card.tone-ok { border-left-color: var(--ok); }
.risk-card.tone-info { border-left-color: var(--info); }
@media (max-width: 760px) { .risk-grid { grid-template-columns: minmax(0, 1fr); } }
.count-line { color: var(--muted); font-size: 12px; padding: var(--s2) var(--s3) 0; }

/* ---------------------------------------------------------------- state */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 8px; border-radius: 999px;
         font-size: 12px; font-weight: 550; background: var(--info-soft); color: var(--info); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.sq::before { border-radius: 1px; }
.badge.tri::before { border-radius: 0; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.badge.bare::before { display: none; }
.t-critical { background: var(--critical-soft); color: var(--critical); }
.t-warning { background: var(--warning-soft); color: var(--warning); }
.t-restart { background: var(--restart-soft); color: var(--restart); }
.t-ok { background: var(--ok-soft); color: var(--ok); }
.t-info { background: var(--info-soft); color: var(--info); }
.t-accent { background: var(--accent-soft); color: var(--accent); }
.check { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: var(--s2); align-items: start; padding: 6px 0; }
.check .m { font-weight: 700; line-height: 1.3; }
.check.pass .m { color: var(--ok); } .check.partial .m { color: var(--warning); } .check.fail .m { color: var(--critical); }

/* ---------------------------------------------------------------- controls */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 var(--s3); font: inherit;
       font-weight: 500; color: var(--ink); background: var(--panel); border: 1px solid var(--line-2);
       border-radius: var(--r1); cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--panel-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.07); }
.btn.quiet { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.quiet:hover { background: var(--panel-2); color: var(--ink); }
.btn.danger { color: var(--critical); border-color: var(--critical); }
.btn.sm { height: 26px; padding: 0 var(--s2); font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line-2);
                          border-radius: var(--r1); padding: 0 var(--s2); height: 30px; max-width: 100%; }
textarea { height: auto; min-height: 72px; padding: var(--s2); width: 100%; }
label.field { display: inline-grid; gap: 3px; font-size: 12px; color: var(--muted); }
label.inline { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 13px; }
.seg { display: inline-flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r1); padding: 2px; }
.seg button { height: 24px; padding: 0 var(--s3); border: 0; background: none; font: inherit; font-size: 12px;
              color: var(--ink-2); border-radius: 4px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--panel); color: var(--ink); font-weight: 600;
                                   box-shadow: 0 1px 2px rgba(27,27,26,.08); }
.filterbar { display: flex; gap: var(--s3); align-items: flex-end; flex-wrap: wrap; }
/* a checkbox or a button sits on the controls' line, not halfway up their labels */
.filterbar > label.inline, .filterbar > .btn { min-height: 30px; display: inline-flex; align-items: center; }
.filterbar > .muted { line-height: 30px; }
.filterbar input[type="search"] { min-width: 180px; }
.grow { flex: 1; min-width: 0; }
.row.wrap { flex-wrap: wrap; }
.checks { display: grid; gap: 2px; }
label.field.col { display: grid; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 var(--s2); font-size: 12px;
        border: 1px solid var(--line-2); border-radius: 999px; background: var(--panel); cursor: pointer; color: var(--ink-2); }
.chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }

/* ---------------------------------------------------------------- notes, lists */
.note { border: 1px solid var(--line); border-left: 3px solid var(--line-2); background: var(--panel-2);
        border-radius: var(--r1); padding: var(--s2) var(--s3); color: var(--ink-2); }
.note.critical { border-left-color: var(--critical); background: var(--critical-soft); }
.note.warning { border-left-color: var(--warning); background: var(--warning-soft); }
.note.ok { border-left-color: var(--ok); background: var(--ok-soft); }
.kv { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: var(--s2) var(--s3); font-size: 13px; }
.kv > div:nth-child(odd) { color: var(--muted); }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: var(--s3) 0; border-bottom: 1px solid var(--line); }
.list > li:first-child { padding-top: 0; }
.list > li:last-child { border-bottom: 0; padding-bottom: 0; }
.queue { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.queue li { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: var(--s3); align-items: start;
            border: 1px solid var(--line); border-left: 4px solid var(--info); border-radius: var(--r1);
            padding: var(--s3); background: var(--panel); }
.queue li.tone-critical { border-left-color: var(--critical); }
.queue li.tone-warning { border-left-color: var(--warning); }
.queue .q-badge { padding-top: 1px; }
.queue .q-body { display: grid; gap: 3px; min-width: 0; }
.queue .title { font-weight: 600; }
.queue .detail { color: var(--ink-2); }
.tl { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.tl li { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: var(--s3); padding: 5px 0;
         border-bottom: 1px dashed var(--line); overflow-wrap: anywhere; }
.tl li:last-child { border-bottom: 0; }
.tl .t { color: var(--muted); font-variant-numeric: tabular-nums; }
.bars { display: flex; align-items: flex-end; gap: 2px; height: 44px; }
.bars i { flex: 1; min-height: 2px; border-radius: 2px 2px 0 0; background: var(--accent); opacity: .75; }
.bars i.hit { background: var(--critical); opacity: 1; }
.empty { color: var(--muted); text-align: center; padding: var(--s6) var(--s4); }
.empty .btn { margin-top: var(--s3); }
details > summary { cursor: pointer; color: var(--ink-2); }
details[open] > summary { margin-bottom: var(--s2); }
/* Every collapsible reads the same way: a chevron that turns when open. A collapsible card's summary is its header. */
details:not(.fold) > summary { list-style: none; display: flex; align-items: center; gap: 6px; }
details:not(.fold) > summary::-webkit-details-marker { display: none; }
details:not(.fold) > summary::before { content: "▸"; font-size: 13px; line-height: 1; color: var(--ink-2); transition: transform .15s; }
details:not(.fold)[open] > summary::before { transform: rotate(90deg); }
details.card > summary { padding: var(--s3) var(--s4); font-size: 15px; font-weight: 600; color: var(--ink); }
details.card > summary:hover { background: var(--panel-2); border-radius: var(--r2); }
details.card[open] > summary { margin-bottom: 0; border-bottom: 1px solid var(--line); border-radius: var(--r2) var(--r2) 0 0; }
details.card > .body { padding: var(--s4); }
details.card > .body.tight { padding: var(--s2) var(--s3); }
pre { margin: 0; white-space: pre-wrap; background: var(--panel-2); border: 1px solid var(--line);
      border-radius: var(--r1); padding: var(--s3); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }

/* skeletons */
.sk { background: linear-gradient(90deg, var(--panel-2) 25%, var(--line) 37%, var(--panel-2) 63%);
      background-size: 400% 100%; animation: sk 1.2s ease infinite; border-radius: var(--r1); height: 12px; }
.sk.line { height: var(--row); border-radius: 0; border-bottom: 1px solid var(--line); }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------------------------------------------------------------- inspector, palette, modal */
.scrim { position: fixed; inset: 0; background: rgba(19, 19, 18, .28); z-index: 40; }
.scrim[hidden], .inspector[hidden], .palette[hidden] { display: none; }
.inspector { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--panel);
             border-left: 1px solid var(--line); box-shadow: var(--shadow); z-index: 45; display: flex;
             flex-direction: column; animation: slide .16s ease-out; }
@keyframes slide { from { transform: translateX(16px); opacity: .6; } to { transform: none; opacity: 1; } }
.inspector > header { padding: var(--s4) var(--s4) var(--s3); border-bottom: 1px solid var(--line); }
.inspector .tabs { display: flex; gap: var(--s1); padding: 0 var(--s3); border-bottom: 1px solid var(--line);
                   overflow-x: auto; }
.inspector .tabs button { height: 34px; padding: 0 var(--s3); border: 0; background: none; font: inherit;
                          color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.inspector .tabs button[aria-selected="true"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--accent); }
.inspector .panel { padding: var(--s4); overflow: auto; flex: 1; }
.inspector .foot { padding: var(--s3) var(--s4); border-top: 1px solid var(--line); display: flex; gap: var(--s2);
                   flex-wrap: wrap; background: var(--panel-2); align-items: flex-end; }
/* a labelled field in the footer: its box sits on the buttons' line, its label above */
.inspector .foot label.field input { height: 30px; }

.palette { position: fixed; top: 10vh; left: 50%; transform: translateX(-50%); width: min(560px, 92vw);
           background: var(--panel); border: 1px solid var(--line); border-radius: var(--r2); box-shadow: var(--shadow);
           z-index: 50; overflow: hidden; }
.palette input { width: 100%; height: 46px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
                 padding: 0 var(--s4); font-size: 15px; }
.palette input:focus { outline: none; }
.palette ul { list-style: none; margin: 0; padding: var(--s1); max-height: 46vh; overflow: auto; }
.palette li { display: flex; align-items: center; gap: var(--s2); padding: var(--s2) var(--s3); border-radius: var(--r1);
              cursor: pointer; }
.palette li[aria-selected="true"] { background: var(--accent-soft); color: var(--accent); }
.palette .kind { margin-left: auto; font-size: 11px; color: var(--muted); }

.modal-scrim { display: flex; align-items: center; justify-content: center; z-index: 55; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r2); box-shadow: var(--shadow);
         width: min(540px, calc(100vw - 32px)); padding: var(--s4); }
.modal h2 { margin-bottom: var(--s2); }
/* A field never widens the dialog: a long option in a select sized the column past its edge. */
.modal { max-height: 90vh; overflow-y: auto; }
.modal .col, .modal label.field.col { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s2); min-width: 0; }
.modal label.field.col { gap: 3px; }
.modal select, .modal input[type="text"], .modal textarea { width: 100%; max-width: 100%; min-width: 0; }
.modal .acts { display: flex; justify-content: flex-end; gap: var(--s2); margin-top: var(--s4); }

/* ---------------------------------------------------------------- the bell, and a rebuild in progress */
.building { font-size: 12px; font-weight: 600; color: var(--warning); background: var(--warning-soft);
            border-radius: 999px; padding: 2px 10px; white-space: nowrap; }
.building::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%;
                    background: currentColor; animation: pulse 1.2s ease-in-out infinite; vertical-align: 0; }
@keyframes pulse { 50% { opacity: .25; } }
.bell-wrap { position: relative; }
.bell { position: relative; }
.bell .count { position: absolute; top: -4px; right: -6px; font-size: 10px; font-weight: 700; line-height: 16px;
               min-width: 16px; text-align: center; color: #fff; background: var(--critical); border-radius: 999px;
               padding: 0 4px; }
.bell-panel { position: absolute; right: 0; top: calc(100% + 8px); width: min(440px, calc(100vw - 32px)); max-height: 70vh;
              overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r2);
              box-shadow: var(--shadow); z-index: 55; }
.bell-panel header { display: flex; align-items: center; gap: var(--s2); padding: var(--s3); border-bottom: 1px solid var(--line);
                     position: sticky; top: 0; background: var(--panel); }
.bell-panel header h2 { margin: 0; font-size: 14px; flex: 1; }
.bell-panel ul { list-style: none; margin: 0; padding: 0; }
.bell-panel li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s2) var(--s3); padding: var(--s3);
                 border-bottom: 1px solid var(--line); }
.bell-panel li:last-child { border-bottom: 0; }
.bell-panel li.unread { background: var(--accent-soft); }
.bell-panel li .title { font-weight: 600; }
.bell-panel .empty { padding: var(--s4); }
@media (max-width: 760px) { .bell-panel { position: fixed; top: 56px; right: 16px; left: 16px; width: auto; } }

/* toasts sit in the page, in their own row above the content: they push it down and never cover it */
.toasts { grid-area: toast; display: grid; gap: var(--s2); padding: 0 var(--s5); min-width: 0; }
.toasts:not(:empty) { padding-top: var(--s3); }
.toasts div { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--ok);
              border-radius: var(--r1); padding: var(--s2) var(--s3); box-shadow: var(--shadow); max-width: 380px; }
.toasts div.err { border-left-color: var(--critical); }
.toasts a.toast-link { display: block; background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--warn, var(--ok)); padding: var(--s2) var(--s3); border-radius: 6px; color: inherit; text-decoration: none; font-weight: 600; cursor: pointer; }
.toasts a.toast-link:hover { text-decoration: underline; }
.toasts a.toast-link.err { border-left-color: var(--critical); }
.toasts > .toast { display: flex; align-items: center; gap: var(--s2); box-shadow: none; }
.toasts .toast > a.toast-link, .toasts .toast > div { border: 0; padding: 0; background: none; box-shadow: none; max-width: none; }
.toasts .toast.err { border-left-color: var(--critical); }
.toasts .toast-x { margin-left: auto; background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit;
  padding: 0 2px; line-height: 1; }
.toasts .toast-view { color: var(--accent); }
/* a phone: one slim line above the content */
@media (max-width: 760px) {
  .toasts > .toast { max-width: none; padding: 6px var(--s3); font-size: 12px; }
  /* (Enterprise console only: Local has no scope bar, and this file is also its console.css)
     the page head: title and subtitle on their own row, the controls under them (no one-word-per-line squeeze) */
  .scopebar ~ .main .page-head > .grow { flex-basis: 100%; }
  .scopebar ~ .main .page-head .sub { font-size: 12px; }
  /* folded sections are one line each: keep them close so what is urgent reaches the first screen */
  .scopebar ~ .main .fold { margin: var(--s2) 0; }
}

/* ---------------------------------------------------------------- graph */
/* What each case found: a narrowing from every agent looked at to the verdict, beside the graph it lights up */
.graph-story { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--s3); align-items: stretch;
               margin-top: var(--s3); }
.graph-story .graph-wrap { margin-top: 0; }
/* the graph's own canvas must not hold its box open: it follows the box, never the reverse */
.graph-story > *, .graph-wrap, .graph-wrap .canvas { min-width: 0; }
#cy { overflow: hidden; }
/* as tall as the graph and its legend, never taller: the row's height is the graph's */
.story-slot { position: relative; min-height: 300px; }
.story-slot > .story-card { position: absolute; inset: 0; overflow: auto; margin: 0; }
.story-card > header { flex-direction: column; align-items: stretch; gap: var(--s2); }
.story-card > header h2 { flex: none; }
.case-picker { display: grid; gap: var(--s2); }
.case-picker .row { display: flex; align-items: center; gap: var(--s2); }
.case-picker-btn { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--s2); }
.case-picker-nav { display: flex; align-items: center; gap: 2px; white-space: nowrap; }
.case-picker input[type="search"] { width: 100%; }
.case-picker-list { list-style: none; margin: 0; padding: 0; max-height: 260px; overflow: auto;
                    border: 1px solid var(--line); border-radius: var(--r1); }
.case-picker-list li { padding: 6px var(--s3); border-bottom: 1px solid var(--line); cursor: pointer; display: grid; gap: 2px; }
.case-picker-list li:last-child { border-bottom: 0; }
.case-picker-list li[aria-selected="true"] { background: var(--accent-soft); }
.case-picker-list li.current .mono { color: var(--accent); }
.case-picker-list li.none { cursor: default; }
.story { display: grid; gap: var(--s2); }
.story-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; }
.story-flow { display: grid; gap: 2px; }
.story-side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); margin-top: var(--s2); }
.story-stage { border: 1px solid var(--line); border-radius: var(--r1); padding: 6px var(--s3); background: var(--panel-2);
               display: grid; gap: 4px; align-content: start; cursor: default; }
.story-card > .body { padding-top: var(--s3); padding-bottom: var(--s3); }
.story-stage:hover { border-color: var(--accent); background: var(--accent-soft); }
/* an empty stage recedes by colour, not opacity, so its text keeps AA contrast */
.story-stage.empty { background: var(--panel); border-style: dashed; }
.story-stage.empty .story-n, .story-stage.empty .story-label { color: var(--muted); }
/* cleared is good news; exposed agents are to be restarted fresh: each its own colour */
.story-stage.tone-ok { border-color: var(--ok); background: var(--ok-soft); }
.story-stage.tone-ok .story-n, .story-stage.tone-ok .story-label { color: var(--ok); }
.story-stage.tone-restart { border-color: var(--restart); background: var(--restart-soft); }
.story-stage.tone-restart .story-n, .story-stage.tone-restart .story-label { color: var(--restart); }
.story-top { display: flex; align-items: baseline; gap: var(--s2); }
.story-n { font-size: 20px; font-weight: 700; line-height: 1; min-width: 22px; }
.story-label { font-weight: 600; font-size: 13px; }
.story-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.story-chips a { text-decoration: none; font-size: 11px; }
.story-arrow { text-align: center; color: var(--muted); font-size: 12px; line-height: 1; }
/* graph first, then what each case found (the story strip above already says what the path is) */
@media (max-width: 1100px) {
  .graph-story { grid-template-columns: minmax(0, 1fr); }
  .story-slot { min-height: 0; }
  .story-slot > .story-card { position: static; }
}
.seg-row { margin: var(--s3) 0 var(--s2); }
.page-head .seg-row { margin: 0; }
/* the Bait page's key to the Observed column */
.obs-key { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s3); }
.obs-key > div { display: grid; gap: 4px; align-content: start; }
.obs-key .badge { justify-self: start; }
@media (max-width: 900px) { .obs-key { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.graph-wrap { margin-top: var(--s3); display: grid; gap: var(--s3); }
.graph-wrap .canvas { position: relative; }
/* what was clicked in the graph, in its corner */
.g-card { position: absolute; bottom: var(--s3); right: var(--s3); width: 280px; max-width: calc(100% - 80px); z-index: 2;
          background: var(--panel); border: 1px solid var(--line); border-radius: var(--r2); box-shadow: var(--shadow);
          padding: var(--s3); display: grid; gap: 8px; }
.g-card .row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.g-card > .btn { justify-self: start; }
.g-card[hidden] { display: none; }
.g-card:not([hidden]) ~ .g-hint { display: none; }
.g-card.in { animation: gcard-in .22s ease-out; }
@keyframes gcard-in { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
.g-tools { position: absolute; top: var(--s3); left: var(--s3); display: flex; flex-direction: column; gap: 4px; }
.g-tools .btn { width: 30px; justify-content: center; padding: 0; box-shadow: var(--shadow); }
/* the one line of text that saves a person working out how to zoom: under the canvas, never over a label */
.g-hint { font-size: 12px; color: var(--muted); padding: 4px 2px 0; }
#cy { height: min(640px, calc(100vh - 260px)); min-height: 320px; background-color: var(--panel); background-image: radial-gradient(var(--line-2) 1px, transparent 1.3px); background-size: 20px 20px; border: 1px solid var(--line); border-radius: var(--r2); }
.legend { display: grid; gap: 6px; font-size: 12px; color: var(--muted); }
.legend-group { display: flex; gap: 6px var(--s4); flex-wrap: wrap; align-items: center; }
.legend-h { font-weight: 600; color: var(--ink-2); min-width: 52px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.legend i.ring2 { width: 11px; height: 11px; background: var(--panel) !important; border: 3px double var(--g-corroborated); box-sizing: border-box; }
.legend i.shape-star { border-radius: 0; width: 11px; height: 11px;
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.legend i.shape-diamond { border-radius: 0; width: 8px; height: 8px; transform: rotate(45deg); border: 1.5px dashed var(--g-shared); }
.legend b { width: 18px; border-top: 2px solid; position: relative; }
.legend b.dashed { border-top-style: dashed; }
.legend b.dotted { border-top-style: dotted; }
.legend b.thin { border-top-width: 1px; }
.legend b.tee { border-top-width: 3px; }
.legend b.tee::after { content: ""; position: absolute; right: -1px; top: -6px; height: 9px; border-right: 2px solid; border-color: inherit; }
.legend i.legend-step { width: auto; height: auto; border-radius: 0; font-style: normal; font-weight: 600; color: var(--ink); }
.legend i.legend-fold { width: auto; height: auto; border-radius: 999px; font-style: normal; font-size: 11px; font-weight: 600;
  padding: 0 6px; border: 1px dashed var(--line-2); color: var(--ink-2); }
.legend-box > summary { cursor: pointer; font-size: 12px; color: var(--muted); width: max-content; }
@media (min-width: 761px) { .legend-box[open] > summary { display: none; } }
/* the opening motion: one fade of the whole picture */
#cy.g-in { animation: g-in .2s ease-out; }
@keyframes g-in { from { opacity: 0; } to { opacity: 1; } }
/* "Showing the paths · Fit everything" */
.g-note { position: absolute; top: var(--s3); right: var(--s3); z-index: 2; display: flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--ink-2); background: var(--panel); border: 1px solid var(--line); border-radius: 999px;
  padding: 0 4px 0 var(--s3); }
.g-note[hidden] { display: none; }
/* what was folded, and the way back */
.g-folds { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.g-folds[hidden] { display: none; }
.fold-chip { cursor: pointer; border-style: dashed; }
.fold-chip .fold-show { color: var(--accent); font-weight: 600; }
.g-open { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; padding: var(--s3); border: 1px dashed var(--line-2);
  border-radius: var(--r2); background: var(--panel); }
.g-fold-total { font-size: 13px; }
/* "Overview of 200 items · zoom in or pick a path to read names": keeps its line, so the canvas never jumps */
.g-cue { margin: 0; font-size: 12px; color: var(--ink-2); min-height: 1.4em; }
.g-cue.off { visibility: hidden; }
/* wide screens: the followed step's card docks at the top of the side column, beside the graph, never over it */
.story-slot > .g-card.docked { position: absolute; top: 0; left: 0; right: 0; bottom: auto; width: auto; max-width: none; z-index: 3; }
.story-slot.has-card > .story-card { top: calc(var(--card-h, 0px) + var(--s3)); }
/* a phone's "Everything": agents and what each touched, the map on request */
.g-phone-all { display: grid; gap: var(--s2); }
.g-list { display: grid; gap: var(--s2); }
.g-list-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); flex-wrap: wrap; }
.g-agents { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.g-agent > details > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--s2); padding: var(--s2);
  border: 1px solid var(--line); border-radius: var(--r1); background: var(--panel); cursor: pointer; font-size: 13px; }
.g-agent .g-touch { display: grid; gap: 2px; padding: 6px var(--s2) var(--s2); font-size: 12px; overflow-wrap: anywhere; }

/* the path: numbered steps, a strip on wide screens and a list of cards on a phone */
.story-path { display: grid; gap: 6px; margin: 0 0 var(--s3); padding: var(--s2) var(--s3); background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--r2); }
.story-path-head { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; min-width: 0; }
/* wide screens: one row, the badge and path tabs leading the numbered steps; the title stays for screen readers */
.story-path:not(.vertical) { display: flex; flex-wrap: wrap; align-items: center; gap: 6px var(--s2); }
.story-path:not(.vertical) .story-path-head { flex: none; }
.story-path:not(.vertical) .story-caveat, .story-path:not(.vertical) .story-time-note { flex-basis: 100%; margin: 0; }
.story-time-note { margin: 0; }
/* every step is visible: the chips wrap into rows (each chip keeps its own line while it fits) */
.story-path:not(.vertical) .story-steps { flex: 1 1 0; flex-wrap: wrap; min-width: 0; }
.story-path:not(.vertical) .story-steps li { flex: none; max-width: 100%; }
.story-path:not(.vertical) .story-step { white-space: nowrap; }
@media (max-width: 1100px) { .story-path:not(.vertical) .story-step { white-space: normal; } }
.sr-title { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.story-path-head h2 { margin: 0; font-size: 14px; flex: 1 1 260px; min-width: 0; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; }
.story-tabs { display: flex; gap: 2px; flex-wrap: wrap; }
.story-tabs .btn[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.sev { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; padding: 1px 6px; border-radius: 4px;
  border: 1px solid currentColor; }
.sev-critical { color: var(--critical); }
.sev-high { color: var(--warning); }
.sev-medium, .sev-low, .sev-possible { color: var(--ink-2); border-style: dashed; }
.story-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: stretch; }
.story-steps li { display: flex; align-items: center; min-width: 0; }
.story-step { display: inline-flex; align-items: baseline; gap: 6px; flex-wrap: wrap; text-align: left; font: inherit; color: inherit;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r1); padding: 3px var(--s2); cursor: pointer;
  min-width: 0; max-width: 100%; }
.story-step:hover, .story-step:focus-visible, .story-step.hot { border-color: var(--accent); background: var(--accent-soft); }
.story-step[aria-current="step"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.step-n { font-weight: 700; font-size: 11px; line-height: 18px; min-width: 18px; height: 18px; border-radius: 50%; text-align: center;
  background: var(--ink); color: var(--panel); align-self: center; }
.step-text { min-width: 0; overflow-wrap: anywhere; }
.step-meta { color: var(--muted); font-size: 11px; }
.story-caveat { margin: 0; }
.story-path.vertical .story-steps { flex-direction: column; flex-wrap: nowrap; }
.story-path.vertical .story-step { display: grid; grid-template-columns: auto minmax(0, 1fr); width: 100%; padding: var(--s2); }
.story-path.vertical .step-meta { grid-column: 2; }
.story-path.vertical .story-path-head h2 { white-space: normal; }
/* filters and time range: folded into one line until wanted */
.filters-card > summary { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; padding: var(--s2) var(--s3);
  cursor: pointer; }
.filters-card > summary .chip { height: 22px; }
.filters-card > summary .chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.filters-card .timeline-body { margin-top: var(--s2); }
#timeline { width: 100%; height: 40px; display: block; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------------------------------------------------------------- small screens */
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "banner" "scope" "toast" "main"; }
  .toasts { padding: 0 var(--s3); }
  .tenant, .search-btn span, .freshness { display: none; }
  .search-btn { min-width: 0; }
  .side { position: fixed; top: 52px; left: 0; bottom: 0; width: min(272px, 82vw); z-index: 35; box-shadow: var(--shadow); }
  .side[hidden] { display: none; }
  .main { padding: var(--s4) var(--s3) var(--s7); }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .inspector { width: 100vw; border-left: 0; }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .kv > div:nth-child(odd) { margin-top: var(--s2); font-size: 12px; }
  .queue li { grid-template-columns: minmax(0, 1fr); }
  #cy { height: 380px; min-height: 0; }
  table.cards thead { display: none; }
  table.cards tbody, table.cards tr, table.cards td { display: block; width: 100%; }
  table.cards tr { border: 1px solid var(--line); border-radius: var(--r2); margin-bottom: var(--s2); padding: var(--s2) 0; }
  table.cards td { height: auto; border: 0; display: grid; grid-template-columns: 116px minmax(0, 1fr);
                   gap: var(--s2); padding: 5px var(--s3); }
  table.cards td::before { content: attr(data-label); color: var(--muted); font-size: 12px; }
  table.cards td.num { text-align: left; }
}
@media (min-width: 901px) { .side { display: flex !important; } }
/* a phone opens the graph on request, full width and most of the screen */
@media (max-width: 760px) {
  #cy { height: 70vh; }
  .story-path { padding: var(--s2); }
}

a.strong { font-weight: 600; }


/* ----------------------------------------------------------------- scope bar and issue views */
.scopebar { grid-area: scope; }
.scope { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; padding: 6px 18px;
  border-bottom: 1px solid var(--line); background: var(--panel); font-size: 12px; }
.scope b { font-weight: 600; }
.stat.link { text-decoration: none; color: inherit; display: block; }
.stat.link:hover { background: var(--hover); text-decoration: none; }
.tabs { display: flex; gap: 2px; padding: 8px 12px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tabs button { background: none; border: 0; padding: 8px 12px; border-radius: 8px 8px 0 0; color: var(--ink-2);
  cursor: pointer; font: inherit; }
.tabs button[aria-selected="true"] { background: var(--hover); color: var(--ink); font-weight: 600; }
ul.plain, ol.plain { margin: 6px 0; padding-left: 18px; }
ul.plain li, ol.plain li { margin: 3px 0; }

.cc-top { display: contents; }
@media (max-width: 760px) {
  .cc-top { display: flex; flex-direction: column; }
  .cc-top .cc-urgent { order: -1; }   /* what needs attention comes before the programme numbers */
}

/* Egress policy: the allowed and blocked lists side by side, stacked on narrow screens */
.grid-egress { display: grid; gap: var(--s3); grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.grid-egress > .card + .card { margin-top: 0; }
.egress-group { cursor: pointer; }
.egress-group + .egress-group { border-top: 1px solid var(--line); }
@media (max-width: 900px) { .grid-egress { grid-template-columns: minmax(0, 1fr); } }

/* Connectors: gaps to close, setup steps, and the generated template */
.conn-recs { margin: 0; padding-left: 18px; display: grid; gap: var(--s3); }
.conn-recs li { display: grid; gap: 2px; }
.conn-steps { margin: var(--s2) 0; padding-left: 18px; display: grid; gap: 4px; font-size: 13px; }
.conn-file { max-height: 360px; overflow: auto; margin-top: var(--s2); }
.conn-fields { display: grid; gap: var(--s3); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.conn-fields input[type="text"] { width: 100%; }
@media (max-width: 700px) { .conn-fields { grid-template-columns: minmax(0, 1fr); } }.rule-warn { color: var(--warning); }

/* AI workflows: a number or name that filters the page, styled as a link */
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer;
           text-decoration: underline; text-underline-offset: 2px; }
.linkish:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* AI workflows, Cases view: the send a case finding is about stands out in the timeline */
.case-tl li.flagged { background: var(--warning-soft); border-left: 3px solid var(--warning); border-radius: 6px; }
.case-tl li { grid-template-columns: 112px minmax(0, 1fr); padding-left: 4px; padding-right: 4px; }
/* the Administration link sits under the signed-in name: its own line, never a link inside a run of text */
.side-foot > a { display: block; }


/* ---------------------------------------------------------------- navigation groups (enterprise console only) */
/* Sections grouped by job. New, namespaced classes: Covin Local loads this sheet too and uses none of them. */
.side nav .nav-group { display: grid; gap: 2px; }
.side nav .nav-group + .nav-group { margin-top: var(--s3); }
.nav-group-h { display: flex; align-items: center; gap: var(--s2); padding: 2px var(--s3); color: var(--muted);
               font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
.nav-progress { margin-left: auto; font-size: 11px; font-weight: 600; letter-spacing: 0; text-transform: none;
                color: var(--warning); }
details.nav-more > summary { list-style: none; cursor: pointer; border-radius: var(--r1); padding-top: 5px;
                             padding-bottom: 5px; }
details.nav-more > summary::before { font-size: 11px; color: var(--muted); }      /* the shared chevron, smaller */
details.nav-more > summary:hover { background: var(--panel-2); color: var(--ink); }
details.nav-more[open] > summary { margin-bottom: 2px; }
.side-foot .guide-open { display: block; margin-top: var(--s2); font-size: 12px; text-align: left; }
.side-foot .guide-open[hidden] { display: none; }

/* ---------------------------------------------------------------- first-run setup checklist */
.setup-check header { display: flex; align-items: baseline; gap: var(--s3); flex-wrap: wrap; }
.setup-check header h2 { margin: 0; }
.setup-bar { height: 6px; border-radius: 999px; background: var(--info-soft); overflow: hidden; margin: var(--s2) 0 var(--s3); }
.setup-bar > i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.setup-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.setup-steps li { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: var(--s2); align-items: start; }
.setup-steps .setup-mark { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
                           font-size: 12px; font-weight: 700; border: 1px solid var(--line-2); color: var(--muted); }
.setup-steps li.done .setup-mark { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.setup-steps li.done .setup-label { color: var(--muted); }
.setup-steps li.next .setup-mark { border-color: var(--accent); color: var(--accent); }
.setup-steps .setup-label { font-weight: 600; }

/* ---------------------------------------------------------------- issue story and its one next step */
.issue-story p { margin: 0 0 var(--s2); font-size: 14px; }
.issue-next { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); margin: var(--s3) 0; }

/* ---------------------------------------------------------------- the optional walkthrough (guide.js) */
/* A non-modal coach card next to the real control it explains. It never covers a dialog: it hides while one is up. */
.guide-coach { position: fixed; z-index: 38; width: 320px; max-width: calc(100vw - 24px); background: var(--panel);
               border: 1px solid var(--line-2); border-top: 3px solid var(--accent); border-radius: var(--r2);
               box-shadow: var(--shadow); padding: var(--s3) var(--s4) var(--s4); }
.guide-coach[hidden] { display: none; }
.guide-coach.guide-docked { left: 224px; bottom: var(--s4); }
.guide-coach .guide-top { display: flex; align-items: center; gap: var(--s2); color: var(--muted); font-size: 12px; }
.guide-coach .guide-top .grow { flex: 1; }
.guide-coach h2 { font-size: 15px; margin: var(--s2) 0 var(--s1); }
.guide-coach h2:focus { outline: none; }
.guide-coach h2:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.guide-coach p { color: var(--ink-2); margin: 0 0 var(--s3); }
.guide-acts { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.guide-acts .grow { flex: 1; }
.guide-target { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r1);
                animation: guide-pulse 1.6s ease-in-out 3; }
@keyframes guide-pulse { 50% { box-shadow: 0 0 0 6px var(--accent-soft); } }
@media (prefers-reduced-motion: reduce) { .guide-target { animation: none; } }
@media (max-width: 900px) {
  .guide-coach.guide-docked, .guide-coach.guide-phone { left: 12px; right: 12px; bottom: 12px; top: auto !important;
                                                        width: auto; }
}
.shell.nav-collapsed ~ .guide-coach.guide-docked { left: var(--s4); }
/* the grouped sidebar is taller than a phone: let the enterprise menu (#nav, which Covin Local does not have) scroll */
@media (max-width: 900px) { .shell #nav { overflow-y: auto; } }

/* walkthrough fixes ------------------------------------------------------------------------------------------------
   One block, appended, so the separate graph branch merges cleanly. Covers: the kill switch strip (Bait page,
   Administration, Autonomous bait), the neutral day-1 banner, term() definitions, the guide's chapter list, its
   bottom sheet that moves to the top on a phone, and the room below the page while the sheet is open. */
.kill-strip { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); padding: var(--s3);
              margin: 0 0 var(--s3); border: 1px solid var(--critical); border-radius: var(--r1); background: var(--panel); }
.kill-strip .grow { flex: 1 1 280px; min-width: 0; }
.kill-strip .btn[disabled] { opacity: .55; cursor: not-allowed; }
.telemetry.setup-wait { background: var(--accent-soft); color: inherit; }
.term { text-decoration: underline dotted; text-underline-offset: 3px; cursor: help; }
.term:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.guide-chapters { margin: 0 0 var(--s3); padding-left: 1.4em; }
.guide-chapters li { margin: var(--s1) 0; }
.guide-chapters .btn[disabled] { opacity: .55; cursor: not-allowed; }
@media (max-width: 900px) {
  body.guide-room .main, body.guide-room #main { padding-bottom: 46vh; }
  .guide-coach.guide-phone.guide-phone-top { top: 64px !important; bottom: auto; }
  .guide-coach.guide-phone { max-height: 40vh; overflow-y: auto; }
}

/* polish pass ------------------------------------------------------------------------------------------------------
   One appended block: the Connect buttons, sample values as placeholders, the graph page's fixed toast slot, and the
   key's folded entry (shown only with a real count). */
.tile .btn.connect-btn { align-self: flex-start; justify-content: center; margin-top: var(--s2); color: var(--accent);
                          border-color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.tile .btn.connect-btn::after { content: " →"; white-space: pre; }
.tile .btn.connect-btn:hover { filter: brightness(1.04); text-decoration: none; }
.sess-form input::placeholder { color: var(--muted); font-style: italic; opacity: 1; }
/* the graph page keeps one toast-high slot whether or not a toast is showing, so a toast never moves the graph or
   the story being read; it still sits in its own row, never over content */
.toasts.slot { height: 44px; padding-top: var(--s2); overflow: hidden; align-content: start; box-sizing: border-box; }
.toasts.slot > .toast, .toasts.slot > div { white-space: nowrap; max-width: min(560px, 100%); min-width: 0; }
.toasts.slot .toast > a.toast-link, .toasts.slot .toast > div { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
@media (max-width: 760px) { .toasts.slot { height: 42px; } }
.legend .legend-folds[hidden] { display: none; }
.toasts.slot > .toast { padding-top: 6px; padding-bottom: 6px; }
/* a dialog with three actions on a phone: they wrap, so Cancel is never pushed off the left edge */
.modal .acts { flex-wrap: wrap; }
