/* The AISM console's palette and type, worn only when the hub is framed by
   the console (html.embedded — set before first paint in base.html). Every
   rule here remaps a token the hub already reads, so nothing about layout,
   hover, motion or the grid changes: only colour and typeface. Both themes;
   the console tells the frame which one it is in.

   Specificity beats the hub's own blocks by design: `html.embedded` outranks
   `:root`, and `html.embedded[data-theme=dark]` outranks
   `:root[data-theme=dark]`; this file also loads after style.css. */

html.embedded {
  --sans: Arial, "Liberation Sans", Helvetica, sans-serif;
  --bg: #f4f7fa; --surface: #ffffff; --surface-2: #f7fafc; --sum-bg: #edf2f6; --track: #edf2f6;
  --ink: #0c1834; --ink-2: #2d536f; --muted: #64809a; --muted-2: #7f97ad;
  --line: #e3e9ef; --line-soft: #edf2f6;
  --accent: #0079a8; --accent-hover: #006a92; --accent-soft: #e5f8ff; --accent-line: #b8f1ff;
  --accent-fill: #00caff; --accent-fill-hover: #00b5e6; --on-accent: #0c1834;
  --lav: #b8f1ff; --lav-soft: #e5f8ff;
  --teal: #00caff; --navy: #0c1834;
  --attn: #e8833a; --attn-bg: #fdf0e6; --attn-line: #f6d9c2; --attn-ink: #a85a15;
  --ok: #0a7a6a; --ok-bg: #e4f6f2; --ok-line: rgba(10, 122, 106, 0.3);
  --warn: #a85a15; --warn-bg: #fdf0e6; --warn-line: #f6d9c2;
  --ok-ink: #0a7a6a; --warn-ink: #a85a15;
  --err: #b3204a; --err-bg: #fdeaf0; --err-line: #f3bccb;
  --topbar: #ffffff; --topbar-ink: #0c1834;
  --inverse: #0c1834; --inverse-ink: #ffffff;
  --fc-bg: #e5f8ff; --fc-bg-hover: #d5f2ff; --fav-ink: #0a7a6a; --fc-ink: #0079a8;
  --viz-actual: #0079a8; --viz-plan: #64809a; --viz-prior: #a9bfcf; --viz-rule: #e8833a;
  --viz-neg: #b3204a; --viz-grid: #e3e9ef; --viz-axis: #cfdae3; --viz-fee: #66d9ff;
  --shadow: 0 1px 2px rgba(12, 24, 52, 0.04), 0 10px 26px rgba(12, 24, 52, 0.05);
}

html.embedded[data-theme="dark"],
html.embedded.theme-dark {
  --bg: #0b1220; --surface: #121b2e; --surface-2: #172238; --sum-bg: #1c2a43; --track: #1c2a43;
  --ink: #e6edf6; --ink-2: #b9c8db; --muted: #8497ad; --muted-2: #5a7391;
  --line: #26354f; --line-soft: #1c2a43;
  --accent: #5fd3ff; --accent-hover: #8ae1ff; --accent-soft: #0e2b3d; --accent-line: #35486a;
  --accent-fill: #00caff; --accent-fill-hover: #66d9ff; --on-accent: #0c1834;
  --lav: #35486a; --lav-soft: #1c2a43;
  --teal: #00caff; --navy: #35486a;
  --attn: #e8833a; --attn-bg: #34220f; --attn-line: #5a3a1d; --attn-ink: #f3a86b;
  --ok: #3ec2aa; --ok-bg: #0f2e29; --ok-line: rgba(62, 194, 170, 0.45);
  --warn: #f3a86b; --warn-bg: #34220f; --warn-line: #5a3a1d;
  --ok-ink: #3ec2aa; --warn-ink: #f3a86b;
  --err: #f07a97; --err-bg: #3a1a26; --err-line: #5a2a3a;
  --topbar: #121b2e; --topbar-ink: #e6edf6;
  --inverse: #e6edf6; --inverse-ink: #0b1220;
  --fc-bg: #0e2b3d; --fc-bg-hover: #143a52; --fav-ink: #3ec2aa; --fc-ink: #5fd3ff;
  --viz-actual: #5fd3ff; --viz-plan: #8497ad; --viz-prior: #5a7391; --viz-rule: #e8833a;
  --viz-neg: #f07a97; --viz-grid: #26354f; --viz-axis: #35486a; --viz-fee: #0079a8;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 10px 26px rgba(0, 0, 0, 0.3);
}

/* The OS preference, when the console has not pinned a theme yet: the same
   dark block, so the first paint inside the frame never flashes light. */
@media (prefers-color-scheme: dark) {
  html.embedded:not([data-theme="light"]) {
    --bg: #0b1220; --surface: #121b2e; --surface-2: #172238; --sum-bg: #1c2a43; --track: #1c2a43;
    --ink: #e6edf6; --ink-2: #b9c8db; --muted: #8497ad; --muted-2: #5a7391;
    --line: #26354f; --line-soft: #1c2a43;
    --accent: #5fd3ff; --accent-hover: #8ae1ff; --accent-soft: #0e2b3d; --accent-line: #35486a;
    --accent-fill: #00caff; --accent-fill-hover: #66d9ff; --on-accent: #0c1834;
    --lav: #35486a; --lav-soft: #1c2a43;
    --teal: #00caff; --navy: #35486a;
    --attn: #e8833a; --attn-bg: #34220f; --attn-line: #5a3a1d; --attn-ink: #f3a86b;
    --ok: #3ec2aa; --ok-bg: #0f2e29; --ok-line: rgba(62, 194, 170, 0.45);
    --warn: #f3a86b; --warn-bg: #34220f; --warn-line: #5a3a1d;
    --ok-ink: #3ec2aa; --warn-ink: #f3a86b;
    --err: #f07a97; --err-bg: #3a1a26; --err-line: #5a2a3a;
    --topbar: #121b2e; --topbar-ink: #e6edf6;
    --inverse: #e6edf6; --inverse-ink: #0b1220;
    --fc-bg: #0e2b3d; --fc-bg-hover: #143a52; --fav-ink: #3ec2aa; --fc-ink: #5fd3ff;
    --viz-actual: #5fd3ff; --viz-plan: #8497ad; --viz-prior: #5a7391; --viz-rule: #e8833a;
    --viz-neg: #f07a97; --viz-grid: #26354f; --viz-axis: #35486a; --viz-fee: #0079a8;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 10px 26px rgba(0, 0, 0, 0.3);
  }
}

/* Framed, the console already shows the brand and owns the theme: the
   hub's own brand mark and theme toggle would be duplicates. The rail
   itself stays — it is the hub's navigation and company switcher. */
html.embedded .rail-head .brand-logo,
html.embedded .mobile-bar .brand-logo,
html.embedded .theme-toggle { display: none !important; }
html.embedded .rail-head { justify-content: flex-end; }

/* Framed, the rail stands where the console's rail stands on the other
   tabs (the console draws none on the P&L tab, client review 2026-09-22),
   so it takes the console rail's width — one left bar, the same width on
   every tab. Collapsed stays the hub's own 56px. */
html.embedded body:not(.side-collapsed) .rail { width: 214px; }
