/* assets/ronnie-ui/theme-toggle.css  V1133 LIGHT/DARK TOGGLE.
 *
 * ADDITIVE ONLY. No base file (tokens.css, shell.css, portal-command.css,
 * mission-control-skin.css) is modified. This file only adds new rules
 * that fire under [data-theme="dark"] on <html>.
 *
 * Every color below is REUSED verbatim from an existing, already-shipped
 * palette in this codebase  nothing here is a new design:
 *   - Home's dark values = assets/admin-cockpit.css's own :root (--cp-*),
 *     the palette the owner named directly ("the colors I like servicing
 *     the admin panel"). Home never had a dark version of its own, so it
 *     adopts this one, unchanged.
 *   - Mission Control's dark values = assets/portal-command.css's own
 *     ORIGINAL :root  the exact tokens that page shipped with before
 *     mission-control-skin.css began overriding them light. Restoring
 *     them is not a redesign; it is turning the skin override off.
 *   - Live Dialer and Customer Portal are NOT touched here: both are
 *     already dark, natively, with no light mode  nothing to toggle. */

/* ===== HOME (ronnie-home.html)  reuses assets/admin-cockpit.css's exact values ===== */
:root[data-theme="dark"] {
  --rh-bg:#060a16; --rh-card:#0a1122; --rh-line: rgba(65,234,255,.16);
  --rh-ink:#eaf1ff; --rh-mute:#93a6cc;
  --rh-blue:#41eaff; --rh-blue-soft: rgba(65,234,255,.12); --rh-blue-ring: rgba(65,234,255,.35);
  --rh-green:#7cffb2; --rh-green-soft: rgba(124,255,178,.12);
  --rh-purple:#bd8bff; --rh-purple-soft: rgba(189,139,255,.12);
  --rh-orange:#ffd479; --rh-orange-soft: rgba(255,212,121,.12);
  --rh-amber:#ffd479;  --rh-amber-soft: rgba(255,212,121,.12);

  /* the underlying V1066 design-system tokens (shell.css / components.css
     consume these directly) -- same admin-cockpit values, same mapping */
  --rn-bg:#060a16; --rn-surface:#0a1122; --rn-surface-soft:#0a1122;
  --rn-border: rgba(65,234,255,.16); --rn-border-strong: rgba(65,234,255,.28);
  --rn-blue:#41eaff; --rn-blue-hover:#7df9ff; --rn-blue-deep:#41eaff; --rn-blue-soft: rgba(65,234,255,.12);
  --rn-live:#7cffb2; --rn-live-soft: rgba(124,255,178,.12);
  --rn-text:#eaf1ff; --rn-text-mute:#93a6cc; --rn-text-on-blue:#060a16;
  --rn-warn:#ffd479; --rn-warn-soft: rgba(255,212,121,.12);
  --rn-error:#ff8b8b; --rn-error-soft: rgba(255,139,139,.12);
}
:root[data-theme="dark"] .rh-nav a:hover{ background: rgba(65,234,255,.10); color:#eaf1ff; }
:root[data-theme="dark"] .rh-mascot-card{ background:linear-gradient(180deg,#0a1122 0%,#060a16 100%); border-color: rgba(65,234,255,.24); }
:root[data-theme="dark"] .rh-hero{ background:linear-gradient(115deg,#0a1122 0%,#0c1428 62%,#060a16 100%); }
:root[data-theme="dark"] .rn-btn--ghost{ background:#0a1122; border-color: rgba(65,234,255,.24); }
:root[data-theme="dark"] .rn-btn--ghost:hover{ border-color:#41eaff; }
:root[data-theme="dark"] .rn-pill{ background:#0a1122; }

/* ===== MISSION CONTROL (customer-mission-control.html)  restores its OWN
   original tokens from assets/portal-command.css, verbatim, AND overrides
   the light "skin-local rh- helpers" that mission-control-skin.css defines
   on the same body.pc-scope selector (that second block is why an
   :root-only override wasn't enough: body's own declared value beats an
   inherited one). Every value here is copied from one of two places:
   portal-command.css's real original :root (the --bg/--panel/--cyan/etc
   family) or the same admin-cockpit-derived dark set already used for
   Home (the --rh-* family)  nothing invented for this page either. ===== */
html[data-theme="dark"] body.pc-scope {
  color-scheme: dark;
  --bg:#030712; --panel:#0b1022; --panel-2:#0b1022; --border: rgba(34,211,238,.20);
  --cyan:#22d3ee; --cyan-bright:#7df9ff; --blue:#2367ff;
  --purple:#8b36f3; --purple-2:#8b36f3; --pink:#ef5ff8;
  --text:#ffffff; --text-dim:#a9c1e8; --text-mute:#7488ad;
  --pc-glass:#0b1022; --pc-glass-strong:#0b1022; --pc-glass-border: rgba(34,211,238,.22);
  --pc-glow-cyan: rgba(34,211,238,.16); --pc-glow-purple: rgba(139,54,243,.14);
  --pc-danger:#ef4444; --pc-good:#34d399; --pc-warn:#fbbf24;

  /* skin-local rh- helpers  same dark mapping already used on Home */
  --rh-card:#0a1122; --rh-line: rgba(65,234,255,.16); --rh-ink:#eaf1ff; --rh-mute:#93a6cc;
  --rh-blue:#41eaff; --rh-blue-soft: rgba(65,234,255,.12); --rh-blue-ring: rgba(65,234,255,.35);
  --rh-green:#7cffb2; --rh-green-soft: rgba(124,255,178,.12);
  --rh-amber:#ffd479; --rh-amber-soft: rgba(255,212,121,.12);
  --rh-red:#ff8b8b; --rh-red-soft: rgba(255,139,139,.12);
  --rh-shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -18px rgba(0,0,0,.5);
}
html[data-theme="dark"] body.pc-scope .mc-btn--ghost,
html[data-theme="dark"] body.pc-scope .mc-brief-btn--ghost {
  background:#0a1122 !important; color:#eaf1ff !important; border-color: rgba(65,234,255,.24) !important;
}

/* ===== THE SWITCH ITSELF  a real, visible control, always in the topbar ===== */
.rn-theme-toggle{
  display:inline-flex; align-items:center; gap:8px;
  background: var(--rh-card,#fff); border:1px solid var(--rh-line,#E6ECF4);
  border-radius:999px; padding:6px 14px 6px 6px; cursor:pointer;
  font-family: var(--rn-font,'Inter',Arial,sans-serif); font-size:13px; font-weight:600;
  color: var(--rh-mute,#5B6B85); user-select:none; transition:.15s;
}
.rn-theme-toggle:hover{ border-color: var(--rh-blue,#2563EB); }
.rn-theme-toggle__track{
  width:34px; height:19px; border-radius:999px; position:relative; flex:none;
  background: var(--rh-line,#E6ECF4); transition:.18s;
}
.rn-theme-toggle__knob{
  position:absolute; top:2px; left:2px; width:15px; height:15px; border-radius:50%;
  background:#fff; box-shadow:0 1px 2px rgba(16,24,40,.25); transition:.18s;
}
:root[data-theme="dark"] .rn-theme-toggle__track{ background:#41eaff; }
:root[data-theme="dark"] .rn-theme-toggle__knob{ left:17px; background:#060a16; }
:root[data-theme="dark"] .rn-theme-toggle{ color:#eaf1ff; }

/* ===== SHARED SIDEBAR TOGGLE (rh2-rail, injected on Dialer/Mission
   Control/Portal/Knowledge by theme-toggle.js's mountSwitch()) ===== */
.rh2-item[data-theme-toggle][aria-pressed="true"]{ color:#2563eb; }
:root[data-theme="dark"] .rh2-item[data-theme-toggle][aria-pressed="true"]{ color:#41eaff; }

/* ===== SHARED RAIL (.rh2-rail)  present on Dialer, Mission Control,
   Portal and Knowledge (and defined, unused, in Home's own stylesheet).
   Its white background is the platform's real, permanent, unconditional
   styling (not a lab override)  it never had a dark version at all, so
   this reuses the same already-established dark palette, same as Home's
   hero/pill/button fixes above. ===== */
:root[data-theme="dark"] .rh2-rail{ background:#0a1122 !important; border-right-color: rgba(65,234,255,.16) !important; }
:root[data-theme="dark"] .rh2-item{ color:#93a6cc !important; }
:root[data-theme="dark"] .rh2-item:hover, :root[data-theme="dark"] .rh2-group.is-open .rh2-item--group{ background: rgba(65,234,255,.10) !important; color:#41eaff !important; }
:root[data-theme="dark"] .rh2-item.is-active, :root[data-theme="dark"] .rh2-group.is-active > .rh2-item--group{ background: rgba(65,234,255,.10) !important; color:#41eaff !important; }
:root[data-theme="dark"] .rh2-flyout{ background:#0a1122 !important; border-color: rgba(65,234,255,.20) !important; }
:root[data-theme="dark"] .rh2-flyout__title{ color:#93a6cc !important; }
:root[data-theme="dark"] .rh2-flyitem{ color:#eaf1ff !important; }
:root[data-theme="dark"] .rh2-flyitem:hover{ background: rgba(65,234,255,.10) !important; color:#41eaff !important; }
:root[data-theme="dark"] .rh2-flyitem.is-active{ background: rgba(65,234,255,.14) !important; color:#41eaff !important; }
:root[data-theme="dark"] .rh2-logo{ color:#41eaff !important; }

/* ===== V1135 FULL-SWEEP: MISSION CONTROL ROOM LAYER ==================
   mission-control-continuity.css is a THIRD forced-light layer (beyond
   the lab-clean blocks and mission-control-skin.css): it hard-forces the
   page canvas light, redefines the whole dark token set on html.pc-scope,
   body.pc-scope AND #mc-scene (an ancestor closer than body, which is why
   the body-scoped override above was not enough), converts .command-room /
   .command-widget to white with !important, forces all room text dark,
   and pins the greeting ids dark. It is structural CSS mixed with the
   light conversion, so it cannot be disabled wholesale like the
   lab-clean blocks -- these are targeted counters, each restoring the
   VERBATIM original value from portal-command.css. */

/* token layer -- must also cover html.pc-scope and #mc-scene */
html[data-theme="dark"].pc-scope, html[data-theme="dark"] body.pc-scope, html[data-theme="dark"] #mc-scene {
  --bg:#030712; --panel:#0b1022; --panel-2:#0b1022; --border: rgba(34,211,238,.20);
  --cyan:#22d3ee; --cyan-bright:#7df9ff; --blue:#2367ff;
  --purple:#8b36f3; --purple-2:#8b36f3; --pink:#ef5ff8;
  --text:#ffffff; --text-dim:#a9c1e8; --text-mute:#7488ad;
  --pc-glass:#0b1022; --pc-glass-strong:#0b1022; --pc-glass-border: rgba(34,211,238,.22);
  --pc-glow-cyan: rgba(34,211,238,.16); --pc-glow-purple: rgba(139,54,243,.14);
  --pc-danger:#ef4444; --pc-good:#34d399; --pc-warn:#fbbf24;
}
/* page canvas (counters continuity's html,body #F4F7FB !important) */
/* V1145 fix (owner-confirmed real defect): this rule only ever fired for body.pc-scope pages —
 * customer-portal.html, ronnie-intelligence.html and research-reports.html carry no matching
 * class, so in dark mode their <body> had NO opaque background at all, letting whatever was
 * behind the browser window show straight through. The intent was clearly "every page gets an
 * opaque dark background" — matching on html[data-theme="dark"] body alone (no class required)
 * covers every page uniformly; the original .pc-scope selector is kept alongside so nothing that
 * already matched it changes. */
html[data-theme="dark"], html[data-theme="dark"] body { background:#030712 !important; }

/* room overlay -- verbatim original from portal-command.css */
html[data-theme="dark"] .command-room {
  background:
    radial-gradient(ellipse 80% 60% at 20% 0%, rgba(35,103,255,.16), transparent 60%),
    radial-gradient(ellipse 60% 50% at 90% 20%, rgba(139,54,243,.14), transparent 60%),
    rgba(3,7,18,.62) !important;
  backdrop-filter: blur(22px) saturate(140%) !important;
  -webkit-backdrop-filter: blur(22px) saturate(140%) !important;
}
html[data-theme="dark"] .command-room__header { background: transparent !important; border-bottom: 1px solid var(--border) !important; }
html[data-theme="dark"] .command-room, html[data-theme="dark"] .command-room * { color: var(--text-dim); }
html[data-theme="dark"] .command-room__title { color: var(--text) !important; }
html[data-theme="dark"] .command-room__breadcrumb, html[data-theme="dark"] .command-widget h3 { color: var(--text-mute) !important; }
html[data-theme="dark"] .command-widget {
  background: linear-gradient(180deg, rgba(125,249,255,.05), rgba(11,16,34,.55)) !important;
  border: 1px solid var(--pc-glass-border) !important;
  box-shadow: none !important;
}
/* inline light text colors: continuity forces them dark for the white
   skin; in dark mode the inline originals are correct again */
html[data-theme="dark"] .command-room [style*="color:#a5f3fc"] { color:#a5f3fc !important; }
html[data-theme="dark"] .command-room [style*="color:#cbd5e1"] { color:#cbd5e1 !important; }
html[data-theme="dark"] .command-room [style*="color:#8fa3c7"] { color:#8fa3c7 !important; }
/* greeting ids (also fixes the "invisible greeting" defect in dark) */
html[data-theme="dark"] #mcGreetingLine1 { color:#ffffff !important; }
html[data-theme="dark"] #mcGreetingPriorities { color:#a9c1e8 !important; }
/* Outbound Command tabs/forms inside rooms */
html[data-theme="dark"] .wf-tab-panel { background:#0b1022 !important; border:1px solid rgba(34,211,238,.20) !important; }
html[data-theme="dark"] .wf-form-grid input, html[data-theme="dark"] .wf-form-grid textarea, html[data-theme="dark"] .wf-form-grid select {
  background:#0a1020 !important; border:1px solid rgba(65,234,255,.30) !important; color:#eaf1ff !important;
}
html[data-theme="dark"] .wf-form-grid label { color:#7488ad !important; }
html[data-theme="dark"] .wf-tab-btn { background: rgba(148,169,214,.08) !important; border:1px solid rgba(148,169,214,.3) !important; color:#aebadb !important; }
html[data-theme="dark"] .wf-tab-btn.is-active { background:#2367ff !important; border-color:#2367ff !important; color:#ffffff !important; }
/* continuity's Home-copy + mc2 shell components */
:root[data-theme="dark"] .rh-nav a:hover { background: rgba(65,234,255,.10); color:#eaf1ff; }
:root[data-theme="dark"] .rn-action { background:#0a1122; }
:root[data-theme="dark"] .rn-action:hover { background: rgba(65,234,255,.08); }
:root[data-theme="dark"] .mc2-hero { background: linear-gradient(115deg,#0a1122 0%,#0c1428 62%,#060a16 100%); }
:root[data-theme="dark"] .mc2-hero__quote, :root[data-theme="dark"] .mc2-hero__stat { background:#0a1122; }
:root[data-theme="dark"] .mc2-qa-tile { background:#0a1122; }
:root[data-theme="dark"] .mc2-qa-tile:hover { background: rgba(65,234,255,.08); }
html[data-theme="dark"] #mc-scene > .mc-brief-display { background: linear-gradient(115deg,#0a1122 0%,#0c1428 100%) !important; }

/* pages whose <body> lacks .rn-page fall back to browser-default black
   text; in dark mode default text is light (light mode untouched) */
:root[data-theme="dark"] body { color:#eaf1ff; }
/* form fields inside Mission Control rooms (generic, beyond wf-form-grid) */
html[data-theme="dark"] .command-room input, html[data-theme="dark"] .command-room select, html[data-theme="dark"] .command-room textarea {
  background:#0a1020 !important; border:1px solid rgba(65,234,255,.30) !important; color:#eaf1ff !important;
}
html[data-theme="dark"] .command-room input::placeholder, html[data-theme="dark"] .command-room textarea::placeholder { color:#7488ad !important; }
