/* ==========================================================================
   Disco Linguam · Hoja de estilos (rediseño 2026-10-10)
   Identidad: azul lapislázuli (del logotipo Polyglottas), papel, oro de
   laurel para los logros y rojo de rúbrica para los errores.
   Tipografía: serifa clásica para el latín y los títulos; sans del sistema
   para la interfaz. Sin fuentes externas (la CSP del servidor solo admite
   recursos propios); las pilas elegidas cubren macrones (ā ē ī ō ū) y
   griego politónico (ἄλφα) en Windows, macOS, Android e iOS.
   ========================================================================== */

:root {
  color-scheme: light;

  /* Color */
  --bg: #f4f3ef;
  --bg-deep: #ebe9e2;
  --surface: #ffffff;
  --surface-soft: #f9f8f5;
  --surface-sunk: #f1f0eb;
  --ink: #1b2233;
  --ink-soft: #4a5366;
  --muted: #687084;
  --line: #e1dfd7;
  --line-strong: #cdcac0;

  --lapis: #1f4380;
  --lapis-strong: #16305e;
  --lapis-soft: #e8eef8;
  --lapis-ink: #ffffff;
  --sky: #0a9fd8;
  --focus: #0a8fc4;

  --gold: #a87b22;
  --gold-bright: #c99a38;
  --gold-soft: #f7efdc;
  --rubric: #a6332b;
  --rubric-soft: #f9e7e4;
  --ok: #2b6a4b;
  --ok-soft: #e3f1e9;
  --warn: #7a5300;
  --warn-soft: #fbf0d6;

  --nav-bg: #12264a;
  --nav-bg-2: #0e1f3d;
  --nav-ink: #c9d4e8;
  --nav-ink-strong: #ffffff;
  --nav-hover: rgba(255, 255, 255, 0.07);
  --nav-active: rgba(201, 154, 56, 0.16);
  --nav-title: #8aa0c4;

  /* Tipografía */
  --font-serif: "Palatino Linotype", "Book Antiqua", Palatino, "URW Palladio L", "P052", "EB Garamond", "Noto Serif", Georgia, serif;
  --font-sans: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;

  --step--1: 0.8125rem;
  --step-0: 0.9375rem;
  --step-1: 1.125rem;
  --step-2: 1.4rem;
  --step-3: 1.85rem;
  --step-4: clamp(1.85rem, 1.4rem + 1.6vw, 2.5rem);

  /* Espacio y forma */
  --radius-s: 6px;
  --radius: 10px;
  --radius-l: 16px;
  --shadow-1: 0 1px 2px rgba(22, 32, 54, 0.06), 0 1px 1px rgba(22, 32, 54, 0.04);
  --shadow-2: 0 10px 30px -12px rgba(22, 32, 54, 0.22), 0 2px 6px rgba(22, 32, 54, 0.06);
  --topbar-h: 64px;
  --sidebar-w: 248px;

  font-family: var(--font-sans);
  font-size: 100%;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0f1421;
    --bg-deep: #0b0f1a;
    --surface: #171e2e;
    --surface-soft: #1b2335;
    --surface-sunk: #131a28;
    --ink: #e6e9f0;
    --ink-soft: #c2c8d6;
    --muted: #98a1b5;
    --line: #2a3347;
    --line-strong: #3a455d;
    --lapis: #7fa7ec;
    --lapis-strong: #a7c3f3;
    --lapis-soft: #1d2a45;
    --lapis-ink: #0d1424;
    --sky: #4cc3f0;
    --focus: #4cc3f0;
    --gold: #dcb35c;
    --gold-bright: #e6c375;
    --gold-soft: #2e2716;
    --rubric: #f08a80;
    --rubric-soft: #3a1e1d;
    --ok: #7fd0a5;
    --ok-soft: #173126;
    --warn: #e9c46a;
    --warn-soft: #33290f;
    --nav-bg: #0c1426;
    --nav-bg-2: #091020;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-2: 0 14px 34px -14px rgba(0, 0, 0, 0.7), 0 2px 6px rgba(0, 0, 0, 0.3);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1421;
  --bg-deep: #0b0f1a;
  --surface: #171e2e;
  --surface-soft: #1b2335;
  --surface-sunk: #131a28;
  --ink: #e6e9f0;
  --ink-soft: #c2c8d6;
  --muted: #98a1b5;
  --line: #2a3347;
  --line-strong: #3a455d;
  --lapis: #7fa7ec;
  --lapis-strong: #a7c3f3;
  --lapis-soft: #1d2a45;
  --lapis-ink: #0d1424;
  --sky: #4cc3f0;
  --focus: #4cc3f0;
  --gold: #dcb35c;
  --gold-bright: #e6c375;
  --gold-soft: #2e2716;
  --rubric: #f08a80;
  --rubric-soft: #3a1e1d;
  --ok: #7fd0a5;
  --ok-soft: #173126;
  --warn: #e9c46a;
  --warn-soft: #33290f;
  --nav-bg: #0c1426;
  --nav-bg-2: #091020;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 14px 34px -14px rgba(0, 0, 0, 0.7), 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-size: var(--step-0);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
/* Protección de contenidos: se conserva el comportamiento original. */
body *:not(input):not(textarea):not(select):not(option) { -webkit-user-select: none; user-select: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }
a { color: var(--lapis); }
.hidden { display: none !important; }
[hidden] { display: none !important; }
h1, h2, h3, h4, h5, p { margin-top: 0; }
h1, h2, h3 { text-wrap: balance; }
kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 1px 6px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--surface-soft);
  font-family: var(--font-sans);
  font-size: 0.85em;
  text-align: center;
}

.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -0.2em;
}
.icon .icon-fill, .icon-fill { fill: currentColor; stroke: none; }

.skip-link {
  position: absolute;
  top: -100px;
  left: 12px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: var(--radius-s);
  background: var(--lapis);
  color: var(--lapis-ink);
  font-weight: 700;
}
.skip-link:focus { top: 12px; }

#vocabularyView { -webkit-user-select: none; user-select: none; }
#vocabularyView input, #vocabularyView select, #vocabularyView button { -webkit-user-select: auto; user-select: auto; }
#modulesView { -webkit-user-select: none; user-select: none; }
#modulesView select, #modulesView button { -webkit-user-select: auto; user-select: auto; }
#learningView { -webkit-user-select: none; user-select: none; }
#learningView button, #learningView select { -webkit-user-select: auto; user-select: auto; }

@media print {
  #vocabularyView { display: none !important; }
}

/* Foco visible y accesible */
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 0; }

/* --------------------------------------------------------------------------
   Formularios y botones
   -------------------------------------------------------------------------- */
label { display: grid; gap: 6px; margin-bottom: 16px; color: var(--ink-soft); font-size: var(--step--1); font-weight: 650; }
input, select, textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-s);
  background: var(--surface);
  padding: 9px 12px;
  color: var(--ink);
  font-size: var(--step-0);
  font-weight: 400;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input::placeholder { color: var(--muted); opacity: 0.85; }
textarea { resize: vertical; }
input:hover, select:hover { border-color: var(--muted); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--lapis); box-shadow: 0 0 0 3px color-mix(in srgb, var(--lapis) 22%, transparent); }
input[type="checkbox"] { width: 18px; height: 18px; min-height: 0; margin: 0; padding: 0; accent-color: var(--lapis); }
input[type="file"] { padding: 8px; background: var(--surface-soft); }
input[type="file"]::file-selector-button {
  margin-right: 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-s);
  padding: 6px 12px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 650;
  cursor: pointer;
}

.primary, .secondary, .remember-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-s);
  padding: 9px 18px;
  font-weight: 700;
  text-decoration: none;
  line-height: 1.2;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}
.primary { border: 1px solid var(--lapis); color: var(--lapis-ink); background: var(--lapis); }
.primary:hover:not(:disabled) { border-color: var(--lapis-strong); background: var(--lapis-strong); }
.secondary { border: 1px solid var(--line-strong); color: var(--ink); background: var(--surface); }
.secondary:hover:not(:disabled) { border-color: var(--lapis); color: var(--lapis); background: var(--lapis-soft); }
.primary:active:not(:disabled), .secondary:active:not(:disabled), .remember-button:active:not(:disabled) { transform: translateY(1px); }
.full-width { width: 100%; }
.link-button {
  display: block;
  margin: 14px auto 0;
  border: 0;
  padding: 6px 4px;
  background: none;
  color: var(--lapis);
  font-weight: 650;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--lapis) 35%, transparent);
  text-underline-offset: 3px;
}
.link-button:hover { text-decoration-color: currentColor; }
button:disabled { cursor: not-allowed; opacity: 0.45; }

.icon-button {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  flex: none;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-s);
  padding: 0;
  background: var(--surface);
  color: var(--ink);
  font-size: 1.15rem;
}
.icon-button:hover:not(:disabled) { border-color: var(--lapis); color: var(--lapis); background: var(--lapis-soft); }
.icon-button .icon { width: 20px; height: 20px; }

/* Mensajes: se muestran como avisos solo cuando tienen texto. */
.message { min-height: 0; margin: 12px 0 0; font-size: var(--step--1); line-height: 1.45; }
.message:empty { display: none; }
.message.error, .message.success {
  padding: 10px 14px;
  border-radius: var(--radius-s);
  border: 1px solid transparent;
}
.message.error { color: var(--rubric); background: var(--rubric-soft); border-color: color-mix(in srgb, var(--rubric) 30%, transparent); }
.message.success { color: var(--ok); background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 28%, transparent); }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 6px;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.eyebrow:empty { display: none; }

/* --------------------------------------------------------------------------
   Acceso (login, verificación, recuperación, instalación)
   -------------------------------------------------------------------------- */
.login-view {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  background: var(--bg);
}
.login-aside {
  position: relative;
  display: grid;
  align-items: center;
  padding: 56px clamp(32px, 5vw, 72px);
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(10, 159, 216, 0.22), transparent 55%),
    linear-gradient(160deg, #1b3a72 0%, #12264a 55%, #0b1830 100%);
  color: #e8eefb;
}
.login-aside::before {
  /* Octógono inspirado en el sello de Polyglottas */
  content: "";
  position: absolute;
  top: -12%;
  right: -14%;
  width: 70%;
  aspect-ratio: 1;
  border: 2px solid rgba(255, 255, 255, 0.1);
  clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%);
  background: linear-gradient(140deg, rgba(10, 159, 216, 0.22), rgba(10, 159, 216, 0.02));
}
.login-aside-inner { position: relative; max-width: 30rem; }
.login-motto {
  margin: 0 0 12px;
  font-family: var(--font-serif);
  font-size: clamp(2rem, 1.3rem + 2.4vw, 3.1rem);
  line-height: 1.12;
  font-variant: small-caps;
  letter-spacing: 0.03em;
}
.login-motto-source { margin: 0 0 40px; color: #b8c6e2; font-size: var(--step--1); }
.login-features { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.login-features li { display: flex; align-items: center; gap: 12px; color: #dbe4f5; }
.login-features .icon { width: 22px; height: 22px; color: var(--gold-bright); }

.login-panel {
  width: min(460px, 100%);
  align-self: center;
  justify-self: center;
  padding: 48px 28px;
}
.login-brand { display: flex; align-items: center; gap: 16px; margin-bottom: 30px; }
.logo { width: 116px; height: 116px; display: block; flex: none; object-fit: contain; border-radius: 14px; }
.login-brand h1 {
  margin: 0 0 4px;
  font-family: var(--font-serif);
  font-size: 2.15rem;
  font-weight: 500;
  font-variant: small-caps;
  letter-spacing: 0.02em;
  line-height: 1.1;
}
.intro { margin: 0; color: var(--muted); font-size: var(--step--1); line-height: 1.5; }
.intro a { font-weight: 700; }
.auth-form h2, .setup-form h2 {
  margin-bottom: 20px;
  font-family: var(--font-serif);
  font-size: var(--step-3);
  font-weight: 500;
  line-height: 1.15;
}
.auth-form .full-width + .full-width { margin-top: 10px; }
.setup-form { margin-top: 26px; padding-top: 26px; border-top: 1px solid var(--line); }
#loginForm + .setup-form, .login-brand + .setup-form { margin-top: 0; padding-top: 0; border-top: 0; }
.setup-divider { display: none; }
.mfa-hint { margin: 0 0 18px; color: var(--muted); font-size: var(--step--1); line-height: 1.5; }
.code-input { font-size: 1.5rem; font-variant-numeric: tabular-nums; letter-spacing: 0.4em; text-align: center; }
.guest-hint { margin: 22px 0 0; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: var(--step--1); line-height: 1.45; text-align: center; }
.auth-choice { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 22px; border: 1px solid var(--line); border-radius: var(--radius-s); }
.auth-choice-button { min-height: 40px; border: 0; background: var(--surface); color: var(--muted); font-weight: 700; }
.auth-choice-button.active { background: var(--lapis-soft); color: var(--lapis); }

/* --------------------------------------------------------------------------
   Estructura de la aplicación
   -------------------------------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
}
.brand-lockup { display: flex; align-items: center; gap: 12px; min-width: 0; margin-right: auto; }
.brand-lockup img { width: 40px; height: 40px; object-fit: contain; border-radius: 8px; }
.brand-lockup div { display: grid; min-width: 0; line-height: 1.15; }
.brand-lockup strong { font-family: var(--font-serif); font-size: 1.3rem; font-weight: 600; font-variant: small-caps; letter-spacing: 0.03em; }
.brand-lockup span { color: var(--muted); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; }
.session-actions { display: flex; align-items: center; gap: 10px; }
.session-user { display: inline-flex; align-items: center; gap: 7px; max-width: 220px; padding: 6px 12px; border-radius: 999px; background: var(--surface-sunk); color: var(--ink-soft); font-size: var(--step--1); font-weight: 600; }
.session-user > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session-user:has(#sessionName:empty) { display: none; }
.logout-button { width: auto; gap: 6px; padding: 0 12px; font-size: var(--step--1); font-weight: 650; display: inline-flex; align-items: center; }
.preview-button { min-height: 40px; padding: 7px 14px; font-size: var(--step--1); }
.preview-level { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--muted); }
.preview-level select { width: auto; min-height: 40px; padding: 6px 30px 6px 10px; font-weight: 650; }

.session-notice {
  margin: 0;
  padding: 11px 24px;
  border-bottom: 1px solid color-mix(in srgb, var(--gold) 35%, transparent);
  background: var(--gold-soft);
  color: var(--warn);
  font-size: var(--step--1);
  font-weight: 600;
  text-align: center;
}

.layout { min-height: calc(100vh - var(--topbar-h)); display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
.sidebar {
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  padding: 14px 12px 16px;
  background: linear-gradient(180deg, var(--nav-bg) 0%, var(--nav-bg-2) 100%);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}
.nav-group-title {
  margin: 16px 12px 6px;
  color: var(--nav-title);
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.nav-group-title:first-of-type { margin-top: 4px; }
.nav-item {
  position: relative;
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  color: var(--nav-ink);
  background: transparent;
  font-size: 0.92rem;
  font-weight: 550;
  text-align: left;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.nav-item .icon { width: 19px; height: 19px; opacity: 0.85; }
.nav-item > span:not(.glyph-icon) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .nav-external { width: 14px; height: 14px; margin-left: auto; opacity: 0.5; }
.glyph-icon { width: 19px; flex: none; font-family: var(--font-serif); font-size: 1.08rem; line-height: 1; text-align: center; }
.nav-item:hover { background: var(--nav-hover); color: var(--nav-ink-strong); }
.nav-item.active { background: var(--nav-active); color: var(--nav-ink-strong); }
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--gold-bright);
}
.nav-item.active .icon, .nav-item.active .glyph-icon { color: var(--gold-bright); opacity: 1; }
.nav-item:focus-visible { outline-color: var(--gold-bright); outline-offset: -2px; }
.theme-toggle .theme-icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .theme-icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .theme-icon-moon { display: none; }

.content { min-width: 0; padding: 36px clamp(16px, 3vw, 44px) 64px; outline: none; }
.page-view { width: min(1120px, 100%); margin: 0 auto; animation: view-in 0.22s ease both; }
@keyframes view-in { from { opacity: 0.4; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.page-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 26px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.page-heading h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: var(--step-4);
  font-weight: 500;
  line-height: 1.1;
}
.role-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid color-mix(in srgb, var(--lapis) 30%, transparent);
  border-radius: 999px;
  padding: 3px 12px;
  background: var(--lapis-soft);
  color: var(--lapis);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.role-badge:empty { display: none; }

/* --------------------------------------------------------------------------
   Resumen
   -------------------------------------------------------------------------- */
.home-overview { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; }
.progress-hero {
  display: flex;
  align-items: center;
  gap: 26px;
  padding: 26px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background:
    radial-gradient(90% 120% at 100% 0%, color-mix(in srgb, var(--sky) 10%, transparent), transparent 60%),
    var(--surface);
  box-shadow: var(--shadow-1);
}
.progress-ring { width: 128px; height: 128px; flex: none; transform: rotate(-90deg); }
.progress-ring circle { fill: none; stroke-width: 10; }
.progress-ring-track { stroke: var(--surface-sunk); }
.progress-ring-value { stroke: var(--gold-bright); stroke-linecap: round; transition: stroke-dashoffset 0.8s cubic-bezier(0.2, 0.7, 0.2, 1); }
.progress-hero-copy { display: grid; gap: 4px; min-width: 0; }
.progress-hero-copy span { color: var(--muted); font-size: var(--step--1); font-weight: 650; letter-spacing: 0.02em; }
.progress-hero-copy strong { font-family: var(--font-serif); font-size: clamp(2.4rem, 2rem + 1.5vw, 3.2rem); font-weight: 500; line-height: 1; font-variant-numeric: tabular-nums; }
.progress-hero-copy small { color: var(--muted); line-height: 1.45; }
.summary-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.metric {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 14px;
  align-items: center;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background: var(--surface);
  box-shadow: var(--shadow-1);
}
.metric .icon {
  grid-row: 1 / 3;
  width: 44px;
  height: 44px;
  padding: 11px;
  border-radius: 12px;
  background: var(--lapis-soft);
  color: var(--lapis);
}
.metric-gold .icon { background: var(--gold-soft); color: var(--gold); }
.metric span { color: var(--muted); font-size: var(--step--1); font-weight: 600; }
.metric strong { font-family: var(--font-serif); font-size: 2rem; font-weight: 500; line-height: 1.1; font-variant-numeric: tabular-nums; }

.quick-links { margin-top: 30px; }
.quick-links h3 { margin-bottom: 14px; font-family: var(--font-serif); font-size: var(--step-2); font-weight: 500; }
.quick-link-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.quick-link {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 12px;
  row-gap: 2px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.quick-link .icon { grid-row: 1 / 3; width: 24px; height: 24px; color: var(--lapis); }
.quick-link strong { font-size: var(--step-0); }
.quick-link small { color: var(--muted); font-size: 0.8rem; line-height: 1.35; }
.quick-link:hover { border-color: var(--lapis); box-shadow: var(--shadow-2); transform: translateY(-1px); }

.notice { margin-top: 18px; padding: 14px 16px; border-left: 3px solid var(--gold); background: var(--gold-soft); }
.password-panel { margin-top: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.password-panel summary { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 18px; cursor: pointer; font-weight: 700; list-style: none; }
.password-panel summary::-webkit-details-marker { display: none; }
.password-panel summary::before { content: "›"; display: inline-block; width: 1em; color: var(--muted); font-size: 1.3rem; line-height: 1; transition: transform 0.15s ease; }
.password-panel[open] summary::before { transform: rotate(90deg); }
.password-panel .message { margin: 0 18px 16px; }
.compact-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; padding: 0 18px 18px; }

/* --------------------------------------------------------------------------
   Gramática y cuadros (índice lateral + documento)
   -------------------------------------------------------------------------- */
.grammar-layout { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 22px; align-items: start; }
/* Cuadros: el selector va arriba y el cuadro ocupa todo el ancho (los modelos
   verbales de Latín II tienen tablas amplias). */
.reference-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.reference-index.reference-index { position: static; max-height: none; flex-direction: row; flex-wrap: wrap; align-items: end; gap: 10px 16px; padding: 14px 16px; background: var(--surface-soft); }
.reference-index.reference-index > label { flex: 0 1 340px; padding: 0; border: 0; background: transparent; }
.reference-list.reference-list { display: flex; flex: 1 1 320px; flex-wrap: wrap; gap: 6px; padding: 0; overflow: visible; }
.reference-list.reference-list button { width: auto; border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; background: var(--surface); }
.reference-list.reference-list button.active { border-color: var(--lapis); }
.reference-list.reference-list:has(button:only-child) { display: none; }
.grammar-index, .reference-index {
  position: sticky;
  top: calc(var(--topbar-h) + 18px);
  max-height: calc(100vh - var(--topbar-h) - 40px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.grammar-index > label, .reference-index > label { margin: 0; padding: 14px; border-bottom: 1px solid var(--line); background: var(--surface-soft); }
.grammar-lesson-list, .reference-list { overflow-y: auto; padding: 6px; scrollbar-width: thin; }
.grammar-lesson-list button, .reference-list button {
  width: 100%;
  display: block;
  border: 0;
  border-radius: var(--radius-s);
  padding: 10px 12px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.35;
  text-align: left;
}
.grammar-lesson-list button:hover, .reference-list button:hover { background: var(--surface-sunk); color: var(--ink); }
.grammar-lesson-list button.active, .reference-list button.active { background: var(--lapis-soft); color: var(--lapis); font-weight: 700; }

.grammar-content, .reference-content, .program-content {
  min-width: 0;
  padding: clamp(22px, 3vw, 40px) clamp(20px, 3.4vw, 48px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-1);
}
.grammar-content, .reference-content { min-height: 520px; }
.grammar-content h3, .reference-content h3, .program-content h3 {
  margin-bottom: 18px;
  font-family: var(--font-serif);
  font-size: var(--step-3);
  font-weight: 500;
  line-height: 1.15;
}
.grammar-content h4 { margin: 26px 0 10px; font-size: var(--step-1); }
.grammar-content h5 { margin: 18px 0 8px; color: var(--lapis); font-size: 0.95rem; }
.grammar-content p, .grammar-content li { max-width: 70ch; font-family: var(--font-serif); font-size: 1.06rem; line-height: 1.7; }
.grammar-content p { margin-bottom: 14px; }
.grammar-content li { margin-bottom: 8px; }
.grammar-exercises { margin-top: 32px; padding: 22px 24px; border: 1px solid color-mix(in srgb, var(--gold) 35%, transparent); border-radius: var(--radius); background: var(--gold-soft); }
.grammar-exercises h4 { margin: 0 0 12px; color: var(--gold); font-family: var(--font-sans); font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; }
.grammar-exercises ol { margin: 0; padding-left: 1.4rem; }
.grammar-exercises li::marker { color: var(--gold); font-family: var(--font-sans); font-weight: 700; font-size: 0.9em; }

.reference-content > p:not(.eyebrow) { margin: 0 0 20px; color: var(--muted); line-height: 1.6; }
.reference-content > p:not(.eyebrow):empty { display: none; }
.reference-table-wrap h4 { margin: 0 0 10px; color: var(--lapis); font-size: var(--step-0); }

/* Tablas morfológicas */
.grammar-table-wrap, .reference-table-wrap { width: 100%; max-width: 100%; margin: 24px 0; overflow-x: auto; scrollbar-width: thin; }
.grammar-table, .reference-table {
  min-width: 100%;
  width: max-content;
  max-width: none;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-s);
  overflow: hidden;
  font-family: var(--font-serif);
  font-size: 1.02rem;
}
.grammar-table th, .grammar-table td, .reference-table th, .reference-table td {
  min-width: 120px;
  padding: 10px 14px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: center;
  vertical-align: top;
  line-height: 1.5;
}
.grammar-table td { white-space: normal; }
.reference-table td, .reference-table th { white-space: pre-line; }
.grammar-table tr > :last-child, .reference-table tr > :last-child { border-right: 0; }
.grammar-table tr:last-child > *, .reference-table tr:last-child > * { border-bottom: 0; }
.grammar-table th, .reference-table th {
  background: var(--lapis-soft);
  color: var(--lapis);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.02em;
}
.grammar-table tr:nth-child(even) td, .reference-table tr:nth-child(even) td { background: var(--surface-soft); }
.grammar-table td:first-child, .grammar-table th:first-child { text-align: left; }
.grammar-table td:first-child, .reference-table td:first-child { color: var(--ink-soft); font-family: var(--font-sans); font-size: 0.86rem; font-weight: 650; }

/* --------------------------------------------------------------------------
   Recursos, libros, programa, ayuda
   -------------------------------------------------------------------------- */
.resources-introduction { margin-bottom: 24px; }
.resources-introduction p { max-width: 70ch; margin: 0; color: var(--muted); font-size: var(--step-1); line-height: 1.6; }
.resources-list { display: grid; gap: 30px; }
.resource-category h3 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
  font-family: var(--font-serif);
  font-size: var(--step-2);
  font-weight: 500;
}
.resource-category h3::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.resource-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.resource-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 64px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  line-height: 1.35;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.resource-link strong { min-width: 0; font-weight: 700; overflow-wrap: anywhere; }
.resource-link:hover { border-color: var(--lapis); box-shadow: var(--shadow-2); transform: translateY(-1px); }
.resource-link span:last-child {
  flex: none;
  border-radius: 999px;
  padding: 3px 10px;
  background: var(--lapis-soft);
  color: var(--lapis);
  font-size: 0.72rem;
  font-weight: 700;
}
.resource-link-description { display: block; margin-top: 4px; color: var(--muted); font-size: 0.82rem; font-weight: 400; }

.program-toolbar { display: flex; justify-content: flex-end; margin-bottom: 18px; }
.program-toolbar label { width: min(100%, 400px); margin: 0; }
.program-content { max-width: 900px; }
.program-section { padding: 22px 0; border-top: 1px solid var(--line); }
.program-section:first-of-type { border-top: 0; }
.program-section h4 { margin: 0 0 10px; color: var(--lapis); font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; }
.program-section p { max-width: 72ch; margin: 0 0 12px; font-family: var(--font-serif); font-size: 1.04rem; line-height: 1.7; }

.help-content { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.help-content section { padding: 22px 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.help-content h3 { margin-bottom: 8px; font-family: var(--font-serif); font-size: var(--step-2); font-weight: 500; }
.help-content p { max-width: 70ch; margin-bottom: 10px; color: var(--ink-soft); line-height: 1.65; }
.help-content p:last-child { margin-bottom: 0; }

/* --------------------------------------------------------------------------
   Tarjetas de estudio (vocabulario, letras, repaso)
   -------------------------------------------------------------------------- */
.vocabulary-heading { align-items: end; }
.vocabulary-total { color: var(--muted); font-size: var(--step--1); font-weight: 600; font-variant-numeric: tabular-nums; }
.vocabulary-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.1fr) minmax(200px, 1.2fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 22px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.vocabulary-filters label { margin: 0; }
.vocabulary-layout, .learning-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.study-card { min-width: 0; }
.card-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 30px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: var(--step--1);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.card-context > span:empty { flex: 1; }
.card-body {
  position: relative;
  min-height: 360px;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 48px 40px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--lapis-soft) 55%, transparent), transparent 38%),
    var(--surface);
  box-shadow: var(--shadow-2);
  text-align: center;
}
.card-body::before {
  /* Filete dorado superior, como en un folio */
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 72px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--gold-bright);
  transform: translateX(-50%);
}
.card-body > p:first-child { min-height: 20px; margin-bottom: 10px; color: var(--muted); font-size: var(--step--1); font-weight: 650; letter-spacing: 0.04em; }
.card-body > p:first-child:empty { min-height: 0; margin: 0; }
.card-body h3 {
  max-width: 100%;
  margin-bottom: 10px;
  overflow-wrap: anywhere;
  font-family: var(--font-serif);
  font-size: clamp(1.85rem, 1.3rem + 2vw, 2.7rem);
  font-weight: 500;
  line-height: 1.2;
}
.card-body h3.principal-parts { font-weight: 700; }
.vocabulary-forms { min-height: 24px; margin-bottom: 0; color: var(--ink-soft); font-family: var(--font-serif); font-size: 1.15rem; font-style: italic; }
.vocabulary-forms:empty { min-height: 0; }
.vocabulary-answer {
  width: min(460px, 100%);
  min-height: 24px;
  margin: 22px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: var(--step-1);
  line-height: 1.5;
}
.vocabulary-answer:empty { border-top-color: transparent; }
.learning-card-body h3 { font-size: clamp(2.6rem, 2rem + 2.6vw, 3.6rem); }
.learning-card-body .vocabulary-forms { font-style: normal; font-size: 1.35rem; }
.learning-name { min-height: 22px; margin: 6px 0 0; color: var(--muted); font-family: var(--font-serif); font-size: 1.05rem; }

/* Autoevaluación: ocultar significado hasta pulsar «Mostrar respuesta» */
.conceal-toggle { display: inline-flex; flex-direction: row; align-items: center; gap: 8px; margin: 0; color: var(--ink-soft); font-size: var(--step--1); font-weight: 600; cursor: pointer; }
.reveal-button { display: none; margin-top: 22px; }
#vocabularyView.conceal-meaning .card-body:not(.revealed) .vocabulary-answer { display: none; }
#vocabularyView.conceal-meaning .card-body:not(.revealed) .reveal-button { display: inline-flex; }

.card-controls, .learning-controls, .review-controls { display: grid; grid-template-columns: 44px minmax(0, 1fr) minmax(0, 1fr) 44px; gap: 10px; margin-top: 14px; }
.card-controls button { min-height: 48px; height: auto; }
.card-controls .icon-button { width: 44px; }
.card-primary { width: auto; }
.again-button { border-color: color-mix(in srgb, var(--gold) 55%, transparent); color: var(--gold); }
.again-button:hover:not(:disabled) { border-color: var(--gold); color: var(--gold); background: var(--gold-soft); }
.remember-button { border: 1px solid var(--lapis); color: var(--lapis-ink); background: var(--lapis); }
.remember-button:hover:not(:disabled) { border-color: var(--lapis-strong); background: var(--lapis-strong); }

.vocabulary-browser {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.browser-heading { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); background: var(--surface-soft); }
.browser-heading strong { font-size: var(--step-0); }
.browser-heading span { color: var(--muted); font-size: 0.75rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.vocabulary-list { height: 470px; overflow-y: auto; padding: 4px; scrollbar-width: thin; }
.vocabulary-row {
  width: 100%;
  min-height: 52px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 10px;
  gap: 10px;
  align-items: center;
  border: 0;
  border-radius: var(--radius-s);
  padding: 9px 12px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}
.vocabulary-row + .vocabulary-row { margin-top: 1px; }
.vocabulary-row:hover { background: var(--surface-sunk); }
.vocabulary-row.active { background: var(--lapis-soft); box-shadow: inset 3px 0 0 var(--lapis); }
.vocabulary-row span:first-child { min-width: 0; display: grid; }
.vocabulary-row strong { overflow-wrap: anywhere; white-space: normal; font-family: var(--font-serif); font-size: 1.02rem; font-weight: 500; line-height: 1.3; }
.vocabulary-row.active strong { color: var(--lapis); font-weight: 600; }
.vocabulary-row small { margin-top: 3px; color: var(--muted); }
.word-state { display: inline-block; width: 9px; height: 9px; flex: none; border: 1.5px solid var(--line-strong); border-radius: 50%; background: transparent; }
.word-state.reviewing, .word-state.in_progress { border-color: var(--gold-bright); background: var(--gold-bright); }
.word-state.mastered { border-color: var(--ok); background: var(--ok); }
.state-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; padding: 10px 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.72rem; }
.state-legend span { display: inline-flex; align-items: center; gap: 6px; }
.pagination { min-height: 58px; display: flex; align-items: center; justify-content: center; gap: 12px; border-top: 1px solid var(--line); }
.pagination .icon-button { width: 38px; height: 38px; }
.pagination span { min-width: 110px; color: var(--muted); font-size: 0.78rem; font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; }

/* Repasar: opciones múltiples */
.review-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.review-option {
  min-height: 52px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-s);
  background: var(--surface);
  color: var(--ink);
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.review-option:hover:not(:disabled) { border-color: var(--lapis); background: var(--lapis-soft); }
.review-option:disabled { cursor: default; opacity: 1; }
.review-option.correct { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); font-weight: 700; }
.review-option.incorrect { border-color: var(--rubric); background: var(--rubric-soft); color: var(--rubric); }
.review-correct { color: var(--ok); font-weight: 650; }
.review-incorrect { color: var(--rubric); font-weight: 650; }

/* Repaso completo: tarjetas de dos caras */
.quick-review-intro { max-width: 70ch; margin: -6px 0 22px; color: var(--muted); line-height: 1.55; }
.quick-review-shell { width: min(720px, 100%); margin: 0 auto; }
.quick-review-card { height: 380px; perspective: 1400px; cursor: pointer; outline: none; }
.quick-review-card:focus-visible { outline: 3px solid var(--focus); outline-offset: 5px; border-radius: var(--radius-l); }
.quick-review-card-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform 0.5s cubic-bezier(0.3, 0.7, 0.2, 1); }
.quick-review-card.flipped .quick-review-card-inner { transform: rotateY(180deg); }
.quick-review-face {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--lapis-soft) 60%, transparent), transparent 42%),
    var(--surface);
  box-shadow: var(--shadow-2);
  text-align: center;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.quick-review-face::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 72px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--lapis);
  transform: translateX(-50%);
}
.quick-review-back {
  transform: rotateY(180deg);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--gold-soft) 85%, transparent), transparent 45%),
    var(--surface);
}
.quick-review-back::before { background: var(--gold-bright); }
.quick-review-face h3 { max-width: 100%; margin: 0; overflow-wrap: anywhere; font-family: var(--font-serif); font-size: clamp(1.9rem, 4.6vw, 3.1rem); font-weight: 500; line-height: 1.2; }
.quick-review-back h3 { font-family: var(--font-sans); font-size: clamp(1.45rem, 3.6vw, 2.25rem); font-weight: 600; color: var(--ink-soft); }
.quick-review-controls { display: grid; grid-template-columns: 44px minmax(140px, 220px) 44px; justify-content: center; gap: 12px; margin-top: 16px; }
.quick-review-controls button { min-height: 46px; }

/* --------------------------------------------------------------------------
   Docencia: estudiantes, grupos e informes
   -------------------------------------------------------------------------- */
.admin-panel { margin-bottom: 18px; padding: 20px 22px 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.admin-panel-title { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; font-family: var(--font-serif); font-size: var(--step-2); font-weight: 500; }
.admin-panel-title .icon { width: 22px; height: 22px; color: var(--lapis); }
.admin-panel > .message { margin-top: 14px; }
#studentMessage { margin: 0 0 18px; }
.group-toolbar { display: grid; grid-template-columns: minmax(220px, 1fr) auto auto auto; gap: 10px; align-items: end; }
.group-toolbar label { margin: 0; }
.download-link { min-height: 44px; }
.student-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: end; }
.student-form label { margin: 0; }
.student-enrollments { display: grid; grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 0; padding: 14px 16px 16px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface-soft); }
.student-enrollments label { margin: 0; }
.student-enrollments legend { padding: 0 6px; color: var(--muted); font-size: 0.75rem; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; grid-column: 1 / -1; }
.form-actions .primary { min-width: 200px; }
.import-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.import-form label { margin: 0; }

.student-list-toolbar { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(200px, 1fr) minmax(180px, 0.8fr); gap: 12px; align-items: stretch; }
.student-list-toolbar label { margin: 0; }
.student-group-filter { margin: 0; padding: 10px 14px 12px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface-soft); }
.student-group-filter legend { padding: 0 6px; color: var(--muted); font-size: 0.75rem; font-weight: 700; }
.group-filter-list { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.group-filter-option { display: inline-flex; flex-direction: row; align-items: center; gap: 8px; margin: 0; color: var(--ink); font-size: 0.86rem; font-weight: 500; }
.group-filter-option input { width: 18px; margin: 0; }
.student-averages {
  margin-top: 14px;
  padding: 11px 16px;
  border-radius: var(--radius-s);
  background: var(--lapis-soft);
  color: var(--lapis);
  font-size: var(--step--1);
  font-weight: 650;
}
.student-averages:empty { display: none; }

.table-wrap { margin-top: 16px; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { background: var(--surface-soft); color: var(--muted); font-size: 0.72rem; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
.student-table tbody tr:hover td { background: var(--surface-soft); }
.student-table td { font-size: 0.9rem; }
.student-table td:nth-child(3) { overflow-wrap: anywhere; }
.student-table td:last-child { white-space: nowrap; }
.table-button {
  min-height: 34px;
  margin: 2px 6px 2px 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-s);
  padding: 5px 11px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 650;
}
.table-button:hover { border-color: var(--lapis); color: var(--lapis); background: var(--lapis-soft); }
.table-button.danger { color: var(--rubric); border-color: color-mix(in srgb, var(--rubric) 40%, transparent); }
.table-button.danger:hover { border-color: var(--rubric); background: var(--rubric-soft); color: var(--rubric); }
.student-display { display: grid; gap: 3px; }
.student-display strong { font-weight: 650; }
.student-display small { color: var(--muted); }
.student-status { display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 3px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 750; white-space: nowrap; }
.student-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.student-status.active { color: var(--ok); background: var(--ok-soft); border: 1px solid color-mix(in srgb, var(--ok) 30%, transparent); }
.student-status.paused { color: var(--warn); background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); }
.student-paused-row td { background: color-mix(in srgb, var(--warn-soft) 55%, transparent); }

/* Bloques antiguos conservados por compatibilidad */
.learning-panel { min-width: 0; padding: 28px 32px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.learning-toolbar { display: grid; grid-template-columns: minmax(210px, 260px) minmax(210px, 260px); gap: 10px; align-items: end; margin-bottom: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.learning-toolbar label { margin: 0; }

/* --------------------------------------------------------------------------
   Tableta y móvil
   -------------------------------------------------------------------------- */
@media (max-width: 1100px) {
  .vocabulary-layout, .learning-layout { grid-template-columns: minmax(0, 1fr) 300px; }
  .grammar-layout, .reference-layout { grid-template-columns: 250px minmax(0, 1fr); }
  .home-overview { grid-template-columns: minmax(0, 1fr); }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .student-list-toolbar { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .student-group-filter { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  :root { --topbar-h: 58px; }
  .topbar { gap: 8px; padding: 0 12px; }
  .brand-lockup img { width: 34px; height: 34px; }
  .brand-lockup strong { font-size: 1.12rem; }
  .brand-lockup span { display: none; }
  .session-user { display: none; }
  .logout-label { display: none; }
  .logout-button { width: 44px; padding: 0; }
  .preview-level-text { display: none; }
  .preview-level select { max-width: 132px; }
  .preview-button { max-width: 150px; padding: 6px 10px; font-size: 0.78rem; line-height: 1.15; }

  /* Pestañas sobre el contenido: dos filas que se desplazan de lado */
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: static;
    height: auto;
    display: grid;
    grid-auto-flow: column;
    grid-template-rows: repeat(2, auto);
    grid-auto-columns: max-content;
    gap: 6px;
    padding: 10px 12px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent);
    mask-image: linear-gradient(90deg, #000 88%, transparent);
  }
  .sidebar::-webkit-scrollbar { display: none; }
  .sidebar.scrolled-end { -webkit-mask-image: none; mask-image: none; }
  .nav-group-title { display: none; }
  .nav-item {
    min-height: 40px;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    padding: 0 14px 0 12px;
    background: rgba(255, 255, 255, 0.05);
    font-size: 0.86rem;
    scroll-snap-align: start;
  }
  .nav-item .icon, .glyph-icon { width: 17px; height: 17px; }
  .nav-item .nav-external { display: none; }
  .nav-item.active { border-color: var(--gold-bright); background: var(--nav-active); }
  .nav-item.active::before { display: none; }
  .nav-item:focus-visible { outline-offset: 1px; }

  .content { padding: 24px 16px 56px; }
  .page-heading { margin-bottom: 20px; padding-bottom: 14px; }
  .vocabulary-layout, .learning-layout { grid-template-columns: minmax(0, 1fr); }
  .vocabulary-browser { margin-top: 6px; }
  .vocabulary-list { height: min(420px, 55vh); }
  .grammar-layout, .reference-layout { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .grammar-index, .reference-index { position: static; max-height: none; }
  .grammar-lesson-list, .reference-list.reference-list { display: none; }
  .grammar-index > label, .reference-index > label { border-bottom: 0; }
  .grammar-content, .reference-content { min-height: 0; }
  .help-content { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .login-view { grid-template-columns: minmax(0, 1fr); }
  .login-aside { display: none; }
  .login-panel { padding: 32px 18px 40px; }
  .login-brand { flex-direction: column; text-align: center; gap: 12px; margin-bottom: 24px; }
  .logo { width: 112px; height: 112px; }
  .login-brand h1 { font-size: 2rem; }

  .brand-lockup div { display: none; }
  .progress-hero { flex-direction: column; text-align: center; padding: 24px 18px; gap: 16px; }
  .progress-ring { width: 120px; height: 120px; }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .metric { grid-template-columns: minmax(0, 1fr); row-gap: 4px; padding: 16px; }
  .metric .icon { grid-row: auto; width: 36px; height: 36px; padding: 8px; margin-bottom: 4px; }
  .quick-link-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .quick-link { grid-template-columns: minmax(0, 1fr); padding: 14px; row-gap: 6px; }
  .quick-link .icon { grid-row: auto; }
  .quick-link small { display: none; }
  .compact-form, .student-form, .import-form, .group-toolbar, .student-list-toolbar { grid-template-columns: minmax(0, 1fr); }
  .student-enrollments { grid-template-columns: minmax(0, 1fr); }
  .form-actions .primary { width: 100%; }
  .vocabulary-filters { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 12px; }
  .vocabulary-filters label:first-child { grid-column: 1 / -1; }

  .card-context { flex-wrap: wrap; row-gap: 4px; }
  .card-body { min-height: 300px; padding: 36px 18px 30px; }
  .card-controls, .learning-controls, .review-controls { grid-template-columns: 48px minmax(0, 1fr) 48px; }
  .card-controls .icon-button { width: 48px; }
  #vocabularyPrevious, #learningPrevious, #reviewPrevious { grid-column: 1; grid-row: 1; }
  #vocabularyAgain, #learningAgain, #reviewAgain { grid-column: 2; grid-row: 1; }
  #vocabularyNext, #learningNext, #reviewNext { grid-column: 3; grid-row: 1; }
  #vocabularyKnown, #learningKnown, #reviewKnown { grid-column: 1 / 4; grid-row: 2; }
  .review-options { grid-template-columns: minmax(0, 1fr); }

  .quick-review-card { height: 330px; }
  .quick-review-face { padding: 28px 20px; }

  .program-toolbar { display: block; }
  .program-toolbar label { width: 100%; }
  .resource-links { grid-template-columns: minmax(0, 1fr); }
  .admin-panel { padding: 16px; }

  /* Tabla de estudiantes como fichas */
  .student-table thead { display: none; }
  .student-table, .student-table tbody, .student-table tr, .student-table td { display: block; width: 100%; }
  .table-wrap { border: 0; background: transparent; overflow: visible; }
  .student-table tr { margin-bottom: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
  .student-table td { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; padding: 6px 0; border: 0; white-space: normal; }
  .student-table td::before { content: attr(data-label); color: var(--muted); font-size: 0.72rem; font-weight: 750; letter-spacing: 0.06em; text-transform: uppercase; padding-top: 2px; }
  .student-table td:first-child { padding-bottom: 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
  .student-table td:last-child { display: flex; flex-wrap: wrap; gap: 8px; white-space: normal; }
  .student-table td:last-child::before { flex-basis: 100%; }
  .student-table td:last-child .table-button { flex: 1 1 0; min-height: 40px; margin: 0; }
  .student-table td > .student-status { justify-self: start; }
  .student-table tbody tr:hover td { background: transparent; }
  .student-paused-row { background: var(--warn-soft) !important; }
  .student-paused-row td { background: transparent; }
}

.watermark {
  position: fixed;
  right: max(14px, env(safe-area-inset-right, 0px));
  bottom: max(12px, env(safe-area-inset-bottom, 0px));
  z-index: 40;
  padding: 4px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  color: var(--lapis);
  font-family: var(--font-serif);
  font-size: 0.82rem;
  font-variant: small-caps;
  letter-spacing: 0.06em;
  text-decoration: none;
  opacity: 0.55;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  transition: opacity 0.15s ease;
}
.watermark:hover, .watermark:focus-visible { opacity: 1; text-decoration: underline; }
.content { padding-bottom: 72px; }
@media print { .watermark { display: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* Biblioteca didáctica, responsive */
.reader-entry{background:var(--surface,#fff);border:1px solid var(--border,#ddd);border-radius:14px;padding:1.1rem 1.3rem;margin:1rem 0;overflow-wrap:anywhere} .reader-entry p{line-height:1.6;white-space:pre-wrap}.reader-entry ol{padding-left:1.8rem;line-height:1.8}.reader-pagination{display:flex;align-items:center;justify-content:center;gap:1rem;margin:1.5rem 0;flex-wrap:wrap}.reader-note{border-left:4px solid #a98b4a;padding:.8rem 1rem;background:rgba(180,146,74,.08)}.reader-tools{display:flex;gap:.8rem;flex-wrap:wrap}.reader-tools input,.reader-tools select{min-width:200px;padding:.65rem}.reader-entry h3{margin-top:0}@media(max-width:650px){.reader-entry{padding:.8rem}.reader-tools>*{width:100%}}

/* Catálogos graduados y acceso restringido v5 */
.reader-locked{background:color-mix(in srgb,var(--surface,#fff) 92%,#b29b6b 8%)}
.reader-paywall{border-left:3px solid #987341;padding:.6rem .9rem;background:rgba(177,147,91,.08);font-weight:600}
.reader-meta{color:var(--muted,#555);font-size:.9rem;font-weight:600}
.reader-tools label{align-self:center;font-weight:600}.reader-tools select{max-width:100%;min-width:10rem}

/* v6: selección temática de Domī y ventana Más vocabulario. */
.exercitia-controls { align-items: center; flex-wrap: wrap; gap: .65rem; }
.exercitia-controls label { font-weight: 600; font-size: .85rem; }
.exercitia-controls select, .exercitia-controls input { max-width: 100%; min-width: 0; }
#exercitiaTopic { flex: 1 1 16rem; }
#exercitiaContent .reader-entry ol { padding-left: 1.65rem; }
#exercitiaContent .reader-entry li { margin-bottom: .68rem; line-height: 1.6; }
.exercise-subsection { border-top: 1px solid var(--border,#ddd); margin-top: 1.35rem; padding-top: 1rem; }
.exercise-subsection h4 { font-size: 1.05rem; margin: 0 0 .25rem; }
@media (max-width: 680px) {
  .exercitia-controls { display: grid; grid-template-columns: 1fr; align-items: stretch; }
  .exercitia-controls select, .exercitia-controls input { width:100%; }
}

/* v7: en Latín II solo hay un modelo verbal; el título ocupa la cabecera del
   cuadro de consulta y no se repite en una columna o selector lateral. */
.reference-layout.reference-layout {grid-template-columns:minmax(0,1fr)}
.reference-layout.single-reference .reference-index {display:none}
.reference-layout.single-reference .reference-content {min-height:0}
.reference-layout.single-reference .reference-content > h3 {margin: 0 0 16px;}
#extraExercisesContent .reader-entry ol {padding-left:1.8rem;line-height:1.7}
#extraExercisesContent .reader-entry li {padding-left:.2rem;margin:.7rem 0;}

#cuadrosOtherButton {font-size:.78rem;padding:.38rem .65rem;margin:0 0 12px;min-height:0}

/* V8: índice temático de la gramática y notas de lectura */
.reader-grammar .rich-grammar {line-height:1.58; max-width:100%; overflow-wrap:anywhere} 
.reader-grammar .rich-grammar h3,.reader-grammar .rich-grammar h4 {margin-top:1.2rem} 
.reader-grammar .rich-grammar table {width:100%;table-layout:auto;border-collapse:collapse;margin:1rem 0;display:block;overflow-x:auto} 
.reader-grammar .rich-grammar td,.reader-grammar .rich-grammar th {padding:7px 11px;border:1px solid #aab4c0;white-space:normal} 
.reader-grammar .rich-grammar blockquote {border-left:3px solid #929fbb;padding-left:15px;margin-left:0} 
.reader-grammar .rich-grammar p.grammar-latin {font-family:Georgia,serif;line-height:1.8} 
.help-sections {display:grid;gap:12px;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));align-items:start} 
.help-section{border:1px solid #bcc7d6;border-radius:10px;padding:16px} 
.help-section h3{margin:0 0 9px}.help-section a{color:#20558c;text-decoration:underline} 
.reader-locked .reader-paywall{font-weight:bold} 

/* v12: las locuciones lógicas y jurídicas se distinguen del resto del léxico. */
.lexicon-rich-entry{line-height:1.55;margin:.55rem 0}.lexicon-rich-entry strong{font-weight:700}.lexicon-rich-entry strong.latin-locution{font-style:italic}

/* v14: vista didáctica */
#learningReveal {margin:.6rem auto 0;}
#learningCard .learning-name, #learningCard .vocabulary-forms {transition:opacity .15s ease;}
#extraExercisesContent .reader-entry ol,#syntaxExercisesContent .reader-entry ol,#exercitiaContent .reader-entry ol {padding-left:1.8rem;line-height:1.75;}
#extraExercisesContent .reader-entry li,#syntaxExercisesContent .reader-entry li,#exercitiaContent .reader-entry li {margin-bottom:.55rem;}
#studentHome .page-heading .eyebrow:empty,#modulesView .page-heading .eyebrow:empty{display:none;}

/* Accesos y versiones: componentes añadidos en la entrega v27. */
.plan-access-note { display:flex; flex-wrap:wrap; align-items:center; gap:8px 16px; margin:0 0 18px; padding:12px 16px; background:var(--surface, #f6f8fc); border:1px solid var(--border, #d5dfef); border-radius:12px; font-size:.93rem; }
.plan-access-note a { font-weight:650; text-underline-offset:3px; }
#accessGrantForm { display:flex; flex-wrap:wrap; gap:12px; align-items:end; margin:14px 0; }
#accessGrantForm label { flex:1 1 235px; }
#accessGrantForm select { width:100%; }
#accessGrantForm button { flex:0 0 auto; }
#accessGrantRows td { vertical-align:middle; }
@media (max-width:700px) { #accessGrantForm { flex-direction:column; align-items:stretch; } #accessGrantForm label, #accessGrantForm button { width:100%; flex-basis:auto; } }

/* v28: vigencias académicas y acceso de Latín III; controles compactos. */
.academic-term-form{display:flex;flex-wrap:wrap;align-items:flex-end;gap:.65rem 1rem;margin-top:1rem;padding:.85rem;border:1px solid var(--line, #d1d8e1);border-radius:.6rem}
.academic-term-form>.reader-note{flex-basis:100%;margin:0 0 .25rem}
.academic-term-form label{display:flex;flex-direction:column;gap:.25rem;font-size:.9rem}
.academic-term-form input{min-width:150px;max-width:210px;padding:.5rem}
#academicTermState{flex-basis:100%;font-weight:600}
#latinThreeStatus .secondary{margin:.3rem .5rem .3rem 0}
.plan-expires{display:block;margin:.4rem 0}


/* DL v30: los dos alfabetos son tarjetas de la misma cuadrícula y tamaño que todas las demás. */
.quick-link.alphabet-quick-link > .glyph-icon {
  grid-row: 1 / 3;
  grid-column: 1;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--lapis);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  line-height: 1;
}
.quick-link.alphabet-quick-link > strong { min-width: 0; overflow-wrap: anywhere; }
.resource-subscription-note {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-left: 3px solid var(--gold);
  border-radius: 4px;
  background: var(--gold-soft);
  color: var(--ink-soft);
  font-weight: 400;
  font-size: 0.88rem;
  line-height: 1.45;
}


/* DL-0001 y DL-0006: valores legibles sin desbordar las tablas existentes. */
.usage-note{display:block;font-size:.73rem;line-height:1.25;max-width:12rem;opacity:.8;margin-top:.3rem}
.review-order-label{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap;margin:.5rem 0}
.schedule-table-wrap{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
.schedule-table{width:100%;min-width:36rem}
.schedule-table td:first-child{min-width:18rem;white-space:normal}
@media(max-width:570px){.schedule-table{min-width:36rem}.schedule-table-wrap{overflow-x:auto}}

.schedule-editor-textarea{width:100%;max-width:100%;box-sizing:border-box}

/* v33: repaso diario */
.daily-review-controls{display:flex;flex-wrap:wrap;align-items:center;gap:.8rem;margin:.8rem 0}
#reviewDueStatus{font-size:.9rem;opacity:.88}

/* v33: práctica docente verificada, responsiva */
.practice-section{margin:1.4rem 0;padding:1rem;border:1px solid #b7c3d7;border-radius:.7rem}
.practice-list{display:grid;gap:.8rem;margin-top:1rem}
.practice-card{padding:1rem;border:1px solid #bdc8d7;border-radius:.6rem;overflow-wrap:anywhere}
.practice-card h4{margin:.1rem 0 .65rem}.practice-card form{display:grid;gap:.7rem}
.practice-card textarea,.practice-card select,.practice-editor textarea,.practice-editor select,.practice-editor input{max-width:100%;width:100%;min-width:0}
.practice-editor{display:grid;gap:.65rem;max-width:920px}.practice-editor label{display:block}
.practice-answer button{justify-self:start}.practice-answer .message[data-status="correct"]{font-weight:700}

/* v34: legibilidad y navegación por teclado de nuevas herramientas. */
#groupAnalyticsRows td{font-variant-numeric:tabular-nums;white-space:normal}
#groupAnalyticsRows td:first-child{min-width:10rem}
#lexicalLookupForm{display:flex;flex-wrap:wrap;gap:.6rem;align-items:center}
#lexicalLookupForm input{min-width:min(22rem,75vw);max-width:100%}
#practiceErrorsList h5{margin:.7rem 0}
.practice-section button:focus-visible,.practice-section input:focus-visible,.practice-section textarea:focus-visible{outline:3px solid var(--gold);outline-offset:2px}
@media(max-width:600px){#groupAnalyticsRows td{min-width:6rem}#lexicalLookupForm{display:grid;grid-template-columns:minmax(0,1fr)}}

/* v35: búsqueda de paradigmas y práctica de audio accesible. */
#cuadrosSearch { width:100%; min-width:0; }
#pronunciationView textarea { display:block; width:min(100%, 48rem); margin:0.8rem 0 1.2rem; min-height:7rem; }
#pronunciationView .reader-tools { display:flex; flex-wrap:wrap; align-items:center; gap:.7rem; }
#pronunciationView .reader-tools button {min-width:9rem;}

/* Diagnóstico privado sin puntuación oficial */
#diagnosticQuestion {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,14rem),1fr));gap:.55rem;margin-top:1rem;}
#diagnosticQuestion h4 {grid-column:1/-1;margin:.2rem 0 .5rem;}
#diagnosticQuestion .diagnostic-choice {text-align:left;white-space:normal;overflow-wrap:anywhere;min-height:3rem;}

/* v38 — los controles de los repertorios no desplazan las tarjetas de vocabulario. */
.lexicon-search-panel{display:grid;grid-template-columns:minmax(230px,1fr) minmax(230px,1fr) auto auto;gap:.75rem;align-items:end;margin:1rem 0 1.25rem;background:var(--surface,#fff);border:1px solid var(--border,#ddd);border-radius:12px;padding:1rem}
.lexicon-search-panel label{display:flex;flex-direction:column;gap:.35rem;font-weight:600}
.lexicon-search-panel select,.lexicon-search-panel input{width:100%;min-width:0}
.lexicon-search-panel button{min-height:40px;white-space:nowrap}
#vocabularyView .vocabulary-layout{margin-top:.6rem;margin-bottom:1.5rem}
@media(max-width:1000px){.lexicon-search-panel{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}.lexicon-search-panel button{white-space:normal}}
@media(max-width:640px){.lexicon-search-panel{grid-template-columns:minmax(0,1fr)}.lexicon-search-panel button{width:100%}}

/* v39: legibilidad y foco accesible — mejoras acotadas, sin certificación WCAG */
:root[data-reading-size="large"] { font-size: 112.5%; }
.page-view h2[tabindex="-1"]:focus { outline: 3px solid var(--focus); outline-offset: 5px; border-radius: 3px; }
.font-scale-toggle {min-width: 45px; padding: 6px 10px; flex-shrink:0; font-weight: 750;}
.morphology-diagnostic {margin-top: 1.4rem;}
.morph-answer-options {display: flex; flex-wrap:wrap; gap: .65rem; padding: .6rem 0;}
.morph-answer-options button {min-width: 90px; overflow-wrap: anywhere;}
.morph-answer-feedback {font-weight:650; padding: .5rem 0; color:var(--ink);}
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid var(--focus); outline-offset: 3px;
}
@media (max-width: 480px) {
 .morph-answer-options {display:grid; grid-template-columns:repeat(2,minmax(0,1fr));}
 .morph-answer-options button {min-width:0; max-width:100%;}
}
/* v39: controles de accesibilidad sin desbordamiento en el panel Magister móvil. */
@media (max-width: 540px) {
  .topbar { height: auto; min-height: var(--topbar-h); padding: 6px 8px; gap: 5px; flex-wrap: wrap; }
  .brand-lockup { flex: 0 0 34px; margin-right: 1px; }
  .session-actions { min-width:0; max-width: calc(100vw - 55px); gap: 4px; flex-wrap:wrap; justify-content:flex-end; }
  .preview-level { min-width: 0; }
  .preview-level select { max-width: 102px; min-width: 70px; padding-left:5px; padding-right:15px; }
  .preview-button { max-width: 110px; padding: 5px 6px; }
  .font-scale-toggle { min-width:36px; padding:5px 6px; }
  .theme-toggle, .logout-button { max-width:36px; width:36px; min-width:36px; padding:0; }
}
.morph-errors-recap { margin: .8rem 0; border:1px solid var(--line-strong); border-radius:9px; padding:.7rem 1rem; }
.morph-errors-recap summary { cursor:pointer; font-weight:650; }
.morph-errors-recap li { padding:.25rem 0; overflow-wrap:anywhere; }

/* v42 · historial docente y práctica personalizada, progresiva */
#practiceHistoryPanel {grid-column:1/-1;min-width:0;border:1px solid var(--border,#bfc7d2);border-radius:.65rem;padding:.75rem;background:var(--surface,#fff)}
#practiceHistoryPanel details {margin:.7rem 0}
#practiceHistoryPanel summary {cursor:pointer;font-weight:600}
#practiceHistoryPanel .practice-card {margin-top:.5rem}
#practiceStudentMode {width:min(100%,28rem);min-height:2.5rem}
@media(max-width:600px){#practiceHistoryPanel{padding:.5rem}#practiceEditorExport{white-space:normal}}

/* v43: índice y repaso sintáctico basado en la numeración original */
.syntax-guide-nav {display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:.65rem;margin:.85rem 0 1.25rem;}
.syntax-guide-nav button {max-width:100%;}
.syntax-topic-search-results {display:flex;flex-wrap:wrap;gap:.5rem;max-height:13rem;overflow-y:auto;margin:.75rem 0;}
.syntax-topic-search-results button {max-width:100%;text-align:left;}
.syntax-diagnostic {margin-top:1.75rem;padding:1rem;border:1px solid var(--line);border-radius:var(--radius);background:var(--surface-soft);}
.syntax-diagnostic summary {font-weight:650;cursor:pointer;}
.syntax-diagnostic .syntax-choices {display:grid;gap:.5rem;grid-template-columns:repeat(auto-fit,minmax(min(100%,18rem),1fr));margin:.8rem 0;}
.syntax-diagnostic .syntax-choices button {text-align:left;white-space:normal;overflow-wrap:anywhere;}
.syntax-diagnostic .syntax-feedback {padding:.6rem;background:var(--lapis-soft);border-radius:.4rem;color:var(--ink);}
.syntax-diagnostic button:focus-visible,.syntax-topic-search-results button:focus-visible {outline:3px solid var(--focus);outline-offset:3px;}
@media (max-width:480px) {.syntax-guide-nav {flex-direction:column;align-items:stretch}.syntax-guide-nav>*{width:100%;}}
@media (prefers-reduced-motion:reduce){.syntax-topic-search-results *, .syntax-diagnostic *{animation:none!important;transition:none!important;}}

/* Información al usuario sobre registro técnico antes del inicio de sesión. */
.access-privacy-note {margin:.9rem 0;padding:.6rem .85rem;border:1px solid var(--line);border-radius:var(--radius-s);background:var(--surface-soft);color:var(--ink-soft);font-size:.87rem;line-height:1.5;}
.access-privacy-note summary {cursor:pointer;color:var(--ink);font-weight:650;}
.access-privacy-note p {margin:.6rem 0 .3rem;}
