:root{
  --bg:#0a1628; --bg2:#0e1f38; --card:#12294d; --card2:#16315c;
  --line:rgba(255,255,255,.09); --txt:#f2f7ff; --muted:#9db4d4;
  --blue:#2f8bff; --blue2:#1a6fe0; --yellow:#ffc53d; --green:#34d399; --red:#fb7185;
  --radius:20px;
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;padding:0}
body{background:radial-gradient(1200px 800px at 80% -10%,#173a6e 0%,var(--bg) 55%) fixed,var(--bg);
  color:var(--txt);font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",Roboto,sans-serif;
  min-height:100vh;-webkit-font-smoothing:antialiased}
#app{min-height:100vh;display:flex;flex-direction:column}
button{font:inherit;color:inherit;background:none;border:none;cursor:pointer}
input,textarea,select{font:inherit;color:var(--txt);background:#0b1c34;border:1px solid var(--line);border-radius:14px;padding:14px 16px;width:100%}
input:focus,textarea:focus,select:focus{outline:2px solid var(--blue);border-color:var(--blue)}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
.safe-top{padding-top:env(safe-area-inset-top)}
.safe-bottom{padding-bottom:env(safe-area-inset-bottom)}

/* ---------- pantallas ---------- */
.loading-screen{min-height:100vh;display:flex;flex-direction:column;gap:16px;align-items:center;justify-content:center;padding:32px;text-align:center}
.pulse-mark{width:72px;height:72px;border-radius:24px;background:linear-gradient(135deg,var(--blue),#7ab8ff);
  display:grid;place-items:center;font-size:36px;animation:pulse 1.6s ease-in-out infinite}
@keyframes pulse{0%,100%{transform:scale(1);opacity:1}50%{transform:scale(1.08);opacity:.75}}

.auth-page{min-height:100vh;display:flex;flex-direction:column;justify-content:center;gap:18px;padding:32px 24px;max-width:440px;margin:0 auto}
.auth-hero{text-align:center}
.auth-hero h1{font-size:34px;margin:10px 0 6px;letter-spacing:-.5px}
.auth-hero p{color:var(--muted);margin:0}
.auth-card{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);padding:22px;display:flex;flex-direction:column;gap:12px}
.auth-card label{font-size:13px;color:var(--muted)}
.google-btn{display:flex;align-items:center;justify-content:center;gap:10px;background:#fff;color:#1a1a1a;
  border-radius:14px;padding:14px;font-weight:600}
.google-btn svg{width:20px;height:20px}
.auth-note{font-size:13px;color:var(--muted);text-align:center}
.auth-error{background:rgba(251,113,133,.12);border:1px solid rgba(251,113,133,.4);color:#fecdd3;border-radius:12px;padding:10px 14px;font-size:14px}

/* ---------- botones ---------- */
.primary-button{background:linear-gradient(135deg,var(--blue2),var(--blue));border-radius:16px;padding:16px 20px;
  font-weight:700;display:inline-flex;align-items:center;justify-content:center;gap:10px;box-shadow:0 8px 24px rgba(47,139,255,.35)}
.primary-button:disabled{opacity:.5;box-shadow:none}
.primary-button.wide{width:100%}
.primary-button.retry{background:linear-gradient(135deg,#b45309,var(--yellow));box-shadow:0 8px 24px rgba(255,197,61,.25)}
.text-back{color:var(--muted);align-self:flex-start;margin-bottom:8px}
.icon-button{width:44px;height:44px;border-radius:14px;background:var(--card);border:1px solid var(--line);display:grid;place-items:center}
.icon-button svg{width:22px;height:22px}
svg{width:24px;height:24px}

/* ---------- layout principal ---------- */
.main-content{flex:1;padding:0 20px 110px;max-width:560px;margin:0 auto;width:100%}
.topline{display:flex;align-items:center;gap:10px;padding:18px 0 6px}
.live-dot{width:8px;height:8px;border-radius:50%;background:var(--green);box-shadow:0 0 10px var(--green)}
.mono-label{font-size:11px;letter-spacing:2px;color:var(--muted);font-weight:700}
.xp-total{margin-left:auto;display:flex;align-items:center;gap:6px;background:rgba(255,197,61,.12);
  border:1px solid rgba(255,197,61,.35);color:var(--yellow);font-weight:700;border-radius:999px;padding:8px 14px}
.xp-total svg{width:18px;height:18px}

.hero-stage{background:linear-gradient(160deg,#1b3f7c,#10254a);border:1px solid var(--line);border-radius:26px;
  padding:24px 22px;margin-top:12px;position:relative;overflow:hidden}
.hero-stage::after{content:"";position:absolute;inset:auto -40px -60px auto;width:200px;height:200px;
  background:radial-gradient(circle,rgba(47,139,255,.35),transparent 70%)}
.hero-meta{display:flex;justify-content:space-between;font-size:11px;letter-spacing:1.5px;color:var(--muted);font-weight:700}
.hero-scene{color:var(--muted);font-size:14px;margin:14px 0 4px}
.hero-audio{width:56px;height:56px;border-radius:50%;background:var(--blue);display:grid;place-items:center;margin:8px 0;box-shadow:0 6px 18px rgba(47,139,255,.5)}
.hero-audio svg{width:26px;height:26px}
.hero-stage h1{font-size:32px;margin:6px 0;letter-spacing:-.5px}
.hero-translation{color:var(--muted);font-size:17px;margin:0 0 8px}
.hero-tip{font-size:14px;color:#cfe0f7;background:rgba(255,255,255,.06);border-radius:12px;padding:10px 14px}
.hero-cta{margin-top:16px;width:100%}
.hero-cta span{opacity:.75;font-weight:500;font-size:14px}

.memory-strip{display:grid;grid-template-columns:1fr 1fr 1fr;gap:10px;margin:16px 0}
.memory-strip div{background:var(--card);border:1px solid var(--line);border-radius:16px;padding:14px;text-align:center}
.memory-strip strong{display:block;font-size:24px}
.memory-strip span{color:var(--muted);font-size:12px}

.invite-card{display:flex;align-items:center;gap:14px;width:100%;text-align:left;background:var(--card);
  border:1px solid var(--line);border-radius:var(--radius);padding:18px;margin:10px 0}
.invite-card .ic{width:52px;height:52px;border-radius:16px;display:grid;place-items:center;flex-shrink:0;
  background:linear-gradient(135deg,var(--blue2),var(--blue))}
.invite-card.talk .ic{background:linear-gradient(135deg,#0ea5e9,#22d3ee)}
.invite-card.review .ic{background:linear-gradient(135deg,#b45309,var(--yellow))}
.invite-card small{color:var(--muted);font-size:11px;letter-spacing:1.5px;font-weight:700}
.invite-card strong{display:block;font-size:17px;margin:2px 0}
.invite-card p{margin:4px 0 0;color:var(--muted);font-size:14px}
.invite-card svg.arrow{margin-left:auto;flex-shrink:0;color:var(--muted)}

.section-heading{display:flex;align-items:flex-end;justify-content:space-between;margin:26px 0 12px}
.section-heading h2{margin:4px 0 0;font-size:22px}
.text-action{color:var(--blue);font-weight:600}
.coverage-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.coverage-grid div{background:var(--card);border:1px solid var(--line);border-radius:16px;padding:16px}
.coverage-grid b{display:block;font-size:11px;color:var(--muted);letter-spacing:1.5px}
.coverage-grid strong{display:block;margin:4px 0;font-size:16px}
.coverage-grid span{color:var(--muted);font-size:13px}

/* ---------- navegación ---------- */
.bottom-nav{position:fixed;left:0;right:0;bottom:0;z-index:50;background:rgba(10,22,40,.92);backdrop-filter:blur(14px);
  border-top:1px solid var(--line);display:grid;grid-template-columns:repeat(5,1fr);padding:8px 4px calc(8px + env(safe-area-inset-bottom))}
.bottom-nav button{display:flex;flex-direction:column;align-items:center;gap:4px;color:var(--muted);font-size:11px;padding:6px}
.bottom-nav button.active{color:#fff}
.bottom-nav button.active .nav-ic{background:rgba(47,139,255,.18);color:var(--blue)}
.nav-ic{width:44px;height:32px;border-radius:999px;display:grid;place-items:center}
.nav-ic svg{width:22px;height:22px}

/* ---------- práctica ---------- */
.practice-page{max-width:560px;margin:0 auto;padding:0 20px 40px;min-height:100vh;display:flex;flex-direction:column}
.practice-header{display:flex;align-items:center;gap:12px;padding:16px 0}
.session-meter{flex:1;height:8px;background:rgba(255,255,255,.1);border-radius:99px;overflow:hidden}
.session-meter span{display:block;height:100%;background:linear-gradient(90deg,var(--blue2),var(--yellow));border-radius:99px;transition:width .3s}
.xp-chip{background:rgba(255,197,61,.12);border:1px solid rgba(255,197,61,.35);color:var(--yellow);font-weight:700;border-radius:999px;padding:6px 12px;font-size:14px}
.exercise-stage{flex:1;display:flex;flex-direction:column;gap:14px}
.skill-line{display:flex;justify-content:space-between;align-items:center;gap:10px}
.skill-line .mono-label{margin:0}
.skill-line span{font-size:12px;color:var(--muted);background:rgba(255,255,255,.06);padding:6px 12px;border-radius:99px}
.scene-line{color:var(--muted);font-size:15px;font-style:italic}
.prompt-copy h2{font-size:30px;margin:0;letter-spacing:-.4px}
.prompt-copy p{color:var(--muted);margin:8px 0 0}
.dialogue-prompt{background:var(--card);border:1px solid var(--line);border-radius:18px;padding:18px}
.dialogue-prompt span{font-size:11px;letter-spacing:2px;color:var(--muted);font-weight:700}
.dialogue-prompt p{font-size:20px;margin:8px 0 0}
.listen-prompt{text-align:center;padding:10px 0}
.sound-disc{width:88px;height:88px;border-radius:50%;background:linear-gradient(135deg,var(--blue2),var(--blue));
  display:grid;place-items:center;margin:0 auto 12px;box-shadow:0 10px 30px rgba(47,139,255,.45)}
.sound-disc svg{width:38px;height:38px}
.answer-stack{display:flex;flex-direction:column;gap:10px}
.answer-option{display:flex;align-items:center;justify-content:space-between;gap:10px;text-align:left;
  background:var(--card);border:1px solid var(--line);border-radius:16px;padding:16px;font-size:17px}
.answer-option.selected{border-color:var(--blue);background:rgba(47,139,255,.12)}
.choice-ring{width:22px;height:22px;border-radius:50%;border:2px solid var(--muted);flex-shrink:0}
.answer-option.selected .choice-ring{border-color:var(--blue);background:var(--blue)}
.production-box{display:flex;flex-direction:column;gap:10px}
.production-box label{font-size:13px;color:var(--muted)}
.mic-button{display:flex;align-items:center;justify-content:center;gap:10px;background:var(--card);border:1px solid var(--line);
  border-radius:16px;padding:16px;font-weight:600}
.mic-button.live{border-color:var(--red);background:rgba(251,113,133,.12);animation:pulse 1.4s infinite}
.voice-note{font-size:13px;color:var(--muted);margin:0}
.feedback-panel{border-radius:18px;padding:18px;border:1px solid}
.feedback-panel.correct{background:rgba(52,211,153,.08);border-color:rgba(52,211,153,.4)}
.feedback-panel.incorrect{background:rgba(251,113,133,.08);border-color:rgba(251,113,133,.4)}
.feedback-title{display:flex;align-items:center;gap:10px;margin-bottom:8px}
.feedback-title strong{font-size:18px}
.feedback-title span:last-child{margin-left:auto;color:var(--yellow);font-weight:700}
.feedback-icon{width:34px;height:34px;border-radius:50%;display:grid;place-items:center;flex-shrink:0}
.correct .feedback-icon{background:var(--green);color:#04281c}
.incorrect .feedback-icon{background:var(--red);color:#3f0a12}
.expected-line{display:flex;align-items:center;gap:10px;background:rgba(255,255,255,.06);border-radius:12px;padding:12px;margin:8px 0;font-size:17px;font-weight:600}
.coach-note{font-size:14px;color:#d7e6fb;margin-top:10px}
.coach-note span{display:block;font-size:10px;letter-spacing:2px;color:var(--muted);font-weight:700;margin-bottom:2px}
.ghost-listen{display:flex;align-items:center;justify-content:center;gap:8px;color:var(--blue);padding:10px}
.exercise-footer{margin-top:auto;padding-top:16px}
.complete-state{text-align:center;padding:40px 0;display:flex;flex-direction:column;gap:14px;align-items:center}
.success-orbit{width:96px;height:96px;border-radius:50%;background:rgba(52,211,153,.15);border:2px solid var(--green);
  display:grid;place-items:center;color:var(--green)}
.success-orbit svg{width:44px;height:44px}
.complete-state h2{font-size:30px;margin:0}

/* ---------- placement ---------- */
.placement-page{max-width:560px;margin:0 auto;padding:24px 20px;min-height:100vh}
.placement-page h2{font-size:28px;margin:8px 0}
.placement-context{color:var(--muted);margin-bottom:18px}
.placement-footnote{color:var(--muted);font-size:13px;margin-top:18px}

/* ---------- currículo / progreso ---------- */
.page-header{padding:26px 0 6px}
.page-header h1{font-size:28px;margin:6px 0;letter-spacing:-.4px}
.page-header p{color:var(--muted);margin:0}
.search-box{display:flex;align-items:center;gap:10px;background:var(--card);border:1px solid var(--line);border-radius:14px;padding:0 14px;margin:14px 0}
.search-box svg{color:var(--muted);flex-shrink:0}
.search-box input{border:none;background:none;padding:14px 0}
.search-box input:focus{outline:none}
.phase-tabs{display:flex;gap:8px;overflow-x:auto;padding:4px 0 12px}
.phase-tabs button{flex-shrink:0;padding:10px 16px;border-radius:999px;background:var(--card);border:1px solid var(--line);color:var(--muted);font-size:14px}
.phase-tabs button.active{background:var(--blue);color:#fff;border-color:var(--blue)}
.unit-card{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);padding:20px;margin-bottom:12px}
.unit-top{display:flex;justify-content:space-between;font-size:11px;letter-spacing:1.5px;color:var(--muted);font-weight:700}
.unit-top em{font-style:normal;color:var(--blue)}
.unit-card h2{margin:8px 0 4px;font-size:20px}
.unit-card>p{color:var(--muted);font-size:14px;margin:0 0 12px}
.unit-skills{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:14px}
.unit-skills span{font-size:12px;background:rgba(255,255,255,.06);padding:6px 10px;border-radius:99px;color:var(--muted)}
.unit-footer{display:flex;align-items:center;justify-content:space-between}
.unit-footer span{color:var(--muted);font-size:13px}
.unit-footer button{display:flex;align-items:center;gap:8px;color:var(--blue);font-weight:700}

.progress-hero{text-align:center;padding:30px 0 10px}
.progress-hero h1{font-size:56px;margin:0}
.progress-hero h1 span{font-size:22px;color:var(--muted)}
.progress-hero p{color:var(--muted);font-size:14px;max-width:320px;margin:8px auto 0}
.mastery-key{display:flex;justify-content:center;gap:18px;margin:16px 0;font-size:13px;color:var(--muted)}
.mastery-key i{display:inline-block;width:12px;height:12px;border-radius:4px;margin-right:6px}
.mastery-key .new{background:#33415c}.mastery-key .learning{background:var(--blue)}.mastery-key .mastered{background:var(--green)}
.phrase-progress-list{display:flex;flex-direction:column;gap:8px}
.progress-row{display:flex;align-items:center;justify-content:space-between;gap:12px;text-align:left;
  background:var(--card);border:1px solid var(--line);border-radius:14px;padding:14px 16px;width:100%}
.phrase-main strong{display:block;font-size:16px}
.phrase-main em{font-style:normal;color:var(--muted);font-size:13px}
.strength-block{text-align:right;flex-shrink:0}
.strength-block small{color:var(--muted);font-size:11px}
.strength-meter{display:flex;gap:3px;margin-top:6px;justify-content:flex-end}
.strength-meter i{width:8px;height:22px;border-radius:3px;background:#2a3a57}
.strength-meter i.filled{background:linear-gradient(180deg,var(--green),#0ea5e9)}
.reset-link{color:var(--red);margin:24px auto;display:block}
.reset-panel{background:var(--card);border:1px solid rgba(251,113,133,.4);border-radius:var(--radius);padding:20px;margin-top:12px}
.reset-panel div{display:flex;gap:10px;margin-top:14px}
.reset-panel button{flex:1;padding:12px;border-radius:12px;background:#22385e}
.reset-panel button.danger{background:var(--red);font-weight:700}

/* ---------- laboratorio ---------- */
.scenario-grid{display:grid;gap:10px;margin-top:14px}
.scenario-card{display:flex;flex-direction:column;gap:6px;text-align:left;background:var(--card);border:1px solid var(--line);
  border-radius:var(--radius);padding:18px;position:relative}
.scenario-card span{font-size:13px;color:var(--muted)}
.scenario-card strong{font-size:17px}
.scenario-card p{font-size:14px;color:var(--muted);margin:0}
.scenario-card svg{position:absolute;right:16px;top:16px;color:var(--muted)}
.lab-header{display:flex;align-items:center;gap:12px;padding:16px 0}
.lab-header strong{display:block;font-size:17px}
.lab-header span{font-size:13px;color:var(--muted)}
.chat-thread{display:flex;flex-direction:column;gap:10px;padding:10px 0 16px}
.bubble{max-width:88%;border-radius:18px;padding:12px 16px}
.bubble small{display:block;font-size:10px;letter-spacing:1.5px;font-weight:700;color:var(--muted);margin-bottom:4px}
.bubble p{margin:0;font-size:16px;line-height:1.45}
.bubble.coach{background:var(--card);border:1px solid var(--line);align-self:flex-start;border-bottom-left-radius:6px}
.bubble.learner{background:linear-gradient(135deg,var(--blue2),var(--blue));align-self:flex-end;border-bottom-right-radius:6px}
.bubble.coach button{color:var(--blue);margin-top:8px;display:flex;align-items:center;gap:6px;font-size:13px}
.lab-feedback{background:rgba(255,197,61,.07);border:1px solid rgba(255,197,61,.3);border-radius:18px;padding:16px}
.score-line{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px}
.score-line span{color:var(--yellow);letter-spacing:2px}
.lab-feedback p{margin:0 0 10px;font-size:15px}
.lab-feedback .natural{display:flex;gap:10px;align-items:flex-start;background:rgba(255,255,255,.05);border-radius:12px;padding:12px;width:100%;text-align:left}
.lab-feedback .natural small{display:block;font-size:10px;letter-spacing:1.5px;color:var(--muted);font-weight:700}
.lab-feedback .natural span:last-child{font-size:16px}
.pronunciation-tip{margin-top:10px;font-size:14px;color:#d7e6fb}
.pronunciation-tip small{display:block;font-size:10px;letter-spacing:1.5px;color:var(--muted);font-weight:700}
.lab-feedback em{display:block;margin-top:10px;color:var(--yellow);font-style:normal;font-weight:700}
.lab-compose{display:flex;flex-direction:column;gap:10px;padding-bottom:20px}
.lab-compose label{font-size:13px;color:var(--muted)}
.lab-compose textarea{min-height:90px;resize:vertical}
.lab-compose .row{display:flex;align-items:center;gap:10px}
.lab-compose .row span[role=status]{flex:1;font-size:13px;color:var(--muted)}
.mic-mini{width:52px;height:52px;border-radius:50%;background:var(--card);border:1px solid var(--line);display:grid;place-items:center;flex-shrink:0}
.mic-mini.live{border-color:var(--red);background:rgba(251,113,133,.12);animation:pulse 1.4s infinite}
.continue-chat{margin:6px 0 24px}

/* ---------- hablar en vivo ---------- */
.live-hero{text-align:center;padding:26px 0 10px}
.live-hero h1{font-size:28px;margin:8px 0 4px}
.live-hero p{color:var(--muted);margin:0;font-size:15px}
.scenario-pick{margin:16px 0}
.scenario-pick label{display:block;font-size:13px;color:var(--muted);margin-bottom:8px}
.mic-stage{display:flex;flex-direction:column;align-items:center;gap:14px;padding:20px 0}
.mic-big{width:120px;height:120px;border-radius:50%;background:linear-gradient(135deg,var(--blue2),#0ea5e9);
  display:grid;place-items:center;box-shadow:0 12px 40px rgba(47,139,255,.5)}
.mic-big svg{width:52px;height:52px}
.mic-big.live{background:linear-gradient(135deg,#f43f5e,#fb923c);animation:pulse 1.6s infinite}
.live-status{font-weight:700;font-size:16px}
.live-status.listening{color:var(--green)}.live-status.thinking{color:var(--yellow)}.live-status.speaking{color:var(--blue)}
.live-status.idle{color:var(--muted)}
.live-transcript{width:100%;background:var(--card);border:1px solid var(--line);border-radius:var(--radius);
  padding:16px;min-height:120px;max-height:300px;overflow-y:auto;margin-top:8px}
.live-transcript .turn{margin-bottom:12px}
.live-transcript .turn small{display:block;font-size:10px;letter-spacing:1.5px;color:var(--muted);font-weight:700}
.live-transcript .turn p{margin:2px 0 0;font-size:16px}
.live-transcript .turn.me p{color:#bfe0ff}
.live-transcript .turn.interim p{color:var(--muted);font-style:italic}
.live-actions{display:flex;gap:10px;width:100%;margin-top:12px}
.live-actions .primary-button{flex:1}
.stop-btn{flex:1;background:rgba(251,113,133,.12);border:1px solid rgba(251,113,133,.5);color:#fecdd3;border-radius:16px;padding:16px;font-weight:700}
.notice-card{background:rgba(255,197,61,.07);border:1px solid rgba(255,197,61,.3);border-radius:var(--radius);padding:20px;margin:16px 0}
.notice-card h3{margin:0 0 8px}
.notice-card p{color:var(--muted);font-size:14px;margin:0}

/* ---------- ajustes ---------- */
.settings-page .field{margin-bottom:16px}
.settings-page .field label{display:block;font-size:13px;color:var(--muted);margin-bottom:8px}
.toggle-row{display:flex;align-items:center;justify-content:space-between;background:var(--card);border:1px solid var(--line);
  border-radius:16px;padding:16px;margin-bottom:10px}
.toggle-row strong{display:block}
.toggle-row small{color:var(--muted)}
.switch{width:56px;height:32px;border-radius:99px;background:#2a3a57;position:relative;flex-shrink:0;transition:background .2s}
.switch.on{background:var(--green)}
.switch::after{content:"";position:absolute;top:4px;left:4px;width:24px;height:24px;border-radius:50%;background:#fff;transition:left .2s}
.switch.on::after{left:28px}
.settings-actions{display:flex;flex-direction:column;gap:10px;margin-top:20px}
.ghost-button{background:var(--card);border:1px solid var(--line);border-radius:16px;padding:16px;font-weight:600}
.ghost-button.danger{color:#fecdd3;border-color:rgba(251,113,133,.4)}
.saved-toast{position:fixed;top:20px;left:50%;transform:translateX(-50%);background:var(--green);color:#04281c;
  font-weight:700;border-radius:99px;padding:12px 24px;z-index:100;box-shadow:0 8px 24px rgba(0,0,0,.4)}
.push-card{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);padding:18px;margin:12px 0}
.push-card strong{display:block;margin-bottom:4px}
.push-card p{color:var(--muted);font-size:14px;margin:0 0 12px}
