:root {
  --bg: #f6f7f4;
  --card: #ffffff;
  --ink: #1b2326;
  --muted: #5f6b70;
  --line: #e3e7e4;
  --brand: #0b6e74;
  --brand-2: #0e8c93;
  --brand-soft: #e2f2f1;
  --accent: #f08a24;
  --accent-soft: #fff1e2;
  --good: #1f8a4c;
  --good-soft: #e3f4ea;
  --bad: #c2412d;
  --bad-soft: #fbe8e4;
  --warn: #b7791f;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.05);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1416; --card: #182023; --ink: #e8eeee; --muted: #9aa8ab; --line: #26302f;
    --brand: #3cb4b9; --brand-2: #5cc8cc; --brand-soft: #173436;
    --accent: #f5a04d; --accent-soft: #3a2a19;
    --good: #5ccf8a; --good-soft: #17301f; --bad: #f08470; --bad-soft: #3a1e19; --warn: #e3b35a;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.5;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .4em; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1.02rem; }
p { margin: 0 0 .8em; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }

.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font-weight: 750; font-size: 1.1rem; }
.brand img { border-radius: 8px; }
.streak-pill { background: var(--accent-soft); color: var(--accent); padding: 4px 12px; border-radius: 99px; font-size: .95rem; }

main { max-width: 600px; margin: 0 auto; padding: 16px; outline: none; }
.tabs {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 10; display: flex; justify-content: space-around;
  background: var(--card); border-top: 1px solid var(--line); padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
}
.tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; font-size: .74rem; color: var(--muted); text-decoration: none; padding: 4px 0; }
.tabs a span { font-size: 1.3rem; line-height: 1.2; filter: grayscale(1); opacity: .7; }
.tabs a.on { color: var(--brand); font-weight: 650; }
.tabs a.on span { filter: none; opacity: 1; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; box-shadow: var(--shadow); }
.card.hero { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; border: none; }
.card.hero .muted { color: rgba(255,255,255,.85); }
.card.hero .btn { background: #fff; color: var(--brand); }
.eyebrow { text-transform: uppercase; letter-spacing: .06em; font-size: .72rem; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.card.hero .eyebrow { color: rgba(255,255,255,.8); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer;
  background: var(--brand); color: #fff; font: inherit; font-weight: 650; padding: 12px 18px; border-radius: 12px;
  text-decoration: none; min-height: 46px;
}
.btn.block { width: 100%; }
.btn.ghost { background: transparent; color: var(--brand); border: 1.5px solid var(--brand); }
.btn.soft { background: var(--brand-soft); color: var(--brand); }
.btn.accent { background: var(--accent); color: #fff; }
.btn:disabled { opacity: .5; cursor: default; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > .btn { flex: 1; }

.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 8px; text-decoration: none; color: var(--ink); }
.list-item .ic { font-size: 1.5rem; width: 40px; height: 40px; display: grid; place-items: center; background: var(--brand-soft); border-radius: 12px; flex: none; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .t { font-weight: 650; }
.list-item .s { font-size: .82rem; color: var(--muted); }
.tick { color: var(--good); font-weight: 800; }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.stat .v { font-size: 1.5rem; font-weight: 800; }
.stat .l { font-size: .8rem; color: var(--muted); }
.stat .h { font-size: .78rem; margin-top: 2px; }
.ok { color: var(--good); } .bad { color: var(--bad); } .warn { color: var(--warn); }

.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li { position: relative; padding: 0 0 12px 42px; }
.steps li::before { counter-increment: s; content: counter(s); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .9rem; }
.ex { border-radius: 12px; padding: 10px 12px; margin-top: 8px; font-size: .95rem; }
.ex.bad { background: var(--bad-soft); color: var(--ink); }
.ex.good { background: var(--good-soft); color: var(--ink); }
.ex b { display: block; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 2px; }
.ex.bad b { color: var(--bad); } .ex.good b { color: var(--good); }
ul.plain { padding-left: 20px; margin: 0; }

.prompt { font-size: 1.12rem; font-weight: 600; }
.readbox { background: var(--brand-soft); border-radius: 12px; padding: 12px 14px; font-size: 1.1rem; line-height: 1.7; margin-top: 10px; }
.mic-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; margin: 18px 0 8px; }
.mic {
  width: 104px; height: 104px; border-radius: 50%; border: 0; cursor: pointer; font-size: 2.6rem;
  background: var(--brand); color: #fff; box-shadow: 0 6px 24px rgba(11,110,116,.35); position: relative;
}
.mic.rec { background: var(--bad); animation: pulse 1.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(194,65,45,.45);} 70% { box-shadow: 0 0 0 22px rgba(194,65,45,0);} 100% { box-shadow: 0 0 0 0 rgba(194,65,45,0);} }
.timer { font-variant-numeric: tabular-nums; font-size: 1.6rem; font-weight: 800; }
.meter { width: 100%; height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: var(--brand); transition: width .1s; }
.progressbar { width: 100%; height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.progressbar i { display: block; height: 100%; background: var(--accent); }
.live { min-height: 70px; font-size: 1.02rem; color: var(--ink); }
.live .interim { color: var(--muted); }
.transcript { line-height: 1.8; }
mark.f { background: var(--accent-soft); color: var(--accent); border-radius: 4px; padding: 0 3px; font-weight: 650; }
mark.r { background: var(--bad-soft); color: var(--bad); border-radius: 4px; padding: 0 3px; }
mark.miss { background: transparent; color: var(--bad); text-decoration: line-through; }

.score-ring { display: flex; align-items: center; gap: 16px; }
.score-ring svg { flex: none; }
.tips li { margin-bottom: 8px; }
.coach { white-space: pre-wrap; }
.notice { background: var(--accent-soft); border-radius: 12px; padding: 10px 12px; font-size: .92rem; margin-bottom: 12px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1.5px solid var(--line); background: var(--card); color: var(--ink); border-radius: 99px; padding: 6px 12px; font: inherit; font-size: .9rem; cursor: pointer; }
.chip.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); font-weight: 650; }
.quiz-opt { display: block; width: 100%; text-align: left; margin: 6px 0; padding: 10px 12px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); font: inherit; cursor: pointer; }
.quiz-opt.right { border-color: var(--good); background: var(--good-soft); }
.quiz-opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
.badges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.badge { text-align: center; padding: 10px 6px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); font-size: .78rem; }
.badge .e { font-size: 1.7rem; display: block; }
.badge.locked { opacity: .35; filter: grayscale(1); }
.chart { width: 100%; height: auto; display: block; }
input[type=text], input[type=email], select {
  width: 100%; padding: 12px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); font: inherit;
}
label.f { display: block; font-weight: 600; margin: 10px 0 6px; }
.back { display: inline-block; margin-bottom: 10px; text-decoration: none; font-weight: 600; }
.center { text-align: center; }
.price { font-size: 2rem; font-weight: 800; }
.footer-links { text-align: center; font-size: .82rem; margin: 20px 0 8px; }
.footer-links a { color: var(--muted); margin: 0 6px; }
.week { display: flex; justify-content: space-between; margin-top: 10px; }
.week .d { width: 34px; text-align: center; font-size: .72rem; color: inherit; opacity: .85; }
.week .d i { display: block; width: 30px; height: 30px; margin: 0 auto 2px; border-radius: 50%; background: rgba(255,255,255,.2); line-height: 30px; font-style: normal; }
.week .d.done i { background: #fff; color: var(--brand); font-weight: 800; }
