/* ==========================================================================
   VIGIL COMMAND — component kit (CSP-native: no inline styles/handlers needed)
   Consumes tokens.css. One coherent surface for both planes.
   ========================================================================== */

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg-0); color: var(--text-0);
  font-family: var(--font-sans); font-size: var(--fs-md); line-height: var(--lh);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { margin: 0; line-height: var(--lh-tight); font-weight: 700; text-wrap: balance; letter-spacing: -.01em; }
a { color: inherit; text-decoration: none; }
code, .mono { font-family: var(--font-mono); font-size: .92em; }
button { font: inherit; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-1); }
.label { font-size: var(--fs-micro); text-transform: uppercase; letter-spacing: var(--tracking-label); color: var(--text-2); font-weight: 600; }
.muted { color: var(--text-1); } .faint { color: var(--text-2); }
.tnum { font-variant-numeric: tabular-nums; }
.scroll-x { overflow-x: auto; }

/* ---- app shell grid ------------------------------------------------------ */
#app { display: grid; grid-template-columns: var(--nav-w) 1fr; grid-template-rows: var(--topbar-h) 1fr;
       grid-template-areas: "brand topbar" "nav main"; height: 100vh; }
#app.nav-collapsed { grid-template-columns: var(--nav-w-collapsed) 1fr; }

/* brand corner */
#brand { grid-area: brand; display: flex; align-items: center; gap: var(--sp-3);
         padding: 0 var(--sp-4); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
         background: var(--bg-1); }
#brand .logo { width: 30px; height: 30px; flex: 0 0 auto; display: grid; place-items: center; }
#brand .logo img { width: 30px; height: 30px; }

/* the owner's logo (packages/vigil-brand): .for-dark is the white artwork shown on the dark theme, .for-light the
   dark artwork shown on the light theme — the same two triggers as tokens.css (the toggle, then the OS setting) */
.vigil-logo.for-light { display: none; }
:root[data-theme="light"] .vigil-logo.for-dark { display: none; }
:root[data-theme="light"] .vigil-logo.for-light { display: block; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .vigil-logo.for-dark { display: none; }
  :root:not([data-theme="dark"]) .vigil-logo.for-light { display: block; }
}
#brand .name { font-weight: 700; letter-spacing: .02em; font-size: var(--fs-md); white-space: nowrap; }
#app.nav-collapsed #brand .name { display: none; }

/* top bar */
#topbar { grid-area: topbar; display: flex; align-items: center; gap: var(--sp-3);
          padding: 0 var(--sp-5); background: var(--bg-1); border-bottom: 1px solid var(--border); }
#topbar .spacer { flex: 1; }
/* The bar must never push its primary action off the screen. A flex item defaults to min-width:auto,
   so nothing in this row would shrink: when a conditional item appeared — the API-key failure badge —
   the row simply overflowed and carried "New Assessment" off the right edge, out of sight behind a
   horizontal scrollbar. The two things an operator must always be able to see and reach are the
   safety state and the primary action, so those never shrink. The search box and the counts give up
   width first and ellipsise instead; the counts are also shown on Home, so trimming them loses nothing. */
#topbar { min-width: 0; }
#topbar .cmdk,
#topbar .scope-chip,
#topbar .counts { min-width: 0; flex: 0 1 auto; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#topbar .segmented,
#topbar .pill,
#topbar .safety,
#topbar .offense-chip,
#topbar .iconbtn,
#topbar .btn.primary { flex: 0 0 auto; }

/* active-engagement scope chip — WHICH JOB every screen is showing (or "All engagements").
   Presentation only: it scopes what is listed, never what is signed or gated. It shrinks and
   ellipsises with the search box under the rule above rather than growing unbounded, so a long job
   name can never carry the safety state or the primary action off the right edge of the bar. */
.scope-chip { display: inline-flex; align-items: center; gap: 7px; max-width: 260px;
  background: var(--bg-2); border: 1px solid var(--border); color: var(--text-1);
  border-radius: var(--r-pill); padding: 6px 13px; cursor: pointer; font-size: var(--fs-sm); font-weight: 600; }
.scope-chip:hover { background: var(--bg-3); color: var(--text-0); }
.scope-chip .glyph { flex: 0 0 auto; opacity: .8; }
.scope-chip .txt { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.scope-chip.on { color: var(--owner); border-color: var(--owner-line); background: var(--owner-dim); }
.scope-chip.on .glyph { opacity: 1; }
/* the × that clears the view filter straight from the top bar (no trip to the library needed). It is a
   SIBLING of the chip inside .scope-wrap — never nested in the chip button (a button-in-a-button is
   invalid HTML). */
.scope-wrap { display: inline-flex; align-items: center; gap: 2px; min-width: 0; }
.scope-clear { flex: 0 0 auto; padding: 3px 7px; border: 1px solid var(--owner-line); background: var(--owner-dim);
  color: var(--owner); font: inherit; font-weight: 700; line-height: 1; cursor: pointer;
  border-radius: var(--r-1); opacity: .85; }
.scope-clear:hover { opacity: 1; background: color-mix(in srgb, var(--owner) 28%, transparent); border-color: var(--owner); }
.scope-clear:focus-visible { outline: 2px solid var(--owner); outline-offset: 1px; }

/* segmented control (All / Offense / Defense) */
.segmented { display: inline-flex; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--r-pill); padding: 3px; }
.segmented button { border: 0; background: transparent; color: var(--text-1); padding: 5px 14px; border-radius: var(--r-pill);
  font-size: var(--fs-sm); font-weight: 600; cursor: pointer; }
.segmented button.on { background: var(--bg-0); color: var(--text-0); box-shadow: var(--shadow-1); }

/* command palette trigger */
.cmdk { display: inline-flex; align-items: center; gap: var(--sp-2); background: var(--bg-2); border: 1px solid var(--border);
  color: var(--text-1); border-radius: var(--r-pill); padding: 7px 14px; cursor: pointer; font-size: var(--fs-sm); min-width: 230px; }
.cmdk .kbd { margin-left: auto; font-size: var(--fs-micro); color: var(--text-2); border: 1px solid var(--border-strong);
  border-radius: 5px; padding: 1px 6px; font-family: var(--font-mono); }

/* pills / chips ------------------------------------------------------------ */
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border-radius: var(--r-pill);
        font-size: var(--fs-sm); font-weight: 600; border: 1px solid var(--border-strong); background: var(--bg-2);
        color: var(--text-1); white-space: nowrap; }
.pill.sm { padding: 3px 9px; font-size: var(--fs-xs); }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
.pill .ico { width: 15px; height: 15px; flex: 0 0 auto; }
.pill.live { color: var(--st-confirmed); border-color: color-mix(in srgb, var(--st-confirmed) 40%, var(--border)); }
.pill.live .dot { animation: pulse 1.4s ease-in-out infinite; }
.pill.idle { color: var(--text-1); }
.pill.reconnect { color: var(--st-queued); border-color: var(--owner-line); }
.pill.owner { color: var(--owner); border-color: var(--owner-line); background: var(--owner-dim); }
.pill.danger { color: var(--st-blocked); border-color: color-mix(in srgb, var(--st-blocked) 45%, var(--border)); }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 55%, transparent); } 50% { box-shadow: 0 0 0 5px transparent; } }

/* counts cluster */
.counts { display: inline-flex; gap: var(--sp-2); }
.count { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--text-1); padding: 4px 10px;
  border-radius: var(--r-pill); background: var(--bg-2); border: 1px solid var(--border); }
.count b { color: var(--text-0); font-variant-numeric: tabular-nums; }

/* the always-visible safety pill */
.safety { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: var(--r-pill);
  font-weight: 700; font-size: var(--fs-sm); cursor: pointer; border: 1px solid var(--owner-line); background: var(--owner-dim); color: var(--owner); }
.safety.clear { color: var(--st-confirmed); border-color: color-mix(in srgb, var(--st-confirmed) 40%, var(--border)); background: transparent; }
.safety.waiting { animation: pulse 1.6s ease-in-out infinite; }
.safety.tripped { color: #fff; background: var(--st-blocked); border-color: var(--st-blocked); }

/* the offense-side indicator, and its one-click start (see app.js offenseChip). Quiet when the offense
   side is up; a real, clearly clickable button when it is DOWN and this proxy can start it — the moment
   the operator most needs a way out that is not a terminal. Styling deliberately mirrors .safety. */
.offense-chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: var(--r-pill);
  font-weight: 700; font-size: var(--fs-sm); font-family: inherit; border: 1px solid var(--border);
  background: var(--bg-2); color: var(--text-1); }
.offense-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
.offense-chip .txt { white-space: nowrap; }
.offense-chip.up { color: var(--st-confirmed); border-color: color-mix(in srgb, var(--st-confirmed) 40%, var(--border)); background: transparent; }
.offense-chip.working { color: var(--text-1); cursor: default; }
.offense-chip.working .dot { animation: pulse 1.4s ease-in-out infinite; }
.offense-chip.down { color: var(--text-1); }
.offense-chip.down.action { cursor: pointer; color: var(--owner); border-color: var(--owner-line); background: var(--owner-dim); }
.offense-chip.down.action:hover { color: var(--text-0); background: color-mix(in srgb, var(--owner) 32%, transparent); border-color: var(--owner); }
.offense-chip.down.action:focus-visible { outline: 2px solid var(--owner); outline-offset: 2px; }
/* "Offense up" is a REAL toggle button: the WHOLE green chip stops the offense side (with a confirm), the
   mirror of the "Start offense side" button the down state shows. A danger-tinted "Stop" hint pill makes
   the destructive click unmistakable; the chip stays green (it IS up) and only the hint + a faint tint turn
   red on hover, so it never looks "down" while it is up. */
.offense-chip.up.action { cursor: pointer; }
.offense-chip.up.action:hover { border-color: color-mix(in srgb, var(--st-blocked) 45%, var(--border));
  background: color-mix(in srgb, var(--st-blocked) 10%, transparent); }
.offense-chip.up.action:focus-visible { outline: 2px solid var(--st-blocked); outline-offset: 2px; }
.offense-chip.up.action .oc-hint { margin-left: 2px; padding: 1px 9px; border-radius: var(--r-pill);
  font-weight: 700; font-size: var(--fs-xs); font-family: inherit; line-height: 1.5; color: var(--st-blocked);
  border: 1px solid color-mix(in srgb, var(--st-blocked) 45%, var(--border)); }
.offense-chip.up.action:hover .oc-hint { border-color: var(--st-blocked);
  background: color-mix(in srgb, var(--st-blocked) 18%, transparent); }

/* buttons ------------------------------------------------------------------ */
.btn { display: inline-flex; align-items: center; gap: 8px; background: var(--bg-2); border: 1px solid var(--border-strong);
  color: var(--text-0); padding: 9px 16px; border-radius: var(--r-pill); cursor: pointer; font-size: var(--fs-sm); font-weight: 600; }
.btn:hover { background: var(--bg-3); }
.btn.primary { background: var(--primary-bg); border-color: var(--primary-bg); color: var(--primary-fg); }
.btn.primary:hover { background: var(--primary-bg-hover); }
.btn.owner { background: var(--owner); border-color: var(--owner); color: #1a1205; }
.btn.ghost { background: transparent; }
.btn.danger { background: transparent; border-color: color-mix(in srgb, var(--st-blocked) 50%, var(--border)); color: var(--st-blocked); }
.btn.lg { padding: 12px 22px; font-size: var(--fs-md); }
.btn.sm { padding: 6px 12px; font-size: var(--fs-xs); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.iconbtn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: var(--r-pill);
  background: var(--bg-2); border: 1px solid var(--border); color: var(--text-1); cursor: pointer; }
.iconbtn:hover { color: var(--text-0); background: var(--bg-3); }

/* nav ---------------------------------------------------------------------- */
#nav { grid-area: nav; background: var(--bg-1); border-right: 1px solid var(--border); overflow-y: auto; padding: var(--sp-4) 0; }
.nav-group { padding: var(--sp-4) var(--sp-5) var(--sp-2); }
#app.nav-collapsed .nav-group { visibility: hidden; height: var(--sp-5); }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 10px var(--sp-5); cursor: pointer; color: var(--text-1);
  border-left: 3px solid transparent; font-size: var(--fs-md); font-weight: 500; }
.nav-item:hover { background: var(--bg-2); color: var(--text-0); }
.nav-item.active { background: var(--bg-2); color: var(--text-0); border-left-color: var(--text-0); font-weight: 600; }
.nav-item.owner.active { border-left-color: var(--owner); }
.nav-item .glyph { width: 20px; height: 20px; flex: 0 0 auto; opacity: .85; }
.nav-item .txt { white-space: nowrap; }
#app.nav-collapsed .nav-item .txt { display: none; }
/* Manual "CONTENTS" list: reuses the nav-item look, but holds full section TITLES inside a fixed
   260px card — the rail's nowrap runs them out of the box. Wrap rather than truncate: in a table of
   contents the title IS the navigation, so an ellipsis would hide what the operator is choosing. */
.man-toc .nav-item { align-items: flex-start; padding-top: 8px; padding-bottom: 8px; }
.man-toc .nav-item .txt { white-space: normal; overflow-wrap: anywhere; line-height: 1.35; }
.nav-item .badge-count { margin-left: auto; font-size: var(--fs-xs); font-weight: 700; background: var(--bg-3); color: var(--text-1);
  border-radius: var(--r-pill); padding: 1px 8px; min-width: 20px; text-align: center; }
.nav-item .badge-count.owner { background: var(--owner-dim); color: var(--owner); }
#app.nav-collapsed .nav-item .badge-count { display: none; }
/* An approval is waiting: make the Approvals & Safety item unmissable — owner-gold glow that pulses
   (reuses @keyframes pulse; currentColor drives the ring), a solid badge, and a bright left rail. */
.nav-item.needs-approval { color: var(--owner); background: var(--owner-dim); border-left-color: var(--owner);
  font-weight: 600; animation: pulse 1.8s ease-in-out infinite; }
.nav-item.needs-approval .glyph { opacity: 1; }
.nav-item.needs-approval .badge-count.owner { background: var(--owner); color: #1a1205; }
@media (prefers-reduced-motion: reduce) { .nav-item.needs-approval { animation: none; box-shadow: inset 3px 0 0 var(--owner); } }

/* main + screen head ------------------------------------------------------- */
#main { grid-area: main; overflow-y: auto; padding: var(--sp-6); }
.wrap { max-width: var(--content-max); margin: 0 auto; }
.screen-head { display: flex; align-items: flex-end; gap: var(--sp-4); margin-bottom: var(--sp-5); flex-wrap: wrap; }
.screen-head h1 { font-size: var(--fs-2xl); }
.screen-head .sub { color: var(--text-1); font-size: var(--fs-md); }
.screen-head .actions { margin-left: auto; display: flex; gap: var(--sp-2); }

/* cards + grid ------------------------------------------------------------- */
.grid { display: grid; gap: var(--sp-4); }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1200px) { .cols-3, .cols-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 720px) { .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; } }
.card { background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--r-3); padding: var(--sp-5); }
.card.owner { border-top: 2px solid var(--owner-line); }
/* inv 12 (S9): a degraded proof subsystem reads as a distinct alarm, never like a clean run. */
.card.verification-degraded { border-color: color-mix(in srgb, var(--st-blocked) 55%, var(--border));
  border-left: 3px solid var(--st-blocked); background: color-mix(in srgb, var(--st-blocked) 8%, var(--bg-1)); }
.card > .card-h { display: flex; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-4); }
.card > .card-h h3 { font-size: var(--fs-lg); }
.card > .card-h .label { margin: 0; }

/* stat tile */
.tile { background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--r-3); padding: var(--sp-5); }
.tile .k { font-size: var(--fs-micro); text-transform: uppercase; letter-spacing: var(--tracking-label); color: var(--text-2); font-weight: 600; }
.tile .v { font-size: var(--fs-3xl); font-weight: 800; margin-top: 6px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.tile .v.sm { font-size: var(--fs-2xl); }
.tile .foot { font-size: var(--fs-sm); color: var(--text-2); margin-top: 6px; }
.tile .foot.up { color: var(--st-confirmed); } .tile .foot.down { color: var(--st-blocked); }

/* status badge (the six-state vocabulary) ---------------------------------- */
.st { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--r-pill);
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: .02em; border: 1px solid transparent; text-transform: capitalize; }
.st .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-idle { color: var(--st-idle); background: color-mix(in srgb, var(--st-idle) 14%, transparent); }
.st-queued { color: var(--st-queued); background: color-mix(in srgb, var(--st-queued) 16%, transparent); }
.st-running { color: var(--st-running); background: color-mix(in srgb, var(--st-running) 16%, transparent); }
.st-running .dot { animation: pulse 1.3s infinite; }
.st-confirmed { color: var(--st-confirmed); background: color-mix(in srgb, var(--st-confirmed) 16%, transparent); }
.st-refuted { color: var(--st-refuted); background: color-mix(in srgb, var(--st-refuted) 14%, transparent); }
.st-blocked { color: var(--st-blocked); background: color-mix(in srgb, var(--st-blocked) 16%, transparent); }

/* severity + oracle shields */
.sev { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: var(--r-1); font-size: var(--fs-xs); font-weight: 700; }
.sev-critical { color: var(--sev-critical); background: color-mix(in srgb, var(--sev-critical) 15%, transparent); }
.sev-high { color: var(--sev-high); background: color-mix(in srgb, var(--sev-high) 15%, transparent); }
.sev-medium { color: var(--sev-medium); background: color-mix(in srgb, var(--sev-medium) 15%, transparent); }
.sev-low { color: var(--sev-low); background: color-mix(in srgb, var(--sev-low) 15%, transparent); }
.sev-info { color: var(--sev-info); background: color-mix(in srgb, var(--sev-info) 16%, transparent); }
.shield { display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-xs); font-weight: 700; color: var(--st-confirmed);
  border: 1px solid color-mix(in srgb, var(--st-confirmed) 40%, var(--border)); border-radius: var(--r-1); padding: 2px 8px; }
.shield.lead { color: var(--st-queued); border-color: var(--owner-line); }

/* tables ------------------------------------------------------------------- */
table.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
table.tbl th { text-align: left; color: var(--text-2); font-weight: 600; font-size: var(--fs-micro); text-transform: uppercase;
  letter-spacing: var(--tracking-label); padding: 10px 12px; border-bottom: 1px solid var(--border); }
table.tbl td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.tbl tr.click { cursor: pointer; } table.tbl tr.click:hover td { background: var(--bg-2); }

/* live node (img.avif) ----------------------------------------------------- */
.node { background: var(--bg-1); border: 1.5px solid var(--border-strong); border-radius: var(--r-3); padding: var(--sp-4);
  min-width: 200px; box-shadow: var(--shadow-1); }
.node .node-h { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.node .node-t { font-weight: 700; font-size: var(--fs-md); }
.node .node-sub { color: var(--text-1); font-size: var(--fs-sm); }
.node .node-meta { display: flex; gap: 10px; margin-top: 10px; color: var(--text-2); font-size: var(--fs-xs); }
.node.running { border-color: color-mix(in srgb, var(--st-running) 60%, var(--border)); }
.node.running::before { content: ""; }
.node.confirmed { border-color: color-mix(in srgb, var(--st-confirmed) 55%, var(--border)); }
.node.queued { border-style: dashed; border-color: var(--owner-line); }
.node.blocked { border-color: color-mix(in srgb, var(--st-blocked) 55%, var(--border)); }

/* activity timeline row ---------------------------------------------------- */
.feed { display: flex; flex-direction: column; }
.trow { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; padding: 11px 8px; border-bottom: 1px solid var(--border); cursor: pointer; }
.trow:hover { background: var(--bg-2); }
.trow .ico { width: 30px; height: 30px; border-radius: var(--r-1); display: grid; place-items: center; background: var(--bg-2);
  color: var(--text-1); align-self: start; }
.trow .body .k { font-weight: 600; }
.trow .body .m { color: var(--text-1); font-size: var(--fs-sm); margin-top: 2px; }
.trow .meta { display: flex; align-items: center; gap: 8px; align-self: start; }
.trow .t { color: var(--text-2); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; white-space: nowrap; }
.trow.kind-refusal .ico { color: var(--st-blocked); background: color-mix(in srgb, var(--st-blocked) 14%, transparent); }
.trow.kind-finding .ico { color: var(--st-confirmed); background: color-mix(in srgb, var(--st-confirmed) 14%, transparent); }
.trow.kind-tool_call .ico, .trow.kind-action .ico { color: var(--st-running); background: color-mix(in srgb, var(--st-running) 14%, transparent); }
.trow.new { animation: fadein .4s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* approval card (owner-signed, inline) ------------------------------------- */
.approval { border: 1px solid var(--owner-line); background: var(--owner-dim); border-radius: var(--r-3); padding: var(--sp-4); }
.approval .ah { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.approval .ah .t { font-weight: 700; }
.approval .why { color: var(--text-1); font-size: var(--fs-sm); }
.approval .acts { display: flex; gap: var(--sp-2); margin-top: var(--sp-3); align-items: center; }
.approval .countdown { margin-left: auto; font-size: var(--fs-xs); color: var(--text-2); font-variant-numeric: tabular-nums; }

/* drawer ------------------------------------------------------------------- */
#drawer { position: fixed; top: 0; right: 0; height: 100vh; width: var(--drawer-w); max-width: 94vw; background: var(--bg-1);
  border-left: 1px solid var(--border-strong); box-shadow: var(--shadow-2); transform: translateX(100%); transition: transform .2s ease;
  z-index: 60; display: flex; flex-direction: column; }
#drawer.open { transform: translateX(0); }

/* dockable / resizable / maximizable activity panel -------------------------- */
/* Bottom dock: full width, height driven by --drawer-h (or an inline style JS sets while dragging). */
#drawer.dock-bottom { top: auto; left: 0; right: 0; bottom: 0; width: auto; max-width: none;
  height: var(--drawer-h, 46vh); max-height: 94vh; border-left: none; border-top: 1px solid var(--border-strong);
  transform: translateY(100%); }
#drawer.dock-bottom.open { transform: translateY(0); }
/* Maximized: fill the viewport regardless of dock, and the drag handle stands down. */
#drawer.max { top: 0; left: 0; right: 0; bottom: 0; width: auto !important; height: auto !important;
  max-width: none; max-height: none; }
/* The drag strip — left edge when side-docked, top edge when bottom-docked. */
#drawer .dz { position: absolute; z-index: 2; background: transparent; touch-action: none; }
#drawer .dz:hover, #drawer .dz.active { background: var(--border-strong); opacity: .8; }
#drawer:not(.dock-bottom) .dz { left: -3px; top: 0; width: 8px; height: 100%; cursor: ew-resize; }
#drawer.dock-bottom .dz { top: -3px; left: 0; height: 8px; width: 100%; cursor: ns-resize; }
#drawer.max .dz { display: none; }
#drawer.resizing { transition: none; user-select: none; }
#drawer .dh .iconbtn.on { color: var(--text-0); background: var(--bg-3); }

#drawer .dh { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-5); border-bottom: 1px solid var(--border); }
#drawer .dh h2 { font-size: var(--fs-xl); flex: 1; }
#drawer .db { padding: var(--sp-5); overflow-y: auto; }
.dsection { margin-bottom: var(--sp-5); }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 14px; font-size: var(--fs-sm); }
.kv .k { color: var(--text-2); } .kv .v { color: var(--text-0); word-break: break-word; }
pre.code { background: var(--bg-0); border: 1px solid var(--border); border-radius: var(--r-1); padding: var(--sp-4);
  font-family: var(--font-mono); font-size: var(--fs-xs); overflow-x: auto; color: var(--text-1); white-space: pre-wrap; }

/* wizard ------------------------------------------------------------------- */
.wizard { display: grid; grid-template-columns: 220px 1fr 320px; gap: var(--sp-6); max-width: var(--content-max); margin: 0 auto; }
@media (max-width: 1100px) { .wizard { grid-template-columns: 1fr; } .wizard .steprail, .wizard .summary { display: none; } }
.steprail { display: flex; flex-direction: column; gap: var(--sp-1); }
.steprail .step { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-2); color: var(--text-2); }
.steprail .step.on { background: var(--bg-2); color: var(--text-0); }
.steprail .step.done { color: var(--st-confirmed); }
.steprail .step .num { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid currentColor; display: grid; place-items: center; font-size: var(--fs-xs); font-weight: 700; }
.wizbody h2 { font-size: var(--fs-2xl); margin-bottom: 8px; }
.wizbody .helper { color: var(--text-1); font-size: var(--fs-md); margin-bottom: var(--sp-5); max-width: 60ch; }
.choice-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-3); }
@media (max-width: 720px) { .choice-grid { grid-template-columns: 1fr; } }
.choice { border: 1.5px solid var(--border); background: var(--bg-1); border-radius: var(--r-3); padding: var(--sp-5); cursor: pointer; display: flex; gap: var(--sp-3); align-items: flex-start; }
.choice:hover { border-color: var(--border-strong); background: var(--bg-2); }
.choice.sel { border-color: var(--text-0); box-shadow: inset 0 0 0 1px var(--text-0); }
.choice.defense.sel { border-color: var(--owner); box-shadow: inset 0 0 0 1px var(--owner); }
.choice .cico { width: 40px; height: 40px; border-radius: var(--r-2); background: var(--bg-2); display: grid; place-items: center; flex: 0 0 auto; }
.choice .ct { font-weight: 700; font-size: var(--fs-lg); }
.choice .cd { color: var(--text-1); font-size: var(--fs-sm); margin-top: 3px; }
.field { margin-bottom: var(--sp-4); }
.field label { display: block; font-weight: 600; margin-bottom: 6px; }
.field .hint { color: var(--text-2); font-size: var(--fs-sm); margin-top: 6px; }
input[type=text], input[type=url], input[type=password], select, textarea {
  width: 100%; background: var(--bg-2); border: 1px solid var(--border-strong); color: var(--text-0); border-radius: var(--r-2);
  padding: 11px 14px; font-size: var(--fs-md); font-family: inherit; }
textarea { min-height: 80px; resize: vertical; }

/* the REAL tool picker ("Run one tool") — one row per tool the engine's roster knows about.
   A tool this wizard cannot start is NOT hidden: it renders as a plain (non-button) `.off` row that
   still carries its install status, its control surface and the honest reason, so an installed tool
   never just disappears and the operator is never left hunting for it. */
.toolpick-list { display: flex; flex-direction: column; gap: var(--sp-2); }
.toolpick { display: block; width: 100%; text-align: left; font: inherit; color: var(--text-0);
  border: 1.5px solid var(--border); background: var(--bg-1); border-radius: var(--r-2);
  padding: var(--sp-3) var(--sp-4); cursor: pointer; }
.toolpick:hover { border-color: var(--border-strong); background: var(--bg-2); }
.toolpick.sel { border-color: var(--st-confirmed); box-shadow: inset 0 0 0 1px var(--st-confirmed); }
.toolpick.off { cursor: default; background: var(--bg-0); border-style: dashed; color: var(--text-2); }
.toolpick.off:hover { border-color: var(--border); background: var(--bg-0); }
.toolpick .tp-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolpick .tp-n { font-weight: 700; font-size: var(--fs-md); }
.toolpick .tp-p { color: var(--text-1); font-size: var(--fs-sm); margin-top: 4px; }
.toolpick .tp-w { color: var(--text-2); font-size: var(--fs-xs); margin-top: 5px; }
.toolpick .tp-w.yes { color: var(--st-confirmed); }

.summary { position: sticky; top: 0; align-self: start; }
.wizfoot { display: flex; align-items: center; gap: var(--sp-3); margin-top: var(--sp-6); }
.wizfoot .safenote { display: flex; align-items: center; gap: 8px; color: var(--st-confirmed); font-size: var(--fs-sm); font-weight: 600; }
.wizfoot .grow { flex: 1; }

/* misc --------------------------------------------------------------------- */
.legend { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; padding: var(--sp-3) var(--sp-4);
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--r-2); font-size: var(--fs-sm); color: var(--text-1); }
.empty { padding: var(--sp-8) var(--sp-5); text-align: center; color: var(--text-2); border: 1px dashed var(--border); border-radius: var(--r-3); }
.empty .big { font-size: var(--fs-xl); color: var(--text-1); font-weight: 700; margin-bottom: 8px; }
.ring { --p: 0; width: 44px; height: 44px; border-radius: 50%;
  background: conic-gradient(var(--st-running) calc(var(--p) * 1%), var(--bg-3) 0); display: grid; place-items: center; }
.ring::after { content: ""; width: 34px; height: 34px; border-radius: 50%; background: var(--bg-1); }
.row-flex { display: flex; align-items: center; gap: var(--sp-2); }
.gap-lg { gap: var(--sp-4); }
.stack { display: flex; flex-direction: column; gap: var(--sp-4); }

/* settings + safety (owner plane) ----------------------------------------- */
.owner-banner { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--owner-line); border-left: 3px solid var(--owner); background: var(--owner-dim);
  border-radius: var(--r-2); color: var(--text-1); font-size: var(--fs-sm); }
.owner-banner .glyph { color: var(--owner); flex: 0 0 auto; }
.acts { display: flex; gap: var(--sp-2); align-items: center; margin-top: var(--sp-4); flex-wrap: wrap; }
.set-status { display: flex; align-items: center; gap: 10px; font-size: var(--fs-sm); color: var(--text-1);
  padding: 10px 12px; border-radius: var(--r-2); border: 1px solid var(--border); background: var(--bg-2); }
.set-status .glyph { flex: 0 0 auto; }
.set-status.ok { color: var(--st-confirmed); border-color: color-mix(in srgb, var(--st-confirmed) 35%, var(--border)); }
.set-status.off { color: var(--text-1); border-color: var(--owner-line); }
.mono { font-family: var(--font-mono); }
.dim { color: var(--text-2); }
.pill.sm.ok { color: var(--st-confirmed); border-color: color-mix(in srgb, var(--st-confirmed) 40%, var(--border)); }
.pill.sm.warn { color: var(--st-queued); border-color: color-mix(in srgb, var(--st-queued) 45%, var(--border)); }

/* defense (AEGIS) — SEMANTIC INVERSION: a confirmed verdict is an ATTACK (danger), never green ------ */
.feed-row.verdict-danger { border-left: 3px solid var(--st-blocked); padding-left: 8px; }
.feed-row.verdict-warn { border-left: 3px solid var(--st-queued); padding-left: 8px; }
.vbadge { flex: 0 0 auto; font-size: var(--fs-xs); font-weight: 800; letter-spacing: .04em; padding: 3px 8px;
  border-radius: var(--r-1); text-transform: uppercase; border: 1px solid var(--border); color: var(--text-2); }
.vbadge.danger { color: #fff; background: var(--st-blocked); border-color: var(--st-blocked); }
.vbadge.warn { color: var(--st-queued); background: color-mix(in srgb, var(--st-queued) 16%, transparent); border-color: color-mix(in srgb, var(--st-queued) 45%, var(--border)); }
.vbadge.muted { color: var(--text-2); }
.actor-row { padding: 10px 0; border-bottom: 1px solid var(--border); }
.actor-row:last-child { border-bottom: none; }
.actor-row .actor-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.actor-row .actor-meta { font-size: var(--fs-xs); margin-top: 4px; }
.bar { height: 8px; border-radius: 999px; background: var(--bg-3); overflow: hidden; margin: 6px 0 2px; }
.bar-fill { height: 100%; background: var(--st-confirmed); border-radius: 999px; }
.bar-fill.mid { background: var(--st-queued); }
.bar-fill.hi { background: var(--st-blocked); }

/* fixes — the horizontal gated remediation ladder + fixable-finding cards --------------------- */
.ladder { display: flex; gap: var(--sp-2); align-items: stretch; padding-bottom: 4px; }
.ladder-stage { flex: 1 0 150px; min-width: 150px; border: 1px solid var(--border); border-radius: var(--r-2);
  padding: 10px 12px; background: var(--bg-2); }
.ladder-stage .ls-h { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 6px; }
.ladder-stage .ls-n { width: 20px; height: 20px; border-radius: 50%; background: var(--bg-3); color: var(--text-1);
  display: grid; place-items: center; font-size: var(--fs-xs); flex: 0 0 auto; }
.ladder-stage .ls-w { font-size: var(--fs-xs); line-height: 1.45; }
.fix-card { border: 1px solid var(--border); border-radius: var(--r-2); padding: 12px 14px; background: var(--bg-1); }
.fix-card .fix-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fix-card .fix-rem { margin-top: 8px; }
.fix-card .fix-rem .label { display: block; margin-bottom: 2px; }
.fix-card .fix-rem p { color: var(--text-1); font-size: var(--fs-sm); line-height: 1.5; }
.btn.sm { padding: 6px 12px; font-size: var(--fs-sm); }
.tile .foot.ok { color: var(--st-confirmed); } .tile .foot.warn { color: var(--st-queued); } .tile .foot.danger { color: var(--st-blocked); }
.cap-row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  padding: 10px 0; border-bottom: 1px solid var(--border); }
.cap-row:last-child { border-bottom: none; }
.cap-row .cap-l { display: flex; align-items: center; gap: 12px; }
.feed-row { display: flex; align-items: center; gap: 10px; padding: 8px 2px; border-bottom: 1px solid var(--border); font-size: var(--fs-sm); }
.feed-row:last-child { border-bottom: none; }
.feed-row .fr-t { flex: 1; color: var(--text-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-row .fr-seq { flex: 0 0 auto; font-size: var(--fs-xs); }

/* modal — the two chat decisions that must NOT be a window.prompt: the egress consent (it has to show
   a counted list of what leaves the machine) and the link picker (it has to show real chats to pick
   from). Escape / backdrop / ✕ all cancel; z-index sits above the drawer (60) and below toasts (80). */
.vmodal { position: fixed; inset: 0; z-index: 70; background: rgba(0, 0, 0, .55); display: grid; place-items: center;
  padding: var(--sp-5); animation: fadein .15s ease; }
.vmodal-card { background: var(--bg-1); border: 1px solid var(--border-strong); border-radius: var(--r-3);
  box-shadow: var(--shadow-2); width: min(660px, 96vw); max-height: 86vh; display: flex; flex-direction: column; }
.vmodal-h { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--border); }
.vmodal-h h3 { font-size: var(--fs-lg); flex: 1; min-width: 0; }
.vmodal-b { padding: var(--sp-5); overflow-y: auto; }
.vmodal-b p { color: var(--text-1); line-height: 1.55; }
.vmodal-f { display: flex; gap: var(--sp-2); justify-content: flex-end; flex-wrap: wrap;
  padding: var(--sp-4) var(--sp-5); border-top: 1px solid var(--border); }

/* text inputs built by V.h carry .input (no type attribute reaches the element selector above) */
.input { background: var(--bg-2); border: 1px solid var(--border-strong); color: var(--text-0);
  border-radius: var(--r-2); padding: 9px 12px; font-size: var(--fs-sm); font-family: inherit; }

/* chat attachments — a chip is a POINTER to material (name, size, file count, progress), never bytes */
.chip { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 5px 10px;
  border: 1px solid var(--border-strong); border-radius: var(--r-pill); background: var(--bg-2); font-size: var(--fs-xs); }
.chip .nm { font-weight: 600; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip .meta { color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.chip .glyph { width: 15px; height: 15px; flex: 0 0 auto; opacity: .8; }
.chip .glyph svg { width: 15px; height: 15px; }
.chip .x { background: transparent; border: 0; color: var(--text-2); cursor: pointer; padding: 0 2px; font-size: 13px; line-height: 1; }
.chip .x:hover { color: var(--text-0); }
.chip .bar { width: 72px; margin: 0; flex: 0 0 auto; }
.chip.busy { border-style: dashed; }
.chip.bad { border-color: color-mix(in srgb, var(--st-blocked) 50%, var(--border)); color: var(--st-blocked); }
.chip.sent { opacity: .65; }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
/* a refusal EXPLAINS itself — full text, wrapped, never truncated to a shrug */
.refusal { border: 1px solid color-mix(in srgb, var(--st-blocked) 45%, var(--border));
  background: color-mix(in srgb, var(--st-blocked) 8%, transparent); border-radius: var(--r-2);
  padding: 10px 12px; font-size: var(--fs-sm); color: var(--text-0); white-space: pre-wrap; word-break: break-word; }
.dropzone.over { border-color: var(--st-running) !important;
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--st-running) 35%, transparent); }
.picker-row { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--r-2); background: var(--bg-1); color: var(--text-0);
  cursor: pointer; font-family: inherit; font-size: var(--fs-sm); }
.picker-row:hover { background: var(--bg-2); border-color: var(--border-strong); }
.picker-row .pn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }

/* chat composer: the SYSTEM-WIDE model/effort strip, and the one-tool picker.
   The strip is boxed and captioned because it sits above the transcript and changes the ENGINE, not
   this conversation — unlabelled next to a chat, those two buttons read as "answer me with this". */
.chat-sysctl { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 8px;
  padding: 10px 12px; border: 1px dashed var(--owner-line); border-radius: var(--r-2); background: var(--owner-dim); }
.chat-sysctl .hint.wide { flex: 1 1 100%; color: var(--text-1); font-size: var(--fs-sm); }
.chat-sysctl select { width: auto; min-width: 0; }
.chat-toolrow { display: flex; gap: 8px; margin-top: 8px; align-items: center; flex-wrap: wrap; }
.chat-toolrow select { width: auto; }
.chat-toolrow .hint { flex: 1 1 260px; color: var(--text-2); font-size: var(--fs-xs); }
/* agentic-engine opt-out toggle in the composer */
/* E3 — the model picker's consequence line: the sovereignty trade-off, visible at the moment of choosing. */
.chat-model-note { font-size: var(--fs-xs); color: var(--text-2); margin-top: 4px; }

/* ── Chat screen — professional layout system ─────────────────────────────────
   Hierarchy: sessions rail · main column (transcript fills → docked composer card → secondary context →
   collapsed engine settings). Layout lives here in classes, not scattered inline styles. */
#chat-wrap { display: flex; gap: 16px; align-items: stretch; margin-top: 12px; min-height: 62vh; }
#chat-sessions { width: 244px; flex: 0 0 244px; display: flex; flex-direction: column; gap: 8px; }
#chat-main { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; gap: 10px; }
@media (max-width: 860px) { #chat-wrap { flex-direction: column; } #chat-sessions { width: auto; flex: 0 0 auto; } }
#chat-list.chat-transcript { flex: 1 1 auto; overflow-y: auto; padding: 10px; border: 1px solid var(--border);
  border-radius: var(--r-3); background: var(--bg-1); min-height: 260px; }

/* the docked composer CARD — attachments · run options · input · usage · footer, one cohesive unit */
.chat-dock { border: 1px solid var(--border-strong); border-radius: var(--r-3); background: var(--bg-2);
  padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow-1); }
.chat-composer { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; margin: 0; }
.chat-composer .input { flex: 1 1 auto; min-width: 0; }   /* the message box grows to fill the row */
.chat-usage { margin: 0; font-size: var(--fs-xs); color: var(--text-2); font-variant-numeric: tabular-nums; }
.chat-foot { display: flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--text-2); }
.chat-foot .glyph svg { width: 13px; height: 13px; }
.chat-agentic { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs);
  color: var(--text-1); white-space: nowrap; cursor: pointer; user-select: none; }
.chat-agentic input { width: auto; margin: 0; }

/* run options — a compact disclosure (one line by default, expandable) */
.chat-runopts { margin: 0; padding: 0; border: 0; background: transparent; }
.chat-runopts > summary.chat-runopts-cap { display: flex; align-items: center; gap: 6px; cursor: pointer;
  font-size: var(--fs-xs); color: var(--text-2); text-transform: uppercase; letter-spacing: .04em;
  font-weight: 600; padding: 2px 0; list-style: none; }
.chat-runopts > summary::-webkit-details-marker { display: none; }
.chat-runopts > summary .glyph svg { width: 13px; height: 13px; }
.chat-runopts-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding-top: 8px; }

/* secondary context (plan checklist + linked chats) + the collapsed system-wide engine settings */
.chat-context { display: flex; flex-direction: column; gap: 10px; }
.chat-context:empty { display: none; }
.chat-engine-settings { border: 1px dashed var(--border); border-radius: var(--r-2); background: var(--bg-1); padding: 6px 10px; }
.chat-engine-settings > summary { cursor: pointer; font-size: var(--fs-xs); color: var(--text-2);
  display: flex; align-items: center; gap: 6px; list-style: none; }
.chat-engine-settings > summary::-webkit-details-marker { display: none; }
.chat-engine-settings > summary .glyph svg { width: 13px; height: 13px; }
.chat-engine-settings[open] { padding-bottom: 10px; }
.chat-engine-settings[open] > summary { margin-bottom: 8px; }

/* hypothesis ledger (Phase C): suspicions recorded from the chat; each closes itself when an oracle
   confirms a matching finding. Open = the lead register; confirmed = the green FACT shield. */
.hyp-panel { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r-2); background: var(--bg-1); }
.hyp-panel .label { font-weight: 600; }
.hyp-row { padding: 8px 0; border-top: 1px solid var(--border); }
.hyp-row:first-of-type { border-top: 0; }

/* grounded-in legend (A2): the four sources of an answer must LOOK different, and model inference must
   never wear evidence's clothes. A chat answer is a LEAD, so these registers are deliberately NOT the
   green confirmed-finding shield (.shield) — attached code reads neutral/blue, a linked chat reads
   violet. Anything uncited is model inference, marked by the Lead badge on the bubble. */
.chat-srcs { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.chat-srcs-lbl { font-size: var(--fs-xs); color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; }
.chat-src-row { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.chat-src { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: var(--r-pill);
  font-size: var(--fs-xs); border: 1px solid var(--border-strong); background: var(--bg-2); max-width: 100%; }
.chat-src .glyph { width: 13px; height: 13px; flex: 0 0 auto; opacity: .85; }
.chat-src .glyph svg { width: 13px; height: 13px; }
.chat-src .rf { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: var(--mono, ui-monospace, monospace); }
.chat-src.src-attached { border-color: color-mix(in srgb, var(--st-running, #4a90d9) 45%, var(--border));
  color: color-mix(in srgb, var(--st-running, #4a90d9) 80%, var(--text-0)); }
.chat-src.src-linked { border-color: color-mix(in srgb, #8b7bd8 45%, var(--border));
  color: color-mix(in srgb, #8b7bd8 80%, var(--text-0)); }

/* propose-gated-actions (A1): the model's suggested next steps, as clickable chips. A chip is INERT —
   the click runs the same gated launcher / navigation as everywhere else; the model proposes, the
   operator's click through the gate is what acts. Kept visually distinct from an attachment .chip. */
.chat-props { padding-top: 10px; border-top: 1px solid var(--border); }
.chat-prop-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: stretch; }
.chat-prop { display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; cursor: pointer;
  border: 1px solid var(--border-strong); border-radius: var(--r-pill); background: var(--bg-1);
  color: var(--text-0); font-family: inherit; font-size: var(--fs-xs); font-weight: 600; text-align: left; }
.chat-prop:hover:not(:disabled) { background: var(--bg-2); border-color: var(--primary-bg, var(--border-strong)); }
.chat-prop:disabled { opacity: .5; cursor: default; }
.chat-prop .glyph { width: 15px; height: 15px; flex: 0 0 auto; opacity: .85; }
.chat-prop .glyph svg { width: 15px; height: 15px; }
.chat-prop .pl { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }

/* D2b — the codebase panel on a launched CODEBASE bubble: propose a dev-mode edit (reviewed as a diff),
   apply it (the operator's click is the approval), and run tests in the no-net sandbox. */
.chat-cb { display: flex; flex-direction: column; gap: 8px; }
.chat-cb .cb-head { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; }
.chat-cb .cb-head .glyph { width: 15px; height: 15px; flex: 0 0 auto; opacity: .85; }
.chat-cb .cb-head .glyph svg { width: 15px; height: 15px; }
.chat-cb .cb-path { font-family: var(--mono, ui-monospace, monospace); font-size: var(--fs-xs); font-weight: 400;
  color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.chat-cb .cb-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* the unified-diff viewer — add/remove/hunk-coloured, monospace, its OWN horizontal scroll so a wide
   line never scrolls the page body. Content is inserted as text nodes (never innerHTML) — see diffView(). */
.chat-diff { margin: 0; border: 1px solid var(--border); border-radius: var(--r-2); background: var(--bg-1);
  font-family: var(--mono, ui-monospace, monospace); font-size: var(--fs-xs); line-height: 1.45;
  max-height: 340px; overflow: auto; padding: 6px 0; }
.chat-diff .diff-line { padding: 0 10px; white-space: pre; }
.chat-diff .diff-ctx  { color: var(--text-0); }
.chat-diff .diff-file { color: var(--text-2); font-weight: 600; }
.chat-diff .diff-hunk { color: color-mix(in srgb, var(--st-running, #4a90d9) 80%, var(--text-0)); background: var(--bg-2); }
.chat-diff .diff-add  { background: color-mix(in srgb, #2ea043 16%, transparent);
  color: color-mix(in srgb, #2ea043 82%, var(--text-0)); }
.chat-diff .diff-del  { background: color-mix(in srgb, #e5484d 16%, transparent);
  color: color-mix(in srgb, #e5484d 82%, var(--text-0)); }

/* command palette (⌘K) -------------------------------------------------------
   z-index 70 = the modal layer: above the drawer (60) and the process box (55), below toasts (80),
   so a toast fired by an action stays readable. Pure overlay — it never enters the page flow. */
.pal-host { position: fixed; inset: 0; z-index: 70; background: rgba(0, 0, 0, .55);
  display: grid; place-items: start center; padding-top: 12vh; }
.pal-box { width: min(680px, 92vw); background: var(--bg-1); border: 1px solid var(--border-strong);
  border-radius: var(--r-2); box-shadow: var(--shadow-2); overflow: hidden; }
.pal-head { display: flex; align-items: center; gap: 10px; padding: 12px var(--sp-5);
  border-bottom: 1px solid var(--border); }
.pal-head .glyph { width: 18px; height: 18px; flex: 0 0 auto; opacity: .7; }
.pal-input { flex: 1 1 auto; min-width: 0; background: transparent; border: 0; outline: none;
  color: var(--text-0); font-size: var(--fs-lg); font-family: inherit; }
.pal-list { max-height: 46vh; overflow-y: auto; }
.pal-row { display: flex; align-items: center; gap: 12px; padding: 9px var(--sp-5); cursor: pointer; }
.pal-row .glyph { width: 18px; height: 18px; flex: 0 0 auto; opacity: .8; }
.pal-row:hover, .pal-row.on { background: var(--bg-2); }
.pal-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-kind { flex: 0 0 auto; color: var(--text-2); font-size: var(--fs-xs); text-transform: uppercase;
  letter-spacing: .04em; }
.pal-foot { padding: 8px var(--sp-5); border-top: 1px solid var(--border); color: var(--text-2);
  font-size: var(--fs-xs); }
.pal-list .empty { padding: 18px var(--sp-5); color: var(--text-2); font-size: var(--fs-sm); }
/* a pill that is also a control (the engaged kill-switch, which opens Safety to release it) */
.pill-act { cursor: pointer; border-width: 1px; font: inherit; font-size: var(--fs-sm); }
.pill-act:hover { filter: brightness(1.12); }

/* toasts */
#toasts { position: fixed; bottom: var(--sp-5); right: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-2); z-index: 80; }
.toast { background: var(--bg-2); border: 1px solid var(--border-strong); border-radius: var(--r-2); padding: 12px 16px; box-shadow: var(--shadow-2);
  font-size: var(--fs-sm); min-width: 240px; animation: fadein .25s ease; }
.toast.err { border-color: color-mix(in srgb, var(--st-blocked) 50%, var(--border)); }

/* WS0: reusable percentage progress bar (docker build/pull/health/plane-start + any long op) */
.pbar { display: flex; flex-direction: column; gap: 6px; margin: var(--sp-2) 0; }
.pbar-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); }
.pbar-label { font-size: var(--fs-sm); color: var(--text-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pbar-pct { font-size: var(--fs-sm); font-variant-numeric: tabular-nums; color: var(--text-0); font-weight: 700; }
.pbar-track { height: 8px; border-radius: var(--r-pill); background: var(--bg-3); border: 1px solid var(--border); overflow: hidden; }
.pbar-fill { height: 100%; width: 0; border-radius: var(--r-pill); background: var(--st-running);
  transition: width .3s ease, background-color .2s ease; }
.pbar-done .pbar-fill { background: var(--st-confirmed); }
.pbar-err .pbar-fill { background: var(--st-blocked); }
.pbar-err .pbar-label { color: var(--st-blocked); }

/* WS0: persistent (route-surviving) error banner — a hard failure the operator must see and dismiss */
#error-banner { position: fixed; top: calc(var(--topbar-h) + 8px); left: 50%; transform: translateX(-50%);
  z-index: 90; max-width: min(720px, 92vw); }
#error-banner .eb-row { display: flex; align-items: flex-start; gap: var(--sp-3);
  background: var(--bg-1); border: 1px solid color-mix(in srgb, var(--st-blocked) 55%, var(--border));
  border-radius: var(--r-2); padding: 10px 12px; box-shadow: var(--shadow-2); }
#error-banner .eb-ico { flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%;
  background: var(--st-blocked); color: #fff; font-weight: 800; display: grid; place-items: center; font-size: 13px; }
#error-banner .eb-msg { flex: 1 1 auto; min-width: 0; font-size: var(--fs-sm); color: var(--text-0); }
#error-banner .eb-detail { margin-top: 3px; color: var(--text-1); font-size: var(--fs-micro); word-break: break-word; }
#error-banner .eb-x { flex: 0 0 auto; background: transparent; border: none; color: var(--text-1);
  font-size: 18px; line-height: 1; cursor: pointer; padding: 0 4px; }
#error-banner .eb-x:hover { color: var(--text-0); }

/* SIGIL on-screen HUD (S4) — a small bottom-LEFT overlay of SIGIL's state; clones the #toasts fixed host,
   capped at 300px so it never obscures the workspace. Reuses .pill for the state chip (idle/listening/
   thinking/speaking → idle/live/reconnect/owner tones). */
#sigil-hud { position: fixed; bottom: var(--sp-5); left: var(--sp-5); max-width: 300px; z-index: 80;
  display: flex; flex-direction: column; gap: var(--sp-2); }
.sigil-hud-card { background: var(--bg-2); border: 1px solid var(--border-strong); border-radius: var(--r-2);
  padding: 10px 12px; box-shadow: var(--shadow-2); max-width: 300px; animation: fadein .25s ease; }
.sigil-hud-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sigil-hud-btns { display: flex; gap: 2px; }
.sigil-hud-x { background: transparent; border: 0; color: var(--text-2); cursor: pointer; font-size: 15px;
  line-height: 1; padding: 2px 7px; border-radius: var(--r-1); }
.sigil-hud-x:hover { background: var(--bg-1); color: var(--text-1); }
.sigil-hud-line { margin-top: 7px; font-size: var(--fs-xs); color: var(--text-2); overflow: hidden;
  text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pill.reconnect .dot, .pill.owner .dot { animation: pulse 1.4s ease-in-out infinite; }

/* W5 process box — a fixed, collapsible, RESIZABLE live-activity overlay (bottom-right). It floats above
   the page but is never in the document flow, so it cannot shift the workspace. z-index 55 keeps it BELOW
   the detail drawer (60), the modal (70) and toasts (80) — an activity ticker must never occlude or steal
   clicks from an interactive panel. */
#process-box { position: fixed; right: var(--sp-5); bottom: var(--sp-5); z-index: 55;
  display: flex; flex-direction: column; align-items: flex-end; }
.pb-pill { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: var(--r-pill);
  border: 1px solid var(--border-strong); background: var(--bg-2); color: var(--text-1); cursor: pointer;
  font: inherit; font-size: var(--fs-sm); box-shadow: var(--shadow-2); }
.pb-pill:hover { color: var(--text-0); }
.pb-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-2); }
.pb-pill.live .dot { background: var(--st-running); animation: pulse 1.4s ease-in-out infinite; }
.pb-card { width: 380px; max-width: 96vw; height: 340px; min-width: 260px; min-height: 150px; max-height: 90vh;
  display: flex; flex-direction: column; background: var(--bg-2); border: 1px solid var(--border-strong);
  border-radius: var(--r-2); box-shadow: var(--shadow-2); overflow: hidden; position: relative; animation: fadein .2s ease; }
/* #2 RESIZE: the box is anchored bottom-right, so a native bottom-right `resize` handle grows off-screen and
   is unusable. A custom TOP-LEFT grip (dragged up/left) grows the box INTO the screen; size is persisted. */
.pb-grip { position: absolute; top: 0; left: 0; width: 18px; height: 18px; cursor: nwse-resize; z-index: 3;
  touch-action: none; }
.pb-grip::before { content: ""; position: absolute; top: 4px; left: 4px; width: 8px; height: 8px;
  border-top: 2px solid var(--text-2); border-left: 2px solid var(--text-2); border-radius: 1px; }
.pb-grip:hover::before { border-color: var(--owner); }
.pb-card.pb-max { width: 96vw !important; height: 90vh !important; }
/* #3 THINKING rows: show the model's full plain-words rationale (wrap, don't ellipsis-truncate). */
.pb-row.pb-think-row .pb-m { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.45; }
.pb-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px;
  border-bottom: 1px solid var(--border); flex: 0 0 auto; }
.pb-title { display: flex; align-items: center; gap: 7px; min-width: 0; }
.pb-title .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-2); flex: 0 0 auto; }
.pb-title .dot.pb-on { background: var(--st-running); animation: pulse 1.4s ease-in-out infinite; }
.pb-run { color: var(--text-2); font-size: var(--fs-xs); overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; max-width: 150px; }
.pb-btns { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.pb-x { background: transparent; border: 0; color: var(--text-2); cursor: pointer; font-size: 15px;
  line-height: 1; padding: 2px 8px; border-radius: var(--r-1); }
.pb-x:hover { color: var(--text-0); background: var(--bg-3); }
/* W4 run-control buttons on the box: Cancel (danger) while running, Resume/Retry (accent) once ended. */
.pb-act { font: inherit; font-size: var(--fs-xs); font-weight: 700; line-height: 1; cursor: pointer;
  padding: 3px 9px; border-radius: var(--r-1); border: 1px solid var(--border); background: transparent;
  color: var(--text-1); }
.pb-act.pb-cancel { color: var(--st-blocked); border-color: color-mix(in srgb, var(--st-blocked) 45%, var(--border)); }
.pb-act.pb-cancel:hover { background: color-mix(in srgb, var(--st-blocked) 15%, transparent); border-color: var(--st-blocked); }
.pb-act.pb-retry { color: var(--owner); border-color: var(--owner-line); }
.pb-act.pb-retry:hover { background: var(--owner-dim); border-color: var(--owner); }
.pb-act:focus-visible { outline: 2px solid var(--owner); outline-offset: 1px; }
.pb-step { padding: 6px 10px; font-size: var(--fs-xs); color: var(--text-1); border-bottom: 1px solid var(--border);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 0 0 auto; }
/* operator ask: a clear terminal "Done" — green + bold when the followed run has finished. */
.pb-step.pb-done { color: var(--st-confirmed); font-weight: 700; }
.pb-step.pb-paused { color: var(--st-queued); font-weight: 700; }
.pb-feed { flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; padding: 2px 0; }
.pb-empty { padding: 18px 14px; color: var(--text-2); font-size: var(--fs-sm); text-align: center; line-height: 1.5; }
/* S3: per-message actions (copy / edit-&-resend / regenerate) — a subtle hover row */
.msg-actions { display: flex; gap: 4px; margin-top: 6px; opacity: 0; transition: opacity .12s ease; }
div:hover > div > .msg-actions, .msg-actions:focus-within { opacity: 1; }
.msg-act { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-xs); color: var(--text-2);
  background: transparent; border: 1px solid transparent; border-radius: var(--r-1); padding: 2px 6px; cursor: pointer; }
.msg-act:hover { color: var(--text-0); background: var(--bg-3); border-color: var(--border); }
.msg-act .glyph svg { width: 14px; height: 14px; }
/* S2: click-to-pick answers for an agent question (+ "Other → type your own") */
.answer-options { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.answer-options .btn.sm { font-size: var(--fs-xs); }
.btn.ghost { background: transparent; border: 1px dashed var(--border-strong); }
.btn.ghost:hover { background: var(--bg-3); }
/* S6: composer slash-command menu */
.slash-menu { background: var(--bg-1); border: 1px solid var(--border-strong); border-radius: var(--r-2);
  box-shadow: var(--shadow-2); max-height: 300px; overflow-y: auto; padding: 4px; }
.slash-item { display: flex; gap: 10px; align-items: baseline; width: 100%; text-align: left; background: transparent;
  border: 0; border-radius: var(--r-1); padding: 7px 10px; cursor: pointer; color: var(--text-0); }
.slash-item:hover { background: var(--bg-3); }
.slash-cmd { font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--accent, var(--text-0)); white-space: nowrap; }
.slash-desc { font-size: var(--fs-xs); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; }
/* S5: a tool step in the process box is clickable → opens the command/output card */
.pb-row.pb-clickable { cursor: pointer; }
.pb-row.pb-clickable:hover { background: var(--bg-3); }
/* S1: pending-approval cards inside the process box (chat approval interrupt) */
.pb-approvals { flex: 0 0 auto; max-height: 55%; overflow-y: auto; border-bottom: 2px solid var(--owner-line);
  padding: 10px; background: var(--owner-dim); }
.pb-approvals-h { display: flex; align-items: center; gap: 6px; font-size: var(--fs-xs); font-weight: 700;
  color: var(--owner); margin-bottom: 8px; text-transform: uppercase; letter-spacing: .04em; }
.pb-approvals-h .dot, .pb-approvals-h svg { animation: pulse 1.4s ease-in-out infinite; }
.pb-row { display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; padding: 5px 10px;
  border-bottom: 1px solid var(--border); animation: fadein .3s ease; }
.pb-row .pb-ico { width: 20px; height: 20px; display: grid; place-items: center; color: var(--text-2); }
.pb-body { min-width: 0; }
.pb-k { font-size: var(--fs-xs); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.pb-m { color: var(--text-1); font-size: var(--fs-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-t { color: var(--text-2); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; white-space: nowrap; align-self: start; }
.pb-tag { font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: var(--r-pill); text-transform: uppercase; letter-spacing: .02em; }
.pb-tag.pb-blocked { color: var(--st-blocked); background: color-mix(in srgb, var(--st-blocked) 16%, transparent); }
.pb-tag.pb-failed { color: var(--st-blocked); background: color-mix(in srgb, var(--st-blocked) 12%, transparent); }
.pb-row.pb-blocked .pb-ico, .pb-row.pb-failed .pb-ico { color: var(--st-blocked); }
.pb-tag.pb-approval { color: var(--st-queued); background: color-mix(in srgb, var(--st-queued) 16%, transparent); }
.pb-row.pb-approval .pb-ico { color: var(--st-queued); }  /* a >=A2 action awaiting your signature — not an error */
/* an oracle-CONFIRMED finding earns the proven-fact colour; a LEAD stays neutral (never the fact colour). */
.pb-row.pb-finding .pb-ico { color: var(--st-confirmed); }
.pb-row.pb-finding .pb-tag { color: var(--st-confirmed); background: color-mix(in srgb, var(--st-confirmed) 14%, transparent); }
.pb-row.pb-lead .pb-ico { color: var(--text-2); }
.pb-tag.pb-lead { color: var(--text-1); background: var(--bg-3); }

/* responsive shell */
@media (max-width: 900px) {
  #app { grid-template-columns: 1fr; grid-template-rows: var(--topbar-h) 1fr; grid-template-areas: "topbar" "main"; }
  #brand, #nav { display: none; }
  #nav.mobile-open { display: block; position: fixed; inset: var(--topbar-h) 0 0 0; z-index: 50; width: 100%; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* a11y — a visible keyboard-focus ring on every interactive element (P7). Uses :focus-visible so it
   shows for keyboard/AT users without adding a ring on mouse click. */
:focus-visible { outline: 2px solid var(--st-running); outline-offset: 2px; border-radius: var(--r-1); }
.nav-item:focus-visible { outline-offset: -2px; }
a:focus-visible, button:focus-visible, [role="link"]:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible { outline: 2px solid var(--st-running); outline-offset: 2px; }
/* S7: per-turn token usage / running context meter under the composer */
.chat-usage { margin-top: 6px; font-size: var(--fs-xs); color: var(--text-2); font-variant-numeric: tabular-nums; }
/* S10: safe markdown in assistant replies */
.md { line-height: 1.5; }
.md-p { margin: 0 0 8px; } .md .md-p:last-child { margin-bottom: 0; }
.md-code { background: var(--bg-0); border: 1px solid var(--border); border-radius: var(--r-1); padding: 8px 10px;
  overflow-x: auto; font-family: var(--font-mono); font-size: var(--fs-xs); white-space: pre; margin: 6px 0; }
.md-ic { background: var(--bg-0); border: 1px solid var(--border); border-radius: 3px; padding: 0 4px; font-family: var(--font-mono); font-size: .92em; }
.md-ul, .md-ol { margin: 4px 0 8px; padding-left: 22px; } .md-ul li, .md-ol li { margin: 2px 0; }
.md-h1, .md-h2, .md-h3, .md-h4 { font-weight: 650; margin: 8px 0 4px; line-height: 1.3; }
.md-h1 { font-size: var(--fs-lg); } .md-h2 { font-size: var(--fs-md); } .md-h3, .md-h4 { font-size: var(--fs-sm); }
.md a { color: var(--accent, #6b8afd); text-decoration: underline; }
/* S11: attachment image thumbnail */
.att-thumb { width: 28px; height: 28px; object-fit: cover; border-radius: var(--r-1); border: 1px solid var(--border); vertical-align: middle; margin-right: 4px; }
/* S9: plan/hypothesis checklist */
.chk { display: inline-flex; align-items: center; }
.chk .glyph svg { width: 15px; height: 15px; }
.chk-done { color: var(--ok, #3fb950); } .chk-no { color: var(--sev-high, #e5a13a); } .chk-open { color: var(--text-2); }
.chk-row.is-done .shield { opacity: .85; } .chk-count { color: var(--text-2); font-weight: 400; font-size: var(--fs-xs); }
/* Chat sessions rail (professional, tidy rows) */
.chat-new { width: 100%; }
.chat-rail-cap { font-size: var(--fs-xs); color: var(--text-2); text-transform: uppercase; letter-spacing: .04em;
  font-weight: 600; margin: 6px 2px 2px; }
.chat-session-row { display: flex; gap: 4px; align-items: stretch; border-radius: var(--r-2); }
.chat-session-row .iconbtn.sm { opacity: 0; transition: opacity .12s ease; }
.chat-session-row:hover .iconbtn.sm, .chat-session-row.on .iconbtn.sm { opacity: 1; }
.chat-session { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; align-items: flex-start;
  gap: 1px; text-align: left; background: transparent; border: 1px solid transparent; border-radius: var(--r-2);
  padding: 7px 10px; cursor: pointer; color: var(--text-0); }
.chat-session:hover { background: var(--bg-2); border-color: var(--border); }
.chat-session.on { background: var(--bg-3); border-color: var(--border-strong); }
.chat-session-t { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-sm); }
.chat-session-m { font-size: var(--fs-xs); color: var(--text-2); }
.iconbtn.sm { width: 30px; height: 30px; }
.chat-empty { padding: 24px; }
/* Session folders (VIGIL_SESSION_FOLDERS): chat-rail groups + the Sessions screen sections */
.chat-rail-top { display: flex; gap: 6px; align-items: stretch; }
.chat-rail-top .chat-new { flex: 1 1 auto; width: auto; }
.chat-folder-h { display: flex; gap: 4px; align-items: stretch; border-radius: var(--r-2); }
.chat-folder-h .iconbtn.sm { opacity: 0; transition: opacity .12s ease; }
.chat-folder-h:hover .iconbtn.sm, .chat-folder-h:focus-within .iconbtn.sm { opacity: 1; }
.chat-folder-t { flex: 1 1 auto; min-width: 0; display: flex; gap: 6px; align-items: center; text-align: left;
  background: transparent; border: 1px solid transparent; border-radius: var(--r-2); padding: 6px 8px;
  cursor: pointer; color: var(--text-0); font-size: var(--fs-sm); }
.chat-folder-t:hover { background: var(--bg-2); border-color: var(--border); }
.chat-folder-t .glyph svg { width: 16px; height: 16px; }
.chat-folder-n { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-folder-c { font-size: var(--fs-xs); color: var(--text-2); }
.chat-folder-item { padding-left: 18px; }
.chat-folder-empty { padding-left: 26px; font-size: var(--fs-xs); }
.chat-session-row[draggable="true"] { cursor: grab; }
.drop-on { outline: 2px dashed var(--border-strong); outline-offset: -2px; background: var(--bg-2); }
.folder-picks .folder-pick { width: 100%; justify-content: flex-start; gap: 8px; }
.folder-picks .folder-pick.on { border-color: var(--border-strong); background: var(--bg-3); }
.folder-toolbar { display: flex; gap: 8px; margin-bottom: 10px; }
.session-folder { margin-bottom: 18px; }
.session-folder-h { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 4px 0 8px; }
.session-folder-h h2 { font-size: var(--fs-md, 15px); margin: 0; }

/* Calibrated critic feed: a routine critic check about a LEAD (advisory only; never affects a fact) and
   the folded "N routine critic checks" summary read as quiet context, not an alarm. Genuine demotions
   (a critic objecting to a real FACT) keep full weight. See foldRoutineCritics / _calibrate_critic. */
.pb-row.pb-muted, .trow.pb-muted { opacity: .58; }
.pb-row.pb-muted:hover, .trow.pb-muted:hover { opacity: .82; }
