/* SPDX-FileCopyrightText: 2026 Original Syndicate, LLC */
/* SPDX-License-Identifier: LicenseRef-OGS-Proprietary */
/* ==========================================================================
   OGS suite theming tokens  (shared across every tool)
   Base :root  = OGS Default, the current look, values untouched.
   [data-ogs-theme="terminal"] = Bloomberg Terminal overlay (full reskin).
   Components read these vars; flipping the root attribute re-themes everything,
   and removing it returns to pixel-identical OGS Default.
   ========================================================================== */
:root {
  --ogs-bg:         #0a0a0a;
  --ogs-surface:    #14171d;
  --ogs-surface-2:  #1b2029;
  --ogs-border:     rgba(255,255,255,0.10);
  --ogs-text:       #e8edf7;
  --ogs-text-dim:   #8592ad;
  --ogs-accent:     #336cd2;            /* OGS blue */
  --ogs-accent-ink: #ffffff;           /* readable text on the accent */
  --ogs-pos:        #22c55e;
  --ogs-neg:        #f87171;
  --ogs-warn:       #f2a30a;
  --ogs-link:       #5a82dc;
  --ogs-font:       'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --ogs-font-mono:  'SF Mono','Cascadia Code','Roboto Mono',monospace;
  --ogs-radius:     8px;
  --ogs-radius-sm:  6px;
  --ogs-hairline:   rgba(255,255,255,0.08);
  /* Added so the MUI palette values are themable too. Each is defined at
     exactly what it already rendered, so adding them changes nothing. */
  --ogs-text-strong: #eef2fb;
  --ogs-text-soft:   #9fb2da;
  --ogs-text-faint:  #4a5a86;
  --ogs-accent-2:    #92cecf;
  --ogs-paper:       #1a1a1a;
  --ogs-elevated:    #202020;
}

/* ==========================================================================
   Classic: the June 2025 platform look, reproduced on the current build.

   Why this exists: production must run the current engine while looking like the
   system people already use, and must be able to move to the new look quickly. The
   old build cannot be recompiled, so the look travels as a theme instead of a
   separate frontend. One engine, one deploy, and the switch is the same admin
   control that already drives every other theme.

   Every value below is lifted from the old build's own shipped stylesheet rather
   than approximated, so this can be checked rather than argued about.
   ========================================================================== */
:root[data-ogs-theme="classic"] {
  /* Sampled from the real signed-in old platform. See src/theme.js for the same values;
     these two must agree or the chrome and the components disagree with each other. */
  --ogs-bg:         #121212;
  --ogs-surface:    #1e1e1e;
  --ogs-surface-2:  #2e2e2e;
  --ogs-border:     rgba(255,255,255,0.12);
  --ogs-hairline:   rgba(255,255,255,0.08);
  --ogs-text:       #ffffff;
  --ogs-text-dim:   rgba(255,255,255,0.70);
  --ogs-text-strong:#ffffff;
  --ogs-text-soft:  rgba(255,255,255,0.70);
  --ogs-text-faint: rgba(255,255,255,0.50);
  --ogs-accent:     #556cd6;
  --ogs-accent-2:   #7986cb;
  --ogs-accent-ink: #ffffff;
  --ogs-paper:      #1e1e1e;
  --ogs-elevated:   #2e2e2e;
  --ogs-pos:        #4caf50;
  --ogs-neg:        #f44336;
  --ogs-warn:       #ff9800;
  --ogs-link:       #7986cb;
  --ogs-font:       Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ogs-font-sans:  Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ogs-radius:     4px;
  --ogs-radius-sm:  4px;
}

/* The suite chrome stays dark in every theme, so it needs the light-card treatment
   undone for its own surfaces. Without this the header and footer would inherit the
   white card colour and lose all contrast against their own text. */

:root[data-ogs-theme="terminal"] {
  --ogs-bg:         #000000;
  --ogs-surface:    #080600;
  --ogs-surface-2:  #120c00;
  --ogs-border:     rgba(255,138,0,0.22);
  --ogs-text:       #ffb000;            /* amber data */
  --ogs-text-dim:   #b3720f;
  --ogs-accent:     #ff7a00;            /* bright orange, headers / keys */
  --ogs-accent-ink: #000000;
  --ogs-pos:        #2fe36b;
  --ogs-neg:        #ff3b30;
  --ogs-warn:       #ffd000;
  --ogs-link:       #4db8ff;            /* cyan links */
  --ogs-font:       'SF Mono','Cascadia Code','Roboto Mono','Consolas',monospace;
  --ogs-font-mono:  'SF Mono','Cascadia Code','Roboto Mono','Consolas',monospace;
  --ogs-radius:     0px;                /* sharp corners */
  --ogs-radius-sm:  0px;
  --ogs-hairline:   rgba(255,138,0,0.18);
}

/* --- Terminal baseline: give the whole page the black/amber/mono ground even
       before a tool's own colors are routed to the vars. Scoped so OGS Default
       is never affected. --- */
:root[data-ogs-theme="terminal"] body {
  background: var(--ogs-bg) !important;
  color: var(--ogs-text);
  font-family: var(--ogs-font);
}

/* --- Shared suite chrome re-skin (header / footer / switcher / feedback) so
       every tool's chrome goes Terminal for free; body content is routed to the
       vars per tool. --- */
:root[data-ogs-theme="terminal"] .ogs-suite-header {
  background: #000 !important; border-bottom: 1px solid var(--ogs-border);
  backdrop-filter: none;
}
:root[data-ogs-theme="terminal"] .ogs-suite-suite,
:root[data-ogs-theme="terminal"] .ogs-suite-app { color: var(--ogs-accent); }
:root[data-ogs-theme="terminal"] .ogs-suite-mark circle,
:root[data-ogs-theme="terminal"] .ogs-suite-mark text { stroke: var(--ogs-accent); fill: var(--ogs-accent); }
:root[data-ogs-theme="terminal"] .ogs-suite-app { fill: var(--ogs-accent); }
:root[data-ogs-theme="terminal"] .ogs-suite-who { color: var(--ogs-text-dim); }
:root[data-ogs-theme="terminal"] .ogs-suite-footer {
  background: #000 !important; border-top: 1px solid var(--ogs-border); color: var(--ogs-text-dim);
}
:root[data-ogs-theme="terminal"] .ogs-switch-btn {
  background: rgba(255,138,0,.12); border-color: var(--ogs-border); color: var(--ogs-text); border-radius: 0;
}
:root[data-ogs-theme="terminal"] .ogs-switch-pop,
:root[data-ogs-theme="terminal"] .ogs-switch-flyout { background: #050300; border-color: var(--ogs-border); border-radius: 0; }
:root[data-ogs-theme="terminal"] .ogs-switch-nm { color: var(--ogs-text); }
:root[data-ogs-theme="terminal"] .ogs-fb-btn { color: var(--ogs-text-dim); }

/* --- Center-header logo slot (independent of theme; shown whenever a logo is
       set). Absolutely centered so it never disturbs the brand/right nav. --- */
.ogs-suite-center {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: flex; align-items: center; pointer-events: none;
  /* max-width is set from JS (fitCenterLogo) to the real gap between the header's own
     children. Absolute positioning keeps the logo on the true centre of the header, but
     it also removes it from the flex layout, so nothing else stops it reaching the nav.
     overflow guards the moment before the measurement runs. */
  overflow: hidden;
}
/* Center-header logo, sized here authoritatively (!important) so it wins over the
   per-app inlined base-chrome copies and applies at one size across the platform.
   Doubled from 26px → 52px per request. The header grows to give it that room
   (min-height, so taller headers like the dashboard's 64px MUI bar aren't shrunk;
   the drifted 48px tool headers grow to contain the bigger logo). */
.ogs-suite-header { min-height: 60px !important; }
.ogs-suite-center-logo { display: block; height: 52px !important; max-height: 56px !important; width: auto; max-width: 100% !important; object-fit: contain; }

/* ==========================================================================
   Terminal, generic (class-agnostic) content reskin. These element-level
   rules re-theme the common surfaces of every tool without needing to know its
   private class names. Scoped entirely under [data-ogs-theme="terminal"] so OGS
   Default is never touched.
   ========================================================================== */
:root[data-ogs-theme="terminal"] { color-scheme: dark; }

/* headings + links + rules */
:root[data-ogs-theme="terminal"] h1, :root[data-ogs-theme="terminal"] h2,
:root[data-ogs-theme="terminal"] h3, :root[data-ogs-theme="terminal"] h4 { color: var(--ogs-accent); }
:root[data-ogs-theme="terminal"] a:not(.ogs-suite-brand):not(.ogs-switch-cell) { color: var(--ogs-link); }
:root[data-ogs-theme="terminal"] hr { border-color: var(--ogs-border); }

/* form controls → sharp, mono, amber-on-black */
:root[data-ogs-theme="terminal"] input,
:root[data-ogs-theme="terminal"] select,
:root[data-ogs-theme="terminal"] textarea,
:root[data-ogs-theme="terminal"] button { border-radius: 0 !important; font-family: var(--ogs-font); }
:root[data-ogs-theme="terminal"] input:not([type=range]),
:root[data-ogs-theme="terminal"] select,
:root[data-ogs-theme="terminal"] textarea {
  background: var(--ogs-surface); color: var(--ogs-text); border: 1px solid var(--ogs-border);
}
:root[data-ogs-theme="terminal"] input::placeholder,
:root[data-ogs-theme="terminal"] textarea::placeholder { color: var(--ogs-text-dim); }

/* tables */
:root[data-ogs-theme="terminal"] table { color: var(--ogs-text); border-color: var(--ogs-border); }
:root[data-ogs-theme="terminal"] th { color: var(--ogs-accent); border-color: var(--ogs-border) !important; }
:root[data-ogs-theme="terminal"] td { border-color: var(--ogs-border) !important; }

/* shared OGS component vocab used by the stdlib tools (billing / show-reports / …) */
:root[data-ogs-theme="terminal"] .sr-card,
:root[data-ogs-theme="terminal"] .card,
:root[data-ogs-theme="terminal"] .panel,
:root[data-ogs-theme="terminal"] .tool-card,
:root[data-ogs-theme="terminal"] .metric,
:root[data-ogs-theme="terminal"] .box {
  background: var(--ogs-surface) !important; border-color: var(--ogs-border) !important; border-radius: 0 !important;
}
:root[data-ogs-theme="terminal"] .sr-h1,
:root[data-ogs-theme="terminal"] .sr-result-title { color: var(--ogs-accent); }
:root[data-ogs-theme="terminal"] .sr-btn,
:root[data-ogs-theme="terminal"] .btn,
:root[data-ogs-theme="terminal"] .btn-primary,
:root[data-ogs-theme="terminal"] .tab.on,
:root[data-ogs-theme="terminal"] .sr-tab.on {
  background: var(--ogs-accent) !important; color: var(--ogs-accent-ink) !important; border-color: var(--ogs-accent) !important; border-radius: 0 !important;
}
:root[data-ogs-theme="terminal"] .sr-btn-ghost,
:root[data-ogs-theme="terminal"] .btn-ghost,
:root[data-ogs-theme="terminal"] .sr-chip,
:root[data-ogs-theme="terminal"] .chip,
:root[data-ogs-theme="terminal"] .pill { border-radius: 0 !important; border-color: var(--ogs-border) !important; color: var(--ogs-text); }
:root[data-ogs-theme="terminal"] .sr-report,
:root[data-ogs-theme="terminal"] pre,
:root[data-ogs-theme="terminal"] code { color: var(--ogs-text); background: var(--ogs-surface); border-radius: 0; }
:root[data-ogs-theme="terminal"] .sr-muted,
:root[data-ogs-theme="terminal"] .muted,
:root[data-ogs-theme="terminal"] .sr-sub { color: var(--ogs-text-dim); }

/* ==========================================================================
   Instrument appearance, an operations-console palette (signal blue on deep
   near-black). Selected via the 'MCR Instrument' appearance; the dashboard
   home also swaps to a signal-dense layout under it.
   ========================================================================== */
:root[data-ogs-theme="instrument"] {
  --ogs-bg:#070a0f; --ogs-surface:#0e131c; --ogs-surface-2:#131b26;
  --ogs-border:rgba(150,178,220,0.10); --ogs-text:#e7edf6; --ogs-text-dim:#93a1b6;
  --ogs-accent:#4d8df0; --ogs-accent-ink:#06101f;
  --ogs-pos:#33c98a; --ogs-neg:#f0625f; --ogs-warn:#e8a33d; --ogs-link:#6aa6ff;
  --ogs-live:#ff5a4d;
  --ogs-font:'Plus Jakarta Sans',system-ui,-apple-system,sans-serif;
  --ogs-font-mono:'SF Mono','Cascadia Code','Roboto Mono',monospace;
  --ogs-radius:3px; --ogs-radius-sm:2px; --ogs-hairline:rgba(150,178,220,0.08);
  color-scheme:dark;
}
:root[data-ogs-theme="instrument"] body { background:var(--ogs-bg) !important; color:var(--ogs-text); font-family:var(--ogs-font); }
:root[data-ogs-theme="instrument"] .ogs-suite-header { background:#070a0f !important; border-bottom:1px solid var(--ogs-border); backdrop-filter:none; }
:root[data-ogs-theme="instrument"] .ogs-suite-app { color:var(--ogs-text); }
:root[data-ogs-theme="instrument"] .ogs-suite-suite { color:var(--ogs-text-dim); }
:root[data-ogs-theme="instrument"] .ogs-suite-footer { background:#070a0f !important; border-top:1px solid var(--ogs-border); color:var(--ogs-text-dim); }
:root[data-ogs-theme="instrument"] .ogs-switch-btn { background:rgba(77,141,240,.10); border-color:var(--ogs-border); color:var(--ogs-text); }
:root[data-ogs-theme="instrument"] .ogs-switch-pop,
:root[data-ogs-theme="instrument"] .ogs-switch-flyout { background:#0b0f16; border-color:var(--ogs-border); }

/* ===== Minard · Flow (cartographic) ===== */
:root[data-ogs-theme="minard"]{
  --ogs-bg:#120e18;--ogs-surface:#1c1626;--ogs-surface-2:#241b30;
  --ogs-border:rgba(202,169,107,0.16);--ogs-text:#e9e0d2;--ogs-text-dim:#a99f8c;
  --ogs-accent:#caa96b;--ogs-accent-ink:#1a1206;--ogs-pos:#8fae6b;--ogs-neg:#b5453b;--ogs-warn:#c98a2e;--ogs-link:#caa96b;
  --ogs-font:Georgia,'Times New Roman',serif;--ogs-font-mono:ui-monospace,'SF Mono',monospace;--ogs-radius:5px;color-scheme:dark;
}
:root[data-ogs-theme="minard"] body{background:radial-gradient(120% 120% at 20% 0%,#1a1422,#100c16) fixed !important;color:var(--ogs-text);}
:root[data-ogs-theme="minard"] .ogs-suite-header{background:#120e18 !important;border-bottom:1px solid var(--ogs-border);}
:root[data-ogs-theme="minard"] .ogs-suite-app{color:var(--ogs-text);}

/* ===== Nightingale · Clinical (light), light body, dark top bar kept ===== */
:root[data-ogs-theme="nightingale"]{
  --ogs-bg:#eef1f5;--ogs-surface:#ffffff;--ogs-surface-2:#f5f7fa;
  --ogs-border:#d9dee6;--ogs-text:#1b2430;--ogs-text-dim:#5f6b7a;
  --ogs-accent:#2f8f88;--ogs-accent-ink:#ffffff;--ogs-pos:#2f8f88;--ogs-neg:#c05a6e;--ogs-warn:#c98a2e;--ogs-link:#2f7d8f;
  --ogs-font:system-ui,-apple-system,sans-serif;--ogs-font-serif:Georgia,serif;--ogs-font-mono:ui-monospace,monospace;--ogs-radius:10px;color-scheme:light;
}
:root[data-ogs-theme="nightingale"] body{background:var(--ogs-bg) !important;color:var(--ogs-text);}
:root[data-ogs-theme="nightingale"] .ogs-page,
:root[data-ogs-theme="nightingale"] main{background:var(--ogs-bg) !important;}

/* ===== Fuller · Systems (blueprint) ===== */
:root[data-ogs-theme="fuller"]{
  --ogs-bg:#081420;--ogs-surface:#0d2233;--ogs-surface-2:#0f2a3f;
  --ogs-border:rgba(87,199,224,0.32);--ogs-text:#d6ecf3;--ogs-text-dim:#6f96a5;
  --ogs-accent:#57c7e0;--ogs-accent-ink:#04141c;--ogs-pos:#4fd0a0;--ogs-neg:#ef6a63;--ogs-warn:#e6b45a;--ogs-link:#57c7e0;
  --ogs-font:ui-monospace,'SF Mono','Roboto Mono',monospace;--ogs-font-sans:system-ui,sans-serif;--ogs-font-mono:ui-monospace,monospace;--ogs-radius:3px;color-scheme:dark;
}
:root[data-ogs-theme="fuller"] body{background:
  linear-gradient(rgba(90,190,220,.06) 1px,transparent 1px) 0 0/26px 26px,
  linear-gradient(90deg,rgba(90,190,220,.06) 1px,transparent 1px) 0 0/26px 26px,
  radial-gradient(120% 120% at 80% -10%,#0c2233,#06101a) fixed !important;color:var(--ogs-text);}
:root[data-ogs-theme="fuller"] .ogs-suite-header{background:#081420 !important;border-bottom:1px solid var(--ogs-border);}
:root[data-ogs-theme="fuller"] .ogs-suite-app{color:var(--ogs-text);}

/* ==========================================================================
   Loewy · Everyday, a mass-desire consumer palette: deep brand blue ground,
   electric-blue interactive, a hot red pop, white type, and soft rounded
   corners. Raymond Loewy's "Most Advanced Yet Acceptable", bold and modern
   yet warm and approachable ("design the moment"). Blue + red + white read as
   the classic globe. Scoped entirely under [data-ogs-theme="loewy"].
   ========================================================================== */
:root[data-ogs-theme="loewy"]{
  --ogs-bg:#001a5e;              /* deep Pepsi blue ground */
  --ogs-surface:#0a2c7a;
  --ogs-surface-2:#123a92;
  --ogs-border:rgba(255,255,255,0.16);
  --ogs-text:#f2f7ff;
  --ogs-text-dim:#a9c0ea;
  --ogs-accent:#2e7bff;          /* electric blue, interactive/primary */
  --ogs-accent-ink:#ffffff;      /* white on blue */
  --ogs-pos:#2fd08a;
  --ogs-neg:#e11d34;             /* Pepsi red, deep, not neon, so it doesn't vibrate on blue */
  --ogs-warn:#ffb52e;
  --ogs-link:#8fb8ff;
  --ogs-live:#e11d34;
  --ogs-font:'Plus Jakarta Sans',system-ui,-apple-system,sans-serif;
  --ogs-font-mono:'SF Mono','Cascadia Code','Roboto Mono',monospace;
  --ogs-radius:12px; --ogs-radius-sm:8px;
  --ogs-hairline:rgba(255,255,255,0.10);
  color-scheme:dark;
}
:root[data-ogs-theme="loewy"] body{background:
  radial-gradient(130% 120% at 85% -10%,#0b3aa0,#001a5e 55%,#00114a) fixed !important;
  color:var(--ogs-text);font-family:var(--ogs-font);}
:root[data-ogs-theme="loewy"] .ogs-page,
:root[data-ogs-theme="loewy"] main{background:transparent !important;}
/* Blue header. Red is incorporated the way the globe does it, never touching the
   blue directly: a crisp white rule separates the blue header from a thin red
   accent beneath it (blue → white → red), so the two saturated colours never
   vibrate against each other. */
:root[data-ogs-theme="loewy"] .ogs-suite-header{
  background:linear-gradient(90deg,#004b93,#005cb4) !important;
  border-bottom:2px solid #ffffff; box-shadow:0 2px 0 0 var(--ogs-neg);
  backdrop-filter:none;}
:root[data-ogs-theme="loewy"] .ogs-suite-suite{color:rgba(255,255,255,.72);}
:root[data-ogs-theme="loewy"] .ogs-suite-app{color:#fff; fill:#fff;}
:root[data-ogs-theme="loewy"] .ogs-suite-mark circle,
:root[data-ogs-theme="loewy"] .ogs-suite-mark text{stroke:#fff;fill:#fff;}
:root[data-ogs-theme="loewy"] .ogs-suite-who{color:#fff;border-color:rgba(255,255,255,.35);}
:root[data-ogs-theme="loewy"] .ogs-suite-adminbtn,
:root[data-ogs-theme="loewy"] .ogs-suite-right .ogs-fb-btn{color:#fff;border-color:rgba(255,255,255,.35);}
:root[data-ogs-theme="loewy"] .ogs-switch-btn{background:rgba(255,255,255,.16);border-color:rgba(255,255,255,.35);color:#fff;}
:root[data-ogs-theme="loewy"] .ogs-switch-pop,
:root[data-ogs-theme="loewy"] .ogs-switch-flyout{background:#0a2c7a;border-color:var(--ogs-border);}
:root[data-ogs-theme="loewy"] .ogs-switch-nm{color:var(--ogs-text);}
:root[data-ogs-theme="loewy"] .ogs-suite-footer{
  background:#00114a !important;border-top:1px solid var(--ogs-border);color:var(--ogs-text-dim);}

/* Generic content reskin so the stdlib tools go Loewy for free. */
:root[data-ogs-theme="loewy"] h1,:root[data-ogs-theme="loewy"] h2,
:root[data-ogs-theme="loewy"] h3,:root[data-ogs-theme="loewy"] h4{color:var(--ogs-text);}
:root[data-ogs-theme="loewy"] a:not(.ogs-suite-brand):not(.ogs-switch-cell){color:var(--ogs-link);}
:root[data-ogs-theme="loewy"] hr{border-color:var(--ogs-border);}
:root[data-ogs-theme="loewy"] input:not([type=range]),
:root[data-ogs-theme="loewy"] select,
:root[data-ogs-theme="loewy"] textarea{
  background:var(--ogs-surface);color:var(--ogs-text);border:1px solid var(--ogs-border);border-radius:var(--ogs-radius-sm);}
:root[data-ogs-theme="loewy"] input::placeholder,
:root[data-ogs-theme="loewy"] textarea::placeholder{color:var(--ogs-text-dim);}
:root[data-ogs-theme="loewy"] table{color:var(--ogs-text);border-color:var(--ogs-border);}
:root[data-ogs-theme="loewy"] th{color:#fff;border-color:var(--ogs-border) !important;}
:root[data-ogs-theme="loewy"] td{border-color:var(--ogs-border) !important;}
:root[data-ogs-theme="loewy"] .sr-card,:root[data-ogs-theme="loewy"] .card,
:root[data-ogs-theme="loewy"] .panel,:root[data-ogs-theme="loewy"] .tool-card,
:root[data-ogs-theme="loewy"] .metric,:root[data-ogs-theme="loewy"] .box{
  background:var(--ogs-surface) !important;border-color:var(--ogs-border) !important;border-radius:var(--ogs-radius) !important;}
:root[data-ogs-theme="loewy"] .sr-btn,:root[data-ogs-theme="loewy"] .btn,
:root[data-ogs-theme="loewy"] .btn-primary,:root[data-ogs-theme="loewy"] .tab.on,
:root[data-ogs-theme="loewy"] .sr-tab.on{
  background:var(--ogs-accent) !important;color:var(--ogs-accent-ink) !important;border-color:var(--ogs-accent) !important;border-radius:999px !important;}
:root[data-ogs-theme="loewy"] .sr-chip,:root[data-ogs-theme="loewy"] .chip,
:root[data-ogs-theme="loewy"] .pill{border-radius:999px !important;border-color:var(--ogs-border) !important;color:var(--ogs-text);}
:root[data-ogs-theme="loewy"] .sr-muted,:root[data-ogs-theme="loewy"] .muted,
:root[data-ogs-theme="loewy"] .sr-sub{color:var(--ogs-text-dim);}
