/* Hallmark · genre: modern-minimal · macrostructure: instrument-panel
 * theme: custom dark-committed · nav: N3 side-rail
 * Every colour and font here references a token. No inline values.
 */

*, *::before, *::after { box-sizing: border-box; }

/* A class-level `display` beats the UA sheet's [hidden] rule, so anything laid
 * out with grid/flex would stay on screen after `node.hidden = true`. Restate
 * the intent once, here, rather than per component. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  overflow-x: clip;
}

body {
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--text-base);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-style: normal;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0;
  text-wrap: balance;
}

a { color: var(--signal); text-decoration-thickness: 1px; text-underline-offset: 2px; }

:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.mono { font-family: var(--font-data); font-variant-numeric: tabular-nums; }
.num  { font-family: var(--font-data); font-variant-numeric: tabular-nums; text-align: right; }
.vh   { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* ============ shell ============ */

.shell {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: 100dvh;
}

/* ---- N3 side rail ---- */

.rail {
  background: var(--surface);
  border-right: var(--rule) solid var(--line);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-5) var(--space-3) var(--space-4);
  position: sticky;
  top: 0;
  height: 100dvh;
  z-index: var(--z-sticky);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0 var(--space-2) var(--space-4);
}
.brand-mark {
  width: 22px; height: 22px;
  flex: none;
  color: var(--ink);
}
.brand-name {
  font-size: var(--text-md);
  font-weight: 600;
  letter-spacing: -0.02em;
}
.brand-env {
  font-family: var(--font-data);
  font-size: var(--text-xs);
  color: var(--muted);
  border: var(--rule) solid var(--line);
  border-radius: var(--radius-sm);
  padding: 1px var(--space-1);
  margin-left: auto;
}

.rail-group { display: flex; flex-direction: column; gap: 2px; }
.rail-label {
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: var(--space-3) var(--space-2) var(--space-1);
}

.rail-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-2);
  border-radius: var(--radius-md);
  color: var(--ink-dim);
  background: none;
  border: 0;
  font: inherit;
  text-align: left;
  cursor: pointer;
  width: 100%;
  transition: background-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}
.rail-item svg { width: 15px; height: 15px; flex: none; opacity: 0.85; }
.rail-item:hover { background: var(--surface-2); color: var(--ink); }
.rail-item[aria-current="page"] {
  background: var(--signal-weak);
  color: var(--ink);
}
.rail-item .count {
  margin-left: auto;
  font-family: var(--font-data);
  font-size: var(--text-xs);
  color: var(--muted);
}
.rail-item[aria-current="page"] .count { color: var(--ink-dim); }

.rail-foot {
  margin-top: auto;
  border-top: var(--rule) solid var(--line-soft);
  padding-top: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* live indicator — the one piece of ambient motion in the system */
.live {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--muted);
  padding: 0 var(--space-2);
}
.live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ok);
  animation: pulse 2s var(--ease-in-out) infinite;
}
.live[data-state="paused"] .live-dot { background: var(--muted); animation: none; }
.live[data-state="error"]  .live-dot { background: var(--bad); animation: none; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ============ main ============ */

.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-6);
  border-bottom: var(--rule) solid var(--line);
  background: var(--ground);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
}
.topbar h1 { font-size: var(--text-lg); }
.topbar .spacer { margin-left: auto; }

.view { padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-6); }
.view[hidden] { display: none; }

.lede { color: var(--ink-dim); max-width: 68ch; margin: 0; }

/* ---- health strip ---- */

.strip {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.stat {
  background: var(--surface);
  border: var(--rule) solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
}
.stat-label {
  font-size: var(--text-xs);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.stat-value {
  font-family: var(--font-data);
  font-variant-numeric: tabular-nums;
  font-size: var(--text-xl);
  line-height: 1.1;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}
.stat-note { font-size: var(--text-xs); color: var(--muted); }
.stat-value[data-tone="ok"]   { color: var(--ok); }
.stat-value[data-tone="bad"]  { color: var(--bad); }
.stat-value[data-tone="warn"] { color: var(--warn); }
.stat-value[data-tone="none"] { color: var(--muted); }

/* ---- panels ---- */

.panel {
  background: var(--surface);
  border: var(--rule) solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.panel-head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: var(--rule) solid var(--line-soft);
  background: var(--surface-2);
}
.panel-head h2 { font-size: var(--text-base); font-weight: 600; }
.panel-head .spacer { margin-left: auto; }
.panel-body { padding: var(--space-4); }

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

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: var(--text-sm); }
th, td {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  border-bottom: var(--rule) solid var(--line-soft);
  white-space: nowrap;
}
th {
  font-size: var(--text-xs);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  background: var(--surface-2);
  position: sticky;
  top: 0;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background-color var(--dur-fast) var(--ease-out); }
tbody tr[data-clickable]:hover { background: var(--surface-2); cursor: pointer; }
tbody tr[aria-selected="true"] { background: var(--surface-3); }
td.wrap { white-space: normal; overflow-wrap: anywhere; }

/* ---- status: colour AND label, never colour alone ---- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-data);
  font-size: var(--text-xs);
  padding: 2px var(--space-2);
  border-radius: 999px;
  white-space: nowrap;
}
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; flex: none; }
.chip[data-tone="ok"]   { background: var(--ok-weak);   color: var(--ok); }
.chip[data-tone="ok"]::before   { background: var(--ok); }
.chip[data-tone="bad"]  { background: var(--bad-weak);  color: var(--bad); }
.chip[data-tone="bad"]::before  { background: var(--bad); }
.chip[data-tone="warn"] { background: var(--warn-weak); color: var(--warn); }
.chip[data-tone="warn"]::before { background: var(--warn); }
.chip[data-tone="idle"] { background: var(--surface-3); color: var(--ink-dim); }
.chip[data-tone="idle"]::before { background: var(--muted); }

/* ---- buttons: all eight states ---- */

.btn {
  font: inherit;
  font-size: var(--text-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  white-space: nowrap;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  border: var(--rule) solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}
.btn:hover, .btn.is-hover { background: var(--surface-3); }
.btn:active, .btn.is-active { background: var(--surface-2); transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] {
  opacity: 0.45; cursor: not-allowed; background: var(--surface);
}
.btn[data-state="loading"] { color: var(--muted); pointer-events: none; }
.btn[data-state="loading"]::before {
  content: ""; width: 11px; height: 11px; border-radius: 50%;
  border: 2px solid var(--line); border-top-color: var(--ink-dim);
  animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn[data-state="error"]   { border-color: var(--bad); color: var(--bad); }
.btn[data-state="success"] { border-color: var(--ok); color: var(--ok); }

.btn--primary {
  background: var(--signal);
  border-color: var(--signal);
  color: var(--ground);
  font-weight: 550;
}
.btn--primary:hover, .btn--primary.is-hover { background: oklch(from var(--signal) calc(l + 0.06) c h); }
.btn--primary:disabled { background: var(--signal); }
.btn--danger:hover { border-color: var(--bad); color: var(--bad); }
.btn--quiet { background: none; border-color: transparent; color: var(--ink-dim); }
.btn--quiet:hover { background: var(--surface-2); color: var(--ink); }
.btn--sm { padding: var(--space-1) var(--space-2); font-size: var(--text-xs); }

/* ---- inputs ---- */

.field { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.field label { font-size: var(--text-sm); color: var(--ink-dim); }
.input {
  font: inherit;
  font-size: var(--text-sm);
  font-family: var(--font-data);
  background: var(--ground);
  border: var(--rule) solid var(--line);
  border-radius: var(--radius-md);
  color: var(--ink);
  padding: var(--space-2) var(--space-3);
  width: 100%;
  min-width: 0;
  transition: border-color var(--dur-fast) var(--ease-out);
}
.input:hover { border-color: var(--surface-3); }
.input::placeholder { color: var(--muted); }
.input:disabled { opacity: 0.5; }
.input[aria-invalid="true"] { border-color: var(--bad); }
select.input { font-family: var(--font-ui); }

/* ---- empty + error states teach the next action ---- */

.empty {
  padding: var(--space-10) var(--space-6);
  text-align: center;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  align-items: center;
}
.empty strong { color: var(--ink-dim); font-weight: 500; }
.empty code {
  font-family: var(--font-data);
  font-size: var(--text-xs);
  background: var(--ground);
  border: var(--rule) solid var(--line);
  border-radius: var(--radius-sm);
  padding: 2px var(--space-2);
  overflow-wrap: anywhere;
}

.notice {
  border: var(--rule) solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  color: var(--ink-dim);
  background: var(--surface-2);
}
.notice[data-tone="bad"]  { border-color: var(--bad);  background: var(--bad-weak);  color: var(--ink); }
.notice[data-tone="warn"] { border-color: var(--warn); background: var(--warn-weak); color: var(--ink); }
.notice[data-tone="ok"]   { border-color: var(--ok);   background: var(--ok-weak);   color: var(--ink); }

/* ---- drawer: the delivery timeline ---- */

.overlay {
  position: fixed;
  inset: 0;
  background: var(--scrim);
  z-index: var(--z-overlay);
  animation: fade var(--dur-base) var(--ease-out);
}
.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  /* 100% not 100vw: on a phone 100vw includes the scrollbar gutter, which
   * pushes a right-anchored panel off the left edge and quietly clips its
   * padding. Measured at 375px in a real browser. */
  width: min(620px, 100%);
  max-width: 100%;
  background: var(--surface);
  border-left: var(--rule) solid var(--line);
  z-index: var(--z-drawer);
  display: flex;
  flex-direction: column;
  animation: slide var(--dur-base) var(--ease-out);
}
@keyframes fade  { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(16px); opacity: 0; } }
.drawer-head {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-bottom: var(--rule) solid var(--line-soft);
}
.drawer-body { padding: var(--space-5); overflow-y: auto; display: flex; flex-direction: column; gap: var(--space-5); }

.kv { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: var(--space-2) var(--space-4); font-size: var(--text-sm); }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-family: var(--font-data); overflow-wrap: anywhere; }

pre.payload {
  margin: 0;
  font-family: var(--font-data);
  font-size: var(--text-xs);
  line-height: 1.6;
  background: var(--ground);
  border: var(--rule) solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  overflow-x: auto;
  color: var(--ink-dim);
}

/* attempt timeline — the debugging centrepiece */
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.attempt {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: var(--space-3);
  padding-bottom: var(--space-4);
  position: relative;
}
.attempt:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 9px; top: 18px; bottom: 0;
  width: var(--rule);
  background: var(--line);
}
.attempt-dot {
  width: 9px; height: 9px; border-radius: 50%;
  margin: 5px auto 0;
  position: relative;
  z-index: var(--z-base);
}
.attempt[data-tone="ok"]   .attempt-dot { background: var(--ok); }
.attempt[data-tone="bad"]  .attempt-dot { background: var(--bad); }
.attempt[data-tone="warn"] .attempt-dot { background: var(--warn); }
.attempt-main { min-width: 0; display: flex; flex-direction: column; gap: var(--space-1); }
.attempt-line { display: flex; align-items: baseline; gap: var(--space-3); flex-wrap: wrap; }
.attempt-no { font-family: var(--font-data); font-size: var(--text-sm); }
.attempt-meta { font-size: var(--text-xs); color: var(--muted); font-family: var(--font-data); }
.attempt-body {
  font-family: var(--font-data);
  font-size: var(--text-xs);
  color: var(--ink-dim);
  background: var(--ground);
  border: var(--rule) solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: var(--space-2);
  overflow-x: auto;
}

/* ---- toast: failures and async only, never celebration ---- */

.toasts {
  position: fixed;
  bottom: var(--space-4); right: var(--space-4);
  z-index: var(--z-toast);
  display: flex; flex-direction: column; gap: var(--space-2);
  width: min(360px, calc(100% - var(--space-8)));
}
.toast {
  background: var(--surface-2);
  border: var(--rule) solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  display: flex; align-items: flex-start; gap: var(--space-3);
  animation: slide var(--dur-base) var(--ease-out);
}
.toast[data-tone="bad"] { border-color: var(--bad); }
/* Reserved for an outcome that is genuinely positive and genuinely
 * happened — a confirmed address, not a saved form. */
.toast[data-tone="ok"]  { border-color: var(--ok); }
.toast .spacer { margin-left: auto; }

/* ---- sign-in / sign-up ---- */

.gate {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: var(--space-6);
}
.gate-card {
  width: min(440px, 100%);
  background: var(--surface);
  border: var(--rule) solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  display: flex; flex-direction: column; gap: var(--space-5);
}
.gate-brand { display: flex; align-items: center; gap: var(--space-3); }
.gate h1 { font-size: var(--text-xl); }

/* Two doors, one card. The selected one is marked by the interactive colour
 * and a rule, never by a filled pill — a filled tab reads as a button. */
.tabs {
  display: flex;
  gap: var(--space-1);
  border-bottom: var(--rule) solid var(--line);
}
.tab {
  font: inherit;
  font-size: var(--text-sm);
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  padding: var(--space-2) var(--space-3);
  margin-bottom: -1px;
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out);
}
.tab:hover { color: var(--ink-dim); }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--signal); }
.tab:disabled { opacity: 0.45; cursor: not-allowed; }

.pane { display: flex; flex-direction: column; gap: var(--space-4); }
.pane[hidden] { display: none; }

.hint { font-size: var(--text-xs); color: var(--muted); }
.gate-title { font-size: var(--text-lg); margin-bottom: var(--space-2); }

/* A row of quiet secondary routes out of a form. They are links in behaviour,
 * so they look like links — a second filled button would compete with the one
 * action the form is actually for. */
.pane-alt {
  display: flex; flex-wrap: wrap; gap: var(--space-4);
  padding-top: var(--space-1);
}
.link-btn {
  font: inherit;
  font-size: var(--text-sm);
  background: none;
  border: 0;
  padding: 0;
  color: var(--signal);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color var(--dur-fast) var(--ease-out);
}
.link-btn:hover { color: var(--ink); }
.link-btn:disabled { color: var(--muted); cursor: not-allowed; text-decoration: none; }

/* The code field is the one place a person retypes a machine's string, so it
 * gets the room to be read back digit by digit. */
.input--code {
  font-size: var(--text-xl);
  letter-spacing: 0.32em;
  text-align: center;
  padding: var(--space-3);
}
.input--code::placeholder { letter-spacing: 0.32em; color: var(--surface-3); }

.gate-alt { border-top: var(--rule) solid var(--line-soft); padding-top: var(--space-4); }
.gate-alt summary {
  font-size: var(--text-sm);
  color: var(--ink-dim);
  cursor: pointer;
  list-style: none;
  padding: var(--space-1) 0;
}
.gate-alt summary::-webkit-details-marker { display: none; }
.gate-alt summary::before { content: "+ "; color: var(--muted); font-family: var(--font-data); }
.gate-alt[open] summary::before { content: "− "; }
.gate-alt summary:hover { color: var(--ink); }
.gate-alt .pane { padding-top: var(--space-4); }

/* ---- onboarding ---- */

.steps { display: flex; flex-direction: column; gap: var(--space-4); }
.step {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: var(--space-4);
  padding-bottom: var(--space-5);
  position: relative;
}
.step:not(:last-child)::after {
  content: ""; position: absolute; left: 12px; top: 30px; bottom: 0;
  width: var(--rule); background: var(--line);
}
.step-no {
  width: 25px; height: 25px; border-radius: 50%;
  border: var(--rule) solid var(--line);
  display: grid; place-items: center;
  font-family: var(--font-data); font-size: var(--text-xs);
  color: var(--muted);
  background: var(--surface);
  position: relative; z-index: var(--z-base);
}
.step[data-done="true"] .step-no { border-color: var(--ok); color: var(--ok); }
.step-main { min-width: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.step-main h3 { font-size: var(--text-base); }
.step-main p { margin: 0; color: var(--ink-dim); font-size: var(--text-sm); }

.snippet {
  display: flex; align-items: flex-start; gap: var(--space-2);
  background: var(--ground);
  border: var(--rule) solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--space-3);
}
.snippet pre {
  margin: 0; flex: 1; min-width: 0;
  font-family: var(--font-data); font-size: var(--text-xs); line-height: 1.7;
  color: var(--ink-dim);
  overflow-x: auto;
}

.row { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: var(--space-4); }
.grow { flex: 1; min-width: 0; }

/* ---- small shared pieces ---- */

.section-title { font-size: var(--text-sm); color: var(--muted); font-weight: 500; }
.drawer-title { font-size: var(--text-base); min-width: 0; overflow-wrap: anywhere; }
.lede--sm { font-size: var(--text-sm); }
.step-meta { font-size: var(--text-xs); color: var(--muted); }
.progress { font-size: var(--text-xs); color: var(--muted); }
.input--inline { width: auto; min-width: 120px; padding: var(--space-1) var(--space-2); font-size: var(--text-xs); }

.rail-project { padding: 0 var(--space-2) var(--space-3); }
.rail-project label { font-size: var(--text-xs); color: var(--muted); }
.whoami {
  font-size: var(--text-xs);
  color: var(--muted);
  padding: 0 var(--space-2);
  overflow-wrap: anywhere;
}

/* An unconfirmed address blocks nothing, so it gets no status colour: the
 * palette rule in tokens.css is that a coloured pixel means ok/warn/bad, and
 * spending one here would rank "click a link when you get a moment" alongside
 * a dead endpoint. It reads as ink, sits with the identity it describes, and
 * disappears the moment the address is confirmed. */
.unverified {
  padding: 0 var(--space-2);
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: var(--text-xs);
  color: var(--ink-dim);
}
.unverified p { margin: 0; }
.unverified .unverified-why { color: var(--muted); }
.unverified .link-btn { font-size: var(--text-xs); align-self: flex-start; }

/* ---- responsive: hard floor at 320px ----
 *
 * The rail stops being a rail and becomes a header: identity and session on
 * the first line, destinations on a scrolling second line. Nothing is dropped
 * on the way down — signing out and switching project are exactly the controls
 * a person needs on a phone, so hiding the rail foot (as this file used to)
 * was a bug, not a simplification.
 */

@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail {
    position: static; height: auto;
    flex-direction: row; align-items: center; flex-wrap: wrap;
    gap: var(--space-2);
    border-right: 0; border-bottom: var(--rule) solid var(--line);
    padding: var(--space-2) var(--space-3);
  }
  .brand { padding: 0; flex: 0 0 auto; }
  .rail-label, .rail-item .count { display: none; }

  .rail-project {
    padding: 0; flex: 0 1 auto; max-width: 190px; min-width: 0;
  }
  /* Visually hidden, not display:none — the select keeps its accessible name. */
  .rail-project label {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%);
  }
  .rail-project .input { font-size: var(--text-xs); padding: var(--space-1) var(--space-2); }

  .rail-foot {
    margin: 0 0 0 auto; border-top: 0; padding-top: 0;
    flex-direction: row; align-items: center; gap: var(--space-2);
  }
  /* The rail foot is one horizontal row here. The reminder keeps its action
   * and loses its explanation rather than pushing "Sign out" off the edge. */
  .unverified { flex-direction: row; align-items: baseline; gap: var(--space-2); }
  .unverified .unverified-why { display: none; }
  .live { padding: 0; }

  .rail-group {
    order: 3;
    flex: 1 1 100%;
    flex-direction: row;
    gap: var(--space-1);
    overflow-x: auto;
    scrollbar-width: thin;
  }
  .rail-item { padding: var(--space-2) var(--space-3); width: auto; flex: 0 0 auto; }

  .view, .topbar { padding-left: var(--space-4); padding-right: var(--space-4); }
  .view { gap: var(--space-4); }
  .kv { grid-template-columns: minmax(0, 1fr); gap: var(--space-1); }
  .kv dt { font-size: var(--text-xs); }
  .drawer { width: 100%; }
  .gate-card { padding: var(--space-5); }
  .toasts { left: var(--space-3); right: var(--space-3); width: auto; }
}

@media (max-width: 560px) {
  /* An email address is 30 characters the phone rail does not have. The signed
   * in identity stays available on the Team screen. */
  .whoami { display: none; }
  .live #live-label { display: none; }
  .strip { grid-template-columns: minmax(0, 1fr); }
  .panel-head { flex-wrap: wrap; }
  .panel-head .spacer { margin-left: 0; flex-basis: 100%; height: 0; }
  .empty { padding: var(--space-6) var(--space-4); }
}

/* Touch targets, on touch devices only — density stays a feature on a desk. */
@media (pointer: coarse) {
  .btn, .rail-item, .tab, .input, select.input { min-height: 44px; }
  .btn--sm { min-height: 40px; padding: var(--space-2) var(--space-3); }
  .input--inline { min-height: 40px; }
  tbody tr[data-clickable] td { padding-top: var(--space-4); padding-bottom: var(--space-4); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 150ms !important;
  }
  .live-dot { animation: none; }
}

/* ---- plan meter ----
 *
 * A bar, because a fraction is the one thing a number cannot show at a glance:
 * "412,000 of 1,000,000" has to be read, a bar at 41% does not. The colour is
 * earned rather than decorative - it follows the tokens.css rule that a
 * coloured pixel means ok/warn/bad, so it stays ink until the number starts to
 * matter at 80%. Being inside your allowance is not an achievement to
 * celebrate in green; it is the normal state. */
.meter {
  height: 8px;
  border-radius: 999px;
  background: var(--line-soft);
  overflow: hidden;
  margin-bottom: var(--space-3);
}
.meter-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--ink-dim);
  transition: width var(--dur-base) var(--ease-out);
}
.meter-fill[data-tone="warn"] { background: var(--warn); }
.meter-fill[data-tone="bad"]  { background: var(--bad); }
.meter-line { margin: 0; font-size: var(--text-sm); }
.meter-note { margin: var(--space-1) 0 0; font-size: var(--text-xs); color: var(--muted); }

/* The platform table reuses the ordinary table styles; only the risk marker is
 * its own, and it is a word rather than a swatch so it survives being read
 * aloud, copied into a message, or seen by someone who cannot separate the
 * two colours. */
.risk { font-size: var(--text-xs); color: var(--warn); }
.risk[data-blocked="true"] { color: var(--bad); }

/* A checkbox row. The whole row is the label, so the target is the sentence
 * rather than a 13px square — the difference between a setting people change
 * and one they give up on. */
.check {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  font-size: var(--text-sm);
  cursor: pointer;
}
.check input { accent-color: var(--signal); }
