/* Agency ops — internal console.
 *
 * Built to the ten rules in the Ops Console Reference Board. The ones that
 * shape everything below:
 *
 *   one spacing scale, nothing between the steps
 *   two row heights — 36 to scan, 44 to act on
 *   status in three channels: stripe + glyph + word, never colour alone
 *   one accent, and it never means "good"
 *   four type sizes; hierarchy from weight and colour, not size
 *   one action per row; irreversible actions leave the table entirely
 *   exactly one filled button per screen
 *
 * Deliberately absent: the four-stat header, pastel status pills, value-tinted
 * numeric chips, and modals. Numbers live in right-aligned tabular columns.
 */

:root {
  /* spacing — 4 / 8 / 12 / 16 / 24 / 32 / 48, nothing between */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;

  /* two row heights: one to scan, one to act on */
  --row: 36px;
  --row-act: 44px;
  --act-col: 88px;

  /* four type sizes */
  --t-title: 20px;
  --t-body:  13px;
  --t-2nd:   12px;
  --t-label: 11px;

  --paper:    #f1f3f4;
  --surface:  #ffffff;
  --raised:   #e8ecee;
  --line:     #d5dbdf;
  --line-soft:#e5e9eb;

  --ink:      #171b1f;
  --soft:     #5b666d;
  --faint:    #87939a;

  /* One accent. Marks the current nav item and the single primary button.
     Deliberately not green: an accent that reads as "good" collides with
     semantic state the moment both appear in the same row. */
  --accent:   #2f4a78;
  --on-accent:#ffffff;

  /* four semantic states, capped on purpose */
  --ok:      #1f6b45;
  --warn:    #8a5300;
  --bad:     #9d2b21;
  --neutral: #5b666d;

  --radius: 3px;
  --chip-radius: 2px;

  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  --sans: "Segoe UI", system-ui, -apple-system, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:    #0f1215;
    --surface:  #161a1e;
    --raised:   #1d2329;
    --line:     #2b333a;
    --line-soft:#222930;
    --ink:      #e5eaed;
    --soft:     #97a3aa;
    --faint:    #6d7a82;
    --accent:   #8bafe4;
    --on-accent:#0f1215;
    --ok:       #63bd8d;
    --warn:     #d5a052;
    --bad:      #e08076;
    --neutral:  #97a3aa;
  }
}
:root[data-theme="dark"] {
  --paper: #0f1215; --surface: #161a1e; --raised: #1d2329;
  --line: #2b333a; --line-soft: #222930;
  --ink: #e5eaed; --soft: #97a3aa; --faint: #6d7a82;
  --accent: #8bafe4; --on-accent: #0f1215;
  --ok: #63bd8d; --warn: #d5a052; --bad: #e08076; --neutral: #97a3aa;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--t-body)/1.45 var(--sans);
  -webkit-font-smoothing: antialiased;
}

/* Every digit column lines up: ages, counts, percentages, dates. */
.num, td.num, th.num, .tabular { font-variant-numeric: tabular-nums; }

/* ── shell ─────────────────────────────────────────────────────────── */

.top {
  display: flex;
  align-items: center;
  gap: var(--s5);
  min-height: var(--row-act);
  padding: 0 var(--s4);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand { font-weight: 600; font-size: var(--t-body); letter-spacing: -.01em; white-space: nowrap; }
.brand span { color: var(--faint); font-weight: 400; }

/* Flat labels, no icon rail. Only the count that matters carries a badge. */
.tabs { display: flex; gap: var(--s1); flex: 1; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }

.tabs button {
  font: 500 var(--t-2nd)/1 var(--sans);
  color: var(--soft);
  background: none;
  border: 0;
  border-radius: var(--radius);
  padding: var(--s2) var(--s3);
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: var(--s2);
}
.tabs button:hover { color: var(--ink); background: var(--raised); }
.tabs button.on { color: var(--accent); font-weight: 600; }
.tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: -1px; }

.tabs em {
  font-style: normal;
  font-family: var(--mono);
  font-size: var(--t-label);
  font-variant-numeric: tabular-nums;
  color: var(--faint);
}
.tabs button.on em { color: var(--accent); }
.tabs em[data-zero="1"] { display: none; }

.right { display: flex; align-items: center; gap: var(--s3); margin-left: auto; }
.cap { font-family: var(--mono); font-size: var(--t-label); color: var(--faint); white-space: nowrap; }
.who { font-size: var(--t-2nd); color: var(--faint); white-space: nowrap; }

/* ── buttons: fill is a privilege ──────────────────────────────────── */

.ghost, .mini {
  font: 500 var(--t-2nd)/1 var(--sans);
  color: var(--soft);
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--s2) var(--s3);
  cursor: pointer;
  white-space: nowrap;
}
.ghost:hover, .mini:hover { color: var(--ink); border-color: var(--faint); }
.ghost:focus-visible, .mini:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Exactly one of these per screen. */
.mini.primary {
  color: var(--on-accent);
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 600;
}
.mini.primary:hover { filter: brightness(1.08); color: var(--on-accent); }

/* Outbound and destructive: filled only on their own confirm screen. */
.mini.danger { color: var(--on-accent); background: var(--bad); border-color: var(--bad); font-weight: 600; }
.mini.danger:hover:not(:disabled) { filter: brightness(1.08); color: var(--on-accent); }
.mini.danger:disabled { opacity: .4; cursor: not-allowed; filter: none; }

.link {
  font: inherit; color: var(--accent); background: none; border: 0; padding: 0;
  cursor: pointer; text-decoration: underline; text-underline-offset: 2px;
}

/* ── layout ────────────────────────────────────────────────────────── */

main { padding: var(--s4); }
.tab { display: none; }
.tab.on { display: block; }

.lede { margin-bottom: var(--s4); max-width: 68ch; }
.lede h1 { font: 600 var(--t-title)/1.2 var(--sans); margin: 0 0 var(--s2); letter-spacing: -.015em; }
.lede p { margin: 0; font-size: var(--t-2nd); color: var(--soft); }

.warn {
  margin: var(--s3) var(--s4) 0;
  padding: var(--s3) var(--s4);
  font-size: var(--t-2nd);
  color: var(--warn);
  background: color-mix(in srgb, var(--warn) 8%, transparent);
  border-left: 3px solid var(--warn);
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* ── status: stripe + glyph + word. Never colour alone. ────────────── */

.chip, .pill {
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  font-family: var(--mono);
  font-size: var(--t-label);
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 2px var(--s2);
  border-radius: var(--chip-radius);
  color: var(--neutral);
  background: color-mix(in srgb, var(--neutral) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--neutral) 40%, transparent);
  white-space: nowrap;
}
.chip .g, .pill .g { font-weight: 600; }

.chip.ok,   .pill.g { color: var(--ok);     background: color-mix(in srgb, var(--ok) 8%, transparent);     border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.chip.warn, .pill.f { color: var(--warn);   background: color-mix(in srgb, var(--warn) 8%, transparent);   border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.chip.bad,  .pill.w { color: var(--bad);    background: color-mix(in srgb, var(--bad) 8%, transparent);    border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.chip.info, .pill.a { color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }

.pills { display: flex; flex-wrap: wrap; gap: var(--s2); }

/* ── tables ────────────────────────────────────────────────────────── */

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

thead th {
  height: var(--row);
  padding: 0 var(--s3);
  text-align: left;
  font: 500 var(--t-label)/1 var(--mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--faint);
  background: var(--raised);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

/* Height is fixed at 36 so ~18 rows fit a 900px viewport without scrolling the
 * shell. Vertical padding would fight that, so cells pad horizontally only and
 * nothing inside is allowed to wrap. */
tbody td {
  height: var(--row);
  padding: 0 var(--s3);
  border-bottom: 1px solid var(--line-soft);
  color: var(--soft);
  vertical-align: middle;
  white-space: nowrap;
  line-height: 1.2;
}
tbody tr:last-child td { border-bottom: 0; }
tbody td strong { color: var(--ink); font-weight: 500; }

/* The name column is the only one allowed to run long — it truncates rather
   than pushing the row taller. */
tbody td:first-child { max-width: 22rem; overflow: hidden; text-overflow: ellipsis; }

/* Chips must not out-measure the row they sit in. */
tbody .chip { line-height: 1.1; vertical-align: middle; }

/* 3px stripe, transparent by default — channel one of three. */
tbody tr { border-left: 3px solid transparent; }
tbody tr.s-ok   { border-left-color: var(--ok); }
tbody tr.s-warn { border-left-color: var(--warn); }
tbody tr.s-bad  { border-left-color: var(--bad); }

tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--raised); }
tr.clickable:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

td.num, th.num { text-align: right; font-family: var(--mono); }
.meta { font-family: var(--mono); font-size: var(--t-label); color: var(--faint); }

/* One action per row, fixed column, quiet until you need it. */
td.act { width: var(--act-col); text-align: right; padding-right: var(--s3); }
td.act .mini { opacity: .55; transition: opacity .1s; }
tr:hover td.act .mini, td.act .mini:focus-visible { opacity: 1; }
tr.waiting td.act .mini { opacity: 1; }

/* ── review queue: the row you act on ──────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid transparent;
  border-radius: var(--radius);
  padding: var(--s4);
  margin-bottom: var(--s3);
}
.card.low { border-left-color: var(--warn); }
.card .row { display: flex; justify-content: space-between; gap: var(--s4); align-items: flex-start; }
.card h3 { font: 600 var(--t-body)/1.3 var(--sans); margin: 0; }

/* Decision record, grafted from shot #02: reasoning as discrete sentences
   rather than a paragraph you skim past. */
.why {
  margin-top: var(--s3);
  padding-top: var(--s3);
  border-top: 1px solid var(--line-soft);
  display: flex; flex-direction: column; gap: var(--s2);
  font-size: var(--t-2nd); color: var(--soft);
}
.why div { display: flex; gap: var(--s2); }
.why div::before { content: "·"; color: var(--faint); }
.why b { color: var(--ink); font-weight: 600; }

.acts { display: flex; gap: var(--s2); margin-top: var(--s4); align-items: center; flex-wrap: wrap; }
.acts a { text-decoration: none; }

/* ── five states, every list ───────────────────────────────────────── */

.empty, .err {
  padding: var(--s6) var(--s4);
  text-align: center;
  font-size: var(--t-2nd);
  color: var(--faint);
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}
.empty .mini, .err .mini { margin-top: var(--s3); }
.err {
  color: var(--bad);
  border-style: solid;
  border-color: color-mix(in srgb, var(--bad) 40%, transparent);
}

/* Skeletons match the real row height so nothing jumps on load. */
.skel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.skel div {
  height: var(--row);
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(90deg, transparent, var(--raised), transparent);
  background-size: 200% 100%;
  animation: sweep 1.1s linear infinite;
}
@keyframes sweep { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skel div { animation: none; background: var(--raised); } }

/* filtered: removable chips plus an honest count */
.filters { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s3); align-items: center; }
.showing { font-family: var(--mono); font-size: var(--t-label); color: var(--faint); margin-left: auto; }

.hint { font-size: var(--t-label); color: var(--faint); margin-top: var(--s2); }
code { font-family: var(--mono); font-size: .95em; color: var(--accent); }

/* ── forms ─────────────────────────────────────────────────────────── */

label {
  display: block;
  font: 500 var(--t-label)/1 var(--mono);
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--faint); margin: var(--s4) 0 var(--s2);
}

input, select, textarea {
  font: 400 var(--t-body)/1.4 var(--sans);
  width: 100%; max-width: 32rem;
  padding: var(--s2) var(--s3);
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
}
textarea { min-height: 5rem; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent);
}

/* ── detail: a panel, never a modal ────────────────────────────────── */

.drawer {
  position: fixed; inset: 0 0 0 auto;
  width: min(34rem, 100%);
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: -8px 0 24px -16px rgba(0,0,0,.4);
  z-index: 30; overflow-y: auto;
}
.drawer[hidden] { display: none; }
.drawer-in { padding: var(--s5); }
.close { position: absolute; top: var(--s4); right: var(--s4); }

/* ── sign-in gate ──────────────────────────────────────────────────── */

.gate { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
  padding: var(--s5); background: var(--paper); }
.gate[hidden] { display: none; }

.gate-box {
  width: 100%; max-width: 19rem;
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: var(--s6) var(--s5) var(--s5);
}
.gate-box .brand { font-size: var(--t-title); margin-bottom: var(--s2); }
.gate-hint { margin: 0; font-size: var(--t-label); color: var(--faint); line-height: 1.4; }
.gate-box label { margin-top: var(--s4); }
.gate-box input { max-width: none; }
.gate-box button[type="submit"] {
  margin-top: var(--s5);
  font: 600 var(--t-body)/1 var(--sans);
  padding: var(--s3);
  color: var(--on-accent); background: var(--accent);
  border: 1px solid var(--accent); border-radius: var(--radius); cursor: pointer;
}
.gate-box button[type="submit"]:hover { filter: brightness(1.08); }
.gate-box button[type="submit"]:disabled { opacity: .5; cursor: default; filter: none; }
.gate-box button[type="submit"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.gate-error {
  margin-top: var(--s4); padding: var(--s2) var(--s3);
  font-size: var(--t-2nd); color: var(--bad);
  background: color-mix(in srgb, var(--bad) 8%, transparent);
  border-left: 3px solid var(--bad); border-radius: 0 var(--radius) var(--radius) 0;
}

/* ── send confirm: irreversible actions leave the table ────────────── */

.confirm {
  max-width: 40rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--bad);
  border-radius: var(--radius);
  padding: var(--s5);
}
.confirm h2 { font: 600 var(--t-title)/1.2 var(--sans); margin: 0 0 var(--s3); }
.consequence { font-size: var(--t-body); color: var(--ink); margin: 0 0 var(--s4); line-height: 1.5; }
.consequence b { font-weight: 600; }
.gatecheck {
  display: flex; gap: var(--s2); align-items: flex-start;
  margin: var(--s4) 0; font-size: var(--t-2nd); color: var(--soft);
}
.gatecheck input { width: auto; max-width: none; margin-top: 2px; flex: none; }

/* ── job steps: fail in place ──────────────────────────────────────── */

.steps { display: flex; flex-direction: column; }
.steps > div {
  display: grid; grid-template-columns: 20px 1fr auto; gap: var(--s3);
  padding: var(--s3) 0; border-bottom: 1px solid var(--line-soft); align-items: start;
}
.steps .mark { font-family: var(--mono); color: var(--faint); }
.steps .done .mark { color: var(--ok); }
.steps .failed .mark { color: var(--bad); }
.steps .failed .log { color: var(--bad); }
.steps .log { font-family: var(--mono); font-size: var(--t-label); color: var(--faint); }
.steps .elapsed {
  font-family: var(--mono); font-size: var(--t-label);
  font-variant-numeric: tabular-nums; color: var(--faint);
}

@media (max-width: 700px) {
  .top { flex-wrap: wrap; padding: var(--s2) var(--s3); gap: var(--s3); }
  .cap { display: none; }
  main { padding: var(--s3); }
}

/* ── log a call ────────────────────────────────────────────────────── */

.callgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s5); }
@media (max-width: 900px) { .callgrid { grid-template-columns: 1fr; } }

/* Outcome is a single choice, so these are segmented, not chips that stack. */
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.chips button {
  font: 500 var(--t-2nd)/1 var(--sans);
  color: var(--soft); background: none;
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--s2) var(--s3); cursor: pointer;
}
.chips button:hover { color: var(--ink); border-color: var(--faint); }
.chips button.on { color: var(--accent); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); font-weight: 600; }
.chips button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.actions { display: flex; align-items: center; gap: var(--s3); margin-top: var(--s5); }
.msg { font-size: var(--t-2nd); color: var(--faint); }
.msg.ok { color: var(--ok); }
.msg.bad { color: var(--bad); }

/* The assumption marks — the part that teaches the rubric. */
.assume { display: flex; flex-direction: column; gap: var(--s2); }
.assume .a {
  border: 1px solid var(--line); border-left: 3px solid var(--line);
  border-radius: var(--radius); padding: var(--s3); background: var(--surface);
}
.assume .a.held { border-left-color: var(--ok); }
.assume .a.corrected { border-left-color: var(--warn); }
.assume .a h4 { font: 600 var(--t-2nd)/1.3 var(--sans); margin: 0 0 var(--s1); color: var(--ink); }
.assume .a .val { font-family: var(--mono); font-size: var(--t-label); color: var(--faint); }
.assume .a .marks { display: flex; gap: var(--s2); margin-top: var(--s2); }
.assume .a input[type="text"] { margin-top: var(--s2); font-size: var(--t-2nd); }
.assume .empty { padding: var(--s5) var(--s3); }

/* ── import ────────────────────────────────────────────────────────── */

.drop {
  border: 1px dashed var(--line); border-radius: var(--radius);
  background: var(--surface); padding: var(--s7) var(--s5);
  text-align: center; display: flex; flex-direction: column; gap: var(--s2);
  align-items: center; color: var(--soft);
}
.drop.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, transparent); }
.drop strong { color: var(--ink); font-size: var(--t-body); font-weight: 600; }
.drop span { font-size: var(--t-2nd); }

/* ── scoreboard ────────────────────────────────────────────────────── */

.action {
  background: var(--surface); border: 1px solid var(--line);
  border-left: 3px solid var(--accent); border-radius: var(--radius);
  padding: var(--s4); margin-bottom: var(--s4); font-size: var(--t-body);
}
.action strong { color: var(--ink); font-weight: 600; }

h2.sub { font: 600 var(--t-body)/1.3 var(--sans); margin: var(--s6) 0 var(--s3); color: var(--ink); }

/* A hit rate is a number, not a status — right-aligned, plain, with an inline
   bar rather than a tint that slides with the value. */
.rate { display: flex; align-items: center; gap: var(--s2); justify-content: flex-end; }
.rate .bar { width: 48px; height: 2px; background: var(--line); position: relative; }
.rate .bar i { position: absolute; inset: 0 auto 0 0; background: var(--soft); }
.rate .n { font-family: var(--mono); font-size: var(--t-label); color: var(--faint); }

/* ── saved views, then filters ─────────────────────────────────────── */

.filters { display: block; }
.views { display: flex; gap: var(--s1); border-bottom: 1px solid var(--line); margin-bottom: var(--s3); }
.viewtab {
  font: 500 var(--t-2nd)/1 var(--sans);
  color: var(--soft); background: none; border: 0;
  border-bottom: 2px solid transparent;
  padding: var(--s2) var(--s3); margin-bottom: -1px;
  cursor: pointer; display: flex; align-items: center; gap: var(--s2);
}
.viewtab:hover { color: var(--ink); }
.viewtab.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.viewtab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.viewtab em {
  font-style: normal; font-family: var(--mono); font-size: var(--t-label);
  font-variant-numeric: tabular-nums; color: var(--faint);
}
.viewtab.on em { color: var(--accent); }

.filterrow { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.filterrow .chip { cursor: pointer; }

/* ── grouped rows: collapse instead of paginate ────────────────────── */

.group { margin-bottom: var(--s3); }
.group table { border-top-left-radius: 0; border-top-right-radius: 0; border-top: 0; }

.ghead {
  width: 100%; display: flex; align-items: center; gap: var(--s2);
  font: 500 var(--t-2nd)/1 var(--sans); color: var(--soft);
  background: var(--raised); border: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: var(--s2) var(--s3); cursor: pointer; text-align: left;
}
.ghead:hover { color: var(--ink); }
.ghead:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.ghead .tw { font-family: var(--mono); color: var(--faint); width: 12px; }
.ghead em {
  font-style: normal; margin-left: auto;
  font-family: var(--mono); font-size: var(--t-label);
  font-variant-numeric: tabular-nums; color: var(--faint);
}
.group:has(.ghead[aria-expanded="false"]) .ghead { border-radius: var(--radius); }

/* An empty cell reads as a rendering bug. Say nothing on purpose. */
.none { color: var(--faint); }

/* ── build progress ────────────────────────────────────────────────── */

.pbar {
  display: inline-block; width: 72px; height: 3px;
  background: var(--line); vertical-align: middle; margin-right: var(--s2);
  position: relative; overflow: hidden;
}
.pbar i { position: absolute; inset: 0 auto 0 0; background: var(--soft); transition: width .3s; }
.pbar i.ok { background: var(--ok); }
.pbar i.bad { background: var(--bad); }
.pct { font-family: var(--mono); font-size: var(--t-label); font-variant-numeric: tabular-nums; color: var(--faint); }

.runner:empty { display: none; }

.joberr {
  padding: var(--s2) 0; font-size: var(--t-2nd); color: var(--bad);
  display: flex; flex-direction: column; gap: var(--s1);
}
.joberr b { font-weight: 600; }

.msgbody { font-family: var(--mono); font-size: var(--t-label); white-space: pre-wrap;
  background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--s3); margin: var(--s3) 0 0; color: var(--soft); }

.rowstatus { font: 400 var(--t-label)/1 var(--sans); color: var(--soft); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 3px 4px; width: auto; max-width: none; }
.rowstatus:hover { border-color: var(--faint); color: var(--ink); }
td.act:last-child { width: 84px; }

/* View demo — a link, not a button, so the row keeps its single action.
   Opening the demo is how you decide whether to use that action. */
.viewdemo {
  font-family: var(--mono);
  font-size: var(--t-label);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  padding-bottom: 1px;
  white-space: nowrap;
}
.viewdemo:hover { border-bottom-color: var(--accent); }
.viewdemo:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
