/* Colori di tutte le pagine, chiari e scuri. Il tema arriva da /assets/theme.js (data-theme su <html>).
   Scuro come veda-analytics: fondo blu notte, testo crema, oro più chiaro. */
:root {
  color-scheme: light;
  --ink: #0B1F3A; --ink-muted: #3B4A63; --ink-soft: #68748A;
  --gold: #C9892B; --gold-soft: #F4C15A;
  --paper: #F7F6F2; --surface: #FFFFFF; --field: #FFFFFF; --border: #E3E1DB; --border-hover: #CFCCC3;
  --soft: #F3F4F7; --th-bg: #FBFAF7; --track: #EEEDE8; --bar: #0B1F3A; --highlight: #FFF8E6;
  --band: #0B1F3A; --band-line: transparent;
  --primary: #0B1F3A; --on-primary: #FFFFFF; --primary-hover: #13305A;
  --danger: #9B2C2C; --danger-bg: #FBF1F1; --danger-border: #E7C4C4;
  --ok: #1E6B3E; --ok-bg: #E7F3EC; --neutral-bg: #F1EFEA;
  --shadow: rgba(11,31,58,.08); --overlay: rgba(11,31,58,.96);
  --focus: rgba(201,137,43,.25);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #F5F0E7; --ink-muted: #D5DBE4; --ink-soft: #98A5B6;
  --gold: #E0AA4F; --gold-soft: #F0C46E;
  --paper: #081525; --surface: #0F2034; --field: #0C1B2D; --border: rgba(245,240,231,.12); --border-hover: rgba(245,240,231,.28);
  --soft: rgba(245,240,231,.08); --th-bg: #0C1B2D; --track: rgba(245,240,231,.08); --bar: #82A9CC; --highlight: rgba(224,170,79,.10);
  --band: #0C1B2D; --band-line: rgba(245,240,231,.08);
  --primary: #F5F0E7; --on-primary: #081525; --primary-hover: #E4DDD0;
  --danger: #FF8C92; --danger-bg: rgba(255,140,146,.12); --danger-border: rgba(255,140,146,.35);
  --ok: #7ECB9D; --ok-bg: rgba(126,203,157,.14); --neutral-bg: rgba(245,240,231,.08);
  --shadow: rgba(0,0,0,.35); --overlay: rgba(8,21,37,.96);
  --focus: rgba(224,170,79,.3);
}

/* Interruttore del tema, come in veda-analytics. on-band: sulla fascia blu di intestazioni e hero. */
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 32px; padding: 0; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); cursor: pointer; flex: none; }
.theme-toggle:hover { border-color: var(--border-hover); }
.theme-toggle.on-band { background: transparent; border-color: rgba(255,255,255,.35); }
.theme-toggle.on-band:hover { border-color: #fff; background: transparent; }
.theme-track { position: relative; width: 28px; height: 16px; border-radius: 999px; background: var(--track); }
.theme-toggle.on-band .theme-track { background: rgba(255,255,255,.18); }
.theme-dot { position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--gold); box-shadow: inset -3px -2px 0 rgba(255,255,255,.55); transition: transform .25s ease, box-shadow .25s ease; }
.theme-toggle[aria-pressed="true"] .theme-dot { transform: translateX(12px); box-shadow: inset 4px -1px 0 var(--band); }
.theme-corner { position: fixed; top: 16px; right: 16px; }
@media (prefers-reduced-motion: reduce) { .theme-dot { transition: none; } }
