@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* ── Paleta principal — sacada de la guía ── */
  --bg:           #ffffff;
  --bg-page:      #f7faf7;
  --surface:      #ffffff;
  --surface-soft: #f0f7f1;
  --surface-mid:  #dff0e1;
  --surface-dim:  #c8e6c9;

  --green-dark:   #1b5e20;   /* verde oscuro — títulos, nav activo */
  --green-main:   #2e7d32;   /* verde principal — acentos, badges */
  --green-mid:    #388e3c;   /* verde medio */
  --green-light:  #4caf50;   /* verde claro — hover states */
  --green-pale:   #e8f5e9;   /* verde muy claro — fondos cards */
  --green-border: #a5d6a7;   /* borde verde suave */

  --text:         #1b2d1c;   /* texto principal — casi negro verdoso */
  --text-mid:     #2e4a30;
  --text-muted:   #5a7a5c;
  --text-faint:   #8aaa8c;

  --border:       #d4e8d5;
  --border-mid:   #b2d4b4;

  --accent:         #4895ef;   /* azul — acentos, highlights */
  --accent-light:   #74b9ff;   /* azul claro — para fondos oscuros */
  --accent-bg:      #eaf3ff;   /* azul muy claro — fondos */
  --accent-border:  #a8d1f5;   /* borde azul suave */

  --danger:       #c62828;
  --danger-bg:    #ffebee;
  --success:      #2e7d32;
  --success-bg:   #e8f5e9;

  --font:         'Plus Jakarta Sans', sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;
  --mono:         'JetBrains Mono', monospace;

  --radius:       6px;
  --radius-lg:    10px;
  --radius-xl:    16px;

  --shadow-sm:    0 1px 3px rgba(27,94,32,0.08), 0 1px 2px rgba(27,94,32,0.05);
  --shadow-md:    0 4px 12px rgba(27,94,32,0.10), 0 2px 4px rgba(27,94,32,0.06);
  --shadow-lg:    0 8px 24px rgba(27,94,32,0.12);
}

/* ══════════════════════════════════════════
   BASE
══════════════════════════════════════════ */
* { box-sizing: border-box; margin: 0; padding: 0; }

/* Kill the grey/blue tap flash and accidental double-tap zoom on touch UI */
* { -webkit-tap-highlight-color: transparent; }
button, a, input, select, textarea,
.nav-item, .option, .tf-btn, .word-chip, .topic-card,
.check-btn, .reset-btn, .breadcrumb, [onclick] {
  touch-action: manipulation;
}

/* Prevent background scroll while the mobile drawer is open */
body.drawer-open { overflow: hidden; touch-action: none; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  background: var(--bg-page);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ══════════════════════════════════════════
   LAYOUT SHELL
══════════════════════════════════════════ */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ══════════════════════════════════════════
   SIDEBAR
══════════════════════════════════════════ */
.sidebar {
  width: 272px;
  flex-shrink: 0;
  background: var(--green-dark);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  z-index: 100;
  transition: transform 0.25s ease;
}

/* scrollbar sidebar */
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }

.main-content {
  margin-left: 272px;
  flex: 1;
  min-width: 0;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Sidebar Logo ── */
.sidebar-logo {
  padding: 1.75rem 1.5rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.logo-badge {
  display: inline-block;
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.85);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 3px;
  font-family: var(--mono);
  margin-bottom: 8px;
  border: 1px solid rgba(255,255,255,0.15);
}

.logo-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
}

.logo-sub {
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  margin-top: 3px;
  font-family: var(--mono);
}

/* ── Sidebar User ── */
.sidebar-user {
  padding: 0.9rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  border: 1.5px solid rgba(255,255,255,0.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  color: #ffffff;
  font-family: var(--mono);
  flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 10px; color: rgba(255,255,255,0.45); font-family: var(--mono); letter-spacing: 0.05em; }

.logout-btn {
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,0.4); padding: 4px;
  border-radius: 4px; transition: color 0.15s;
  display: flex; align-items: center;
}
.logout-btn:hover { color: #ff8a80; }
.logout-btn svg { width: 15px; height: 15px; }

/* ── Sidebar Nav ── */
.sidebar-nav { padding: 1rem 0; flex: 1; }

.nav-section-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  font-family: var(--mono);
  padding: 0.75rem 1.5rem 0.3rem;
}

.nav-item {
  touch-action: manipulation;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.5rem 1.5rem;
  cursor: pointer;
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  transition: all 0.15s;
  border-left: 3px solid transparent;
  user-select: none;
  line-height: 1.3;
}

.nav-item:hover {
  color: #ffffff;
  background: rgba(255,255,255,0.06);
}

.nav-item.active {
  color: #ffffff;
  border-left-color: var(--accent-light);
  background: rgba(255,255,255,0.1);
  font-weight: 600;
}

.nav-item-num {
  font-family: var(--mono);
  font-size: 10px;
  color: rgba(255,255,255,0.3);
  width: 22px;
  flex-shrink: 0;
}
.nav-item.active .nav-item-num { color: var(--accent-light); }

.nav-item-title { flex: 1; }

.priority-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-alta  { background: var(--accent-light); }
.dot-media { background: rgba(255,255,255,0.4); }
.dot-baja  { background: rgba(255,255,255,0.2); }

.lock-icon { width: 12px; height: 12px; flex-shrink: 0; color: rgba(255,255,255,0.25); }

/* Tema completado por el alumno: color distinto + tilde en el sidebar */
.nav-item.completed .nav-item-title { color: #69f0ae; font-weight: 600; }
/* Sidebar: sección de contenido desbloqueado destacada */
.sidebar .pack-section {
  margin: 0.5rem 0.75rem;
  padding: 0.35rem 0 0.5rem;
  border: 1px solid rgba(255, 193, 7, .35);
  border-radius: 10px;
  background: rgba(255, 193, 7, .07);
}
.sidebar .pack-section .nav-section-label { color: #ffca28; padding-left: 0.75rem; }
.sidebar .pack-section .nav-item-num { color: rgba(255, 202, 40, .6); }
.sidebar .pack-section .nav-item { color: rgba(255,255,255,0.8); }
.sidebar .pack-section .nav-item.active,
.sidebar .pack-section .nav-item:hover { background: rgba(255, 193, 7, .14); }

.nav-item.completed .nav-item-num   { color: #69f0ae; }
.nav-item.completed .priority-dot   { display: none; }
.nav-item.completed::after {
  content: '✓';
  flex-shrink: 0;
  color: #69f0ae;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 10px;
  color: rgba(255,255,255,0.25);
  font-family: var(--mono);
  line-height: 1.6;
}

/* ══════════════════════════════════════════
   MOBILE
══════════════════════════════════════════ */
.mobile-header {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: calc(54px + env(safe-area-inset-top));
  padding-top: env(safe-area-inset-top);
  padding-left: calc(1.25rem + env(safe-area-inset-left));
  padding-right: calc(1.25rem + env(safe-area-inset-right));
  background: var(--green-dark);
  align-items: center;
  gap: 12px;
  z-index: 200;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.menu-toggle {
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,0.8); padding: 4px;
  display: flex; align-items: center;
}
.menu-toggle svg { width: 22px; height: 22px; }

.mobile-logo {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  flex: 1;
}

.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}

/* ══════════════════════════════════════════
   PAGES
══════════════════════════════════════════ */
.page { display: none; }
.page.active { display: block; }

/* ══════════════════════════════════════════
   HOME PAGE
══════════════════════════════════════════ */
.home-hero {
  background: var(--green-dark);
  padding: 3.5rem 3rem 3rem;
  position: relative;
  overflow: hidden;
}

.home-hero::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 320px; height: 320px;
  border-radius: 50%;
  background: rgba(255,255,255,0.03);
  pointer-events: none;
}

.home-hero::after {
  content: '';
  position: absolute;
  bottom: -80px; left: 40%;
  width: 240px; height: 240px;
  border-radius: 50%;
  background: rgba(255,255,255,0.025);
  pointer-events: none;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 4px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  font-family: var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4.5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.05;
  color: #ffffff;
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
}

.hero-title .highlight {
  color: #ffffff;
  text-decoration: underline;
  text-decoration-color: var(--accent-light);
  text-underline-offset: 5px;
}

.hero-sub {
  color: rgba(255,255,255,0.65);
  font-size: 15px;
  max-width: 460px;
  line-height: 1.65;
  position: relative;
  z-index: 1;
}

.hero-stats {
  display: flex;
  gap: 0;
  margin-top: 2rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 1.5rem;
  position: relative;
  z-index: 1;
}

.stat {
  flex: 1;
  padding-right: 1.5rem;
  border-right: 1px solid rgba(255,255,255,0.1);
  margin-right: 1.5rem;
}
.stat:last-child { border-right: none; margin-right: 0; padding-right: 0; }

.stat-num {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1;
}

.stat-label {
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  margin-top: 3px;
  font-family: var(--mono);
}

/* ── Home body ── */
.home-body {
  padding: 2.5rem 3rem 4rem;
}

.rule-card {
  background: var(--accent-bg);
  border: 1.5px solid var(--accent-border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.4rem;
  margin-bottom: 2rem;
  font-size: 14px;
  color: #1a3a6b;
  line-height: 1.65;
}
.rule-card strong {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #2c5fa8;
  margin-bottom: 5px;
}

.info-card {
  background: var(--green-pale);
  border: 1.5px solid var(--green-border);
  border-left: 4px solid var(--green-main);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.4rem;
  margin-bottom: 2rem;
  font-size: 14px;
  color: var(--green-dark);
  line-height: 1.65;
}
.info-card strong {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--green-mid);
  margin-bottom: 5px;
}
.info-card a { color: var(--green-main); font-weight: 600; }

.section-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 1rem;
  margin-top: 2.25rem;
}

.section-heading-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-family: var(--mono);
  white-space: nowrap;
}

.section-heading-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

.section-heading-count {
  font-size: 10px;
  color: var(--text-faint);
  font-family: var(--mono);
  white-space: nowrap;
}

/* ── Topic Cards Grid ── */
.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
  margin-bottom: 0.5rem;
}

.topic-card {
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.25rem;
  cursor: pointer;
  transition: all 0.18s ease;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.topic-card:hover {
  border-color: var(--green-border);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.topic-card.locked-card {
  opacity: 0.65;
  cursor: default;
  background: var(--bg-page);
}
.topic-card.locked-card:hover {
  transform: none;
  box-shadow: var(--shadow-sm);
  border-color: var(--border);
}

.topic-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.topic-card-num {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-faint);
  font-weight: 500;
}

.topic-card-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: 10px;
  line-height: 1.35;
}

.topic-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.topic-card-qs {
  font-size: 11px;
  color: var(--text-faint);
  font-family: var(--mono);
}

.priority {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 3px;
  font-family: var(--mono);
}
.p-alta  { background: #e8f5e9; color: #1b5e20; }
.p-media { background: #f1f8e9; color: #33691e; }
.p-baja  { background: #f5f5f5; color: #757575; }
.p-free  { background: var(--accent-bg); color: #1565c0; }
.p-pack  { background: #fff3e0; color: #e65100; }

/* ── Contenido desbloqueado (Pack / Repaso Extra) ── */
.pack-zone {
  margin-top: 2.5rem;
  padding: 1.25rem 1.25rem 1.4rem;
  border: 1.5px solid #ffd54f;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(1200px 120px at 0% 0%, rgba(255, 193, 7, .10), transparent 60%),
    linear-gradient(180deg, #fffdf5 0%, #fff9e8 100%);
  box-shadow: 0 6px 24px rgba(255, 179, 0, .12);
}

.pack-zone-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 1rem;
}

.pack-zone-icon {
  font-size: 26px;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(230, 81, 0, .25));
}

.pack-zone-copy { display: flex; flex-direction: column; gap: 2px; }

.pack-zone-title {
  font-size: 14px;
  font-weight: 800;
  color: #e65100;
  letter-spacing: .01em;
}

.pack-zone-sub {
  font-size: 11px;
  color: #9a6a2e;
  font-family: var(--mono);
}

/* Tarjetas bonus: acabado dorado que las diferencia de las unidades comunes */
.topic-card-bonus {
  border-color: #ffca28;
  background: linear-gradient(180deg, #fffdf6 0%, #fff8e6 100%);
}
.topic-card-bonus:hover {
  border-color: #ffb300;
  box-shadow: 0 8px 22px rgba(255, 179, 0, .22);
}
.topic-card-bonus .topic-card-num {
  color: #e65100;
  font-weight: 700;
}
.topic-card-bonus .topic-card-title { color: #b34700; }

/* ══════════════════════════════════════════
   DIAGNÓSTICO PROFUNDO
══════════════════════════════════════════ */
.deep-hint {
  font-size: 12px;
  color: #5a7a5c;
  margin: 0 0 10px;
  font-style: italic;
}

.deep-result-card {
  background: linear-gradient(180deg, #ffffff 0%, #f4faf5 100%);
  border: 1.5px solid var(--green-border);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.5rem;
  text-align: center;
  box-shadow: var(--shadow-md);
  margin-bottom: 1.5rem;
}
.deep-result-big {
  font-size: 3rem;
  font-weight: 800;
  color: var(--green-dark);
  line-height: 1;
}
.deep-result-big span { font-size: 1.5rem; color: var(--text-faint); font-weight: 600; }
.deep-result-cap {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-family: var(--mono);
  margin-top: 6px;
}
.deep-result-sub {
  font-size: 14px;
  color: var(--text);
  margin: 0.9rem auto 0;
  max-width: 460px;
  line-height: 1.5;
}

.deep-group { margin-bottom: 1.4rem; }
.deep-group-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: 0.6rem;
}
.deep-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.deep-chip {
  font-size: 12px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 20px;
  border: 1px solid var(--border);
}
.deep-chip-ok   { background: #e8f5e9; border-color: #a5d6a7; color: #1b5e20; }
.deep-chip-done { background: #f5f5f5; border-color: #e0e0e0; color: #616161; }
.deep-chip-weak { background: #fff3e0; border-color: #ffcc80; color: #e65100; }

/* ══════════════════════════════════════════
   TOPIC PAGE
══════════════════════════════════════════ */
.topic-hero {
  background: var(--green-dark);
  padding: 2rem 3rem 2.25rem;
}

.topic-breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  transition: color 0.15s;
  margin-bottom: 1rem;
  font-family: var(--mono);
}
.topic-breadcrumb:hover { color: rgba(255,255,255,0.85); }
.topic-breadcrumb svg { width: 12px; height: 12px; }

.topic-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 800;
  line-height: 1.1;
  color: #ffffff;
  margin-bottom: 0.6rem;
}
.topic-title span { color: rgba(255,255,255,0.75); }

.topic-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.topic-desc-text { font-size: 13px; color: rgba(255,255,255,0.55); }

.topic-body {
  padding: 2.5rem 3rem 4rem;
  max-width: 820px;
}

/* ══════════════════════════════════════════
   THEORY COMPONENTS
══════════════════════════════════════════ */
.section-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--green-mid);
  font-family: var(--mono);
  margin: 2rem 0 1rem;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.concept-block { margin-bottom: 1.5rem; }
.concept-block h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: 0.5rem;
}
.concept-block p {
  font-size: 14px;
  color: var(--text-mid);
  line-height: 1.75;
}

.formula-box {
  background: var(--green-pale);
  border: 1.5px solid var(--green-border);
  border-radius: var(--radius);
  padding: 0.9rem 1.2rem;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--green-dark);
  margin: 0.75rem 0;
  font-weight: 500;
}
.formula-box .label {
  font-size: 9px;
  color: var(--text-faint);
  display: block;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.example-row { display: flex; gap: 10px; margin: 0.75rem 0; }

.ex-wrong {
  flex: 1;
  background: #fff5f5;
  border: 1.5px solid #ffcdd2;
  border-radius: var(--radius);
  padding: 0.7rem 1rem;
  font-size: 13.5px;
  color: var(--text);
}
.ex-right {
  flex: 1;
  background: #f1f8f1;
  border: 1.5px solid #c8e6c9;
  border-radius: var(--radius);
  padding: 0.7rem 1rem;
  font-size: 13.5px;
  color: var(--text);
}

.ex-tag {
  font-size: 10px;
  font-weight: 700;
  font-family: var(--mono);
  margin-bottom: 4px;
  display: block;
  letter-spacing: 0.08em;
}
.ex-wrong .ex-tag { color: var(--danger); }
.ex-right .ex-tag { color: var(--green-main); }

/* ── Tables ── */
.table-wrap {
  overflow-x: auto;
  margin: 0.75rem 0;
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-sm);
}

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }

th {
  background: var(--green-dark);
  color: rgba(255,255,255,0.85);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 10px 16px;
  text-align: left;
  font-family: var(--mono);
}

td {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  color: var(--text-mid);
  line-height: 1.5;
}

td:first-child {
  color: var(--green-dark);
  font-weight: 600;
  font-family: var(--mono);
  font-size: 12px;
}

tr:nth-child(even) td { background: var(--green-pale); }
tr:hover td { background: var(--surface-mid); }

/* ── Tip & Exam boxes ── */
.tip-box {
  background: #e3f2fd;
  border: 1.5px solid #90caf9;
  border-left: 4px solid #1976d2;
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  font-size: 13.5px;
  color: #0d3c6e;
  margin: 1rem 0;
  line-height: 1.65;
}
.tip-box strong,
.exam-box strong,
.infer-box strong {
  /* inline emphasis inside box body — just bold */
  font-weight: 700;
}
.tip-box > strong:first-child,
.exam-box > strong:first-child,
.infer-box > strong:first-child {
  /* box title: monospace label, uppercase, block */
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 6px;
}
.tip-box  > strong:first-child { color: #1565c0; }
.exam-box > strong:first-child { color: #2c5fa8; }
.infer-box > strong:first-child { color: #2d9966; }

.exam-box {
  background: var(--accent-bg);
  border: 1.5px solid var(--accent-border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  font-size: 13.5px;
  color: #1a3a6b;
  margin: 1rem 0;
  line-height: 1.65;
}
.exam-box li { margin-left: 1.25rem; margin-bottom: 4px; }
.exam-box ul { margin-top: 4px; }

/* ── Vocab grid ── */
.vocab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
  gap: 8px;
  margin: 0.75rem 0;
}

.vocab-item {
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s, border-color 0.15s;
}
.vocab-item:hover {
  border-color: var(--green-border);
  box-shadow: var(--shadow-md);
}

.vocab-word {
  font-size: 13px;
  font-weight: 700;
  color: var(--green-dark);
  font-family: var(--mono);
}

.vocab-def {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.vocab-ex {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 4px;
  font-style: italic;
  line-height: 1.4;
}

/* ══════════════════════════════════════════
   PRACTICE SECTION
══════════════════════════════════════════ */
.practice-section {
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-top: 2.5rem;
  box-shadow: var(--shadow-md);
}

.practice-header {
  background: var(--green-dark);
  padding: 1.1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.practice-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: rgba(255,255,255,0.9);
  font-family: var(--mono);
}

.score-display {
  font-family: var(--mono);
  font-size: 12px;
  color: rgba(255,255,255,0.55);
}
.score-display span {
  color: var(--accent-light);
  font-weight: 700;
  font-size: 15px;
}

.questions-body {
  padding: 1.5rem;
}

.question-block {
  margin-bottom: 1.75rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--border);
}
.question-block:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.q-type-badge {
  font-size: 9px;
  font-weight: 700;
  font-family: var(--mono);
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 6px;
}

.q-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--green-dark);
  margin-bottom: 1rem;
  line-height: 1.5;
}

/* ── Multiple choice ── */
.options { display: grid; gap: 7px; }

.option {
  touch-action: manipulation;
  background: #fafafa;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 0.7rem 1rem;
  cursor: pointer;
  font-size: 13.5px;
  color: var(--text-mid);
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 10px;
  user-select: none;
  line-height: 1.4;
}
.option:hover:not(.locked) {
  border-color: var(--green-border);
  background: var(--green-pale);
  color: var(--green-dark);
}
.option.correct {
  border-color: #66bb6a;
  background: #f1f8f1;
  color: #1b5e20;
  font-weight: 600;
}
.option.wrong {
  border-color: #ef9a9a;
  background: #fff5f5;
  color: var(--danger);
}
.option.reveal-correct {
  border-color: #a5d6a7;
  background: #f1f8f1;
  color: #2e7d32;
  font-weight: 600;
}

.option-letter {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  width: 22px; height: 22px;
  border-radius: 4px;
  background: var(--border);
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.option.correct .option-letter  { background: #c8e6c9; color: #1b5e20; }
.option.wrong .option-letter    { background: #ffcdd2; color: var(--danger); }

/* ── True / False ── */
.tf-options { display: flex; gap: 10px; }

.tf-btn {
  touch-action: manipulation;
  flex: 1;
  background: #fafafa;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-mid);
  text-align: center;
  transition: all 0.15s;
  font-family: var(--font);
}
.tf-btn:hover:not(.locked) {
  border-color: var(--green-border);
  background: var(--green-pale);
  color: var(--green-dark);
}
.tf-btn.correct {
  border-color: #66bb6a;
  background: #f1f8f1;
  color: #1b5e20;
}
.tf-btn.wrong {
  border-color: #ef9a9a;
  background: #fff5f5;
  color: var(--danger);
}
.tf-btn.reveal-correct {
  border-color: #a5d6a7;
  background: #f1f8f1;
  color: #2e7d32;
}

/* ── Word order ── */
.answer-area {
  background: var(--green-pale);
  border: 1.5px dashed var(--green-border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  min-height: 46px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  margin-bottom: 0.75rem;
  transition: all 0.15s;
}
.answer-area.correct-area {
  border-color: #66bb6a;
  background: #f1f8f1;
  border-style: solid;
}
.answer-area.wrong-area {
  border-color: #ef9a9a;
  background: #fff5f5;
  border-style: solid;
}

.word-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 0.75rem;
  min-height: 36px;
}

.word-chip {
  background: #ffffff;
  border: 1.5px solid var(--border-mid);
  border-radius: 5px;
  padding: 4px 12px;
  font-size: 12.5px;
  font-family: var(--mono);
  cursor: pointer;
  transition: all 0.15s;
  color: var(--green-dark);
  user-select: none;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
}
.word-chip:hover { border-color: var(--green-main); background: var(--green-pale); }
.word-chip.used  { opacity: 0.25; cursor: default; pointer-events: none; }
.word-chip.placed {
  background: var(--green-pale);
  border-color: var(--green-main);
  color: var(--green-dark);
  cursor: pointer;
}
.word-chip.placed:hover { background: var(--surface-mid); }

/* ── Feedback ── */
.q-feedback {
  font-size: 13.5px;
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: var(--radius);
  display: none;
  line-height: 1.55;
  font-weight: 500;
}
.q-feedback.show { display: block; }
.q-feedback.ok {
  background: #f1f8f1;
  color: #1b5e20;
  border: 1.5px solid #c8e6c9;
}
.q-feedback.err {
  background: #fff5f5;
  color: #c62828;
  border: 1.5px solid #ffcdd2;
}

/* ── Buttons ── */
.btn-row { display: flex; gap: 8px; margin-top: 0.75rem; flex-wrap: wrap; }

.check-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--green-main);
  color: #ffffff;
  border: none;
  border-radius: var(--radius);
  padding: 9px 20px;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.15s;
  box-shadow: 0 2px 6px rgba(46,125,50,0.3);
}
.check-btn:hover { background: var(--green-dark); }
.check-btn:disabled { opacity: 0.4; cursor: default; }

.reset-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: var(--text-muted);
  border: 1.5px solid var(--border-mid);
  border-radius: var(--radius);
  padding: 8px 16px;
  font-size: 13px;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.15s;
}
.reset-btn:hover { border-color: var(--green-border); color: var(--green-dark); }

/* Botón "Responder de nuevo" en preguntas de unidad (mc / tf) */
.retry-btn { margin-top: 12px; }

/* Stat de racha en el home hero */
.stat-streak .stat-num { color: #e65100; }

/* Toast / notificación flotante (racha, etc.) */
.app-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(140%);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(92vw, 420px);
  background: var(--green-dark);
  color: #ffffff;
  padding: 14px 18px;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  font-size: 14px;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.22,1,0.36,1), opacity 0.35s;
}
.app-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
.app-toast .toast-fire { font-size: 26px; line-height: 1; }
.app-toast strong { color: #b9f6ca; }

/* ── Progress bar ── */
.progress-bar-wrap {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin-top: 1.5rem;
}
.progress-bar-fill {
  height: 100%;
  background: var(--green-main);
  border-radius: 2px;
  transition: width 0.4s ease;
}

/* ══════════════════════════════════════════
   LOGIN PAGE
══════════════════════════════════════════ */
.login-page {
  min-height: 100vh;
  display: flex;
  background: var(--bg-page);
}

.login-left {
  flex: 1;
  background: var(--green-dark);
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.login-left::before {
  content: '';
  position: absolute;
  top: -100px; right: -100px;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: rgba(255,255,255,0.03);
}

.login-brand {
  position: relative;
  z-index: 1;
}

.login-brand-badge {
  display: inline-block;
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.85);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 4px;
  font-family: var(--mono);
  margin-bottom: 1.5rem;
  border: 1px solid rgba(255,255,255,0.2);
}

.login-brand h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  font-weight: 800;
  color: #ffffff;
  line-height: 1.1;
  margin-bottom: 1rem;
}

.login-brand h1 span { color: #ffffff; text-decoration: underline; text-decoration-color: var(--accent-light); text-underline-offset: 5px; }

.login-brand p {
  font-size: 15px;
  color: rgba(255,255,255,0.6);
  line-height: 1.65;
  max-width: 360px;
}

.login-brand-stats {
  display: flex;
  gap: 2rem;
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.login-stat-num {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1;
}
.login-stat-label {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  margin-top: 3px;
  font-family: var(--mono);
}

.login-right {
  width: 400px;
  flex-shrink: 0;
  background: #ffffff;
  padding: 3rem 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-right h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: 0.4rem;
}

.login-right-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.form-group { margin-bottom: 1.1rem; }

.form-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-family: var(--mono);
}

.form-input {
  width: 100%;
  background: var(--bg-page);
  border: 1.5px solid var(--border-mid);
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
  /* 16px keeps mobile browsers from auto-zooming the page on focus */
  font-size: 16px;
  color: var(--text);
  font-family: var(--font);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-input:focus {
  border-color: var(--green-main);
  box-shadow: 0 0 0 3px rgba(46,125,50,0.12);
  background: #ffffff;
}
.form-input::placeholder { color: var(--text-faint); }

.form-submit {
  width: 100%;
  background: var(--green-main);
  color: #ffffff;
  border: none;
  border-radius: var(--radius);
  padding: 0.85rem;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.15s;
  margin-top: 0.5rem;
  box-shadow: 0 3px 8px rgba(46,125,50,0.3);
}
.form-submit:hover { background: var(--green-dark); }

.form-error {
  color: var(--danger);
  font-size: 13px;
  margin-top: 0.6rem;
  padding: 8px 12px;
  background: var(--danger-bg);
  border-radius: var(--radius);
  display: none;
}
.form-error.show { display: block; }

.login-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}

.login-cta {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.65;
}
.login-cta a { color: var(--green-main); font-weight: 600; text-decoration: none; }
.login-cta a:hover { text-decoration: underline; }

.guest-btn {
  width: 100%;
  background: transparent;
  color: var(--text-muted);
  border: 1.5px solid var(--border-mid);
  border-radius: var(--radius);
  padding: 0.7rem;
  font-size: 13px;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.15s;
  margin-top: 0.75rem;
  font-weight: 500;
}
.guest-btn:hover { border-color: var(--green-border); color: var(--green-dark); background: var(--green-pale); }

/* ── Google button ── */
.google-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #ffffff;
  color: #3c4043;
  border: 1.5px solid #dadce0;
  border-radius: var(--radius);
  padding: 0 1rem;
  height: 44px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  margin-top: 0.25rem;
}
.google-btn:hover {
  background: #f8f9fa;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
  border-color: #c0c4c8;
}
.google-btn:active { background: #f1f3f4; }

/* ── Admin details (collapsible admin login) ── */
details.admin-details {
  margin-top: 0.25rem;
}
details.admin-details summary {
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  list-style: none;
  user-select: none;
  padding: 4px 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--border-mid);
}
details.admin-details summary::-webkit-details-marker { display: none; }
details.admin-details summary:hover { color: var(--green-dark); }

/* ── Admin invite code display ── */
.admin-card {
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
}
.admin-card h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: 0.25rem;
}
.invite-code-display {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 0.5rem;
}
.invite-code-display span {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--green-dark);
  background: var(--green-pale);
  border: 1.5px solid var(--green-border);
  border-radius: var(--radius);
  padding: 4px 14px;
  letter-spacing: 0.08em;
}

/* ══════════════════════════════════════════
   PAYWALL
══════════════════════════════════════════ */
.paywall-card {
  max-width: 480px;
  margin: 4rem auto;
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 3rem 2.5rem;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.paywall-icon {
  width: 56px; height: 56px;
  background: var(--green-pale);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1.25rem;
  font-size: 1.5rem;
}

.paywall-card h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: 0.75rem;
}

.paywall-card p {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.75;
  margin-bottom: 1.75rem;
}

.paywall-contact {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--green-main);
  color: #ffffff;
  padding: 0.85rem 1.75rem;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s;
  box-shadow: 0 3px 8px rgba(46,125,50,0.3);
}
.paywall-contact:hover { background: var(--green-dark); }

.paywall-note { font-size: 12px; color: var(--text-faint); margin-top: 1rem; }

.paywall-back {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--text-muted); cursor: pointer;
  margin-bottom: 2rem; transition: color 0.15s; font-family: var(--mono);
}
.paywall-back:hover { color: var(--green-main); }
.paywall-back svg { width: 12px; height: 12px; }

/* ══════════════════════════════════════════
   ADMIN PAGE
══════════════════════════════════════════ */
.admin-hero {
  background: var(--green-dark);
  padding: 2rem 3rem;
}
.admin-hero h1 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.25rem;
}
.admin-hero p { font-size: 13px; color: rgba(255,255,255,0.55); }

.admin-body { padding: 2rem 3rem 4rem; }

.admin-table-wrap {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 1.5rem 0;
  box-shadow: var(--shadow-sm);
}

.admin-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.admin-table th {
  background: var(--green-dark);
  color: rgba(255,255,255,0.8);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 10px 16px;
  text-align: left;
  font-family: var(--mono);
}
.admin-table td { padding: 11px 16px; border-top: 1px solid var(--border); color: var(--text-mid); }
.admin-table tr:hover td { background: var(--green-pale); }

.status-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 3px;
  font-family: var(--mono);
  letter-spacing: 0.08em;
}
.status-active   { background: #e8f5e9; color: #1b5e20; }
.status-inactive { background: #f5f5f5; color: #757575; }

.admin-actions { display: flex; gap: 6px; }

.btn-sm {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font);
  font-weight: 600;
  border: 1.5px solid;
  transition: all 0.15s;
}
.btn-activate   { background: #e8f5e9; color: #2e7d32; border-color: #a5d6a7; }
.btn-activate:hover { background: #c8e6c9; }
.btn-deactivate { background: var(--accent-bg); color: #1565c0; border-color: var(--accent-border); }
.btn-deactivate:hover { background: #d0e8ff; }
.btn-delete     { background: transparent; color: #757575; border-color: var(--border-mid); }
.btn-delete:hover { color: var(--danger); border-color: #ffcdd2; background: #fff5f5; }

.add-user-form {
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.add-user-form h3 { font-size: 14px; font-weight: 700; color: var(--green-dark); margin-bottom: 1rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-add-btn {
  background: var(--green-main);
  color: #ffffff;
  border: none;
  border-radius: var(--radius);
  padding: 0.7rem 1.5rem;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  margin-top: 0.75rem;
  transition: background 0.15s;
  box-shadow: 0 2px 6px rgba(46,125,50,0.25);
}
.form-add-btn:hover { background: var(--green-dark); }

/* ══════════════════════════════════════════
   CHECKLIST
══════════════════════════════════════════ */
.checklist-body { padding: 2.5rem 3rem 4rem; }

.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}
.checklist-item:last-child { border-bottom: none; }

.check-checkbox {
  width: 20px; height: 20px;
  border: 2px solid var(--border-mid);
  border-radius: 4px;
  flex-shrink: 0;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
  margin-top: 1px;
  background: #fafafa;
}
.check-checkbox:hover { border-color: var(--green-main); }
.check-checkbox.checked { background: var(--green-main); border-color: var(--green-main); }
.check-checkbox.checked::after {
  content: '✓';
  font-size: 11px;
  color: #ffffff;
  font-weight: 700;
}

.checklist-text { font-size: 14px; color: var(--text-mid); line-height: 1.6; }
.checklist-text.checked { text-decoration: line-through; color: var(--text-faint); }

/* ══════════════════════════════════════════
   TENSE LESSON COMPONENTS
══════════════════════════════════════════ */
.tense-lesson {
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.tense-lesson-header {
  background: var(--green-dark);
  padding: 0.9rem 1.4rem;
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}

.tense-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.01em;
}

.tense-kw {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent-light);
  letter-spacing: 0.06em;
}

.tense-formula-block {
  background: var(--green-pale);
  border-bottom: 1px solid var(--green-border);
  padding: 0.8rem 1.4rem;
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--green-dark);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.tense-formula-block > * { min-width: 0; }

.tense-formula-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
  background: var(--surface-mid);
  padding: 2px 8px;
  border-radius: 3px;
}

.tense-aux-note {
  padding: 0.6rem 1.4rem;
  font-size: 13px;
  color: var(--text-muted);
  background: var(--surface-soft);
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
}
.tense-aux-note strong { color: var(--green-dark); }

.tense-body {
  padding: 1.2rem 1.4rem;
}

/* Inference and discard hint boxes */
.infer-box {
  background: #f0fff4;
  border: 1.5px solid #b7e4c7;
  border-left: 4px solid #2d9966;
  border-radius: var(--radius-lg);
  padding: 0.9rem 1.2rem;
  font-size: 14px;
  color: #1a5c38;
  margin: 0.85rem 0;
  line-height: 1.65;
}

.discard-box {
  background: #fff5f5;
  border: 1.5px solid #ffc9c9;
  border-left: 4px solid var(--danger);
  border-radius: var(--radius-lg);
  padding: 0.9rem 1.2rem;
  font-size: 14px;
  color: #7b1a1a;
  margin: 0.85rem 0;
  line-height: 1.65;
}
.discard-box strong {
  display: block;
  font-family: var(--mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--danger);
  margin-bottom: 5px;
}

/* ══════════════════════════════════════════
   FONT SIZE INCREASES
══════════════════════════════════════════ */
.q-text        { font-size: 17px !important; }
.option        { font-size: 15px !important; }
.concept-block p { font-size: 16px !important; }
.formula-box   { font-size: 15px !important; }
.checklist-text { font-size: 15.5px !important; }
.infer-box,
.discard-box   { font-size: 14.5px !important; }
.tf-btn        { font-size: 15px !important; }
table td       { font-size: 14.5px !important; line-height: 1.6; }
table th       { font-size: 11px !important; }
.topic-body > p { font-size: 16px !important; }
.vocab-def     { font-size: 13px !important; }
.vocab-word    { font-size: 14px !important; }

/* ══════════════════════════════════════════
   METHOD INTRO — landing section for guests
══════════════════════════════════════════ */
.method-intro {
  margin-bottom: 2.5rem;
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
}

.method-intro-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-family: var(--mono);
  margin-bottom: 1.25rem;
}

.method-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 1.5rem;
}

.method-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 1rem;
  background: var(--bg-page);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
}

.mc-num {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-bg);
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--accent-border);
}

.mc-content {}

.mc-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: 4px;
  line-height: 1.3;
}

.mc-body {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.6;
}

.mc-body em {
  font-style: normal;
  font-weight: 700;
  color: var(--green-dark);
  font-family: var(--mono);
}

.method-cta-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.cta-primary {
  background: var(--green-main);
  color: #ffffff;
  border: none;
  border-radius: var(--radius);
  padding: 10px 22px;
  font-size: 13.5px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.15s;
  box-shadow: 0 2px 8px rgba(46,125,50,0.28);
}
.cta-primary:hover { background: var(--green-dark); }

.cta-secondary {
  background: transparent;
  color: var(--text-muted);
  border: 1.5px solid var(--border-mid);
  border-radius: var(--radius);
  padding: 9px 18px;
  font-size: 13px;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.15s;
}
.cta-secondary:hover { border-color: var(--accent-border); color: var(--accent); background: var(--accent-bg); }

/* Mobile login button in header */
.mobile-login-btn {
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.9);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius);
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.mobile-login-btn:hover { background: rgba(255,255,255,0.2); }

/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */
@media (max-width: 900px) {
  .login-left { display: none; }
  .login-right { width: 100%; padding: 2rem 1.5rem; }
}

@media (max-width: 768px) {
  .mobile-header { display: flex; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }
  .main-content { margin-left: 0; }

  .home-hero,
  .home-body,
  .topic-hero,
  .topic-body,
  .admin-hero,
  .admin-body,
  .checklist-body {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
  .home-body { padding-top: 5rem; }

  /* Clear the fixed 54px header + notch safe-area so nothing hides behind it.
     topic/admin heroes had only 2rem top, leaving the breadcrumb under the header. */
  .home-hero  { padding-top: calc(3.5rem + env(safe-area-inset-top)); }
  .topic-hero { padding-top: calc(54px + 0.9rem + env(safe-area-inset-top)); }
  .admin-hero { padding-top: calc(54px + 0.9rem + env(safe-area-inset-top)); }
  /* Drawer slides in below the header instead of being covered by it */
  .sidebar { top: calc(54px + env(safe-area-inset-top)); }

  /* ── Panel admin: tablas anchas → tarjetas apiladas en mobile ── */
  .admin-hero h1 { font-size: 1.4rem; }
  .admin-table-wrap {
    overflow: visible;
    border: none;
    box-shadow: none;
    border-radius: 0;
    margin: 1rem 0;
  }
  /* La barra verde de título de tabla queda redondeada arriba */
  .admin-table-wrap > div:first-child { border-radius: var(--radius) var(--radius) 0 0; }
  .admin-table thead { display: none; }
  .admin-table,
  .admin-table tbody,
  .admin-table tr,
  .admin-table td { display: block; width: 100%; }
  .admin-table tr {
    background: #ffffff;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1rem;
    overflow: hidden;
  }
  .admin-table tr:hover td { background: transparent; }
  .admin-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    border-top: none;
    padding: 10px 14px;
    text-align: right;
  }
  .admin-table td + td { border-top: 1px solid var(--border); }
  .admin-table td::before {
    content: attr(data-label);
    font-family: var(--mono);
    font-size: 9.5px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    font-weight: 700;
    text-align: left;
    flex-shrink: 0;
  }
  /* Celdas con contenido ancho: etiqueta arriba, contenido debajo */
  .admin-table td[data-label="Progreso"],
  .admin-table td[data-label="Acciones"] {
    flex-direction: column;
    align-items: stretch;
    text-align: left;
    gap: 7px;
  }
  /* Simulacros: etiqueta arriba, los 3 chips en fila debajo */
  .admin-table td[data-label="Simulacros"] {
    flex-wrap: wrap;
    justify-content: flex-start;
    text-align: left;
    gap: 4px 6px;
  }
  .admin-table td[data-label="Simulacros"]::before { flex-basis: 100%; }
  .admin-table .admin-actions { flex-wrap: wrap; }
  .admin-table .btn-sm { flex: 1 1 auto; min-width: 90px; min-height: 38px; text-align: center; }
  /* Fila "sin datos" (colspan) vuelve a bloque centrado, sin etiqueta */
  .admin-table td[colspan] { display: block; text-align: center; }
  .admin-table td[colspan]::before { content: none; }

  /* Formulario "agregar alumno": una sola columna + código que envuelve */
  .form-row { grid-template-columns: 1fr; }
  .invite-code-display { flex-wrap: wrap; }

  /* Bigger, finger-friendly tap targets (~44px) */
  .nav-item { padding: 0.72rem 1.4rem; font-size: 14px; }
  .option { padding: 0.85rem 1rem; font-size: 15px; }
  .tf-btn { padding: 0.9rem; font-size: 15px; }
  .word-chip { padding: 0.6rem 0.9rem; font-size: 14px; }
  .word-chip.placed { padding: 0.6rem 0.9rem; }
  .check-btn, .reset-btn { padding: 0.7rem 1.25rem; font-size: 14px; min-height: 44px; }
  .topic-breadcrumb, .paywall-back { padding: 0.35rem 0; display: inline-flex; }
  .logout-btn { padding: 0.5rem; }

  /* ── Paywall / lock cards: fit small screens with less scroll ── */
  /* The contextual paywall & seq-lock cards used big desktop margins+padding,
     pushing content past the fold. Tighten everything on mobile. */
  .paywall-card { margin: 1.25rem auto; padding: 1.75rem 1.25rem; border-radius: var(--radius-lg); }
  .paywall-back { margin-bottom: 1.25rem; }
  .paywall-icon { width: 48px; height: 48px; margin-bottom: 0.9rem; font-size: 1.3rem; }
  .paywall-card h2 { font-size: 1.2rem; line-height: 1.3; margin-bottom: 0.6rem; }
  .paywall-card p { font-size: 14px; line-height: 1.6; margin-bottom: 1rem; }
  /* Full-width CTA = bigger, easier tap target on phones */
  .paywall-contact { display: flex; width: 100%; justify-content: center; padding: 0.95rem 1.25rem; }

  .topic-grid { grid-template-columns: 1fr 1fr; }
  .method-cards { grid-template-columns: 1fr; }
  .method-cta-bar { flex-direction: column; align-items: stretch; }
  .method-cta-bar button { text-align: center; }
  .example-row { flex-direction: column; }

  /* ── Theory boxes: fit mobile without horizontal scroll ── */
  /* Shrink table cells so the table's min-content width fits the viewport
     (~335px) instead of forcing the .table-wrap to scroll horizontally. */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { font-size: 12.5px; table-layout: fixed; }
  table th,
  table td {
    padding: 7px 8px;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
  }
  table td { font-size: 12.5px !important; line-height: 1.5; }
  table th { font-size: 9.5px !important; }
  table td:first-child { font-size: 11px !important; }

  /* Formula blocks wrap their text instead of overflowing the rounded card */
  .tense-formula-block { padding: 0.7rem 1rem; font-size: 13.5px; }
  .tense-aux-note { padding: 0.55rem 1rem; font-size: 12px; }
  .tense-body { padding: 1rem; }
  .tense-lesson-header { padding: 0.8rem 1rem; }
  .form-row { grid-template-columns: 1fr; }
  .hero-stats { flex-direction: column; gap: 0.75rem; }
  .stat { border-right: none; margin-right: 0; padding-right: 0; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 0.75rem; }
  .stat:last-child { border-bottom: none; }
}

@media (max-width: 480px) {
  .topic-grid { grid-template-columns: 1fr; }
  .vocab-grid { grid-template-columns: 1fr 1fr; }
  .tf-options { flex-direction: column; }
}

/* ── Simulacro engine ─────────────────────────────── */
.q-num-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--green-main);
  text-transform: uppercase;
  margin-bottom: .45rem;
}

.option.sim-selected {
  border-color: var(--green-main);
  background: #e8f5e9;
  color: var(--green-dark);
}

.tf-btn.sim-selected {
  border-color: var(--green-main);
  background: #e8f5e9;
  color: var(--green-dark);
  font-weight: 600;
}

.sim-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
  padding: 1.25rem 1.5rem;
  background: #f1f8e9;
  border: 1.5px solid var(--green-main);
  border-radius: 12px;
}

.sim-count-wrap {
  font-size: 14px;
  color: var(--text-muted);
  font-family: var(--mono);
}

.sim-submit-btn {
  touch-action: manipulation;
  background: var(--green-main);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: .75rem 1.5rem;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
}
.sim-submit-btn:hover { background: var(--green-dark); }

.sim-result {
  margin-top: 2rem;
  padding: 2rem;
  border-radius: 14px;
  text-align: center;
  border: 2px solid;
}
.sim-pass { background: #e8f5e9; border-color: #4caf50; color: #1b5e20; }
.sim-fail { background: #fce4ec; border-color: #e91e63; color: #880e4f; }

.sim-result-score {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: .35rem;
}
.sim-result-label {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: .4rem;
}
.sim-result-sub {
  font-size: 14px;
  opacity: .75;
  margin-bottom: 1.25rem;
}
.sim-retry-btn {
  background: transparent;
  border: 2px solid currentColor;
  border-radius: 8px;
  padding: .55rem 1.25rem;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  color: inherit;
  transition: opacity .2s;
}
.sim-retry-btn:hover { opacity: .7; }

/* ══════════════════════════════════════════
   LARGE SCREENS (≥ 1280px)
══════════════════════════════════════════ */
@media (min-width: 1280px) {
  body { font-size: 17px; }

  .sidebar { width: 300px; }
  .main-content { margin-left: 300px; }

  .home-hero { padding: 4rem 4rem 3.5rem; }
  .home-body { padding: 3rem 4rem 5rem; max-width: 1300px; }

  .hero-sub { max-width: 560px; font-size: 16px; }
  .stat-num { font-size: 2.4rem; }

  .topic-hero { padding: 2.5rem 4rem 2.75rem; }
  .topic-body { padding: 3rem 4rem 5rem; max-width: 920px; }

  .topic-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
  .topic-card { padding: 1.25rem 1.4rem; }
  .topic-card-title { font-size: 14.5px; }

  .concept-block h3 { font-size: 17px; }
  .concept-block p  { font-size: 15px; }
  table { font-size: 14.5px; }
  .tip-box, .exam-box, .infer-box { font-size: 14.5px; padding: 1.1rem 1.4rem; }

  .exercise-block { padding: 1.25rem 1.4rem; }
  .q-text { font-size: 15px; }
  .option { font-size: 14px; padding: .65rem 1rem; }
  .tf-btn { font-size: 14px; padding: .65rem 1.4rem; }

  .login-right { padding: 3rem 4rem; max-width: 480px; margin: 0 auto; }
}

/* ══════════════════════════════════════════
   EXTRA LARGE SCREENS (≥ 1600px)
══════════════════════════════════════════ */
@media (min-width: 1600px) {
  body { font-size: 18px; }

  .sidebar { width: 320px; }
  .main-content { margin-left: 320px; }

  .sidebar-logo { padding: 2rem 1.75rem 1.5rem; }
  .logo-title { font-size: 1.4rem; }
  .nav-item { font-size: 14px; padding: .55rem 1.75rem; }
  .nav-item-num { font-size: 11px; width: 26px; }

  .home-hero { padding: 5rem 5rem 4rem; }
  .home-body { padding: 3.5rem 5rem 6rem; max-width: 1500px; }

  .hero-sub { font-size: 17px; max-width: 640px; }
  .stat-num { font-size: 2.75rem; }
  .stat-label { font-size: 12px; }

  .topic-hero { padding: 3rem 5rem 3.25rem; }
  .topic-body { padding: 3.5rem 5rem 6rem; max-width: 1040px; }

  .topic-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
  .topic-card { padding: 1.4rem 1.6rem; }
  .topic-card-title { font-size: 15px; }
  .topic-card-qs { font-size: 12px; }

  .concept-block h3 { font-size: 18px; }
  .concept-block p  { font-size: 16px; }
  table { font-size: 15px; }
  .tip-box, .exam-box, .infer-box { font-size: 15px; }

  .exercise-block { padding: 1.5rem 1.6rem; }
  .q-text { font-size: 16px; }
  .option { font-size: 15px; padding: .7rem 1.1rem; }
  .tf-btn { font-size: 15px; padding: .7rem 1.6rem; }

  .formula-box { font-size: 15px; padding: 1rem 1.4rem; }

  .fc-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .7rem; }
  .fc { height: 90px; }
  .fc-w { font-size: 1rem; }
  .fc-d { font-size: .82rem; }
  .fc-e { font-size: .72rem; }

  .sim-result-score { font-size: 3.5rem; }
  .sim-result-label { font-size: 1.5rem; }
}

/* ── Vocabulary Flashcards ──────────────────────────── */
.fc-legend { display:flex; align-items:center; gap:6px; font-size:12px; color:var(--text-muted); margin:.75rem 0 1.25rem; }
.fc-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(145px,1fr)); gap:.55rem; margin-bottom:1.5rem; }
.fc { height:80px; perspective:600px; cursor:pointer; user-select:none; }
.fc-i { position:relative; width:100%; height:100%; transition:transform .35s; transform-style:preserve-3d; }
.fc.fc-flip .fc-i { transform:rotateY(180deg); }
.fc-f, .fc-b { position:absolute; inset:0; backface-visibility:hidden; border-radius:8px; display:flex; flex-direction:column; align-items:center; justify-content:center; padding:.4rem .6rem; text-align:center; }
.fc-f { background:var(--green-pale); border:1.5px solid var(--border); }
.fc-b { background:var(--green-dark); color:#fff; transform:rotateY(180deg); }
.fc-w { font-weight:700; font-size:.88rem; color:var(--green-dark); }
.fc-d { font-size:.75rem; font-weight:600; margin-bottom:2px; }
.fc-e { font-size:.65rem; opacity:.75; font-style:italic; line-height:1.3; }

/* ── Next Topic Bar ─────────────────────────── */
.next-topic-bar { padding: 0 3rem 3rem; }
.next-topic-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: var(--green-pale);
  border: 1.5px solid var(--green-border);
  border-radius: var(--radius-lg);
}
.next-topic-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  font-family: var(--mono);
  white-space: nowrap;
}
.next-topic-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--green-dark);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: .65rem 1.25rem;
  font-size: 16px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: background .15s;
  touch-action: manipulation;
}
.next-topic-btn:hover { background: var(--green-mid); }
@media (max-width: 768px) {
  .next-topic-bar { padding: 0 1.25rem 2rem; }
  .next-topic-wrap { flex-direction: column; align-items: flex-start; gap: .75rem; }
  .next-topic-btn { width: 100%; justify-content: space-between; }
}

/* ══════════════════════════════════════════
   DIAGNÓSTICO — CTA en home (invitado)
══════════════════════════════════════════ */
.diag-cta {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  background: linear-gradient(135deg, var(--green-dark), var(--green-mid));
  color: #fff;
  border-radius: var(--radius-xl);
  padding: 1.5rem 1.75rem;
  margin: 1.5rem 0;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: transform .12s, box-shadow .15s;
}
.diag-cta:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.diag-cta:active { transform: scale(.99); }
.diag-cta-icon { font-size: 2.4rem; line-height: 1; }
.diag-cta-body { flex: 1 1 240px; }
.diag-cta-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: .35rem;
}
.diag-cta-sub { font-size: 14px; line-height: 1.5; color: rgba(255,255,255,0.88); }
.diag-cta-sub strong { color: #fff; }
.diag-cta-btn {
  background: #fff;
  color: var(--green-dark);
  border: none;
  border-radius: var(--radius);
  padding: .8rem 1.4rem;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, transform .08s;
}
.diag-cta-btn:hover { background: var(--green-pale); }
.diag-cta:active .diag-cta-btn { transform: scale(.97); }

/* ── Diagnóstico — enunciado de lectura (passage) ── */
.diag-passage {
  background: var(--surface-soft);
  border-left: 3px solid var(--green-border);
  border-radius: var(--radius);
  padding: .85rem 1rem;
  margin: .75rem 0;
  font-style: italic;
  color: var(--text-mid);
  font-size: 15px;
  line-height: 1.6;
}

/* ── Diagnóstico — barra de progreso ── */
.diag-progress-track {
  height: 8px;
  background: var(--surface-soft, #e8f5e9);
  border-radius: 20px;
  overflow: hidden;
  margin: 0 0 1.5rem;
}
.diag-progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #2e7d32, #4caf50);
  border-radius: 20px;
  transition: width .4s cubic-bezier(.2,.7,.3,1);
}

/* ═══════════════ FLASHQUIZ (Vocabulario) ═══════════════ */
.deck-intro {
  font-size: 14px;
  color: #5a7a5c;
  line-height: 1.6;
  background: var(--surface-soft, #f1f8f2);
  border: 1px solid #d9ead9;
  border-radius: 14px;
  padding: 0.9rem 1.1rem;
  margin-bottom: 1.4rem;
}
.deck-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.85rem;
}
.deck-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  text-align: left;
  background: #fff;
  border: 1.5px solid #e0ece0;
  border-radius: 16px;
  padding: 1rem 1.05rem;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  font-family: inherit;
}
.deck-card:hover {
  transform: translateY(-3px);
  border-color: #4caf50;
  box-shadow: 0 8px 22px rgba(27, 94, 32, .12);
}
.deck-card-top {
  background: linear-gradient(135deg, #fffdf3, #fff6d9);
  border-color: #ffca28;
}
.deck-card-top:hover { border-color: #ffb300; box-shadow: 0 8px 22px rgba(255, 179, 0, .22); }
.deck-emoji { font-size: 26px; line-height: 1; }
.deck-name { font-weight: 700; font-size: 15px; color: #1b3d1e; line-height: 1.25; }
.deck-count { font-size: 12px; color: #7a927c; }

.flash-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.9rem;
}
.flash-exit {
  border: none;
  background: #eef4ee;
  color: #4a6a4c;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border-radius: 20px;
  cursor: pointer;
}
.flash-exit:hover { background: #e0ece0; }
.flash-deck-name { font-size: 13px; font-weight: 600; color: #7a927c; }

.flash-card {
  background: #fff;
  border: 1.5px solid #e6efe6;
  border-radius: 20px;
  padding: 1.6rem 1.3rem;
  box-shadow: 0 6px 20px rgba(27, 94, 32, .06);
}
.flash-prompt {
  text-align: center;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #9bb09d;
  font-weight: 700;
  margin-bottom: 0.4rem;
}
.flash-word {
  text-align: center;
  font-size: clamp(28px, 7vw, 40px);
  font-weight: 800;
  color: #14401a;
  line-height: 1.1;
  margin-bottom: 1.4rem;
  word-break: break-word;
}
.flash-options { display: flex; flex-direction: column; gap: 0.6rem; }
.flash-opt {
  text-align: left;
  background: #f7fbf7;
  border: 1.5px solid #e0ece0;
  border-radius: 13px;
  padding: 0.85rem 1rem;
  font-family: inherit;
  font-size: 15px;
  color: #234223;
  cursor: pointer;
  transition: background .12s, border-color .12s, transform .08s;
}
.flash-opt:hover { border-color: #4caf50; background: #eef8ee; }
.flash-opt:active { transform: scale(.99); }
.flash-options.locked .flash-opt { cursor: default; }
.flash-opt.done { opacity: .65; }
.flash-opt.correct {
  background: #e7f6e7;
  border-color: #43a047;
  color: #1b5e20;
  font-weight: 700;
  opacity: 1;
}
.flash-opt.wrong {
  background: #fdecec;
  border-color: #e53935;
  color: #b71c1c;
  opacity: 1;
}
.flash-reveal {
  display: none;
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  background: #fff8e6;
  border: 1px solid #ffe082;
  border-radius: 13px;
  font-size: 14.5px;
  color: #5d4a12;
  line-height: 1.5;
}
.flash-reveal.show { display: block; }
.flash-reveal strong { color: #14401a; }
.flash-ex { display: block; margin-top: 0.35rem; font-style: italic; color: #8a7a3a; font-size: 13.5px; }
.flash-footer { margin-top: 1rem; text-align: right; min-height: 1px; }

.flash-result {
  text-align: center;
  background: #fff;
  border: 1.5px solid #e6efe6;
  border-radius: 20px;
  padding: 2.2rem 1.4rem;
  box-shadow: 0 6px 20px rgba(27, 94, 32, .06);
}
.flash-result-emoji { font-size: 48px; line-height: 1; }
.flash-result-pct { font-size: 56px; font-weight: 800; color: #1b5e20; line-height: 1.05; margin-top: 0.5rem; }
.flash-result-sub { font-size: 13px; color: #9bb09d; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.flash-result-detail { font-size: 14px; color: #5a7a5c; margin-top: 0.6rem; }
.flash-result-msg { font-size: 15px; color: #2f4a31; line-height: 1.6; margin: 1rem auto 1.4rem; max-width: 340px; }
.flash-result-actions { display: flex; flex-direction: column; gap: 0.6rem; align-items: center; }
.flash-result-actions .sim-submit-btn, .flash-result-actions .reset-btn { width: 100%; max-width: 260px; }

/* ═══════════════ NUDGE DE REFERIDO (pop-up) ═══════════════ */
.ref-nudge-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(15, 40, 18, .55);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.1rem;
  opacity: 0;
  transition: opacity .25s ease;
}
.ref-nudge-overlay.show { opacity: 1; }
.ref-nudge {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 22px;
  padding: 1.9rem 1.5rem 1.4rem;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .3);
  transform: translateY(14px) scale(.98);
  transition: transform .28s cubic-bezier(.2,.8,.3,1);
}
.ref-nudge-overlay.show .ref-nudge { transform: translateY(0) scale(1); }
.ref-nudge-close {
  position: absolute;
  top: 0.8rem;
  right: 0.9rem;
  border: none;
  background: none;
  font-size: 18px;
  color: #a9bcaa;
  cursor: pointer;
  line-height: 1;
}
.ref-nudge-close:hover { color: #5a7a5c; }
.ref-nudge-emoji { font-size: 42px; line-height: 1; }
.ref-nudge-title {
  font-family: var(--font-display, serif);
  font-size: 21px;
  color: #14401a;
  line-height: 1.25;
  margin: 0.7rem 0 0.5rem;
}
.ref-nudge-sub { font-size: 14px; color: #5a7a5c; line-height: 1.55; margin: 0 0 1.2rem; }
.ref-nudge-sub strong { color: #1b5e20; }
.ref-nudge-linkrow { display: flex; gap: 0.45rem; margin-bottom: 0.7rem; }
.ref-nudge-input {
  flex: 1;
  min-width: 0;
  border: 1.5px solid #e0ece0;
  border-radius: 11px;
  padding: 0.6rem 0.7rem;
  font-size: 13px;
  color: #3a5a3c;
  background: #f7fbf7;
  font-family: inherit;
}
.ref-nudge-copy {
  border: none;
  background: #eef4ee;
  color: #2e5d32;
  font-weight: 700;
  font-size: 13px;
  padding: 0 1rem;
  border-radius: 11px;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.ref-nudge-copy:hover { background: #e0ece0; }
.ref-nudge-wa {
  display: block;
  background: #25d366;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  padding: 0.8rem;
  border-radius: 13px;
  transition: filter .12s;
}
.ref-nudge-wa:hover { filter: brightness(.95); }
.ref-nudge-later {
  border: none;
  background: none;
  color: #9bb09d;
  font-size: 13.5px;
  font-family: inherit;
  cursor: pointer;
  margin-top: 0.9rem;
  padding: 0.3rem;
}
.ref-nudge-later:hover { color: #5a7a5c; text-decoration: underline; }
.diag-nav { justify-content: flex-end; }

/* ── Diagnóstico — resultado ── */
.diag-result-card {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
}
.diag-ring-wrap { flex: 0 0 auto; width: 150px; }
.diag-ring { width: 150px; height: 150px; display: block; }
.diag-ring-pct {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  fill: var(--green-dark);
}
.diag-ring-frac { font-size: 12px; font-weight: 600; fill: var(--text-muted); }
.diag-result-info { flex: 1 1 260px; }
.diag-level {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--green-dark);
  line-height: 1.15;
  margin-bottom: .4rem;
}
.diag-blurb { font-size: 15px; color: var(--text-mid); line-height: 1.55; margin-bottom: 1rem; }
.diag-time-box {
  background: var(--green-pale);
  border: 1px solid var(--green-border);
  border-radius: var(--radius-lg);
  padding: .85rem 1.1rem;
}
.diag-time-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-muted);
  font-family: var(--mono);
  margin-bottom: .2rem;
}
.diag-time-val { font-size: 1.2rem; font-weight: 700; color: var(--green-dark); }

.diag-weak { margin-bottom: 1.5rem; }
.diag-weak-title { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: .65rem; }
.diag-weak-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.diag-weak-chip {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid #f5c6c6;
  border-radius: 999px;
  padding: .35rem .85rem;
  font-size: 13px;
  font-weight: 600;
}

.diag-final-cta {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  text-align: center;
}
.diag-final-cta h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--green-dark);
  margin-bottom: .5rem;
}
.diag-final-cta p { font-size: 15px; color: var(--text-mid); line-height: 1.55; max-width: 520px; margin: 0 auto 1.25rem; }
.diag-cta-buttons { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: center; margin-bottom: 1rem; }
.btn-wa-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #25d366;
  color: #fff;
  text-decoration: none;
  border-radius: var(--radius);
  padding: .85rem 1.4rem;
  font-size: 15px;
  font-weight: 700;
  transition: background .15s, transform .08s;
}
.btn-wa-inline:hover { background: #1eb455; }
.btn-wa-inline:active { transform: translateY(1px) scale(.99); }
.diag-retry {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.diag-retry:hover { color: var(--green-dark); }

/* ══════════════════════════════════════════
   REPASO INTELIGENTE
══════════════════════════════════════════ */
.review-empty {
  text-align: center;
  padding: 3rem 1.5rem;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
}
.review-empty-icon { font-size: 3rem; margin-bottom: .5rem; }
.review-empty h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--green-dark);
  margin-bottom: .5rem;
}
.review-empty p { font-size: 15px; color: var(--text-mid); max-width: 420px; margin: 0 auto 1.5rem; line-height: 1.55; }
.review-cleared { opacity: .55; transition: opacity .3s; }
.review-cleared-note {
  margin-top: .75rem;
  color: var(--success);
  font-size: 13px;
  font-weight: 700;
}

/* ══════════════════════════════════════════
   REFERIDOS — Pack Aprobados
══════════════════════════════════════════ */
.pack-value {
  background: linear-gradient(135deg, var(--green-pale), var(--surface-mid));
  border: 1px solid var(--green-border);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
}
.pack-value-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--green-dark);
  margin-bottom: 1rem;
}
.pack-value-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}
.pack-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.25rem;
}
.pack-item-h { font-size: 15px; font-weight: 700; color: var(--green-dark); margin-bottom: .4rem; }
.pack-item-b { font-size: 13.5px; color: var(--text-mid); line-height: 1.5; }
.pack-value-note { font-size: 14px; color: var(--text-mid); line-height: 1.5; }
.pack-value-note strong { color: var(--green-dark); }

.ref-link-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.ref-link-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-muted);
  font-family: var(--mono);
  margin-bottom: .6rem;
}
.ref-link-row { display: flex; gap: .5rem; margin-bottom: .85rem; flex-wrap: wrap; }
.ref-link-input {
  flex: 1 1 220px;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius);
  padding: .7rem .9rem;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-mid);
  background: var(--bg-page);
}
.ref-link-input:focus { outline: none; border-color: var(--green-light); }
.ref-copy-btn {
  background: var(--green-dark);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: .7rem 1.3rem;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, transform .08s;
}
.ref-copy-btn:hover { background: var(--green-mid); }
.ref-copy-btn:active { transform: scale(.97); }
.ref-wa-btn {
  display: inline-flex;
  align-items: center;
  background: #25d366;
  color: #fff;
  text-decoration: none;
  border-radius: var(--radius);
  padding: .8rem 1.4rem;
  font-size: 15px;
  font-weight: 700;
  transition: background .15s, transform .08s;
}
.ref-wa-btn:hover { background: #1eb455; }
.ref-wa-btn:active { transform: translateY(1px) scale(.99); }

.ref-progress {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.25rem;
}
.ref-progress.ref-won {
  background: linear-gradient(135deg, var(--green-dark), var(--green-mid));
  border-color: var(--green-dark);
  color: #fff;
}
.ref-progress-head { display: flex; align-items: baseline; gap: .75rem; flex-wrap: wrap; margin-bottom: .5rem; }
.ref-progress-num {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: var(--green-dark);
  line-height: 1;
}
.ref-won .ref-progress-num { color: #fff; }
.ref-progress-label { font-size: 15px; font-weight: 600; color: var(--text-mid); }
.ref-won .ref-progress-label { color: rgba(255,255,255,0.92); }
.ref-progress-hint { font-size: 14px; color: var(--text-muted); line-height: 1.5; }
.ref-claim-btn {
  display: inline-block;
  background: #fff;
  color: var(--green-dark);
  text-decoration: none;
  border-radius: var(--radius);
  padding: .85rem 1.5rem;
  font-size: 15px;
  font-weight: 700;
  margin-top: .75rem;
  transition: transform .08s;
}
.ref-claim-btn:hover { transform: translateY(-1px); }
.ref-claim-note { font-size: 13px; color: rgba(255,255,255,0.85); margin-top: .6rem; }

.ref-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.25rem 1.5rem;
}
.ref-list-title { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: .75rem; }
.ref-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .7rem 0;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.ref-item:last-child { border-bottom: none; }
.ref-item-email { font-size: 14px; color: var(--text-mid); word-break: break-all; }
.ref-badge {
  font-size: 12px;
  font-weight: 700;
  padding: .3rem .75rem;
  border-radius: 999px;
  white-space: nowrap;
}
.ref-badge-paid { background: var(--success-bg); color: var(--success); border: 1px solid var(--green-border); }
.ref-badge-pending { background: #fff8e1; color: #b26a00; border: 1px solid #ffe0a3; }
.ref-empty {
  background: var(--surface-soft);
  border: 1px dashed var(--border-mid);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── Banner 10% OFF (invitado que llega por referido) ── */
.ref-discount-banner {
  background: linear-gradient(135deg, #fff8e1, #ffecb3);
  border: 1px solid #ffe0a3;
  border-radius: var(--radius-lg);
  padding: .85rem 1.1rem;
  margin: .9rem 0;
  font-size: 14px;
  color: #8a5a00;
  line-height: 1.45;
}
.ref-discount-banner strong { color: #b26a00; }

/* ── Responsive ── */
@media (max-width: 640px) {
  .diag-cta { flex-direction: column; align-items: flex-start; }
  .diag-cta-btn { width: 100%; }
  .diag-result-card { flex-direction: column; text-align: center; }
  .diag-ring-wrap { margin: 0 auto; }
  .diag-cta-buttons { flex-direction: column; }
  .diag-cta-buttons .cta-primary,
  .diag-cta-buttons .btn-wa-inline { width: 100%; justify-content: center; }
}

/* ══════════════════════════════════════════
   TOUCH FEEDBACK (:active pressed states)
   Hover doesn't exist on touch, so give every tappable
   element an immediate, tactile press response.
══════════════════════════════════════════ */
.topic-card { transition: border-color .15s, box-shadow .15s, transform .08s; }
.topic-card:active { transform: scale(.975); }

.nav-item:active { background: rgba(255,255,255,0.14); }

.option, .tf-btn { transition: all .15s, transform .08s; }
.option:active:not(.locked),
.tf-btn:active:not(.locked) {
  border-color: var(--green-border);
  background: var(--green-pale);
  transform: scale(.99);
}

.word-chip:active:not(.used) { transform: scale(.94); }

.cta-primary, .cta-secondary, .form-submit, .check-btn, .reset-btn,
.sim-submit-btn, .sim-retry-btn, .next-topic-btn, .mobile-login-btn,
.paywall-contact, .guest-btn { transition: background .15s, opacity .15s, transform .08s; }
.cta-primary:active, .cta-secondary:active, .form-submit:active,
.check-btn:active:not(:disabled), .reset-btn:active, .sim-submit-btn:active,
.sim-retry-btn:active, .next-topic-btn:active, .mobile-login-btn:active,
.paywall-contact:active, .guest-btn:active { transform: translateY(1px) scale(.99); }

.menu-toggle:active { opacity: .55; }
.logout-btn:active { opacity: .55; }
.topic-breadcrumb:active, .paywall-back:active { opacity: .6; }
