/* Interruptor de tema claro/escuro, usado em todas as páginas.
   Pílula 2:1 com o botão deslizando; cores fixas (claro #F9F9F9 / escuro #111). */
.mode-switch{
  --ms-w:56px; --ms-h:28px;
  position:relative; flex:none; display:inline-block;
  width:var(--ms-w); height:var(--ms-h); padding:0; margin:0;
  border-radius:999px; border:1px solid #DDD; background:#F9F9F9;
  cursor:pointer; -webkit-tap-highlight-color:transparent;
  transition:background-color .25s ease, border-color .25s ease;
}
/* área de toque maior sem mudar o tamanho visual */
.mode-switch::before{content:""; position:absolute; inset:-8px -4px;}
.mode-switch:hover{border-color:#C9C9C9;}
.mode-switch:focus-visible{outline:2px solid var(--accent, #0F4C5C); outline-offset:3px;}
.mode-switch-knob{
  position:absolute; top:2px; left:2px;
  width:calc(var(--ms-h) - 6px); height:calc(var(--ms-h) - 6px);
  display:flex; align-items:center; justify-content:center;
  border-radius:50%; background:#F3F3F7; border:1px solid #DDD; color:#4A4A48;
  box-shadow:0 1px 2px rgba(17,17,17,.12);
  transition:transform .3s cubic-bezier(.16,1,.3,1), background-color .25s ease, border-color .25s ease, color .25s ease;
}
.mode-switch-knob svg{width:13px; height:13px; stroke:currentColor; fill:none; stroke-width:1.75; stroke-linecap:round; stroke-linejoin:round;}
.mode-switch .ms-moon{display:none;}

:root[data-theme="dark"] .mode-switch{background:#111; border-color:#444;}
:root[data-theme="dark"] .mode-switch:hover{border-color:#5A5A5A;}
:root[data-theme="dark"] .mode-switch-knob{transform:translateX(calc(var(--ms-w) - var(--ms-h))); background:#1C1C1C; border-color:#444; color:#EDEDEA; box-shadow:none;}
:root[data-theme="dark"] .mode-switch .ms-sun{display:none;}
:root[data-theme="dark"] .mode-switch .ms-moon{display:block;}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]) .mode-switch{background:#111; border-color:#444;}
  :root:not([data-theme="light"]) .mode-switch:hover{border-color:#5A5A5A;}
  :root:not([data-theme="light"]) .mode-switch-knob{transform:translateX(calc(var(--ms-w) - var(--ms-h))); background:#1C1C1C; border-color:#444; color:#EDEDEA; box-shadow:none;}
  :root:not([data-theme="light"]) .mode-switch .ms-sun{display:none;}
  :root:not([data-theme="light"]) .mode-switch .ms-moon{display:block;}
}
@media (prefers-reduced-motion: reduce){
  .mode-switch, .mode-switch-knob{transition:none;}
}
