/* Visual-only successor. Light is the existing product default; artwork is never inverted. */
:root { color-scheme: light; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas:#0e1724; --paper:#172536; --line:#34475e;
  --ink:#e8f0f8; --ink-2:#c1cedd; --muted:#a9b9cb;
  --teal:#67dad5; --teal-2:#88e9e3; --cyan:#42c9ed; --teal-soft:#173d43;
  --ok:#acdfb5; --ok-soft:#1a392c; --warn:#ffdb8a; --warn-soft:#3e3320;
  --bad:#ffaaa6; --bad-soft:#422932; --idle:#bfccdc; --idle-soft:#263449;
  --focus:#ffda82; --shadow:0 2px 5px #0003,0 9px 25px #0002;
  background:var(--canvas); color:var(--ink);
}
.sw-brand-mark.gb-snowflake { width:40px; height:44px; flex:0 0 40px; object-fit:contain; background:none; border-radius:0; }
.gb-brand { display:flex; gap:12px; align-items:center; width:max-content; max-width:100%; margin:0 0 1.7rem; text-decoration:none; color:inherit; }
.gb-brand img { object-fit:contain; flex:0 0 36px; }
.gb-brand span { font:650 1.05rem/1.3 system-ui,sans-serif; }
.gb-brand small { display:block; font:500 .78rem/1.5 system-ui,sans-serif; letter-spacing:.045em; }
.gb-theme-toolbar { display:flex; align-items:center; gap:.65rem; flex-wrap:wrap; margin-left:auto; }
.team-card > .gb-theme-toolbar { justify-content:flex-end; margin:-.3rem 0 1rem; }
button.gb-theme-toggle { display:inline-flex; align-items:center; justify-content:center; width:36px; height:36px; min-width:36px; min-height:36px; padding:0; margin:0; border:1px solid #8baebb; border-radius:8px; background:transparent; color:inherit; cursor:pointer; }
button.gb-theme-toggle svg { display:block; }
button.gb-theme-toggle:hover { background:#90c8d01f; }
button.gb-theme-toggle:focus-visible { outline:3px solid #10b0e0; outline-offset:3px; }
.growth-account-strip button.gb-theme-toggle { background:transparent; color:#fff; border-color:rgba(255,255,255,.4); }
#gb-theme-status { position:absolute !important; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
:root[data-theme="dark"] body { background:var(--canvas); color:var(--ink); color-scheme:dark; }
:root[data-theme="dark"] :is(h1,h2,h3,h4) { color:var(--ink); }
:root[data-theme="dark"] a { color:var(--teal-2); }
:root[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]),
:root[data-theme="dark"] :is(select,textarea),
:root[data-theme="dark"] #op-profile-form :is(input,select),
:root[data-theme="dark"] .op-launch :is(input,select) {
  background:#101d2d; color:var(--ink); border-color:var(--line); caret-color:var(--ink);
}
:root[data-theme="dark"] textarea#sw-ed-body,
:root[data-theme="dark"] textarea#sw-ed-subject,
:root[data-theme="dark"] textarea#ev-how,
:root[data-theme="dark"] textarea#ev-mine,
:root[data-theme="dark"] textarea#ev-preview,
:root[data-theme="dark"] textarea#ev-signoff,
:root[data-theme="dark"] textarea#ev-mine-signoff {
  color-scheme:light;
  forced-color-adjust:none;
  background-color:#101d2d !important;
  color:#f4f8fc !important;
  -webkit-text-fill-color:#f4f8fc !important;
  caret-color:#f4f8fc !important;
  opacity:1 !important;
}
:root[data-theme="dark"] select#ev-model,
:root[data-theme="dark"] select#ev-mine-model {
  color-scheme:dark;
  forced-color-adjust:none;
  background-color:#101d2d !important;
  color:#f4f8fc !important;
  -webkit-text-fill-color:#f4f8fc !important;
  opacity:1 !important;
}
:root[data-theme="dark"] ::placeholder { color:#93a8bd; opacity:1; }
:root[data-theme="dark"] input { accent-color:var(--teal); }
:root[data-theme="dark"] :is(.sw-btn,.sw-item,.op-user,.op-signature,.op-resource-url,.sj-msg) { background:var(--paper); color:var(--ink); border-color:var(--line); }
:root[data-theme="dark"] .sw-item[aria-current="true"],
:root[data-theme="dark"] #sj-thread-list .sj-thread-item[aria-current="true"] { background:var(--teal-soft); border-color:var(--teal); }
:root[data-theme="dark"] :is(.sw-btn,.op-user):hover:not(:disabled) { background:#233b4e; border-color:var(--teal); }
:root[data-theme="dark"] .sw-primary { background:#75ded8; color:#0e252c; border-color:#75ded8; }
:root[data-theme="dark"] .sw-primary:hover:not(:disabled) { background:#a0f1ed; color:#0e252c; }
:root[data-theme="dark"] .sw-danger { color:var(--bad); border-color:#95635e; }
:root[data-theme="dark"] .sw-ghost { color:var(--muted); background:transparent; }
:root[data-theme="dark"] :is(.op-sender,.sf-review-kind,.sf-review-count b) { color:var(--ink); }
:root[data-theme="dark"] .op-older { color:var(--warn); }
:root[data-theme="dark"] #op-action-status { background:var(--teal-soft); color:var(--ink); border-color:var(--teal); }
:root[data-theme="dark"] .op-profile-status { background:var(--ok-soft); color:var(--ok); border-color:var(--ok); }
:root[data-theme="dark"] .op-agent-controls { border-color:var(--line); }
:root[data-theme="dark"] #sj-thread-list .sj-thread-item,
:root[data-theme="dark"] .sj-lead-actions button,
:root[data-theme="dark"] .sj-starter button { background:var(--paper); color:var(--ink); border-color:var(--line); }
:root[data-theme="dark"] .sj-lead-actions button[data-decision="APPROVE"] { color:var(--ok); }
:root[data-theme="dark"] .sj-lead-actions button[data-decision="REJECT"] { color:var(--bad); }
:root[data-theme="dark"] .sj-msg[data-state="OPT_OUT"], :root[data-theme="dark"] .sj-badge[data-tone="warn"] { background:var(--bad-soft); color:var(--bad); border-color:#95635e; }
:root[data-theme="dark"] .sj-msg[data-state="HUMAN_REVIEW"], :root[data-theme="dark"] .sj-badge[data-tone="review"] { background:var(--warn-soft); color:var(--warn); border-color:#8f7843; }
:root[data-theme="dark"] .sj-badge { background:var(--idle-soft); color:var(--ink-2); }
:root[data-theme="dark"] .sj-badge[data-tone="ok"] { background:var(--ok-soft); color:var(--ok); }
:root[data-theme="dark"] .sj-meeting-samples { color:var(--muted); }
:root[data-theme="dark"] .growth-account-strip { background:#101e30; color:var(--ink); border-bottom:1px solid var(--line); }
:root[data-theme="dark"] .growth-account-strip a { color:#b2eff5; }
:root[data-theme="dark"] .growth-account-strip button { color:var(--ink); background:#254554; }
:root[data-theme="dark"] .growth-account-strip button.gb-theme-toggle { color:var(--ink); background:transparent; border-color:#6f8ba5; }
:root[data-theme="dark"] .growth-team-page { background:var(--canvas); color:var(--ink); color-scheme:dark; }
:root[data-theme="dark"] .growth-team-page .team-card { background:var(--paper); border-color:var(--line); box-shadow:var(--shadow); }
:root[data-theme="dark"] .growth-team-page :is(p,label) { color:var(--ink-2); }
:root[data-theme="dark"] .growth-team-page :is(.eyebrow,.team-message) { color:var(--teal-2); }
:root[data-theme="dark"] .growth-team-page .team-error { color:var(--bad); }
:root[data-theme="dark"] .growth-team-page :is(td,th) { border-color:var(--line); }
:root[data-theme="dark"] .growth-team-page button { color:#0e252c; background:#75ded8; }
:root[data-theme="dark"] .growth-team-page button:hover { background:#a0f1ed; }
:root[data-theme="dark"] .growth-team-page #team-one-time-link { background:#101d2d; color:var(--teal-2); }
:root[data-theme="dark"] .growth-team-page .gb-theme-toggle { color:var(--ink); background:transparent; border-color:#6f8ba5; }
:root[data-theme="dark"] #panel-pixel .sp-shell,
:root[data-theme="dark"] #panel-pixel .sp-shell.sp-expanded,
:root[data-theme="dark"] #panel-pixel .sp-shell:fullscreen,
:root[data-theme="dark"] #panel-pixel .sp-inspector { background:var(--paper); color:var(--ink); border-color:var(--line); color-scheme:dark; }
:root[data-theme="dark"] #panel-pixel :is(.sp-controls button,.sp-role) { background:#23384d; color:var(--ink); border-color:#587087; }
:root[data-theme="dark"] #panel-pixel :is(.sp-controls button,.sp-role):hover { background:#325066; }
:root[data-theme="dark"] #panel-pixel .sp-role[aria-pressed="true"] { background:var(--teal-soft); color:var(--teal-2); border-color:var(--teal); }
:root[data-theme="dark"] #panel-pixel .sp-heading .sp-controls span,
:root[data-theme="dark"] #panel-pixel .sp-inspector h3 { color:var(--ink); }
:root[data-theme="dark"] #panel-pixel .sp-stage { border-color:#486071; }
/* Existing Pixel artwork and sprites retain their original colors in both themes. */
@media (max-width:600px) {
  .growth-account-strip { gap:.5rem; }
  .growth-account-strip .gb-theme-toolbar { gap:.4rem; }
  .gb-brand { margin-bottom:1.2rem; }
}
@media (prefers-reduced-motion:reduce) {
  .gb-theme-toggle, .gb-snowflake { transition:none; animation:none; }
}
/* Keep the theme toggle readable while hovered on administrator/public cards. */
:root[data-theme="dark"] .growth-team-page button.gb-theme-toggle:hover,
:root[data-theme="dark"] .growth-team-page button.gb-theme-toggle:focus-visible { background:#233b4e; color:var(--ink); }
/* Lead groups and source panels are painted after the shared tokens. Without these
   rules their hardcoded light backgrounds stay white and flash on every refresh. */
:root[data-theme="dark"] .sw-lead-group details,
:root[data-theme="dark"] .op-sources,
:root[data-theme="dark"] .op-handoff-more {
  background:var(--paper); color:var(--ink); border-color:var(--line); color-scheme:dark;
  transition:none; animation:none;
}
:root[data-theme="dark"] .sw-lead-group summary,
:root[data-theme="dark"] .op-sources summary { color:var(--ink); background:transparent; }
:root[data-theme="dark"] .op-dossier-site,
:root[data-theme="dark"] a.sw-item-site { color:var(--muted); }
:root[data-theme="dark"] .sw-btn,
:root[data-theme="dark"] .sw-item,
:root[data-theme="dark"] .sj-thread-item,
:root[data-theme="dark"] .sj-lead-actions button,
:root[data-theme="dark"] .sj-starter button,
:root[data-theme="dark"] .sf-review-item,
:root[data-theme="dark"] .sf-opp-item { transition:none; animation:none; }
