/* Estilos de la landing de Studigoal.
   Los valores salen de docs/design-system.md, parte 1 («Fundamentos»). Tres temas (A · Calma, B · Cercana y C · Foco) en modo claro u oscuro.
   El tema y el modo los elige el estudiante en «Apariencia» (web/js/look.js), que los pone en <html> como
   data-theme («b» o «c»; sin atributo, Calma) y data-mode («light» o «dark»; sin atributo, el del dispositivo). */

/* Tipografías alojadas en la propia web (carpeta fonts/), sin conexión a Google.
   Licencia SIL Open Font License. */
@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/atkinson-hyperlegible-next-italic-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/atkinson-hyperlegible-next-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/atkinson-hyperlegible-next-normal-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/atkinson-hyperlegible-next-normal-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url('../fonts/plus-jakarta-sans-normal-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url('../fonts/plus-jakarta-sans-normal-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}


:root {
  --bg: #ffffff;
  --surface: #f6f7f8;
  --text: #1f2328;
  --text-muted: #5f6670;
  --border-subtle: #e4e6ea;
  --border-control: #868d95;

  --status-ok: #28704a;
  --status-ok-soft: #e3f3e8;
  --status-attention: #8f5c00;
  --status-attention-soft: #fbefd2;
  --status-review: #b23c25;
  --status-review-soft: #fde6dd;
  --danger: var(--status-review);
  --on-danger: #ffffff;
  --status-info: #1f4f8f;
  --status-info-soft: #e4eefb;
  --scrim: rgba(31, 35, 40, 0.4);

  /* Color de tema (design-system.md, parte 1): valores claro y oscuro del tema elegido. */
  --theme-accent-light: #1f6f8b;
  --theme-accent-dark: #5fb3cf;
  --theme-on-accent-dark: #0d1b22;
  --theme-soft-light: #e2f0f5;
  --theme-soft-dark: #1f3640;
  --theme-tint-light: #f5f8fa;
  --theme-tint-dark: #1d2124;
  /* Fondo Aurora de la banda (design-system.md, «Banda, paneles y pie»; TA-70, 23/11/26): claro intenso y oscuro medio. */
  --theme-aurora-light: radial-gradient(60% 80% at 100% 0%, #b5e2de 0%, transparent 70%), radial-gradient(55% 75% at 0% 100%, #c6d5f3 0%, transparent 70%), linear-gradient(#f1f7f9, #f1f7f9);
  --theme-aurora-dark: radial-gradient(60% 80% at 100% 0%, #2b5a62 0%, transparent 70%), radial-gradient(55% 75% at 0% 100%, #2e3a5e 0%, transparent 70%), linear-gradient(#1a2c34, #1a2c34);
  --theme-check-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3.2 3.2L13 4.8' fill='none' stroke='%230d1b22' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");

  --accent: var(--theme-accent-light);
  --on-accent: #ffffff;
  --accent-soft: var(--theme-soft-light);
  --tint: var(--theme-tint-light);

  --gap: var(--bg);
  --arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='M3 6l5 5 5-5' fill='none' stroke='%235f6670' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3.2 3.2L13 4.8' fill='none' stroke='%23ffffff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");

  /* Banda de color, paneles y hoja (design-system.md, parte 1). */
  /* En claro (TA-70, 23/11/26), la banda lleva el fondo Aurora y el pie, el tono suave del tema, con texto oscuro. */
  --band: var(--accent-soft);
  --band-image: var(--theme-aurora-light);
  --on-band: var(--text);
  --panel-edge: var(--border-subtle); /* borde de los paneles sobre la banda: en claro se apoyan en un fondo casi blanco */
  --panel: var(--bg);
  --band-gap: var(--tint); /* franja entre la banda y el pie (17/11/26; tono de tarjeta desde TA-70) */

  --radius-control: 8px;
  --radius-frame: 12px;
  --radius-sheet: 32px;
  --space-seam: 3px;

  --font-heading: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: "Atkinson Hyperlegible Next", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --hover-overlay: color-mix(in srgb, var(--text) 6%, transparent);
  --pressed-overlay: color-mix(in srgb, var(--text) 12%, transparent);

  /* Colores de asignatura: fuerte y suave (design-system.md, parte 1). */
  --s1: #258f98;  --s1-soft: #d1f3f6;
  --s2: #035a5c;  --s2-soft: #d1f3f4;
  --s3: #536d68;  --s3-soft: #d3f3ec;
  --s4: #6e8456;  --s4-soft: #e4f0d8;
  --s5: #636817;  --s5-soft: #ebeed4;
  --s6: #514b06;  --s6-soft: #efedd2;
  --s7: #645342;  --s7-soft: #f1eae3;
  --s8: #936656;  --s8-soft: #f3e9e5;
  --s9: #965474;  --s9-soft: #ffe2ee;
  --s10: #6c4361; --s10-soft: #fce3f4;
  --s11: #8566b1; --s11-soft: #efe6fe;
  --s12: #543f8c; --s12-soft: #ebe8ff;
}

/* Modo oscuro: el del dispositivo (salvo que el estudiante elija «Claro») o el elegido («Oscuro»).
   Los dos bloques son iguales a propósito: el CSS no permite escribirlos una sola vez. */
@media (prefers-color-scheme: dark) {
  :root:not([data-mode="light"]) {
    --bg: #191919;
    --surface: #222325;
    --text: #e9eaec;
    --text-muted: #a0a5ad;
    --border-subtle: #2f3033;
    --border-control: #767b83;

    --status-ok: #6fcf97;
    --status-ok-soft: #1d3326;
    --status-attention: #e5b04a;
    --status-attention-soft: #3a2f14;
    --status-review: #ff9a85;
    --status-review-soft: #3d2019;
    --on-danger: #3d2019;
    --status-info: #8fb8f0;
    --status-info-soft: #1f2c40;
    --scrim: rgba(0, 0, 0, 0.6);

    --accent: var(--theme-accent-dark);
    --on-accent: var(--theme-on-accent-dark);
    --accent-soft: var(--theme-soft-dark);
    --tint: var(--theme-tint-dark);
    color-scheme: dark;

    /* En oscuro la banda usa el tono suave del tema y los paneles, el gris de superficie. */
    --band: var(--accent-soft);
    --band-image: var(--theme-aurora-dark);
    --on-band: var(--text);
    --panel-edge: transparent;
    --panel: var(--surface);
    --band-gap: var(--border-subtle);

    --arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='M3 6l5 5 5-5' fill='none' stroke='%23a0a5ad' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    --check: var(--theme-check-dark);

    --s1: #7fd4dc;  --s1-soft: #113437;
    --s2: #65a3a5;  --s2-soft: #113435;
    --s3: #9fb8b3;  --s3-soft: #13342f;
    --s4: #b7cda1;  --s4-soft: #28321c;
    --s5: #adb36f;  --s5-soft: #2e3018;
    --s6: #99945d;  --s6-soft: #312f16;
    --s7: #ae9c8c;  --s7-soft: #352c23;
    --s8: #e0b3a3;  --s8-soft: #372b26;
    --s9: #e4a1c0;  --s9-soft: #3d2531;
    --s10: #b78dab; --s10-soft: #3b2635;
    --s11: #d1b4fd; --s11-soft: #31293f;
    --s12: #9b8bd7; --s12-soft: #2e2a40;
  }
}

:root[data-mode="dark"] {
  --bg: #191919;
  --surface: #222325;
  --text: #e9eaec;
  --text-muted: #a0a5ad;
  --border-subtle: #2f3033;
  --border-control: #767b83;

  --status-ok: #6fcf97;
  --status-ok-soft: #1d3326;
  --status-attention: #e5b04a;
  --status-attention-soft: #3a2f14;
  --status-review: #ff9a85;
  --status-review-soft: #3d2019;
  --on-danger: #3d2019;
  --status-info: #8fb8f0;
  --status-info-soft: #1f2c40;
  --scrim: rgba(0, 0, 0, 0.6);

  --accent: var(--theme-accent-dark);
  --on-accent: var(--theme-on-accent-dark);
  --accent-soft: var(--theme-soft-dark);
  --tint: var(--theme-tint-dark);
  color-scheme: dark;

  /* En oscuro la banda usa el tono suave del tema y los paneles, el gris de superficie. */
  --band: var(--accent-soft);
  --band-image: var(--theme-aurora-dark);
  --on-band: var(--text);
  --panel-edge: transparent;
  --panel: var(--surface);
  --band-gap: var(--border-subtle);

  --arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='M3 6l5 5 5-5' fill='none' stroke='%23a0a5ad' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --check: var(--theme-check-dark);

  --s1: #7fd4dc;  --s1-soft: #113437;
  --s2: #65a3a5;  --s2-soft: #113435;
  --s3: #9fb8b3;  --s3-soft: #13342f;
  --s4: #b7cda1;  --s4-soft: #28321c;
  --s5: #adb36f;  --s5-soft: #2e3018;
  --s6: #99945d;  --s6-soft: #312f16;
  --s7: #ae9c8c;  --s7-soft: #352c23;
  --s8: #e0b3a3;  --s8-soft: #372b26;
  --s9: #e4a1c0;  --s9-soft: #3d2531;
  --s10: #b78dab; --s10-soft: #3b2635;
  --s11: #d1b4fd; --s11-soft: #31293f;
  --s12: #9b8bd7; --s12-soft: #2e2a40;
}

/* Temas B · Cercana y C · Foco: cambian el color principal y las esquinas (design-system.md, sección 2). */
:root[data-theme="b"] {
  --theme-accent-light: #a8365a;
  --theme-accent-dark: #e57b9b;
  --theme-on-accent-dark: #2a0f19;
  --theme-soft-light: #f8e4ea;
  --theme-soft-dark: #3d242c;
  --theme-tint-light: #fbf7f3;
  --theme-tint-dark: #211d1e;
  --theme-aurora-light: radial-gradient(60% 80% at 100% 0%, #f2bfd0 0%, transparent 70%), radial-gradient(55% 75% at 0% 100%, #d8c5ee 0%, transparent 70%), linear-gradient(#faf2f5, #faf2f5);
  --theme-aurora-dark: radial-gradient(60% 80% at 100% 0%, #63364a 0%, transparent 70%), radial-gradient(55% 75% at 0% 100%, #4a2d55 0%, transparent 70%), linear-gradient(#2e1b21, #2e1b21);
  --theme-check-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3.2 3.2L13 4.8' fill='none' stroke='%232a0f19' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --radius-control: 12px;
  --radius-frame: 16px;
}
:root[data-theme="c"] {
  --theme-accent-light: #2347d9;
  --theme-accent-dark: #7b95ff;
  --theme-on-accent-dark: #0a0f2e;
  --theme-soft-light: #e6ebff;
  --theme-soft-dark: #1f2748;
  --theme-tint-light: #f5f6fb;
  --theme-tint-dark: #1c1e26;
  --theme-aurora-light: radial-gradient(60% 80% at 100% 0%, #bccbff 0%, transparent 70%), radial-gradient(55% 75% at 0% 100%, #d3c4f8 0%, transparent 70%), linear-gradient(#f2f4ff, #f2f4ff);
  --theme-aurora-dark: radial-gradient(60% 80% at 100% 0%, #2f4080 0%, transparent 70%), radial-gradient(55% 75% at 0% 100%, #3a2f66 0%, transparent 70%), linear-gradient(#181f3a, #181f3a);
  --theme-check-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3.2 3.2L13 4.8' fill='none' stroke='%230a0f2e' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --radius-control: 6px;
  --radius-frame: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  /* Pie al final de la pantalla aunque el contenido no la llene (23/11/26): el cuerpo ocupa al menos el alto de la
     pantalla y el pie se va abajo; en las páginas con la banda como contenido («Mi perfil», «Mi agenda», «Mi familia»,
     la web del tutor…), la banda se estira hasta el pie. */
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
body > * { flex-shrink: 0; }
body > .foot { margin-top: auto; }
body > main.band.profile { flex-grow: 1; }
/* En «Hoy», la hoja sobresale de la banda: lo que se estira es la franja de antes del pie (today-gap). */
body > .today-gap { flex-grow: 1; }

h1, h2, h3, h4 { font-family: var(--font-heading); line-height: 1.2; margin: 0; text-wrap: balance; }
h1 { font-size: 28px; font-weight: 700; }
h2 { font-size: 22px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 500; }
p { margin: 0; }

/* Lo que lleva el atributo «hidden» no se ve, aunque su clase le dé otro «display» (por ejemplo, el aviso de bloqueo). */
[hidden] { display: none !important; }

/* Foco de teclado: hueco de 1 px y anillo de 2 px, sin cambiar el tamaño. */
:focus { outline: none; }
:focus-visible {
  outline: none;
  box-shadow: 0 0 0 1px var(--gap), 0 0 0 3px var(--border-control);
}

/* Estructura de la página: cabecera, banda de color, contenido y pie. */
.wrap { max-width: 1024px; margin: 0 auto; padding-inline: 32px; }
.top { padding-block: 20px; background: var(--bg); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.top h1 { font-size: 44px; font-weight: 700; letter-spacing: -0.01em; }
/* En las páginas legales y en «Mi perfil», «Studigoal» es un enlace a la landing; el título de la página es el h1 de main. */
.top .wordmark {
  font-family: var(--font-heading);
  font-size: 44px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
}
@media (max-width: 560px) { .top .wordmark { font-size: 34px; } }

.band { padding-block: 40px; color: var(--on-band); background: var(--band); background-image: var(--band-image); --gap: var(--band); }
.band .panel { box-shadow: inset 0 0 0 1px var(--panel-edge); }
.band.has-sheet { padding-bottom: 0; display: flow-root; } /* flow-root: la hoja puede sobresalir por debajo de la banda */
.intro { display: flex; flex-direction: column; gap: 6px; margin-bottom: 56px; padding-top: 24px; }
.intro .lead { font-size: clamp(30px, 6.4vw, 64px); font-weight: 700; line-height: 1.1; letter-spacing: -0.015em; }
.intro .sub2 { font-family: var(--font-heading); font-size: clamp(20px, 3.2vw, 32px); font-weight: 500; line-height: 1.25; }

/* Arranque con sesión en /planning (18/11/26): hasta que account.js sabe que hay cuenta, se ven la cabecera (sin el
   botón «Menú») y el fondo de la banda vacío, para que no asome la portada sin cuenta. Desde el 23/11/26 la banda no se
   oculta, solo su contenido: así, al recargar, el fondo no desaparece y vuelve. Si el arranque fallara, la página
   aparece igual a los 6 s. */
html.session-loading body > :not(header):not(.band), html.session-loading .band > *, html.session-loading #account-button { visibility: hidden; animation: session-loading-end 0s 6s forwards; }
@keyframes session-loading-end { to { visibility: visible; } }

/* Paneles de selección: pegados, con la banda asomando entre ellos. */
.panels-top, .panels {
  display: grid;
  gap: var(--space-seam);
  border-radius: var(--radius-frame);
  overflow: hidden;
}
.panels-top { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 44px; }
/* Pregunta de la edad (design-system.md, «Portada y planning»): un panel solo, encima de los demás. */
.panels-top > .panel:nth-child(2) { grid-column: span 2; }
.panels { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* ESO, 1º a 3º: sin panel «A elegir», quedan dos paneles. Sin modalidad, las obligatorias van pegadas a la etiqueta. */
.panels.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.panel.no-track .sub { margin-top: 0; padding-top: 0; border-top: 0; }
.panel .opt-list .note { margin-top: 10px; }
.panel { --gap: var(--panel); min-width: 0; padding: 20px 22px 22px; color: var(--text); background: var(--panel); }
.panel-label {
  margin: 0 0 4px;
  padding-bottom: 12px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
}
.panel .opt { font-weight: 400; letter-spacing: 0; }
/* Curso elegido (design-system.md, «Portada y planning»): el nombre del curso y, a la derecha, el botón de lápiz. */
.grade-chosen { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; margin-top: 10px; }
.grade-current { font-family: var(--font-heading); font-weight: 600; overflow-wrap: anywhere; }
.panel .hint { margin: 10px 0 0; font-size: 14px; color: var(--text-muted); }
.panel .sub { margin-top: 6px; padding-top: 4px; border-top: 1px solid var(--border-subtle); }
/* Barra de las asignaturas (design-system.md, «Barra de las asignaturas»): va encima de los paneles y aparece
   cuando el alumno marca o cambia su primera asignatura. A la izquierda dice cuántas hay seleccionadas y a la
   derecha lleva el botón. Con las asignaturas visibles, fondo translúcido de la banda; ocultas, fondo de panel. */
.subjects-block { display: flex; flex-direction: column; gap: 14px; }
.subjects-bar {
  --gap: var(--band);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  padding: 4px 4px 4px 12px;
  color: var(--on-band);
  font-size: 14px;
  background: color-mix(in srgb, var(--on-band) 16%, transparent);
  border-radius: var(--radius-frame);
}
.subjects-bar .btn.compact { margin-left: auto; }
.subjects-bar.collapsed { --gap: var(--panel); color: var(--text); background: var(--panel); }
.subjects-bar[hidden], .subjects-bar span[hidden], .subjects-block .panels[hidden] { display: none; }

/* Botón compacto (design-system.md, «Botón»): 24 px de alto y zona sensible invisible de 44. */
.btn.compact {
  position: relative;
  min-height: 24px;
  height: 24px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 600;
  line-height: 24px;
  color: var(--text);
  background: var(--accent-soft);
  border-radius: 6px;
}
.btn.compact::after { content: ""; position: absolute; inset: -10px -6px; }
.btn.compact:hover:not(:disabled) { background: color-mix(in srgb, var(--text) 6%, var(--accent-soft)); }
.btn.compact:active:not(:disabled) { background: color-mix(in srgb, var(--text) 12%, var(--accent-soft)); }
.btn.compact:focus-visible { box-shadow: 0 0 0 1px var(--gap), 0 0 0 3px var(--border-control); }
@media (hover: none) { .btn.compact:hover:not(:disabled) { background: var(--accent-soft); } }

/* Resumen de horas por asignatura, bajo el planning. */
/* Tarjeta «Horas por asignatura» (design-system.md): título a la izquierda y botón compacto a la derecha. */
.hours-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hours-head h2 { min-width: 0; }
.hours-head .btn.compact { flex: none; }
/* La tarjeta va dentro de la banda, 14 por debajo de la hoja, y es la que sobresale: la banda termina 4 px por
   encima de la curva de sus esquinas de abajo. */
.band .hours-card { position: relative; color: var(--text); margin: 14px 0 calc(-1 * (var(--radius-control) + 4px)); }
.band.has-hours .sheet { margin-bottom: 0; }
.band.has-sheet.has-hours + main { padding-top: calc(var(--radius-control) + 4px + 40px); }
/* Resumen de horas (TA-14, opción A): anillo con el total en el centro y lista al lado; en pantallas estrechas,
   la lista baja debajo del anillo. */
.hours { display: flex; flex-wrap: wrap; align-items: center; gap: 28px; }
.hours-ring { flex: 0 0 auto; width: 220px; height: 220px; overflow: visible; }
.hours-ring path { fill: var(--subject); stroke: var(--tint); stroke-width: 2; stroke-linejoin: round; }
.hours-ring .hours-empty { fill: var(--border-subtle); }
.hours-sweep { fill: none; stroke: #fff; stroke-width: 44; stroke-dasharray: 100 100; stroke-dashoffset: 0; }
.hours-turn { transform-box: view-box; transform-origin: 50% 50%; }
.hours-total { font-family: var(--font-heading); font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; fill: var(--text); }
.hours-week { font-size: 14px; fill: var(--text-muted); }
.hours table { flex: 1 1 240px; min-width: 0; max-width: 480px; border-collapse: collapse; font-size: 15px; }
.hours th, .hours td { height: 36px; padding: 0 0 0 10px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--border-subtle); }
.hours tbody th { padding-left: 0; text-align: left; font-weight: 400; white-space: normal; }
.hours .share { width: 44px; color: var(--text-muted); }
.hours .dot { display: inline-block; flex: 0 0 auto; width: 12px; height: 12px; margin-right: 10px; border-radius: 3px; background: var(--subject); }
/* Animación al aparecer (1 s): el anillo se dibuja y se asienta, el total cuenta y las filas entran una a una. */
@keyframes hours-sweep { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }
@keyframes hours-settle { from { opacity: 0; transform: rotate(-24deg) scale(0.94); } to { opacity: 1; transform: none; } }
@keyframes hours-row { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes hours-fade { from { opacity: 0; } to { opacity: 1; } }
.hours.is-waiting .hours-sweep { stroke-dashoffset: 100; }
.hours.is-waiting .hours-turn, .hours.is-waiting tbody tr, .hours.is-waiting .hours-week { opacity: 0; }
.hours.is-playing .hours-sweep { animation: hours-sweep 1s cubic-bezier(0.65, 0, 0.35, 1) both; }
.hours.is-playing .hours-turn { animation: hours-settle 1s cubic-bezier(0.22, 1, 0.36, 1) both; }
.hours.is-playing tbody tr { animation: hours-row 0.4s cubic-bezier(0.22, 1, 0.36, 1) var(--row-delay, 0s) both; }
.hours.is-playing .hours-week { animation: hours-fade 0.4s ease 0.9s both; }
@media (prefers-reduced-motion: reduce) {
  .hours.is-playing .hours-sweep, .hours.is-playing .hours-turn, .hours.is-playing tbody tr, .hours.is-playing .hours-week { animation: none; }
}

/* Dificultad de las asignaturas (design-system.md, «Tarjeta de dificultad»): lista con el color de la escala y un
   selector de valor de 0 a 10 en cada tarjeta, la explicación del peso y el botón para rehacer el planning. Solo con sesión iniciada. */
/* Caja «Generar planning» (design-system.md): panel con el botón principal a todo el ancho, bajo las asignaturas.
   Solo sin sesión iniciada. */
.panel.generate { margin-top: 14px; border-radius: var(--radius-frame); }
.panel.generate[hidden] { display: none; }
.sheet:focus { outline: none; }
/* Espera al generar el planning (design-system.md): la primera vez, una semana que se va llenando (4 s);
   las demás, una barra de progreso (2 s). Con «reducir movimiento», solo el texto. */
.plan-loading { padding-bottom: 28px; }
.plan-loading[hidden] { display: none; }
.plan-loading h3 { margin: 0 0 16px; font-size: 22px; font-weight: 700; }
.plan-loading .small { margin: 16px 0 0; color: var(--text-muted); }
/* Pantallas de 560 o más (TA-23, 17/11/26): la semana entera, de lunes a domingo, a todo el ancho de la hoja,
   con dos tarjetas por día. En móvil, tres días con tres tarjetas cada uno, como antes. */
.pl-week { display: flex; gap: 12px; }
.pl-col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.pl-col span { font-size: 13px; font-weight: 700; color: var(--text-muted); }
.pl-card { height: 64px; background: var(--surface); opacity: 0; animation: pl-card 0.25s ease-out forwards; }
.pl-card:nth-of-type(3) { display: none; }
/* Orden de aparición (por filas, cada 0,26 s; en móvil, cada 0,42 s) y tono de cada tarjeta. Va aquí y no en el HTML porque la web no admite estilos escritos dentro de la página (CSP). */
.pl-col:nth-child(1) .pl-card:nth-of-type(1) { animation-delay: 0.00s; --tone: var(--s1); }
.pl-col:nth-child(2) .pl-card:nth-of-type(1) { animation-delay: 0.26s; --tone: var(--s9); }
.pl-col:nth-child(3) .pl-card:nth-of-type(1) { animation-delay: 0.52s; --tone: var(--s7); }
.pl-col:nth-child(4) .pl-card:nth-of-type(1) { animation-delay: 0.78s; --tone: var(--s11); }
.pl-col:nth-child(5) .pl-card:nth-of-type(1) { animation-delay: 1.04s; --tone: var(--s4); }
.pl-col:nth-child(6) .pl-card:nth-of-type(1) { animation-delay: 1.30s; --tone: var(--s2); }
.pl-col:nth-child(7) .pl-card:nth-of-type(1) { animation-delay: 1.56s; --tone: var(--s8); }
.pl-col:nth-child(1) .pl-card:nth-of-type(2) { animation-delay: 1.82s; --tone: var(--s11); }
.pl-col:nth-child(2) .pl-card:nth-of-type(2) { animation-delay: 2.08s; --tone: var(--s4); }
.pl-col:nth-child(3) .pl-card:nth-of-type(2) { animation-delay: 2.34s; --tone: var(--s2); }
.pl-col:nth-child(4) .pl-card:nth-of-type(2) { animation-delay: 2.60s; --tone: var(--s8); }
.pl-col:nth-child(5) .pl-card:nth-of-type(2) { animation-delay: 2.86s; --tone: var(--s1); }
.pl-col:nth-child(6) .pl-card:nth-of-type(2) { animation-delay: 3.12s; --tone: var(--s9); }
.pl-col:nth-child(7) .pl-card:nth-of-type(2) { animation-delay: 3.38s; --tone: var(--s7); }
@media (max-width: 559px) {
  .pl-week { max-width: 420px; }
  .pl-col:nth-child(n+4) { display: none; }
  .pl-card:nth-of-type(3) { display: block; }
  .pl-col:nth-child(1) .pl-card:nth-of-type(1) { animation-delay: 0.00s; }
  .pl-col:nth-child(2) .pl-card:nth-of-type(1) { animation-delay: 0.42s; }
  .pl-col:nth-child(3) .pl-card:nth-of-type(1) { animation-delay: 0.84s; }
  .pl-col:nth-child(1) .pl-card:nth-of-type(2) { animation-delay: 1.26s; }
  .pl-col:nth-child(2) .pl-card:nth-of-type(2) { animation-delay: 1.68s; }
  .pl-col:nth-child(3) .pl-card:nth-of-type(2) { animation-delay: 2.10s; }
  .pl-col:nth-child(1) .pl-card:nth-of-type(3) { animation-delay: 2.52s; --tone: var(--s9); }
  .pl-col:nth-child(2) .pl-card:nth-of-type(3) { animation-delay: 2.94s; --tone: var(--s11); }
  .pl-col:nth-child(3) .pl-card:nth-of-type(3) { animation-delay: 3.36s; --tone: var(--s7); }
}
.pl-card i { display: block; height: 8px; background: var(--tone); }
.pl-card b { display: block; height: 8px; margin: 10px 8px 0; width: 70%; background: var(--border-subtle); border-radius: 999px; }
.pl-card b + b { margin-top: 8px; width: 45%; }
.pl-bar { height: 8px; background: var(--border-subtle); border-radius: 999px; overflow: hidden; }
.pl-bar i { display: block; height: 8px; width: 0; background: var(--accent); border-radius: 999px; animation: pl-bar 2s linear forwards; }
.plan-loading.first .pl-bar, .plan-loading.again .pl-week, .plan-loading.again .small { display: none; }
@keyframes pl-card { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes pl-bar { from { width: 0; } to { width: 100%; } }
@media (prefers-reduced-motion: reduce) {
  .plan-loading .pl-week, .plan-loading .pl-bar, .plan-loading .small { display: none; }
}
.panel.difficulty { margin-top: 14px; border-radius: var(--radius-frame); }
/* Cabecera del panel con el botón de información (15/11/26): la línea inferior pasa de la etiqueta a la fila. */
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; border-bottom: 1px solid var(--border-subtle); }
.panel-head .panel-label { margin: 0; padding-bottom: 0; border-bottom: 0; }
.panel-head .xbtn { margin-bottom: 8px; }
/* Ventana de información de la dificultad. */
.info-sec { display: flex; flex-direction: column; gap: 6px; }
.info-sec .panel-label { margin: 0; padding-bottom: 8px; }
/* Lista de cambios de «Volver sin aplicar». */
.changes { display: flex; flex-direction: column; gap: 6px; margin: 0; padding-left: 20px; font-size: 15px; }
/* Confirmación al salir (16/11/26): título ámbar con «▲», lista de cambios sobre ámbar claro y botón rojo para salir. */
.warn-title { color: var(--status-attention); }
.changes.warn { padding: 12px 14px 12px 32px; background: var(--status-attention-soft); border-radius: var(--radius-control); }
.btn.s.del { color: var(--status-review); border-color: var(--status-review); }
.btn.s.del:focus-visible { box-shadow: 0 0 0 1px var(--gap), 0 0 0 3px var(--status-review); }
/* Final de los ajustes con sesión iniciada (15/11/26): botón a todo el ancho, aviso encima y ayuda debajo. */
.panel.settings-end { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; border-radius: var(--radius-frame); }
.panel.settings-end[hidden] { display: none; }
.settings-end .dwarn { color: var(--status-attention); }
.settings-end .hint { margin: 0; }
/* Pantalla de ajustes con sesión iniciada (15/11/26): el planning y las horas solo se ven en la pantalla principal. */
.band.settings-screen #sheet, .band.settings-screen #hours-card { display: none; }
.difficulty .dend { margin: 10px 0 6px; font-size: 14px; color: var(--text-muted); }
.dlist { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.dcard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 4px 4px 4px 12px;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-left: 6px solid var(--subject);
  border-radius: var(--radius-control);
}
.dname { min-width: 0; overflow-wrap: anywhere; }
.dstep { display: flex; align-items: center; gap: 4px; }
.dstep button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  font: inherit;
  font-size: 22px;
  line-height: 1;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border-control);
  border-radius: 50%;
  cursor: pointer;
}
.dstep button:hover:not(:disabled) { background: color-mix(in srgb, var(--text) 6%, var(--bg)); }
.dstep button:active:not(:disabled) { background: color-mix(in srgb, var(--text) 12%, var(--bg)); transform: translateY(1px); }
.dstep button:disabled { opacity: 0.35; cursor: not-allowed; }
.dstep input {
  width: 52px;
  height: 44px;
  padding: 0;
  font: 700 18px var(--font-heading);
  font-variant-numeric: tabular-nums;
  text-align: center;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border-control);
  border-radius: 22px;
}
.difficulty .dwarn, .update-bar .dwarn { color: var(--status-attention); }
/* Barra de cambios sin aplicar (design-system.md): fija abajo, sube desde el borde inferior en 0,25 s. */
.update-bar {
  position: fixed;
  z-index: 30;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  --gap: var(--tint);
  color: var(--text);
  background: var(--tint);
  border-top: 1px solid var(--border-control);
  animation: update-bar-in 0.25s ease-out;
}
.update-bar[hidden], .update-bar [hidden] { display: none; }
.update-in { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; }
.update-in p { margin: 0; }
.update-in .hint { font-size: 14px; color: var(--text-muted); }
@keyframes update-bar-in { from { transform: translateY(100%); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .update-bar { animation: none; } }
/* Barra de la cuenta (design-system.md, «Barra fija inferior», TA-20): la de cambios sin aplicar, con la lista de beneficios. */
.invite-head { display: flex; align-items: center; gap: 10px; }
.invite-toggle {
  flex: 1;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font: 700 15px/1.3 var(--font-body);
  text-align: left;
  cursor: pointer;
}
.invite-toggle svg { flex: none; transform: rotate(180deg); }
.invite-bar.folded .invite-toggle svg { transform: none; }
.invite-toggle:focus-visible { box-shadow: 0 0 0 1px var(--gap), 0 0 0 3px var(--border-control); border-radius: 4px; }
.invite-head .btn { flex: none; }
.invite-body { display: flex; flex-direction: column; gap: 10px; }
.invite-body[hidden] { display: none; }
.invite-body .hint { font-size: 14px; color: var(--text-muted); }
.benefits { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.benefits-title { font-weight: 700; }
.difficulty .note.info { margin-top: 10px; }
.dinvite { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding-top: 10px; }
.dinvite p { max-width: 65ch; }
/* Texto solo para lectores de pantalla (anuncia dónde queda una asignatura al cambiar su valor). */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.opt-list { display: flex; flex-direction: column; }
.time { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.time .field { justify-content: flex-end; max-width: none; margin: 0; padding-top: 14px; }
/* ESO: «Días libres» admite dos días («Sábado y domingo») y necesita más ancho que las otras dos columnas. */
.time.two-free { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.35fr); }

/* Hoja del planning: apoyada en la banda, con las esquinas de arriba redondeadas. */
.sheet {
  --gap: var(--bg);
  margin-top: 36px;
  padding: 28px 28px 8px;
  color: var(--text);
  background: var(--bg);
  /* Hoja cerrada (14/11/26): borde fino y cuatro esquinas. La banda termina 4 px por encima de donde empieza
     la curva de las esquinas de abajo: la hoja sobresale el radio más 4 (36; 28 en móvil). */
  position: relative;
  margin-bottom: calc(-1 * (var(--radius-sheet) + 4px));
  border: 1px solid var(--border-control);
  border-radius: var(--radius-sheet);
}
/* Bajo la hoja queda un margen de 40 del fondo de la página antes de la primera tarjeta. */
.band.has-sheet + main { padding-top: 76px; }
.sheet .download { padding-bottom: 20px; }

main { max-width: 1024px; margin: 0 auto; padding: 40px 32px 16px; }

/* Tarjeta y panel: margen interior 16, separación de 14 entre elementos. */
.card {
  --gap: var(--tint);
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  margin-bottom: 24px;
  padding: 16px;
  background: var(--tint);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control);
}
.card p, .card ul { max-width: 65ch; }
.card ul { padding-left: 20px; display: flex; flex-direction: column; gap: 8px; margin: 0; }

.small { color: var(--text-muted); font-size: 14px; }

/* Formulario */
fieldset { display: flex; flex-direction: column; gap: 6px; margin: 0 0 10px; padding: 0; border: 0; min-width: 0; }
legend {
  padding: 0;
  margin-bottom: 6px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.015em;
}

.field { display: flex; flex-direction: column; gap: 6px; max-width: 28rem; margin-bottom: 14px; }
.field label {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.015em;
}

select {
  width: 100%;
  min-height: 44px;
  padding: 0 44px 0 12px;
  font: inherit;
  color: var(--text);
  background-color: var(--bg);
  background-image: var(--arrow);
  background-repeat: no-repeat;
  background-position: right 12px center;
  border: 1px solid var(--border-control);
  border-radius: var(--radius-control);
  appearance: none;
  -webkit-appearance: none;
}
select:hover:not(:disabled) { border-color: var(--text-muted); }
select:disabled { opacity: 0.45; cursor: not-allowed; }

/* Casillas y opciones: 22 px, borde de 2 px, fila de al menos 44 px. */
fieldset label,
.opt {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-weight: 600;
  letter-spacing: 0.015em;
  cursor: pointer;
}
input[type="checkbox"],
input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  display: grid;
  place-content: center;
  flex: none;
  width: 22px;
  height: 22px;
  margin: 0;
  background: var(--bg);
  border: 2px solid var(--text-muted);
  cursor: pointer;
}
input[type="checkbox"] { border-radius: 6px; }
input[type="radio"] { border-radius: 50%; }
input:checked { background: var(--accent); border-color: var(--accent); }
input[type="checkbox"]:checked::after {
  content: "";
  width: 6px;
  height: 11px;
  border: solid var(--on-accent);
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg) translate(-1px, -1px);
}
input[type="radio"]:checked::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--on-accent); }
input:hover:not(:checked):not(:disabled) { border-color: var(--accent); }
input:active:not(:disabled) { background: var(--accent-soft); border-color: var(--accent); }
input:checked:active:not(:disabled) { background: color-mix(in srgb, var(--text) 22%, var(--accent)); }
input:focus-visible { box-shadow: 0 0 0 1px var(--gap), 0 0 0 3px var(--text-muted); }

/* Avisos en pantalla: margen interior 10 × 12, símbolo y palabra, separación de 10. */
.note { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; font-size: 15px; border-radius: var(--radius-control); }
.note b { font-family: var(--font-heading); white-space: nowrap; }
.note span { color: var(--text); }
.note.warn { background: var(--status-attention-soft); color: var(--status-attention); }
.note.info { background: var(--status-info-soft); color: var(--status-info); }
/* «Mi agenda» (TA-13, opción 2A): aviso «No da tiempo» encima de la semana, con dos respuestas. */
.agenda-notes { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.agenda-note { flex-direction: column; align-items: stretch; gap: 10px; padding: 16px; color: var(--status-review); background: var(--status-review-soft); }
.agenda-note b { white-space: normal; }
.agenda-note p { margin: 0; color: var(--text); }
.agenda-actions { display: flex; flex-direction: column; gap: 12px; }
/* Opción 6B (16/11/26): tarjetas de elegir una (las de «Apariencia») y «Aplicar». */
.agenda-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.agenda-choice { display: flex; gap: 10px; align-items: flex-start; padding: 12px; color: var(--text); background: var(--bg); border: 1px solid var(--border-control); border-radius: var(--radius-control); cursor: pointer; }
.agenda-choice:has(input:checked) { padding: 11px; background: var(--accent-soft); border: 2px solid var(--accent); }
.agenda-choice:has(input:focus-visible) { box-shadow: 0 0 0 1px var(--gap), 0 0 0 3px var(--border-control); }
.agenda-choice.off { background: var(--surface); border-style: dashed; cursor: not-allowed; }
.agenda-choice input { flex: 0 0 auto; margin: 1px 0 0; }
.agenda-choice-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.agenda-choice-title { font-family: var(--font-heading); font-size: 15px; font-weight: 700; }
.agenda-choice.off .agenda-choice-title { color: var(--text-muted); }
.agenda-choice-tag { display: inline-block; margin: 0 0 0 6px; background: var(--accent-soft); }
.agenda-choice-help { font-size: 14px; line-height: 1.4; }
.agenda-choice-help.no { font-weight: 700; color: var(--status-review); }
.agenda-apply { align-self: flex-end; min-width: 240px; }
@media (max-width: 559px) { .agenda-apply { align-self: stretch; } }
.agenda-dialog #dlg-title { color: var(--status-review); }
.agenda-dialog > p { margin: 0 0 14px; }
/* Etiqueta de la sesión del planning (opción 1A). */
.pb-tag { margin-bottom: 6px; }

/* Pie F1 · Mínimo legal (design-system.md, «Pie»; en uso desde el 17/11/26): una línea sobre la banda, con el
   estado y la versión a la izquierda y los enlaces legales a la derecha. En pantallas estrechas pasa a dos líneas. */
.foot { padding-block: 24px 28px; color: var(--on-band); background: var(--band); font-size: 14px; }
.foot-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 18px; }
.foot-line p { margin: 0; }
.foot-version::before { content: "· "; }
.foot-name + .foot-version { margin-left: -14px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0 0 0 auto; padding: 0; list-style: none; }
.foot a { color: inherit; text-underline-offset: 3px; }
.foot a[aria-current="page"] { font-weight: 700; text-decoration: none; }
.foot a:focus-visible { box-shadow: 0 0 0 1px var(--band), 0 0 0 3px var(--on-band); }
@media (max-width: 559px) { .foot-links { margin-left: 0; width: 100%; } }

/* Enlace de texto pequeño (por ejemplo, «Privacidad» en la ventana de crear cuenta). */
.small a { color: var(--accent); text-underline-offset: 3px; }

/* Botones: alto 44, margen lateral 18. Principal (.btn) y secundario (.btn.s). */
.btn {
  min-height: 44px;
  padding: 0 18px;
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  color: var(--on-accent);
  background: var(--accent);
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  cursor: pointer;
}
/* Botón grande (design-system.md, «Botón»): acción principal de una pantalla. En móvil ocupa todo el ancho. */
.btn.lg { min-height: 52px; padding: 0 32px; font-size: 18px; }
@media (max-width: 559px) { .btn.lg { width: 100%; min-height: 44px; padding: 0 18px; font-size: 16px; } }
/* El botón también se usa como enlace (<a class="btn">): sin subrayado y centrado. */
a.btn { display: inline-flex; align-items: center; text-decoration: none; }
.btn:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 88%, var(--text)); }
.btn:active:not(:disabled) { background: color-mix(in srgb, var(--accent) 78%, var(--text)); transform: translateY(1px); }
.btn:focus-visible { box-shadow: 0 0 0 1px var(--gap), 0 0 0 3px var(--accent); }
.btn.s { color: var(--text); background: transparent; border-color: var(--border-control); }
.btn.s:hover:not(:disabled) { background: var(--hover-overlay); }
.btn.s:active:not(:disabled) { background: var(--pressed-overlay); }
.btn.s:focus-visible { box-shadow: 0 0 0 1px var(--gap), 0 0 0 3px var(--border-control); }
/* Destructivo (design-system.md, «Botón»): solo para confirmar acciones irreversibles. */
.btn.danger { color: var(--on-danger); background: var(--danger); }
.btn.danger:hover:not(:disabled) { background: color-mix(in srgb, var(--danger) 88%, var(--text)); }
.btn.danger:active:not(:disabled) { background: color-mix(in srgb, var(--danger) 78%, var(--text)); }
.btn.danger:focus-visible { box-shadow: 0 0 0 1px var(--gap), 0 0 0 3px var(--danger); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
@media (hover: none) {
  .btn:hover:not(:disabled) { background: var(--accent); }
  .btn.danger:hover:not(:disabled) { background: var(--danger); }
  .btn.s:hover:not(:disabled) { background: transparent; }
}
/* Botón secundario de solo icono (−, +, ▲, ▼): sin margen lateral; el nombre va en la etiqueta accesible. */
.btn.icon { padding: 0; min-width: 0; }

/* Planning semanal (design-system.md, «Planning semanal»):
   siete columnas de 190 px como mínimo; si no caben, scroll lateral. */
.planning { display: flex; flex-direction: column; gap: 14px; margin-top: 10px; }
.weekscroll { position: relative; overflow-x: auto; padding-bottom: 10px; }
.week { display: grid; grid-template-columns: repeat(7, minmax(190px, 1fr)); gap: 8px; }
.day { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.day h4 {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.015em;
  color: var(--text-muted);
}
.day.today h4 { font-weight: 700; color: var(--accent); }
.day.drop-target { background: var(--accent-soft); }
.day-free {
  padding: 10px;
  font-size: 14px;
  text-align: center;
  color: var(--text-muted);
  border: 1px dashed var(--border-control);
  border-radius: 6px;
}

/* Tarjeta: barra de color arriba, esquinas rectas, asignatura, hora y caja de duración pegada abajo.
   Altura mínima: 110 px + 2 px por minuto. Estados según el día: pasado, en curso (hoy) y futuro. */
.pb {
  container-type: inline-size;
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: calc(110px + var(--minutes, 30) * 2px);
  padding: 8px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border-subtle);
  border-top: 8px solid var(--subject);
  border-radius: 0;
  overflow-wrap: anywhere;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  cursor: grab;
  transition: margin 0.18s ease, height 0.18s ease, min-height 0.18s ease, padding 0.18s ease, border-width 0.18s ease, opacity 0.18s ease;
}
/* Días pasados: barra de arriba gris (color-block-bar-past = color-border-control; TA-42, 18/11/26). */
.pb.past { background: var(--surface); border-color: var(--surface); border-top-color: var(--border-control); cursor: default; }
.pb.now { border-color: var(--border-control); border-top-color: var(--subject); }
.pb-name { display: block; font-family: var(--font-heading); font-size: 15px; font-weight: 500; line-height: 1.3; }
.pb small { display: block; margin-top: 2px; margin-bottom: 8px; font-size: 13px; color: var(--text-muted); }

/* Caja «Duración de la sesión»: − a la izquierda, duración en el centro y + a la derecha.
   Si no cabe en una fila (contenido de menos de 168 px), la duración va arriba y los botones debajo. */
.dur { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-top: auto; padding: 6px; background: var(--accent-soft); border-radius: 12px; }
.dur-label { grid-column: 1 / -1; font-size: 12px; line-height: 1.25; color: var(--text-muted); }
.dur-val {
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  font-variant-numeric: tabular-nums;
  background: var(--bg);
  border-radius: 999px;
}
.dur button {
  justify-self: center;
  width: 44px;
  height: 44px;
  padding: 0;
  font: inherit;
  font-size: 22px;
  line-height: 1;
  color: var(--text);
  background: var(--bg);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}
.dur button:hover:not(:disabled) { background: color-mix(in srgb, var(--text) 6%, var(--bg)); }
.dur button:active:not(:disabled) { background: color-mix(in srgb, var(--text) 12%, var(--bg)); transform: translateY(1px); }
.dur button:disabled { opacity: 0.45; cursor: not-allowed; }
.dur button:focus-visible { box-shadow: 0 0 0 1px var(--accent-soft), 0 0 0 3px var(--border-control); }
@container (min-width: 168px) {
  .dur { grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; }
  .dur-val { grid-column: 2; grid-row: 2; }
  .dur .less { grid-column: 1; grid-row: 2; }
  .dur .more { grid-column: 3; grid-row: 2; }
}

/* Arrastrar: la tarjeta de origen se pliega, la que se lleva aparece levantada y las demás se separan para dejar un hueco. */
.pb.dragging { height: 0 !important; min-height: 0; padding-top: 0; padding-bottom: 0; border-top-width: 0; border-bottom-width: 0; margin-bottom: -8px; opacity: 0; overflow: hidden; pointer-events: none; }
.pb.gap-before { margin-top: var(--hole); }
.pb.gap-after { margin-bottom: var(--hole); }
.pb.gap-before::before, .pb.gap-after::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: calc(var(--hole) - 8px);
  border: 2px dashed var(--accent);
  border-radius: 2px;
  pointer-events: none;
}
.pb.gap-before::before { top: calc(-1 * var(--hole)); }
.pb.gap-after::after { bottom: calc(-1 * var(--hole)); }
.pb.ghost {
  position: fixed;
  z-index: 10;
  margin: 0;
  min-height: 0;
  pointer-events: none;
  opacity: 0.96;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
  transform: rotate(1.5deg) scale(1.03);
  transition: none;
  cursor: grabbing;
}
body.is-dragging { cursor: grabbing; }
@media (prefers-reduced-motion: reduce) { .pb { transition: none; } }

.download { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
/* Qué se descarga: dos tarjetas de elegir una con miniatura (17/11/26, design-system.md, «Portada y planning»). */
.sheet .download { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border-subtle); }
.dl-label { margin: 0 0 4px; font-size: 15px; font-weight: 600; letter-spacing: 0.015em; }
.dl-choices { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 4px; }
.dl-choice {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 340px;
  max-width: 100%;
  box-sizing: border-box;
  padding: 12px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border-control);
  border-radius: var(--radius-control);
  cursor: pointer;
}
.dl-choice:hover { background: var(--hover-overlay); }
.dl-choice:has(input:checked) { padding: 11px; background: var(--accent-soft); border: 2px solid var(--accent); }
.dl-choice:has(input:focus-visible) { box-shadow: 0 0 0 1px var(--gap), 0 0 0 3px var(--border-control); }
.dl-choice:has(input:checked) .dl-title::after { content: " ✓"; }
.dl-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.dl-title { font-family: var(--font-heading); font-size: 15px; font-weight: 700; }
.dl-help { font-size: 14px; color: var(--text-muted); }
.dl-mini { display: flex; flex-direction: column; gap: 4px; flex: none; box-sizing: border-box; width: 96px; height: 68px; padding: 5px; background: #fff; border: 1px solid var(--border-control); }
.dl-mini-band { flex: none; height: 6px; background: #e4e6ea; }
.dl-mini-cols { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; flex: 1; }
.dl-mini-col { display: flex; flex-direction: column; gap: 2px; }
.dl-mini-bar { height: 14px; background: #f6f7f8; border-left: 2px solid var(--tone); }
.dl-mini-free { height: 30px; border: 1px dashed #868d95; }
.dl-mini-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: repeat(5, minmax(0, 1fr)); gap: 1px; flex: 1; }
.dl-mini-cell { background: #fff; border-top: 2px solid var(--tone); }
.dl-mini-cell.alt { background: #f6f7f8; }
.dl-mini .t1 { --tone: #258f98; } .dl-mini .t2 { --tone: #035a5c; } .dl-mini .t3 { --tone: #536d68; } .dl-mini .t4 { --tone: #645342; }
.dl-mini .t5 { --tone: #965474; } .dl-mini .t6 { --tone: #6c4361; } .dl-mini .t7 { --tone: #8566b1; }
@media (max-width: 559px) {
  .dl-choices { flex-direction: column; gap: 10px; width: 100%; }
  .dl-choice { width: 100%; gap: 12px; }
  .dl-mini { width: 84px; height: 60px; }
  .download .btn.lg { margin-top: 0; }
}
/* Ventana «¿Qué mes quieres descargar?»: tarjetas en columna y botones apilados, el principal arriba. */
.dl-month > p { margin: 0; font-size: 16px; }
.dl-month .dl-month-choices { grid-template-columns: 1fr; }
.dl-month-choice { align-items: center; min-height: 48px; box-sizing: border-box; }
.dl-month .row { flex-direction: column; flex-wrap: nowrap; }
.dl-month .row .btn { width: 100%; }

/* Cuenta con alias y código (design-system.md, «Ventanas de la cuenta»; aprobada el 14/10/26). */
.top .btn { max-width: 52vw; gap: 8px; }
.btn .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn svg { flex: none; }
.btn.block { width: 100%; }
.btn.xbtn { min-width: 44px; padding: 0; }
a.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }

.scrim {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  background: var(--scrim);
}
.scrim[hidden] { display: none; }
/* Confirmación al salir (16/11/26): va encima de cualquier otra ventana. */
.scrim.over { z-index: 55; }
body.dialog-open { overflow: hidden; }
.dialog {
  --gap: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 360px;
  margin: auto;
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control);
}
.dialog:focus { box-shadow: none; }
.dialog h3 { font-size: 18px; line-height: 1.3; }
.dialog .field { max-width: none; margin-bottom: 0; }
.dialog form { display: flex; flex-direction: column; gap: 14px; }
.dialog .dlg-step { display: flex; flex-direction: column; gap: 14px; }
.dialog .dlg-step:empty { display: none; }
.dialog .row { display: flex; flex-wrap: wrap; gap: 8px; }
.dialog .row .btn { flex: 1 1 auto; }
/* Ventanas de 360 px y de confirmación: los botones, uno encima de otro y a todo el ancho, con el principal
   (o el destructivo) arriba (TA-22, 16/11/26). Las alternativas de alias (#u-alts) siguen en fila. */
.dialog:not(.wide) .row:not(#u-alts), .dialog[role="alertdialog"] .row { flex-direction: column; flex-wrap: nowrap; }
.dialog:not(.wide) .row:not(#u-alts) .btn, .dialog[role="alertdialog"] .row .btn { width: 100%; }
.dialog:not(.wide) .row:not(#u-alts) .btn.s, .dialog[role="alertdialog"] .row .btn.s { order: 1; }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
/* Nueva entrada (TA-48, 22/11/26; design-system.md, «Enlace», «Campo de texto y desplegable» y «Botón»).
   Enlaces en una ventana: cada uno en su línea con 44 de alto, uno debajo de otro sin hueco (las zonas se tocan).
   La ventana separa sus piezas 14; los enlaces se acercan 8 a sus vecinas para no dejar demasiado aire. */
.dlg-links { display: flex; flex-direction: column; align-items: flex-start; margin-block: -8px; }
.dlg-links .text-link { display: inline-flex; align-items: center; min-height: 44px; font-size: 15px; text-align: left; }
.dlg-switch .text-link { display: inline-flex; align-items: center; min-height: 44px; }
.dlg-switch { margin-block: -8px; }
/* Mes y año en una fila: «Mes» 1,4 partes y «Año» 1 parte, separados 8. */
.birth-pair { display: grid; grid-template-columns: 1.4fr 1fr; gap: 8px; }
.birth-pair select { width: 100%; min-width: 0; }
/* «Falta: …» encima del botón apagado, a 6. */
.dialog .dlg-missing { margin-bottom: -8px; }

/* Campo de texto (44 px, borde de control) y casillas del código (52 px, hasta 6 en fila). */
.input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border-control);
  border-radius: var(--radius-control);
}
input.input:hover:not(:disabled) { border-color: var(--text-muted); }
input.input:active:not(:disabled) { background: var(--bg); border-color: var(--text-muted); }
input.input:focus-visible { box-shadow: 0 0 0 1px var(--gap), 0 0 0 3px var(--border-control); }
.input:disabled { opacity: 0.45; cursor: not-allowed; background: var(--surface); }
/* Campo de fecha en el iPhone (16/11/26): Safari le da un ancho mínimo propio y lo centra, y el campo se salía
   por la derecha de la ventana. Se quita el aspecto del sistema para que ocupe el ancho del contenedor, como el resto. */
input[type="date"].input {
  display: block;
  min-width: 0;
  max-width: 100%;
  height: 44px;
  padding-top: 0;
  padding-bottom: 0;
  line-height: 42px; /* sin el aspecto del sistema, Safari pone la fecha arriba: así queda centrada en vertical */
  text-align: left;
  appearance: none;
  -webkit-appearance: none;
}
input[type="date"].input::-webkit-date-and-time-value { margin: 0; line-height: 42px; text-align: left; }
.field.err input[type="date"].input { line-height: 40px; }
.field.err .input { padding: 0 11px; border: 2px solid var(--status-review); }
.field.err input.input:focus-visible { box-shadow: 0 0 0 1px var(--gap), 0 0 0 3px var(--status-review); }
/* Campo de varias líneas (contenido de un examen, 16/11/26): el de texto, más alto y con margen arriba y abajo. */
textarea.input { height: auto; min-height: 96px; padding: 10px 12px; line-height: 1.5; resize: vertical; }
textarea.input:hover:not(:disabled) { border-color: var(--text-muted); }
textarea.input:focus-visible { box-shadow: 0 0 0 1px var(--gap), 0 0 0 3px var(--border-control); }
.field.err textarea.input { padding: 9px 11px; }
.field.err textarea.input:focus-visible { box-shadow: 0 0 0 1px var(--gap), 0 0 0 3px var(--status-review); }
/* Nota y contenido en la tarjeta de un examen. */
.xcard .xcontent { font-size: 14px; color: var(--text-muted); overflow-wrap: anywhere; }
.field.err input[type="checkbox"] { border-color: var(--status-review); }
/* TA-52 (19/11/26): las casillas miden 44, como el botón del ojo que va a su derecha (web/js/code-input.js). */
/* La fila mide como mucho 7 casillas de 52 y sus huecos: así el ojo queda pegado a la última casilla en las páginas anchas. */
.pin-row { display: flex; align-items: center; gap: 8px; max-width: calc(7 * 52px + 6 * 8px); }
.pin-row .pin { flex: 1 1 auto; min-width: 0; }
/* El ojo mide lo mismo que una casilla: el ancho de la fila entre 7, menos los huecos de 8 (19/11/26). */
.pin-row .pin-eye { display: grid; flex: 0 0 calc((100% - 48px) / 7); place-items: center; min-width: 0; max-width: 52px; }
.pin-eye .ic-eye-off { display: none; }
.pin-eye[aria-pressed="true"] .ic-eye { display: none; }
.pin-eye[aria-pressed="true"] .ic-eye-off { display: block; }
/* Campo de contraseña del tutor con el ojo dentro (SPEC-001; design-system.md, «Campo de texto y desplegable»). */
.pass-wrap { position: relative; }
.input.pass { padding-right: 52px; }
.field.err .input.pass { padding-right: 51px; }
.pass-eye {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  border-radius: var(--radius-control);
  cursor: pointer;
}
.pass-eye:hover { color: var(--text); background: var(--hover-overlay); }
.pass-eye:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--border-control); }
.pass-eye .ic-eye-off { display: none; }
.pass-eye[aria-pressed="true"] .ic-eye { display: none; }
.pass-eye[aria-pressed="true"] .ic-eye-off { display: block; }
/* Enlace dentro de una ventana que hace una acción («¿Has olvidado tu contraseña?»): aspecto del enlace en el texto. */
.text-link { padding: 0; font: inherit; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; background: none; border: 0; cursor: pointer; border-radius: 2px; }
.text-link:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--accent); }
/* Aviso «● Al día» (design-system.md, «Aviso»). */
.note.ok { background: var(--status-ok-soft); color: var(--status-ok); }
/* Recuadro de correo, solo en la web de test (SPEC-001; design-system.md, «Recuadro de correo»). */
.mailbox { overflow: hidden; border: 1px solid var(--border-control); border-radius: var(--radius-control); }
.mailbox-head { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 10px 12px; font-size: 14px; background: var(--surface); border-bottom: 1px solid var(--border-subtle); }
.mailbox-head div { display: flex; gap: 8px; min-width: 0; }
.mailbox-head dt { flex: none; width: 56px; color: var(--text-muted); }
.mailbox-head dd { min-width: 0; margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.mailbox-body { display: flex; flex-direction: column; gap: 10px; padding: 12px; font-size: 15px; }
.mailbox-body p { margin: 0; }
.mailbox-body .btn { align-self: flex-start; }
.pin { display: flex; gap: 8px; }
.pin .input {
  flex: 1 1 0;
  min-width: 0;
  max-width: 52px;
  min-height: 44px;
  height: 44px;
  padding: 0;
  text-align: center;
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
/* Etiqueta de un grupo de campos que no es un <label> (el código): igual que las etiquetas de campo. */
.lab { font-size: 15px; font-weight: 600; letter-spacing: 0.015em; }
.dialog [data-self-start] { align-self: flex-start; }
.help { font-size: 14px; color: var(--text-muted); }
.help.ok { color: var(--status-ok); }
.msg-err { display: flex; gap: 6px; font-size: 14px; letter-spacing: 0.01em; color: var(--status-review); }
.msg-err[hidden], .help[hidden] { display: none; }
.big { font-family: var(--font-heading); font-size: 20px; font-weight: 700; user-select: all; overflow-wrap: anywhere; }
.big.code { letter-spacing: 0.12em; }

/* Selector segmentado (Entrar | Crear cuenta). */
.seg {
  display: flex;
  width: 100%;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--border-control);
  border-radius: var(--radius-control);
}
.seg label {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 14px;
  font-weight: 600;
  letter-spacing: 0.015em;
  cursor: pointer;
  border-right: 1px solid var(--border-control);
}
.seg label:last-child { border-right: 0; }
.seg input { position: absolute; inset: 0; width: auto; height: auto; margin: 0; opacity: 0; border: 0; cursor: pointer; }
.seg label:has(input:checked) { color: var(--on-accent); background: var(--accent); }
.seg label:not(:has(input:checked)):hover { background: var(--hover-overlay); }
.seg:has(input:focus-visible) { box-shadow: 0 0 0 1px var(--gap), 0 0 0 3px var(--border-control); }
/* «✓» delante de la opción elegida (TA-21, 16/11/26): aparece y el texto se desliza para dejarle sitio
   (time-block-move). Es decorativo: el lector de pantalla ya anuncia la opción marcada. */
.seg label::before {
  content: "✓";
  content: "✓" / "";
  display: inline-block;
  width: 0;
  margin-right: 0;
  overflow: hidden;
  opacity: 0;
  font-weight: 700;
  text-align: center;
  transition: width 0.18s ease, margin-right 0.18s ease, opacity 0.18s ease;
}
.seg label:has(input:checked)::before { width: 1em; margin-right: 4px; opacity: 1; }
@media (prefers-reduced-motion: reduce) { .seg label::before { transition: none; } }

/* Aviso temporal: margen interior 10 × 14, abajo y centrado. */
.toast {
  position: fixed;
  z-index: 60;
  left: 50%;
  bottom: max(24px, calc(env(safe-area-inset-bottom, 0px) + 16px));
  max-width: calc(100% - 32px);
  padding: 10px 14px;
  font-size: 15px;
  color: var(--bg);
  background: var(--text);
  border-radius: var(--radius-control);
  transform: translateX(-50%);
}
.toast[hidden] { display: none; }

@media (max-width: 820px) {
  .panels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* Pantallas medianas (18/11/26): «Curso» (tan ancho como sus opciones) y «Tu tiempo de estudio» lado a lado (antes el segundo bajaba a otra fila y
     dejaba un hueco junto al curso). Horas al día y hora de inicio en una fila; el día libre, debajo. */
  .panels-top { grid-template-columns: auto minmax(0, 1fr); }
  .panels-top > .panel:nth-child(2) { grid-column: auto; }
  .time, .time.two-free { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
  .time .field:last-child { grid-column: 1 / -1; }
}
@media (max-width: 339px) { .time, .time.two-free { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) {
  .wrap, main { padding-inline: 16px; }
  .top h1 { font-size: 34px; }
  .intro { margin-bottom: 32px; }
  .panels, .panels.two, .panels-top { grid-template-columns: minmax(0, 1fr); }
  .panels-top { margin-bottom: 28px; }
  .panels-top > .panel:nth-child(2) { grid-column: auto; }
  /* Horas al día y hora de inicio en la misma fila; el día libre, debajo (16/11/26). */
  .time, .time.two-free { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
  .time .field:last-child { grid-column: 1 / -1; }
  .sheet { --radius-sheet: 24px; padding: 20px 16px 4px; }
  .band.has-sheet + main { padding-top: 68px; }
}

/* Menú de la cuenta y ajustes del plan (design-system.md, «Ventanas de la cuenta» y «Portada y planning»). */
.top .wrap { position: relative; }
.top #account-button { position: relative; z-index: 41; }
.top #account-button[aria-expanded="true"] { background: var(--bg); }
.menu-veil { position: fixed; inset: 0; z-index: 40; background: var(--scrim); }
.menu {
  position: absolute;
  z-index: 41;
  top: calc(100% + 8px);
  right: 32px;
  width: 280px;
  max-width: calc(100% - 32px);
  padding: 8px;
  background: var(--bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-frame);
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--text);
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: var(--radius-control);
  cursor: pointer;
}
.menu-item.strong { font-weight: 700; }
.menu-item.danger { color: var(--status-review); }
.menu-item:hover { background: var(--hover-overlay); }
.menu-item:active { background: var(--pressed-overlay); }
.menu-item:focus-visible { box-shadow: inset 0 0 0 2px var(--border-control); }
.menu-item svg { flex: none; }
.menu-sep { height: 1px; margin: 6px 8px; background: var(--border-subtle); }
@media (hover: none) { .menu-item:hover { background: transparent; } }

/* Resumen encima del planning con cuenta (TA-16, 16/11/26; design-system.md, «Portada y planning»): sobre la banda, sin
   fondo propio. Curso con font-size-title-page; modalidad, tiempo y día libre con font-size-body; extraescolares y próximos
   exámenes en paneles (etiqueta de panel); «Ajustes del plan» (botón secundario sobre color-panel) abajo a la derecha. */
.settings-summary { display: flex; flex-direction: column; gap: 14px; color: var(--on-band); }
.settings-summary .ss-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.settings-summary p { margin: 0; font-size: 16px; line-height: 1.45; }
.settings-summary .ss-grade { font-size: 28px; font-weight: 700; }
.settings-summary .ss-track + .ss-time, .settings-summary .ss-track[hidden] + .ss-time { margin-top: 8px; }
.panel.ss-box { border-radius: var(--radius-control); }
.panel.ss-box[hidden] { display: none; }
.ss-box p { margin-top: 8px; overflow-wrap: anywhere; }
.ss-box .xlink { margin-top: 8px; }
.ss-box .xrows { margin-top: 4px; }
.ss-box .xrow:last-child { border-bottom: 0; padding-bottom: 0; }
.settings-summary .btn.s { align-self: flex-end; --gap: var(--band); background-color: var(--panel); }
.settings-summary .btn.s:hover:not(:disabled) { background: linear-gradient(var(--hover-overlay), var(--hover-overlay)) var(--panel); }
.settings-summary .btn.s:active:not(:disabled) { background: linear-gradient(var(--pressed-overlay), var(--pressed-overlay)) var(--panel); }
.band.settings-collapsed .intro { margin-bottom: 24px; padding-top: 8px; }
.band.settings-collapsed .intro .lead { font-size: clamp(26px, 5vw, 40px); }
@media (max-width: 560px) { .menu { right: 16px; } }

/* Botón de cuenta fijo (design-system.md, «Cabecera»): al bajar por la página, el botón (y su menú) se quedan
   pegados arriba a la derecha, para no tener que volver a la cabecera. Fondo sólido para leerse sobre cualquier contenido. */
.top #account-button.floating {
  position: fixed;
  z-index: 41;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  right: max(calc(env(safe-area-inset-right, 0px) + 16px), calc((100vw - 1024px) / 2 + 32px));
  background: var(--bg);
}
.menu.floating {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 12px + 44px + 8px);
  right: max(calc(env(safe-area-inset-right, 0px) + 16px), calc((100vw - 1024px) / 2 + 32px));
  max-width: calc(100vw - 32px);
}

/* Menú de la cabecera sin sesión (TA-28, design-system.md, «Preguntas frecuentes» y «Menú desplegable»): botón «Menú»
   con el icono de tres rayas; por debajo de 560 px, solo el icono. Desde TA-28 «Apariencia» va dentro del menú. */
.top-actions { display: flex; align-items: center; gap: 8px; min-width: 0; }
.top #account-button:not(.initial) { display: inline-flex; align-items: center; gap: 8px; }
.top #account-button[hidden] { display: none; }
@media (max-width: 560px) {
  .top #account-button:not(.initial) { min-width: 44px; padding: 0; justify-content: center; }
  .menu-text { display: none; }
}
/* «Entrar» y «Crear cuenta» en la cabecera sin sesión (TA-48, design-system.md, «Cabecera»): a la derecha, antes del
   botón «Menú». En menos de 560 px bajan a la fila de acceso: los dos a medias, a 16 de la banda; el menú sigue
   abriéndose bajo su botón, en la primera fila. */
.guest-access { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.guest-access[hidden] { display: none; }
.top .guest-access .btn { max-width: none; }
@media (max-width: 560px) {
  .top .wrap:has(.guest-access:not([hidden])) { flex-wrap: wrap; row-gap: 16px; }
  .guest-access { order: 3; display: grid; grid-template-columns: 1fr 1fr; flex: 1 0 100%; margin-left: 0; }
  .top .wrap:has(.guest-access:not([hidden])) .menu { top: 52px; }
}
/* La flecha de «se abre en otra pestaña», a la derecha de la fila del formulario. */
.menu-item .menu-ext { display: inline-flex; margin-left: auto; color: var(--text-muted); }
.flabel { font-size: 15px; font-weight: 600; letter-spacing: 0.015em; }
.looks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.look {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 44px;
  padding: 8px;
  border: 1px solid var(--border-control);
  border-radius: var(--radius-control);
  cursor: pointer;
}
.look input { position: absolute; inset: 0; width: auto; height: auto; margin: 0; opacity: 0; border: 0; cursor: pointer; }
.look:has(input:checked) { padding: 7px; border: 2px solid var(--accent); }
.look:not(:has(input:checked)):hover { background: var(--hover-overlay); }
.look:has(input:focus-visible) { box-shadow: 0 0 0 1px var(--gap), 0 0 0 3px var(--border-control); }
.look-sw { display: flex; gap: 4px; margin-bottom: 4px; }
.look-sw i { flex: 1; height: 20px; }
/* Muestra fija de cada tema en modo claro (design-system.md, parte 1), sea cual sea el tema elegido. */
.look-a .look-sw i { border-radius: 8px; } .look-a .look-sw i:first-child { background: #1f6f8b; } .look-a .look-sw i:last-child { background: #e2f0f5; border: 1px solid #1f6f8b; }
.look-b .look-sw i { border-radius: 12px; } .look-b .look-sw i:first-child { background: #a8365a; } .look-b .look-sw i:last-child { background: #f8e4ea; border: 1px solid #a8365a; }
.look-c .look-sw i { border-radius: 6px; } .look-c .look-sw i:first-child { background: #2347d9; } .look-c .look-sw i:last-child { background: #e6ebff; border: 1px solid #2347d9; }
.look-name { font-family: var(--font-heading); font-size: 15px; font-weight: 600; }
.look:has(input:checked) .look-name::after { content: " ✓"; color: var(--accent); }
.look-note { font-size: 13px; color: var(--text-muted); }
.seg label { white-space: nowrap; }
@media (max-width: 380px) { .looks { grid-template-columns: minmax(0, 1fr); } .seg label { padding: 0 8px; } }

/* Ventanas de extraescolares y exámenes: 420 px como máximo (design-system.md, parte 1). */
.dialog.wide { max-width: 420px; }
.field.err select { padding-left: 11px; border: 2px solid var(--status-review); }

/* Extraescolares y próximos exámenes (design-system.md, «Tarjeta de extraescolar» y «Fila de lista»). */
.difficulty .sub .hint { margin-bottom: 10px; }
.opt-tag { font-weight: 500; text-transform: none; letter-spacing: 0; }
.xlist { display: flex; flex-direction: column; gap: 10px; }
.xcard {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-frame);
}
.xname { font-family: var(--font-heading); font-weight: 600; overflow-wrap: anywhere; }
/* Próximos exámenes en los ajustes: filas compactas (16/11/26, opción 2A). */
.xrows { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.xrow { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border-subtle); }
.xday {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: var(--radius-control);
  line-height: 1.1;
}
.xday b { font-family: var(--font-heading); font-size: 18px; }
.xday span { font-size: 12px; font-weight: 700; }
.xrow-text { display: flex; flex: 1 1 auto; flex-direction: column; min-width: 0; }
.xrow .xname { font-size: 15px; line-height: 1.3; }
.xrow .xwhen { font-size: 14px; color: var(--text-muted); }
/* Filas de «Mis exámenes» y de los próximos exámenes del planning (16/11/26): el cuadradito de la fecha con el fondo suave y el borde del tono de la asignatura
   (como los días del calendario; sin tono, gris) y el número en el color del texto, para que se lea en todos los tonos. */
.xday.tone {
  color: var(--text);
  background: var(--subject-soft, var(--surface));
  border: 2px solid var(--subject, var(--border-control));
  box-sizing: border-box;
}
/* «Sin nota» en un examen pasado de «Mi agenda» (design-system.md, «Fila de lista»; TA-08, 18/11/26). */
.xnoscore { color: var(--status-attention); font-weight: 600; }
.xrow .xcontent { font-size: 14px; color: var(--text-muted); overflow-wrap: anywhere; }
/* «Mi agenda» (TA-13): etiqueta del tipo delante del título de la fila y en las sesiones del planning. */
.xtag {
  align-self: flex-start;
  margin-bottom: 2px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.02em;
  color: var(--text);
  background: var(--subject-soft, var(--surface));
  border-radius: 999px;
}
.xtag.exam { background: var(--status-review-soft); }
/* Tiempo de preparación: la caja de − valor + de la duración de la sesión, en una fila. */
.dur.prep { display: flex; align-items: center; gap: 6px; max-width: 20rem; }
.dur.prep .dur-val { flex: 1 1 auto; }
.xlink { display: inline-block; align-self: flex-start; font-size: 15px; font-weight: 600; color: var(--accent); text-underline-offset: 3px; }
.xwhen { font-size: 15px; font-variant-numeric: tabular-nums; }
.xactions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.xempty { padding: 14px; font-size: 15px; color: var(--text-muted); border: 1px dashed var(--border-control); border-radius: var(--radius-frame); }
.btn.xadd { margin-top: 12px; }
.xcount { align-self: flex-end; font-size: 13px; }
.daybtns { display: grid; grid-template-columns: repeat(7, minmax(36px, 1fr)); gap: 4px; }
.daybtn {
  min-height: 44px;
  padding: 0;
  font: inherit;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border-control);
  border-radius: var(--radius-control);
  cursor: pointer;
}
.daybtn:hover { background: var(--hover-overlay); }
.daybtn:active { background: var(--pressed-overlay); }
.daybtn[aria-pressed="true"] { font-weight: 700; color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
.field.err .daybtn { border-color: var(--status-review); }
.xtimes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.xtimes .field { margin: 0; }
@media (max-width: 340px) { .xtimes { grid-template-columns: minmax(0, 1fr); } }
.xtravel {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 52px;
  align-items: center;
  gap: 6px;
  padding: 6px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  background: var(--accent-soft);
  border-radius: var(--radius-frame);
}
.xtravel button {
  min-height: 44px;
  padding: 0;
  font: inherit;
  font-size: 22px;
  color: var(--text);
  background: var(--bg);
  border: 0;
  border-radius: var(--radius-control);
  cursor: pointer;
}
.xtravel button:disabled { opacity: 0.45; cursor: not-allowed; }

/* Extraescolar en el planning: recuadro discontinuo con la actividad y su hora; no se mueve. */
.pextra {
  display: flex;
  flex-direction: column;
  padding: 8px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--text);
  background: var(--surface);
  border: 1px dashed var(--text-muted);
  border-radius: 6px;
  overflow-wrap: anywhere;
}
.pextra-name { font-family: var(--font-heading); font-size: 15px; font-weight: 500; }
.pextra small { font-size: 13px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.day-late { font-size: 13px; font-weight: 700; color: var(--status-attention); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* Planning en PDF (se rellena al pulsar «Descargar PDF» y solo se ve al imprimir).
   Tema fijo y neutro: blanco, texto oscuro y color solo en la barra de cada asignatura. */
#print-sheet { position: absolute; left: -10000px; top: 0; width: 277mm; color: #1f2328; background: #fff; }
.pdf-page {
  display: flex;
  flex-direction: column;
  /* Hoja A4 horizontal sin los márgenes (@page): 297 − 2 × 10 mm de ancho y 210 − 2 × 12 mm de alto. */
  width: 277mm;
  height: 186mm;
  padding: 0;
  overflow: hidden;
  background: #fff;
  color: #1f2328;
  font-family: var(--font-body);
  font-size: 8pt;
  line-height: 1.25;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
/* Hoja semanal nueva (17/11/26, design-system.md, «Planning en PDF»): franja gris, días con su total,
   columnas alternas, casilla en cada sesión, examen en una línea, «Notas» con el QR y pie sin línea. */
.pdf-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6mm;
  flex: none;
  box-sizing: border-box;
  height: 14mm;
  padding: 0 5mm;
  background: #e4e6ea;
  color: #1f2328;
}
.pdf-band-left { display: flex; align-items: baseline; gap: 4mm; min-width: 0; overflow: hidden; white-space: nowrap; }
.pdf-title { font-family: var(--font-heading); font-size: 18pt; font-weight: 700; line-height: 1.1; }
.pdf-band-tight .pdf-title { font-size: 13pt; }
.pdf-hours { font-size: 10pt; }
.pdf-band-right { display: flex; flex-direction: column; align-items: flex-end; flex: none; }
.pdf-brand { font-family: var(--font-heading); font-size: 11pt; font-weight: 700; }
.pdf-meta { font-size: 8pt; }
.pdf-days-head { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); flex: none; box-sizing: border-box; height: 8mm; border-bottom: 0.4mm solid #1f2328; }
.pdf-day-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1mm; min-width: 0; padding: 0 0.8mm 1mm; }
.pdf-day-name { font-family: var(--font-heading); font-size: 8pt; font-weight: 700; letter-spacing: 0.06em; white-space: nowrap; }
.pdf-day-total { font-size: 8pt; color: #5f6670; white-space: nowrap; }
.pdf-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); flex: 1; min-height: 0; align-content: stretch; }
.pdf-day { min-width: 0; padding: 1.3mm 0.8mm 0; }
.pdf-day:nth-child(even) { background: #f6f7f8; }
.pdf-session {
  position: relative;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  margin-bottom: 1mm;
  background: #fff;
  border: 0.3mm solid #868d95;
  border-left: 3mm solid var(--pdf-color);
  border-radius: 1mm;
  overflow: hidden;
}
.pdf-check {
  position: absolute;
  right: 1.2mm;
  bottom: 1.2mm;
  box-sizing: border-box;
  width: 3mm;
  height: 3mm;
  background: #fff;
  border: 0.3mm solid #1f2328;
  border-radius: 0.5mm;
}
.pdf-session-head { flex: none; height: 9mm; padding: 1mm 1.5mm 0; }
.pdf-name {
  font-family: var(--font-heading);
  font-size: 9pt;
  font-weight: 700;
  line-height: 3.6mm;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pdf-time { font-size: 8pt; line-height: 3.4mm; white-space: nowrap; }
.pdf-lines { margin: 0 2mm; }
.pdf-lines span {
  display: block;
  background-image: repeating-linear-gradient(to right, #5f6670 0 2mm, transparent 2mm 3.2mm);
  background-repeat: no-repeat;
  background-size: 100% 0.25mm;
  background-position: bottom;
}
.pdf-extra {
  box-sizing: border-box;
  margin-bottom: 1mm;
  padding: 1mm 1.5mm;
  background: #fff;
  border: 0.3mm dashed #868d95;
  border-radius: 1mm;
  overflow: hidden;
}
.pdf-extra-name { font-family: var(--font-heading); font-size: 9pt; font-weight: 700; line-height: 3.6mm; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pdf-extra-travel { font-size: 7pt; line-height: 3mm; color: #5f6670; white-space: nowrap; }
.pdf-late { height: 4mm; font-size: 7pt; font-weight: 700; line-height: 4mm; color: #8f5c00; }
/* Día del examen en el PDF (una línea desde el 17/11/26): fondo rojo claro con la campana, «Examen» y la asignatura. */
.pdf-exam {
  display: flex;
  align-items: center;
  gap: 1mm;
  box-sizing: border-box;
  margin-bottom: 1mm;
  padding: 0 1.5mm;
  overflow: hidden;
  background: #fde6dd;
  border: 0.3mm solid #b23c25;
  border-radius: 1mm;
  font-size: 8pt;
  white-space: nowrap;
}
.pdf-exam svg { flex: none; width: 3.2mm; height: 3.2mm; fill: none; stroke: #1f2328; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pdf-exam-word { flex: none; font-weight: 700; }
.pdf-exam.pdf-delivery-mark { background: var(--pdf-soft); border-color: var(--pdf-color); }
.pdf-exam-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.pdf-free {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  background: #fff;
  border: 0.3mm dashed #868d95;
  border-radius: 1mm;
  color: #5f6670;
  font-size: 8pt;
}
.pdf-notes {
  display: flex;
  gap: 4mm;
  flex: none;
  box-sizing: border-box;
  height: 24mm;
  margin-top: 2mm;
  padding: 2mm 3mm;
  background: #fff;
  border: 0.3mm solid #868d95;
}
.pdf-notes-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pdf-notes-label { font-size: 9pt; color: #5f6670; }
.pdf-notes .pdf-lines { margin: 0; }
.pdf-notes-line { height: 4.5mm; }
.pdf-qr { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.6mm; flex: none; }
.pdf-qr svg { display: block; width: 15mm; height: 15mm; }
.pdf-qr-url { font-family: var(--font-heading); font-size: 9pt; font-weight: 700; line-height: 1; }
.pdf-footer {
  display: flex;
  align-items: center;
  gap: 6mm;
  flex: none;
  height: 7mm;
}
.pdf-check-note { flex: none; font-size: 8pt; color: #5f6670; }
/* Plan mensual (17/11/26): cuadrícula del mes, una fila por semana con fondos alternos. */
.pdf-mgrid { display: flex; flex-direction: column; flex: none; }
.pdf-mrow { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); box-sizing: border-box; }
.pdf-mrow:nth-child(even) { background: #f6f7f8; }
.pdf-mday { display: flex; flex-direction: column; gap: 0.8mm; min-width: 0; box-sizing: border-box; padding: 1.6mm; overflow: hidden; }
.pdf-mday-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1mm; flex: none; height: 3.7mm; }
.pdf-mday-num { font-family: var(--font-heading); font-size: 10pt; font-weight: 700; line-height: 1; }
.pdf-mday-out .pdf-mday-num { color: #868d95; }
.pdf-mday-total { font-size: 8pt; color: #5f6670; white-space: nowrap; }
.pdf-mark {
  display: flex;
  align-items: center;
  gap: 1mm;
  flex: none;
  box-sizing: border-box;
  height: 4.8mm;
  padding: 0 1.5mm;
  overflow: hidden;
  background: var(--pdf-soft, #f6f7f8);
  border: 0.3mm solid var(--pdf-color, #868d95);
  border-radius: 1mm;
  font-size: 8pt;
  white-space: nowrap;
}
.pdf-mark-exam { background: #fde6dd; border-color: #b23c25; }
.pdf-mark-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.pdf-mline { display: flex; align-items: center; gap: 1.2mm; flex: none; height: 3.7mm; font-size: 8pt; white-space: nowrap; }
.pdf-mline-bar { flex: none; width: 0.8mm; height: 3.4mm; background: var(--pdf-color); }
.pdf-mline-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 700; }
.pdf-mline-min { flex: none; color: #5f6670; }
.pdf-mmore { flex: none; height: 3.7mm; font-size: 8pt; color: #5f6670; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pdf-mfree { flex: 1; min-height: 5mm; }
.pdf-notes.pdf-mnotes { height: auto; margin: 1.6mm 0 0; }
.pdf-phrase { flex: 1; margin: 0; font-size: 8pt; line-height: 1.25; }
.pdf-icons { display: flex; gap: 4mm; flex: none; }
.pdf-icon { display: flex; align-items: center; gap: 1.5mm; font-size: 8pt; }
.pdf-icon svg { width: 5mm; height: 5mm; fill: none; stroke: #1f2328; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Márgenes de la hoja en el propio PDF (11/11/26): si Chrome pone los suyos («Mínimo», «Predeterminado»), la semana
   sigue cabiendo en una página, porque está pensada para el hueco que dejan estos. */
@page { size: A4 landscape; margin: 12mm 10mm; }
@media print {
  html, body { background: #fff !important; }
  body > *:not(#print-sheet) { display: none !important; }
  #print-sheet { position: static; width: auto; }
  .pdf-page { break-after: page; }
  .pdf-page:last-child { break-after: auto; }
}

/* Apartados con cuenta (TA-30, 17/11/26; design-system.md, «Barra de apartados»): Hoy · Planning · Mi agenda · Mi perfil.
   En el ordenador (860 o más), en la cabecera; en móvil, barra fija abajo de 56 (más el margen seguro). */
.appnav[hidden] { display: none; }
.appnav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  border-radius: var(--radius-control);
}
.appnav a svg { flex: none; width: 20px; height: 20px; }
.appnav a[aria-current="page"] { color: var(--accent); font-weight: 700; }
.appnav a[aria-current="page"]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: 3px; background: var(--accent); }
.appnav a:hover { background: var(--hover-overlay); }
.appnav a:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--border-control); }
@media (min-width: 860px) {
  .appnav { display: flex; gap: 8px; margin-left: auto; }
  .top .wrap:has(> .appnav:not([hidden])) .top-actions, .top .wrap:has(> .appnav:not([hidden])) > #account-button { margin-left: 8px; }
}
@media (max-width: 859px) {
  .appnav {
    position: fixed;
    z-index: 45;
    left: 0;
    right: 0;
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
    background: var(--bg);
    border-top: 1px solid var(--border-subtle);
  }
  .appnav a { flex-direction: column; justify-content: center; gap: 2px; min-height: 56px; padding: 0 2px; font-size: 12px; color: var(--text-muted); border-radius: 0; }
  .appnav a svg { width: 22px; height: 22px; }
  .appnav a[aria-current="page"]::after { top: 0; bottom: auto; left: 18%; right: 18%; }
  body.has-appnav { padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px)); }
  /* Las barras fijas de cada página van encima de los apartados. */
  body.has-appnav .update-bar, body.has-appnav .today-bar { bottom: calc(56px + env(safe-area-inset-bottom, 0px)); padding-bottom: 12px; }
  body.has-appnav .toast { bottom: calc(56px + 16px + env(safe-area-inset-bottom, 0px)); }
}

/* Botón de cuenta con la inicial (TA-30): círculo de 44 con la primera letra del alias. */
.top #account-button.initial {
  display: inline-grid;
  place-content: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  font-size: 18px;
  color: var(--text);
  background: var(--accent-soft);
  border-color: var(--border-control);
  border-radius: 50%;
}
.top #account-button.initial[aria-expanded="true"] { border-color: var(--accent); background: var(--accent-soft); }

/* Recuadro de lo que se comparte («Qué verán tus tutores»; ventajas de la cuenta familiar en «¿Has olvidado tu acceso?»). Grupo Familiar. */
.share-box { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; font-size: 15px; background: var(--surface); border-radius: var(--radius-control); }
.share-box ul { display: flex; flex-direction: column; gap: 2px; margin: 0; padding-left: 20px; }

/* Lista de pasos con el número de paso (design-system.md, «Número de paso»; TA-72 y TA-73): «Cómo empieza tu
   estudiante» y «Cómo empezar» de «Hoy». */
.steps { display: flex; flex-direction: column; gap: 14px; margin: 0; padding: 0; list-style: none; }
.steps li { display: flex; align-items: flex-start; gap: 12px; }
.step-num {
  display: grid;
  flex: none;
  place-items: center;
  width: 30px;
  height: 30px;
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  color: var(--on-accent);
  background: var(--accent);
  border-radius: 50%;
}
.step-text { display: flex; flex-direction: column; gap: 2px; padding-top: 3px; }
.step-name { font-size: 16px; font-weight: 700; }
.step-help { font-size: 14px; color: var(--text-muted); }
