/* ICP Incident Response — same palette contract as digital-twin/item_view: the status slots
   (ok/warn/serious/critical/unknown) are reserved for state and never reused for identity.

   Colour is rationed here. It carries three things and nothing else:
     - reply status (the replied / no-reply pills and the passed / failed drill chips)
     - the OK / Not OK verdict on the lookup card
     - the penalty state
   Panels, headings, helper text and buttons are neutral, and no card has a coloured rail. A
   page where everything is coloured is a page where nothing is.

   Two slots, not three, on a drill record: a drill is passed or it is failed. There was an
   amber "late" tier here and it has been removed, because a reply after the window earns no
   partial credit and a colour between green and red said it did. Lateness survives as the
   *reason* on a failed chip — a dashed edge and an annotation, never a rank. */
.viz-root {
  --plane:          #f9f9f7;
  --surface-1:      #fcfcfb;
  --surface-2:      #f2f1ed;
  --surface-3:      #eceae4;
  --text-primary:   #0b0b0b;
  --text-secondary: #52514e;
  /* darkened from #898781: muted text is mostly 11–12px, and the lighter grey sat near 3.5:1
     on the plane */
  --text-muted:     #6f6d68;
  --grid:           #e1e0d9;
  --axis:           #c3c2b7;
  --border:         rgba(11, 11, 11, .10);

  --st-ok:       #0ca30c;
  --st-warn:     #fab219;
  --st-serious:  #ec835a;
  --st-critical: #d03b3b;
  --st-unknown:  #898781;

  /* The same three states, as ink. The slots above are tuned for dots and edges; set as small
     words on a light surface the green and the amber fall well under 4.5:1. Dots and borders
     keep the slot, anything a person has to read takes the ink. */
  --ink-ok:       #0a7a0a;
  --ink-warn:     #94590a;
  --ink-critical: #c53030;

  --focus: #3987e5;

  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  .viz-root {
    --plane:          #0d0d0d;
    --surface-1:      #1a1a19;
    --surface-2:      #222221;
    --surface-3:      #2b2b29;
    --text-primary:   #ffffff;
    --text-secondary: #c3c2b7;
    --text-muted:     #898781;
    --grid:           #2c2c2a;
    --axis:           #383835;
    --border:         rgba(255, 255, 255, .10);
    --st-ok:          #35c035;
    --ink-ok:         #35c035;
    --ink-warn:       #fab219;
    --ink-critical:   #f0706b;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }

/* ---------- the audience switch ----------
   `body.op` is set from the payload's `operator` flag, never from the URL, so a page that
   failed to authenticate degrades to the visitor's view rather than to a broken one. Cosmetic
   reinforcement only: in public mode the operator payload was never sent. */
body:not(.op) .op-only { display: none !important; }
body.op .pub-only { display: none !important; }
/* `body.static` is set from the payload's `static` flag. There is no operator half of a
   published build to reveal — no key is held, no write would reach anything — so the
   surfaces are struck out here as well as by the payload that never contained them. */
body.static .op-only { display: none !important; }

/* A reading column, not a dashboard: the page is one question and its answer, and at 1180px
   the answer sat in the left third of a mostly empty card. The operator keeps the full width,
   because the raw-source column needs it. */
body {
  margin: 0 auto; padding: 16px 24px 48px; max-width: 960px;
  background: var(--plane); color: var(--text-primary);
  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}
body.op { max-width: 1180px; }
h1 { font-size: 18px; font-weight: 600; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 15px; font-weight: 600; margin: 0 0 10px; letter-spacing: -.005em; }
code { font: 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--text-muted); }
.muted { color: var(--text-muted); font-weight: 400; }
.small { font-size: 11px; }
p { margin: 0; }

/* ---------- 0. header ---------- */
.topbar {
  display: flex; justify-content: space-between; align-items: baseline; gap: 20px;
  margin-bottom: 12px;
  /* Sticky, so the way back to nodao.org and the sync status stay in view. It bleeds into
     the body's side padding so content scrolling under it is fully covered. */
  position: sticky; top: 0; z-index: 20;
  margin-left: -24px; margin-right: -24px; padding: 10px 24px;
  background: var(--plane);
  border-bottom: 1px solid transparent; transition: border-color .15s;
}
body.scrolled .topbar { border-bottom-color: var(--border); }
.topmeta { display: flex; align-items: baseline; gap: 10px; font-size: 11.5px; color: var(--text-secondary); }
.sync { display: inline-flex; align-items: baseline; gap: 6px; white-space: nowrap; cursor: help; }
/* a heartbeat, not a status light: it says the page is still watching, so it stays neutral —
   green here would read as a verdict on the drill */
.pulse {
  width: 7px; height: 7px; border-radius: 50%; align-self: center;
  background: var(--text-muted); animation: beat 2.6s ease-in-out infinite;
}
.pulse[data-state="off"] {
  animation: none; background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--text-muted); opacity: .6;
}
/* a published snapshot is not watching anything, so the heartbeat stops. A beating dot over
   the words "Updated 14 Aug" would be the page contradicting itself once every 2.6 seconds.
   Dim green, so the board reads as live without the dot pulsing. */
.pulse[data-state="still"] { animation: none; background: var(--st-ok); opacity: .55; }
@keyframes beat {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .3; transform: scale(.72); }
}
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }
.opbadge {
  font-size: 9.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-secondary); border: 1px solid var(--axis);
  border-radius: 4px; padding: 1px 6px; cursor: help;
}

/* ---------- banner ---------- */
.banner {
  border: 1px solid var(--axis); background: var(--surface-2);
  border-radius: 8px; padding: 8px 12px; margin-bottom: 12px;
  font-size: 12px; line-height: 1.45; color: var(--text-secondary);
}
.banner strong { color: var(--text-primary); }

/* ---------- panels ---------- */
.panel {
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px 18px 18px; min-width: 0;
}
.tile-label { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.tile-foot { font-size: 13px; color: var(--text-secondary); margin-top: 8px; max-width: 62ch; }

/* ---------- 1. incident status ---------- */
.incident {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px 24px; flex-wrap: wrap; margin-bottom: 14px;
}
/* The mode switch. While a drill is open the module trades palettes with the page — a dark
   slab on the light theme — so "something is running" is readable from across a room, before
   a single word is. It is done by re-pointing the neutral tokens, so every chip and button
   inside follows without a second set of rules, and it spends no status colour: the slab is
   neutral, and the countdown only turns amber or red when the clock says so. */
.incident.live {
  --surface-1: #141413; --surface-2: #232322; --surface-3: #2b2b29;
  --text-primary: #ffffff; --text-secondary: #c9c8bf; --text-muted: #9d9b94;
  --axis: #4a4a46; --border: rgba(255, 255, 255, .14);
  --st-ok: #35c035; --ink-ok: #35c035; --ink-warn: #fab219; --ink-critical: #f0706b;
  color: var(--text-primary); border-color: transparent;
  padding-top: 18px; padding-bottom: 20px;
}
/* On the dark theme a white slab would be a torch in the reader's face at night; there the
   module lifts one surface step and takes a bright edge instead. */
@media (prefers-color-scheme: dark) {
  .incident.live {
    --surface-1: #262624; --surface-2: #32322f; --surface-3: #3b3b38;
    border-color: rgba(255, 255, 255, .55);
  }
}
.incident.live .tile-label {
  font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--text-secondary); margin-bottom: 6px;
}
.inc-main { min-width: 0; }
/* Left-aligned: the status line is usually long enough to push this column below it, and
   right-aligned items then sit ragged under the hero. */
.inc-side { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
/* one hero: the time left, because every other number is measured against it */
.hero {
  font-size: 46px; font-weight: 650; line-height: 1.05; letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}
.hero.calm { font-size: 26px; font-weight: 500; color: var(--text-secondary); letter-spacing: -.01em; }
.hero.urgent { color: var(--ink-warn); }
.hero.overdue { font-size: 30px; color: var(--ink-critical); }

/* the consequence line under the hero. Sized between the foot and the hero: it is the second
   thing read in this module, not the fourth. Neutral — the money is the emphasis, and a red
   line here would read as an alarm about a drill that is already over. */
.inc-outcome { margin-top: 8px; max-width: 54ch; }
.inc-outline {
  font-size: 12.5px; font-weight: 600; color: var(--text-primary);
  font-variant-numeric: tabular-nums; line-height: 1.4;
}
details.outcome > summary.inc-outline { cursor: pointer; list-style: none; display: inline; }
details.outcome > summary::-webkit-details-marker { display: none; }
details.outcome > summary::after {
  content: '?'; font-size: 9px; font-weight: 700; opacity: .7; margin-left: 5px;
  border: 1px solid var(--axis); border-radius: 3px; padding: 0 3px;
}
details.outcome[open] > summary::after { content: '×'; }
.outcome-why {
  margin-top: 6px; font-size: 11.5px; line-height: 1.5; color: var(--text-secondary);
  max-width: 54ch;
}
.outcome-facts { margin: 5px 0 0; padding-left: 16px; color: var(--text-muted); }

/* ---------- count chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-start; }
.chip {
  display: inline-flex; align-items: baseline; gap: 6px;
  border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px 4px 10px;
  background: var(--surface-2); font-size: 12px; color: var(--text-secondary);
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; align-self: center; }
.chip b { font-size: 17px; font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.chip.zero b { color: var(--text-muted); font-weight: 600; }

/* ---------- operator: feed freshness ----------
   The one place an alarm is warranted: only the operator can act on it. Text and dot carry
   the level; the panel itself stays neutral. */
.feedbar {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  border: 1px solid var(--border); border-radius: 10px; padding: 9px 14px; margin-bottom: 12px;
  background: var(--surface-1);
}
.feed-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--st-unknown); align-self: center; }
.feed-main { font-size: 15px; font-weight: 600; }
.feed-sub { font-size: 11.5px; color: var(--text-secondary); flex: 1 1 auto; min-width: 0; }
.feedbar .btn { flex: 0 0 auto; }
.feedbar[data-level="warn"] .feed-main { color: var(--ink-warn); }
.feedbar[data-level="bad"] .feed-main,
.feedbar[data-level="never"] .feed-main { color: var(--ink-critical); }
.feedbar[data-level="idle"] .feed-main { color: var(--text-muted); font-weight: 500; }

.ingest { margin-bottom: 12px; }
.ingest textarea {
  width: 100%; resize: vertical; min-height: 74px;
  font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--surface-2);
}
.row-inline { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.flash { font-size: 11.5px; color: var(--text-secondary); }
.flash.good { color: var(--ink-ok); font-weight: 600; }
.flash.bad { color: var(--ink-critical); font-weight: 600; }

.queue { margin-bottom: 12px; }
.queue-why { margin: 0 0 10px; }
.queue-list { display: flex; flex-direction: column; gap: 8px; }
.qitem { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; }
.qhead { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.qhead .sender { font-weight: 600; font-size: 12.5px; }
.qhead .key { margin-left: auto; }
.qitem .excerpt {
  margin: 5px 0 8px; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--text-secondary); white-space: pre-wrap; word-break: break-word;
  max-height: 6.5em; overflow: auto;
}
.qctl { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.qctl select { max-width: 320px; }

/* ---------- 2. the answer ---------- */
/* The page's own headline. Everything above it is context and everything below is reference,
   so this is the one heading set larger than the rest. */
.lookup { margin-bottom: 28px; }

.lookup h2 { font-size: 19px; font-weight: 650; letter-spacing: -.015em; margin-bottom: 12px; }
.lk-controls { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; }

/* ---------- the provider combobox ----------
   The list is absolutely positioned so opening it never reflows the card underneath: the
   answer a reader is already looking at must not jump down the page while they refine the
   query that produced it. */
.lk-combo { position: relative; width: 100%; max-width: 420px; }
.lk-combo .flabel { font-size: 12.5px; color: var(--text-secondary); }
.combo-in { position: relative; display: block; width: 100%; }
/* The one field on the page a visitor has to use, so it is the one field sized like it: a
   thumb-height box with a firm edge, where every other input stays form-sized. */
#lk-input {
  width: 100%; min-width: 0; min-height: 44px; padding: 8px 46px 8px 12px;
  font-size: 16px; border-color: var(--axis); border-radius: 9px;
}
#lk-input::placeholder { color: var(--text-muted); }
.lk-toggle {
  position: absolute; right: 1px; top: 1px; bottom: 1px; width: 42px;
  display: flex; align-items: center; justify-content: center;
  font: inherit; font-size: 18px; line-height: 1; cursor: pointer;
  color: var(--text-secondary); background: none; border: 0; border-radius: 0 8px 8px 0;
}
.lk-toggle:hover { color: var(--text-primary); background: var(--surface-2); }
.lk-listbox {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 30;
  margin: 0; padding: 4px; list-style: none;
  max-height: 264px; overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface-1); border: 1px solid var(--axis); border-radius: 8px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .16);
}
.lk-opt {
  padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 14px;
  color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lk-opt:hover { background: var(--surface-2); }
/* the keyboard highlight has to be legible next to the hover tint, so it takes an edge too */
.lk-opt.on { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--axis); font-weight: 600; }

.lk-suggest { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.lk-suggest:empty { margin-top: 0; }
.lk-none { margin-top: 10px; font-size: 12px; }
.lk-none:empty { margin-top: 0; }

.lk-card { margin-top: 18px; }
.lk-pname { font-size: 17px; font-weight: 700; margin-bottom: 10px; letter-spacing: -.01em; }

/* the verdict: one word, readable in greyscale and out loud, with colour as reinforcement.
   One box holds the verdict and, when it is bad, the remedy under a hairline — "you're
   exposed" and "here is the line to post" are the same breath, not two cards. The wash and
   the edge take the verdict's colour (it is one of the three things colour is for), faint
   enough that the word still does the work. */
.lk-verdict {
  --tone: var(--st-unknown);
  border: 1px solid color-mix(in srgb, var(--tone) 38%, transparent); border-radius: 12px;
  padding: 14px 16px;
  background: color-mix(in srgb, var(--tone) 7%, var(--surface-1));
}
.lk-verdict.ok   { --tone: var(--st-ok); }
.lk-verdict.warn { --tone: var(--st-warn); }
.lk-verdict.bad  { --tone: var(--st-critical); }
.lk-vhead { display: flex; align-items: center; gap: 6px 18px; flex-wrap: wrap; }
/* The verdict exists only while a drill is running. Between drills the card carries no
   banner at all — there is no question outstanding, and a calm panel saying so would be
   read as an all-clear the page has no standing to give a provider under penalty. */
.lk-big { font-size: 38px; font-weight: 750; letter-spacing: -.025em; line-height: 1.05; white-space: nowrap; }
.lk-vbody { flex: 1 1 260px; min-width: 0; }
.lk-vline { font-size: 14px; font-weight: 600; display: flex; align-items: baseline; gap: 5px; flex-wrap: wrap; }
.lk-verdict.ok .lk-big   { color: var(--ink-ok); }
.lk-verdict.warn .lk-big { color: var(--ink-warn); }
.lk-verdict.bad .lk-big  { color: var(--ink-critical); }

.lk-countdown { margin-top: 3px; font-size: 13px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.lk-countdown.urgent { color: var(--ink-warn); font-weight: 700; }
.lk-countdown.overdue { color: var(--ink-critical); font-weight: 600; }

.lk-note { margin-top: 6px; font-size: 12px; color: var(--text-secondary); line-height: 1.45; max-width: 72ch; }
.lk-h { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 7px; }
.lk-block { margin-top: 16px; }
/* record and penalty are two short facts about the same provider: side by side where there
   is room, stacked where there is not */
.lk-facts { display: flex; flex-wrap: wrap; gap: 0 40px; }
.lk-facts > .lk-block { min-width: 0; }

/* the record in the card: most recent first, dates spelled out. The board's three anonymous
   chips are for scanning 79 rows; this is for reading one. */
.lk-hist { display: flex; gap: 8px; flex-wrap: wrap; }
.lk-hchip {
  display: inline-flex; align-items: baseline; gap: 7px;
  border: 1px solid var(--border); border-radius: 6px; padding: 4px 10px;
}
.lk-hchip b { font-size: 10.5px; font-weight: 800; letter-spacing: .06em; }
.lk-hdate { font-size: 12px; color: var(--text-secondary); }
.lk-hchip.lk-fail { border-width: 1.5px; }
/* A late reply is a failure — same colour, same word. The dashed edge carries only the
   reason, and it is deliberately the quietest signal on the chip: this is an annotation on
   a miss, not a third grade between passing and missing. */
.lk-hchip.is-late { border-style: dashed; }
.lk-hwhy {
  font-size: 9.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-muted); cursor: help;
}
.lk-hnote { margin-top: 6px; line-height: 1.45; }

/* the call to action: only when a drill is running and this provider has not replied. It
   lives inside the verdict box, under a hairline in the verdict's own tone. */
.lk-cta {
  margin-top: 14px; padding-top: 13px;
  border-top: 1px solid color-mix(in srgb, var(--tone) 28%, transparent);
}
.lk-say { font-size: 13px; font-weight: 600; margin-bottom: 7px; }
.inc-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.lk-notify { padding-top: 14px; border-top: 1px solid var(--border); }
.lk-nline { font-size: 13px; color: var(--text-secondary); margin-bottom: 9px; }
/* the line to post, assembled from live parts: the provider half is fixed and exact, the name
   half is an input because it is the only bit they supply */
.replybox {
  display: inline-flex; align-items: center; flex-wrap: wrap;
  border: 1px solid var(--axis); border-radius: 8px; padding: 9px 12px;
  background: var(--surface-1);
  font: 14px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
  max-width: 100%;
}
.rb-lit { color: var(--text-secondary); white-space: pre; }
.rb-np { color: var(--text-primary); font-weight: 700; }
.rb-name {
  font: inherit; min-height: 0; padding: 1px 4px; min-width: 8ch; max-width: 100%;
  color: var(--text-primary); font-weight: 700;
  background: var(--surface-2);
  border: 0; border-bottom: 2px dashed var(--axis); border-radius: 3px;
}

/* the penalty disclosure — the same component on the board and in the card. The percentage is
   the whole headline; the wording behind it is the server's. */
.pen { display: inline-block; }
.pen > summary {
  display: inline-flex; align-items: center; gap: 4px; cursor: pointer; list-style: none;
  font-size: 11px; font-weight: 700; letter-spacing: .02em;
  color: var(--ink-critical);
  border: 1px solid color-mix(in srgb, var(--st-critical) 45%, transparent);
  border-radius: 4px; padding: 1px 6px;
}
.pen > summary::-webkit-details-marker { display: none; }
.pen > summary::after { content: '?'; font-size: 9px; opacity: .75; }
.pen[open] > summary::after { content: '×'; }
.penwhy {
  white-space: normal; max-width: 48ch; margin-top: 6px;
  font-size: 11.5px; line-height: 1.5; color: var(--text-secondary);
}
.penrounds { margin: 5px 0 0; padding-left: 16px; color: var(--text-muted); }

/* the good-news case. Same slot as the penalty chip, same reserved colour, opposite sign —
   it is a statement about the penalty, which is one of the three things colour is for here. */
.lk-clear {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 600; color: var(--ink-ok);
  border: 1px solid color-mix(in srgb, var(--st-ok) 40%, transparent);
  border-radius: 6px; padding: 4px 10px;
}

.lk-rule { margin-top: 10px; font-size: 12px; color: var(--text-muted); }
.lk-rule summary { cursor: pointer; }
.lk-rule p { margin-top: 5px; max-width: 72ch; }

/* ---------- 3. the nudge, under the roster ---------- */
.signup { margin-top: 28px; scroll-margin-top: 64px; }   /* clears the sticky header */
.signup form { max-width: 420px; }
.signup .su-line { font-size: 13px; color: var(--text-secondary); margin-bottom: 12px; max-width: 68ch; }
.signup .su-for { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.signup .field input { min-height: 40px; font-size: 15px; padding: 7px 11px; border-color: var(--axis); border-radius: 8px; }
.signup .field { width: 100%; }
.signup .field input { width: 100%; min-width: 0; }
.su-terms {
  margin-top: 10px; padding: 10px 11px; border: 1px solid var(--axis);
  border-radius: 8px; background: var(--surface-3);
}
.su-promise { font-size: 12px; line-height: 1.45; color: var(--text-secondary); }
/* Checkbox and its label are one line of reading, not two columns. `display: flex` (not
   inline-flex) so the label wraps under itself on a narrow screen instead of pushing the
   box around, and the box keeps a fixed size so it cannot stretch with the text. */
.consent {
  display: flex; align-items: flex-start; gap: 8px;
  margin-top: 9px; line-height: 1.45; font-size: 12.5px;
  width: 100%;
}
.consent input[type=checkbox] {
  flex: 0 0 auto;
  width: 16px; height: 16px; min-height: 0;
  margin: 1px 0 0; padding: 0;
  /* neutral: ticking a consent box is not a reply status, a verdict or a penalty */
  accent-color: var(--text-primary);
}
.consent > span { flex: 1 1 auto; min-width: 0; }
.signup .flash { display: block; margin-top: 6px; }

/* ---------- controls ---------- */
.ctl {
  display: inline-flex; align-items: center; gap: 6px; min-height: 30px;
  font-size: 12px; color: var(--text-secondary);
}
.field { flex-direction: column; align-items: flex-start; gap: 3px; font-size: 11px; color: var(--text-muted); }
.flabel { white-space: nowrap; }
.ctl input:not([type=checkbox]), .ctl select, .btn, select, textarea {
  font: inherit; font-size: 12px; color: var(--text-primary);
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: 6px; padding: 5px 8px; min-height: 28px;
}
/* Buttons are a size up from the form fields: they are what a thumb aims at. Several are
   real links (the room, the mail draft, the jump to the signup), so the link underline is
   switched off here once rather than per button. */
.btn {
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 500; padding: 6px 13px; min-height: 34px;
  border-color: var(--axis); border-radius: 8px; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: progress; }
/* Emphasis without a brand colour: the primary button is the page's own ink, filled. One per
   module at most — the script moves it to whichever action is next for this reader — so a
   filled button always means "this one". */
.btn.primary {
  background: var(--text-primary); border-color: var(--text-primary);
  color: var(--surface-1); font-weight: 600;
}
.btn.primary:hover { background: var(--text-primary); opacity: .86; }
.checkbox { cursor: pointer; }

.board-head-h { margin: 0 0 8px; }
.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 0 0 10px; }
.filters .spacer { flex: 1 1 auto; }
.segmented { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.seg {
  font: inherit; font-size: 12px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface-1); color: var(--text-secondary);
  border: 1px solid var(--border); border-radius: 6px; padding: 5px 10px; min-height: 28px;
}
.seg:hover { background: var(--surface-2); }
.seg.on { color: var(--text-primary); font-weight: 600; border-color: var(--axis); background: var(--surface-2); }
.segn {
  font-variant-numeric: tabular-nums; font-size: 11px; color: var(--text-muted);
  border-left: 1px solid var(--border); padding-left: 6px;
}
#query { min-width: 160px; }

/* ---------- 4. the roster ---------- */
.board { padding: 4px 14px 8px; }
.scroll { overflow-x: auto; max-height: 66vh; overflow-y: auto; }
table { border-collapse: collapse; width: 100%; font-size: 12px; }
th, td { text-align: left; padding: 6px 14px 6px 0; border-bottom: 1px solid var(--grid); white-space: nowrap; vertical-align: middle; }
th {
  color: var(--text-muted); font-weight: 600; position: sticky; top: 0; z-index: 1;
  background: var(--surface-1); padding-top: 9px; padding-bottom: 7px;
}
td.wrap { white-space: normal; min-width: 220px; }
td:last-child, th:last-child { padding-right: 0; }
.sortbtn {
  font: inherit; font-weight: 600; color: var(--text-muted); background: none; border: 0;
  padding: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 4px;
}
.sortbtn:hover { color: var(--text-primary); }
.sortbtn .arrow { font-size: 9px; color: var(--text-secondary); }

tbody tr:hover { background: var(--surface-2); }
.pname { font-weight: 600; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 600;
  border: 1px solid var(--border); background: var(--surface-2);
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; }

.seen { display: inline-flex; align-items: baseline; gap: 4px; font-variant-numeric: tabular-nums; }
/* the "at or before" marker: a bound is not a timestamp and must not look like one */
.seen .bound { color: var(--text-muted); font-weight: 700; cursor: help; }
.seen-t { color: var(--text-primary); }
.tag {
  font-size: 9px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-muted); border: 1px solid var(--border); border-radius: 3px; padding: 0 4px;
  cursor: help;
}

.hist { display: inline-flex; gap: 4px; }
.hchip {
  font-size: 9.5px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase;
  border: 1px solid var(--border); border-radius: 3px; padding: 1px 5px; cursor: help;
}
/* dashed = failed because the reply came after the window. Hover says so in words; on the
   board this is scanning texture, and the card spells it out. */
.hchip.is-late { border-style: dashed; }

.reply { display: inline-flex; align-items: baseline; gap: 8px; max-width: 46ch; }
.reply .sender { color: var(--text-primary); font-weight: 500; flex: 0 0 auto; }
.reply .excerpt { color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { color: var(--text-muted); font-size: 12px; padding: 18px 0 22px; text-align: center; }

/* ---------- 5. penalties total ---------- */
.totals { margin-top: 20px; }
.tot-num { font-size: 30px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tot-num b { font-weight: 700; }
.tot-unit { font-size: 15px; font-weight: 600; color: var(--text-secondary); }
.tot-usd { font-size: 15px; font-weight: 500; color: var(--text-muted); margin-left: 8px; }
.tot-sub { margin-top: 4px; }
.est-tag {
  font-size: 9.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-secondary); border: 1px solid var(--axis); border-radius: 4px; padding: 0 5px;
  margin-left: 4px;
}
.tot-why { margin-top: 8px; font-size: 11.5px; color: var(--text-muted); }
.tot-why summary { cursor: pointer; }
.tot-why p { margin-top: 5px; max-width: 90ch; line-height: 1.5; }

.foot { margin-top: 22px; font-size: 11px; color: var(--text-muted); border-top: 1px solid var(--grid); padding-top: 10px; max-width: 100ch; }

/* held-but-not-live: the last good state stays readable and stops looking current. The lookup
   card is in here because a stale "OK" is the most dangerous thing this page can show. */
body.offline .incident, body.offline .board, body.offline .queue, body.offline .feedbar,
body.offline .lookup, body.offline .totals {
  opacity: .5; filter: saturate(.55); transition: opacity .15s;
}

/* ---------- phone: providers check this away from a desk ---------- */
@media (max-width: 760px) {
  body { padding: 12px 14px 32px; }
  .topbar { flex-direction: column; align-items: flex-start; gap: 4px; margin-left: -14px; margin-right: -14px; padding: 8px 14px; }
  .incident { gap: 12px; }
  .inc-side { align-items: flex-start; width: 100%; }
  .chips { justify-content: flex-start; }
  .panel { padding: 14px 14px 16px; }
  .hero { font-size: 34px; }
  .hero.calm { font-size: 24px; }
  /* thumb-sized, and the two actions of a pair share the row instead of one wrapping under
     the other */
  .btn { min-height: 42px; font-size: 14px; }
  .inc-actions, .lk-cta .row-inline { width: 100%; }
  .inc-actions .btn, .lk-cta .row-inline .btn { flex: 1 1 auto; }
  /* 16px is the size below which iOS zooms the page when a field takes focus, which throws
     the reader off the thing they were about to type into */
  .ctl input:not([type=checkbox]), .rb-name, textarea { font-size: 16px; }
  .ctl input:not([type=checkbox]) { min-height: 40px; }
  .feed-sub { flex-basis: 100%; }
  .ctl { width: 100%; }
  .ctl input, .ctl select, #query, #lk-input { width: 100%; min-width: 0; }
  .lk-combo { max-width: none; }
  .lk-listbox { max-height: 50vh; }
  .board { padding: 4px 10px 8px; }
  .scroll { max-height: none; }
  /* the operator's raw-source column is the one that cannot fit; the five public columns stay
     and the table scrolls inside its own box rather than pushing the page sideways. Keyed on
     the column name, because nth-child would hide the wrong thing in public mode. */
  .c-source { display: none; }
  .qhead .key { margin-left: 0; }
  .lk-big { font-size: 32px; }
  .replybox { display: flex; font-size: 14px; }
  .replybox .rb-name { font-size: 16px; }
  .lookup { margin-bottom: 22px; }
  .signup { margin-top: 22px; }
  .penwhy { max-width: none; }
}


/* ---------- title breadcrumb ----------
   NODAO / Internet Computer (ICP) / Incident Response.
   The first two crumbs are context and recede; the last one is the page and carries the
   weight, so a provider arriving from a chat link sees where they are and what this is in
   a single line rather than a wordmark bar plus a heading repeating it. */
.crumbs {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .45rem;
  font-size: 1.02rem; font-weight: 400; margin: 0;
}
/* (These rules named --text-1 / --text-3, tokens this palette does not define, so every crumb
   fell back to the body colour and nothing receded. They now use the real ones.) */
.crumb { color: var(--text-secondary); text-decoration: none; }
a.crumb:hover { color: var(--text-primary); text-decoration: underline; }
/* The NODAO mark, kept quiet: small, faded, and only at full strength on hover. */
/* The NODAO mark alone, quiet. On hover or keyboard focus the name rolls out to its right,
   and the whole thing stays one link to nodao.org. */
.crumb-home { display: inline-flex; align-items: baseline; }
/* Bars take the text colour, so the mark reads on the light and the dark theme alike. */
.crumb-mark { width: 1em; height: 1em; vertical-align: -0.14em; align-self: center; flex: none; color: var(--text-primary); opacity: .7; transition: opacity .15s; }
.crumb-home-name {
  display: inline-block; overflow: hidden; white-space: nowrap; max-width: 0; opacity: 0;
  transition: max-width .3s ease, opacity .2s ease, margin-left .3s ease;
}
.crumb-home:hover .crumb-mark, .crumb-home:focus-visible .crumb-mark { opacity: 1; }
.crumb-home:hover .crumb-home-name, .crumb-home:focus-visible .crumb-home-name,
.crumb-home.is-open .crumb-home-name { max-width: 5em; opacity: 1; margin-left: .35em; }
.crumb-home.is-open .crumb-mark { opacity: 1; }
/* Phones: one line. The middle crumb shortens to ICP, so the path reads at a glance. */
.crumb-short { display: none; text-decoration: none; }
@media (max-width: 560px) {
  .crumbs { flex-wrap: nowrap; white-space: nowrap; font-size: .95rem; gap: .35rem; }
  .crumb-long { display: none; }
  .crumb-short { display: inline; }
}
a.crumb-home:hover { text-decoration: none; }
a.crumb-home:hover .crumb-home-name { text-decoration: underline; }
@media (prefers-reduced-motion: reduce) { .crumb-home-name { transition: none; } }
.crumbsep { color: var(--text-muted); opacity: .7; }
.crumb-now { color: var(--text-primary); font-weight: 700; }
