/* Trade Vantage, the app only: the Night desk (approved 7 Nov 2026, TJay 23:14 CT; 94 boards in
   docs/design/app/boards/, spec docs/design/app/SPEC.md, a copy of AIOS/Design/outbox/
   2026-11-08-0102__trade-vantage__in-app-design-spec.md). Replaces the 27 Oct Night session
   (steel accent, Geist).

   Loaded by index.html after the app's own stylesheets, never by the public pages (they wear the
   same tokens in styles/web*.css, and must not see these rules). It redefines the token names the
   app already reads, so every rule that uses them follows without an edit, and adds the spec's new
   names (spec 1.1) for the component rules under the NIGHT DESK banners in styles/app.css.

   Colours are the dark theme's only: Light and Ink on white keep their own values by role
   (decision D1, default). Type, radii and motion are every theme's. */

/* ---------- Every theme: type, motion, radii (spec 1.4 to 1.8) ---------- */
:root {
  /* Familjen Grotesk 600 for display, headings and display figures; Instrument Sans for words and
     every other figure, set in tabular figures on the whole app (below). No monospace face. */
  --sans: 'Instrument Sans', system-ui, sans-serif;
  --display: 'Familjen Grotesk', 'Instrument Sans', system-ui, sans-serif;
  --mono: 'Instrument Sans', system-ui, sans-serif;
  --hf: var(--display);
  --bf: var(--sans);
  --display-settings: normal;
  --title-settings: normal;
  --font-body: var(--sans);
  --font-heading: var(--display);

  /* Motion (spec 1.8): one curve; .35 to .55 s for colour and ground, .7 to .9 s for a sheet. */
  --ease: cubic-bezier(.22, 1, .36, 1);
  --ez: var(--ease);
  --dur-colour: .45s;
  --dur-sheet: .8s;

  /* Radii (spec 1.6): shell 30, padding 8, core 23, seams 6. Three older names keep a -night
     suffix (the app reads --r-xs, --r-sm and --r-core for other things). */
  --r-hair: 2px;
  --r-xs-night: 4px;
  --r-sm-night: 8px;
  --r-chip: 999px;
  --r-row: 10px;
  --r-item: 14px;
  --r-well: 17px;
  --r-core-night: 23px;
  --r-seam: 6px;
  --r-seg: 999px;
  --r-shell: 30px;

  /* Type sizes (spec 1.4) */
  --t-title-today: 56px;
  --t-title: 44px;
  --t-next: 64px;
  --t-hero: 48px;
  --t-big: 40px;
  --t-count: 34px;
  --t-sheet: 30px;
  --t-core: 20px;
  --t-row: 18px;
  --t-body: 16px;
  --t-ui: 14px;
  --t-label: 13px;
  --t-small: 12px;
  --t-micro: 11px;
}
html { font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

/* ---------- Daylight: the app's colours (spec v5.1 over v2 2.1-2.3; TJay 20-21 Nov 2026) ----------
   The one home for every colour (spec v2 2.3, brief 7.1). The block keeps its selector so every
   rule written for the default theme follows; Light and Ink on white stay in the code, unused
   (A10: Daylight is the only theme). The token names the app already reads keep their names; the
   spec's names (fog, paper, ink, stone, navy) are added beside them. */
:root:not([data-theme="light"]):not([data-theme="contrast"]) {
  /* The spec's names (v2 2.1) */
  --fog: #E8ECEE;
  --paper: #FFFFFF;
  --ink: #121A24;
  --ink2: #4A5562;
  --ink3: #5E6976;
  --acc: #DAD4C8;            /* stone: the time block, the knob, caps, open-risk segment 1 */
  --acc-2: #B5AC9C;          /* stone 2: open-risk segment 2 */
  --acc-lip: #CFC8BA;        /* the lip's top edge */
  --hl: #46505C;             /* stone on light: the Now time, small accent text */
  --on-stone: #3E382E;       /* dial and band labels on stone */
  --on-paper: #38404B;       /* labels on paper */
  --n: #1A2A42;              /* Harbour navy: rail, dial, pills, primary buttons, plates */
  --n-pale: rgba(26, 42, 66, .24);
  --neg-hero: #880F1A;
  --night: var(--fog);
  --night-2: #D7DEE3;
  --night-core: var(--paper);
  --night-deep: #F4F6F7;
  --ink-section: var(--ink);
  --text-3: var(--ink2);
  --text-dim: var(--ink3);
  --ember: var(--n);
  --ember-chip-ink: var(--on-paper);
  --ember-chip: rgba(70, 80, 92, .10);
  --ember-wash: rgba(70, 80, 92, .06);
  --neg-text: #9B111E;
  --neg-fill: var(--neg-text);
  --zero: #8C96A1;
  --news: var(--neg-text);
  --news-past: #8C96A1;
  --error-ring: var(--neg-text);
  --error-icon: var(--neg-text);
  --error-title: var(--neg-text);
  --error-night: var(--error-ring);
  --bias-long: #0A805C;  --bias-long-bg: rgba(10, 128, 92, .10);
  --bias-short: #9B111E; --bias-short-bg: rgba(155, 17, 30, .08);
  --bias-flat-bg: rgba(18, 26, 36, .06);
  --scrim-night: rgba(18, 26, 36, .42);

  /* Grounds */
  --ground: var(--fog);
  --surface: var(--fog);
  --surface-2: var(--night-2);
  --surface-3: #E1E6E9;
  --chart-pane: var(--paper);
  --nav-bg: var(--n);

  /* Rings, dividers and tints: the ink at alpha (spec v2 2.1 "lines") */
  --line: rgba(18, 26, 36, .08);
  --line-2: rgba(18, 26, 36, .10);
  --line-3: rgba(18, 26, 36, .16);
  --tint-1: rgba(18, 26, 36, .035);
  --tint-2: rgba(18, 26, 36, .06);

  /* Text */
  --text: var(--ink);
  --text-2: var(--ink2);
  --muted: var(--text-3);
  --faint: var(--text-dim);
  --placeholder: var(--text-dim);

  /* Selection and time: navy marks the trader's own choices; stone is time material */
  --accent: var(--n);
  --accent-deep: var(--n);
  --accent-ink: var(--n);
  --accent-hi: var(--n);
  --accent-tint: rgba(26, 42, 66, .08);
  --accent-line: rgba(26, 42, 66, .30);

  /* Money and R only (and the bias pills, which are direction) */
  --pos: #0A805C;
  --pos-tint: rgba(10, 128, 92, .10);
  --pos-line: rgba(10, 128, 92, .32);
  --pos-ink: #0A805C;
  --neg: var(--neg-text);
  --neg-tint: rgba(155, 17, 30, .08);
  --neg-line: rgba(155, 17, 30, .35);
  --neg-ink: var(--neg-text);
  --amber: var(--neg-text);  /* Daylight has no amber (spec v2 5): a warning is the one red */
  --release: var(--news);

  /* The primary button: the navy pill with the stone knob */
  --solid-bg: var(--n);
  --solid-bg-hover: #22365A;
  --solid-ink: #F4F6F8;

  /* Surfaces */
  --ground-glow: none;
  --shell: var(--night-2);
  --core: var(--paper);
  --core-flat: var(--paper);
  --well: var(--night-deep);
  --raised: var(--paper);
  --chip-bg: rgba(18, 26, 36, .06);
  --plot: var(--paper);
  --groove: var(--night-deep);
  --engrave: var(--ink);
  --metal: var(--ink);

  /* Depth: the window's ring and long shadow, a core's top light edge */
  --shell-edge: 0 0 0 1px rgba(18, 26, 36, .07);
  --frame-float: 0 0 0 1px rgba(18, 26, 36, .07), inset 0 1px 0 rgba(255, 255, 255, .75), 0 60px 100px -50px rgba(18, 26, 36, .45);
  --core-bevel: inset 0 1px 0 #fff, 0 1px 2px rgba(18, 26, 36, .05);
  --groove-sunk: inset 0 0 0 1px rgba(18, 26, 36, .07);
  --pill-float: 0 18px 40px -12px rgba(18, 26, 36, .5);
  --outline: inset 0 0 0 1px rgba(18, 26, 36, .12);
  --selected-ring: inset 0 0 0 1.5px var(--n);
  --selected-edge: inset 2px 0 0 var(--n);
  --focus: 2px solid var(--n);
  --focus-offset: 3px;

  color-scheme: light;
}
/* Navy surfaces (the rail, the page pill, the coach, plates): the text tokens turn light there. */
:root:not([data-theme="light"]):not([data-theme="contrast"]) :is(.rail, .on-navy) {
  --text: #F4F6F8;
  --text-2: #DCE3EA;
  --text-3: #AEBBC7;
  --text-dim: #8796A4;
  --muted: #AEBBC7;
  --faint: #8796A4;
}

/* The light scope for content on fog (spec 1.2), used by a fog band only. Green and red on fog fail
   4.5:1 below 18 px (4.15 and 4.30): they go on paper, or at 18 px and up. */
.lt {
  --fog: #E8ECEE; --paper: #FFFFFF; --ink: #121A24; --ink-2: #4A5562;
  --ember-on-light: #A84E1C; --pos-light: #0A805C; --neg-light: #C0442E;
}

/* ---------- Light and ink on white (D1: kept by role) ----------
   Both keep their own values (tokens.css), with the exceptions earlier sessions found. */
:root[data-theme="light"] {
  --faint: #68686f;   /* 5.0:1 on the ground, 4.7:1 on the second surface */
}
:root[data-theme="light"] .watch-row.on, :root[data-theme="contrast"] .watch-row.on,
:root[data-theme="light"] .day-cell.on, :root[data-theme="contrast"] .day-cell.on { background: transparent; }
:root[data-theme="light"] .ghost-btn.danger, :root[data-theme="contrast"] .ghost-btn.danger { background: transparent; box-shadow: inset 0 0 0 1px var(--neg-line); }

/* Code words in Help and What's New */
code, kbd { font-family: var(--sans); font-size: .92em; }

/* Every transition and animation off when the reader asks for less motion (spec 1.8) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
