/* ============================================================================
   Meta Sidecar — admin dashboard styles.

   A light, high-contrast operator UI. Design rules, so later edits stay
   coherent:

   1. Colour carries ONE meaning: status. Green/amber/red never decorate.
      A single blue is the only brand accent (primary actions + focus).
   2. Status is never colour alone — every status also carries a glyph.
   3. Three button variants exist. Primary (one per screen), secondary,
      quiet. Destructive is a modifier, never a fourth colour of button.
   4. Text ramp is three steps: --ink, --ink-2, --ink-3. All clear 4.5:1
      on --surface. Nothing lighter than --ink-3 may carry words.
   5. No uppercase micro-labels, no letter-spacing tricks, no glow.
      Hierarchy comes from size, weight and space.
   ========================================================================== */

:root {
  /* surfaces */
  --page: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #f8fafb;   /* table heads, inset panels */
  --surface-3: #eef1f5;   /* hover */
  --line: #dfe4e9;
  --line-strong: #c6cfd8;

  /* text — all AA on --surface */
  --ink: #151b23;         /* 15.8:1 */
  --ink-2: #4b5563;       /*  7.6:1 */
  --ink-3: #626c78;       /*  5.3:1 on white; ≥4.7:1 on every tint below */

  /* the one accent */
  --accent: #1b5fc1;      /*  6.1:1 — also white-on-accent 6.1:1 */
  --accent-dark: #17509f;
  --accent-tint: #e9f1fd;
  --accent-line: #bcd4f5;

  /* status — text colours, all AA on white */
  --ok: #0e6f3d;
  --warn: #8a5300;
  --bad: #b42318;
  --info: var(--accent);
  --idle: var(--ink-3);

  /* status — tints */
  --ok-tint: #e8f5ee;    --ok-line: #b7e0c8;
  --warn-tint: #fdf4e3;  --warn-line: #f0d9a8;
  --bad-tint: #fdeceb;   --bad-line: #f5c2bc;
  --idle-tint: #f0f2f5;  --idle-line: #dfe4e9;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(21, 27, 35, .05), 0 1px 3px rgba(21, 27, 35, .04);
  --shadow-lift: 0 4px 12px rgba(21, 27, 35, .08);
  --topbar-h: 56px;
}

* { box-sizing: border-box; }

/* Class-based display rules (.signin, .rollup, …) outrank the UA stylesheet's
   [hidden] rule, so hiding a view by attribute silently fails without this. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 15px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 21px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0; }

a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-dark); }

code, .mono {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: .92em;
}

/* Numbers line up wherever they're compared. */
.num, td.num, th.num, .tabular { font-variant-numeric: tabular-nums; text-align: right; }

.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: 13px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--surface); color: var(--accent); padding: 10px 14px;
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lift);
  transition: top .12s ease;
}
.skip:focus { top: 12px; }

/* Focus: one ring, everywhere, always visible. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ---------------------------------------------------------------- topbar -- */

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  height: var(--topbar-h);
}
.topbar-in {
  max-width: 1180px; margin: 0 auto; height: 100%;
  padding: 0 20px; display: flex; align-items: center; gap: 12px;
}
.brand { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.brand-name { font-weight: 650; font-size: 15px; letter-spacing: -.01em; }
.brand-origin {
  color: var(--ink-3); font-size: 12.5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.sysstatus {
  margin-left: auto; display: flex; align-items: center; gap: 7px;
  font-size: 13px; color: var(--ink-2); white-space: nowrap;
}
.sysdot {
  width: 8px; height: 8px; border-radius: 99px;
  background: var(--idle); flex: none;
}
.sysstatus.is-ok .sysdot { background: var(--ok); }
.sysstatus.is-bad .sysdot { background: var(--bad); }
.sysstatus.is-bad { color: var(--bad); font-weight: 550; }

/* ----------------------------------------------------------------- shell -- */

.shell { max-width: 1180px; margin: 0 auto; padding: 24px 20px 96px; }

.pagehead {
  display: flex; align-items: flex-end; gap: 16px;
  flex-wrap: wrap; margin-bottom: 18px;
}
.pagehead-actions { margin-left: auto; display: flex; gap: 8px; }

/* ----------------------------------------------------------------- cards -- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 16px; }
.card-pad { padding: 20px; }
.card-flush { overflow: hidden; }

.card-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.card-head p { color: var(--ink-2); font-size: 13.5px; }
.card-head .card-head-actions { margin-left: auto; display: flex; gap: 8px; }
.card-body { padding: 20px; }

/* --------------------------------------------------------------- buttons -- */

.btn {
  --btn-bg: var(--surface);
  --btn-fg: var(--ink);
  --btn-line: var(--line-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--btn-bg); color: var(--btn-fg);
  border: 1px solid var(--btn-line);
  border-radius: var(--radius-sm);
  padding: 8px 14px; min-height: 36px;
  font: inherit; font-size: 14px; font-weight: 550;
  cursor: pointer; white-space: nowrap;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.btn:hover:not(:disabled) { background: var(--surface-3); }

.btn-primary {
  --btn-bg: var(--accent); --btn-fg: #fff; --btn-line: var(--accent);
}
.btn-primary:hover:not(:disabled) { background: var(--accent-dark); border-color: var(--accent-dark); }

.btn-quiet { --btn-bg: transparent; --btn-line: transparent; --btn-fg: var(--ink-2); }
.btn-quiet:hover:not(:disabled) { background: var(--surface-3); color: var(--ink); }

.btn-danger { --btn-fg: var(--bad); --btn-line: var(--bad-line); }
.btn-danger:hover:not(:disabled) { background: var(--bad-tint); }

.btn-block { width: 100%; }
.btn-sm { min-height: 30px; padding: 4px 10px; font-size: 13px; }

.btn:disabled { opacity: .5; cursor: not-allowed; }

/* Busy state: the label swaps to a gerund in JS, the spinner marks the wait. */
.btn.is-busy { cursor: progress; }
.btn.is-busy::before {
  content: ""; width: 13px; height: 13px; flex: none;
  border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 99px; animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .btn.is-busy::before { animation-duration: 2s; }
}

.actionbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}
.actionbar .spacer { margin-left: auto; }
.actionbar-note { color: var(--ink-2); font-size: 13px; max-width: 62ch; }

/* ----------------------------------------------------------------- forms -- */

.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.field > label,
.field-label {
  display: block; font-size: 13.5px; font-weight: 600;
  color: var(--ink); margin-bottom: 5px;
}
.field .help {
  font-size: 13px; color: var(--ink-2); margin-top: 6px; line-height: 1.5;
}

input[type=text], input[type=password], input[type=number], input[type=url], select, textarea {
  width: 100%;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  font: inherit; font-size: 14px;
}
input::placeholder { color: var(--ink-3); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-tint);
}
input:disabled, select:disabled {
  background: var(--surface-2); color: var(--ink-2); cursor: not-allowed;
}
select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%236b7683' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  padding-right: 32px;
}

.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.fieldset { border: 0; padding: 0; margin: 0 0 24px; }
.fieldset:last-child { margin-bottom: 0; }
.fieldset > legend,
.group-title {
  padding: 0; margin-bottom: 4px;
  font-size: 15px; font-weight: 600; color: var(--ink);
}
.group-note {
  font-size: 13px; color: var(--ink-2); margin-bottom: 14px; max-width: 72ch;
}

/* checkbox rows */
.check-row {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 14px; line-height: 1.5;
}
.check-row input[type=checkbox] { width: auto; margin: 3px 0 0; flex: none; }
input[type=checkbox], input[type=radio] {
  accent-color: var(--accent); width: 16px; height: 16px;
}

/* toggle switch */
.switch { display: inline-flex; align-items: center; cursor: pointer; flex: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track {
  width: 38px; height: 22px; border-radius: 99px;
  background: var(--line-strong); position: relative;
  transition: background .14s ease;
}
.switch-track::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px; border-radius: 99px; background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.2);
  transition: transform .14s ease;
}
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch-track {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

/* ---------------------------------------------------------------- tables -- */

.tablewrap { overflow-x: auto; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
  text-align: left; padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 14px; vertical-align: middle;
}
.table thead th {
  background: var(--surface-2);
  color: var(--ink-2); font-size: 13px; font-weight: 600;
  white-space: nowrap;
}
.table tbody tr:last-child td { border-bottom: 0; }
/* Must outrank `.table th/td`, which sets text-align:left at equal
   specificity and is declared later in the file. */
.table th.num, .table td.num { text-align: right; font-variant-numeric: tabular-nums; }
/* Keeps count columns shrink-to-fit so the figures sit near each other
   instead of being flung to the far edges of a full-width table. */
.stats-table { max-width: 720px; }

.table tbody tr.is-clickable { cursor: pointer; }
.table tbody tr.is-clickable:hover { background: var(--accent-tint); }
.table tbody tr.is-clickable:focus-within { background: var(--accent-tint); }

.rowlink {
  background: none; border: 0; padding: 0; font: inherit; color: inherit;
  cursor: pointer; text-align: left; font-weight: 600;
}
.rowlink:hover { color: var(--accent); }

.cell-sub { color: var(--ink-3); font-size: 13px; }
.table td.nowrap, .table th.nowrap { white-space: nowrap; }

.empty { padding: 44px 20px; text-align: center; }
.empty h3 { margin-bottom: 6px; }
.empty p { color: var(--ink-2); max-width: 46ch; margin: 0 auto 16px; }

/* ----------------------------------------------------------- status bits -- */

/* Pill: tinted surface + glyph + word. Never colour alone. */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; white-space: nowrap;
  padding: 3px 10px; border-radius: 99px;
  background: var(--idle-tint); border: 1px solid var(--idle-line); color: var(--ink-2);
}
.pill::before { content: "○"; font-size: 11px; line-height: 1; }
.pill.is-ok    { background: var(--ok-tint);   border-color: var(--ok-line);   color: var(--ok); }
.pill.is-ok::before { content: "●"; }
.pill.is-test  { background: var(--accent-tint); border-color: var(--accent-line); color: var(--accent); }
.pill.is-test::before { content: "◐"; }
.pill.is-warn  { background: var(--warn-tint); border-color: var(--warn-line); color: var(--warn); }
.pill.is-warn::before { content: "▲"; font-size: 9px; }
.pill.is-bad   { background: var(--bad-tint);  border-color: var(--bad-line);  color: var(--bad); }
.pill.is-bad::before { content: "■"; font-size: 9px; }
.pill.is-setup::before { content: "◔"; }

/* Mark: the small square glyph used in rails, check rows and results. */
.mark {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 99px;
  font-size: 11px; font-weight: 700; line-height: 1;
  background: var(--idle-tint); color: var(--ink-3);
}
.mark::before { content: "·"; }
.mark.is-pass { background: var(--ok-tint); color: var(--ok); }
.mark.is-pass::before { content: "✓"; }
.mark.is-warn { background: var(--warn-tint); color: var(--warn); }
.mark.is-warn::before { content: "!"; }
.mark.is-fail { background: var(--bad-tint); color: var(--bad); }
.mark.is-fail::before { content: "✕"; }
.mark.is-pending { background: var(--idle-tint); color: var(--ink-3); }
.mark.is-pending::before { content: "○"; }
.mark.is-off { background: var(--idle-tint); color: var(--ink-3); }
.mark.is-off::before { content: "–"; }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12.5px; font-weight: 550;
  padding: 2px 8px; border-radius: 99px;
  background: var(--idle-tint); border: 1px solid var(--idle-line); color: var(--ink-3);
  margin: 2px 4px 2px 0;
}
.chip.is-on { background: var(--ok-tint); border-color: var(--ok-line); color: var(--ok); }

/* Callout: explanatory prose that isn't a status. */
.callout {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13.5px; color: var(--ink-2); line-height: 1.55;
}
.callout + .callout { margin-top: 10px; }
.callout strong, .callout b { color: var(--ink); font-weight: 600; }
.callout.is-info { background: var(--accent-tint); border-color: var(--accent-line); border-left-color: var(--accent); }
.callout.is-warn { background: var(--warn-tint); border-color: var(--warn-line); border-left-color: var(--warn); }
.callout.is-bad  { background: var(--bad-tint);  border-color: var(--bad-line);  border-left-color: var(--bad); }

.codeblock {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 12px 14px; margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px; color: var(--ink); overflow-x: auto;
  white-space: pre; line-height: 1.6;
}

/* ------------------------------------------------------------- workspace -- */

.storebar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 16px;
  margin-bottom: 20px;
}
.storebar-id { display: flex; align-items: baseline; gap: 9px; min-width: 0; }
.storebar-id h1 { font-size: 18px; }
.storebar-id .handle {
  color: var(--ink-3); font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.storebar-end { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.dirty {
  font-size: 13px; font-weight: 600; color: var(--warn);
  display: inline-flex; align-items: center; gap: 6px;
}
.dirty::before { content: "●"; font-size: 8px; }

.savemsg { font-size: 13px; color: var(--ink-2); }
.savemsg.is-ok { color: var(--ok); font-weight: 550; }
.savemsg.is-bad { color: var(--bad); font-weight: 550; }

.workspace {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

/* rail */
.rail { position: sticky; top: 84px; }
.rail-group + .rail-group { margin-top: 18px; }
.rail-title {
  font-size: 13px; font-weight: 600; color: var(--ink-3);
  padding: 0 10px; margin-bottom: 6px;
}
.rail-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: none; border: 0; border-radius: var(--radius-sm);
  padding: 9px 10px; font: inherit; font-size: 14px; font-weight: 500;
  color: var(--ink-2); cursor: pointer; text-align: left;
  transition: background .12s ease, color .12s ease;
}
.rail-item:hover { background: var(--surface-3); color: var(--ink); }
.rail-item[aria-current="true"] {
  background: var(--accent-tint); color: var(--accent); font-weight: 600;
}
.rail-num {
  flex: none; width: 18px; height: 18px; border-radius: 99px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  background: var(--idle-tint); color: var(--ink-3);
}
.rail-item[aria-current="true"] .rail-num { background: var(--accent); color: #fff; }
.rail-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* pane */
.section { display: none; }
.section.is-active { display: block; }

.section-head { margin-bottom: 16px; }
.section-head h2 { margin-bottom: 4px; }
.section-head p { color: var(--ink-2); font-size: 14px; max-width: 76ch; }

/* ---------------------------------------------------------- event cards -- */

.evcard {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  margin-bottom: 14px; overflow: hidden;
}
.evcard-head {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 16px 18px;
}
.evcard-id { flex: 1; min-width: 0; }
.evcard-id h3 { margin-bottom: 2px; }
.evcard-id p { color: var(--ink-2); font-size: 13.5px; line-height: 1.5; }
.evcard-state { flex: none; }
.evcard-body {
  padding: 0 18px 18px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.evcard.is-off .evcard-body { display: none; }
.evcard.is-off .evcard-head { padding-bottom: 16px; }

.subcard {
  margin-top: 16px; padding: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.subcard-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 4px; }
.subcard-head h4 { font-size: 14px; font-weight: 600; }
.subcard-head p { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.subcard-body { margin-top: 14px; }
.subcard.is-off .subcard-body { display: none; }

/* ---------------------------------------------------------- status board -- */

.rollup {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 18px 20px;
}
.rollup-text { flex: 1; min-width: 220px; }
.rollup-text h2 { margin-bottom: 3px; }
.rollup-text p { color: var(--ink-2); font-size: 13.5px; }
.rollup-score {
  font-size: 13px; color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.checklist { padding: 4px 0; }
.check-group-title {
  font-size: 13px; font-weight: 600; color: var(--ink-3);
  padding: 14px 20px 6px;
}
/* Divides the "what's wrong" summary from the full grouped list, so the
   repeated rows read as detail rather than duplication. */
.check-all-title {
  font-size: 14px; font-weight: 600; color: var(--ink);
  padding: 14px 20px 10px; margin-top: 8px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}
.checkline {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 9px 20px;
  border-top: 1px solid var(--line);
  font-size: 14px; line-height: 1.5;
}
.checkline .cmsg { flex: 1; min-width: 0; }
.checkline .crit {
  color: var(--bad); font-weight: 650; font-size: 12.5px;
  margin-left: 4px; white-space: nowrap;
}
.checkline .cfix {
  flex: none; font-size: 13px; font-weight: 550;
  background: none; border: 0; padding: 2px 4px; cursor: pointer;
  color: var(--accent); border-radius: 4px;
}
.checkline .cfix:hover { background: var(--accent-tint); text-decoration: underline; }
.checkline .cfix-static { flex: none; font-size: 13px; color: var(--ink-3); }

/* ---------------------------------------------------------------- result -- */

.result { margin: 0; border-top: 1px solid var(--line); }
.result-head {
  padding: 12px 20px 4px;
  font-size: 14px; font-weight: 600; color: var(--ink);
}
.rrow {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 7px 20px; font-size: 14px; line-height: 1.5;
}
.rrow:last-child { padding-bottom: 14px; }
.rrow .rk {
  flex: none; min-width: 130px; color: var(--ink-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px;
}
.rrow .rv { flex: 1; min-width: 0; word-break: break-word; }

.pf-lines { margin-top: 6px; font-size: 13px; line-height: 1.65; }
.pf-line { display: flex; gap: 7px; align-items: flex-start; }
.pf-line .pf-mark { flex: none; font-weight: 700; }
.pf-line.is-pass .pf-mark { color: var(--ok); }
.pf-line.is-fail .pf-mark { color: var(--bad); }
.pf-line.is-warn .pf-mark { color: var(--warn); }
.pf-line.is-manual .pf-mark, .pf-line.is-unknown .pf-mark { color: var(--ink-3); }
.pf-line.is-fail { color: var(--bad); font-weight: 550; }

/* ----------------------------------------------------------- gate + acks -- */

.gate {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 14px 16px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: 14px; line-height: 1.5;
}

.acklist { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.ack {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 13px 15px; font-size: 14px; line-height: 1.5;
}
.ack + .ack { border-top: 1px solid var(--line); }
.ack input { margin-top: 3px; flex: none; }
.ack-body { flex: 1; min-width: 0; }

/* --------------------------------------------------------------- signin -- */

.signin { display: flex; justify-content: center; padding-top: 8vh; }
.signin-card { width: 100%; max-width: 380px; padding: 28px; }
.signin-card h1 { margin-bottom: 6px; }
.signin-card > p { margin-bottom: 20px; color: var(--ink-2); font-size: 14px; }
.formerr { margin-top: 12px; font-size: 13.5px; color: var(--bad); min-height: 1.4em; }

.prefill {
  margin-top: 14px; display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap; font-size: 13.5px;
}

/* ------------------------------------------------------------- live feed -- */

/* "Live" pulse in the card head — visible only while the feed is polling. */
.feedlive { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ok); }
.feedlive-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--ok);
  animation: feedpulse 1.8s ease-out infinite;
}
@keyframes feedpulse {
  0%   { box-shadow: 0 0 0 0 rgba(14,111,61,0.45); }
  70%  { box-shadow: 0 0 0 6px rgba(14,111,61,0); }
  100% { box-shadow: 0 0 0 0 rgba(14,111,61,0); }
}

.feed { display: flex; flex-direction: column; }
.feed-row {
  padding: 10px 20px; border-top: 1px solid var(--line); font-size: 13.5px;
}
.feed-row:first-child { border-top: none; }
/* A just-arrived row flashes once so new events catch the eye. */
.feed-row.is-new { animation: feedflash 1.2s ease-out; }
@keyframes feedflash { from { background: var(--accent-tint); } to { background: transparent; } }

.feed-line { display: flex; align-items: baseline; gap: 10px; }
.feed-time { flex: none; width: 64px; color: var(--ink-3); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.feed-name { font-weight: 600; color: var(--ink); }
.feed-value { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.feed-badges { margin-left: auto; flex: none; display: flex; gap: 5px; align-items: baseline; }

/* Source payload line — the matchable detail. */
.feed-detail {
  margin-top: 4px; margin-left: 74px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px; line-height: 1.7; color: var(--ink-2); word-break: break-word;
}
.feed-kv .feed-k { color: var(--ink-3); }
.feed-kv .feed-v { color: var(--ink); }
.feed-sep { color: var(--line-strong); margin: 0 7px; }
.feed-matchkeys { color: var(--ink-3); }
.feed-badge {
  font-size: 11.5px; font-weight: 600; padding: 1px 7px; border-radius: 99px; white-space: nowrap;
  background: var(--idle-tint); border: 1px solid var(--idle-line); color: var(--ink-3);
}
.feed-badge.is-sent { background: var(--ok-tint); border-color: var(--ok-line); color: var(--ok); }
.feed-badge.is-failed { background: var(--bad-tint); border-color: var(--bad-line); color: var(--bad); }
.feed-badge.is-test { background: var(--warn-tint); border-color: var(--warn-line); color: var(--warn); }
.feed-badge.is-replay { background: var(--accent-tint); border-color: var(--accent-line); color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  .feedlive-dot, .feed-row.is-new { animation: none; }
}

/* ------------------------------------------------------------ responsive -- */

@media (max-width: 900px) {
  .workspace { grid-template-columns: 1fr; gap: 16px; }
  .rail {
    position: static;
    display: flex; gap: 6px; overflow-x: auto;
    padding-bottom: 6px; margin: 0 -20px; padding-left: 20px; padding-right: 20px;
    scrollbar-width: thin;
  }
  .rail-group { display: contents; }
  .rail-title { display: none; }
  .rail-item {
    width: auto; flex: none; white-space: nowrap;
    border: 1px solid var(--line); background: var(--surface);
  }
  .rail-item[aria-current="true"] { border-color: var(--accent-line); }
  .storebar { position: static; }
  .g2, .g3 { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .shell { padding: 16px 14px 72px; }
  .topbar-in { padding: 0 14px; }
  .brand-origin { display: none; }
  .card-body, .rollup { padding: 16px; }
  .actionbar { padding: 12px 16px; }
  .checkline, .rrow, .check-group-title, .result-head, .feed-row { padding-left: 16px; padding-right: 16px; }
  .feed-detail { margin-left: 0; }
  .table th, .table td { padding: 11px 12px; }
  .btn { min-height: 40px; }              /* comfortable touch target */
  .actionbar .btn { flex: 1 1 auto; }
  .storebar-end { width: 100%; margin-left: 0; }
  .storebar-end .btn-primary { margin-left: auto; }
  .rrow { flex-direction: column; gap: 2px; }
  .rrow .rk { min-width: 0; }
  /* Stack the roll-up so the score and action can't be squeezed off-screen. */
  .rollup { flex-direction: column; align-items: stretch; gap: 10px; }
  .rollup-text { min-width: 0; }
  .checkline { flex-wrap: wrap; }
  .checkline .cfix { margin-left: 29px; }
}
