:root {
  --theme-track: #e8eefb;
  --theme-thumb: #fff;
  --theme-icon: #52617a;
  --theme-active: #294d84;
  --theme-shadow: #1c376428;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111827;
  --paper: #1b2537;
  --ink: #edf2fb;
  --muted: #aab8cf;
  --blue: #a8c9ff;
  --focus: #a8c9ff;
  --theme-track: #293951;
  --theme-thumb: #405779;
  --theme-icon: #abc0df;
  --theme-active: #f0f5ff;
  --theme-shadow: #060c1a55;
}
.top-actions { display: flex; align-items: center; gap: 8px; }
.theme-toggle {
  position: relative; display: grid; place-items: center; flex: none;
  width: 64px; height: 44px; margin: 0; padding: 0; border: 0;
  border-radius: 999px; background: transparent; cursor: pointer;
}
.theme-toggle[hidden] { display: none; }
.theme-toggle:focus-visible { outline: 2.5px solid var(--focus); outline-offset: 3px; }
.theme-track {
  position: relative; display: grid; grid-template-columns: repeat(2, 1fr);
  place-items: center; width: 100%; height: 34px; padding: 3px 4px;
  border-radius: 999px; background: var(--theme-track);
  transition: background-color 240ms var(--ease);
}
.theme-track::before {
  content: ""; position: absolute; inset: 4px auto 4px 5px;
  width: 26px; border-radius: 50%; background: var(--theme-thumb);
  box-shadow: 0 2px 6px var(--theme-shadow);
  transition: transform 320ms var(--ease), background-color 240ms var(--ease);
}
.theme-track svg {
  position: relative; width: 16px; height: 16px; color: var(--theme-icon);
  transition: transform 320ms var(--ease), color 240ms var(--ease);
}
.theme-sun, .theme-toggle[aria-pressed="true"] .theme-moon { color: var(--theme-active) !important; }
.theme-moon { transform: scale(.79) rotate(-17deg); }
.theme-toggle[aria-pressed="true"] .theme-track::before { transform: translateX(28px); }
.theme-toggle[aria-pressed="true"] .theme-sun { color: var(--theme-icon) !important; transform: scale(.79) rotate(38deg); }
.theme-toggle[aria-pressed="true"] .theme-moon { transform: scale(1) rotate(0); }
@media (hover: hover) {
  .theme-toggle:hover .theme-track { box-shadow: 0 0 0 2px var(--theme-shadow); }
}
.theme-toggle:active .theme-track { scale: .97; }
:root.theme-ready body, :root.theme-ready :is(.hero,.server,.server-icon,.eyebrow,.signal,.state,.brand-mark,.jump,.tile-icon,footer) {
  transition: background-color 240ms var(--ease), color 240ms var(--ease), border-color 240ms var(--ease);
}
:root[data-theme="dark"] :is(.brand-mark,.jump:hover) { background: #243552; }
:root[data-theme="dark"] .hero { background: #1c2b43; }
:root[data-theme="dark"] .eyebrow { background: #2b4369; color: #c3d9ff; }
:root[data-theme="dark"] .server { background: var(--paper); }
:root[data-theme="dark"] .server-icon { background: #293c5b; color: #a7c7f7; }
:root[data-theme="dark"] .signal { background: #303e54; color: #d3ddf0; }
:root[data-theme="dark"] .signal[data-state="online"] { background: #24473d; color: #b7e9ca; }
:root[data-theme="dark"] .signal[data-state="warning"] { background: #4a3825; color: #ffdfa3; }
:root[data-theme="dark"] .state { color: #aab8cf; }
:root[data-theme="dark"] .state[data-state="online"] { color: #a9e3be; }
:root[data-theme="dark"] .state[data-state="warning"] { color: #f7d38e; }
:root[data-theme="dark"] .state[data-state="offline"] { color: #ffc0c5; }
:root[data-theme="dark"] .services li { --tile: #4a3825; --tone: #f6d28d; }
:root[data-theme="dark"] .services [data-service="whatsapp"] { --tile: #24473d; --tone: #a9e3be; }
:root[data-theme="dark"] .services [data-service="duodot"] { --tile: #2c4369; --tone: #b6d2ff; }
:root[data-theme="dark"] .services [data-service="converter"] { --tile: #483042; --tone: #ffc1cf; }
:root[data-theme="dark"] .art { filter: brightness(.90) saturate(.80); }
:root[data-theme="dark"] footer { border-color: #29374e; }
@media (hover: hover) {
  :root[data-theme="dark"] .card:hover { background: #233149; box-shadow: 0 14px 28px #080f2070; }
}
@media (max-width: 420px) {
  .top-actions { gap: 3px; }
  .jump { padding-inline: 5px; font-size: .79rem; white-space: nowrap; }
  .jump > span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .theme-toggle:active .theme-track { scale: 1; }
}
