:root {
  --bg: #f6f4ef;
  --panel: #fffdf8;
  --panel-2: #f1eee7;
  --ink: #20221f;
  --muted: #6d706b;
  --line: #dedbd3;
  --accent: #315c4c;
  --accent-soft: #dce9e3;
  --accent-2: #9f6e3d;
  --ok: #2d6a4f;
  --bad: #9d3f3f;
  --shadow: 0 12px 30px rgba(35, 38, 34, .08);
  --radius: 22px;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 0%, rgba(49,92,76,.08), transparent 28%),
    radial-gradient(circle at 100% 10%, rgba(159,110,61,.08), transparent 24%),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
button,input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
.app-shell { max-width: 860px; margin: 0 auto; min-height: 100vh; padding-bottom: 48px; }
.topbar {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(16px);
  background: rgba(246,244,239,.86);
  border-bottom: 1px solid rgba(222,219,211,.7);
}
.brand-button { display:flex; align-items:center; gap:10px; border:0; background:transparent; color:var(--ink); cursor:pointer; padding:0; text-align:left; }
.brand-button strong { display:block; font-size:16px; letter-spacing:.01em; }
.brand-button small { display:block; font-size:11px; color:var(--muted); margin-top:2px; }
.brand-mark { width:38px; height:38px; border-radius:13px; display:grid; place-items:center; background:var(--accent); color:#fff; font-weight:800; box-shadow:var(--shadow); }
.top-actions { display:flex; gap:8px; }
.icon-btn { width:42px; height:42px; border-radius:14px; border:1px solid var(--line); background:var(--panel); cursor:pointer; }
main { padding: 24px 20px; }
.hero { padding: 22px 0 8px; }
.eyebrow { color: var(--accent); font-weight: 700; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
h1 { font-size: clamp(34px, 6vw, 54px); line-height:1.04; margin:10px 0 12px; letter-spacing:-.035em; }
h2 { font-size: 26px; line-height:1.2; margin:0 0 8px; letter-spacing:-.02em; }
h3 { margin:0 0 8px; font-size:18px; }
p { line-height:1.72; }
.hero p { color:var(--muted); max-width:640px; margin:0; }
.card { background:rgba(255,253,248,.92); border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow); padding:22px; }
.home-grid { display:grid; grid-template-columns:1.5fr .8fr; gap:16px; margin-top:20px; }
.lesson-card { position:relative; overflow:hidden; min-height:245px; display:flex; flex-direction:column; justify-content:space-between; }
.lesson-card::after { content:"¡Hola!"; position:absolute; right:-8px; top:6px; font-size:72px; font-weight:800; color:rgba(49,92,76,.06); transform:rotate(-8deg); pointer-events:none; }
.meta-row { display:flex; gap:10px; flex-wrap:wrap; color:var(--muted); font-size:13px; }
.pill { display:inline-flex; align-items:center; gap:6px; padding:7px 10px; border-radius:999px; background:var(--panel-2); }
.primary-btn,.secondary-btn,.ghost-btn,.choice-btn {
  border:0; border-radius:14px; cursor:pointer; transition:.15s ease; font-weight:700;
}
.primary-btn { background:var(--accent); color:white; padding:14px 18px; }
.primary-btn:hover { transform:translateY(-1px); filter:brightness(.98); }
.secondary-btn { background:var(--accent-soft); color:var(--accent); padding:12px 16px; }
.ghost-btn { background:transparent; color:var(--muted); padding:10px 12px; border:1px solid var(--line); }
.primary-btn:disabled,.secondary-btn:disabled { opacity:.45; cursor:not-allowed; transform:none; }
.stat-card { display:flex; flex-direction:column; gap:16px; }
.stat { padding-bottom:14px; border-bottom:1px solid var(--line); }
.stat:last-child { border-bottom:0; padding-bottom:0; }
.stat strong { display:block; font-size:28px; }
.stat span { color:var(--muted); font-size:13px; }
.progress-track { height:8px; border-radius:999px; background:#e6e2da; overflow:hidden; margin:10px 0 18px; }
.progress-fill { height:100%; width:0%; background:var(--accent); transition:width .25s ease; }
.lesson-head { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:12px; }
.lesson-head .day-badge { flex:none; width:64px; height:64px; border-radius:20px; background:var(--accent-soft); color:var(--accent); display:grid; place-items:center; font-weight:800; }
.stage-wrap { max-width:680px; margin:0 auto; }
.stage-card { min-height:420px; display:flex; flex-direction:column; justify-content:center; text-align:center; padding:36px 28px; }
.stage-label { color:var(--muted); font-size:13px; margin-bottom:14px; }
.spanish-main { font-family: Georgia, "Times New Roman", serif; font-size: clamp(40px, 8vw, 64px); line-height:1.08; margin:10px 0 12px; letter-spacing:-.02em; }
.chinese-sub { color:var(--muted); font-size:18px; }
.audio-row { display:flex; justify-content:center; gap:10px; margin:22px 0 0; flex-wrap:wrap; }
.audio-btn { border:1px solid var(--line); background:var(--panel); color:var(--ink); border-radius:999px; padding:11px 16px; cursor:pointer; }
.stage-actions { display:flex; justify-content:space-between; gap:10px; margin-top:16px; }
.info-card { text-align:left; }
.example-chip { display:inline-flex; padding:8px 11px; background:var(--panel-2); border-radius:999px; margin:4px; }
.exercise-title { font-size:13px; font-weight:800; color:var(--accent); letter-spacing:.06em; text-transform:uppercase; }
.prompt { font-size:22px; line-height:1.5; margin:12px 0 18px; }
.choices { display:grid; gap:10px; margin-top:16px; }
.choice-btn { text-align:left; padding:15px 16px; background:var(--panel-2); color:var(--ink); border:1px solid transparent; }
.choice-btn:hover { border-color:#c8c4ba; }
.choice-btn.correct { background:#e2efe8; border-color:#9ac1ad; color:#214c3b; }
.choice-btn.wrong { background:#f6e4e4; border-color:#d8aaaa; color:#7d3131; }
.speech-box { margin-top:18px; padding:16px; border-radius:18px; background:var(--panel-2); }
.mic-btn { width:78px; height:78px; border-radius:50%; border:0; background:var(--accent); color:#fff; font-size:28px; cursor:pointer; box-shadow:0 10px 26px rgba(49,92,76,.22); }
.mic-btn.listening { animation:pulse 1.2s infinite; }
@keyframes pulse { 0%,100%{box-shadow:0 0 0 0 rgba(49,92,76,.35)} 50%{box-shadow:0 0 0 14px rgba(49,92,76,0)} }
.recognition-text { min-height:30px; margin-top:12px; font-size:18px; }
.feedback { margin-top:12px; padding:12px 14px; border-radius:14px; font-size:14px; }
.feedback.ok { background:#e2efe8; color:#214c3b; }
.feedback.bad { background:#f6e4e4; color:#7d3131; }
.text-fallback { display:flex; gap:8px; margin-top:12px; }
.text-fallback input { flex:1; min-width:0; border:1px solid var(--line); border-radius:12px; padding:12px 13px; background:var(--panel); }
.hint { margin-top:12px; color:var(--accent-2); font-weight:700; }
.dialogue { text-align:left; }
.bubble { max-width:82%; border-radius:18px; padding:12px 14px; margin:10px 0; line-height:1.55; }
.bubble.ai { background:var(--panel-2); margin-right:auto; }
.bubble.user { background:var(--accent); color:white; margin-left:auto; }
.scene-event { text-align:center; color:var(--muted); font-size:13px; padding:12px; }
.complete-icon { width:74px; height:74px; margin:0 auto 16px; border-radius:24px; display:grid; place-items:center; background:var(--accent-soft); color:var(--accent); font-size:34px; }
.small-note { color:var(--muted); font-size:13px; }
.toast { position:fixed; left:50%; bottom:24px; transform:translate(-50%,20px); opacity:0; pointer-events:none; background:#20221f; color:white; padding:11px 14px; border-radius:12px; transition:.2s ease; z-index:50; font-size:13px; }
.toast.show { opacity:1; transform:translate(-50%,0); }
.sr-warning { margin-top:12px; font-size:12px; color:var(--muted); }
@media(max-width:700px){
  .home-grid{grid-template-columns:1fr}
  main{padding:18px 14px}
  .topbar{padding:10px 14px}
  .stage-card{min-height:390px;padding:28px 18px}
  .stage-actions{position:sticky;bottom:12px;background:rgba(246,244,239,.92);padding:8px;border-radius:16px;backdrop-filter:blur(12px)}
}

/* V0.2 */
.home-actions { display:flex; gap:10px; flex-wrap:wrap; }
.section-head { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.day-grid { display:grid; grid-template-columns:repeat(5,1fr); gap:10px; margin-top:16px; }
.day-tile { border:1px solid var(--line); background:var(--panel-2); border-radius:14px; padding:12px; text-align:left; cursor:pointer; color:var(--ink); }
.day-tile span,.day-tile strong { display:block; }
.day-tile span { color:var(--muted); font-size:12px; }
.day-tile strong { margin-top:4px; font-size:14px; }
.day-tile.completed { background:#e2efe8; border-color:#b7d0c3; }
.day-tile.in_progress { background:#f5eadf; border-color:#d7b792; }
.day-tile.locked { opacity:.42; cursor:not-allowed; }
.spanish-main.compact { font-size:44px; }
.center { justify-content:center; }
.complete-title { font-size:42px; }
.mini-audio { border:0; background:transparent; cursor:pointer; font-size:16px; }
@media(max-width:700px){
  .day-grid{grid-template-columns:repeat(2,1fr)}
  .section-head{align-items:center}
  .complete-title{font-size:34px}
}
