/* Muted gray is the default palette. Explicit dark-mode choices remain usable. */
:root[data-theme=light] { color-scheme:light; --bg:#f2f3f3; --panel:#fafafa; --ink:#303438; --muted:#596168; --line:#d5d8da; --accent:#485b66; --mint:#426558; --soft:#e9ecee; --field:#fff; --control-line:#89949c; --on-accent:#fff; --focus:#405c6a; }
:root[data-theme=dark] { color-scheme:dark; --bg:#222629; --panel:#2b3034; --ink:#edf0f1; --muted:#b3bdc3; --line:#515a61; --accent:#c2cfd6; --mint:#a9c5b8; --soft:#353d43; --field:#252b2f; --control-line:#87939c; --on-accent:#222629; --focus:#d2e1e8; }
html[data-theme] { --calm-soft:var(--soft); --calm-selected:var(--soft); --calm-input:var(--field); --calm-on-accent:var(--on-accent); }
html[data-theme] body { background:var(--bg); color:var(--ink); }
html[data-theme] .portal-header,html[data-theme] .marketing-header { background:var(--panel); border-color:var(--line); }
html[data-theme] .card,html[data-theme] .dashboard-card,html[data-theme] .metric,html[data-theme] .world-summary,html[data-theme] .dashboard-card.people-summary,html[data-theme] .preview,html[data-theme] .feature,html[data-theme] .preview-card { background:var(--panel); border-color:var(--line); box-shadow:0 2px 8px #00000004; }
html[data-theme] .dashboard-card:hover { background:var(--soft); border-color:var(--control-line); box-shadow:none; }
html[data-theme] .primary,html[data-theme] .cta { background:var(--accent); color:var(--on-accent); border:1px solid var(--accent); box-shadow:none; }
html[data-theme] .primary:hover,html[data-theme] .cta:hover { filter:brightness(.94); }
html[data-theme] .secondary,html[data-theme] .world-tab,html[data-theme] .save-story,html[data-theme] .theme-switch,html[data-theme] .badge,html[data-theme] .dash-pills span,html[data-theme] .tag,html[data-theme] .tag.life { background:var(--soft); color:var(--ink); border-color:var(--control-line); }
html[data-theme] .secondary:hover,html[data-theme] .world-tab:hover,html[data-theme] .save-story:hover { background:var(--panel); border-color:var(--accent); }
html[data-theme] .theme-switch button { color:var(--muted); }
html[data-theme] .theme-switch button[aria-pressed=true],html[data-theme] .world-tab[aria-pressed=true],html[data-theme] .save-story[aria-pressed=true] { background:var(--panel); color:var(--accent); border-color:var(--accent); box-shadow:none; }
html[data-theme] .theme-switch button:hover { background:var(--panel); color:var(--ink); }
html[data-theme] input:not([type=checkbox]):not([type=radio]),html[data-theme] textarea,html[data-theme] select { background:var(--field); color:var(--ink); border-color:var(--control-line); }
html[data-theme] input::placeholder,html[data-theme] textarea::placeholder { color:var(--muted); opacity:1; }
html[data-theme] input[type=checkbox],html[data-theme] progress { accent-color:var(--accent); }
html[data-theme] .task input:checked { background:var(--accent); border-color:var(--accent); }
html[data-theme] .task input:checked::after { color:var(--on-accent); }
html[data-theme] .life-intro,html[data-theme] .morning-brief,html[data-theme] .ringnote,html[data-theme] .day,html[data-theme] .preference,html[data-theme] .division,html[data-theme] .school-grid span,html[data-theme] .rate-flow>div,html[data-theme] .story,html[data-theme] .snapshot-game { background:var(--soft); border-color:var(--line); color:var(--ink); }
html[data-theme] .day.today { background:var(--panel); outline-color:var(--accent); }
html[data-theme] .day strong,html[data-theme] .economy-value,html[data-theme] .game-meta strong,html[data-theme] .memory-year,html[data-theme] .division h3 { color:var(--ink); }
html[data-theme] .dash-icon,html[data-theme] .people-summary .dash-icon,html[data-theme] .team-monogram,html[data-theme] .team-monogram.huskies,html[data-theme] .team-monogram.mariners,html[data-theme] .portal-header .spark,html[data-theme] .logo span { background:var(--soft); border-color:var(--line); color:var(--accent); }
html[data-theme] .dash-progress { background:var(--soft); }
html[data-theme] .dash-progress span { background:var(--accent); }
html[data-theme] .chart polyline { stroke:var(--accent); }
html[data-theme] .dash-card-top h2,html[data-theme] .dash-focus,html[data-theme] .portal-header .brand,html[data-theme] .trivia-question { color:var(--ink); }
html[data-theme] .muted,html[data-theme] .notice,html[data-theme] .sync-note,html[data-theme] .save-strip,html[data-theme] .topline,html[data-theme] .dash-source,html[data-theme] .dash-label,html[data-theme] .dash-detail,html[data-theme] .dashboard-footer,html[data-theme] .cardfooter,html[data-theme] .life-form label,html[data-theme] .nutrition-note label,html[data-theme] .event small,html[data-theme] .event .time,html[data-theme] .taskcopy small,html[data-theme] .preference small,html[data-theme] .story p,html[data-theme] .feed-status { color:var(--muted); }
html[data-theme] .textbtn,html[data-theme] .source-link,html[data-theme] .dash-foot,html[data-theme] .portal-header .nav button.active,html[data-theme] .portal-header .nav button:hover,html[data-theme] .edition-entry>summary,html[data-theme] .economy-metric summary { color:var(--accent); }
html[data-theme] .portal-header .nav button { color:var(--muted); }
html[data-theme] .portal-header .nav button.active { border-color:var(--accent); }
html[data-theme] .header-actions>.badge::before { background:var(--mint); box-shadow:none; }
html[data-theme] dialog { background:var(--panel); color:var(--ink); border-color:var(--control-line); }
html[data-theme] dialog p { color:var(--muted); }
html[data-theme] dialog::backdrop { background:#30343870; }
html[data-theme] .toast { background:var(--accent); color:var(--on-accent); border-color:var(--accent); }
html[data-theme] .sample,html[data-theme] .event-past { background:var(--soft); border-color:var(--line); color:var(--muted); }
html[data-theme=light] .trivia-choice.correct { background:#e4ece7; color:#345845; border-color:#718b7c; }
html[data-theme=light] .trivia-choice.incorrect { background:#f1e8e8; color:#833c42; border-color:#a47c80; }
html[data-theme] .trivia-choice { background:var(--soft); color:var(--ink); border-color:var(--control-line); }
html[data-theme] :is(button,a,input,textarea,select,summary):focus-visible { outline:3px solid var(--focus); outline-offset:3px; }
html[data-theme] .settings-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:20px; }
html[data-theme] .settings-option { display:flex; gap:12px; align-items:center; min-height:44px; margin:12px 0; }
html[data-theme] .settings-option input { flex:none; }
