#theme-switch {
  position:relative;display:flex;align-items:center;justify-content:space-between;flex:none;
  width:51px;height:29px;padding:3px 5px;border-radius:24px;border:1px solid #dbd7c9;
  background:#ebe7dc;color:#7e725b;
}
#theme-switch::before {
  content:"";position:absolute;left:3px;top:3px;width:21px;height:21px;border-radius:50%;
  background:#fff;box-shadow:0 1px 3px #18181335;transition:transform .18s ease;
}
#theme-switch svg { position:relative;width:17px;height:17px; }
#theme-switch .sun {color:#976322;}
#theme-switch[aria-checked=true] {background:#376253;border-color:#4d8875;color:#ddf0e7;}
#theme-switch[aria-checked=true]::before {transform:translateX(22px);}
#theme-switch[aria-checked=true] .moon {color:#2b5149;}
#theme-switch[aria-checked=true] .sun {color:#c9ded4;}
.card,.collection {--rim:#75ad93;}
.tone-0,.c0 {--rim:#d4ad5c;}
.tone-1,.c1 {--rim:#76b698;}
.tone-2,.c2 {--rim:#9a9edd;}
.tone-3,.c3 {--rim:#d9999d;}
.tone-4,.c4 {--rim:#72b8bd;}
.c5,.tone-5 {--rim:#8fa8db;}
.c6,.tone-6 {--rim:#dca171;}
.c7,.tone-7 {--rim:#91b278;}
@media(hover:hover) and (pointer:fine) and (prefers-reduced-motion:no-preference){
  .card,.collection {transition:transform .16s ease-out,box-shadow .16s,border-color .16s;}
  :is(.card,.collection)[data-raised] {
    position:relative;z-index:1;transform:perspective(900px) translateY(-3px) rotateX(var(--rx,0deg)) rotateY(var(--ry,0deg));
    border-color:var(--rim);
    box-shadow:0 0 0 1px color-mix(in srgb,var(--rim) 78%,transparent),
      0 2px 6px color-mix(in srgb,var(--rim) 26%,transparent),0 8px 18px #29303715;
  }
}
@media(prefers-reduced-motion:reduce){#theme-switch::before {transition:none;}}
:root[data-theme=dark] {
  color-scheme:dark;--paper:#1c1e23;--surface:#262a32;--ink:#edf0ef;--secondary:#b1b7c2;
  --line:#424751;--hairline:#353a43;--accent-ink:#f1cb83;--wash:#413b2c;
  --lift:0 4px 18px #08090d40;--gold:#ebc37a;
}
[data-theme=dark] :is(.rail,#fold,.transcript) {background:#23262d;border-color:#383c45;}
[data-theme=dark] .rail {box-shadow:1px 0 0 #ffffff0b,6px 0 20px #05060838;}
[data-theme=dark] .rail-nav {border-color:#3b4049;}
[data-theme=dark] :is(.rail-nav a,#fold) {color:#b7becb;}
[data-theme=dark] :is(.rail-nav a:hover,#fold:hover) {background:#323842;color:#fff;}
[data-theme=dark] .rail-nav a.on {background:#443a28;color:#f0c777;}
[data-theme=dark] .logo [data-muc-watch] {background-color:#cfc8af;border-radius:15px;}
[data-theme=dark] :is(.add,.tabs a[aria-current],.import) {background:var(--surface);border-color:var(--line);color:var(--ink);}
[data-theme=dark] .tabs {background:#171a20;}
[data-theme=dark] .tabs a:not([aria-current]) {color:var(--secondary);}
[data-theme=dark] .compose {background:#373124;border-color:#5e5037;}
[data-theme=dark] .compose::after {opacity:.65;}
[data-theme=dark] .compose-mascot::before {background:#c5b48f;border-color:#a98c56;}
[data-theme=dark] .source-tab {color:#e6cba5;}
[data-theme=dark] .source-tab .icon {color:#fb9e85;}
[data-theme=dark] .link-input .icon {color:#c5b7a2;}
[data-theme=dark] input::placeholder {color:#aeb5bf;opacity:1;}
[data-theme=dark] :is(.import .primary,.primary,#toggle,.chips .selected) {background:#eac47c;border-color:#eac47c;color:#25231f;}
[data-theme=dark] .status:not(:empty),[data-theme=dark] .flag {color:#efbf92;}
[data-theme=dark] .collection {background:var(--night-tile);border-color:#ffffff15;}
[data-theme=dark] .collection img {filter:drop-shadow(0 0 1px #aba89a);}
[data-theme=dark] .thumb {background:#353b44;}
[data-theme=dark] .save {color:#bdc4cd;}
[data-theme=dark] .save[aria-pressed=true] {color:#edc181;}
[data-theme=dark] .controls [aria-pressed=true] {color:#f1ca88;border-color:#766444;}
[data-theme=dark] .word.hot {background:#e2b76e;box-shadow:0 0 0 2px #e2b76e;color:#1e2426;}
[data-theme=dark] :is(.transcript-head,.cue-filter,.dict-head,.dict-credit) {border-color:var(--line);}
[data-theme=dark] :is(.transcript-head h2,.cue-copy) {color:#f0f1f3;}
[data-theme=dark] .cue .vi {color:#b9c3cf;}
[data-theme=dark] .cue.active {background:linear-gradient(106deg,#353e30,#283e39 58%,#273f40);}
[data-theme=dark] .cue-seek {background:#5e6979;color:#fff;}
[data-theme=dark] .cue.active .cue-seek {background:#cedfd8;color:#223a34;}
[data-theme=dark] .panel-tool {background:#353a44;color:#ced4dc;}
[data-theme=dark] .script-lang[aria-pressed=true] {background:#324b43;color:#b6e4d1;}
[data-theme=dark] .dictionary::backdrop {background:#080a0db3;}
[data-theme=dark] .loader>span {background:#a69b81;}
[data-theme=dark] #toast:not(:empty) {background:#e7e9e8;color:#1d2226;}
@media(max-width:700px){
  .head-acts {gap:7px;}
  [data-theme=dark] .rail {box-shadow:none;background:transparent;}
}
