:root { color-scheme: light; }
.topbar-tools { display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-wrap: wrap; }
.topbar .brand { min-width: 0; }
.brand-mark { flex-shrink: 0; }
/* El símbolo institucional cambia a su variante clara para seguir siendo legible en modo noche. */
html[data-theme="dark"] .brand-mark { content: url('/assets/acodi-symbol-b-dark.svg'); }
.theme-controls { display: flex; padding: 3px; gap: 3px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); }
.theme-controls button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 11px; border: 0; border-radius: 9px; color: var(--ink-soft); background: transparent; font: 800 .76rem Manrope, Arial, sans-serif; }
.theme-controls button[aria-pressed="true"] { color: #10233f; background: #dceaff; }

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #edf3fb;
  --ink-soft: #b6c6da;
  --paper: #0b1422;
  --white: #142238;
  --line: #344860;
  --shadow: 0 20px 44px rgba(0,0,0,.18);
}
html[data-theme="dark"] body { background: radial-gradient(circle at 14% -4%, #172c48 0, rgba(23,44,72,0) 35%), var(--paper); }
html[data-theme="dark"] .class-intro { background: #142238; border-color: var(--line); }
html[data-theme="dark"] .lesson-card,
html[data-theme="dark"] .tutor-card,
html[data-theme="dark"] .metrics-card,
html[data-theme="dark"] .learning-map,
html[data-theme="dark"] .timeline-card { border-color: var(--line); }
html[data-theme="dark"] .eyebrow { color: #b6c7dd; }
html[data-theme="dark"] .pilot-badge,
html[data-theme="dark"] .meta-chip,
html[data-theme="dark"] .duration,
html[data-theme="dark"] .video-status { color: #d8e7f8; background: #22354c; border-color: var(--line); }
html[data-theme="dark"] .meta-chip strong,
html[data-theme="dark"] .unit-number,
html[data-theme="dark"] .metric span,
html[data-theme="dark"] .metric.active strong { color: #9ec8ff; }
html[data-theme="dark"] .theme-controls button[aria-pressed="true"] { color: #f0f5ff; background: #304966; }
html[data-theme="dark"] .first-time-steps li,
html[data-theme="dark"] .unit-card { background: #192b41; border-color: var(--line); }
html[data-theme="dark"] .unit-card.active { background: #153d42; border-color: #4dafa4; }
html[data-theme="dark"] .secondary-button { color: #e1edff; background: #29415e; }
html[data-theme="dark"] .progress-rail { background: #2c4059; }
html[data-theme="dark"] .pause-hint { background: #193632; border-color: #3e766e; }
html[data-theme="dark"] .privacy-note { color: #b6c6da; }
html[data-theme="dark"] .question-form textarea,
html[data-theme="dark"] .tutor-mode select { color: #edf3fb; background: #102034; border-color: #586e87; }
html[data-theme="dark"] .question-form textarea::placeholder { color: #b1c1d5; opacity: 1; }
html[data-theme="dark"] .stop-button { color: #ffd4dc; background: #542c3b; border-color: #89536a; }
/* No usar filtros ni invertir videos, fotografías o diagramas clínicos. */
@media (max-width: 580px) {
  .topbar-tools { justify-content: flex-start; width: 100%; }
}
