/* Shared surface tokens keep lessons, practice, accounts and admin in sync. */
:root {
  --on-primary: #fff;
  --on-lime: #18233d;
  --contrast-bg: #18233d;
  --contrast-hover: #2b3957;
  --auth-bg: #3657ff;
  --surface-hover: #f5f7ff;
  --surface-muted: #eceee8;
  --surface-disabled: #f1f2f5;
  --line-strong: #b8c0ce;
  --line-blue: #bfcef2;
  --line-green: #8dbda2;
  --line-red: #db9ba1;
  --line-orange: #c9ac78;
  --progress-track: #e8ebf2;
  --sky-hover: #cadcff;
  --materials-bg: #eeefe8;
  --materials-line: #dfe2d5;
  --tempo-wrong: #fffcf6;
  --tempo-wrong-line: #dccbad;
  --tempo-correct: #f4faf6;
  --tempo-correct-line: #b9d4c4;
  --ring-track: #b5c8eb;
  --toast-error: #b0343e;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --primary: #91a4ff;
  --primary-hover: #b0bdff;
  --on-primary: #142044;
  --ink: #edf1fa;
  --muted: #a9b4c8;
  --bg: #101522;
  --paper: #192233;
  --line: #344156;
  --sky: #243755;
  --lilac: #302946;
  --green: #8bdfb4;
  --mint: #203b31;
  --orange: #f4c27e;
  --peach: #3a3020;
  --red: #ffadb5;
  --error: #40272f;
  --shadow: 0 8px 28px #0003;
  --contrast-bg: #293851;
  --contrast-hover: #354663;
  --auth-bg: #283fae;
  --surface-hover: #253149;
  --surface-muted: #1d2739;
  --surface-disabled: #202a3b;
  --line-strong: #586880;
  --line-blue: #455e85;
  --line-green: #4f856a;
  --line-red: #a66472;
  --line-orange: #977246;
  --progress-track: #344156;
  --sky-hover: #2e456a;
  --materials-bg: #242e2c;
  --materials-line: #414d45;
  --tempo-wrong: #302a22;
  --tempo-wrong-line: #67543b;
  --tempo-correct: #20302b;
  --tempo-correct-line: #416852;
  --ring-track: #526f9c;
  --toast-error: #912c3d;
}
.header-tools { display: flex; align-items: center; justify-content: flex-end; gap: 14px; margin-left: auto; flex: 0 0 auto; }
.header-tools .header-note { max-width: 140px; }
.theme-toggle { position: relative; display: grid; place-items: center; flex: 0 0 36px; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; color: var(--muted); background: transparent; }
.theme-toggle::before { content: ""; position: absolute; inset: -4px; border-radius: 50%; }
.theme-toggle:hover:not(:disabled) { color: var(--ink); background: var(--surface-muted); }
.theme-toggle:disabled { opacity: .65; }
.theme-sun { display: none; }
:root[data-theme="dark"] .theme-sun { display: block; }
:root[data-theme="dark"] .theme-moon { display: none; }
.brand-dark { display: none !important; }
:root[data-theme="dark"] .brand-light { display: none !important; }
:root[data-theme="dark"] .brand-dark { display: block !important; }

@media (max-width: 1000px) {
  .header { flex-wrap: wrap; }
  .header nav { order: 3; width: 100%; justify-content: center; }
}
@media (max-width: 760px) {
  .header-tools .header-note { display: none; }
}
@media (max-width: 600px) {
  .header { gap: 12px; }
}
