/* ==========================================================================
   English Daily — Listen. Learn. Speak.
   Sistema de diseño: azul oscuro, blanco, verde de progreso. Claro / oscuro.
   ========================================================================== */

:root {
  --navy-950: #050d1f;
  --navy-900: #0b1b3b;
  --navy-800: #12285a;
  --navy-700: #1b3a7a;
  --blue-600: #2f5bea;
  --blue-500: #4672ff;
  --blue-400: #7194ff;
  --blue-100: #e6edff;
  --blue-50: #f3f6ff;
  --green-600: #0e9f6e;
  --green-500: #12b981;
  --green-400: #34d399;
  --green-100: #d7f7ea;
  --amber-500: #f59e0b;
  --amber-100: #fff2d6;
  --red-500: #ef4444;
  --red-100: #fde4e4;
  --violet-500: #8b5cf6;

  --bg: #f4f6fb;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-2: #f1f4fa;
  --surface-3: #e8edf7;
  --border: #e3e8f2;
  --border-strong: #cfd7e6;
  --text: #0b1b3b;
  --text-2: #42506b;
  --text-3: #74809a;
  --primary: var(--blue-600);
  --primary-strong: #2449c9;
  --primary-soft: var(--blue-100);
  --on-primary: #ffffff;
  --success: var(--green-500);
  --success-soft: var(--green-100);
  --warning: var(--amber-500);
  --warning-soft: var(--amber-100);
  --danger: var(--red-500);
  --danger-soft: var(--red-100);
  --hero-1: #0b1b3b;
  --hero-2: #1b3a7a;
  --shadow-sm: 0 1px 2px rgba(11, 27, 59, .06), 0 1px 1px rgba(11, 27, 59, .04);
  --shadow: 0 8px 24px -12px rgba(11, 27, 59, .18), 0 2px 6px rgba(11, 27, 59, .05);
  --shadow-lg: 0 24px 48px -20px rgba(11, 27, 59, .35);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --sidebar-w: 264px;
  --topbar-h: 64px;
  --bottomnav-h: 68px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Plus Jakarta Sans", var(--font);
  color-scheme: light;
}

/* Modo oscuro: automático (sistema) salvo que el usuario elija tema claro, o forzado con data-theme="dark". */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #060d1c; --bg-elevated: #0c1730; --surface: #0e1a33; --surface-2: #13213f; --surface-3: #1a2a4d;
    --border: #1d2c4f; --border-strong: #2a3c66; --text: #eef2fb; --text-2: #b4c0da; --text-3: #8391b0;
    --primary: var(--blue-500); --primary-strong: var(--blue-400); --primary-soft: rgba(70, 114, 255, .16);
    --success-soft: rgba(18, 185, 129, .16); --warning-soft: rgba(245, 158, 11, .16); --danger-soft: rgba(239, 68, 68, .16);
    --hero-1: #0d1f48; --hero-2: #1d3f8f;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4); --shadow: 0 10px 30px -14px rgba(0, 0, 0, .6); --shadow-lg: 0 30px 60px -20px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #060d1c; --bg-elevated: #0c1730; --surface: #0e1a33; --surface-2: #13213f; --surface-3: #1a2a4d;
  --border: #1d2c4f; --border-strong: #2a3c66; --text: #eef2fb; --text-2: #b4c0da; --text-3: #8391b0;
  --primary: var(--blue-500); --primary-strong: var(--blue-400); --primary-soft: rgba(70, 114, 255, .16);
  --success-soft: rgba(18, 185, 129, .16); --warning-soft: rgba(245, 158, 11, .16); --danger-soft: rgba(239, 68, 68, .16);
  --hero-1: #0d1f48; --hero-2: #1d3f8f;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4); --shadow: 0 10px 30px -14px rgba(0, 0, 0, .6); --shadow-lg: 0 30px 60px -20px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.55; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; min-height: 100vh; min-height: 100dvh;
}
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.2; margin: 0 0 .5rem; letter-spacing: -.01em; }
h1 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); font-weight: 800; }
h2 { font-size: 1.25rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 .75rem; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--primary); color: #fff; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 55%, transparent); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 28px; height: 28px; }
[hidden] { display: none !important; }

/* --------------------------------------------------------------- layout */
.app { display: grid; grid-template-columns: 1fr; min-height: 100dvh; }
@media (min-width: 1024px) { .app { grid-template-columns: var(--sidebar-w) 1fr; } }

.sidebar {
  display: none; position: sticky; top: 0; height: 100dvh; padding: 22px 16px; flex-direction: column; gap: 6px;
  background: linear-gradient(180deg, var(--navy-900), var(--navy-950)); color: #c9d4ef; overflow-y: auto;
}
@media (min-width: 1024px) { .sidebar { display: flex; } }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 10px 18px; color: #fff; text-decoration: none !important; }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, var(--blue-500), var(--green-500)); box-shadow: 0 8px 20px -8px rgba(70, 114, 255, .8); }
.brand-mark svg { width: 24px; height: 24px; }
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 1.12rem; letter-spacing: -.01em; line-height: 1.1; }
.brand-slogan { font-size: .72rem; color: #8fa1c9; letter-spacing: .04em; }
.nav-section { font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; color: #6d7fa8; padding: 14px 12px 6px; }
.nav-link {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: #c9d4ef; font-weight: 500;
  text-decoration: none !important; transition: background .15s, color .15s;
}
.nav-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-link.active { background: rgba(70, 114, 255, .18); color: #fff; box-shadow: inset 3px 0 0 var(--blue-400); }
.nav-link .badge { margin-left: auto; }
.sidebar-footer { margin-top: auto; padding: 14px 10px 4px; border-top: 1px solid rgba(255, 255, 255, .08); }
.sidebar-user { display: flex; align-items: center; gap: 10px; color: #fff; }
.sidebar-user small { display: block; color: #8fa1c9; font-size: .75rem; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar-h); display: flex; align-items: center; gap: 12px; padding: 0 16px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--border);
}
@media (min-width: 768px) { .topbar { padding: 0 28px; } }
.topbar-title { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .brand-mobile { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none !important; }
.topbar .brand-mobile .brand-mark { width: 34px; height: 34px; border-radius: 10px; }
@media (min-width: 1024px) { .topbar .brand-mobile { display: none; } }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.content { width: 100%; max-width: 1180px; margin: 0 auto; padding: 20px 16px calc(var(--bottomnav-h) + 28px + env(safe-area-inset-bottom)); }
@media (min-width: 768px) { .content { padding: 28px 28px 48px; } }
@media (min-width: 1024px) { .content { padding-bottom: 48px; } }

.bottomnav {
  position: fixed; inset: auto 0 0 0; z-index: 40; display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--bottomnav-h) + env(safe-area-inset-bottom)); padding: 6px 6px env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--bg-elevated) 92%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
}
@media (min-width: 1024px) { .bottomnav { display: none; } }
.bottomnav a, .bottomnav button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: .68rem; font-weight: 600;
  color: var(--text-3); text-decoration: none !important; background: none; border: 0; border-radius: 14px; cursor: pointer;
}
.bottomnav .active { color: var(--primary); }
.bottomnav .active .icon { stroke-width: 2.4; }
.bottomnav .fab-slot { position: relative; }
.bottomnav .fab {
  width: 52px; height: 52px; margin-top: -26px; border-radius: 18px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--blue-600), var(--green-500)); box-shadow: 0 12px 24px -10px rgba(47, 91, 234, .8);
}

/* sheet (menú "Más" móvil) */
.sheet-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(5, 13, 31, .5); opacity: 0; pointer-events: none; transition: opacity .2s; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 61; background: var(--bg-elevated); border-radius: 24px 24px 0 0;
  padding: 10px 16px calc(20px + env(safe-area-inset-bottom)); transform: translateY(105%); transition: transform .25s cubic-bezier(.2, .8, .2, 1);
  box-shadow: var(--shadow-lg); max-height: 85dvh; overflow-y: auto; }
.sheet.open { transform: none; }
.sheet-backdrop.open { opacity: 1; pointer-events: auto; }
.sheet-handle { width: 42px; height: 5px; border-radius: 9px; background: var(--border-strong); margin: 4px auto 14px; }
.sheet-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sheet-grid a { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 6px; border-radius: 16px;
  background: var(--surface-2); color: var(--text); font-size: .8rem; font-weight: 600; text-align: center; text-decoration: none !important; }
.sheet-grid a .icon { color: var(--primary); width: 24px; height: 24px; }

/* ------------------------------------------------------------ componentes */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 18px; min-width: 0; }
@media (min-width: 768px) { .card { padding: 22px; } }
.card-header { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card-header h2, .card-header h3 { margin: 0; }
.card-header .spacer { flex: 1; }
.card-flat { background: var(--surface-2); border: 0; box-shadow: none; }
.card-link { display: block; color: inherit; text-decoration: none !important; transition: transform .15s, box-shadow .15s, border-color .15s; }
.card-link:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-strong); }

.grid { display: grid; gap: 16px; }
@media (min-width: 768px) { .grid { gap: 20px; } }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 640px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-4 { grid-template-columns: repeat(4, 1fr); } }
.span-2 { grid-column: 1 / -1; }
@media (min-width: 900px) { .span-2 { grid-column: span 2; } }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.muted { color: var(--text-3); }
.small { font-size: .85rem; }
.tiny { font-size: .75rem; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: 16px; }
.text-center { text-align: center; }
.w-full { width: 100%; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head p { color: var(--text-2); margin: 4px 0 0; }
.eyebrow { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--primary); }

/* botones */
.btn {
  --_bg: var(--surface); --_fg: var(--text); --_bd: var(--border-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 9px 16px;
  border-radius: 12px; border: 1px solid var(--_bd); background: var(--_bg); color: var(--_fg); font-weight: 600; font-size: .92rem;
  cursor: pointer; text-decoration: none !important; white-space: nowrap; transition: transform .08s, background .15s, box-shadow .15s, opacity .15s;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.btn:hover { background: color-mix(in srgb, var(--_bg) 92%, var(--text)); }
.btn:active { transform: scale(.98); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { --_bg: var(--primary); --_fg: var(--on-primary); --_bd: transparent; box-shadow: 0 8px 18px -10px color-mix(in srgb, var(--primary) 80%, transparent); }
.btn-primary:hover { background: var(--primary-strong); }
.btn-success { --_bg: var(--success); --_fg: #fff; --_bd: transparent; }
.btn-danger { --_bg: var(--danger); --_fg: #fff; --_bd: transparent; }
.btn-soft { --_bg: var(--primary-soft); --_fg: var(--primary); --_bd: transparent; }
.btn-ghost { --_bg: transparent; --_bd: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-lg { min-height: 52px; padding: 12px 22px; font-size: 1rem; border-radius: 14px; }
.btn-sm { min-height: 34px; padding: 6px 12px; font-size: .82rem; border-radius: 10px; }
.btn-icon { width: 42px; padding: 0; }
.btn-icon.btn-sm { width: 34px; }
.btn-round { border-radius: 999px; }
.btn-block { width: 100%; }
.btn-gradient { --_fg: #fff; --_bd: transparent; background: linear-gradient(135deg, var(--blue-600), var(--green-500)); }
.btn-gradient:hover { background: linear-gradient(135deg, var(--primary-strong), var(--green-600)); }
.btn.loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.loading::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor;
  border-color: var(--_fg) transparent var(--_fg) transparent; animation: spin .8s linear infinite; color: var(--_fg); }
.btn.loading::after { border-color: #fff transparent #fff transparent; }
.btn:not(.btn-primary):not(.btn-success):not(.btn-danger):not(.btn-gradient).loading::after { border-color: var(--text) transparent var(--text) transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

/* chips / badges */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: .72rem; font-weight: 700;
  background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.badge-primary { background: var(--primary-soft); color: var(--primary); }
.badge-success { background: var(--success-soft); color: var(--green-600); }
.badge-warning { background: var(--warning-soft); color: #b45309; }
.badge-danger { background: var(--danger-soft); color: var(--red-500); }
:root[data-theme="dark"] .badge-success, :root[data-theme="dark"] .badge-warning { color: var(--green-400); }
.badge-status-new { background: var(--primary-soft); color: var(--primary); }
.badge-status-learning { background: var(--warning-soft); color: #b45309; }
.badge-status-review { background: rgba(139, 92, 246, .14); color: var(--violet-500); }
.badge-status-mastered { background: var(--success-soft); color: var(--green-600); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--border-strong);
  background: var(--surface); font-size: .85rem; font-weight: 600; cursor: pointer; color: var(--text-2); user-select: none; transition: all .15s; }
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.active, .chip[aria-pressed="true"], input:checked + .chip { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip-input { position: absolute; opacity: 0; pointer-events: none; }

/* formularios */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: .82rem; font-weight: 600; color: var(--text-2); }
.help { font-size: .78rem; color: var(--text-3); }
.input, .select, .textarea, .field input:not([type="checkbox"]):not([type="radio"]), .field select, .field textarea {
  width: 100%; min-height: 44px; padding: 10px 13px; border-radius: 12px; border: 1px solid var(--border-strong);
  background: var(--bg-elevated); color: var(--text); transition: border-color .15s, box-shadow .15s; font-size: 16px;
}
.textarea, .field textarea { min-height: 90px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus, .field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent);
}
.input-lg { min-height: 56px; font-size: 1.15rem; padding: 12px 16px; border-radius: 14px; }
.input-group { position: relative; display: flex; align-items: center; }
.input-group .input { padding-left: 42px; }
.input-group > .icon { position: absolute; left: 13px; color: var(--text-3); pointer-events: none; }
.input-with-action { display: flex; gap: 8px; }
.form-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .form-grid.cols-2 { grid-template-columns: repeat(2, 1fr); } .form-grid.cols-3 { grid-template-columns: repeat(3, 1fr); } }
.errorlist { list-style: none; padding: 0; margin: 4px 0 0; color: var(--danger); font-size: .8rem; }
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: .9rem; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--primary); flex: none; }
.checkbox-list ul, ul.checkbox-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.checkbox-list label { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border-strong); font-size: .85rem; cursor: pointer; }
.checkbox-list input { accent-color: var(--primary); }
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--border-strong); transition: .2s; cursor: pointer; }
.switch span::before { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: var(--shadow-sm); }
.switch input:checked + span { background: var(--success); }
.switch input:checked + span::before { transform: translateX(20px); }
input[type="range"] { accent-color: var(--primary); width: 100%; }

/* alertas / toasts */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 13px 15px; border-radius: 14px; background: var(--primary-soft); color: var(--text); font-size: .9rem; border: 1px solid transparent; }
.alert .icon { color: var(--primary); margin-top: 1px; }
.alert-success { background: var(--success-soft); } .alert-success .icon { color: var(--green-600); }
.alert-warning { background: var(--warning-soft); } .alert-warning .icon { color: #b45309; }
.alert-danger { background: var(--danger-soft); } .alert-danger .icon { color: var(--danger); }
.toasts { position: fixed; z-index: 100; left: 50%; transform: translateX(-50%); bottom: calc(var(--bottomnav-h) + 16px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 8px; width: min(440px, calc(100vw - 32px)); pointer-events: none; }
@media (min-width: 1024px) { .toasts { bottom: 24px; left: auto; right: 24px; transform: none; } }
.toast { pointer-events: auto; display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 14px; background: var(--navy-900); color: #fff;
  box-shadow: var(--shadow-lg); font-size: .9rem; animation: toast-in .25s ease-out; }
.toast.success .icon { color: var(--green-400); } .toast.error .icon { color: #fca5a5; } .toast.info .icon { color: var(--blue-400); }
.toast.hide { animation: toast-out .2s ease-in forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

/* modal */
dialog.modal { border: 0; padding: 0; border-radius: var(--radius-lg); background: var(--bg-elevated); color: var(--text); box-shadow: var(--shadow-lg);
  width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 40px); }
dialog.modal::backdrop { background: rgba(5, 13, 31, .55); backdrop-filter: blur(3px); }
.modal-body { padding: 22px; overflow-y: auto; max-height: calc(100dvh - 140px); }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 18px 22px 0; }
.modal-head h2 { margin: 0; font-size: 1.15rem; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 0 22px 20px; flex-wrap: wrap; }

/* tablas y listas */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 14px; padding: 14px 4px; border-bottom: 1px solid var(--border); min-width: 0; }
.list-item:last-child { border-bottom: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title { font-weight: 650; overflow: hidden; text-overflow: ellipsis; }
.list-item .sub { color: var(--text-3); font-size: .85rem; overflow: hidden; text-overflow: ellipsis; }
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.table td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }

.empty { text-align: center; padding: 40px 16px; color: var(--text-3); }
.empty .empty-icon { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 20px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.empty h3 { color: var(--text); }

.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%); background-size: 400% 100%;
  animation: shimmer 1.3s ease infinite; border-radius: 10px; min-height: 16px; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.progress { height: 10px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--green-500), var(--green-400)); transition: width .6s cubic-bezier(.2, .8, .2, 1); }
.progress.blue > span { background: linear-gradient(90deg, var(--blue-600), var(--blue-400)); }
.progress-sm { height: 6px; }

/* --------------------------------------------------------------- dashboard */
.hero {
  position: relative; overflow: hidden; border-radius: var(--radius-lg); padding: 24px; color: #fff;
  background: radial-gradient(120% 140% at 100% 0%, rgba(18, 185, 129, .35), transparent 50%),
              radial-gradient(90% 120% at 0% 100%, rgba(113, 148, 255, .35), transparent 55%),
              linear-gradient(135deg, var(--hero-1), var(--hero-2));
  box-shadow: var(--shadow-lg);
}
@media (min-width: 768px) { .hero { padding: 30px 32px; } }
.hero::after { content: ""; position: absolute; right: -60px; bottom: -80px; width: 260px; height: 260px; border-radius: 50%;
  border: 36px solid rgba(255, 255, 255, .05); pointer-events: none; }
.hero h1 { color: #fff; margin-bottom: 4px; }
.hero p { color: #c9d6f5; }
.hero-grid { display: grid; gap: 22px; align-items: center; grid-template-columns: 1fr; position: relative; z-index: 1; }
@media (min-width: 768px) { .hero-grid { grid-template-columns: 1fr auto; } }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.hero .btn { --_bg: rgba(255, 255, 255, .12); --_fg: #fff; --_bd: rgba(255, 255, 255, .18); }
.hero .btn:hover { background: rgba(255, 255, 255, .2); }
.hero .btn-white { --_bg: #fff; --_fg: var(--navy-900); --_bd: transparent; }
.hero .btn-white:hover { background: #eef2ff; }
.streak-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: rgba(255, 255, 255, .12);
  font-weight: 700; font-size: .82rem; color: #fff; }
.streak-pill .icon { color: #fbbf24; }

.ring { --size: 132px; --stroke: 12; position: relative; width: var(--size); height: var(--size); flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: var(--stroke); }
.ring .track { stroke: rgba(255, 255, 255, .14); }
.card .ring .track { stroke: var(--surface-3); }
.ring .value { stroke: url(#ring-gradient); stroke-linecap: round; transition: stroke-dashoffset 1s cubic-bezier(.2, .8, .2, 1); }
.ring-label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-label strong { font-family: var(--font-display); font-size: 1.9rem; font-weight: 800; line-height: 1; }
.ring-label span { font-size: .72rem; opacity: .75; margin-top: 4px; }

.stat { display: flex; flex-direction: column; gap: 6px; }
.stat-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.stat-icon.green { background: var(--success-soft); color: var(--green-600); }
.stat-icon.amber { background: var(--warning-soft); color: #d97706; }
.stat-icon.violet { background: rgba(139, 92, 246, .14); color: var(--violet-500); }
.stat-value { font-family: var(--font-display); font-size: 1.7rem; font-weight: 800; line-height: 1.1; letter-spacing: -.02em; }
.stat-label { font-size: .82rem; color: var(--text-3); font-weight: 500; }

.bars { display: flex; align-items: flex-end; gap: 8px; height: 140px; padding-top: 10px; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.bar-fill { width: 100%; max-width: 38px; border-radius: 10px 10px 4px 4px; background: linear-gradient(180deg, var(--blue-500), var(--blue-600)); min-height: 4px; transition: height .6s; position: relative; }
.bar-fill.today { background: linear-gradient(180deg, var(--green-400), var(--green-500)); }
.bar-fill:hover::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: var(--navy-900); color: #fff; font-size: .72rem; padding: 4px 8px; border-radius: 8px; white-space: nowrap; }
.bar small { font-size: .7rem; color: var(--text-3); }

.quick-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 640px) { .quick-actions { grid-template-columns: repeat(4, 1fr); } }
.qa { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border);
  color: var(--text); text-decoration: none !important; transition: transform .15s, box-shadow .15s; }
.qa:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.qa strong { font-size: .95rem; }
.qa small { color: var(--text-3); font-size: .78rem; }

/* Inicio: una sola tarea principal, las palabras del día (móvil primero). */
.home { max-width: 980px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
@media (min-width: 768px) { .home { gap: 20px; } }
.today-card {
  position: relative; overflow: hidden; border-radius: var(--radius-lg); padding: 22px 18px; color: #fff;
  background: radial-gradient(110% 120% at 100% 0%, rgba(18, 185, 129, .32), transparent 55%),
              linear-gradient(135deg, var(--hero-1), var(--hero-2));
  box-shadow: var(--shadow-lg);
}
@media (min-width: 640px) { .today-card { padding: 30px 32px; } }
.today-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.today-hello { color: #c9d6f5; font-weight: 600; font-size: .92rem; }
.today-card h1 { color: #fff; margin: 12px 0 6px; font-size: clamp(1.55rem, 5.5vw, 2.2rem); line-height: 1.15; }
.today-sub { color: #c9d6f5; margin: 0; }
.today-sub strong { color: #fff; font-size: 1.1em; }
.today-progress { display: flex; align-items: center; gap: 14px; margin-top: 20px; }
.today-bar { flex: 1; height: 14px; border-radius: 999px; background: rgba(255, 255, 255, .16); overflow: hidden; }
.today-bar > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--green-500), var(--green-400));
  box-shadow: 0 0 16px rgba(52, 211, 153, .55); transition: width .8s cubic-bezier(.2, .8, .2, 1); }
.today-count { font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; line-height: 1; white-space: nowrap; }
.today-count small { font-size: .62em; opacity: .7; font-weight: 700; }
.today-add { display: flex; align-items: center; gap: 6px; margin-top: 20px; padding: 6px; border-radius: 16px; background: #fff;
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, .45); }
.today-add input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 1rem; color: var(--navy-900); padding: 10px; }
.today-add input::placeholder { color: #8a94ab; }
.today-add .btn { flex: none; min-height: 44px; border-radius: 12px; }
.today-fill { width: 100%; margin-top: 10px; min-height: 46px; border-radius: 14px; font-weight: 700;
  --_bg: rgba(255, 255, 255, .1); --_fg: #fff; --_bd: rgba(255, 255, 255, .28); border-style: dashed; }
.today-fill:hover { background: rgba(255, 255, 255, .18); }
.today-fill .icon { color: var(--green-400); }

/* Vocabulario del día: tabla en escritorio, tarjetas en el teléfono. */
.vd { padding: 0; overflow: hidden; }
.vd-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 18px 18px 14px; }
@media (min-width: 768px) { .vd-head { padding: 22px 22px 16px; } }
.vd-playall { min-height: 46px; border-radius: 14px; padding-inline: 18px; }
@media (max-width: 479px) { .vd-playall { width: 100%; } }

.vd-player { margin: 0 18px 14px; padding: 12px 14px; border-radius: 14px; background: var(--primary-soft); display: flex; flex-direction: column; gap: 10px; }
@media (min-width: 768px) { .vd-player { margin: 0 22px 16px; } }
.vd-now { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.vd-now-step { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--primary); }
.vd-now strong { font-size: 1.05rem; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.vd-controls { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.vd-pp { width: 46px; height: 46px; border-radius: 50%; }
.vd-speed { display: flex; align-items: center; gap: 10px; }
.vd-speed .btn { color: var(--primary); flex: none; }
.vd-speed output { font-family: var(--font-display); font-weight: 800; min-width: 4.2ch; text-align: right; color: var(--primary); }
.vd-speed input[type="range"] { --fill: 50%; flex: 1; height: 28px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; touch-action: pan-y; }
.vd-speed input[type="range"]::-webkit-slider-runnable-track { height: 8px; border-radius: 999px;
  background: linear-gradient(90deg, var(--primary) var(--fill), rgba(47, 91, 234, .18) var(--fill)); }
.vd-speed input[type="range"]::-moz-range-track { height: 8px; border-radius: 999px; background: rgba(47, 91, 234, .18); }
.vd-speed input[type="range"]::-moz-range-progress { height: 8px; border-radius: 999px; background: var(--primary); }
.vd-speed input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; margin-top: -9px; border-radius: 50%;
  background: #fff; border: 3px solid var(--primary); box-shadow: 0 2px 8px rgba(11, 27, 59, .25); }
.vd-speed input[type="range"]::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 3px solid var(--primary); }
.vd-speed input[type="range"]:focus-visible { outline: 2px solid var(--primary); outline-offset: 4px; border-radius: 999px; }
.vd-toggle { margin-left: auto; cursor: pointer; position: relative; }
.vd-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.vd-toggle span { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; font-size: .82rem; font-weight: 700;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); }
.vd-toggle input:checked + span { background: var(--success); border-color: var(--success); color: #fff; }
.vd-toggle input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.vd-player .progress { background: rgba(47, 91, 234, .15); }
.vd-player .progress > span { background: var(--primary); }

.vd-table { border-top: 1px solid var(--border); }
.vd-row { display: grid; grid-template-columns: 40px 1fr; gap: 4px 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); align-items: center; min-width: 0; }
.vd-row > * { min-width: 0; }
.vd-row:last-child { border-bottom: 0; }
.vd-th { display: none; }
.vd-num { grid-row: span 3; align-self: start; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; font-size: .85rem; color: var(--text-3); background: var(--surface-2); }
.vd-check { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--success); color: #fff;
  box-shadow: 0 4px 12px -4px rgba(18, 185, 129, .7); }
.vd-row.done { cursor: pointer; transition: background .15s; }
.vd-row.done:hover { background: var(--surface-2); }
.vd-row.selected { background: var(--primary-soft); }
.vd-row.playing { background: var(--success-soft); }
.vd-en { display: flex; align-items: center; gap: 8px; }
.vd-en strong { font-family: var(--font-display); font-size: 1.15rem; overflow-wrap: anywhere; }
.vd-en { flex-wrap: wrap; }
.vd-known { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; padding: 4px 10px; border-radius: 999px; cursor: pointer;
  font-size: .76rem; font-weight: 600; color: var(--text-3); border: 1px solid var(--border); background: var(--surface); white-space: nowrap; }
.vd-known input { width: 16px; height: 16px; margin: 0; accent-color: var(--success); cursor: pointer; }
.vd-known:has(input:checked) { color: var(--green-600); border-color: var(--success); background: var(--success-soft); }
@media (min-width: 768px) { .vd-known { margin-left: 0; } }
.vd-row.known .vd-es, .vd-row.known .vd-sample, .vd-row.known .vd-en strong { opacity: .5; }
.vd-es { color: var(--text-2); overflow-wrap: anywhere; }
.vd-es small, .vd-sample small { display: block; color: var(--text-3); font-size: .8rem; }
.vd-meaning { display: block; }
.vd-meaning + .vd-meaning { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--border); }
.vd-sample { display: flex; align-items: flex-start; gap: 8px; margin-top: 4px; }
.vd-sample > span { min-width: 0; overflow-wrap: anywhere; }
.vd-sample b { font-weight: 600; }
.vd-more { border: 0; background: none; padding: 4px 0 0; color: var(--primary); font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer; }
.vd-row.empty .vd-num { grid-row: auto; border: 1.5px dashed var(--border-strong); background: transparent; }
.vd-empty { color: var(--text-3); font-size: .9rem; }
@media (min-width: 768px) {
  .vd-row { grid-template-columns: 52px minmax(140px, 1fr) minmax(150px, 1.1fr) minmax(220px, 1.8fr); gap: 14px; padding: 12px 22px; }
  .vd-th { display: grid; background: var(--navy-900); color: #fff; font-size: .8rem; font-weight: 700; letter-spacing: .02em; padding-block: 12px; }
  .vd-num { grid-row: auto; align-self: center; }
  .vd-sample { margin-top: 0; }
  .vd-row.empty .vd-empty { grid-column: span 3; }
}
:root[data-theme="dark"] .vd-th { background: var(--surface-3); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .vd-th { background: var(--surface-3); } }

.vd-ex-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.vd-ex-head h3 { display: flex; align-items: center; gap: 8px; }
.vd-ex-head h3 .icon, #ex-word { color: var(--primary); }
.vd-tabs { margin: 14px 0 6px; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.vd-tabs .chip { flex: none; }
.vd-ex-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.vd-ex-list li { display: flex; align-items: flex-start; gap: 10px; padding: 8px; border-radius: 12px; overflow-wrap: anywhere; }
.vd-ex-list li > span { min-width: 0; }
.vd-ex-list li.playing { background: var(--success-soft); }
.vd-ex-list b { font-weight: 650; }
.vd-ex-list small { color: var(--text-3); font-size: .86rem; }
.vd-gen { margin-top: 14px; min-height: 48px; }
.vd-pager { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; margin-top: 16px; }
.vd-pager #ex-pos { text-align: center; white-space: nowrap; }
.vd-pager .btn { min-height: 46px; padding-inline: 10px; }

.ai-suggest { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 10px; }
.home-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.home-links a { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); color: var(--text-2); font-size: .86rem; font-weight: 600; text-decoration: none; text-align: center; }
.home-links a:hover { color: var(--primary); border-color: var(--primary); }
.home-links .icon { color: var(--primary); }
.home-links b { color: var(--primary); }

/* ------------------------------------------------------------ vocabulario */
.word-card { display: flex; gap: 14px; align-items: flex-start; }
.word-title { font-family: var(--font-display); font-size: 1.15rem; font-weight: 750; color: var(--text); }
.word-ipa { font-family: ui-monospace, "Cascadia Code", monospace; font-size: .85rem; color: var(--text-3); }
.word-hero { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.word-hero h1 { font-size: clamp(1.8rem, 1.4rem + 2vw, 2.6rem); margin: 0; }
.speak-btn { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; border: 0; cursor: pointer; color: #fff;
  background: linear-gradient(135deg, var(--blue-600), var(--blue-500)); box-shadow: 0 10px 22px -10px rgba(47, 91, 234, .9); flex: none; }
.speak-btn:active { transform: scale(.96); }
.speak-btn.playing { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 10px rgba(70, 114, 255, .15); } }
.kv { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 640px) { .kv { grid-template-columns: repeat(2, 1fr); } }
.kv dt { font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); font-weight: 700; }
.kv dd { margin: 2px 0 0; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-list span { padding: 3px 10px; border-radius: 999px; background: var(--surface-2); font-size: .82rem; }

.sentence { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 14px; background: var(--surface-2); transition: background .15s; }
.sentence + .sentence { margin-top: 10px; }
.sentence.playing { background: var(--primary-soft); box-shadow: inset 3px 0 0 var(--primary); }
.sentence .en { font-weight: 600; font-size: 1rem; }
.sentence .es { color: var(--text-2); font-size: .9rem; margin-top: 2px; }
.sentence .meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.sentence .actions { display: flex; gap: 2px; margin-left: auto; flex: none; flex-wrap: wrap; justify-content: flex-end; }
.sentence .grow { flex: 1; min-width: 0; }
.fav-on { color: #f59e0b !important; }
.fav-on .icon { fill: #f59e0b; }

.filters { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
@media (min-width: 900px) { .filters { grid-template-columns: 2fr repeat(4, 1fr) auto; } }
.filters .span-all { grid-column: 1 / -1; }
@media (min-width: 900px) { .filters .span-all { grid-column: auto; } }

.vocab-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .vocab-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1200px) { .vocab-grid { grid-template-columns: repeat(3, 1fr); } }
.vocab-item { position: relative; display: flex; flex-direction: column; gap: 8px; }
.vocab-item .row-between { flex-wrap: nowrap; }

/* ------------------------------------------------------------ reproductor */
.player-stage { text-align: center; padding: 28px 18px; border-radius: var(--radius-lg); color: #fff;
  background: radial-gradient(100% 120% at 50% 0%, rgba(70, 114, 255, .45), transparent 60%), linear-gradient(160deg, var(--hero-1), var(--navy-950)); box-shadow: var(--shadow-lg); }
.player-stage .now-word { font-family: var(--font-display); font-size: clamp(2rem, 1.5rem + 3vw, 3.2rem); font-weight: 800; letter-spacing: -.02em; }
.player-stage .now-text { font-size: clamp(1.05rem, 1rem + .6vw, 1.35rem); font-weight: 600; min-height: 2.6em; margin: 10px auto 0; max-width: 680px; }
.player-stage .now-sub { color: #b9c7ea; min-height: 1.6em; max-width: 680px; margin: 6px auto 0; }
.player-stage .now-step { display: inline-block; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--green-400); font-weight: 700; margin-bottom: 8px; }
.transport { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 22px; }
.transport .btn { --_bg: rgba(255, 255, 255, .1); --_fg: #fff; --_bd: rgba(255, 255, 255, .14); }
.transport .btn:hover { background: rgba(255, 255, 255, .18); }
.transport .play-main { width: 72px; height: 72px; border-radius: 50%; --_bg: #fff; --_fg: var(--navy-900); box-shadow: 0 14px 30px -10px rgba(0, 0, 0, .6); }
.transport .play-main:hover { background: #eef2ff; }
.transport .play-main .icon { width: 30px; height: 30px; }
.player-progress { margin-top: 18px; display: flex; align-items: center; gap: 10px; color: #b9c7ea; font-size: .8rem; }
.player-progress .progress { flex: 1; background: rgba(255, 255, 255, .14); }
.controls-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .controls-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .controls-grid { grid-template-columns: repeat(3, 1fr); } }
.seg { display: inline-flex; padding: 4px; border-radius: 12px; background: var(--surface-2); gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 7px 11px; border-radius: 9px; font-weight: 700; font-size: .82rem; color: var(--text-2); cursor: pointer; }
.seg button.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); }
.queue-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; cursor: pointer; }
.queue-item:hover { background: var(--surface-2); }
.queue-item.current { background: var(--primary-soft); }
.queue-item .num { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: .75rem; font-weight: 700; background: var(--surface-3); flex: none; }

/* manos libres */
.handsfree { min-height: calc(100dvh - var(--topbar-h) - 60px); display: flex; flex-direction: column; gap: 16px; }
.handsfree .player-stage { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 34px 18px; }
.mic-state { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: rgba(255, 255, 255, .1); font-size: .8rem; font-weight: 700; }
.mic-dot { width: 10px; height: 10px; border-radius: 50%; background: #64748b; }
.mic-state.on .mic-dot { background: var(--green-400); box-shadow: 0 0 0 0 rgba(52, 211, 153, .7); animation: mic 1.6s infinite; }
@keyframes mic { 70% { box-shadow: 0 0 0 10px rgba(52, 211, 153, 0); } 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); } }
.big-touch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.big-touch .btn { min-height: 64px; font-size: .95rem; flex-direction: column; gap: 4px; }
.cmd-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.cmd-list code { display: block; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); font-size: .82rem; }

/* -------------------------------------------------------------- prácticas */
.practice-types { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.ptype { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 14px; border: 1.5px solid var(--border); background: var(--surface);
  cursor: pointer; transition: all .15s; font-weight: 650; font-size: .88rem; }
.ptype .icon { color: var(--primary); }
.ptype:hover { border-color: var(--primary); }
.ptype input { position: absolute; opacity: 0; }
.ptype:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }
.ptype.disabled { opacity: .45; cursor: not-allowed; }
.ptype small { font-weight: 500; color: var(--text-3); font-size: .74rem; }

.quiz { max-width: 720px; margin: 0 auto; }
.quiz-top { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.quiz-top .progress { flex: 1; }
.quiz-card { padding: 26px 20px; text-align: center; border-radius: var(--radius-lg); }
@media (min-width: 640px) { .quiz-card { padding: 34px 32px; } }
.quiz-prompt { font-family: var(--font-display); font-size: clamp(1.35rem, 1.1rem + 1.4vw, 2rem); font-weight: 750; margin: 14px 0 8px; word-wrap: break-word; }
.quiz-hint { color: var(--text-2); }
.options { display: grid; gap: 10px; margin-top: 20px; text-align: left; }
.option { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; border-radius: 14px; border: 1.5px solid var(--border-strong); background: var(--surface);
  cursor: pointer; font-weight: 600; font-size: .98rem; transition: all .12s; color: var(--text); text-align: left; }
.option:hover:not(:disabled) { border-color: var(--primary); background: var(--primary-soft); }
.option .key { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); font-size: .8rem; flex: none; }
.option.correct { border-color: var(--success); background: var(--success-soft); }
.option.wrong { border-color: var(--danger); background: var(--danger-soft); }
.option.selected { border-color: var(--primary); background: var(--primary-soft); }
.tokens { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 16px; min-height: 48px; }
.token { padding: 9px 14px; border-radius: 12px; background: var(--surface); border: 1.5px solid var(--border-strong); font-weight: 650; cursor: pointer; user-select: none; transition: all .12s; }
.token:hover { border-color: var(--primary); }
.token.used { opacity: .3; pointer-events: none; }
.token.picked { background: var(--primary-soft); border-color: var(--primary); }
.token.flag { background: var(--danger-soft); border-color: var(--danger); }
.answer-zone { min-height: 58px; padding: 10px; border-radius: 14px; border: 2px dashed var(--border-strong); display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; }
.flashcard { perspective: 1200px; height: 230px; cursor: pointer; margin-top: 10px; }
.flashcard-inner { position: relative; width: 100%; height: 100%; transition: transform .5s cubic-bezier(.2, .8, .2, 1); transform-style: preserve-3d; }
.flashcard.flipped .flashcard-inner { transform: rotateY(180deg); }
.flashcard-face { position: absolute; inset: 0; display: grid; place-content: center; gap: 6px; padding: 20px; border-radius: var(--radius-lg); backface-visibility: hidden;
  background: linear-gradient(135deg, var(--hero-1), var(--hero-2)); color: #fff; }
.flashcard-face.back { transform: rotateY(180deg); background: linear-gradient(135deg, #0e7a57, var(--green-500)); }
.flashcard-face strong { font-family: var(--font-display); font-size: 2rem; }
.feedback { margin-top: 18px; padding: 14px 16px; border-radius: 14px; text-align: left; animation: toast-in .2s; }
.feedback.ok { background: var(--success-soft); }
.feedback.ko { background: var(--danger-soft); }
.feedback strong { display: flex; align-items: center; gap: 8px; }
.diff { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.diff span { padding: 2px 7px; border-radius: 6px; font-weight: 600; font-size: .9rem; }
.diff .ok { background: var(--success-soft); color: var(--green-600); }
.diff .wrong, .diff .missing { background: var(--danger-soft); color: var(--red-500); }
.diff .missing { text-decoration: line-through; }
.diff .extra { background: var(--warning-soft); color: #b45309; }
.result-hero { text-align: center; padding: 30px 20px; }
.result-score { font-family: var(--font-display); font-size: 3.6rem; font-weight: 800; line-height: 1; }
.result-score.pass { color: var(--success); } .result-score.fail { color: var(--danger); }

/* ------------------------------------------------------------------ tutor */
.chat { display: flex; flex-direction: column; height: calc(100dvh - var(--topbar-h) - var(--bottomnav-h) - 64px - env(safe-area-inset-bottom)); min-height: 420px; }
@media (min-width: 1024px) { .chat { height: calc(100dvh - var(--topbar-h) - 120px); } }
.chat-layout { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 1100px) { .chat-layout { grid-template-columns: 280px 1fr; } }
.chat-messages { flex: 1; overflow-y: auto; padding: 16px 4px; display: flex; flex-direction: column; gap: 14px; scroll-behavior: smooth; }
.msg { display: flex; gap: 10px; max-width: 88%; }
.msg.user { align-self: flex-end; flex-direction: row-reverse; }
.msg .avatar { width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center; flex: none; font-size: .8rem; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--blue-600), var(--green-500)); }
.msg.user .avatar { background: var(--navy-800); }
.bubble { padding: 12px 15px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); min-width: 0; }
.msg.user .bubble { background: var(--primary); color: #fff; border-color: transparent; border-top-right-radius: 6px; }
.msg.bot .bubble { border-top-left-radius: 6px; }
.bubble .tr { font-size: .85rem; color: var(--text-3); margin-top: 6px; border-top: 1px dashed var(--border); padding-top: 6px; }
.bubble-tools { display: flex; gap: 2px; margin-top: 6px; flex-wrap: wrap; }
.bubble-tools .btn { min-height: 30px; padding: 4px 8px; font-size: .75rem; }
.correction { margin-top: 8px; padding: 10px 12px; border-radius: 12px; background: var(--warning-soft); font-size: .86rem; color: var(--text); }
.correction del { color: var(--red-500); }
.correction ins { color: var(--green-600); text-decoration: none; font-weight: 700; }
.expr { margin-top: 8px; padding: 10px 12px; border-radius: 12px; background: var(--success-soft); font-size: .86rem; color: var(--text); }
.composer { display: flex; gap: 8px; align-items: flex-end; padding: 10px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.composer textarea { flex: 1; border: 0; background: transparent; resize: none; min-height: 44px; max-height: 140px; padding: 10px 6px; outline: none; font-size: 16px; }
.mic-btn.recording { background: var(--danger) !important; color: #fff !important; animation: pulse 1.2s infinite; }
.typing { display: inline-flex; gap: 4px; padding: 14px 16px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 50% { opacity: .2; } }

/* -------------------------------------------------------------- auth/landing */
.auth { min-height: 100dvh; display: grid; grid-template-columns: 1fr; background: var(--bg); }
@media (min-width: 960px) { .auth { grid-template-columns: 1.05fr 1fr; } }
.auth-aside { display: none; position: relative; overflow: hidden; padding: 48px; color: #fff; flex-direction: column; justify-content: space-between;
  background: radial-gradient(80% 60% at 100% 0%, rgba(18, 185, 129, .35), transparent 60%), radial-gradient(70% 70% at 0% 100%, rgba(113, 148, 255, .4), transparent 60%), linear-gradient(160deg, var(--navy-900), var(--navy-950)); }
@media (min-width: 960px) { .auth-aside { display: flex; } }
.auth-aside h2 { font-size: 2.4rem; color: #fff; font-weight: 800; letter-spacing: -.02em; max-width: 520px; }
.auth-aside p { color: #b9c7ea; max-width: 460px; font-size: 1.05rem; }
.auth-features { display: grid; gap: 14px; margin-top: 26px; }
.auth-features div { display: flex; gap: 12px; align-items: center; color: #dbe4fb; }
.auth-features .icon { color: var(--green-400); }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 32px 16px; }
.auth-card { width: 100%; max-width: 440px; }
.auth-card .brand { color: var(--text); padding: 0 0 24px; }
.auth-card .brand-slogan { color: var(--text-3); }
.divider { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: .8rem; margin: 18px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.landing-hero { min-height: 100dvh; display: flex; flex-direction: column; color: #fff;
  background: radial-gradient(70% 60% at 85% 10%, rgba(18, 185, 129, .35), transparent 60%), radial-gradient(60% 60% at 0% 90%, rgba(113, 148, 255, .4), transparent 60%), linear-gradient(160deg, var(--navy-900), var(--navy-950)); }
.landing-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 16px; max-width: 1180px; width: 100%; margin: 0 auto; }
.landing-nav .brand { padding: 0; }
.landing-body { flex: 1; display: grid; gap: 36px; align-items: center; max-width: 1180px; width: 100%; margin: 0 auto; padding: 24px 16px 56px; grid-template-columns: 1fr; }
@media (min-width: 960px) { .landing-body { grid-template-columns: 1.1fr .9fr; padding: 40px 28px 80px; } }
.landing-body h1 { font-size: clamp(2.2rem, 1.5rem + 3.4vw, 4rem); color: #fff; letter-spacing: -.03em; line-height: 1.05; }
.landing-body h1 em { font-style: normal; background: linear-gradient(90deg, var(--blue-400), var(--green-400)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.landing-body p.lead { color: #c3d0f0; font-size: 1.12rem; max-width: 560px; }
.landing-card { background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); border-radius: 24px; padding: 22px; backdrop-filter: blur(10px); }
.landing-card .sentence { background: rgba(255, 255, 255, .07); color: #fff; }
.landing-card .sentence .es { color: #b9c7ea; }
.features { max-width: 1180px; margin: 0 auto; padding: 56px 16px; display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .features { grid-template-columns: repeat(3, 1fr); padding: 72px 28px; } }
.footer { text-align: center; padding: 28px 16px; color: var(--text-3); font-size: .82rem; border-top: 1px solid var(--border); }

/* onboarding steps */
.steps { display: grid; gap: 14px; grid-template-columns: 1fr; counter-reset: step; }
@media (min-width: 800px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step { position: relative; padding-top: 40px; }
.step::before { counter-increment: step; content: counter(step); position: absolute; top: 0; left: 0; width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center;
  background: var(--primary); color: #fff; font-weight: 800; font-size: .9rem; }

/* misc */
.kbd { display: inline-block; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--border-strong); font-size: .75rem; font-family: ui-monospace, monospace; background: var(--surface-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--text-3); }
.dot.green { background: var(--success); }
.avatar-circle { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .85rem; color: #fff; background: linear-gradient(135deg, var(--blue-600), var(--green-500)); flex: none; }
.notif-dot { position: relative; }
.notif-dot[data-count]:not([data-count="0"])::after { content: attr(data-count); position: absolute; top: 4px; right: 4px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  background: var(--danger); color: #fff; font-size: .62rem; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--bg); }
.offline-banner { position: fixed; top: 0; left: 0; right: 0; z-index: 90; background: var(--amber-500); color: #1f1300; text-align: center; font-size: .82rem; font-weight: 700; padding: 6px; }
.update-banner { position: fixed; z-index: 95; left: 16px; right: 16px; bottom: calc(var(--bottomnav-h) + 16px); display: flex; gap: 10px; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-radius: 14px; background: var(--navy-900); color: #fff; box-shadow: var(--shadow-lg); max-width: 460px; margin: 0 auto; }
@media (min-width: 1024px) { .update-banner { bottom: 24px; left: auto; } }
.job-progress { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 14px; background: var(--primary-soft); }
details.disclosure { border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; background: var(--surface); }
details.disclosure summary { cursor: pointer; font-weight: 650; list-style: none; display: flex; align-items: center; gap: 8px; }
details.disclosure summary::-webkit-details-marker { display: none; }
details.disclosure[open] summary { margin-bottom: 10px; }
.param-row { display: grid; gap: 10px; grid-template-columns: 1fr; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--border); }
@media (min-width: 700px) { .param-row { grid-template-columns: 1.3fr 1fr; } }
.param-row:last-child { border-bottom: 0; }
.param-row .lim { font-size: .74rem; color: var(--text-3); }
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface-2); overflow-x: auto; margin-bottom: 18px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button, .tabs a { border: 0; background: none; padding: 9px 14px; border-radius: 10px; font-weight: 650; font-size: .88rem; color: var(--text-2); cursor: pointer; white-space: nowrap; text-decoration: none !important; }
.tabs .active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.plan-week { border-left: 3px solid var(--primary); padding: 4px 0 4px 14px; }
.plan-week + .plan-week { margin-top: 14px; }
.legal { max-width: 760px; }
.legal h2 { margin-top: 28px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }
@media print { .sidebar, .topbar, .bottomnav { display: none !important; } }
