
/* Toggle de tema com sol e lua (pílula 56x28). Estado vem do aria-checked (true = tema ESCURO): o círculo branco fica sobre a lua (escuro) ou sobre o sol (claro). Prefixo tg-; bordas e foco por tokens --nx-*;
   as cores próprias do trilho e dos ícones são tokens --tg-* (o claro vem do desenho: trilho azul-claro, sol âmbar). Só anima com movimento ligado (html[data-motion="on"], ncMotionOn()); sem isso a troca é instantânea. */
html body .theme-switch { --tg-track: #22262C; --tg-bd: var(--nx-card-bd, rgba(255,255,255,.14)); --tg-sun: rgba(255,255,255,.42); --tg-moon: #2A3140; --tg-knob: #FFFFFF;
  position: relative; display: block; width: 56px; height: 28px; box-sizing: border-box; padding: 0; flex-shrink: 0; border-radius: 999px; border: 1px solid var(--tg-bd); background: var(--tg-track); cursor: pointer; }
html body .theme-switch[aria-checked="false"] { --tg-track: #DCEBFA; --tg-bd: rgba(14,116,144,.22); --tg-sun: #F59E0B; --tg-moon: #6F86A3; }
html body .theme-switch::before { content: ""; position: absolute; inset: -9px -2px; }   /* área de toque de 44 px no celular, sem mudar o desenho */
html body .theme-switch .theme-switch-knob { position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: var(--tg-knob); box-shadow: 0 1px 3px rgba(0,0,0,.30); transform: translateX(28px); }
html body .theme-switch[aria-checked="false"] .theme-switch-knob { transform: translateX(0); }
html body .theme-switch .tg-i { position: absolute; top: 50%; width: 14px; height: 14px; margin-top: -7px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
html body .theme-switch .tg-sun { left: 6px; color: var(--tg-sun); opacity: .75; } html body .theme-switch .tg-moon { right: 6px; color: var(--tg-moon); opacity: 1; }
html body .theme-switch[aria-checked="false"] .tg-sun { opacity: 1; } html body .theme-switch[aria-checked="false"] .tg-moon { opacity: .8; }
html[data-motion="on"] body .theme-switch { transition: background-color .2s ease, border-color .2s ease; }
html[data-motion="on"] body .theme-switch .theme-switch-knob { transition: transform .2s ease; }
html[data-motion="on"] body .theme-switch .tg-i { transition: opacity .2s ease, color .2s ease; }
@media (prefers-reduced-motion: reduce) { html body .theme-switch, html body .theme-switch .theme-switch-knob, html body .theme-switch .tg-i { transition: none !important; } }
