/* Fondo blanco o negro elegido a mano (04/12/2026, Juan). Sin elegir, manda el del sistema
   (estilo.css, prefers-color-scheme). Los valores son LOS MISMOS que los de estilo.css:
   tests/test_tema.py lo comprueba. */
:root[data-tema="claro"] { color-scheme: light;
  --fondo: #f3f6f9; --superficie: #ffffff; --texto: #14212b; --suave: #4d5b68; --linea: #dbe3ea;
  --primario: #0b4f6c; --primario-2: #087e8b; --sobre-primario: #ffffff;
  --acento: #0a5f80; --acento-fondo: #e3f1f6; --arena: #f4a259; --arena-fondo: #fdf0e3;
  --aviso: #fff4d6; --aviso-borde: #8a6100;
  --barra: #087e8b; --barra-fondo: #dfe8ee; --foco: #b35900;
  --fallo: #a4000f; --fallo-fondo: #fde7e9;
  --t-medio: #e0f2ef; --t-medio-txt: #135e55; --t-superior: #e6eefb; --t-superior-txt: #1d4a8f;
  --t-espec: #f3e9fb; --t-espec-txt: #5f2c86; --t-grado: #fdeede; --t-grado-txt: #8a4a0c;
  --sombra: 0 1px 2px rgba(16, 38, 56, .06), 0 4px 14px rgba(16, 38, 56, .07); }
:root[data-tema="oscuro"] { color-scheme: dark;
  --fondo: #0e1419; --superficie: #172029; --texto: #e8eef3; --suave: #a9b7c3; --linea: #2b3844;
  --primario: #10394d; --primario-2: #0d5a64; --sobre-primario: #eaf6fa;
  --acento: #7fd0e6; --acento-fondo: #183442; --arena: #f4a259; --arena-fondo: #3a2a1a;
  --aviso: #2e2614; --aviso-borde: #e0b450;
  --barra: #4fc0cf; --barra-fondo: #2a3743; --foco: #ffb066;
  --fallo: #ff8a95; --fallo-fondo: #3a1a1e;
  --t-medio: #173a36; --t-medio-txt: #8fe0d3; --t-superior: #1b2d48; --t-superior-txt: #a9c6f5;
  --t-espec: #2f2240; --t-espec-txt: #d6b5f2; --t-grado: #3b2a17; --t-grado-txt: #f5c48f;
  --sombra: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .25); }

/* Boton de la barra: luna con fondo blanco (pasa a negro), sol con fondo negro (pasa a blanco). */
.boton-tema { display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  min-width: 2.6rem; min-height: 2.6rem; padding: .3rem .7rem; border: 1px solid rgba(255, 255, 255, .45);
  border-radius: 999px; background: transparent; color: inherit; font: inherit; font-size: .9rem;
  font-weight: 650; cursor: pointer; white-space: nowrap; }
.boton-tema:hover { background: rgba(255, 255, 255, .12); }
.boton-tema:focus-visible { outline: 3px solid var(--arena); outline-offset: 2px; }
.boton-tema svg { width: 1.15rem; height: 1.15rem; }
.boton-tema .sol { display: none; }
.boton-tema[aria-pressed="true"] .sol { display: block; }
.boton-tema[aria-pressed="true"] .luna { display: none; }
@media (max-width: 40rem) { .boton-tema .rotulo { display: none; } }
