:root {
  /* Colour lives in tokens.css (loaded before this sheet), the same file the
     player site reads. This block holds dimensions, type and stacking. */

  /* Layout */
  --sidebar-w:     220px;
  --betslip-w:     296px;
  --header-h:      56px;
  --ticker-h:      32px;

  /* Touch */
  --tap: 44px;

  /* Radius */
  --r-sm:  4px;
  --r-md:  8px;
  --r-lg:  12px;
  --r-xl:  16px;

  /* Type */
  --font-body: 'Archivo', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-mono: 'IBM Plex Mono', 'SF Mono', ui-monospace, Menlo, monospace;

  /* Z-index scale */
  --z-sidebar:  10;
  --z-header:   20;
  --z-drawer:   30;
  --z-betslip:  25;
  --z-modal:    40;
  --z-toast:    50;
}
/* ═══════════════════════════════════════════════════════════
   FOREBET ADMIN
   Same token system as the player site; a denser, quieter surface.
   ═══════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* A display rule on a class beats the hidden attribute's UA default, which
   silently reveals every step of the login flow at once. Guard it once here
   rather than remembering per component. */
[hidden] { display: none !important; }

button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input { font: inherit; }

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

.w-full { width: 100%; }

/* ── BUTTONS ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 14px; border-radius: var(--r-sm);
  font-size: 13px; font-weight: 600; min-height: 40px;
  transition: background .15s, border-color .15s, color .15s;
}
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover:not(:disabled) { background: var(--green-hover); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-ghost { border: 1px solid var(--border); color: var(--ink-secondary); }
.btn-ghost:hover { background: var(--surface-raised); color: var(--ink); }
.btn-danger { background: var(--red); color: var(--ink); }
.btn-danger:hover { filter: brightness(1.1); }
.btn-sm { padding: 6px 10px; min-height: 34px; font-size: 12px; }

.linkish { color: var(--accent-ink); font-size: 12px; text-align: center; width: 100%; padding: 6px; }
.linkish:hover { text-decoration: underline; }

/* ── LOGIN GATE ──────────────────────────────────────────── */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.gate-card {
  width: 100%; max-width: 360px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: 28px;
  display: flex; flex-direction: column; gap: 12px;
  box-shadow: var(--shadow-lg);
}
.gate-brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 20px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 8px;
}
.gate-mark { display: block; flex: none; }
.gate-brand-tag {
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em;
  color: var(--accent-ink); margin-left: 8px; vertical-align: middle;
}
.gate-step { display: flex; flex-direction: column; gap: 10px; }
.gate-hint { font-size: 12px; color: var(--ink-secondary); }

.lbl { font-size: 11px; font-weight: 600; color: var(--ink-secondary); }
.inp {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 10px 12px; color: var(--ink);
  min-height: 42px; width: 100%;
}
.inp:focus { border-color: var(--accent); outline: none; }
.inp-sm { min-height: 34px; padding: 6px 10px; font-size: 12px; width: auto; }
.inp-code {
  font-family: var(--font-mono); font-size: 22px; letter-spacing: .3em;
  text-align: center; padding: 12px;
}
.prefix-wrap { display: flex; align-items: stretch; border: 1px solid var(--border); border-radius: var(--r-sm); overflow: hidden; }
.prefix-wrap .inp { border: none; border-radius: 0; }
.prefix { display: grid; place-items: center; padding: 0 10px; background: var(--surface-raised); color: var(--ink-secondary); font-family: var(--font-mono); font-size: 13px; }

.err { background: var(--red-dim); color: var(--red); border: 1px solid var(--red); border-radius: var(--r-sm); padding: 9px 12px; font-size: 12px; }

.enroll-secret {
  font-family: var(--font-mono); font-size: 13px; word-break: break-all;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 10px 12px; color: var(--accent-ink);
}
.recovery-list {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px;
  font-family: var(--font-mono); font-size: 11px;
  background: var(--bg); border: 1px solid var(--amber); border-radius: var(--r-sm); padding: 10px;
  color: var(--amber);
}

/* ── SHELL ───────────────────────────────────────────────── */
.topbar {
  display: flex; align-items: center; gap: 20px;
  padding: 0 20px; height: 56px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.brand {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 700; letter-spacing: -0.02em; white-space: nowrap;
}
.brand-mark { display: block; flex: none; }
.brand-tag { font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--accent-ink); margin-left: 6px; }

.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: var(--r-sm);
  font-size: 13px; color: var(--ink-secondary); white-space: nowrap; min-height: 40px;
}
.tab:hover { background: var(--surface-raised); color: var(--ink); }
.tab.active { background: var(--accent-dim); color: var(--accent-ink); font-weight: 600; }
.pill { background: var(--surface); color: var(--ink); font-family: var(--font-mono); font-size: 10px; padding: 1px 6px; border-radius: 10px; }
.tab.active .pill { background: var(--accent); color: var(--on-accent); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); }

/* Two-level nav: five section buttons in the top bar, their screens on the row
   below. Turns a 13-tab wall into five plain choices. */
.nav-groups { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.nav-groups::-webkit-scrollbar { display: none; }
.navg {
  padding: 8px 15px; border-radius: var(--r-sm);
  font-size: 14px; font-weight: 600; color: var(--ink-secondary); white-space: nowrap;
}
.navg:hover { background: var(--surface-raised); color: var(--ink); }
.navg.active { background: var(--accent-dim); color: var(--accent-ink); }

.nav-sub {
  display: flex; gap: 2px; align-items: center;
  padding: 6px 20px; background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 56px; z-index: 19;
  overflow-x: auto; scrollbar-width: none;
}
.nav-sub::-webkit-scrollbar { display: none; }
.subtab {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: var(--r-sm);
  font-size: 13px; color: var(--ink-secondary); white-space: nowrap; min-height: 34px;
}
.subtab:hover { color: var(--ink); }
.subtab.active { background: var(--accent-dim); color: var(--accent-ink); font-weight: 600; }
.subtab.active .pill { background: var(--accent); color: var(--on-accent); }

.topbar-end { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.whoami { font-size: 12px; color: var(--ink-secondary); white-space: nowrap; }

.main { padding: 20px; max-width: 1100px; margin: 0 auto; }
.view-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.view-title { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.budget { margin-left: auto; font-size: 12px; color: var(--ink-secondary); font-family: var(--font-mono); }
.range { margin-left: auto; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.range-sep { font-size: 12px; color: var(--ink-muted); }

/* ── CARDS ───────────────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 14px 16px; margin-bottom: 10px;
}
.card-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.card-title { font-size: 14px; font-weight: 600; }
.card-sub { font-size: 11px; color: var(--ink-muted); font-family: var(--font-mono); }

.money { font-family: var(--font-mono); font-weight: 500; }
.money-lg { font-size: 18px; }
.pos { color: var(--green); }
.neg { color: var(--red); }
.warn { color: var(--amber); }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-bottom: 12px; }
.stat { background: var(--surface-raised); border-radius: var(--r-sm); padding: 8px 10px; }
.stat-k { font-size: 10px; color: var(--ink-muted); text-transform: uppercase; letter-spacing: .04em; }
.stat-v { font-family: var(--font-mono); font-size: 14px; margin-top: 2px; }

.badge {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  padding: 3px 8px; border-radius: var(--r-sm);
  background: var(--surface-raised); color: var(--ink-secondary);
}
.badge-wait { background: var(--amber-dim); color: var(--amber); }
.badge-ok { background: var(--green-dim); color: var(--green); }

.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.empty { padding: 40px 0; text-align: center; color: var(--ink-muted); font-size: 13px; }
.empty-ok { color: var(--green); }

/* ── TABLE ───────────────────────────────────────────────── */
.tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.tbl th {
  text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--ink-muted); padding: 8px 10px; border-bottom: 1px solid var(--border);
  font-weight: 600; white-space: nowrap;
}
.tbl td { padding: 8px 10px; border-bottom: 1px solid var(--border-subtle); vertical-align: top; }
.tbl tr:last-child td { border-bottom: none; }
.tbl .num { font-family: var(--font-mono); text-align: right; white-space: nowrap; }
.tbl-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); }

/* ── MODAL ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: var(--scrim);
  display: grid; place-items: center; padding: 20px; z-index: 40;
}
.modal-overlay[hidden] { display: none; }
.modal {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 22px; width: 100%; max-width: 420px; box-shadow: var(--shadow-lg);
}
.modal-title { font-size: 16px; font-weight: 600; margin-bottom: 12px; }
.modal-body { font-size: 13px; color: var(--ink-secondary); line-height: 1.6; margin-bottom: 18px; }
.modal-body strong { color: var(--ink); font-family: var(--font-mono); }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* ── TOAST ───────────────────────────────────────────────── */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--surface-raised); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 11px 18px; font-size: 13px;
  box-shadow: var(--shadow-lg); z-index: 50; max-width: calc(100vw - 32px);
}
.toast[hidden] { display: none; }

@media (max-width: 720px) {
  .topbar { height: auto; flex-wrap: wrap; padding: 10px 14px; gap: 10px; }
  .topbar-end { width: 100%; }
  .tabs { width: 100%; order: 3; }
  .main { padding: 14px; }
  .budget, .range { margin-left: 0; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* Role badge. The server is the authority on what an admin may do; this only
   tells them which they are. */
.role-tag {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 2px 6px;
  border-radius: var(--r-sm);
  margin-left: 8px;
  vertical-align: middle;
}
.role-super    { background: var(--accent-dim); color: var(--accent-ink); }
.role-operator { background: var(--surface-raised); color: var(--ink-secondary); }

/* Transaction status colours; failures should be visible at a glance. */
.badge-fail { background: var(--red-dim); color: var(--red); }

/* Customer rows open a detail view. Without an affordance the drill-down is a
   feature nobody finds, so the row states that it is interactive. */
.tbl tbody tr.row-click { cursor: pointer; }
.tbl tbody tr.row-click:hover { background: var(--surface-raised); }
.tbl tbody tr.row-click:focus-visible {
  outline: 2px solid var(--accent-ink);
  outline-offset: -2px;
}

/* Risk flags on a withdrawal. Reasons to look twice, printed where the decision
   is made rather than on a screen an operator would have to go and find. */
.flags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 2px;
}
.flag {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
}
.flag-ok     { background: var(--green-dim); color: var(--green); }
.flag-high   { background: var(--red-dim);   color: var(--red); }
.flag-medium { background: var(--amber-dim); color: var(--amber); }

/* Payment gateway switcher. */
.gw-list { display: flex; flex-direction: column; gap: 8px; }
.gw-option {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: var(--r-md, 8px);
  border: 1px solid var(--border); background: var(--surface);
}
.gw-active { border-color: var(--green); }
.gw-unconfigured { opacity: .6; }
.gw-name { font-weight: 700; text-transform: capitalize; }
.gw-status { font-size: 12px; color: var(--ink-muted); }
.gw-option .btn, .gw-option .badge, .gw-option .card-sub { margin-left: auto; }

/* Inline match creation form. */
.match-form { padding: 16px; margin-bottom: 16px; }
.mf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 12px; }
.mf-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--ink-secondary); }
.mf-field span { font-weight: 600; }
.mf-field .inp { width: 100%; }
.mf-pricing { padding: 12px 0; border-top: 1px solid var(--border-subtle); border-bottom: 1px solid var(--border-subtle); margin-bottom: 12px; }
.mf-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.mf-tab {
  padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 600;
  border: 1px solid var(--border); background: var(--surface); color: var(--ink-secondary);
}
.mf-tab.active { border-color: var(--accent); background: var(--accent-dim); color: var(--ink); }
.mf-mode { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.mf-mode .mf-hint { grid-column: 1 / -1; }
.mf-hint { font-size: 11px; color: var(--ink-muted); line-height: 1.5; margin: 0; }

/* Which markets go on the board. A grid rather than a column: eight of them
   stacked pushed the create button off a laptop screen. */
.mf-markets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px 14px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.mf-markets-head {
  grid-column: 1 / -1;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ink-muted);
}
.mf-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
}
.mf-check input { cursor: pointer; }
.mf-check input:disabled { cursor: default; }
/* "always", "9 outcomes", "17 outcomes" — the count is the point, since a
   market's cost is how many prices it puts on the board. */
.mf-check em { font-style: normal; font-size: 11px; color: var(--ink-muted); }
.mf-preview-expected {
  font-size: 13px; color: var(--ink-secondary); margin-bottom: 8px;
}
.mf-preview-expected strong { color: var(--ink); font-family: var(--font-mono); }

/* Expected-score picker: two rows (halves), each a home : away scoreline. */
.mf-score { display: grid; gap: 8px; margin-bottom: 4px; }
.mf-score-head,
.mf-score-row {
  display: grid;
  grid-template-columns: 96px 1fr 16px 1fr;
  align-items: center;
  gap: 8px;
}
.mf-score-head span {
  text-align: center;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
}
.mf-score-label { font-size: 13px; color: var(--ink-secondary); }
.mf-score-colon { text-align: center; color: var(--ink-muted); font-weight: 700; }
.mf-score-sel { text-align: center; text-align-last: center; }
.mf-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.mf-preview { margin-top: 12px; padding: 12px; border-radius: var(--r-md, 8px); background: var(--surface-raised); }
.mf-preview-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-bottom: 8px; }
.mf-preview-grid div { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-secondary); }
.mf-preview-grid strong { color: var(--ink); font-family: var(--font-mono); }

/* Live control panel on an in-play manual match. */
.live-panel {
  margin-top: 10px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--bg); display: grid; gap: 8px;
}
.live-line { display: flex; align-items: center; gap: 10px; }
.live-score { font-family: var(--font-mono); font-size: 20px; font-weight: 700; color: var(--ink); }
.live-min { font-family: var(--font-mono); color: var(--ink-secondary); }
.live-controls { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* Manual payout rows in Settings. */
.mp-row { padding: 10px 0; border-top: 1px solid var(--border-subtle); }
.mp-row:first-of-type { border-top: none; }
.mp-main { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.mp-main .badge { margin-left: auto; }
.mp-meta { font-size: 12px; color: var(--ink-secondary); margin-top: 3px; }
.mp-completed { opacity: .75; }
.mp-cancelled, .mp-failed { opacity: .6; }

/* ── SEVERITY ─────────────────────────────────────────────
   One scale, used everywhere, so "this needs you" is a property of the design
   rather than a colour somebody remembered to add. The palette was already
   here; what was missing was using it consistently — 69 stat blocks all
   rendered at the same weight, so a KES 180,000 exposure looked like a bet
   count.

   critical  something is wrong now and money is involved
   warn      something needs attention today
   calm      normal, and deliberately quieter than both
*/
.sev-critical { --sev: var(--red);   --sev-dim: var(--red-dim); }
.sev-warn     { --sev: var(--amber); --sev-dim: var(--amber-dim); }
.sev-calm     { --sev: var(--ink-muted); --sev-dim: transparent; }

/* A row that needs a decision or reports a problem. The stripe is the scan
   target: a column of them reads as a list of things to do without reading a
   word. */
.sev-row {
  display: grid;
  grid-template-columns: 3px 1fr auto;
  gap: 0 14px;
  align-items: start;
  padding: 12px 14px 12px 0;
  border-bottom: 1px solid var(--border-subtle);
  background: linear-gradient(to right, var(--sev-dim), transparent 40%);
}
.sev-row:last-child { border-bottom: none; }
.sev-row::before { content: ''; background: var(--sev); border-radius: 2px; align-self: stretch; }
.sev-row-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sev-row-title { font-weight: 600; color: var(--ink); }
.sev-row-detail { font-size: 13px; color: var(--ink-secondary); line-height: 1.5; }
.sev-row-action { align-self: center; }

/* A figure that carries severity. Size AND colour move together — colour alone
   is not a signal for everybody looking at this screen. */
.figure { display: flex; flex-direction: column; gap: 2px; }
.figure-v {
  font-variant-numeric: tabular-nums;
  font-size: 26px; font-weight: 600; line-height: 1.05;
  letter-spacing: -0.02em; color: var(--ink);
}
.figure.sev-critical .figure-v,
.figure.sev-warn .figure-v { color: var(--sev); font-size: 30px; }
.figure-k { font-size: 12px; color: var(--ink-muted); line-height: 1.35; }
.figure-note { font-size: 12px; color: var(--ink-muted); }

/* ── TODAY ────────────────────────────────────────────────
   Three bands in a fixed order: what needs a person, what is wrong, where we
   stand. The order is the argument — decisions first, because that is what
   somebody opened the console to do. */
.today-band { margin-bottom: 30px; }
.today-band-head {
  display: flex; align-items: baseline; gap: 10px;
  margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.today-band-title { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.today-band-count {
  font-variant-numeric: tabular-nums; font-size: 12px;
  color: var(--ink-muted); margin-left: auto;
}
.today-clear {
  padding: 22px 16px; text-align: center; color: var(--ink-muted); font-size: 14px;
  border: 1px dashed var(--border); border-radius: 8px;
}
.today-figures {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 18px 22px;
}
@media (max-width: 640px) {
  .sev-row { grid-template-columns: 3px 1fr; }
  .sev-row-action { grid-column: 2; margin-top: 6px; }
}

/* ── SEGMENTED CONTROL ────────────────────────────────────
   For a choice that is the whole point of a screen. A dropdown hides which
   options exist behind a click; this shows them, and shows which one is on. */
.seg { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 12px; }
.seg-btn {
  font: inherit; font-size: 13px; font-weight: 500;
  padding: 7px 14px; border-radius: 7px; cursor: pointer;
  background: var(--surface); color: var(--ink-secondary);
  border: 1px solid var(--border);
}
.seg-btn:hover { color: var(--ink); border-color: var(--ink-muted); }
.seg-btn.active {
  background: var(--accent-dim); color: var(--accent-ink); border-color: var(--accent);
}
.seg-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── PAGER ────────────────────────────────────────────────
   Says where you are, not just "next" — a Next button with nothing behind it
   is how a list of five thousand rows pretends to be a list of a hundred. */
.pager { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.pager-label {
  font-size: 13px; color: var(--ink-muted); font-variant-numeric: tabular-nums;
}
.pager button[disabled] { opacity: .4; cursor: default; }

/* ── On-screen action panel ───────────────────────────────
   Everything a dangerous action needs happens inside the confirm modal now:
   the consequence, the fields, and the refusal. Nothing leaves the screen. */
.cf-form { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.cf-field { display: flex; flex-direction: column; gap: 5px; }
.cf-label {
  font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--ink-muted); font-family: var(--font-mono);
}
.cf-field .inp { width: 100%; }
.cf-hint { font-size: 11px; color: var(--ink-muted); line-height: 1.45; }
.cf-list {
  max-height: 190px; overflow-y: auto; margin-top: 12px;
  border: 1px solid var(--border-subtle); border-radius: 8px;
}
.cf-pick {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  font-size: 12px; font-family: var(--font-mono); cursor: pointer;
  border-bottom: 1px solid var(--border-subtle);
}
.cf-pick:last-child { border-bottom: none; }
.cf-pick:hover { background: var(--surface-raised); }
.cf-pick input { accent-color: var(--accent); flex: none; }
.cf-pick .cf-when { margin-left: auto; color: var(--ink-muted); font-size: 11px; }
.cf-pick-all {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 12px; font-size: 12px;
}
/* A refusal stays put. It used to be a toast, which is how "nothing happened,
   and nothing said why" was possible after a code was typed. */
.cf-error {
  margin-top: 14px; padding: 10px 12px; border-radius: 8px;
  border: 1px solid var(--red); background: var(--red-dim);
  color: var(--ink); font-size: 12px; line-height: 1.5;
}
.cf-check { flex-direction: row; align-items: flex-start; gap: 9px; cursor: pointer; font-size: 13px; }
.cf-check input { accent-color: var(--accent); margin-top: 2px; flex: none; }
.cf-check .cf-hint { display: block; margin-top: 2px; }
.cf-area { min-height: 68px; resize: vertical; font-family: inherit; line-height: 1.5; padding: 9px 11px; }
/* A consequence that is recomputed as the figures are typed. */
.cf-outcome {
  margin-top: 14px; padding: 10px 12px; border-radius: 8px;
  background: var(--surface-raised); border: 1px solid var(--border-subtle);
  font-size: 12px; line-height: 1.5; color: var(--ink-secondary);
}
/* A line under a view's title explaining how the screen is meant to be used.
   Adjustments needed one: it shows staged corrections but is not where they
   are staged, and nothing on it said so. */
.view-note {
  margin: -6px 0 16px; max-width: 68ch;
  font-size: 12px; line-height: 1.6; color: var(--ink-secondary);
}

/* ── Freshness ────────────────────────────────────────────
   How old the numbers on screen are, and a way to refresh them without
   reloading the page. The dot is the state: live, paused, or failing. */
.freshness {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 10px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border-subtle); background: transparent;
  color: var(--ink-muted); font: inherit; font-size: 11px;
  font-family: var(--font-mono); white-space: nowrap;
}
.freshness:hover { color: var(--ink); border-color: var(--border); }
.freshness-dot {
  width: 6px; height: 6px; border-radius: 50%; flex: none;
  background: var(--green); box-shadow: 0 0 0 3px color-mix(in oklch, var(--green) 22%, transparent);
}
/* Paused: the tab is in the background, or a panel is open over the data. */
.freshness.is-paused { color: var(--ink-muted); }
.freshness.is-paused .freshness-dot { background: var(--ink-muted); box-shadow: none; }
/* The last refresh did not land. The numbers on screen are still the old ones. */
.freshness.is-stale { color: var(--amber); border-color: var(--amber); }
.freshness.is-stale .freshness-dot { background: var(--amber); box-shadow: none; }
.freshness.is-busy .freshness-dot { animation: freshPulse 1s ease-in-out infinite; }
@keyframes freshPulse { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .freshness.is-busy .freshness-dot { animation: none; } }
