.theme-switch {
    --theme-edge:#bbcbd2; --theme-muted:#506473; --theme-surface:#e3ecee; --theme-accent:#25677c;
    --theme-field:#f1f5f5; --theme-line:#cfdadf; --theme-shadow:0 3px 10px #223f4c14; --theme-amber:#795117; --theme-blue:#246b81;
    transition:background-color .28s ease, color .28s ease, border-color .28s ease;
}
:root[data-theme="dark"] .theme-switch,.theme-dark .theme-switch {
    --theme-edge:#4b626d; --theme-muted:#a8bbc6; --theme-surface:#2d3e48; --theme-accent:#8cc4d5;
    --theme-field:#2a3a44; --theme-line:#374952; --theme-shadow:0 4px 16px #10161e45; --theme-amber:#edcd8b; --theme-blue:#a0d3e3;
}
.theme-switch { display:grid; position:relative; grid-template-columns:1fr 1fr; align-items:center; justify-items:center; width:60px; height:33px; flex:none; border:1px solid var(--theme-edge); border-radius:999px; padding:0; color:var(--theme-muted); background:var(--theme-surface) }
.theme-switch:hover { border-color:var(--theme-accent) }
.theme-switch .glyph { z-index:1; width:16px; height:16px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; pointer-events:none }
.theme-thumb { position:absolute; top:3px; left:3px; width:25px; height:25px; background:var(--theme-field); border:1px solid var(--theme-line); border-radius:50%; box-shadow:var(--theme-shadow); transition:transform .27s cubic-bezier(.2,.8,.2,1), background .28s ease }
.theme-switch[aria-checked="false"] .theme-sun { color:var(--theme-amber) }
.theme-switch[aria-checked="true"] .theme-moon { color:var(--theme-blue) }
.theme-switch[aria-checked="true"] .theme-thumb { transform:translateX(27px) }

@media (prefers-reduced-motion: reduce) {
  .theme-switch,.theme-switch .theme-thumb { transition:none }
}
