/* =============================================================================
   The desk: masthead, drilldown, capital moves, and the small-screen layout.

   Loaded after sleeves.css and record.css, so it owns the page shell and the
   responsive behaviour while reusing their tokens and record components.
   No webfont, no framework, no build step. The only script on any page is the
   service-worker registration in the shell and the approval confirmation.

   Reading order is the job: can I see the whole desk -> why is this sleeve in
   this state -> what do I hold and what did it do -> what needs my signature.
   ============================================================================= */

:root {
  --bg: #fbfbfa;
  --panel: #ffffff;
  --ink: #1b1b19;
  --muted: #6b6b66;
  --rule: #e2e2dd;
  --rule-strong: #c9c9c2;
  --accent: #1f5f5b;
  --accent-soft: #e7efed;
  --halt-bg: #fdf1ef;
  --halt-ink: #8c2f20;
  --halt-rule: #e7c3bc;
  --gain: #1f7a4d;
  --loss: #9c3325;
  --stale: #8a6212;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --serif: ui-serif, "Iowan Old Style", "New York", Palatino, Georgia, serif;
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16161a;
    --panel: #1a1a20;
    --ink: #e8e8e4;
    --muted: #9a9a94;
    --rule: #2c2c31;
    --rule-strong: #3d3d45;
    --accent: #6fc3ba;
    --accent-soft: #1d2a29;
    --halt-bg: #2a1a18;
    --halt-ink: #f0b4a8;
    --halt-rule: #533029;
    --gain: #4fbf83;
    --loss: #e0796a;
    --stale: #e0b35c;
  }
}

html { -webkit-text-size-adjust: 100%; }
/* The dock reserves a column on wide screens, so `main` — not the window — is the width a layout
   actually has. The console's headline and chat shell query this container. */
main {
  container-type: inline-size;
  container-name: page;
}
body {
  overflow-wrap: break-word;
  padding-left: max(24px, var(--safe-l));
  padding-right: max(24px, var(--safe-r));
  padding-bottom: calc(28px + var(--safe-b));
}
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.sr-only,
.skip:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.skip {
  position: fixed;
  z-index: 20;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--bg);
  border-radius: 4px;
  font-size: 13px;
}

/* ---- Masthead -------------------------------------------------------------------------------
   Wordmark in the system serif (no webfont), navigation as a small ledger tab,
   the read time right-aligned. The tab is the only ink block in the chrome, so
   "which page am I on" is answered before any figure is read. */

.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  margin: 0 0 26px;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--rule-strong);
}
.wordmark {
  font: 500 21px/1 var(--serif);
  letter-spacing: -0.03em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.wordmark:hover { color: var(--ink); }
.wordmark-sub {
  margin-left: 7px;
  font: 500 9px/1 var(--mono);
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--muted);
  vertical-align: 2px;
}
nav.primary { display: flex; align-items: center; gap: 2px; }
nav.primary a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 4px;
  color: var(--muted);
  text-decoration: none;
  font: 600 11px/1 var(--mono);
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
nav.primary a:hover { color: var(--ink); background: var(--accent-soft); }
nav.primary a[aria-current="page"] {
  color: var(--bg);
  background: var(--ink);
}
nav.primary a[aria-current="page"]:hover { background: var(--ink); color: var(--bg); }
.nav-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  margin-left: 6px;
  padding: 0 5px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font: 600 10px/1 var(--mono);
  letter-spacing: 0;
}
.asof {
  margin: 0 0 0 auto;
  color: var(--muted);
  font: 11px/1.4 var(--mono);
  white-space: nowrap;
}
/* The clock and the currency control travel together, so the control is never left floating on a
   line of its own when the reading column narrows for the dock. */
.masthead-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 4px 10px;
  margin-left: auto;
  min-width: 0;
}
.masthead-right .asof { margin-left: 0; }
.asof-k { letter-spacing: 0.08em; text-transform: uppercase; font-size: 9px; }
/* The armed-policy chip is a sentence, not a timestamp: it wraps rather than running off a phone,
   and it must never be truncated — "auto-executing within ₹50,000/day until 14:20" is the point. */
.asof.policy-chip {
  white-space: normal;
  max-width: 100%;
  font: 600 10px/1.5 var(--mono);
}
.asof.policy-chip .state { white-space: normal; }

/* ---- Display currency: one small GET form, right of the clock. -------------------------------
   Native is the default and leaves no mark on the page. Selecting another currency adds a thin
   basis strip under the masthead; a currency with no recorded rate adds the warning on that same
   strip and the figures stay in their ledger's currency. With no rate at all there is nothing to
   choose, so a static chip replaces the select. */

.display-pick {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 2px;
}
.display-label {
  color: var(--muted);
  font: 500 9px/1 var(--mono);
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
/* The stand-in when there is nothing to choose: no rate was recorded, so the figures are in
   their ledger's currency and a one-option select would be a control that does nothing. */
.display-chip {
  display: inline-flex;
  align-items: center;
  margin: 0 0 0 2px;
  padding: 3px 8px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font: 600 10px/1.2 var(--mono);
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.display-pick select {
  height: 30px;
  max-width: 11rem;
  padding: 0 6px;
  border: 1px solid var(--rule-strong);
  border-radius: 4px;
  background: var(--panel);
  color: var(--ink);
  font: 600 11px/1 var(--mono);
  letter-spacing: 0.04em;
}
.display-pick select:hover { border-color: var(--ink); }
.display-pick select:disabled { color: var(--muted); }
.display-go {
  height: 30px;
  padding: 0 7px;
  border: 1px solid var(--rule-strong);
  border-radius: 4px;
  background: var(--panel);
  color: var(--ink);
  font: 600 9px/1 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.display-go:hover { border-color: var(--ink); }

.display-state {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 5px 18px;
  margin: -14px 0 20px;
  font: 11px/1.5 var(--mono);
  color: var(--muted);
}
.display-converted { margin: 0; color: var(--accent); }
.display-warning {
  margin: 0;
  padding: 5px 10px;
  border-left: 3px solid var(--stale);
  border-radius: 3px;
  background: var(--panel);
  color: var(--stale);
  font-weight: 600;
}
.display-rates { font: 10.5px/1.55 var(--mono); }
.display-rates summary { cursor: pointer; }
.display-rates summary:hover { color: var(--ink); }
.display-rates p { margin: 3px 0 0; }
.display-rates p + p { margin-top: 2px; }

/* Exact ledger values are carried in <data value="…">; the visible text is the display form.
   Tabular numerals keep a right-aligned column still while its width changes with the currency. */
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.total-code {
  margin-left: 3px;
  color: var(--muted);
  font: 500 9px/1 var(--mono);
  letter-spacing: 0.08em;
}

/* ---- Page head: one large statement per page, then the reader's own words. ------------------ */

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px 24px;
  margin: 0 0 20px;
}
.eyebrow {
  margin: 0 0 7px;
  color: var(--muted);
  font: 500 10px/1 var(--mono);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.page-head h1 {
  margin: 0;
  font: 500 clamp(26px, 5.4vw, 36px)/1.02 var(--serif);
  letter-spacing: -0.025em;
  color: var(--ink);
}
/* Still used by the ledger-event page, where the line under the title is the event's kind and
   time — a value, not a sentence about the page. */
.page-lede {
  margin: 0;
  max-width: 46ch;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.5;
}
.detail-head { align-items: center; }

.crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin: 0 0 14px;
  color: var(--muted);
  font: 11px/1.4 var(--mono);
}
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--ink); text-decoration: underline; }
.crumb-sep { opacity: 0.55; }
.detail-title h1 { font-size: clamp(28px, 6vw, 40px); }

/* ---- State: a dot and a word, never colour alone. ------------------------------------------- */

.state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font: 600 11px/1 var(--mono);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
}
.state .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.state-running { color: var(--gain); }
.state-stale { color: var(--stale); }
.state-empty { color: var(--muted); }
.state-halted { color: var(--halt-ink); }
.detail-head .state {
  padding: 9px 13px;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: var(--panel);
}

/* ---- Why: the answer to "why is it like this", before the evidence. ------------------------- */

.why {
  margin: 0 0 22px;
  padding: 2px 0 2px 16px;
  border-left: 2px solid var(--accent);
}
.why h2 {
  margin: 0 0 6px;
  font: 600 10px/1.4 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.why-sentence { margin: 0; max-width: 78ch; font-size: 15px; line-height: 1.5; }
.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px 22px;
  margin: 16px 0 0;
}
.facts dt,
.decision-facts dt,
.digests dt {
  color: var(--muted);
  font: 500 9.5px/1.3 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.facts dd,
.decision-facts dd {
  margin: 3px 0 0;
  font: 12px/1.45 var(--mono);
  color: var(--ink);
  overflow-wrap: anywhere;
}

/* ---- Blocks: a hairline, a label, then the thing itself. ------------------------------------ */

.block { margin: 0 0 32px; min-width: 0; }
.block-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
  margin: 0 0 10px;
  padding: 0 0 6px;
  border-bottom: 1px solid var(--rule-strong);
}
.block-head h2 {
  margin: 0;
  font: 600 11px/1.3 var(--mono);
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink);
}
.block-hint {
  margin: 0;
  color: var(--muted);
  font: 11px/1.45 var(--mono);
}
.detail-strip { margin-bottom: 26px; }
.unknown { color: var(--muted); font-style: italic; }
.nowrap { white-space: nowrap; }

/* ---- Tables on a phone: a row becomes a card, never a sideways scroll. ----------------------
   The seven-column sleeve table is the money-approval device's most important
   page. At 320px seven columns cannot be read, and a horizontal scrollbar hides
   the state column — so each row stacks, labelled, with the label taken from the
   cell itself via data-label. Nothing is dropped; reading order is preserved. */

@media (max-width: 959px) {
  table.desk,
  table.desk tbody { display: block; width: 100%; }
  table.desk thead {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  table.desk tr {
    display: block;
    margin: 0 0 10px;
    padding: 3px 13px;
    border: 1px solid var(--rule);
    border-radius: 8px;
    background: var(--panel);
  }
  table.desk tr:last-child { margin-bottom: 0; }
  table.desk td {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    width: 100%;
    padding: 7px 0;
    border-bottom: 1px solid var(--rule);
    text-align: right;
    white-space: normal;
  }
  table.desk td:last-child { border-bottom: 0; }
  table.desk td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    color: var(--muted);
    font: 500 9.5px/1.4 var(--mono);
    letter-spacing: 0.09em;
    text-transform: uppercase;
    text-align: left;
  }
  table.desk td.num,
  table.desk td.when { white-space: normal; }
  table.desk td.sleeve { font-size: 14px; }
  table.desk td.positions { overflow-wrap: anywhere; }
  table.desk td.empty { display: block; text-align: left; }
  table.desk td.empty::before { content: none; }

  /* Orders are the same object at a different density. */
  table.orders,
  table.orders tbody { display: block; width: 100%; }
  table.orders thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  table.orders tr {
    display: block;
    padding: 2px 12px;
    border: 1px solid var(--rule);
    border-radius: 8px;
    background: var(--panel);
    margin-bottom: 8px;
  }
  table.orders td {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px solid var(--rule);
    text-align: right;
    overflow-wrap: anywhere;
  }
  table.orders td:last-child { border-bottom: 0; }
  table.orders td::before {
    content: attr(data-label);
    color: var(--muted);
    font: 500 9.5px/1.4 var(--mono);
    letter-spacing: 0.09em;
    text-transform: uppercase;
    text-align: left;
  }
}

/* ---- Single-sleeve record ------------------------------------------------------------------ */

.record-single { margin-top: 0; }
.record-card-head h3 a { color: inherit; text-decoration: none; }
.record-card-head h3 a:hover { text-decoration: underline; text-underline-offset: 2px; }
.record-panel {
  --tone: var(--flat);
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 14px 16px 15px;
  border: 1px solid var(--rule);
  border-top: 2px solid var(--tone);
  border-radius: 8px;
  background: var(--panel);
}
.record-panel.gain { --tone: var(--gain); }
.record-panel.loss { --tone: var(--loss); }
.record-panel.flat { --tone: var(--flat); }
.record-curve-wrap-lg { height: 220px; margin: 4px 0 14px; }
.detail-stats { grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); }
.detail-stats dt { text-align: left; }
.detail-stats dd { text-align: left; }
.detail-stats > div:first-child dd { color: var(--tone); }
.record-curve-wrap-lg .record-curve-empty { height: 100%; }

/* ---- Decisions: one card per recorded cycle ------------------------------------------------- */

.decisions { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin: 0; padding: 0; list-style: none; }
.decision {
  min-width: 0;
  padding: 13px 15px 14px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--panel);
}
.decision-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
}
.decision-when { font: 600 11px/1.4 var(--mono); letter-spacing: 0.02em; }
.decision-cycle { color: var(--muted); font: 10.5px/1.4 var(--mono); overflow-wrap: anywhere; }
.decision-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 10px 16px;
  margin: 11px 0 10px;
}
.targets {
  margin: 0 0 10px;
  font: 12px/1.5 var(--mono);
  color: var(--ink);
}
.targets .k {
  color: var(--muted);
  font: 500 9.5px/1.4 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-right: 10px;
}
.digests { display: grid; gap: 4px; margin: 0 0 10px; }
.digests > div { display: flex; flex-wrap: wrap; gap: 3px 9px; align-items: baseline; }
.digests dd {
  margin: 0;
  color: var(--muted);
  font: 10.5px/1.45 var(--mono);
  word-break: break-all;
}
.evidence { margin: 10px 0 0; padding-top: 9px; border-top: 1px dashed var(--rule-strong); }
.evidence h3 {
  margin: 0 0 6px;
  color: var(--muted);
  font: 500 9.5px/1.3 var(--mono);
  letter-spacing: 0.11em;
  text-transform: uppercase;
}
.evidence ul { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.evidence li { min-width: 0; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.ev-cap {
  display: inline-block;
  margin-right: 5px;
  padding: 1px 5px;
  border: 1px solid var(--rule-strong);
  border-radius: 3px;
  color: var(--muted);
  font: 500 9px/1.5 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.ev-source { font-weight: 600; margin-right: 5px; }
.evidence code { color: var(--muted); font: 10.5px/1.5 var(--mono); word-break: break-all; }
.evidence time { color: var(--muted); font: 10.5px/1.5 var(--mono); }
.decision-note { margin: 10px 0 0; color: var(--muted); font-size: 12px; font-style: italic; }

/* ---- Capital moves ------------------------------------------------------------------------- */

.moves { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.move {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--rule);
  border-top: 2px solid var(--accent);
  border-radius: 10px;
  background: var(--panel);
}
.move-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px 16px;
}
.amount-k {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font: 500 9.5px/1 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.amount-v { font: 600 clamp(22px, 5.4vw, 27px)/1.05 var(--mono); letter-spacing: -0.03em; }
.move .state {
  padding: 6px 9px;
  border: 1px solid currentColor;
  border-radius: 999px;
  color: var(--stale);
  font-size: 10px;
}
.move .state-approved { color: var(--gain); }
.move .state-rejected { color: var(--halt-ink); }
.move .state-in_progress { color: var(--accent); }
.move.is-decided { border-top-color: var(--rule-strong); }
.decided-block { margin-top: 30px; }
.move-route {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 9px;
  margin: 12px 0 2px;
  font: 13px/1.45 var(--mono);
}
.move-route .arrow { color: var(--accent); }
.move-reason { margin: 0; color: var(--muted); font: 11px/1.5 var(--mono); overflow-wrap: anywhere; }

.steps { margin: 14px 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.step {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--rule);
}
.step-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--rule-strong);
  border-radius: 50%;
  color: var(--muted);
  font: 500 10px/1 var(--mono);
}
.step-body { min-width: 0; }
.step-edge { font: 600 12px/1.4 var(--mono); overflow-wrap: anywhere; }
.step-line { display: flex; flex-wrap: wrap; gap: 3px 10px; align-items: baseline; margin-top: 3px; }
.step-meta { color: var(--muted); font: 11px/1.45 var(--mono); }
.step-state {
  margin-left: auto;
  font: 600 9.5px/1.5 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.step-state-DONE { color: var(--gain); }
.step-state-PENDING { color: var(--stale); }
.step-state-FAILED { color: var(--halt-ink); }
.step-evidence {
  margin: 5px 0 0;
  color: var(--muted);
  font: 11px/1.5 var(--mono);
  overflow-wrap: anywhere;
}

/* The approval form. The token field is deliberately not `required`: an empty
   token must reach the server so the page can say, in the page's own voice, that
   it is not authorised, instead of a browser tooltip that looks like a crash. */
.decision-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 11px 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--rule-strong);
}
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.field label {
  color: var(--muted);
  font: 500 9.5px/1.3 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.field input {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--rule-strong);
  border-radius: 6px;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.3 var(--sans);
  -webkit-appearance: none;
  appearance: none;
}
.field input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.field-hint { margin: 0; color: var(--muted); font: 10.5px/1.45 var(--mono); }
.actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  flex: 1 1 150px;
  min-height: 48px;
  padding: 12px 16px;
  border: 1px solid transparent;
  border-radius: 6px;
  font: 600 13px/1.2 var(--sans);
  letter-spacing: 0.01em;
  cursor: pointer;
}
.btn-approve { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn-approve:hover { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.btn-reject { background: transparent; border-color: var(--halt-rule); color: var(--halt-ink); }
.btn-reject:hover { background: var(--halt-bg); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.token-help { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.token-help summary { cursor: pointer; min-height: 32px; padding: 6px 0; color: var(--accent); font: 500 11.5px/1.4 var(--mono); }
.token-help p { margin: 2px 0 0; }
.token-help code { font: 11px/1.4 var(--mono); overflow-wrap: anywhere; }

/* ---- Notices ------------------------------------------------------------------------------- */

.notice {
  margin: 0 0 18px;
  padding: 13px 15px;
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  background: var(--panel);
}
.notice-ok { border-color: var(--gain); }
.notice-error { border-color: var(--halt-rule); background: var(--halt-bg); color: var(--halt-ink); }
.notice-title { margin: 0 0 5px; font-size: 14px; font-weight: 600; line-height: 1.35; }
.notice-detail { margin: 0; font-size: 13px; line-height: 1.5; }
.notice-detail + .notice-detail { margin-top: 5px; }

.empty-block {
  margin: 0;
  padding: 22px 16px;
  border: 1px dashed var(--rule-strong);
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}
.empty-block p { margin: 0; }
.empty-block p + p { margin-top: 5px; }

.banner-note { margin: 7px 0 0; font: 11px/1.5 var(--mono); opacity: 0.85; }

/* ---- Footer -------------------------------------------------------------------------------- */

.foot {
  margin-top: 34px;
  padding-top: 13px;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}
.foot p { margin: 0; }
/* The footer's two statements, folded. A basis is available, not worn on the sleeve. */
.foot-basis { color: var(--muted); font-size: 12px; }
.foot-basis > summary {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  font: 500 9px/1 var(--mono);
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.foot-basis > summary:hover { color: var(--ink); }
.foot-basis > p { margin-top: 4px; }
.foot-stamp { margin-top: 5px; text-align: right; }

/* ---- Two columns when there is room; one when there is not. -------------------------------- */

@media (min-width: 1080px) {
  .moves { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .decisions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 719px) {
  body {
    padding-top: max(14px, env(safe-area-inset-top, 0px));
    padding-left: max(15px, var(--safe-l));
    padding-right: max(15px, var(--safe-r));
  }
  .masthead { margin-bottom: 20px; gap: 4px 14px; }
  nav.primary { margin-left: auto; order: 2; }
  nav.primary a { padding: 0 9px; }
  /* The clock and the currency control take the second line together, clock left and control
     right, so the control is never left floating and the tabs never wrap off a 320px screen. */
  .masthead-right {
    order: 4;
    flex: 1 0 100%;
    justify-content: space-between;
    gap: 6px 10px;
  }
  .display-pick { margin-left: 0; min-width: 0; }
  .display-chip { margin-left: 0; }
  .display-pick select { height: 32px; max-width: 5.6rem; font-size: 11px; }
  .display-state { margin-top: -8px; }
  .page-head { gap: 10px; margin-bottom: 18px; }
  .index-head, .moves-head { display: block; }
  .detail-head { align-items: flex-start; }
  .why { padding-left: 12px; }
  .why-sentence { font-size: 14px; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px 12px; }
  .detail-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .record-curve-wrap-lg { height: 180px; }
  .decision-form { grid-template-columns: minmax(0, 1fr); }
  .actions { flex-direction: column; }
  .btn { flex-basis: auto; width: 100%; }

  /* The desk is used with a thumb. Every control that approves, toggles a cost
     or opens a page is at least 44px tall. */
  .record-toggle { display: inline-flex; align-items: center; min-height: 44px; padding: 10px 12px; }
  .record-toggle.reset { min-height: 44px; padding: 10px 12px; }
  .crumb a { display: inline-flex; align-items: center; min-height: 44px; }
  .token-help summary { min-height: 44px; }
  .foot { margin-top: 26px; }
}

@media (max-width: 380px) {
  .masthead { column-gap: 8px; }
  .wordmark { font-size: 17px; letter-spacing: -0.04em; }
  .wordmark-sub { display: none; }
  nav.primary { gap: 0; }
  nav.primary a { padding: 0 4px; font-size: 10px; letter-spacing: 0.04em; }
  .display-pick { gap: 4px; }
  .display-pick select { max-width: 4.4rem; padding: 0 3px; font-size: 10px; }
  /* 320px leaves 105px beside the clock: one small word, and a clock a shade smaller, so the
     control keeps its visible label instead of becoming a bare select. */
  .asof { font-size: 10px; }
  .display-label { font-size: 8px; letter-spacing: 0.05em; }
  .amount-v { font-size: 21px; }
  .facts { grid-template-columns: minmax(0, 1fr); }
}
