:root{
  --blue:#0829A6; --blue2:#0B45CF; --blue-dark:#04186F;
  --green:#2EBC14; --green-dark:#239D0D;
  --ink:#12131A; --muted:#62697A; --line:#E4E7EF;
  --paper:#FFFFFF; --soft:#F5F7FB; --soft-blue:#EEF3FF;
  --shadow:0 18px 45px rgba(17,35,87,.12); --radius:24px;
}
*{box-sizing:border-box} html{background:var(--soft)} body{margin:0;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:var(--ink);background:var(--soft);min-height:100vh}
button,input{font:inherit} button{cursor:pointer}.hidden{display:none!important}
.shell{width:min(520px,100%);margin:0 auto;min-height:100vh;background:var(--soft);position:relative;padding-bottom:92px}
.auth-shell{min-height:100vh;background:linear-gradient(155deg,var(--blue-dark),var(--blue) 58%,var(--blue2));display:flex;align-items:center;justify-content:center;padding:24px}
.auth-card{width:min(440px,100%);background:#fff;border-radius:30px;padding:26px;box-shadow:0 32px 80px rgba(0,0,0,.24)}
.auth-logo{display:block;width:250px;max-width:80%;margin:0 auto 20px}.auth-card h1{text-align:center;margin:4px 0 6px;font-size:29px}.auth-card>.lead{text-align:center;color:var(--muted);margin:0 0 22px;font-size:14px}
.auth-tabs{display:grid;grid-template-columns:1fr 1fr;background:var(--soft-blue);padding:5px;border-radius:16px;margin-bottom:17px}.auth-tabs button{border:0;background:transparent;border-radius:12px;padding:11px;font-weight:900;color:#63709a}.auth-tabs button.active{background:#fff;color:var(--blue);box-shadow:0 5px 15px rgba(8,41,166,.10)}
.form{display:grid;gap:11px}.field{display:grid;gap:6px}.field label{font-size:12px;font-weight:850;color:#30384c}.field input{border:1px solid #d9dfed;border-radius:14px;padding:13px 14px;outline:none;background:#fff}.field input:focus{border-color:#7c95ee;box-shadow:0 0 0 3px #edf2ff}
.btn{border:0;border-radius:999px;padding:13px 18px;font-weight:900;transition:.18s transform,.18s opacity}.btn:active{transform:scale(.985)}.btn-blue{background:var(--blue);color:#fff;box-shadow:0 10px 22px rgba(8,41,166,.22)}.btn-green{background:var(--green);color:#fff;box-shadow:0 10px 22px rgba(46,188,20,.22)}.btn-light{background:var(--soft-blue);color:var(--blue)}.btn-outline{background:#fff;border:1.5px solid #bfd0ff;color:var(--blue)}.btn-block{width:100%}
.mode-note{margin-top:14px;padding:11px 13px;border-radius:14px;font-size:11px;line-height:1.45;background:#fff8e7;border:1px solid #efdba5;color:#78590e}.mode-note.cloud{background:#eef9ea;border-color:#d1e9ca;color:#26731a}
.app-header{position:sticky;top:0;z-index:20;background:rgba(255,255,255,.95);backdrop-filter:blur(14px);border-bottom:1px solid rgba(0,0,0,.06);padding:11px 16px}.head-row{display:flex;align-items:center;justify-content:space-between}.brand img{width:205px;max-height:48px;object-fit:contain}.head-user{width:40px;height:40px;border-radius:13px;background:var(--soft-blue);display:grid;place-items:center;color:var(--blue);font-weight:950}
.view{display:none;padding:17px}.view.active{display:block}.hero{background:linear-gradient(150deg,var(--blue-dark),var(--blue) 62%,var(--blue2));border-radius:28px;color:#fff;padding:22px;position:relative;overflow:hidden;box-shadow:var(--shadow)}.hero:after{content:"";position:absolute;width:150px;height:150px;border:28px solid rgba(46,188,20,.23);border-radius:50%;right:-73px;top:-62px}.eyebrow{font-size:11px;font-weight:950;letter-spacing:.13em;text-transform:uppercase;color:var(--green)}.hero .eyebrow{color:#a9ff92}.hero h1{font-size:29px;line-height:1.05;margin:7px 0 8px;letter-spacing:-.03em}.hero p{margin:0;color:#e8edff;font-size:13px;line-height:1.5;max-width:340px}.brand-line{display:inline-block;margin-top:15px;color:#a9ff92;font-weight:900;font-size:12px}
.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:9px;margin:13px 0}.stat{background:#fff;border:1px solid var(--line);border-radius:18px;padding:13px 8px;text-align:center}.stat strong{display:block;font-size:18px}.stat span{display:block;color:var(--muted);font-size:9px;font-weight:900;letter-spacing:.04em;margin-top:2px}.section-head{display:flex;align-items:end;justify-content:space-between;margin:21px 2px 11px}.section-head h2{margin:0;font-size:18px}.section-head span{color:var(--muted);font-size:11px}.card{background:#fff;border:1px solid var(--line);border-radius:22px;box-shadow:0 9px 24px rgba(25,45,90,.05)}.practice-card{padding:18px}.practice-top{display:flex;gap:13px;align-items:center}.app-icon{width:54px;height:54px;border-radius:18px;background:var(--blue);color:#fff;display:grid;place-items:center;font-size:24px}.practice-top h3{margin:0 0 3px;font-size:17px}.practice-top p{margin:0;color:var(--muted);font-size:12px}.pills{display:flex;gap:7px;flex-wrap:wrap;margin:13px 0}.pill{background:#eff3fb;color:#53607c;border-radius:999px;padding:6px 9px;font-size:10px;font-weight:850}.pill.green{background:#eaf8e5;color:var(--green-dark)}.quick-grid{display:grid;grid-template-columns:1fr 1fr;gap:9px}.quick{border:1px solid var(--line);background:#fff;border-radius:20px;padding:14px;text-align:left}.quick b{display:block;font-size:13px;margin:7px 0 2px}.quick small{color:var(--muted)}
.conversation-top{display:flex;align-items:center;gap:10px}.circle-btn{border:0;background:#fff;color:var(--blue);width:42px;height:42px;border-radius:14px;font-size:19px}.progress-track{flex:1;height:8px;background:#e8edf8;border-radius:999px;overflow:hidden}.progress-fill{height:100%;width:0;background:linear-gradient(90deg,var(--blue),var(--green));transition:.3s}.lesson-step{font-size:11px;font-weight:900;color:var(--muted)}.lesson-title{font-size:27px;margin:17px 0 2px}.lesson-sub{color:var(--muted);font-size:12px;margin-bottom:13px}.speaker{padding:19px}.speaker .role{color:var(--blue);font-size:10px;font-weight:950;letter-spacing:.12em}.phrase{font-size:22px;font-weight:850;line-height:1.35;margin:11px 0 16px}.two-btns{display:grid;grid-template-columns:1fr 1fr;gap:8px}.mic-zone{text-align:center;margin:19px 0}.mic{width:92px;height:92px;border:0;border-radius:50%;background:linear-gradient(145deg,var(--blue),var(--blue2));color:#fff;font-size:34px;box-shadow:0 16px 30px rgba(8,41,166,.28)}.mic.listening{background:linear-gradient(145deg,#d93443,#ff776f);animation:pulse 1.15s infinite}@keyframes pulse{0%{box-shadow:0 0 0 0 rgba(217,52,67,.35)}70%{box-shadow:0 0 0 23px rgba(217,52,67,0)}100%{box-shadow:0 0 0 0 rgba(217,52,67,0)}}.mic-label{font-size:10px;font-weight:950;color:var(--muted);margin-top:9px}.browser-note{display:none;background:#fff8e7;border:1px solid #efdba5;color:#78590e;border-radius:14px;padding:11px;font-size:11px;line-height:1.4;margin:11px 0}.fallback{display:none;gap:8px}.fallback input{width:100%;border:1px solid var(--line);border-radius:13px;padding:12px}.result{display:none;padding:17px;margin-top:13px}.score-row{display:flex;align-items:center;gap:13px}.score-badge{width:76px;height:76px;border-radius:23px;background:#eaf8e5;color:var(--green-dark);display:grid;place-items:center;font-size:27px;font-weight:950}.score-row h3{margin:0 0 3px}.score-row p{margin:0;color:var(--muted);font-size:11px}.metrics{display:grid;grid-template-columns:repeat(3,1fr);gap:7px;margin:13px 0}.metric{background:var(--soft);border-radius:13px;padding:9px;text-align:center}.metric b{display:block}.metric span{color:var(--muted);font-size:9px;font-weight:900}.transcript{font-size:12px;color:#46516d;border-top:1px solid var(--line);padding-top:11px}.words{display:flex;gap:5px;flex-wrap:wrap;margin-top:9px}.word{padding:5px 7px;border-radius:8px;background:#eaf8e5;color:#28731d;font-size:11px;font-weight:850}.word.miss{background:#fff0f2;color:#a83141}
.complete{text-align:center;padding:24px}.big-score{font-size:58px;line-height:1;font-weight:950;color:var(--blue)}.xp{display:inline-block;margin:12px auto;background:#eaf8e5;color:var(--green-dark);padding:9px 13px;border-radius:999px;font-weight:950}.activity{display:grid;gap:8px}.activity-item{display:flex;align-items:center;justify-content:space-between;padding:13px 14px}.activity-item b{font-size:12px}.activity-item span{color:var(--muted);font-size:11px}.profile-card{padding:21px;text-align:center}.avatar{width:76px;height:76px;border-radius:24px;background:var(--blue);color:#fff;display:grid;place-items:center;font-size:25px;font-weight:950;margin:0 auto 10px}.profile-card h2{margin:3px 0}.profile-card p{color:var(--muted);font-size:12px;margin:0}.logout{margin-top:17px}.cloud-warning{margin:14px 0;padding:13px;border-radius:16px;background:#fff8e7;border:1px solid #efdba5;color:#78590e;font-size:11px;line-height:1.5}
.navbar{position:fixed;z-index:30;bottom:0;left:50%;transform:translateX(-50%);width:min(520px,100%);background:rgba(255,255,255,.96);backdrop-filter:blur(18px);border-top:1px solid var(--line);display:grid;grid-template-columns:repeat(4,1fr);padding:7px 7px calc(7px + env(safe-area-inset-bottom))}.navbar button{border:0;background:transparent;color:#8791aa;font-size:9px;font-weight:900;padding:6px}.navbar button span{display:block;font-size:18px;margin-bottom:2px}.navbar button.active{color:var(--blue)}.toast{position:fixed;z-index:100;left:50%;bottom:98px;transform:translateX(-50%) translateY(20px);opacity:0;background:#101833;color:white;padding:11px 15px;border-radius:13px;font-size:11px;font-weight:850;transition:.22s;max-width:90%;text-align:center}.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}
@media(max-width:390px){.brand img{width:182px}.hero h1{font-size:26px}.phrase{font-size:20px}}

.field select,.preview-box select{width:100%;border:1px solid #d9dfed;border-radius:14px;padding:13px 14px;outline:none;background:#fff;color:var(--ink)}
.field select:focus,.preview-box select:focus{border-color:#7c95ee;box-shadow:0 0 0 3px #edf2ff}
.field small{color:var(--muted);font-size:10px;line-height:1.35}
.preview-box{margin-top:13px;padding-top:13px;border-top:1px solid var(--line);display:grid;gap:8px}
.preview-box label{font-size:11px;font-weight:900;color:#30384c}
.streak-rule{margin-top:10px;padding:13px 14px;display:grid;gap:4px;background:#fff}
.streak-rule b{font-size:12px;color:var(--blue)}
.streak-rule span{font-size:11px;color:var(--muted);line-height:1.45}
.stats.four{grid-template-columns:repeat(4,1fr)}
.stats.four .stat{padding-left:5px;padding-right:5px}
.stats.four .stat strong{font-size:16px}
@media(max-width:390px){.stats.four .stat span{font-size:8px}}

/* v0.4 — speaking-only A/B/C/D feedback */
.grade-row{display:flex;align-items:center;gap:16px}
.grade-badge{width:86px;height:86px;border-radius:26px;display:grid;place-items:center;font-size:48px;font-weight:1000;line-height:1;flex:0 0 auto;border:2px solid transparent}
.grade-copy h3{font-size:23px;margin:0 0 5px}
.grade-copy p{font-size:12px;margin:0;color:var(--muted);font-weight:800}
.grade-a{background:#e7faec!important;color:#188331!important;border-color:#b9eac5!important}
.grade-b{background:#eaf0ff!important;color:#1746b7!important;border-color:#c8d5ff!important}
.grade-c{background:#fff5d9!important;color:#9a6800!important;border-color:#f5da8b!important}
.grade-d{background:#ffe8eb!important;color:#bc3342!important;border-color:#f4bec5!important}
.feedback-block{margin-top:14px;padding-top:14px;border-top:1px solid var(--line)}
.feedback-block>b{font-size:13px}
.feedback-help{margin:4px 0 10px;color:var(--muted);font-size:10px;line-height:1.4}
.words{display:flex;flex-wrap:wrap;gap:7px}
.word{display:inline-flex;flex-direction:column;gap:2px;padding:7px 9px;border-radius:10px;font-size:12px;font-weight:900;line-height:1.1}
.word small{font-size:8px;font-weight:800;opacity:.82}
.word-correct{background:#e8f8ec;color:#177a31}
.word-missing{background:#ffe8eb;color:#b62d3d;text-decoration:underline;text-decoration-style:dotted}
.word-wrong{background:#fff1dc;color:#9a5900}
.extra-words{margin-top:9px;font-size:10px;color:#8a5d12;line-height:1.4}
.compact-transcript{margin-top:12px;padding:10px 12px;border-radius:12px;background:#f7f8fc;font-size:10px;color:var(--muted)}
.final-grade{width:118px;height:118px;border-radius:34px;display:grid;place-items:center;font-size:70px;font-weight:1000;margin:12px auto 8px;border:2px solid transparent}
.final-number{font-size:19px;font-weight:1000;color:var(--ink);margin-bottom:4px}
.browser-note{background:#fff7e5!important;color:#775710!important;border:1px solid #f0d697!important}

/* v0.5 voice safety */
.mic-disabled{
  opacity:.55;
  filter:grayscale(.25);
}

/* v0.8 — natural voice selector */
.voice-card{margin-top:14px;padding:16px}
.voice-card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:12px}
.voice-card h3{margin:4px 0 4px;font-size:17px}
.voice-card p{margin:0;color:var(--muted);font-size:10px;line-height:1.4}
.voice-icon{width:44px;height:44px;border-radius:15px;background:#eef3ff;display:grid;place-items:center;font-size:21px}
.voice-select{
  width:100%;
  border:1px solid #d9dfed;
  border-radius:14px;
  padding:13px 14px;
  margin-bottom:10px;
  color:var(--ink);
  background:white;
  font-weight:700;
  font-size:12px;
}

/* v1.0 local Whisper recorder */
.mic-label{min-height:18px;text-align:center}

/* v1.5 Guided Role Play */
.partner-card{
  margin-bottom:12px;
  padding:18px;
  background:linear-gradient(145deg,#f2f7ff,#ffffff);
  border:1px solid #d9e5ff;
}
.partner-role{
  color:#65718b;
  font-size:10px;
  font-weight:950;
  letter-spacing:.12em;
  margin-bottom:8px;
}
.partner-phrase{
  font-size:18px;
  font-weight:800;
  line-height:1.42;
  color:#26324c;
  margin-bottom:13px;
}


/* v1.6 — Practice Lab: six distinct speaking modes */
.module-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}
.module-card{
  position:relative;
  min-height:150px;
  border:1px solid var(--line);
  border-radius:22px;
  padding:16px;
  background:#fff;
  text-align:left;
  box-shadow:0 9px 24px rgba(25,45,90,.045);
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  justify-content:flex-start;
  gap:8px;
  color:var(--ink);
  overflow:hidden;
}
.module-card:active{transform:scale(.985)}
.module-card::after{
  content:"";
  position:absolute;
  width:72px;height:72px;
  border-radius:50%;
  right:-24px;bottom:-24px;
  opacity:.7;
}
.module-card.roleplay::after{background:#eef1ff}
.module-card.shadowing::after{background:#e7fbfb}
.module-card.build::after{background:#f1ecff}
.module-card.free::after{background:#eaf8e5}
.module-card.mistakes::after{background:#fff1e7}
.module-icon{
  width:42px;height:42px;border-radius:14px;
  display:grid;place-items:center;
  font-size:21px;
  background:#f4f6fb;
}
.module-card.roleplay .module-icon{background:#edf0ff}
.module-card.shadowing .module-icon{background:#e9fbfb}
.module-card.build .module-icon{background:#f1ecff}
.module-card.free .module-icon{background:#edf9e9}
.module-card.mistakes .module-icon{background:#fff2e7}
.module-copy{display:block;z-index:1}
.module-copy b{display:block;font-size:15px;margin-bottom:4px}
.module-copy small{display:block;color:var(--muted);font-size:10.5px;line-height:1.4}
.module-xp,.module-status{
  margin-top:auto;
  display:inline-flex;
  align-items:center;
  min-height:24px;
  padding:5px 8px;
  border-radius:999px;
  background:#f1f4fb;
  color:#65718b;
  font-size:9px;
  font-weight:950;
  letter-spacing:.03em;
  z-index:1;
}
.module-status.has-items{background:#fff0e5;color:#a3560b}
.module-card.wide{
  grid-column:1/-1;
  min-height:112px;
  display:grid;
  grid-template-columns:46px 1fr auto;
  align-items:center;
  column-gap:12px;
}
.module-card.wide .module-xp,.module-card.wide .module-status{margin-top:0}
.challenge-card{
  margin-bottom:12px;
  padding:18px;
  background:linear-gradient(145deg,#ffffff,#f7f9ff);
  border:1px solid #dce4f7;
}
.challenge-label{
  color:var(--blue);
  font-size:10px;
  font-weight:950;
  letter-spacing:.11em;
  margin-bottom:8px;
}
.challenge-prompt{
  font-size:20px;
  line-height:1.38;
  font-weight:900;
  color:#202b48;
}
.challenge-hints{
  display:flex;
  flex-wrap:wrap;
  gap:7px;
  margin-top:12px;
}
.challenge-hints span{
  background:#eef3ff;
  color:#53607c;
  border-radius:999px;
  padding:6px 9px;
  font-size:10px;
  font-weight:800;
}
.my-recording{
  width:100%;
  height:42px;
  margin-top:12px;
}
.review-empty{
  margin-top:28px;
  padding:28px 22px;
  text-align:center;
}
.review-empty-icon{
  width:74px;height:74px;
  margin:0 auto 15px;
  border-radius:24px;
  display:grid;place-items:center;
  background:#eef8ea;
  font-size:34px;
}
.review-empty h1{font-size:25px;margin:7px 0 9px}
.review-empty p{
  margin:0 0 18px;
  color:var(--muted);
  font-size:12px;
  line-height:1.6;
}
.review-empty .btn+.btn{margin-top:8px}

@media(max-width:390px){
  .module-card{min-height:142px;padding:14px}
  .module-card.wide{min-height:108px;grid-template-columns:42px 1fr}
  .module-card.wide .module-status{grid-column:2;margin-top:2px;justify-self:start}
  .challenge-prompt{font-size:18px}
}
