/* Hearth & Field — design system
   Palette: parchment, forest, honey, clay, sky. Warm, earthy, calm. */
:root {
  --bg: #f6f1e6;
  --bg-2: #efe7d6;
  --surface: #fffcf5;
  --surface-2: #faf5ea;
  --ink: #1e2a20;
  --ink-2: #3c4a3e;
  --muted: #6b766c;
  --line: #e3d9c4;
  --forest: #2f6b45;
  --forest-2: #24543a;
  --forest-soft: #e2eedf;
  --honey: #e0a526;
  --honey-soft: #fbefcf;
  --clay: #b5562f;
  --clay-soft: #f6e0d4;
  --sky: #3b7ea1;
  --sky-soft: #dcebf3;
  --good: #2f8a4c;
  --bad: #c2453a;
  --shadow: 0 1px 2px rgba(40, 35, 20, .06), 0 6px 20px rgba(40, 35, 20, .07);
  --shadow-lg: 0 2px 6px rgba(40, 35, 20, .08), 0 18px 40px rgba(40, 35, 20, .12);
  --radius: 16px;
  --radius-sm: 10px;
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121813; --bg-2: #18201a; --surface: #1b231d; --surface-2: #212b23; --ink: #ece6d6; --ink-2: #cfc8b6;
    --muted: #98a196; --line: #2f3a31; --forest: #6fb486; --forest-2: #8fcaa2; --forest-soft: #213429;
    --honey: #e8b648; --honey-soft: #3a2f16; --clay: #e08a63; --clay-soft: #3a241a; --sky: #74b3d6; --sky-soft: #1b2e39;
    --good: #5fc27f; --bad: #ef7a6f; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25); --shadow-lg: 0 18px 40px rgba(0,0,0,.4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121813; --bg-2: #18201a; --surface: #1b231d; --surface-2: #212b23; --ink: #ece6d6; --ink-2: #cfc8b6;
  --muted: #98a196; --line: #2f3a31; --forest: #6fb486; --forest-2: #8fcaa2; --forest-soft: #213429;
  --honey: #e8b648; --honey-soft: #3a2f16; --clay: #e08a63; --clay-soft: #3a241a; --sky: #74b3d6; --sky-soft: #1b2e39;
  --good: #5fc27f; --bad: #ef7a6f; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25); --shadow-lg: 0 18px 40px rgba(0,0,0,.4);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased; min-height: 100vh; overflow-x: hidden;
}
img, svg, canvas { max-width: 100%; }
a { color: var(--forest); text-decoration-thickness: 1px; text-underline-offset: 3px; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 650; line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 4.5vw, 3rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--honey); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- shell ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40; 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: 1160px; margin: 0 auto; display: flex; align-items: center; gap: 12px; padding: 10px 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--serif); font-weight: 700; font-size: 1.2rem; white-space: nowrap; }
.brand-mark { width: 34px; height: 34px; flex: none; }
.nav { display: flex; gap: 2px; margin-left: 16px; }
.nav a { padding: 8px 12px; border-radius: 999px; text-decoration: none; color: var(--ink-2); font-weight: 550; font-size: .95rem; }
.nav a:hover { background: var(--bg-2); }
.nav a.on { background: var(--forest-soft); color: var(--forest-2); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; background: var(--surface);
  border: 1px solid var(--line); font-weight: 600; font-size: .88rem; text-decoration: none; color: var(--ink); white-space: nowrap;
}
.chip.hot { background: var(--honey-soft); border-color: transparent; }
.avatar-btn { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-size: 1.3rem; background: var(--forest-soft); text-decoration: none; border: 2px solid var(--surface); box-shadow: var(--shadow); }
.icon-btn { background: none; border: 0; padding: 8px; border-radius: 10px; cursor: pointer; font-size: 1.1rem; color: var(--ink-2); }
.icon-btn:hover { background: var(--bg-2); }

main { max-width: 1160px; margin: 0 auto; padding: 24px 16px 110px; }
.tabbar { display: none; }

@media (max-width: 860px) {
  .nav, .hide-sm { display: none !important; }
  main { padding-top: 16px; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
    background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 1px; text-decoration: none; color: var(--muted); font-size: .7rem; font-weight: 600; padding: 4px 0; border-radius: 10px; }
  .tabbar a span { font-size: 1.35rem; line-height: 1.2; filter: grayscale(.6); opacity: .8; }
  .tabbar a.on { color: var(--forest); }
  .tabbar a.on span { filter: none; opacity: 1; }
  .tabbar .badge-dot { position: relative; }
}

/* ---------- layout ---------- */
.stack > * + * { margin-top: 16px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.g3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.section { margin-top: 40px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.tiny { font-size: .78rem; }
.center { text-align: center; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .74rem; font-weight: 700; color: var(--muted); margin-bottom: 6px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.card.tint { background: var(--surface-2); }
a.card { display: block; text-decoration: none; color: inherit; transition: transform .15s ease, box-shadow .15s ease; }
a.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px; border-radius: 999px; border: 0;
  background: var(--forest); color: #fff; font-weight: 650; text-decoration: none; cursor: pointer; font-size: 1rem; line-height: 1.2;
  box-shadow: 0 2px 0 var(--forest-2); transition: transform .08s ease, filter .15s ease; min-height: 46px;
}
:root[data-theme="dark"] .btn, .btn { color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn:not(.ghost):not(.soft) { color: #0f1a12; } }
:root[data-theme="dark"] .btn:not(.ghost):not(.soft) { color: #0f1a12; }
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn.big { padding: 16px 28px; font-size: 1.08rem; min-height: 56px; }
.btn.honey { background: var(--honey); color: #2a1e04; box-shadow: 0 2px 0 #b9831a; }
.btn.clay { background: var(--clay); box-shadow: 0 2px 0 #8d3f20; }
.btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); box-shadow: none; }
.btn.ghost:hover { background: var(--bg-2); }
.btn.soft { background: var(--forest-soft); color: var(--forest-2); box-shadow: none; }
.btn.sm { padding: 8px 14px; min-height: 36px; font-size: .9rem; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- progress ---------- */
.bar { height: 10px; background: var(--bg-2); border-radius: 999px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--forest), #5aa36f); border-radius: 999px; transition: width .6s cubic-bezier(.2,.8,.2,1); }
.bar.honey > i { background: linear-gradient(90deg, var(--honey), #f0c860); }
.bar.thin { height: 6px; }
.ring { --p: 0; --c: var(--forest); width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--bg-2) 0); flex: none; }
.ring > div { width: 50px; height: 50px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-weight: 700; font-size: .85rem; }

/* ---------- landing ---------- */
.hero {
  position: relative; border-radius: 28px; overflow: hidden; padding: clamp(32px, 6vw, 72px) clamp(20px, 5vw, 64px);
  background: radial-gradient(1200px 400px at 90% -10%, rgba(224,165,38,.35), transparent 60%), linear-gradient(160deg, #24543a, #2f6b45 55%, #3d7d52);
  color: #fdf8ec; box-shadow: var(--shadow-lg);
}
.hero h1 { font-size: clamp(2.2rem, 6vw, 4rem); max-width: 14ch; margin-bottom: 14px; }
.hero p.lead { font-size: clamp(1.05rem, 2vw, 1.3rem); max-width: 40ch; opacity: .92; }
.hero .btn.honey { margin-top: 10px; }
.hero-art { position: absolute; right: -40px; bottom: -20px; width: min(48%, 520px); opacity: .95; pointer-events: none; }
@media (max-width: 860px) { .hero-art { opacity: .18; width: 90%; } }
.steps { counter-reset: s; }
.step { position: relative; padding-left: 0; }
.step .num { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--honey-soft); font-size: 1.3rem; margin-bottom: 10px; }
.mosaic { display: flex; flex-wrap: wrap; gap: 8px; }
.mosaic span { padding: 8px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-weight: 600; font-size: .92rem; }

/* ---------- home ---------- */
.greet h1 { margin-bottom: 4px; }
.quote { font-family: var(--serif); font-style: italic; color: var(--ink-2); font-size: 1.05rem; }
.mission {
  background: linear-gradient(160deg, var(--surface), var(--surface-2)); border: 1px solid var(--line); border-radius: 22px; padding: 22px; box-shadow: var(--shadow);
}
.mission-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.mission-item {
  display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 14px; text-decoration: none; color: inherit;
  border: 1px solid var(--line); background: var(--surface); margin-top: 10px; transition: transform .12s ease, border-color .12s;
}
.mission-item:hover { border-color: var(--forest); transform: translateX(2px); }
.mission-item .tick { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; flex: none; font-size: .9rem; }
.mission-item.done { opacity: .62; }
.mission-item.done .tick { background: var(--good); border-color: var(--good); color: #fff; }
.mission-item .mi-label { font-weight: 650; line-height: 1.3; }
.mission-item .mi-sub { font-size: .85rem; color: var(--muted); }
.mission-item .go { margin-left: auto; color: var(--muted); font-size: 1.2rem; }
.stat { display: flex; align-items: center; gap: 12px; }
.stat .big { font-family: var(--serif); font-size: 1.7rem; font-weight: 700; line-height: 1; }
.stat .lbl { font-size: .8rem; color: var(--muted); font-weight: 600; }

/* ---------- tracks ---------- */
.track-card { position: relative; overflow: hidden; padding: 18px 18px 16px; }
.track-card::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--tc, var(--forest)); }
.track-card .ticon { font-size: 2rem; width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center; background: color-mix(in srgb, var(--tc) 14%, transparent); margin-bottom: 10px; }
.track-card h3 { margin: 0 0 4px; }
.track-card p { margin: 0 0 12px; color: var(--muted); font-size: .93rem; }
.group-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.group-tabs::-webkit-scrollbar { display: none; }
.group-tabs button { flex: none; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; font-size: .92rem; }
.group-tabs button.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.track-hero { border-radius: 24px; padding: clamp(22px, 4vw, 40px); color: #fff; position: relative; overflow: hidden; box-shadow: var(--shadow-lg); }
.track-hero .big-icon { position: absolute; right: 18px; top: 8px; font-size: clamp(5rem, 14vw, 9rem); opacity: .25; pointer-events: none; }
.track-hero h1 { margin-bottom: 6px; }
.track-hero p { max-width: 60ch; opacity: .95; }
.track-hero .bar { background: rgba(255,255,255,.25); }
.track-hero .bar > i { background: #fff; }
.unit { margin-top: 28px; }
.unit-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.level-pill { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; padding: 3px 9px; border-radius: 999px; background: var(--honey-soft); color: #8a5d00; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .level-pill { color: var(--honey); } }
:root[data-theme="dark"] .level-pill { color: var(--honey); }
.lesson-row {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; text-decoration: none; color: inherit; margin-top: 8px; transition: border-color .12s, transform .12s;
}
.lesson-row:hover { border-color: var(--tc, var(--forest)); transform: translateX(2px); }
.lesson-row .dot { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--bg-2); font-weight: 700; font-size: .9rem; }
.lesson-row.done .dot { background: var(--good); color: #fff; }
.lesson-row.next { border-color: var(--honey); box-shadow: 0 0 0 3px var(--honey-soft); }
.lesson-row .lt { font-weight: 650; line-height: 1.3; }
.lesson-row .ls { font-size: .84rem; color: var(--muted); }
.lesson-row .meta { margin-left: auto; font-size: .8rem; color: var(--muted); white-space: nowrap; text-align: right; }

/* ---------- lesson ---------- */
.crumbs { font-size: .88rem; color: var(--muted); margin-bottom: 12px; }
.crumbs a { color: var(--muted); }
.lesson-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
@media (max-width: 960px) { .lesson-wrap { grid-template-columns: 1fr; } }
.lesson-wrap aside { position: sticky; top: 80px; }
@media (max-width: 960px) { .lesson-wrap aside { position: static; } }
.hook { font-family: var(--serif); font-size: clamp(1.15rem, 2.2vw, 1.4rem); color: var(--ink-2); border-left: 4px solid var(--honey); padding-left: 16px; margin: 8px 0 24px; }
.prose { font-size: 1.06rem; }
.prose p { margin-bottom: 1.1em; }
.prose b { color: var(--ink); font-weight: 650; background: linear-gradient(transparent 62%, var(--honey-soft) 0); }
.prose code, .keys code { font-family: ui-monospace, Consolas, monospace; font-size: .88em; background: var(--bg-2); padding: 1px 6px; border-radius: 6px; }
.prose .code, .block .code { margin: 12px 0; }
.block { margin-top: 28px; }
.block-title { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 1.25rem; font-weight: 650; margin-bottom: 12px; }
.block-title .bi { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--forest-soft); font-size: 1.1rem; }
.keys { list-style: none; padding: 0; margin: 0; }
.keys li { padding: 10px 0 10px 32px; position: relative; border-bottom: 1px dashed var(--line); }
.keys li:last-child { border-bottom: 0; }
.keys li::before { content: '✦'; position: absolute; left: 6px; top: 10px; color: var(--honey); }
.watch-list { display: grid; gap: 8px; }
.watch-btn {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line);
  text-decoration: none; color: inherit; font-weight: 550;
}
.watch-btn:hover { border-color: #e03a3a; }
.watch-btn .yt { width: 38px; height: 27px; border-radius: 7px; background: #e33; display: grid; place-items: center; color: #fff; font-size: .8rem; flex: none; }
.watch-btn .rd { width: 38px; height: 27px; border-radius: 7px; background: var(--sky); display: grid; place-items: center; color: #fff; font-size: .9rem; flex: none; }
.do-card { background: linear-gradient(160deg, var(--clay-soft), var(--surface)); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.do-card.outside { background: linear-gradient(160deg, var(--forest-soft), var(--surface)); }
.checklist { list-style: none; padding: 0; margin: 0 0 14px; }
.checklist li { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; }
.checklist input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--forest); flex: none; }
.checklist label { cursor: pointer; }
.checklist input:checked + label { text-decoration: line-through; color: var(--muted); }
.safety { display: flex; gap: 12px; align-items: flex-start; background: var(--clay-soft); border-radius: 14px; padding: 14px 16px; font-size: .95rem; margin-bottom: 16px; }
.safety .si { font-size: 1.4rem; line-height: 1; }
textarea, input[type="text"], input[type="number"], input[type="search"], input[type="date"], select {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px;
}
textarea { min-height: 120px; resize: vertical; }
textarea:focus, input:focus, select:focus { outline: none; border-color: var(--forest); box-shadow: 0 0 0 3px var(--forest-soft); }
label.field { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.rate { display: flex; gap: 10px; }
.rate button { flex: 1; padding: 14px; font-size: 1.5rem; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; }
.rate button.on { border-color: var(--forest); background: var(--forest-soft); }

/* ---------- quiz ---------- */
.quiz { max-width: 720px; margin: 0 auto; }
.qprog { display: flex; gap: 6px; margin-bottom: 22px; }
.qprog i { flex: 1; height: 8px; border-radius: 999px; background: var(--bg-2); }
.qprog i.ok { background: var(--good); }
.qprog i.no { background: var(--bad); }
.qprog i.cur { background: var(--honey); }
.qtext { font-family: var(--serif); font-size: clamp(1.3rem, 3vw, 1.75rem); line-height: 1.3; margin-bottom: 20px; }
.opts { display: grid; gap: 10px; }
.opt {
  text-align: left; padding: 16px 18px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); cursor: pointer;
  font-size: 1.03rem; font-weight: 550; display: flex; gap: 12px; align-items: center; transition: border-color .1s, transform .08s;
}
.opt:hover:not([disabled]) { border-color: var(--forest); }
.opt:active:not([disabled]) { transform: scale(.99); }
.opt .k { width: 28px; height: 28px; border-radius: 8px; background: var(--bg-2); display: grid; place-items: center; font-size: .8rem; font-weight: 700; flex: none; }
.opt.right { border-color: var(--good); background: color-mix(in srgb, var(--good) 12%, var(--surface)); }
.opt.wrong { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, var(--surface)); animation: shake .35s; }
.opt[disabled] { cursor: default; }
@keyframes shake { 25% { transform: translateX(-6px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }
.feedback { margin-top: 16px; padding: 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); animation: rise .25s ease; }
.feedback.ok { border-color: color-mix(in srgb, var(--good) 40%, var(--line)); }
.feedback.no { border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.score-big { font-family: var(--serif); font-size: clamp(3rem, 10vw, 5rem); font-weight: 700; line-height: 1; }

/* ---------- misc components ---------- */
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px; }
.badge { text-align: center; padding: 14px 8px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.badge .bi { font-size: 2rem; }
.badge .bn { font-weight: 650; font-size: .85rem; line-height: 1.2; margin-top: 4px; }
.badge .bd { font-size: .72rem; color: var(--muted); line-height: 1.25; margin-top: 2px; }
.badge.locked { opacity: .45; filter: grayscale(1); }
.heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 12px); gap: 3px; overflow-x: auto; padding-bottom: 4px; }
.heat i { width: 12px; height: 12px; border-radius: 3px; background: var(--bg-2); }
.heat i.l1 { background: color-mix(in srgb, var(--forest) 30%, var(--bg-2)); }
.heat i.l2 { background: color-mix(in srgb, var(--forest) 55%, var(--bg-2)); }
.heat i.l3 { background: color-mix(in srgb, var(--forest) 80%, var(--bg-2)); }
.heat i.l4 { background: var(--forest); }
.interest-bars .ib { display: grid; grid-template-columns: 110px 1fr 36px; gap: 10px; align-items: center; margin-bottom: 8px; font-size: .9rem; }
.pill-choice { display: flex; flex-wrap: wrap; gap: 10px; }
.pill-choice button {
  padding: 12px 16px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; font-size: 1rem;
}
.pill-choice button.on { border-color: var(--forest); background: var(--forest-soft); }
.avatar-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 8px; }
.avatar-pick button { font-size: 1.8rem; padding: 8px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); cursor: pointer; aspect-ratio: 1; }
.avatar-pick button.on { border-color: var(--forest); background: var(--forest-soft); }
.wyr { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.wyr button {
  padding: 22px 18px; border-radius: 18px; border: 2px solid var(--line); background: var(--surface); cursor: pointer; text-align: left; font-size: 1.05rem;
  font-weight: 600; display: flex; gap: 14px; align-items: center; transition: transform .1s, border-color .1s; box-shadow: var(--shadow);
}
.wyr button:hover { border-color: var(--forest); transform: translateY(-2px); }
.wyr button .e { font-size: 2rem; }
.onboard { max-width: 760px; margin: 0 auto; }
.toolbox { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 20px; }
.kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.kpi > div { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; }
.kpi .v { font-family: var(--serif); font-size: 1.45rem; font-weight: 700; }
.kpi .l { font-size: .78rem; color: var(--muted); font-weight: 600; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .93rem; }
table.tbl th, table.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.tbl th { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.table-scroll { overflow-x: auto; }
.journal-entry { border-left: 3px solid var(--forest); padding: 4px 0 4px 14px; margin-bottom: 18px; }
.journal-entry img { border-radius: 12px; margin-top: 8px; max-height: 260px; }
.big-timer { font-family: var(--serif); font-size: clamp(3.5rem, 14vw, 6rem); font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.game-stage { min-height: 320px; display: grid; place-items: center; text-align: center; }
.game-big { font-family: var(--serif); font-size: clamp(2.6rem, 10vw, 4.5rem); font-weight: 700; letter-spacing: .05em; font-variant-numeric: tabular-nums; }
.numpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 300px; margin: 14px auto 0; }
.numpad button { padding: 16px; font-size: 1.3rem; font-weight: 700; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; }
.numpad button:active { background: var(--bg-2); }
.tag { display: inline-block; font-size: .74rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--bg-2); color: var(--ink-2); }
.tag.out { background: var(--forest-soft); color: var(--forest-2); }
.tag.adult { background: var(--clay-soft); color: var(--clay); }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty .ei { font-size: 3rem; }
hr.soft { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
.footer { margin-top: 60px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
.search-box { position: relative; }
.search-box input { padding-left: 42px; }
.search-box::before { content: '🔎'; position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: .95rem; opacity: .7; }
.tip { display: flex; gap: 14px; align-items: flex-start; }
.tip .ti { font-size: 1.8rem; line-height: 1; }
.code { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: .88rem; background: #1d2620; color: #e4f0e0; padding: 14px 16px; border-radius: 12px; overflow-x: auto; white-space: pre; line-height: 1.5; }
.chat { display: flex; flex-direction: column; gap: 8px; max-height: 340px; overflow-y: auto; padding: 12px; background: var(--surface-2); border-radius: 14px; border: 1px solid var(--line); }
.chat .msg { max-width: 85%; padding: 9px 13px; border-radius: 14px; font-size: .95rem; line-height: 1.4; }
.chat .msg.me { align-self: flex-end; background: var(--forest); color: #fff; border-bottom-right-radius: 4px; }
.chat .msg.bot { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 700px) { .split { grid-template-columns: 1fr; } }

/* toasts & confetti */
#toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: 90px; z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-weight: 600; font-size: .93rem; box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(10px); transition: all .3s ease; text-align: center; }
.toast.show { opacity: 1; transform: none; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 99; }

.fade-in { animation: rise .35s ease both; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

@media print {
  .topbar, .tabbar, .no-print, .footer, #toasts { display: none !important; }
  body { background: #fff; color: #000; }
  main { padding: 0; max-width: none; }
  .card { box-shadow: none; border-color: #ccc; }
}
