.themes { position: relative; display: flex; height: 44px; flex: none; align-items: center; margin: 0 0 0 auto; padding: 4px; border: 0; border-radius: 99px; background: var(--tile); view-transition-name: theme-switch; }
.themes label { position: relative; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; color: var(--muted); transition: color .3s, scale .3s; }
.themes label:hover { color: var(--ink); }
.themes label:active { scale: .9; }
.themes label:has(:focus-visible) { outline: 2px solid var(--accent); }
.themes [data-icon] { width: 19px; height: 19px; transition: rotate .5s var(--spring), scale .5s var(--spring); }
:root[data-mode="light"] [data-opt="light"], :root[data-mode="system"] [data-opt="system"], :root[data-mode="dark"] [data-opt="dark"] { color: var(--accent); }
:root[data-mode="light"] [data-opt="light"] [data-icon] { rotate: 90deg; scale: 1.1; }
.thumb { position: absolute; top: 4px; left: 4px; width: 36px; height: 36px; translate: 100% 0; transition: translate .55s var(--spring); }
.thumb span { display: block; width: 100%; height: 100%; border-radius: 50%; background: var(--raised); box-shadow: 0 1px 3px rgb(0 0 0 / .12); }
:root[data-mode="light"] .thumb { translate: 0 0; }
:root[data-mode="dark"] .thumb { translate: 200% 0; }
.thumb .stretch { animation: stretch .45s ease-in-out; }
@keyframes stretch { 40% { scale: 1.22 .86; } }
.theme-switching *:where(:not(.themes, .themes *)) { transition: none !important; }
::view-transition { pointer-events: none; }
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { animation: reveal .65s cubic-bezier(.65, 0, .35, 1) both; }
::view-transition-group(theme-switch), ::view-transition-new(theme-switch) { animation: none; }
::view-transition-old(theme-switch) { display: none; }
@keyframes reveal { from { clip-path: circle(0 at var(--reveal-x) var(--reveal-y)); } to { clip-path: circle(var(--reveal-r) at var(--reveal-x) var(--reveal-y)); } }
@media (max-width: 767px) { .themes { height: 40px; } .themes label, .thumb { width: 32px; height: 32px; } }
@media (max-width: 639px) { .themes { padding: 3px; height: 38px; } .themes label, .thumb { width: 28px; height: 32px; } .thumb { top: 3px; left: 3px; } .themes [data-icon] { width: 16px; height: 16px; } }
