/* Light/dark button and its circular reveal -- static/js/theme-toggle.js.
   The old pill switch (two knobs in ::before/::after) becomes a round
   button holding the sun/moon glyph canvas. */
.darkmode-toggle.nb-dm-switch, .darkmode-toggle.nb-m-dm-switch {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; padding: 0; border-radius: 50%; flex-shrink: 0; cursor: pointer;
  background: rgba(255, 255, 255, .16); border: 1.5px solid rgba(255, 255, 255, .26);
  box-shadow: none; overflow: visible; transition: background .3s, border-color .3s, box-shadow .2s;
  will-change: transform;
}
.darkmode-toggle.nb-dm-switch::before, .darkmode-toggle.nb-dm-switch::after,
.darkmode-toggle.nb-m-dm-switch::before, .darkmode-toggle.nb-m-dm-switch::after { content: none !important; display: none !important; }
.darkmode-toggle.nb-dm-switch:hover { box-shadow: 0 0 0 3px rgba(255, 255, 255, .14); }
.darkmode-toggle:focus-visible { outline: 2px solid var(--dm-secondary, #FFD166); outline-offset: 2px; }
html.dark-mode .darkmode-toggle.nb-dm-switch { background: rgba(44, 43, 68, .55); border-color: rgba(255, 255, 255, .14); box-shadow: none; }
/* the sidebar shows the button only while it is open (as before) */
.nb-sidebar:hover .darkmode-toggle.nb-dm-switch { width: 36px; }
/* the phone drawer sits on the page's own surface */
.darkmode-toggle.nb-m-dm-switch { width: 40px; height: 40px; background: var(--bg-soft); border-color: var(--border); }
html.dark-mode .darkmode-toggle.nb-m-dm-switch { background: color-mix(in srgb, var(--bg-soft) 70%, #2C2B44); border-color: rgba(255, 255, 255, .1); }
.darkmode-toggle canvas.tt-glyph { width: 24px; height: 24px; display: block; pointer-events: none; }

/* the glowing rim of the circle that brings the new theme in */
#tt-rim { position: fixed; display: none; z-index: 2147483000; pointer-events: none; border-radius: 50%; border: 3px solid; box-sizing: border-box; }
#tt-rim.to-dark { border-color: #A99BFF; box-shadow: 0 0 12px #6E5BFF, inset 0 0 12px #6E5BFF; }
#tt-rim.to-light { border-color: #FFD166; box-shadow: 0 0 12px #F5A524, inset 0 0 12px #F5A524; }

/* View Transitions: the script animates the new page's clip-path itself */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-old(root) { z-index: 1; }
::view-transition-new(root) { z-index: 2; }
@media (prefers-reduced-motion: reduce) { #tt-rim { display: none !important; } }
