/* Shared theme tokens. System preference is resolved before the first paint. */
:root { --surface:#fff; --soft:hsl(340 46.7% 97.1%); --ink:#202222; --muted:#72777e; --line:hsl(340 33.3% 91.8%); --brand-accent:hsl(340 78.0% 44.0%); }
:root[data-theme="dark"] { --surface:#19191f; --soft:#202027; --ink:#ededf1; --muted:#aaaab6; --line:#303039; --brand-accent:hsl(340 85.0% 72.0%); }
body,body.landing-active { background:var(--surface); color:var(--ink); }
body > header,body.landing-active > header { background:var(--surface); border-color:var(--line); }
.brand-link { flex-shrink:0; }
.brand-logo { width:150px; height:auto; }
[data-theme="light"] .brand-logo { filter:brightness(0); }
#landingView { --ink:var(--page-ink,#202222); background:var(--surface); }
#landingView .lp-footer-brand { display:inline-block; }
#landingView .lp-footer-brand img { width:161px; height:auto; }
[data-theme="dark"] #landingView { --page-ink:hsl(340 56.5% 95.5%); --muted:hsl(340 21.9% 71.4%); --brand-accent:hsl(340 85.0% 72.0%); }
[data-theme="dark"] .landing-active #landingNavLinks { color:var(--ink); }
[data-theme="dark"] #landingView .lp-preview,
[data-theme="dark"] #landingView .lp-quote-art,
[data-theme="dark"] #landingView .lp-icon,
[data-theme="dark"] #landingView .lp-tracks span { background:var(--soft); }
[data-theme="dark"] #landingView .lp-study-card { background:var(--surface); }
[data-theme="dark"] #landingView :is(.lp-tracks,.lp-feature,.lp-steps,.lp-cta,.lp-chapter) { border-color:var(--line); }
[data-theme="dark"] #landingView .lp-tracks button { color:var(--muted); }
[data-theme="dark"] #landingView .lp-tracks button:hover { background:var(--soft); color:var(--brand-accent); }
[data-theme="dark"] #landingView :is(.lp-button,.lp-challenge-card,.featured,.lp-arrow,.lp-circle,.lp-footer) { background:hsl(340 78.0% 44.0%); }
[data-theme="dark"] #landingView .featured .lp-arrow { background:#fff; color:hsl(340 78.0% 44.0%); }
[data-theme="dark"] #landingView .lp-answer { background:hsl(340 100.0% 95.9%); }
[data-theme="dark"] #landingView .muted { color:hsl(340 20.2% 67.1%); }
[data-theme="dark"] .claim-panel { background:var(--surface); border-color:var(--line); color:var(--ink); }
[data-theme="dark"] :is(.claim-description,.claim-credit p,.claim-close) { color:var(--muted); }
[data-theme="dark"] :is(.claim-credit,.claim-icon,.claim-close:hover) { background:var(--soft); }
[data-theme="dark"] :is(.claim-icon,.claim-check,.claim-eyebrow) { color:var(--brand-accent); }
[data-theme="dark"] #visitorNameInput { background:var(--soft); color:var(--ink); border-color:var(--line); }
[data-theme="dark"] .claim-error { color:#fca5a5; }
/* Existing workspace utility classes also follow the chosen theme. */
[data-theme="light"] :is(#dashboardView,#dashboardUserBar,#toast) [class*="text-slate-"],
[data-theme="light"] :is(#dashboardView,#dashboardUserBar,#toast) .text-white { color:hsl(340 30.4% 22.0%); }
[data-theme="light"] :is(#dashboardView,#dashboardUserBar,#toast) [class*="bg-slate-"],
[data-theme="light"] :is(#dashboardView,#dashboardUserBar,#toast) [class*="bg-[#07090E]"] { background:hsl(340 50.0% 96.9%); }
[data-theme="light"] :is(#dashboardView,#dashboardUserBar,#toast) [class*="border-slate-"] { border-color:hsl(340 32.1% 89.6%); }
[data-theme="light"] #dashboardView [class*="bg-gradient-to-"] { background:hsl(340 50.0% 96.9%); }
[data-theme="light"] :is(#dashboardView,#dashboardUserBar) [class*="text-certa-"],
[data-theme="light"] :is(#dashboardView,#dashboardUserBar) [class*="text-rose-"] { color:#b8194c; }
[data-theme="light"] #dashboardView [class*="text-emerald-"] { color:#087353; }
[data-theme="light"] #dashboardView [class*="text-amber-"] { color:#8c5808; }
[data-theme="light"] #dashboardView [class*="text-red-"] { color:#b32626; }
[data-theme="light"] #dashboardView [class*="text-sky-"] { color:hsl(340 95.8% 27.8%); }
[data-theme="light"] #dashboardView .certa-gradient,
[data-theme="light"] #dashboardView .certa-gradient * { color:white; }
[data-theme="light"] #dashboardView .sentence-selected { color:#9a1743; }
[data-theme="light"] #toast { background:white; color:hsl(340 30.4% 22.0%); }
[data-theme="light"] ::-webkit-scrollbar-track { background:hsl(340 46.7% 97.1%); }
[data-theme="light"] ::-webkit-scrollbar-thumb { background:hsl(340 26.1% 78.2%); }
@media(max-width:1000px) { .landing-active #landingNavLinks { display:none; } }
@media(max-width:480px) { .brand-logo { width:112px; } body.landing-active > header > div { padding:18px 16px; gap:8px; } .landing-active #navStartBtn { padding:10px 12px; font-size:11px; }  body:not(.landing-active) > header > div { flex-wrap:wrap; } }
html[data-theme] body > header { background:var(--surface); border-color:var(--line); }
[data-theme="light"] #dashboardUserBar > div { background:hsl(340 50.0% 96.9%); border-color:hsl(340 32.1% 89.6%); }

.theme-toggle { position:relative; display:flex; align-items:center; justify-content:space-between; flex-shrink:0; margin-left:auto; width:62px; height:34px; padding:7px; border:1px solid var(--line); border-radius:20px; background:var(--soft); color:var(--muted); cursor:pointer; }
.theme-toggle svg { width:17px; height:17px; z-index:1; }
.theme-thumb { position:absolute; top:3px; left:3px; width:26px; height:26px; border-radius:50%; background:var(--surface); box-shadow:0 1px 4px #0002; transition:transform .18s ease; }
[data-theme="dark"] .theme-thumb { transform:translateX(28px); background:hsl(340 32.5% 29.6%); }
[data-theme="light"] .theme-sun { color:hsl(340 78.0% 44.0%); }
[data-theme="dark"] .theme-moon { color:hsl(340 100.0% 88.6%); }
.theme-toggle:focus-visible { outline:3px solid hsl(340 100.0% 76.1%); outline-offset:3px; }
@media(prefers-reduced-motion:reduce) { .theme-thumb { transition:none; } }
