:root {
  --bg: #F6F4EF;
  --surface: #FFFFFF;
  --surface-2: #FBFAF7;
  --ink: #16162A;
  --muted: #5F5F76;
  --line: #E6E2D8;
  --brand: #3D3BD6;
  --brand-ink: #FFFFFF;
  --brand-soft: #ECEBFF;
  --accent: #FF7A1A;
  --accent-soft: #FFF0E3;
  --accent-ink: #A84A00;
  --good: #0B7A3B;
  --good-soft: #E3F6EA;
  --warn: #8A5A0B;
  --warn-soft: #FFF5DB;
  --bad: #B8282E;
  --bad-soft: #FDE8E8;
  --ahead: #2558C4;
  --ahead-soft: #E5EEFF;
  --boss: #7C2BD6;
  --boss-soft: #F2E8FF;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(22, 22, 42, .05), 0 6px 24px rgba(22, 22, 42, .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101018; --surface: #1A1A26; --surface-2: #20202E; --ink: #F1F0EC; --muted: #A3A2B8; --line: #2D2D40;
    --brand: #8E8BFF; --brand-ink: #0F0F1A; --brand-soft: #25244A;
    --accent: #FF9A4A; --accent-soft: #3A2716; --accent-ink: #FF9A4A;
    --good: #3DD68C; --good-soft: #13301F; --warn: #F2C14E; --warn-soft: #33290F; --bad: #FF6B70; --bad-soft: #3A1719;
    --ahead: #6FA0FF; --ahead-soft: #16264A; --boss: #B98AFF; --boss-soft: #2A1A42;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 24px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font-family: "Outfit", system-ui, -apple-system, Segoe UI, sans-serif;
  font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}
a { color: var(--brand); }
button, input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); font-weight: 800; }
h2 { font-size: 1.3rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 650; }
p { margin: 0 0 .8em; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.tiny { font-size: .78rem; }

.wrap { max-width: 980px; margin: 0 auto; padding: 18px 16px 40px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar .in { max-width: 980px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.1rem; text-decoration: none; color: var(--ink); }
.logo-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--brand); display: grid; place-items: center; font-size: 16px; }
.chips { margin-left: auto; display: flex; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-weight: 600; font-size: .85rem; white-space: nowrap; }
.chip.fire { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); }
.desk-nav { display: none; gap: 4px; margin-left: 18px; }
.desk-nav a { text-decoration: none; color: var(--muted); padding: 6px 12px; border-radius: 10px; font-weight: 550; }
.desk-nav a.on { background: var(--brand-soft); color: var(--brand); }

/* ---------- tab bar (mobile) ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 9px; text-decoration: none; color: var(--muted); font-size: .72rem; font-weight: 600; }
.tabbar a span { font-size: 1.25rem; line-height: 1; }
.tabbar a.on { color: var(--brand); }
@media (min-width: 820px) {
  .tabbar { display: none; }
  .desk-nav { display: flex; }
  body { padding-bottom: 0; }
}

/* ---------- cards / layout ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card + .card, .stack > * + * { margin-top: 14px; }
.grid { display: grid; gap: 14px; }
.grid > .card + .card { margin-top: 0; }
.g2 { grid-template-columns: 1fr; }
.g3 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 720px) { .g2 { grid-template-columns: 1fr 1fr; } .g3 { grid-template-columns: repeat(3, 1fr); } }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.between { justify-content: space-between; }
.section-title { margin: 26px 0 10px; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); padding: 10px 16px; border-radius: 12px; font-weight: 600; cursor: pointer; text-decoration: none; color: var(--ink); transition: transform .08s ease, background .15s; min-height: 44px; }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.accent { background: var(--accent); color: #1A1206; border-color: var(--accent); }
.btn.wa { background: #13803F; color: #fff; border-color: #13803F; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.small { padding: 6px 12px; min-height: 36px; font-size: .88rem; border-radius: 10px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn[disabled]:hover { background: var(--surface); }
.btn[disabled]:active { transform: none; }
.btn.rec { background: var(--bad); color: #fff; border-color: var(--bad); }

/* ---------- hero (today) ---------- */
.hero { position: relative; overflow: hidden; background: linear-gradient(135deg, #3D3BD6 0%, #6E3BE0 100%); color: #fff; border: 0; }
.hero.boss { background: linear-gradient(135deg, #5A1FB0 0%, #C2307A 100%); }
.hero h1, .hero h2 { color: #fff; }
.hero .muted { color: rgba(255,255,255,.78); }
.hero .btn { background: #fff; color: #23215f; border-color: #fff; }
.hero .tag { background: rgba(255,255,255,.18); color: #fff; }
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: rgba(255,255,255,.08); }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: .75rem; font-weight: 700; letter-spacing: .02em; background: var(--brand-soft); color: var(--brand); }
.tag.boss { background: var(--boss-soft); color: var(--boss); }
.tag.good { background: var(--good-soft); color: var(--good); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.bad { background: var(--bad-soft); color: var(--bad); }
.tag.ahead { background: var(--ahead-soft); color: var(--ahead); }
.tag.done { background: var(--good-soft); color: var(--good); }

/* ---------- stats ---------- */
.stat { padding: 16px; }
.stat .v { font-size: 1.8rem; font-weight: 800; line-height: 1.1; }
.stat .k { color: var(--muted); font-size: .82rem; font-weight: 600; }
.bar { height: 10px; background: var(--line); border-radius: 999px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--accent)); border-radius: 999px; transition: width .6s ease; }
.ring { --p: 0; width: 76px; height: 76px; border-radius: 50%; background: conic-gradient(var(--brand) calc(var(--p) * 1%), var(--line) 0); display: grid; place-items: center; flex: none; }
.ring > b { width: 60px; height: 60px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-weight: 800; font-size: 1.05rem; }

.banner { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: 14px; background: var(--accent-soft); color: var(--ink); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.banner.info { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 25%, transparent); }
.banner .grow { flex: 1; min-width: 0; }

/* ---------- journey map ---------- */
.map { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
@media (min-width: 620px) { .map { grid-template-columns: repeat(7, 1fr); } }
.node { aspect-ratio: 1; border-radius: 16px; border: 2px solid var(--line); background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; text-decoration: none; color: var(--ink); position: relative; font-weight: 800; font-size: 1.15rem; }
.node small { font-size: .62rem; font-weight: 600; color: var(--muted); }
.node.done { background: var(--good-soft); border-color: var(--good); color: var(--good); }
.node.now { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent); animation: pulse 2s infinite; }
.node.locked { opacity: .45; }
.node.boss { border-style: dashed; border-color: var(--boss); }
.node.boss.done { border-style: solid; }
.node .crown { position: absolute; top: -9px; right: -6px; font-size: .95rem; }
@keyframes pulse { 50% { box-shadow: 0 0 0 9px color-mix(in srgb, var(--brand) 6%, transparent); } }
.week-label { grid-column: 1 / -1; margin-top: 8px; font-weight: 700; font-size: .85rem; color: var(--muted); }

/* ---------- day view ---------- */
.stepper { position: sticky; top: 53px; z-index: 10; display: flex; gap: 6px; overflow-x: auto; padding: 10px 0; background: var(--bg); box-shadow: 0 -10px 0 var(--bg); scrollbar-width: none; }
.stepper::-webkit-scrollbar { display: none; }
.step { flex: none; display: flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: .82rem; font-weight: 650; color: var(--muted); text-decoration: none; }
.step.done { background: var(--good-soft); color: var(--good); border-color: transparent; }
.step { cursor: pointer; font-family: inherit; }
.step.on { background: var(--brand); color: #fff; border-color: transparent; box-shadow: 0 4px 14px color-mix(in srgb, var(--brand) 35%, transparent); }
.step:disabled { opacity: .55; cursor: not-allowed; }
.step-bar { position: absolute; left: 0; right: 0; bottom: 2px; height: 3px; border-radius: 3px; background: var(--line); overflow: hidden; }
.step-bar i { display: block; height: 100%; background: var(--good); transition: width .4s ease; }
.step-count { margin: 4px 2px 0; }
.step-nav { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.step-nav .btn { min-width: 200px; }
.qbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.qdots { display: flex; gap: 6px; }
.qdot { width: 14px; height: 14px; padding: 0; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); cursor: pointer; }
.qdot.done { background: var(--good); border-color: var(--good); }
.qdot.on { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent); }
.qdot:disabled { cursor: not-allowed; opacity: .5; }
.step-in { animation: stepIn .35s ease both; }
@keyframes stepIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .step-in { animation: none; } .step-bar i { transition: none; } }
.block { scroll-margin-top: 120px; }
.block-h { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.block-h .num { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-weight: 800; flex: none; }
.block.is-done .block-h .num { background: var(--good-soft); color: var(--good); }
.block-h .mins { margin-left: auto; font-size: .8rem; color: var(--muted); font-weight: 600; white-space: nowrap; }

.word { padding: 14px; border-radius: 14px; background: var(--brand-soft); }
.word b { font-size: 1.2rem; }
.twister { padding: 14px; border-radius: 14px; background: var(--accent-soft); font-weight: 600; font-size: 1.05rem; }
.fix { display: grid; gap: 6px; }
.wrong, .right { padding: 8px 12px; border-radius: 10px; font-weight: 500; }
.wrong { background: var(--bad-soft); color: var(--bad); text-decoration: line-through; text-decoration-thickness: 1px; }
.wrong.no-strike { text-decoration: none; }
.right { background: var(--good-soft); color: var(--good); }
.point { padding: 14px 0; border-top: 1px solid var(--line); }
.point:first-of-type { border-top: 0; }
.ex { display: grid; gap: 6px; margin-top: 8px; }
.remember { margin-top: 12px; padding: 14px 16px; border-left: 4px solid var(--accent); background: var(--accent-soft); border-radius: 0 12px 12px 0; font-weight: 600; }

.drill { padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.drill + .drill { margin-top: 12px; }
.drill.ok { border-color: color-mix(in srgb, var(--good) 45%, transparent); }
.drill-h { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.opts { display: grid; gap: 8px; }
.opt { text-align: left; padding: 11px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 500; min-height: 44px; }
.opt:hover:not([disabled]) { border-color: var(--brand); }
.opt.right-ans { border-color: var(--good); background: var(--good-soft); color: var(--good); }
.opt.wrong-ans { border-color: var(--bad); background: var(--bad-soft); color: var(--bad); }
.opt[disabled] { cursor: default; }
.explain { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--surface); border: 1px dashed var(--line); font-size: .92rem; }
textarea, input[type=text], input[type=email], input[type=tel], input[type=url], input[type=date], input[type=number], select {
  width: 100%; padding: 11px 13px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); outline: none; min-height: 44px;
}
textarea { min-height: 96px; resize: vertical; }
textarea:focus, input:focus, select:focus { border-color: var(--brand); }
label.f { display: block; font-weight: 600; font-size: .9rem; margin: 12px 0 6px; }
.hint { font-size: .82rem; color: var(--muted); margin-top: 4px; }

.timer { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 1.6rem; }
.speak-box { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.metrics { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.metric { padding: 5px 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); font-size: .82rem; font-weight: 600; }
.metric.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.metric.good { color: var(--good); border-color: color-mix(in srgb, var(--good) 40%, transparent); }
.lint { margin-top: 8px; display: grid; gap: 6px; }
.lint div { font-size: .86rem; padding: 7px 10px; border-radius: 10px; background: var(--warn-soft); }
.lint b { color: var(--warn); }
.fb { margin-top: 12px; padding: 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.fb-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.fb-score { font-size: .78rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); }
.fb-score.all { background: var(--good-soft); color: var(--good); }
.fb-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.fb-list li { display: flex; gap: 8px; align-items: flex-start; font-size: .9rem; line-height: 1.4; }
.fb-i { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: .72rem; font-weight: 800; margin-top: 1px; }
.fb-list li.ok .fb-i { background: var(--good-soft); color: var(--good); }
.fb-list li.miss .fb-i { background: var(--bad-soft); color: var(--bad); }
.fb-pitch { margin-top: 12px; padding: 12px; border-radius: 12px; background: var(--brand-soft); display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.fb-pitch p { margin: 0; flex: 1 1 260px; font-size: .86rem; line-height: 1.45; }
.fb-pitch .btn { flex: none; }
.learned { margin: 6px 0 14px; padding-left: 20px; display: grid; gap: 6px; }
.nums { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 8px; }
.nstat { padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.nstat .k { font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.nstat .v { font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.nd { font-weight: 700; }
.nd.up { color: var(--good); }
.nd.down { color: var(--bad); }
.done-banner { padding: 10px 12px; border-radius: 12px; background: var(--good-soft); margin-bottom: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.recdot { width: 10px; height: 10px; border-radius: 50%; background: var(--bad); animation: blink 1s infinite; display: inline-block; }
@keyframes blink { 50% { opacity: .2; } }

.checklist label { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; cursor: pointer; }
.checklist input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--brand); flex: none; }
.scale { display: flex; gap: 6px; }
.scale button { flex: 1; min-height: 42px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 700; cursor: pointer; }
.scale button.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.skill-rate { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 10px; margin: 8px 0; }
.emoji-scale button { font-size: 1.3rem; }
details.model { margin-top: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; background: var(--surface); }
details.model summary { padding: 12px 0; cursor: pointer; font-weight: 650; color: var(--brand); }
details.model div { padding-bottom: 14px; white-space: pre-wrap; }

.done-bar { margin-top: 18px; }
.locked-card { text-align: center; padding: 40px 20px; }

/* ---------- lists ---------- */
.list-item { display: flex; gap: 12px; align-items: flex-start; padding: 14px 0; border-top: 1px solid var(--line); }
.list-item:first-child { border-top: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.trunc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.badge { text-align: center; padding: 14px 8px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
.badge .i { font-size: 2rem; }
.badge.off { opacity: .35; filter: grayscale(1); }
.badge b { display: block; font-size: .85rem; margin-top: 4px; }
.badge span { font-size: .72rem; color: var(--muted); }

.lb-row { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; }
.lb-row.me { background: var(--brand-soft); font-weight: 700; }
.lb-row > span:nth-child(2) { min-width: 0; overflow-wrap: anywhere; }
.lb-row .rank { font-weight: 800; color: var(--muted); text-align: center; }

/* ---------- report ---------- */
.report-pre { white-space: pre-wrap; overflow-wrap: anywhere; font-family: inherit; font-size: .92rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 16px; max-height: 520px; overflow: auto; margin: 0; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.seg button { border: 0; background: var(--surface); padding: 8px 14px; cursor: pointer; font-weight: 600; min-height: 40px; }
.seg button.on { background: var(--brand); color: var(--brand-ink); }

/* ---------- chart ---------- */
.chart svg { width: 100%; height: auto; display: block; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .82rem; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: middle; }

/* ---------- onboarding ---------- */
.onboard { max-width: 560px; margin: 10px auto; }
.onboard .big-emoji { font-size: 3rem; }
.promise { display: grid; gap: 10px; margin: 18px 0; }
.promise > div { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.promise > div > span { font-size: 1.4rem; }

/* ---------- certificate ---------- */
.cert { text-align: center; padding: 48px 28px; border: 3px double var(--brand); background: var(--surface); border-radius: 8px; }
.cert h1 { font-size: 2.4rem; }
.cert .name { font-size: 2rem; font-weight: 800; color: var(--brand); margin: 12px 0; overflow-wrap: anywhere; }

/* ---------- toast / confetti ---------- */
.toast { position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); opacity: 0; background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 14px; font-weight: 600; z-index: 50; transition: all .25s ease; pointer-events: none; width: max-content; max-width: calc(100% - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (min-width: 820px) { .toast { bottom: 28px; } }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; width: 100%; height: 100%; }

.modal-bg { position: fixed; inset: 0; background: rgba(10, 10, 20, .55); z-index: 70; display: grid; place-items: center; padding: 16px; }
.modal { background: var(--surface); border-radius: 22px; padding: 28px 22px; max-width: 420px; width: 100%; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; text-align: center; box-shadow: var(--shadow); animation: pop .3s ease; }
.modal .big { font-size: 3.4rem; }
@keyframes pop { from { transform: scale(.9); opacity: 0; } }

/* ---------- focus / file button ---------- */
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.seg button:focus-visible { outline-offset: -3px; }
.hero .btn:focus-visible { outline-color: #fff; }
textarea:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.modal:focus { outline: none; }
.file-btn { position: relative; }
.file-btn input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); }
.file-btn:focus-within { outline: 3px solid var(--brand); outline-offset: 2px; }

/* ---------- touch: bigger tap targets on phones ---------- */
@media (max-width: 819px) {
  .btn.small, .step { min-height: 44px; }
  .btn.ghost.small { min-width: 44px; }
  .qdot { width: 22px; height: 22px; }
  .step-nav .btn { flex: 1 1 100%; }
  .skill-rate { grid-template-columns: 92px 1fr; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  #confetti { display: none; }
}

@media print {
  :root { --bg: #fff; --surface: #fff; --surface-2: #fff; --ink: #16162A; --muted: #55556A; --line: #E6E2D8; --brand: #3D3BD6; color-scheme: light; }
  .topbar, .tabbar, .no-print, .toast, .modal-bg, #confetti { display: none !important; }
  body { background: #fff; padding: 0; }
  .wrap { max-width: none; padding: 0; }
  .cert { border-color: #3D3BD6; margin-top: 60px; }
}

/* v1.2: missed-day check-in + early access */
.reason-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn { font: inherit; font-size: .9rem; padding: 8px 12px; min-height: 40px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.chip-btn:hover { border-color: var(--brand); }
.chip-btn.on { background: var(--brand-soft); border-color: var(--brand); font-weight: 600; }
.miss-card { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.card.early { margin-top: 14px; }
.onboard .card.early { margin: 0 0 14px; }

/* v1.3: accounts, lives, paywall */
.hearts { letter-spacing: 2px; white-space: nowrap; }
.paywall { max-width: 560px; margin: 0 auto; text-align: center; }
.paywall .price { display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 14px 0; }
.paywall .price b { font-size: 2.4rem; line-height: 1; }
.paylist { text-align: left; margin: 0 auto 16px; max-width: 380px; padding-left: 20px; }
.paylist li { margin: 4px 0; }
.paywall-mini { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.logo { white-space: nowrap; }
@media (max-width: 420px) { .topbar .chips .chip:last-child { display: none; } .topbar .chips { gap: 6px; } }

/* ---- Phase 2: Recall + Learn cards ---- */
.qdot.miss { background: var(--bad); border-color: var(--bad); }
.point.lcard { border-top: 0; padding-top: 4px; }
.check { margin-top: 14px; padding: 14px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); }
.check p { margin: 6px 0 10px; }

/* ---- Phase 3: measured numbers + My Kit ---- */
.nt { margin: 0 0 6px; font-size: 1rem; }
.nhead { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; justify-content: space-between; font-size: .88rem; color: var(--muted); margin-bottom: 4px; }
.nhead b { color: var(--ink); }
.nchart { width: 100%; height: auto; display: block; color: var(--ink); overflow: visible; }
.nchart .ngrid { stroke: currentColor; stroke-opacity: .1; }
.nchart .nax { font-size: 11px; fill: currentColor; fill-opacity: .55; }
.nchart .nband { fill: var(--good-soft); }
.nchart .nline { fill: none; stroke: var(--brand); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.nchart .ndot { fill: var(--brand); stroke: var(--surface); stroke-width: 2; }
.nchart .npt:hover .ndot { r: 6; }
.nchart .nlab { font-size: 12px; font-weight: 600; fill: currentColor; }
.nchart .nbar { fill: var(--brand); }
.nchart .nbar:hover { opacity: .8; }
.ntable { margin-top: 12px; }
.ntable summary { cursor: pointer; color: var(--muted); }
.tbl-wrap { overflow-x: auto; }
.tbl-wrap table { width: 100%; border-collapse: collapse; font-size: .88rem; margin-top: 8px; }
.tbl-wrap th, .tbl-wrap td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl-wrap th { color: var(--muted); font-weight: 600; }
table.ba td:first-child { white-space: normal; }
.kit-link { display: flex; align-items: center; gap: 12px; margin-top: 14px; color: inherit; text-decoration: none; }
.kit-link:hover { border-color: var(--brand); }
.nstack { display: grid; gap: 14px; }
.nstack .card { max-width: 720px; }

/* paid AI coach panel (inside the feedback card) */
.coach { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.coach-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.coach-scores { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.coach-scores .cs { display: flex; flex-direction: column; align-items: center; padding: 6px 4px; border-radius: 10px; background: var(--brand-soft); font-size: .72rem; }
.coach-scores .cs b { font-size: 1.15rem; line-height: 1.2; color: var(--brand); }
.coach-scores .cs .muted { font-size: .68rem; }
.coach-fixes { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; font-size: .9rem; }
.coach-fixes .was { text-decoration: line-through; color: var(--bad); }
.coach .btn { margin-top: 10px; }
.coach-note { margin: 8px 0 0; }


/* ---------- practise more (practice.js) ---------- */
.selfcheck { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.selfcheck ul { list-style: none; margin: 6px 0 0; padding: 0; }
.selfcheck li { font-size: .9rem; margin: 4px 0; display: flex; gap: 6px; align-items: baseline; }
.selfcheck li.miss { color: var(--ink); }
.good-t { color: var(--good); font-weight: 600; }
.bad-t { color: var(--bad); font-weight: 600; }
.chat { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 12px; }
.chat .bubble { max-width: 85%; padding: 8px 12px; border-radius: 14px 14px 14px 4px; background: var(--surface-2); border: 1px solid var(--line); font-size: .95rem; }
.chat .bubble.me { align-self: flex-end; border-radius: 14px 14px 4px 14px; background: var(--good-soft); }
.rapid { padding: 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.iv-done { padding: 8px 0; border-bottom: 1px dashed var(--line); }
