@font-face {
  font-family: AppFont;
  src: url("/fonts/Manrope.ttf") format("truetype");
  font-display: swap;
  font-weight: 200 800;
}

:root {
  --paper: #f7f6f0;
  --surface: #ffffff;
  --ink: #173e3d;
  --ink-2: #2b4b48;
  --text: #202c31;
  --muted: #778781;
  --line: #e4e7dd;
  --mint: #e0ede5;
  --accent: #f4643b;
  --accent-deep: #de5630;
  --ok: #5b9271;
  --ok-bg: #edf7ef;
  --ok-line: #80b397;
  --bad: #e9775b;
  --bad-bg: #fff0ea;
  --bad-line: #e88c77;
  /* mastery ramp: one hue, light -> dark */
  --lv-new: #eceee7;
  --lv-learning: #b4d8c1;
  --lv-familiar: #7fb898;
  --lv-known: #3f8466;
  --lv-forever: #173e3d;
  --radius: 20px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { background: var(--paper); color: var(--text); -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  font: 15px/1.5 AppFont, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
button, input, a { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; padding: 0; }
button:disabled { cursor: default; }
a { text-decoration: none; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
h1, h2, p { margin: 0; }

#turbo { max-width: 760px; margin: 0 auto; padding: 0 16px calc(32px + env(safe-area-inset-bottom)); }

.ic { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---- Boot ---- */
.boot { min-height: 70vh; display: grid; place-items: center; align-content: center; gap: 16px; color: var(--muted); text-align: center; }
.boot-bolt { width: 54px; height: 54px; border-radius: 18px; background: var(--accent); box-shadow: 0 5px 0 var(--accent-deep); animation: pulse 1s ease-in-out infinite alternate; }
@keyframes pulse { to { transform: scale(0.9); } }

/* ---- Top bar ---- */
.topbar { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.back { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 17px; letter-spacing: -0.4px; color: var(--ink); padding: 6px 8px 6px 0; }
.back img { border-radius: 9px; }
.icon-btn { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); color: var(--ink); }
.icon-btn .ic { width: 20px; height: 20px; }

.eyebrow { font-size: 10.5px; letter-spacing: 1.8px; font-weight: 800; color: var(--muted); text-transform: uppercase; }
.eyebrow.light { color: #a9c7bb; }
.muted { color: var(--muted); }
.small { font-size: 13px; line-height: 1.5; }
.lead { font-size: 16px; line-height: 1.55; color: #3e504c; }
.lead.small { font-size: 14.5px; }

/* ---- Buttons ---- */
.cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 54px; padding: 0 26px; border-radius: 16px;
  background: var(--accent); color: #fff; font-weight: 800; font-size: 16px; letter-spacing: -0.2px;
  box-shadow: 0 4px 0 var(--accent-deep); transition: transform 0.12s, box-shadow 0.12s;
}
.cta:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--accent-deep); }
.cta .ic { width: 20px; height: 20px; stroke-width: 2.4; }
.cta.wide { width: 100%; }
.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 0 16px; border-radius: 99px;
  background: var(--surface); border: 1px solid var(--line); font-weight: 750; font-size: 13.5px; color: var(--ink);
}
.pill.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.pill.wide { width: 100%; min-height: 50px; border-radius: 16px; font-size: 15px; }
.link { color: var(--accent-deep); font-weight: 750; font-size: 14px; padding: 6px 0; text-decoration: underline; text-decoration-color: #f4643b55; text-underline-offset: 3px; }
.link.light { color: #ffd2c2; text-decoration-color: #ffd2c255; }

/* ---- Hero ---- */
.hero {
  position: relative; overflow: hidden;
  background: var(--ink); color: #fff; border-radius: 26px; padding: 22px 22px 24px;
  box-shadow: 0 18px 40px -24px #173e3d99;
}
.hero::after {
  content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, #f4643b40, transparent 70%); pointer-events: none;
}
.hero-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.hero h1 { font-size: clamp(30px, 8vw, 40px); line-height: 1.05; letter-spacing: -1.4px; margin: 14px 0 14px; font-weight: 800; }
.hero p { color: #cfe1d9; font-size: 15px; margin-top: 14px; max-width: 520px; }
.hero .focus-note { display: flex; align-items: center; gap: 7px; font-size: 13.5px; color: #ffd2c2; }
.hero .focus-note .ic { width: 16px; height: 16px; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; margin-top: 20px; position: relative; z-index: 1; }
.streak { display: inline-flex; align-items: center; gap: 5px; font-weight: 800; font-size: 13px; color: #ffb59c; background: #ffffff14; padding: 5px 11px 5px 8px; border-radius: 99px; white-space: nowrap; }
.streak .ic { width: 16px; height: 16px; fill: var(--accent); stroke: var(--accent); }

.day-dots { display: flex; gap: 6px; flex-wrap: wrap; }
.day-dots i { width: 34px; height: 8px; border-radius: 99px; background: #ffffff26; transition: background 0.3s; }
.day-dots i.on { background: var(--accent); }
.day-dots i.extra.on { background: #ffb59c; }
.summary .day-dots { justify-content: center; margin: 18px 0 6px; }
.summary .day-dots i { background: var(--line); }
.summary .day-dots i.on { background: var(--accent); }

/* ---- KPI tiles ---- */
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 14px 0; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px 14px 13px; text-align: left; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kpi-label { font-size: 12px; font-weight: 750; color: var(--muted); line-height: 1.3; }
.kpi b { font-size: clamp(24px, 6.5vw, 32px); letter-spacing: -1px; color: var(--ink); line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi b small { font-size: 14px; color: var(--muted); letter-spacing: 0; font-weight: 700; }
.kpi > small { font-size: 11.5px; color: var(--muted); line-height: 1.35; }
button.kpi { cursor: pointer; transition: border-color 0.2s; }
button.kpi:hover { border-color: #c7ddcf; }

/* ---- Cards ---- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 14px 0; }
.card.compact { padding: 16px; text-align: left; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.card-head h2 { font-size: 20px; letter-spacing: -0.6px; color: var(--ink); margin-top: 3px; line-height: 1.25; }

/* ---- Mastery bar ---- */
.mastery { display: flex; gap: 2px; height: 22px; border-radius: 6px; overflow: hidden; }
.mastery .seg { display: block; min-width: 3px; transition: flex-grow 0.6s ease; }
.mastery .seg:first-child { border-radius: 6px 0 0 6px; }
.mastery .seg:last-child { border-radius: 0 6px 6px 0; }
.mastery .seg:only-child { border-radius: 6px; }
.mastery.small { height: 8px; border-radius: 4px; gap: 1.5px; }
.mastery.small .seg { min-width: 2px; }
.lv-new { background: var(--lv-new); }
.lv-learning { background: var(--lv-learning); }
.lv-familiar { background: var(--lv-familiar); }
.lv-known { background: var(--lv-known); }
.lv-forever { background: var(--lv-forever); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: 12.5px; color: #4a5a56; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend b { color: var(--ink); font-variant-numeric: tabular-nums; }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: 0 0 auto; }

/* ---- Plan ---- */
.plan-line { display: flex; align-items: flex-start; gap: 10px; padding: 7px 0; color: #3e504c; font-size: 14.5px; }
.plan-line .ic { width: 18px; height: 18px; color: var(--muted); margin-top: 2px; }
.plan-line b { color: var(--ink); }
.warn { display: flex; gap: 9px; align-items: flex-start; margin-top: 10px; padding: 11px 13px; border-radius: 14px; background: var(--bad-bg); color: #8a3b25; font-size: 13.5px; }
.warn .ic { width: 18px; height: 18px; margin-top: 1px; }
.weekly { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.wk { display: grid; gap: 6px; justify-items: center; }
.wk-bar { width: 100%; max-width: 30px; height: 46px; border-radius: 6px; background: #f1f2ec; display: flex; align-items: flex-end; overflow: hidden; }
.wk-bar i { display: block; width: 100%; background: var(--lv-known); border-radius: 4px 4px 0 0; }
.wk.today .wk-bar i { background: var(--accent); }
.wk small { font-size: 11px; color: var(--muted); font-weight: 700; }
.wk.today small { color: var(--ink); }

/* ---- Traps ---- */
.card.traps { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; background: #fff7f2; border-color: #f6d7c9; }
.trap-icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: #ffe3d8; color: var(--accent-deep); }
.traps b { color: #7a321c; font-size: 16px; }
.traps p { font-size: 13px; color: #8b5a48; margin-top: 2px; }

/* ---- Topics ---- */
.topics { display: grid; gap: 2px; margin-top: 10px; }
.topic-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(70px, 1fr) 62px; align-items: center; gap: 12px; padding: 11px 8px; border-radius: 12px; text-align: left; transition: background 0.15s; }
.topic-row:hover { background: #f5f6f1; }
.topic-row.focused { background: #fff3ed; }
.topic-name { font-size: 13.5px; font-weight: 650; color: var(--ink); line-height: 1.3; }
.topic-name em { font-style: normal; font-size: 10px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--accent-deep); background: #ffe3d8; padding: 2px 6px; border-radius: 6px; margin-left: 4px; white-space: nowrap; }
.topic-count { text-align: right; font-weight: 800; color: var(--ink); font-size: 14px; font-variant-numeric: tabular-nums; }
.topic-count small { color: var(--muted); font-weight: 600; }

.foot { display: grid; gap: 6px; justify-items: center; text-align: center; margin: 24px 0 8px; font-size: 12.5px; color: var(--muted); }

/* ---- Onboarding ---- */
.onboarding { min-height: 100vh; }
.ob-card { background: var(--surface); border: 1px solid var(--line); border-radius: 28px; padding: 28px 22px 24px; margin-top: 6px; }
.ob-card h1 { font-size: clamp(30px, 8vw, 40px); letter-spacing: -1.4px; line-height: 1.08; color: var(--ink); margin: 8px 0 12px; }
.ob-bolt { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: var(--accent); color: #fff; box-shadow: 0 5px 0 var(--accent-deep); margin-bottom: 20px; }
.ob-bolt .ic { width: 32px; height: 32px; fill: #fff; }
.interstitial .ob-bolt .ic { fill: none; stroke: #fff; }
.ob-list { list-style: none; padding: 0; margin: 22px 0 26px; display: grid; gap: 14px; }
.ob-list li { display: flex; gap: 13px; align-items: flex-start; font-size: 14.5px; color: #3e504c; line-height: 1.5; }
.ob-list li .ic { width: 38px; height: 38px; padding: 9px; border-radius: 12px; background: var(--mint); color: var(--ink); }
.ob-list b { color: var(--ink); }
.choices { display: grid; gap: 10px; margin-top: 22px; }
.choice { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 58px; padding: 0 18px; border-radius: 16px; border: 1px solid var(--line); background: #fbfbf8; font-weight: 750; font-size: 15.5px; color: var(--ink); text-align: left; transition: border-color 0.15s, background 0.15s; }
.choice:hover { border-color: var(--ok-line); background: var(--ok-bg); }
.choice small { color: var(--muted); font-weight: 600; font-size: 13px; text-align: right; }
.choice.ghost { background: transparent; border-style: dashed; }
.date-choice input { border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; background: #fff; color: var(--ink); font-weight: 650; min-width: 0; }
.plan-big { display: flex; align-items: center; gap: 16px; margin: 14px 0 18px; }
.plan-big > b { font-size: 76px; line-height: 0.9; letter-spacing: -4px; color: var(--accent); font-weight: 800; }
.plan-big span { font-size: 22px; font-weight: 800; color: var(--ink); letter-spacing: -0.6px; line-height: 1.2; }
.plan-big small { display: block; font-size: 14px; font-weight: 600; color: var(--muted); letter-spacing: 0; margin-top: 3px; }
.plan-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 16px; }
.plan-facts > div { display: flex; gap: 10px; align-items: center; background: #f6f7f2; border-radius: 14px; padding: 12px 14px; }
.plan-facts .ic { color: var(--muted); }
.plan-facts span { font-size: 12.5px; color: var(--muted); font-weight: 650; }
.plan-facts b { display: block; font-size: 16px; color: var(--ink); }
.ob-card .muted.small { margin-top: 10px; }
.ob-actions { display: grid; gap: 14px; margin-top: 22px; }
.adjust { display: flex; align-items: center; justify-content: center; gap: 14px; font-weight: 750; color: var(--ink); }
.adjust .pill { width: 44px; height: 44px; padding: 0; font-size: 20px; }

/* ---- Sprint ---- */
.sprint { padding-top: 10px; }
.sprint-top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; padding: 10px 0; background: var(--paper); }
.sprint-progress { flex: 1; display: flex; gap: 3px; min-width: 0; }
.sprint-progress i { flex: 1; height: 8px; border-radius: 99px; background: #e5e8e0; transition: background 0.25s; }
.sprint-progress i.now { background: #b9c8c0; }
.sprint-progress i.ok { background: var(--ok); }
.sprint-progress i.bad { background: var(--bad); }
.sprint-progress i.ret:not(.ok):not(.bad):not(.now) { background: #f8d3c6; }
.combo { display: inline-flex; align-items: center; gap: 3px; font-weight: 800; font-size: 15px; color: #a6b0aa; min-width: 44px; justify-content: flex-end; font-variant-numeric: tabular-nums; transition: color 0.2s; }
.combo .ic { width: 18px; height: 18px; }
.combo.hot { color: var(--accent-deep); }
.combo.hot .ic { fill: var(--accent); stroke: var(--accent); animation: flicker 0.6s ease-in-out infinite alternate; }
@keyframes flicker { to { transform: scale(1.12) rotate(-4deg); } }

.q-card { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 18px; margin-top: 4px; animation: rise 0.25s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.q-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 12px; color: var(--muted); font-weight: 650; }
.kind { font-size: 10.5px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; padding: 4px 9px; border-radius: 8px; background: var(--mint); color: var(--ink); }
.kind-new { background: #e7efff; color: #2c4d8f; }
.kind-sibling { background: #f1e9ff; color: #5b3a96; }
.kind-return, .kind-trap { background: #ffe6dc; color: #9a3c1f; }
.q-image { margin: 14px -4px 0; border-radius: 16px; overflow: hidden; background: #eef0ea; }
.q-image img { display: block; width: 100%; height: auto; max-height: 340px; object-fit: contain; }
.q-text { font-size: clamp(18px, 4.6vw, 22px); line-height: 1.38; letter-spacing: -0.4px; color: var(--ink); margin: 16px 0 16px; font-weight: 750; }
.answers { display: grid; gap: 9px; }
.answer { display: flex; gap: 12px; align-items: center; min-height: 58px; padding: 12px 14px; border-radius: 16px; border: 1px solid #e1e6de; background: #fff; text-align: left; font-size: 15px; line-height: 1.45; transition: border-color 0.15s, background 0.15s, transform 0.1s, opacity 0.2s; }
.answer:hover:not(:disabled) { border-color: #b9cfc2; background: #fafcf9; }
.answer:active:not(:disabled) { transform: scale(0.99); }
.answer .idx { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 10px; display: grid; place-items: center; border: 1px solid #dfe4dc; font-weight: 800; font-size: 13px; color: var(--muted); }
.answer .idx .ic { width: 17px; height: 17px; stroke-width: 2.6; }
.answer.correct { border-color: var(--ok-line); background: var(--ok-bg); animation: pop 0.3s ease-out; }
.answer.correct .idx { background: var(--ok); border-color: var(--ok); color: #fff; }
.answer.wrong { border-color: var(--bad-line); background: var(--bad-bg); animation: shake 0.35s ease-out; }
.answer.wrong .idx { background: var(--bad); border-color: var(--bad); color: #fff; }
.answer.dim { opacity: 0.55; }
@keyframes pop { 50% { transform: scale(1.015); } }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.hint { text-align: center; color: #929c94; font-size: 12.5px; margin: 16px 6px 2px; }
.keys { display: none; }
@media (hover: hover) and (pointer: fine) { .keys { display: inline; margin-left: 6px; padding: 2px 7px; border-radius: 6px; background: #f1f2ec; color: var(--muted); font-weight: 700; } }

.feedback { margin-top: 14px; border-radius: 18px; padding: 16px; animation: rise 0.25s ease-out; scroll-margin-top: 72px; scroll-margin-bottom: 20px; }
.feedback.ok { background: var(--ok-bg); }
.feedback.bad { background: #fff6f1; border: 1px solid #f6d7c9; }
.fb-title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-weight: 800; font-size: 17px; color: var(--ink); }
.feedback.ok .fb-title .ic { color: var(--ok); stroke-width: 2.6; }
.feedback.bad .fb-title { color: #8a3b25; }
.feedback.bad .fb-title .ic { color: var(--accent-deep); }
.fb-title small { width: 100%; font-size: 12.5px; font-weight: 650; color: var(--muted); }
.right-answer { margin-top: 12px; padding: 11px 13px; border-radius: 12px; background: #fff; border: 1px solid var(--ok-line); font-weight: 700; color: var(--ink); font-size: 15px; }
.right-answer span { display: block; font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--ok); font-weight: 800; margin-bottom: 2px; }
.explain { margin-top: 12px; font-size: 14.5px; line-height: 1.6; color: #34463f; }
.explain mark { background: #fff1c9; color: inherit; border-radius: 4px; padding: 0 2px; font-weight: 700; }
.steps { margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: #ffffffb3; font-size: 14px; color: #34463f; }
.steps b { color: var(--ink); }
.steps ol { margin: 6px 0 0; padding-left: 20px; display: grid; gap: 4px; }
.core { margin-top: 12px; font-size: 15px; line-height: 1.55; color: var(--ink); font-weight: 600; }
.core mark, .explain mark { background: #fff1c9; color: inherit; border-radius: 4px; padding: 0 2px; font-weight: 700; }
.feedback > .link { display: inline-block; margin-top: 4px; }
.confident { display: flex; gap: 8px; align-items: center; margin-top: 10px; font-size: 13px; font-weight: 700; color: #6b4a9a; }
.confident .ic { width: 18px; height: 18px; }
.next-up { display: flex; gap: 9px; align-items: flex-start; margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: #f1e9ff; color: #4b2f80; font-size: 13.5px; font-weight: 650; }
.next-up .ic { width: 18px; height: 18px; margin-top: 1px; }

/* Anchor card */
.hook-card { margin-top: 12px; padding: 14px 16px; border-radius: 16px; background: var(--ink); color: #fff; position: relative; overflow: hidden; }
.hook-card::after { content: ""; position: absolute; right: -40px; top: -50px; width: 140px; height: 140px; border-radius: 50%; background: radial-gradient(circle, #f4643b40, transparent 70%); }
.hook-card.fresh { animation: hook-in 0.5s ease-out; box-shadow: 0 0 0 3px #f4643b55; }
@keyframes hook-in { from { transform: scale(0.94); opacity: 0; } }
.hook-head { display: flex; align-items: center; gap: 6px; font-size: 10.5px; font-weight: 800; letter-spacing: 1.4px; text-transform: uppercase; color: #ffb59c; }
.hook-head .ic { width: 15px; height: 15px; }
.hook-title { display: block; margin-top: 6px; font-size: 19px; line-height: 1.25; letter-spacing: -0.4px; }
.hook-card p { margin-top: 6px; font-size: 13.5px; line-height: 1.5; color: #cfe1d9; position: relative; z-index: 1; }

/* Road signs */
.signs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.sign { display: flex; align-items: center; gap: 8px; margin: 0; padding: 6px 10px 6px 6px; border-radius: 12px; background: #fff; border: 1px solid var(--line); max-width: 100%; }
.sign img { width: 40px; height: 40px; object-fit: contain; flex: 0 0 40px; }
.sign figcaption { font-size: 12.5px; line-height: 1.3; color: #34463f; }
.sign figcaption b { display: block; font-size: 11px; color: var(--muted); }
.signs.small .sign { background: #ffffff14; border-color: #ffffff22; padding: 4px; }
.signs.small .sign img { width: 34px; height: 34px; flex-basis: 34px; }
.signs.small figcaption { display: none; }

/* 3D stage */
.q-visual { position: relative; margin: 14px -4px 0; }
.q-visual .q-image { margin: 0; }
.visual-switch { position: absolute; right: 10px; bottom: 10px; z-index: 2; display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: 99px; background: #173e3de6; color: #fff; font-size: 12.5px; font-weight: 750; }
.visual-switch .ic { width: 16px; height: 16px; }
.stage { border-radius: 16px; overflow: hidden; background: #e9ece5; }
.stage-slot { position: relative; height: 260px; background: #e9ece5; }
.stage.compact .stage-slot { height: 240px; }
.stage-canvas { position: absolute; inset: 0; }
.stage-loading { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 700; }
.stage-loading .ic { width: 28px; height: 28px; animation: pulse 0.8s ease-in-out infinite alternate; }
.stage-bar { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: #fff; }
.stage-btn { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 12px; display: grid; place-items: center; background: var(--accent); color: #fff; }
.stage-btn .ic { width: 18px; height: 18px; fill: #fff; stroke: #fff; }
.stage-progress { flex: 1; height: 6px; border-radius: 99px; background: #e5e8e0; overflow: hidden; }
.stage-progress i { display: block; height: 100%; width: 0; background: var(--accent); }
.stage-views { display: inline-flex; padding: 3px; border-radius: 10px; background: #f1f2ec; }
.stage-views button { padding: 6px 10px; border-radius: 8px; font-size: 12.5px; font-weight: 750; color: var(--muted); }
.stage-views button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px #17303d14; }
.stage-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; padding: 0 12px 10px; background: #fff; font-size: 12px; color: #4a5a56; font-weight: 650; }
.stage-legend:empty { display: none; }
.stage-legend span { display: inline-flex; align-items: center; gap: 5px; }
.stage-legend i { width: 9px; height: 9px; border-radius: 50%; }
.stage-crash { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 11px; background: #fff0ea; color: #8a3b25; font-weight: 800; font-size: 13.5px; border-top: 1px solid #f6d7c9; }
.stage-crash .ic { width: 18px; height: 18px; }
.stage.crashing .stage-progress i, .stage.crashing .stage-btn { background: var(--bad); }
.crash-note { display: flex; gap: 8px; margin: 0; padding: 10px 12px; background: #fff0ea; color: #6d2f1c; font-size: 13px; line-height: 1.45; }
.crash-note .ic { width: 18px; height: 18px; flex: 0 0 18px; color: var(--accent-deep); }
.fb-stage { margin-top: 14px; }
.fb-label { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; font-size: 12px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.fb-label .ic { width: 16px; height: 16px; }
.fb-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; }
.cta.next { min-height: 50px; padding: 0 22px; }

/* ---- Starter ---- */
.interstitial { min-height: 70vh; display: grid; align-content: center; justify-items: start; gap: 10px; max-width: 560px; margin: 0 auto; padding: 24px 4px; }
.interstitial h1 { font-size: clamp(28px, 7vw, 38px); letter-spacing: -1.2px; line-height: 1.1; color: var(--ink); }
.interstitial .cta { margin-top: 14px; }
.ob-promise { display: flex; gap: 12px; align-items: flex-start; margin: 0 0 22px; padding: 14px 16px; border-radius: 16px; background: #fff3ed; color: #6d2f1c; font-size: 14.5px; line-height: 1.5; }
.ob-promise .ic { width: 22px; height: 22px; flex: 0 0 22px; color: var(--accent-deep); }
.ob-promise b { color: #7a321c; }
.before-after { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 16px 0 14px; }
.before-after > div { min-width: 120px; padding: 14px 16px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); }
.before-after span { display: block; font-size: 12px; font-weight: 750; color: var(--muted); }
.before-after b { font-size: 46px; letter-spacing: -2px; line-height: 1.05; color: var(--muted); }
.before-after b small { font-size: 20px; letter-spacing: 0; }
.before-after .after { background: var(--ink); border-color: var(--ink); animation: pop-big 0.6s 0.2s ease-out backwards; }
.before-after .after span { color: #a9c7bb; }
.before-after .after b { color: #fff; }
.before-after > i .ic { width: 26px; height: 26px; color: var(--accent); }
@keyframes pop-big { from { transform: scale(0.7); opacity: 0; } 70% { transform: scale(1.06); } }
.summary .lead { max-width: 520px; margin: 10px auto 0; }
.hook-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.hook-list li { display: flex; gap: 10px; align-items: center; font-weight: 750; color: var(--ink); font-size: 14.5px; }
.hook-list .ic { width: 18px; height: 18px; color: var(--accent-deep); flex: 0 0 18px; }
.reminder { display: flex; gap: 13px; align-items: flex-start; text-align: left; margin: 14px 0; padding: 15px 16px; border-radius: 18px; background: #fff; border: 1px solid var(--line); font-size: 14px; color: #34463f; }
.reminder > .ic { width: 22px; height: 22px; color: var(--accent-deep); flex: 0 0 22px; margin-top: 1px; }
.reminder b { color: var(--ink); font-size: 15px; }
.reminder p { margin-top: 3px; }
.reminder-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

/* Anchors collection */
.hook-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; margin-bottom: 12px; }
.hook-tile { display: flex; gap: 9px; align-items: flex-start; padding: 11px 12px; border-radius: 14px; background: #f5f7f2; text-align: left; font-size: 13.5px; font-weight: 750; color: var(--ink); line-height: 1.35; transition: background 0.15s; }
.hook-tile:hover { background: var(--mint); }
.hook-tile .ic { width: 17px; height: 17px; flex: 0 0 17px; color: var(--accent-deep); margin-top: 1px; }
.card .muted.small .ic { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; }
.plan-cta { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.plan-cta > div { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; flex: 1 1 240px; }
.plan-cta .ic { width: 22px; height: 22px; color: var(--accent-deep); grid-row: span 2; }
.plan-cta b { color: var(--ink); font-size: 16px; }
.plan-cta p { grid-column: 2; font-size: 13.5px; color: var(--muted); }
.kind-try { background: #fff1c9; color: #7a5a00; }
.kind-apply { background: #e7efff; color: #2c4d8f; }
.kind-control { background: var(--ink); color: #fff; }
.kind-transfer { background: #f1e9ff; color: #5b3a96; }
.sprint-progress i.ctl:not(.ok):not(.bad):not(.now) { background: #c9d6d0; }
.result-lines li.hl { background: var(--ink); border-color: var(--ink); color: #cfe1d9; }
.result-lines li.hl b { color: #fff; }
.result-lines li.hl .ic { color: var(--accent); }

/* ---- Summary ---- */
.summary { text-align: center; padding-top: 28px; }
.ring { width: 150px; height: 150px; margin: 0 auto 18px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--ok) var(--deg), #e5e8e0 0); animation: ring-in 0.9s ease-out; }
.ring > div { width: 122px; height: 122px; border-radius: 50%; background: var(--paper); display: grid; place-items: center; align-content: center; }
.ring b { font-size: 36px; letter-spacing: -1.4px; color: var(--ink); line-height: 1; }
.ring small { font-size: 11.5px; color: var(--muted); font-weight: 700; margin-top: 4px; }
@keyframes ring-in { from { transform: scale(0.85) rotate(-30deg); opacity: 0; } }
.summary h1 { font-size: clamp(28px, 7vw, 36px); letter-spacing: -1.2px; color: var(--ink); }
.result-lines { list-style: none; padding: 0; margin: 20px 0 6px; display: grid; gap: 8px; text-align: left; }
.result-lines li { display: flex; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; font-size: 14.5px; color: #3e504c; animation: rise 0.3s ease-out backwards; }
.result-lines li:nth-child(2) { animation-delay: 0.08s; }
.result-lines li:nth-child(3) { animation-delay: 0.16s; }
.result-lines li:nth-child(4) { animation-delay: 0.24s; }
.result-lines li:nth-child(5) { animation-delay: 0.32s; }
.result-lines li .ic { color: var(--ok); }
.result-lines b { color: var(--ink); }
.delta-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 4px 0 10px; font-size: 14px; color: var(--muted); font-weight: 650; }
.delta-row b { color: var(--ink); font-size: 15px; font-variant-numeric: tabular-nums; }
.delta-row em { font-style: normal; color: var(--ok); margin-left: 6px; font-size: 13px; }
.delta-row + .mastery { margin-top: 6px; }
.tip { display: flex; gap: 13px; align-items: flex-start; text-align: left; background: var(--mint); border-radius: 18px; padding: 15px 16px; margin: 14px 0; color: #34463f; font-size: 14px; }
.tip .ic { width: 22px; height: 22px; color: var(--ink); margin-top: 1px; }
.tip b { color: var(--ink); font-size: 15px; }
.tip p { margin-top: 2px; }
.tip.celebrate { background: #fff1e9; }
.tip.celebrate .ic { color: var(--accent); fill: var(--accent); }
.summary-actions { display: grid; gap: 10px; margin-top: 18px; }

/* ---- Sheet ---- */
#sheet { width: min(620px, calc(100% - 24px)); max-height: min(86vh, 900px); border: 0; border-radius: 26px; padding: 0; background: var(--paper); color: var(--text); box-shadow: 0 30px 80px -20px #0b1f1d66; }
#sheet::backdrop { background: #10221f8c; backdrop-filter: blur(2px); }
.sheet-head { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 18px 12px 22px; background: var(--paper); }
.sheet-head h2 { font-size: 21px; letter-spacing: -0.6px; color: var(--ink); line-height: 1.25; }
#sheet-body { padding: 0 22px 24px; display: grid; gap: 14px; }
#sheet-body .cta.wide, #sheet-body .pill.wide { margin-top: 4px; }
.science { display: grid; gap: 4px; }
.sci { display: flex; gap: 13px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.sci:last-child { border-bottom: 0; }
.sci > .ic { width: 36px; height: 36px; padding: 8px; border-radius: 12px; background: var(--mint); color: var(--ink); }
.sci b { color: var(--ink); font-size: 15px; }
.sci p { font-size: 14px; color: #3e504c; margin-top: 3px; line-height: 1.5; }
.sci small { display: block; margin-top: 5px; font-size: 12px; color: var(--muted); font-style: italic; }
.levels-explain { display: grid; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; font-size: 13.5px; color: #3e504c; }
.levels-explain > b { color: var(--ink); font-size: 15px; }
.levels-explain span { display: flex; gap: 8px; align-items: baseline; }
.levels-explain .sw { transform: translateY(1px); }
.big-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.big-pair > div { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; }
.big-pair span { display: block; font-size: 12.5px; font-weight: 750; color: var(--muted); }
.big-pair b { font-size: 40px; font-weight: 800; letter-spacing: -1.6px; color: var(--ink); line-height: 1.1; }
.lead b { color: var(--ink); }
.ok-note { display: flex; gap: 8px; align-items: center; color: var(--ok); font-weight: 750; }
.field-row { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.field { display: grid; gap: 6px; font-size: 13px; font-weight: 750; color: var(--muted); }
.field input { min-height: 48px; border: 1px solid var(--line); border-radius: 13px; background: #fff; padding: 0 14px; color: var(--ink); font-weight: 650; }
#plan-result { display: grid; gap: 4px; }

/* ---- Tooltip & toast ---- */
.chart-tip { position: absolute; z-index: 30; transform: translate(-50%, -100%); padding: 6px 10px; border-radius: 9px; background: var(--ink); color: #fff; font-size: 12.5px; font-weight: 700; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity 0.12s; }
.chart-tip.show { opacity: 1; }
#toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 700; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; max-width: calc(100% - 32px); text-align: center; z-index: 40; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 700px) {
  .hero { padding: 30px 32px 32px; }
  .card { padding: 22px 24px; }
  .q-card { padding: 26px 28px; }
  .ob-card { padding: 40px 40px 34px; }
  .kpis { gap: 14px; }
  .kpi { padding: 18px 18px 16px; }
}
@media (max-width: 520px) {
  .hero-actions .cta { flex: 1 1 100%; }
  .hero-actions .link { margin: 0 auto; }
}
@media (max-width: 420px) {
  .stage-slot, .stage.compact .stage-slot { height: 210px; }
  .stage-views button { padding: 6px 8px; }
  .before-after > div { min-width: 0; flex: 1; }
  .before-after b { font-size: 38px; }
  .kpi { padding: 12px 11px; border-radius: 16px; }
  .kpi-label { font-size: 11px; }
  .topic-row { grid-template-columns: minmax(0, 1fr) 56px; }
  .topic-bar { grid-column: 1 / -1; grid-row: 2; }
  .day-dots i { width: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
