/* Light mode (the default) and the toolbar toggle. Pages keep their dark styles; html[data-theme="light"] overrides them. */
.theme-toggle{display:inline-flex;align-items:center;justify-content:center;width:38px;height:38px;flex:none;border-radius:999px;border:1px solid #2e2e33;background:transparent;color:#e4e4e7;cursor:pointer;padding:0}
.theme-toggle:hover{border-color:#55555c;color:#fff}
.theme-toggle svg{width:18px;height:18px}
.theme-toggle .sun{display:block}.theme-toggle .moon{display:none}
html[data-theme="light"] .theme-toggle{border-color:#d4d4d8;color:#3f3f46}
html[data-theme="light"] .theme-toggle:hover{border-color:#a1a1aa;color:#0b0b0d}
html[data-theme="light"] .theme-toggle .sun{display:none}
html[data-theme="light"] .theme-toggle .moon{display:block}
.logo-light{display:none}
html[data-theme="light"] .logo-dark{display:none}
html[data-theme="light"] .logo-light{display:inline}
.top .wrap .right{display:flex;align-items:center;gap:18px}

html[data-theme="light"]{
  --bg:#fff;--fg:#0b0b0d;--muted:#52525b;--dim:#6b6b73;--line:#e5e5ea;--card:#f7f7f9;--card2:#f2f2f5;
  --blue-link:#0062E0;--tip:#0062E0;--grad:linear-gradient(90deg,#0b0b0d 0%,#1f5fb8 55%,#007AFF 100%);
  --s-ref:#9a9aa3;--grid:#e5e5ea;--axis:#c7c7cc;
  color-scheme:light
}
html[data-theme="light"] body{background:var(--bg);color:var(--fg)}
html[data-theme="light"] a:hover{color:#007AFF}
html[data-theme="light"] header.top{background:rgba(255,255,255,.85);border-bottom-color:#ececf0}
html[data-theme="light"] nav a{color:#3f3f46}
html[data-theme="light"] nav a:hover{color:#0b0b0d}
html[data-theme="light"] nav a.cta,html[data-theme="light"] nav a.cta:hover{color:#fff}
html[data-theme="light"] .btn.ghost{color:#0b0b0d;border-color:#d4d4d8}
html[data-theme="light"] .btn.ghost:hover{border-color:#a1a1aa;color:#0b0b0d}
html[data-theme="light"] .mark rect[fill="#FFFFFF"]{fill:#0B0B0D}
html[data-theme="light"] .card .tiles i{background:#0b0b0d}
html[data-theme="light"] .card .tiles i.b{background:#007AFF}
html[data-theme="light"] .card .tiles i.l{background:#3D9BFF}
html[data-theme="light"] .tag{border-color:#d4d4d8;color:#3f3f46}
html[data-theme="light"] .tag.on{border-color:rgba(0,122,255,.45);color:#0050b8;background:rgba(0,122,255,.08)}
html[data-theme="light"] .tag.dev{border-color:#c9d6ea;color:#2f4a6e}
html[data-theme="light"] .term pre{color:#1c1c1e}
html[data-theme="light"] .progress{border-color:#d4d4d8}
html[data-theme="light"] .progress strong{color:#0b0b0d}
html[data-theme="light"] .contact{background:radial-gradient(120% 140% at 85% 0%,rgba(0,122,255,.12),rgba(255,255,255,0) 55%),var(--card)}
html[data-theme="light"] .contact .card{background:rgba(255,255,255,.75)}
html[data-theme="light"] .hl li span:last-child,html[data-theme="light"] .stat2 .what{color:#3f3f46}
html[data-theme="light"] .skip{background:#0b0b0d;color:#fff}
/* code panels stay dark in both modes */
/* privacy and terms */
html[data-theme="light"] p,html[data-theme="light"] li{color:inherit}
html[data-theme="light"] .legal p,html[data-theme="light"] .legal li{color:#3f3f46}
/* findings page */
html[data-theme="light"] .findings p,html[data-theme="light"] .findings ul,html[data-theme="light"] .findings ol,html[data-theme="light"] .findings .meta b{color:#3f3f46}
html[data-theme="light"] .findings .abstract p,html[data-theme="light"] .findings code,html[data-theme="light"] .findings .race-row .t,html[data-theme="light"] .findings .tip{color:#1c1c1e}
html[data-theme="light"] .findings math,html[data-theme="light"] .findings .counter b,html[data-theme="light"] .findings .tiles .cap b,html[data-theme="light"] .findings .readout .exact{color:#0b0b0d}
html[data-theme="light"] .findings .draft{background:#fff8eb;border-color:#f0c060;color:#7a5200}
html[data-theme="light"] .findings button.ghost{color:#3f3f46}
html[data-theme="light"] .findings .seg{background:#ececf0}
html[data-theme="light"] .findings .seg button[aria-pressed=true]{background:#fff;color:#0b0b0d}
html[data-theme="light"] .findings .track{background:#ececf0}
html[data-theme="light"] .findings .tip{background:#fff;border-color:#e5e5ea;box-shadow:0 8px 24px rgba(0,0,0,.12)}
html[data-theme="light"] .findings header.top,html[data-theme="light"] .findings footer{border-color:#ececf0}
