/* ═══════════════════════════════════════════════════════════════════════════
   BRASH Intelligence — the one token file every surface reads.

   Added 3 Sep 2026 from docs/INTEL-UX-DESIGN-BRIEF.md §3. Before this the
   Edition, the markets atlas, sign-in / set-name, the boot screen, the shared
   brief and the access refusal panel each carried their own palette under
   their own names (two papers, two inks, two reds). Every one of those files
   now maps its legacy names onto the tokens below, so a colour is changed
   here and nowhere else.

   Contrast, day edition, on --paper then on --card (WCAG AA is 4.5:1 for
   text under 18px):
     --ink        16.0 / 14.9
     --ink-2       6.4 /  5.9     secondary text, labels, kickers, ISO codes
     --ink-3       4.9 /  4.5     the floor; never below 13px on the card
     --red-text    5.4 /  5.0     the ONLY red allowed as running text
     --amber-text  6.3            --green-text 5.5     --blue-text 5.0
     --red         3.4 / 3.2      FILL ONLY: rules, tags (with --on-red text,
                                  4.7:1), the active-desk underline, the live dot
   Night edition: every text token clears 5.6:1; --red-text is 7.3:1.

   The night edition is selected by [data-edition="night"] on the surface's
   root element (the Edition's .ed-root sets it from state; the other pages
   are day-only). The Edition's own applyTheme() no longer writes colours —
   it only syncs <meta theme-color> and the body background to --paper.

   Platform note (brief §3.2): the platform red #F40000 measures 3.78:1 on
   this paper, so it would also be fill-only. The B/ switcher keeps #F40000
   as the platform mark; the Edition keeps #E8472C as its editorial red for
   rules and fills, because it was chosen against this paper.
   ═══════════════════════════════════════════════════════════════════════ */

:root, .ed-root, [data-edition="day"] {
  --paper: #F3EFE7;
  --card: #EDE7DC;
  --rule: rgba(23,20,15,.16);
  --rule-2: #17140F;
  --ink: #17140F;
  --ink-2: #5A5650;
  --ink-3: #6E675C;
  --red: #E8472C;
  --red-text: #B5311C;
  --on-red: #17140F;
  --amber-text: #6B5410;
  --green-text: #1F6E3C;
  --blue-text: #1B6E8F;
  --wash: rgba(232,71,44,.07);
  --focus: #1B6E8F;
  --logo-f: none;
  --shadow: rgba(12,10,7,.3);
  --sans: 'neue-haas-grotesk-display', 'Neue Haas Grotesk Display Pro', sans-serif;
}

[data-edition="night"] {
  --paper: #131210;
  --card: #1A1815;
  --rule: rgba(237,231,219,.16);
  --rule-2: #EDE7DB;
  --ink: #EDE7DB;
  --ink-2: #A8A093;
  --ink-3: #948C7E;
  --red: #FF5B3B;
  --red-text: #FF7A5C;
  --on-red: #131210;
  --amber-text: #F5A623;
  --green-text: #4FC57A;
  --blue-text: #6FB7D6;
  --wash: rgba(255,91,59,.09);
  --focus: #6FB7D6;
  --logo-f: invert(1);
  --shadow: rgba(0,0,0,.6);
}

/* ── Type scale (brief §3.3). Nothing under 12px; tracking capped at .12em
   except the wordmark. Numbers tabular wherever they align. ─────────────── */
.t-h1, .ed-h1 { font-size: clamp(40px, 4.2vw, 64px); line-height: 1.02; letter-spacing: -.025em; font-weight: 700; }
.t-h2, .ed-h2 { font-size: 26px; line-height: 1.1; letter-spacing: -.02em; font-weight: 700; }
.t-h3, .ed-h3 { font-size: 18px; line-height: 1.25; letter-spacing: -.015em; font-weight: 700; }
.t-dek, .ed-dek { font-size: 15px; line-height: 1.6; letter-spacing: 0; font-weight: 400; }
.t-body, .ed-body { font-size: 14px; line-height: 1.5; letter-spacing: 0; font-weight: 500; }
.t-label, .ed-label { font-size: 12px; line-height: 1.3; letter-spacing: .12em; font-weight: 600; text-transform: uppercase; color: var(--ink-2); }
.t-caption, .ed-caption { font-size: 12px; line-height: 1.3; letter-spacing: 0; font-weight: 500; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.t-wordmark, .ed-wordmark { font-size: 13px; letter-spacing: .34em; font-weight: 500; text-transform: uppercase; }
.t-num, .ed-num { font-variant-numeric: tabular-nums; }

/* ── Buttons (brief §3.6). Three kinds. 32px minimum on desktop, 44px on
   touch. Filled: ink on paper. Outline: 1px --rule-2. Text: underlined ink,
   red on hover only. Destructive is Filled in --red-text. ──────────────── */
.i-btn, .ed-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  box-sizing: border-box; min-height: 36px; padding: 0 16px;
  font-family: var(--sans); font-size: 14px; font-weight: 600; line-height: 1.2;
  letter-spacing: 0; text-transform: none; text-decoration: none; white-space: nowrap;
  color: var(--ink); background: transparent; border: 1px solid transparent; border-radius: 0;
  cursor: pointer; -webkit-appearance: none; appearance: none;
  transition: background .2s, color .2s, border-color .2s;
}
.i-btn-fill, .ed-btn-fill { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.i-btn-fill:hover, .ed-btn-fill:hover { background: var(--red-text); border-color: var(--red-text); color: var(--paper); }
.i-btn-outline, .ed-btn-outline { background: transparent; color: var(--ink); border-color: var(--rule-2); }
.i-btn-outline:hover, .ed-btn-outline:hover { background: var(--wash); border-color: var(--red-text); }
.i-btn-outline.ed-on, .ed-btn-outline.ed-on { color: var(--red-text); border-color: var(--red-text); }
.i-btn-text, .ed-btn-text { background: none; border-color: transparent; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; padding: 0 4px; min-height: 32px; }
.i-btn-text:hover, .ed-btn-text:hover { color: var(--red-text); }
.i-btn-danger, .ed-btn-danger { background: var(--red-text); color: var(--paper); border-color: var(--red-text); }
.i-btn-sm, .ed-btn-sm { min-height: 32px; padding: 0 12px; font-size: 13px; }
.i-btn-lg, .ed-btn-lg { min-height: 48px; padding: 0 22px; font-size: 15px; }
.i-btn[disabled], .ed-btn[disabled], .i-btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
@media (pointer: coarse) {
  .i-btn, .ed-btn, .i-btn-sm, .ed-btn-sm { min-height: 44px; }
}

/* ── Tags. Severity is a fill, never a blink. ────────────────────────── */
.i-tag, .ed-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; line-height: 1.3; letter-spacing: .12em; font-weight: 600; text-transform: uppercase;
  padding: 3px 8px; border: 1px solid transparent; white-space: nowrap;
}
.ed-tag-flash { background: var(--red); color: var(--on-red); border-color: var(--red); }
.ed-tag-priority { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.ed-tag-outline { background: transparent; color: var(--ink-2); border-color: var(--rule); }
.ed-tag-alarm { background: transparent; color: var(--red-text); border-color: var(--red-text); }
.ed-tag-ink { background: transparent; color: var(--ink); border-color: var(--rule-2); }

/* ── Status word: a dot plus a word in the matching -text colour. ───── */
.i-status, .ed-status { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; letter-spacing: .12em; font-weight: 600; text-transform: uppercase; }
.i-status::before, .ed-status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.ed-live { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; letter-spacing: .12em; font-weight: 600; text-transform: uppercase; color: var(--ink-2); }
.ed-live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--red); flex: none; }

/* ── Focus. One ring, 2px --focus at 2px offset, on every interactive
   element. The Edition's 53 inline outline:none declarations are gone. ─ */
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 0; }

/* ── Motion is an entrance, never a state. Nothing loops; and a reader who
   has asked the OS for less motion gets none. ───────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
