/* Oído — diseño. Siempre oscuro (como TicProfit), Inter incluida en la app.
   Móvil primero; a partir de 1024 px, menú lateral y rejillas anchas. */
@font-face { font-family: 'Inter'; font-style: normal; font-display: swap; font-weight: 100 900; src: url(/fonts/inter-latin-wght-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-display: swap; font-weight: 100 900; src: url(/fonts/inter-latin-ext-wght-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --bg: #0a0d13; --bg2: #0e121a; --card: #131822; --card2: #19202c; --card3: #212938;
  --line: rgba(255,255,255,.07); --line2: rgba(255,255,255,.12);
  --tx: #eef2f8; --tx2: #a9b2c3; --tx3: #707b90;
  --acc: #34d399; --acc-d: #10b981; --acc-bg: rgba(52,211,153,.12);
  --ind: #818cf8; --warn: #fbbf24; --warn-bg: rgba(251,191,36,.12); --bad: #fb7185; --bad-bg: rgba(251,113,133,.12);
  --c-escucha: #2dd4bf; --c-intensiva: #38bdf8; --c-habla: #a78bfa; --c-frases: #fbbf24; --c-escritura: #fb7185;
  --c-examen: #f472b6; --c-lectura: #94a3b8; --c-clase: #60a5fa; --c-otro: #64748b;
  --r: 16px; --r-s: 11px;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --tabs-h: 62px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--tx); font-family: var(--font); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; text-size-adjust: 100%; }
body { min-height: 100vh; overscroll-behavior-y: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: var(--acc); }
h1 { font-size: 26px; line-height: 1.15; margin: 0; letter-spacing: -.5px; font-weight: 750; }
h2 { font-size: 22px; margin: 6px 0; letter-spacing: -.3px; }
p { margin: 0 0 10px; }
.muted { color: var(--tx2); } .small { font-size: 13px; } .center { text-align: center; } .cap::first-letter { text-transform: uppercase; }
.ok-t { color: var(--acc); } .warn-t { color: var(--warn); } .acc-t { color: var(--ind); }
[hidden] { display: none !important; }
.ic { width: 20px; height: 20px; flex: none; vertical-align: -4px; }
.ic.mini { width: 14px; height: 14px; vertical-align: -2px; margin-right: 3px; }
kbd { font-family: var(--font); font-size: 10px; color: var(--tx3); border: 1px solid var(--line2); border-radius: 5px; padding: 0 5px; margin-left: auto; }
mark { background: rgba(251,191,36,.18); color: #ffe39a; border-radius: 4px; padding: 0 2px; }
code { font-family: ui-monospace, 'SF Mono', Consolas, monospace; font-size: 13px; }

/* ── Arranque ───────────────────────────────────────────────────────── */
#splash { position: fixed; inset: 0; z-index: 100; background: radial-gradient(circle at 50% 42%, rgba(52,211,153,.10), transparent 55%), var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; transition: opacity .45s; }
#splash img { border-radius: 22px; box-shadow: 0 16px 40px rgba(0,0,0,.5); margin-bottom: 12px; }
#splash.out { opacity: 0; pointer-events: none; }
.splash-name { font-size: 38px; font-weight: 800; letter-spacing: -1.2px; }
.splash-tag { color: var(--tx3); font-size: 13px; letter-spacing: .4px; }
.boot-err { text-align: center; padding: 24px; } .boot-err button { margin-top: 12px; background: var(--acc); color: #04150d; padding: 10px 18px; border-radius: 10px; font-weight: 700; }

#welcome { position: fixed; inset: 0; z-index: 90; overflow: auto; background: radial-gradient(circle at 50% 0%, rgba(52,211,153,.10), transparent 60%), var(--bg); padding: calc(28px + var(--safe-t)) 18px calc(28px + var(--safe-b)); }
.wl-inner { max-width: 440px; margin: 0 auto; text-align: center; }
.wl-logo { border-radius: 20px; box-shadow: 0 12px 30px rgba(0,0,0,.45); }
#welcome h1 { font-size: 40px; margin: 14px 0 4px; letter-spacing: -1.2px; }
.wl-tag { color: var(--tx2); font-size: 16px; }
.wl-list { text-align: left; list-style: none; padding: 0; margin: 22px 0; display: grid; gap: 10px; }
.wl-list li { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; color: var(--tx2); font-size: 14px; }
.wl-list b { color: var(--tx); }
.wl-card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px; display: grid; gap: 10px; justify-items: center; }
.gbtn { min-height: 44px; width: 100%; display: flex; justify-content: center; }
.wl-local { color: var(--tx2); text-decoration: underline; text-underline-offset: 3px; padding: 8px; }

/* ── Armazón ───────────────────────────────────────────────────────── */
#shell { min-height: 100vh; }
.side { display: none; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: calc(8px + var(--safe-t)) 14px 8px; background: rgba(10,13,19,.86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 9px; font-size: 18px; letter-spacing: -.3px; }
.brand img { border-radius: 8px; }
.topbar .brand { margin-right: auto; }
.top-racha { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: var(--tx3); font-size: 15px; }
.top-racha.ok { color: var(--warn); }
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tx3); flex: none; }
.sync-dot.ok { background: var(--acc); } .sync-dot.syncing { background: var(--ind); animation: pulse 1s infinite; }
.sync-dot.error, .sync-dot.expired { background: var(--bad); } .sync-dot.offline { background: var(--warn); } .sync-dot.local { background: transparent; border: 1.5px solid var(--tx3); }
@keyframes pulse { 50% { opacity: .35; } }
#view { padding: 14px 14px calc(var(--tabs-h) + 24px + var(--safe-b)); }
html.has-mini #view { padding-bottom: calc(var(--tabs-h) + 92px + var(--safe-b)); }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr); height: calc(var(--tabs-h) + var(--safe-b)); padding-bottom: var(--safe-b); background: rgba(12,15,22,.94); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); }
.tabs button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--tx3); font-size: 11px; font-weight: 600; }
.tabs button .ic { width: 23px; height: 23px; }
.tabs button.on { color: var(--acc); }
.page { max-width: 1120px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin: 4px 2px 14px; }
.page-head p { margin: 4px 0 0; }

/* ── Piezas ────────────────────────────────────────────────────────── */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin-bottom: 14px; }
.sec-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; margin: 4px 0 10px; }
.sec-title .muted { font-weight: 500; font-size: 13px; }
.sec-title.sm { font-size: 14px; margin-top: 14px; }
.page > .sec-title { margin: 18px 2px 10px; }
.sub-title { font-weight: 650; font-size: 13px; color: var(--tx2); text-transform: uppercase; letter-spacing: .5px; margin: 14px 0 8px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 16px; border-radius: 12px; background: var(--card2); border: 1px solid var(--line2); font-weight: 650; font-size: 15px; transition: transform .08s, background .15s; text-decoration: none; color: var(--tx); }
.btn:active { transform: scale(.98); }
.btn.pri { background: var(--acc); border-color: transparent; color: #03140c; }
.btn.pri:hover { background: #4ae0a8; }
.btn.ghost { background: transparent; }
.btn.sm { min-height: 36px; padding: 6px 12px; font-size: 14px; border-radius: 10px; }
.btn.big { min-height: 54px; font-size: 16px; }
.btn.huge { min-height: 76px; font-size: 19px; border-radius: 18px; }
.btn.full { width: 100%; margin-top: 10px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.btn-row .btn { flex: 1 1 140px; }
.link { color: var(--acc); text-decoration: underline; text-underline-offset: 2px; font-weight: 600; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; color: var(--tx2); flex: none; }
.icon-btn:hover { background: var(--card2); color: var(--tx); }
.icon-btn.sm { width: 32px; height: 32px; } .icon-btn.sm .ic { width: 17px; height: 17px; }
.icon-btn.lg { width: 56px; height: 56px; } .icon-btn.lg .ic { width: 28px; height: 28px; }
.icon-btn-sp { width: 40px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 6px 12px; font-size: 12.5px; font-weight: 650; background: var(--card2); border: 1px solid var(--line2); color: var(--tx2); white-space: nowrap; }
.chip.fase { color: var(--acc); background: var(--acc-bg); border-color: rgba(52,211,153,.25); }
.pill { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 4px 10px; font-size: 12.5px; font-weight: 650; background: var(--card2); color: var(--tx2); }
.pill.ok { background: var(--acc-bg); color: var(--acc); } .pill.warn { background: var(--warn-bg); color: var(--warn); } .pill.acc { background: rgba(129,140,248,.15); color: var(--ind); }
.pill .ic { width: 15px; height: 15px; }
.banner { display: flex; gap: 10px; align-items: flex-start; border-radius: 14px; padding: 12px 14px; margin-bottom: 14px; font-size: 14px; }
.banner.info { background: rgba(129,140,248,.1); border: 1px solid rgba(129,140,248,.25); }
.banner .ic { color: var(--ind); margin-top: 2px; }
.banner.inst { background: var(--acc-bg); border: 1px solid rgba(52,211,153,.25); }
.banner.inst > .ic { color: var(--acc); }
.banner.inst > div { flex: 1; } .banner.inst .btn { margin-top: 8px; }
.sep { height: 1px; background: var(--line); margin: 14px 0; }
.bul { padding-left: 20px; margin: 6px 0 10px; } .bul li { margin-bottom: 6px; }
.progress { height: 6px; background: var(--card3); border-radius: 99px; overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--acc); border-radius: 99px; transition: width .3s; }
.empty { text-align: center; padding: 30px 10px; }

/* Categorías */
.cat-escucha { --c: var(--c-escucha); } .cat-intensiva { --c: var(--c-intensiva); } .cat-habla { --c: var(--c-habla); } .cat-frases { --c: var(--c-frases); }
.cat-escritura { --c: var(--c-escritura); } .cat-examen { --c: var(--c-examen); } .cat-lectura { --c: var(--c-lectura); } .cat-clase { --c: var(--c-clase); } .cat-otro { --c: var(--c-otro); }
.c-escucha { fill: var(--c-escucha); background: var(--c-escucha); } .c-intensiva { fill: var(--c-intensiva); background: var(--c-intensiva); } .c-habla { fill: var(--c-habla); background: var(--c-habla); } .c-frases { fill: var(--c-frases); background: var(--c-frases); }
.c-escritura { fill: var(--c-escritura); background: var(--c-escritura); } .c-examen { fill: var(--c-examen); background: var(--c-examen); } .c-lectura { fill: var(--c-lectura); background: var(--c-lectura); } .c-clase { fill: var(--c-clase); background: var(--c-clase); } .c-otro { fill: var(--c-otro); background: var(--c-otro); }

/* ── Hoy ───────────────────────────────────────────────────────────── */
.grid-hoy { display: grid; gap: 0; }
.hero { display: flex; gap: 16px; align-items: center; background: linear-gradient(160deg, #15201f 0%, var(--card) 55%); }
.hero-ring { position: relative; flex: none; }
.ring-bg { stroke: var(--card3); } .ring-fg { stroke: var(--ind); transition: stroke-dashoffset .8s cubic-bezier(.2,.8,.2,1); }
.ring.ok .ring-fg { stroke: var(--acc); }
.ring-in { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-in b { font-size: 32px; font-weight: 800; letter-spacing: -1px; line-height: 1; }
.ring-in span { font-size: 12px; color: var(--tx2); margin-top: 3px; }
.hero-tx { min-width: 0; display: grid; gap: 8px; }
.racha-big { display: flex; align-items: baseline; gap: 6px; color: var(--tx2); }
.racha-big .ic { width: 22px; height: 22px; align-self: center; color: var(--tx3); }
.racha-big b { font-size: 26px; font-weight: 800; color: var(--tx); letter-spacing: -.5px; }
.racha-big.ok .ic { color: var(--warn); }
.hero-tx p { margin: 0; }
.exam-count { display: flex; align-items: center; gap: 7px; text-align: left; font-size: 12.5px; color: var(--tx2); background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; }
.exam-count b { color: var(--tx); }
.exam-count .ic { width: 16px; height: 16px; color: var(--c-examen); }
.tasks { display: grid; gap: 9px; }
.task { display: flex; gap: 12px; align-items: center; text-align: left; width: 100%; padding: 12px; border-radius: 14px; background: var(--card2); border: 1px solid var(--line); transition: transform .08s, border-color .15s; }
.task:active { transform: scale(.99); }
.task:hover { border-color: var(--line2); }
.t-ic { width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex: none; color: var(--c, var(--tx2)); background: color-mix(in srgb, var(--c, #888) 15%, transparent); }
.t-ic.sm { width: 32px; height: 32px; border-radius: 9px; } .t-ic.sm .ic { width: 17px; height: 17px; }
.t-tx { flex: 1; min-width: 0; display: grid; gap: 2px; }
.t-tx small { color: var(--tx3); font-size: 12px; font-weight: 600; display: flex; align-items: center; }
.t-tx b { font-size: 15.5px; }
.t-tx span { color: var(--tx2); font-size: 13px; line-height: 1.35; }
.t-tx em { color: var(--tx3); font-size: 12.5px; font-style: normal; }
.t-go { width: 38px; height: 38px; border-radius: 50%; background: var(--acc); color: #03140c; display: flex; align-items: center; justify-content: center; flex: none; }
.t-go .ic { width: 17px; height: 17px; }
.t-done { display: inline-flex; align-items: center; gap: 4px; color: var(--acc); font-weight: 700; font-size: 13px; flex: none; }
.task.done { background: transparent; }
.task.done .t-tx b { color: var(--tx2); }
.task.done .t-tx span { display: none; }
.tip p { color: var(--tx2); margin: 0; }
.tip .sec-title .ic { color: var(--warn); }
.loglist { display: grid; gap: 4px; }
.logrow { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.logrow:last-child { border-bottom: 0; }
.lg-tx { flex: 1; min-width: 0; display: grid; } .lg-tx b { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .lg-tx small { color: var(--tx3); font-size: 12px; }
.lg-min { font-weight: 700; font-size: 14px; }

/* ── Escuchar / Hablar ────────────────────────────────────────────── */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.tile { text-align: left; padding: 14px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); display: grid; gap: 5px; align-content: start; position: relative; overflow: hidden; }
.tile::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--c); }
.tile > .ic { color: var(--c); width: 26px; height: 26px; }
.tile b { font-size: 15.5px; }
.tile span { font-size: 12.5px; color: var(--tx2); line-height: 1.35; }
.tile-n { position: absolute; right: 12px; top: 8px; font-size: 30px; font-weight: 800; color: color-mix(in srgb, var(--c) 35%, transparent); }
.chips-list { display: flex; flex-wrap: wrap; gap: 7px; }
.dchip { display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; border-radius: 10px; background: var(--card2); border: 1px solid var(--line); font-size: 13.5px; text-align: left; }
.dchip b { font-weight: 600; }
.dchip.done { border-color: rgba(52,211,153,.25); }
.sc { font-size: 12px; font-weight: 700; padding: 2px 7px; border-radius: 99px; background: var(--card3); color: var(--tx2); }
.sc.ok { background: var(--acc-bg); color: var(--acc); } .sc.mid { background: var(--warn-bg); color: var(--warn); } .sc.lo { background: var(--bad-bg); color: var(--bad); }
.lec-list, .par-list, .ia-list, .grab-list, .mine-list, .flist { display: grid; gap: 7px; }
.lec, .par, .ia { display: flex; align-items: center; gap: 12px; text-align: left; width: 100%; padding: 10px 12px; border-radius: 12px; background: var(--card2); border: 1px solid var(--line); }
.lec > span:nth-child(2), .par > b, .ia > b { flex: 1; }
.lec span b, .par b, .ia b { display: block; font-size: 14.5px; font-weight: 650; }
.lec small, .par small, .ia small { display: block; color: var(--tx2); font-size: 12.5px; }
.par { flex-wrap: wrap; } .par small { flex-basis: 100%; order: 3; margin-top: -6px; }
.ia { flex-wrap: wrap; } .ia small { flex-basis: calc(100% - 40px); }
.ia .ic { color: var(--tx3); }
.lec-n { width: 28px; height: 28px; border-radius: 50%; background: var(--card3); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: var(--tx2); flex: none; }
.lec.done .lec-n { background: var(--acc-bg); color: var(--acc); } .lec-n .ic { width: 15px; height: 15px; }
.reclist { display: grid; gap: 7px; }
.rec { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--card2); border: 1px solid var(--line); color: var(--tx); text-decoration: none; }
.rec .ic { color: var(--tx3); }
.rec-tx { flex: 1; min-width: 0; display: grid; gap: 2px; }
.rec-tx b { font-size: 14.5px; } .rec-tx small { color: var(--acc); font-size: 12px; font-weight: 600; } .rec-tx span { color: var(--tx2); font-size: 13px; }
.rec.big { border-color: rgba(52,211,153,.3); background: linear-gradient(160deg, #142320, var(--card2)); }
.grab, .mine, .fitem { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.grab:last-child, .mine:last-child, .fitem:last-child { border-bottom: 0; }
.grab > span, .mine > span, .fitem > span:nth-child(2) { flex: 1; min-width: 0; display: grid; }
.grab b, .mine b, .fitem b { font-size: 14px; font-weight: 600; }
.grab small, .mine small, .fitem small { color: var(--tx2); font-size: 12.5px; }
.fst { font-size: 11px; font-weight: 700; color: var(--tx3); text-transform: uppercase; letter-spacing: .4px; flex: none; }
.fst.r { color: var(--acc); } .fst.l, .fst.x { color: var(--warn); }
pre.prompt { white-space: pre-wrap; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; font-size: 13px; color: var(--tx2); max-height: 42vh; overflow: auto; font-family: var(--font); }

/* ── Frases ────────────────────────────────────────────────────────── */
.hero-frases { background: linear-gradient(160deg, #221c10, var(--card) 60%); }
.hf-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; margin-bottom: 12px; }
.hf-nums b { display: block; font-size: 28px; font-weight: 800; letter-spacing: -.5px; }
.hf-nums span { font-size: 12px; color: var(--tx2); }
.hf-btns { display: grid; grid-template-columns: 1.4fr 1fr; gap: 10px; }
.temas { display: grid; gap: 8px; margin-bottom: 14px; }
.tema { display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.tema.cur { border-color: rgba(251,191,36,.4); }
.tema-ic { width: 38px; height: 38px; border-radius: 11px; background: var(--warn-bg); color: var(--warn); display: flex; align-items: center; justify-content: center; flex: none; }
.tema-tx { flex: 1; display: grid; gap: 3px; min-width: 0; }
.tema-tx b { font-size: 15px; } .tema-tx small { color: var(--tx2); font-size: 12.5px; }
.bar { display: block; position: relative; height: 5px; border-radius: 99px; background: var(--card3); overflow: hidden; }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(251,191,36,.45); border-radius: 99px; }
.bar i.b2 { background: var(--warn); }

/* ── Progreso ──────────────────────────────────────────────────────── */
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: grid; gap: 1px; }
.kpi b { font-size: 24px; font-weight: 800; letter-spacing: -.5px; }
.kpi span { font-size: 13px; color: var(--tx2); font-weight: 600; }
.kpi small { font-size: 12px; color: var(--tx3); }
svg.bars { width: 100%; height: auto; max-height: 260px; display: block; }
svg.bars .lbl { font-size: 13px; fill: var(--tx3); } svg.bars .lbl.hl { fill: var(--tx); font-weight: 700; }
svg.bars .goal { stroke: var(--tx3); stroke-dasharray: 5 5; } svg.bars .goal-t { font-size: 12px; fill: var(--tx3); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--tx2); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.heat-wrap { overflow-x: auto; }
svg.heat { width: 100%; max-width: 560px; display: block; }
.heat rect.h0, .legend .h0 { fill: var(--card3); background: var(--card3); }
.heat rect.h1, .legend .h1 { fill: #3a3424; background: #3a3424; }
.heat rect.h2, .legend .h2 { fill: #146a4c; background: #146a4c; }
.heat rect.h3, .legend .h3 { fill: #1fa874; background: #1fa874; }
.heat rect.h4, .legend .h4 { fill: #4ef0b0; background: #4ef0b0; }
.heat rect.today { stroke: var(--tx); stroke-width: 1.5; }
.slots { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 12px; font-size: 13px; color: var(--tx2); }
.slots b { color: var(--tx); }
svg.spark { width: 100%; height: 70px; display: block; margin: 6px 0; }
svg.spark polyline { fill: none; stroke: var(--acc); stroke-width: 2.5; stroke-linejoin: round; }
svg.spark circle { fill: var(--acc); }
.chkrow { display: grid; grid-template-columns: auto 1fr; gap: 0 10px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.chkrow small { grid-column: 1 / -1; color: var(--tx3); font-size: 12px; } .chkrow span { color: var(--tx2); font-size: 13.5px; }
.ruta { display: grid; gap: 4px; }
.ruta-f, .ruta-h { display: flex; gap: 12px; padding: 8px 0; position: relative; }
.ruta-f .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--card3); margin-top: 4px; flex: none; }
.ruta-f.now .dot { background: var(--acc); box-shadow: 0 0 0 4px var(--acc-bg); } .ruta-f.past .dot { background: #1fa874; }
.ruta-f b, .ruta-h b { display: block; font-size: 14.5px; } .ruta-f small, .ruta-h small { color: var(--tx2); font-size: 12.5px; }
.ruta-f p, .ruta-h p { margin: 4px 0 0; color: var(--tx2); font-size: 13px; }
.ruta-h > span { color: var(--c-examen); flex: none; } .ruta-h.done > span { color: var(--acc); } .ruta-h.past { opacity: .6; }
.rev { padding: 8px 0; border-bottom: 1px solid var(--line); } .rev:last-of-type { border-bottom: 0; }
.rev small { color: var(--tx3); margin-left: 8px; } .rev p { margin: 4px 0 0; font-size: 13.5px; color: var(--tx2); }
.rev-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; margin-bottom: 12px; }
.rev-sum b { display: block; font-size: 20px; } .rev-sum span { font-size: 12px; color: var(--tx2); }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; color: var(--tx3); font-weight: 600; font-size: 12px; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 9px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl td small { display: block; color: var(--tx2); font-size: 12.5px; }
.tbl td:not(:first-child), .tbl th:not(:first-child) { white-space: nowrap; padding-left: 10px; }

/* ── Formularios ───────────────────────────────────────────────────── */
.field { display: grid; gap: 6px; margin-bottom: 12px; min-width: 0; }
.field label { font-size: 13px; font-weight: 650; color: var(--tx2); }
input:not([type=checkbox]), textarea, select { width: 100%; background: var(--bg2); border: 1px solid var(--line2); border-radius: 11px; padding: 11px 12px; font-size: 16px; outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--acc); }
textarea { resize: vertical; }
input[type=date] { min-height: 46px; }
.row2 { display: grid; grid-template-columns: 1fr; gap: 0 12px; } .row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 10px; }
.seg { display: flex; background: var(--bg2); border: 1px solid var(--line2); border-radius: 12px; padding: 3px; gap: 3px; }
.seg button { flex: 1; min-height: 38px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--tx2); padding: 4px 8px; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; }
.seg button.on { background: var(--card3); color: var(--tx); box-shadow: 0 1px 0 rgba(255,255,255,.06) inset; }
.seg.wrap { flex-wrap: wrap; } .seg.wrap button { flex: 1 1 auto; }
.seg.wrap input { flex: 1 1 70px; width: 70px; min-height: 38px; padding: 6px 8px; }
.seg.days button.on { background: var(--acc-bg); color: var(--acc); }
.seg.sm button { min-height: 32px; font-size: 13px; padding: 2px 6px; }
.seg.tabs { margin-bottom: 12px; }
.dep-grid { display: grid; gap: 6px; margin-bottom: 12px; }
.dep-row { display: grid; grid-template-columns: 82px 1fr; align-items: center; gap: 8px; font-size: 14px; }
.dep-row span::first-letter { text-transform: uppercase; }
.switch { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--tx2); margin: 10px 0; cursor: pointer; }
.switch input { display: none; }
.switch span { width: 42px; height: 25px; border-radius: 99px; background: var(--card3); position: relative; flex: none; transition: background .2s; }
.switch span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 19px; height: 19px; border-radius: 50%; background: var(--tx2); transition: transform .2s, background .2s; }
.switch input:checked + span { background: var(--acc-d); } .switch input:checked + span::after { transform: translateX(17px); background: #fff; }
details summary { cursor: pointer; color: var(--tx2); font-weight: 600; padding: 4px 0; }
pre.diag { white-space: pre-wrap; font-size: 12px; color: var(--tx3); }

/* ── Capas: pantallas y hojas ─────────────────────────────────────── */
#layers { position: relative; z-index: 50; }
.screen { position: fixed; inset: 0; z-index: 50; background: var(--bg); transform: translateX(100%); transition: transform .26s cubic-bezier(.2,.8,.2,1); display: flex; flex-direction: column; }
.screen.open { transform: none; }
.screen.closing { transform: translateX(100%); }
.screen-win { display: flex; flex-direction: column; height: 100%; }
.screen-head { display: flex; align-items: center; gap: 8px; padding: calc(8px + var(--safe-t)) 10px 8px; border-bottom: 1px solid var(--line); background: var(--bg); }
.screen-title { flex: 1; min-width: 0; text-align: center; display: grid; }
.screen-title b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.screen-title small { font-size: 12px; color: var(--tx2); }
.screen-body { flex: 1; overflow-y: auto; padding: 16px 16px calc(28px + var(--safe-b)); -webkit-overflow-scrolling: touch; }
.sheet-wrap { position: fixed; inset: 0; z-index: 60; }
.sheet-bg { position: absolute; inset: 0; background: rgba(0,0,0,.55); opacity: 0; transition: opacity .22s; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: 90vh; overflow-y: auto; background: var(--card); border-radius: 22px 22px 0 0; border-top: 1px solid var(--line2); padding: 8px 16px calc(20px + var(--safe-b)); transform: translateY(100%); transition: transform .26s cubic-bezier(.2,.8,.2,1); }
.sheet-wrap.open .sheet-bg { opacity: 1; } .sheet-wrap.open .sheet { transform: none; }
.sheet-wrap.closing .sheet-bg { opacity: 0; } .sheet-wrap.closing .sheet { transform: translateY(100%); }
.sheet-handle { width: 40px; height: 5px; border-radius: 99px; background: var(--line2); margin: 2px auto 10px; }
.sheet-title { font-weight: 750; font-size: 18px; margin-bottom: 10px; }
#toast { position: fixed; left: 50%; bottom: calc(var(--tabs-h) + 18px + var(--safe-b)); transform: translate(-50%, 30px); opacity: 0; pointer-events: none; z-index: 80; background: #f1f5f9; color: #0b1220; padding: 11px 16px; border-radius: 12px; font-weight: 600; font-size: 14px; max-width: calc(100vw - 32px); box-shadow: 0 10px 30px rgba(0,0,0,.4); transition: opacity .2s, transform .2s; display: flex; align-items: center; gap: 12px; }
#toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
#toast button { color: #0f766e; font-weight: 800; }
html.has-layer #toast { bottom: calc(24px + var(--safe-b)); }

/* Mini reproductor */
#mini { position: fixed; left: 10px; right: 10px; bottom: calc(var(--tabs-h) + 10px + var(--safe-b)); z-index: 35; display: flex; align-items: center; gap: 6px; padding: 8px 8px 8px 14px; border-radius: 16px; background: #1b2433; border: 1px solid var(--line2); box-shadow: 0 10px 30px rgba(0,0,0,.45); overflow: hidden; }
.mini-fill { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,255,255,.06); }
.mini-fill i { display: block; height: 100%; width: 0; background: var(--acc); }
.mini-main { flex: 1; min-width: 0; text-align: left; display: grid; }
.mini-main b { font-size: 14px; } .mini-main span { font-size: 12.5px; color: var(--tx2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Reproductor de sesiones ──────────────────────────────────────── */
.building { text-align: center; padding: 40px 10px; display: grid; gap: 14px; justify-items: center; }
.building .progress { width: 220px; }
.spin { width: 38px; height: 38px; border-radius: 50%; border: 3px solid var(--card3); border-top-color: var(--acc); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.player { display: grid; gap: 14px; max-width: 560px; margin: 0 auto; }
.pl-cue { min-height: 230px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 20px; display: flex; flex-direction: column; justify-content: center; gap: 10px; text-align: center; }
.pl-tag { font-size: 12px; font-weight: 700; color: var(--acc); text-transform: uppercase; letter-spacing: .6px; }
.pl-es { font-size: 18px; color: var(--tx2); }
.pl-en { font-size: 23px; font-weight: 700; line-height: 1.3; letter-spacing: -.2px; }
.pl-en .tapa { color: var(--tx3); letter-spacing: 4px; }
.pl-hint { font-size: 14px; color: var(--warn); font-weight: 600; min-height: 20px; }
.player.oculto .pl-es, .player.oculto .pl-en { filter: blur(9px); opacity: .5; }
.pl-bar { height: 8px; border-radius: 99px; background: var(--card3); cursor: pointer; overflow: hidden; }
.pl-bar i { display: block; height: 100%; width: 0; background: var(--acc); border-radius: 99px; }
.pl-time { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--tx3); margin-top: -8px; font-variant-numeric: tabular-nums; }
.pl-ctrl { display: flex; justify-content: center; align-items: center; gap: 22px; }
.play-btn { width: 76px; height: 76px; border-radius: 50%; background: var(--acc); color: #03140c; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 8px 26px rgba(52,211,153,.3); transition: transform .08s; }
.play-btn:active { transform: scale(.95); }
.play-btn .ic { width: 32px; height: 32px; }
.play-btn.big { width: 96px; height: 96px; } .play-btn.big .ic { width: 40px; height: 40px; }
.done-box { text-align: center; display: grid; gap: 8px; justify-items: center; padding: 30px 6px; max-width: 460px; margin: 0 auto; }
.done-box .btn { width: 100%; }
.ic.big-ok { width: 64px; height: 64px; color: var(--acc); background: var(--acc-bg); border-radius: 50%; padding: 14px; }
.done-box .ring { margin-bottom: -6px; }

/* ── Tarjetas de frases ───────────────────────────────────────────── */
.flash { display: grid; gap: 16px; max-width: 560px; margin: 0 auto; }
.fl-top { display: flex; gap: 6px; justify-content: center; }
.fl-front { text-align: center; display: grid; gap: 10px; justify-items: center; padding: 14px 0; }
.fl-back { text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 20px 16px; display: grid; gap: 10px; animation: fadeUp .2s; }
.fl-en { font-size: 23px; font-weight: 700; line-height: 1.3; }
.fl-es { font-size: 17px; color: var(--tx2); }
.fl-tools { display: flex; gap: 8px; justify-content: center; }
.grades { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.grades button { min-height: 62px; border-radius: 13px; font-weight: 700; font-size: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 1px solid var(--line2); background: var(--card2); }
.grades small { font-size: 11.5px; font-weight: 600; color: var(--tx3); }
.grades .g1 { color: var(--bad); } .grades .g2 { color: var(--warn); } .grades .g3 { color: var(--acc); } .grades .g4 { color: var(--ind); }
.sc-rep.pesas .grades button { min-height: 86px; font-size: 16px; }
.rest { text-align: center; display: grid; gap: 10px; padding-top: 6vh; max-width: 460px; margin: 0 auto; }
.rest-t { font-size: 64px; font-weight: 800; letter-spacing: -2px; font-variant-numeric: tabular-nums; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } }

/* ── Dictados y ejercicios ────────────────────────────────────────── */
.dict, .quiz { display: grid; gap: 14px; max-width: 640px; margin: 0 auto; }
.dict-top { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--tx2); font-weight: 600; }
.dict-ctrl { display: flex; align-items: center; justify-content: center; gap: 14px; }
.dict-in { min-height: 96px; font-size: 18px !important; line-height: 1.4; }
.huecos { font-size: 20px; line-height: 2.1; text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px 12px; }
.huecos .hole { display: inline-block; min-width: 44px; max-width: 70vw; padding: 3px 8px; font-size: 18px; text-align: center; border-radius: 8px; margin: 0 2px; background: var(--bg2); border: 1px dashed var(--acc); }
.huecos.res { font-size: 18px; }
.w { border-radius: 6px; padding: 1px 3px; }
.w.ok { color: var(--acc); } .w.casi { color: var(--warn); }
.w.bad { color: var(--bad); background: var(--bad-bg); } .w.bad s { color: var(--tx3); margin-left: 4px; font-size: .85em; }
.w.miss { color: var(--bad); text-decoration: underline wavy rgba(251,113,133,.6); }
.diff { font-size: 18px; line-height: 1.8; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.full-sent { font-size: 17px; font-weight: 600; padding: 4px 2px; }
.fb { display: flex; align-items: center; gap: 8px; font-weight: 700; padding: 8px 12px; border-radius: 10px; margin-bottom: 8px; }
.fb.good { background: var(--acc-bg); color: var(--acc); } .fb.mid { background: var(--warn-bg); color: var(--warn); } .fb.low { background: var(--bad-bg); color: var(--bad); }
.dict-intro { display: grid; gap: 6px; max-width: 640px; margin: 0 auto; }
.vocab { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; font-size: 14px; }
.vocab div { padding: 3px 0; color: var(--tx2); } .vocab b { color: var(--tx); }
.opts { display: grid; grid-template-columns: 1fr; gap: 10px; }
.opts.big { grid-template-columns: 1fr 1fr; }
.opt { min-height: 64px; border-radius: 16px; background: var(--card2); border: 1px solid var(--line2); font-size: 18px; font-weight: 650; padding: 10px 14px; transition: background .15s; }
.opts.big .opt { min-height: 96px; font-size: 26px; font-weight: 750; }
.opt.right { background: var(--acc-bg); border-color: var(--acc); color: var(--acc); }
.opt.wrong { background: var(--bad-bg); border-color: var(--bad); color: var(--bad); }
.opt.off { opacity: .45; }
code.suena { display: block; text-align: center; color: var(--warn); font-size: 15px; }
.lesson .card p { color: var(--tx2); } .lesson .card p:first-child { color: var(--tx); }
.ex { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.ex-btns { display: grid; gap: 4px; }
.mini-btn { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 650; color: var(--tx2); padding: 5px 9px; border-radius: 8px; background: var(--card2); border: 1px solid var(--line); }
.mini-btn .ic { width: 14px; height: 14px; color: var(--acc); }
.ex-tx { flex: 1; min-width: 200px; display: grid; gap: 3px; }
.ex-tx b { font-size: 15.5px; } .ex-tx code { color: var(--warn); } .ex-tx small { color: var(--tx2); }

/* ── Hablar ───────────────────────────────────────────────────────── */
.qs { display: grid; gap: 8px; }
.q { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; }
.q.big { font-size: 18.5px; line-height: 1.35; display: block; margin: 6px 0; }
.compare { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; margin-bottom: 10px; }
.cmp-box { background: var(--card2); border-radius: 12px; padding: 12px; display: grid; gap: 4px; min-height: 90px; align-content: center; }
.cmp-box small { color: var(--c-habla); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; }
.cmp-vs { color: var(--tx3); font-weight: 800; }
.mind { display: flex; flex-wrap: wrap; gap: 7px; margin: 10px 0; }
.mind span { padding: 7px 11px; border-radius: 99px; background: rgba(167,139,250,.12); color: #d6caff; font-size: 14px; font-weight: 600; }
.tips { margin-top: 8px; font-size: 14px; } .tips p { color: var(--tx2); margin: 6px 0 0; }
.timer-card { text-align: center; }
.big-timer { font-size: 54px; font-weight: 800; letter-spacing: -1.5px; font-variant-numeric: tabular-nums; color: var(--tx2); }
.big-timer.run { color: var(--tx); }
.rec-row { display: flex; align-items: center; gap: 14px; }
.rec-row > div { display: grid; }
.rec-btn { width: 64px; height: 64px; border-radius: 50%; background: rgba(251,113,133,.14); color: var(--bad); display: flex; align-items: center; justify-content: center; flex: none; border: 2px solid rgba(251,113,133,.35); }
.rec-btn .ic { width: 28px; height: 28px; }
.rec-btn.on { background: var(--bad); color: #fff; animation: recpulse 1.2s infinite; }
@keyframes recpulse { 50% { box-shadow: 0 0 0 10px rgba(251,113,133,.15); } }
#rec-out audio { width: 100%; margin-top: 12px; }
.rondas { display: flex; gap: 8px; justify-content: center; margin-bottom: 12px; }
.rondas span { padding: 6px 12px; border-radius: 99px; background: var(--card2); color: var(--tx3); font-weight: 700; font-size: 13px; }
.rondas span.on { background: rgba(167,139,250,.18); color: #d6caff; } .rondas span.done { color: var(--acc); }

/* ── Tabletas y PC ────────────────────────────────────────────────── */
@media (min-width: 640px) {
  .row2 { grid-template-columns: 1fr 1fr; }
  .tiles { grid-template-columns: repeat(4, 1fr); }
  .kpis { grid-template-columns: repeat(4, 1fr); }
  .opts { grid-template-columns: 1fr 1fr; }
  #view { padding-left: 22px; padding-right: 22px; }
}
@media (min-width: 1024px) {
  :root { --tabs-h: 0px; }
  #shell { display: grid; grid-template-columns: 236px 1fr; }
  .side { display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 20px 14px; border-right: 1px solid var(--line); background: var(--bg2); }
  .side .brand { padding: 4px 8px 18px; font-size: 20px; }
  .side-nav { display: grid; gap: 3px; }
  .side-nav button, .side-foot button { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 11px; color: var(--tx2); font-weight: 600; text-align: left; }
  .side-nav button:hover, .side-foot button:hover { background: var(--card); color: var(--tx); }
  .side-nav button.on { background: var(--acc-bg); color: var(--acc); }
  .side-racha { margin: 20px 8px; padding: 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); display: flex; align-items: baseline; gap: 6px; color: var(--tx2); }
  .side-racha .ic { align-self: center; color: var(--tx3); } .side-racha.ok .ic { color: var(--warn); }
  .side-racha b { font-size: 24px; color: var(--tx); }
  .side-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; }
  .topbar, .tabs { display: none; }
  #view { padding: 28px 34px 40px; }
  html.has-mini #view { padding-bottom: 110px; }
  h1 { font-size: 30px; }
  .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; align-items: start; }
  .grid-hoy { grid-template-columns: 380px 1fr; grid-template-areas: "hero plan" "tip plan" "log plan" ". plan"; gap: 0 16px; align-items: start; }
  .grid-hoy .hero { grid-area: hero; } .grid-hoy .plan { grid-area: plan; } .grid-hoy .tip { grid-area: tip; } .grid-hoy .logcard { grid-area: log; }
  .hero { flex-direction: column; text-align: center; padding: 26px 18px; }
  .hero-tx { justify-items: center; }
  .temas { grid-template-columns: 1fr 1fr; }
  #mini { left: calc(236px + 24px); right: 24px; bottom: 20px; max-width: 760px; margin: 0 auto; }
  #toast { bottom: 28px; left: calc(50% + 118px); }
  /* Ventanas centradas en vez de pantalla completa */
  .screen { background: rgba(0,0,0,.6); transform: none; opacity: 0; transition: opacity .2s; align-items: center; justify-content: center; padding: 4vh 20px; }
  .screen.open { opacity: 1; } .screen.closing { opacity: 0; transform: none; }
  .screen-win { width: min(780px, 100%); height: auto; max-height: 92vh; background: var(--bg); border: 1px solid var(--line2); border-radius: 20px; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,.6); transform: translateY(12px); transition: transform .2s; }
  .screen.open .screen-win { transform: none; }
  .screen-head { padding: 10px 12px; }
  .screen-body { padding: 20px 24px 26px; }
  .sheet { left: 50%; right: auto; bottom: 50%; width: 520px; border-radius: 20px; border: 1px solid var(--line2); transform: translate(-50%, 50%) scale(.97); opacity: 0; transition: transform .2s, opacity .2s; max-height: 86vh; padding-bottom: 20px; }
  .sheet-wrap.open .sheet { transform: translate(-50%, 50%); opacity: 1; }
  .sheet-wrap.closing .sheet { transform: translate(-50%, 50%) scale(.97); opacity: 0; }
  .sheet-handle { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
