/* Zabanyar "Sunflower" identity: off-white + off-black + one saturated pop.
   Tactile 3D buttons (a darker bottom edge that compresses on press), soft 16px radius everywhere. */
:root {
  --bg: #FAFAF7; --surface: #FFFFFF; --ink: #141414; --muted: #5E5E58; --line: #E6E4DC;
  --pop: #FFC531; --pop-edge: #D99A00; --pop-soft: #FFF3CC; --on-pop: #141414;
  --ok: #23905A; --ok-edge: #186A41; --bad: #D93B40; --bad-edge: #A3262B;
  --r: 16px; --ease: cubic-bezier(.16, 1, .3, 1);
  --font: "Bricolage Grotesque", "Vazirmatn", "Noto Sans SC", "Noto Sans Devanagari", "Noto Sans KR", "Noto Sans JP", "Noto Sans Hebrew", "Noto Sans Armenian", "Noto Sans Georgian", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #121211; --surface: #1C1C1A; --ink: #F4F3EE; --muted: #A3A29A; --line: #2E2E2B; --pop-soft: #3A3110; color-scheme: dark; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--font); line-height: 1.5; padding-bottom: 84px; -webkit-font-smoothing: antialiased; }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--pop-edge); outline-offset: 2px; }
i.ph, i[class^="ph-"] { font-size: 1.25em; vertical-align: -.2em; }

/* Top bar */
.bar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 10px; height: 64px; padding: 0 16px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.mark { display: flex; gap: 8px; align-items: center; font-weight: 800; font-size: 1.25rem; letter-spacing: -.02em; margin-inline-end: auto; }
.mark span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--pop); color: var(--on-pop); box-shadow: 0 3px 0 var(--pop-edge); }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: .9rem; }
.pill { white-space: nowrap; }
.pill.streak b { color: #E8590C; }
@media (max-width: 420px) { .pill#pair { max-width: 44vw; overflow: hidden; text-overflow: ellipsis; } }
select { height: 36px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); padding: 0 10px; }

main { max-width: 720px; margin: 0 auto; padding: 20px 16px 32px; }
h1 { font-size: clamp(2rem, 6vw, 3.25rem); line-height: 1.05; letter-spacing: -.035em; margin: 8px 0 10px; font-weight: 800; }
h1 mark { background: var(--pop); color: var(--on-pop); padding: 0 .15em; border-radius: 8px; }
h2 { font-size: 1.35rem; letter-spacing: -.02em; margin: 28px 0 12px; }
.lede { color: var(--muted); max-width: 52ch; font-size: 1.05rem; }

/* Tactile buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 24px; border: 0; border-radius: var(--r);
  background: var(--pop); color: var(--on-pop); font-weight: 700; font-size: 1.05rem; box-shadow: 0 5px 0 var(--pop-edge); transition: transform .12s var(--ease), box-shadow .12s var(--ease); white-space: nowrap; }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--pop-edge); }
.btn.ghost { background: var(--surface); color: var(--ink); box-shadow: 0 4px 0 var(--line); border: 2px solid var(--line); }
.btn.ghost:active { box-shadow: 0 0 0 var(--line); }
.btn.wide { width: 100%; }

/* Language picker */
.langs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 10px 0 8px; }
.lang { text-align: start; padding: 12px 14px; border-radius: var(--r); border: 2px solid var(--line); background: var(--surface); box-shadow: 0 4px 0 var(--line); transition: transform .12s var(--ease); }
.lang:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.lang b { display: block; font-size: 1.05rem; }
.lang small { color: var(--muted); }
.lang[aria-pressed="true"] { border-color: var(--pop-edge); background: var(--pop-soft); box-shadow: 0 4px 0 var(--pop-edge); }
.lang:disabled { opacity: .35; cursor: not-allowed; }
.step { font-weight: 700; margin-top: 22px; }

/* Home */
.mission { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; padding: 18px; border-radius: 24px; background: var(--ink); color: var(--bg); }
.ring { --p: 0; width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 1.1rem;
  background: radial-gradient(closest-side, var(--ink) 74%, transparent 75% 100%), conic-gradient(var(--pop) calc(var(--p) * 1%), #3a3a36 0); }
.mission p { margin: 0 0 10px; opacity: .8; }
.mission h3 { margin: 0 0 4px; font-size: 1.25rem; }
.path { position: relative; display: flex; flex-direction: column; align-items: center; gap: 22px; padding: 12px 0; }
.unit-title { align-self: stretch; text-align: center; color: var(--muted); font-weight: 700; margin: 10px 0 -6px; }
.node { position: relative; width: 76px; height: 70px; border-radius: 50%; border: 0; display: grid; place-items: center; font-size: 1.8rem;
  background: var(--line); color: var(--muted); box-shadow: 0 7px 0 color-mix(in srgb, var(--line) 70%, #000); transition: transform .12s var(--ease); }
.node.done { background: var(--ok); color: #fff; box-shadow: 0 7px 0 var(--ok-edge); }
.node.now { background: var(--pop); color: var(--on-pop); box-shadow: 0 7px 0 var(--pop-edge); animation: bob 2.4s var(--ease) infinite; }
.node.now::after { content: ""; position: absolute; inset: -10px; border-radius: 50%; border: 3px solid var(--pop); opacity: .5; }
.node:active { transform: translateY(5px); }
.node:nth-child(4n+2) { translate: 60px; } .node:nth-child(4n+4) { translate: -60px; }
@keyframes bob { 50% { transform: translateY(-6px); } }

/* Study card */
.card { position: relative; background: var(--surface); border: 2px solid var(--line); border-radius: 24px; padding: 28px 20px; text-align: center; box-shadow: 0 6px 0 var(--line); animation: enter .45s var(--ease); }
@keyframes enter { from { opacity: 0; transform: translateY(16px) scale(.98); } }
.prompt { color: var(--muted); font-size: 1.15rem; }
.answer { font-size: clamp(1.9rem, 7vw, 2.8rem); font-weight: 700; letter-spacing: -.02em; margin: 14px 0 4px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 18px; }
.chipbtn { display: inline-flex; gap: 6px; align-items: center; height: 42px; padding: 0 16px; border-radius: 999px; border: 2px solid var(--line); background: var(--surface); font-weight: 600; }
.grades { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 20px; }
.grade { border: 0; border-radius: 14px; padding: 10px 4px; color: #fff; font-weight: 700; transition: transform .12s var(--ease); }
.grade small { display: block; font-weight: 500; font-size: .72rem; opacity: .9; }
.grade:active { transform: translateY(3px); }
.g1 { background: var(--bad); box-shadow: 0 4px 0 var(--bad-edge); }
.g2 { background: #8A6A00; box-shadow: 0 4px 0 #5E4800; }
.g3 { background: var(--ok); box-shadow: 0 4px 0 var(--ok-edge); }
.g4 { background: var(--ink); color: var(--bg); box-shadow: 0 4px 0 var(--muted); }
.score { margin-top: 12px; min-height: 1.5em; }
.progress { height: 14px; border-radius: 999px; background: var(--line); overflow: hidden; margin-bottom: 18px; }
.progress i { display: block; height: 100%; background: var(--pop); border-radius: 999px; transition: width .5s var(--ease); }
.xp-pop { position: fixed; inset-inline-start: 50%; top: 40%; translate: -50% 0; font-weight: 800; font-size: 1.6rem; color: var(--pop-edge); pointer-events: none; animation: xp .9s var(--ease) forwards; z-index: 20; }
@keyframes xp { to { opacity: 0; transform: translateY(-60px) scale(1.3); } }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.stat { padding: 18px; border-radius: var(--r); background: var(--surface); border: 2px solid var(--line); }
.stat b { display: block; font-size: 2.2rem; letter-spacing: -.03em; }
.stat.hero { grid-column: 1 / -1; background: var(--pop); color: var(--on-pop); border-color: var(--pop-edge); }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; align-items: end; height: 110px; margin-top: 10px; }
.week i { display: block; border-radius: 8px 8px 4px 4px; background: var(--pop); min-height: 4px; }
.week span { text-align: center; color: var(--muted); font-size: .75rem; }

/* Tutor */
.scen-cats { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; }
.scen-cats button { flex: none; scroll-snap-align: start; height: 38px; padding: 0 14px; border-radius: 999px; border: 2px solid var(--line); background: var(--surface); font-weight: 600; }
.scen-cats button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.scen-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 12px; }
.scen { text-align: start; padding: 16px; min-height: 118px; border-radius: 20px; border: 2px solid var(--line); background: var(--surface); box-shadow: 0 4px 0 var(--line); display: flex; flex-direction: column; justify-content: space-between; gap: 10px; transition: transform .12s var(--ease); }
.scen i { font-size: 2rem; color: var(--pop-edge); }
.scen b { font-size: .98rem; line-height: 1.25; }
.scen:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.scen:nth-child(5n+1) { background: var(--pop-soft); border-color: var(--pop); }
.tutorhead { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.tutorhead .who { flex: 1; }
.tutorhead b { display: block; }
.tutorhead small { color: var(--muted); }
.avatar { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--pop); box-shadow: 0 3px 0 var(--pop-edge); font-size: 1.5rem; }
.chat { display: flex; flex-direction: column; gap: 10px; min-height: 48vh; }
.msg { max-width: 86%; padding: 12px 16px; border-radius: 20px; animation: enter .35s var(--ease); }
.msg p { margin: 0 0 4px; }
.msg.assistant { align-self: flex-start; background: var(--surface); border: 2px solid var(--line); border-end-start-radius: 6px; }
.msg.user { align-self: flex-end; background: var(--ink); color: var(--bg); border-end-end-radius: 6px; }
.msg .fix { background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); padding: 6px 10px; border-radius: 10px; font-size: .9rem; }
.msg .gloss { color: var(--muted); font-size: .88rem; }
.typing span { display: inline-block; width: 8px; height: 8px; margin: 0 2px; border-radius: 50%; background: var(--muted); animation: dot 1s infinite; }
.typing span:nth-child(2) { animation-delay: .15s; } .typing span:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 50% { transform: translateY(-5px); opacity: .4; } }
.composer { position: sticky; bottom: 84px; display: flex; gap: 8px; padding: 10px 0; background: var(--bg); }
.composer input { flex: 1; height: 52px; border-radius: var(--r); border: 2px solid var(--line); background: var(--surface); padding: 0 14px; }
.composer .btn { min-height: 52px; padding: 0 16px; }

/* Forms */
.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; font-weight: 600; }
.form input { height: 52px; border-radius: var(--r); border: 2px solid var(--line); background: var(--surface); padding: 0 14px; }
.err { color: var(--bad); min-height: 1.5em; }

/* Bottom tabs */
.tabs { position: fixed; bottom: 0; inset-inline: 0; z-index: 10; display: grid; grid-template-columns: repeat(5, 1fr); background: var(--surface); border-top: 2px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabs button { background: none; border: 0; padding: 10px 2px 12px; display: grid; justify-items: center; gap: 2px; font-size: .75rem; font-weight: 600; color: var(--muted); }
.tabs button i { font-size: 1.6rem; }
.tabs button[aria-current="page"] { color: var(--ink); }
.tabs button[aria-current="page"] i { color: var(--pop-edge); }
@media (min-width: 900px) { main { padding-top: 36px; } }
@media (prefers-reduced-motion: reduce) { *, *::after { animation: none !important; transition: none !important; } }
/* Scenario card with photo: image fills the card, label sits on a bottom scrim */
.scen.photo { position: relative; overflow: hidden; min-height: 168px; padding: 0; justify-content: flex-end; border-color: var(--line); background: var(--ink); }
.scen.photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.scen.photo:hover img { transform: scale(1.05); }
.scen.photo i { position: absolute; top: 10px; inset-inline-start: 10px; font-size: 1.3rem; color: var(--on-pop); background: var(--pop); border-radius: 10px; padding: 6px; }
.scen.photo b { position: relative; padding: 32px 12px 12px; color: #fff; background: linear-gradient(transparent, rgb(0 0 0 / .75)); }
.card .composer { position: static; padding-bottom: 0; }
/* Language picker grouping */
.pickbar { position: sticky; top: 64px; z-index: 5; display: grid; gap: 10px; padding: 12px 0; background: var(--bg); }
.seg { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 999px; background: var(--line); }
.seg button { height: 38px; border: 0; border-radius: 999px; background: none; font-weight: 700; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 2px 0 var(--pop-edge); }
.pickbar input { height: 46px; border-radius: var(--r); border: 2px solid var(--line); background: var(--surface); padding: 0 14px; }
.group-title { margin: 14px 0 2px; font-size: .85rem; font-weight: 700; color: var(--muted); }
/* Journey + placement */
.placecta { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; padding: 16px; margin-bottom: 16px; border-radius: 20px; background: var(--pop-soft); border: 2px solid var(--pop); }
.placecta > i { font-size: 2.2rem; color: var(--pop-edge); }
.placecta p { margin: 2px 0 0; color: var(--muted); font-size: .92rem; }
.placecta .btn { grid-column: 1 / -1; }
.journey { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.jstep { display: grid; gap: 2px; padding: 14px 12px; border-radius: var(--r); background: var(--surface); border: 2px solid var(--line); }
.jstep b { font-size: 1.5rem; letter-spacing: -.02em; }
.jstep small { color: var(--muted); font-size: .78rem; }
.jstep.now { background: var(--pop); border-color: var(--pop-edge); color: var(--on-pop); }
.jstep.now small { color: var(--on-pop); opacity: .8; }
.note { color: var(--muted); font-size: .82rem; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; border-inline-start: 3px solid var(--line); }
.timeline li { display: flex; gap: 12px; align-items: center; padding: 8px 12px; margin-inline-start: -14px; }
.timeline li > i { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--pop); color: var(--on-pop); font-size: .95rem; flex: none; }
.timeline small { display: block; color: var(--muted); }
.options { display: grid; gap: 10px; margin-top: 18px; }
.options .ok { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 15%, var(--surface)); }
.options .bad { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 15%, var(--surface)); }
.answer.cando { font-size: 1.25rem; font-weight: 600; }
.answer.big { font-size: 4rem; }
@media (max-width: 420px) { .journey { grid-template-columns: 1fr; } }

/* ===== v2: onboarding wizard ===== */
.wizhead { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; margin-bottom: 8px; }
.wizhead .chipbtn { width: 44px; padding: 0; justify-content: center; }
.dots { display: flex; justify-content: center; gap: 8px; }
.dots i { width: 10px; height: 10px; border-radius: 999px; background: var(--line); transition: width .3s var(--ease), background .3s; }
.dots i.done { background: var(--pop-edge); }
.dots i.now { width: 34px; background: var(--pop); }
.ask { font-size: clamp(1.5rem, 4.5vw, 2rem); margin: 18px 0 4px; letter-spacing: -.03em; }
.pickbar { top: 64px; }
.lgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin: 10px 0 6px; }
.lgrid.pop { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.ltile { position: relative; display: grid; gap: 2px; text-align: start; padding: 12px 14px; border-radius: 18px; border: 2px solid var(--line); background: var(--surface);
  box-shadow: 0 4px 0 var(--line); transition: transform .14s var(--ease), border-color .2s, background .2s; overflow: hidden; }
.ltile .hi { font-size: 1.05rem; font-weight: 800; color: var(--pop-edge); letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ltile b { font-size: 1rem; }
.ltile small { color: var(--muted); font-size: .78rem; }
.ltile.big { padding: 18px 16px 14px; min-height: 128px; align-content: end; }
.ltile.big .hi { position: absolute; top: 10px; inset-inline-start: 14px; inset-inline-end: 10px; font-size: clamp(1.25rem, 4.6vw, 1.6rem); text-align: start; }
.ltile:hover { border-color: var(--pop); transform: translateY(-2px); }
.ltile:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.ltile[aria-pressed="true"], .ltile.picked { border-color: var(--pop-edge); background: var(--pop-soft); box-shadow: 0 4px 0 var(--pop-edge); }
.ltile.picked { animation: pick .26s var(--ease); }
@keyframes pick { 50% { transform: scale(1.05); } }
.ltile:disabled { opacity: .3; cursor: not-allowed; transform: none; }
.lgroup { border-bottom: 1px solid var(--line); }
.lgroup summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 14px 4px; cursor: pointer; font-size: 1.02rem; }
.lgroup summary::-webkit-details-marker { display: none; }
.lgroup summary span { margin-inline-start: auto; min-width: 28px; height: 24px; padding: 0 8px; display: grid; place-items: center; border-radius: 999px; background: var(--line); font-size: .78rem; font-weight: 700; color: var(--muted); }
.lgroup summary i { transition: transform .25s var(--ease); color: var(--muted); }
.lgroup[open] summary i { transform: rotate(180deg); }
.pairhero { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 14px 0 4px; padding: 22px 16px; border-radius: 24px; background: var(--ink); color: var(--bg); font-size: clamp(1.3rem, 5vw, 1.9rem); font-weight: 800; letter-spacing: -.02em; }
.pairhero i { color: var(--pop); }
.goals { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-top: 12px; }
.goal { position: relative; display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: center; text-align: start; padding: 16px; border-radius: 18px; border: 2px solid var(--line); background: var(--surface); box-shadow: 0 4px 0 var(--line); transition: transform .14s var(--ease); }
.goal > i:first-child { grid-row: span 2; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--line); font-size: 1.5rem; transition: background .2s; }
.goal small { color: var(--muted); font-size: .82rem; line-height: 1.35; }
.goal .tick { position: absolute; top: 10px; inset-inline-end: 10px; color: var(--pop-edge); opacity: 0; transform: scale(.5); transition: .2s var(--ease); }
.goal[aria-pressed="true"] { border-color: var(--pop-edge); background: var(--pop-soft); box-shadow: 0 4px 0 var(--pop-edge); }
.goal[aria-pressed="true"] > i:first-child { background: var(--pop); }
.goal[aria-pressed="true"] .tick { opacity: 1; transform: none; }
.goal:active { transform: translateY(3px); }

/* ===== v2: home greeting — a big speech bubble in the target language ===== */
.greet { position: relative; display: grid; gap: 4px; margin: 6px 0 22px; padding: 20px 22px; border-radius: 28px 28px 28px 8px; background: var(--pop); color: var(--on-pop); box-shadow: 0 6px 0 var(--pop-edge); }
[dir="rtl"] .greet { border-radius: 28px 28px 8px 28px; }
.greet .hi { justify-self: start; font-size: clamp(2.4rem, 10vw, 3.6rem); font-weight: 800; line-height: 1.05; letter-spacing: -.04em; }
.greet b { font-size: 1.05rem; }
.greet small { display: block; opacity: .75; font-weight: 600; }

/* ===== v2: scenario browser ===== */
.search { width: 100%; height: 50px; margin: 6px 0 14px; border-radius: var(--r); border: 2px solid var(--line); background: var(--surface); padding: 0 16px; }
.feature { position: relative; display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; gap: 8px; width: 100%; aspect-ratio: 16 / 9; max-height: 360px; padding: 20px; border: 0; border-radius: 26px; overflow: hidden; background: var(--ink); color: #fff; text-align: start; box-shadow: 0 6px 0 var(--line); }
.feature img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.feature::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 35%, rgb(0 0 0 / .8)); }
.feature:hover img { transform: scale(1.04); }
.feature > :not(img) { position: relative; z-index: 1; }
.feature .tag { display: inline-flex; gap: 6px; align-items: center; padding: 4px 12px; border-radius: 999px; background: var(--pop); color: var(--on-pop); font-weight: 700; font-size: .85rem; }
.feature b { font-size: clamp(1.5rem, 5vw, 2.2rem); line-height: 1.1; letter-spacing: -.02em; }
.feature .cta { display: inline-flex; gap: 6px; align-items: center; font-weight: 700; opacity: .9; }
.scen-cats { margin: 16px -16px 0; padding: 4px 16px 8px; scrollbar-width: none; }
.scen-cats button { display: inline-flex; gap: 6px; align-items: center; }
.shelf { scroll-margin-top: 80px; }
.shelf h2 { display: flex; align-items: center; gap: 8px; margin: 26px 0 10px; }
.shelf h2 i { color: var(--pop-edge); }
.shelf h2 small { margin-inline-start: auto; font-size: .8rem; color: var(--muted); font-weight: 700; }
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 42%); gap: 12px; overflow-x: auto; margin: 0 -16px; padding: 4px 16px 10px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.rail::-webkit-scrollbar, .scen-cats::-webkit-scrollbar { display: none; }
.rail .scen { scroll-snap-align: start; min-height: 0; aspect-ratio: 3 / 4; }
@media (min-width: 640px) { .rail { grid-auto-columns: 200px; } }
.scen.photo b { font-size: 1rem; }
/* Mission and pair banner stay a dark slab in both themes. */
.mission, .pairhero { background: #1E1E1C; color: #F4F3EE; }
.ring { background: radial-gradient(closest-side, #1E1E1C 74%, transparent 75% 100%), conic-gradient(var(--pop) calc(var(--p) * 1%), #3a3a36 0); }
@media (prefers-color-scheme: dark) { .mission, .pairhero { background: #262622; box-shadow: inset 0 0 0 2px #34342F; } .ring { background: radial-gradient(closest-side, #262622 74%, transparent 75% 100%), conic-gradient(var(--pop) calc(var(--p) * 1%), #3a3a36 0); } }

/* ===== v3: units on the home path ===== */
.unit { margin-top: 22px; padding: 14px 14px 4px; border-radius: 24px; border: 2px solid var(--line); background: var(--surface); }
.unit header { display: flex; align-items: center; gap: 12px; }
.unit header > i { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: var(--line); font-size: 1.5rem; }
.unit header b { display: block; font-size: 1.1rem; }
.unit header small { color: var(--muted); font-weight: 600; }
.upct { margin-inline-start: auto; font-weight: 800; color: var(--muted); }
.unit.current { border-color: var(--pop); box-shadow: 0 5px 0 var(--pop-edge); }
.unit.current header > i { background: var(--pop); color: var(--on-pop); }
.unit.complete header > i { background: var(--ok); color: #fff; }
.unit .path { padding: 16px 0 18px; }

/* ===== v3: exercises ===== */
.studytop { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.studytop .progress { flex: 1; margin: 0; }
.combo { display: inline-flex; align-items: center; gap: 2px; padding: 2px 10px; border-radius: 999px; background: var(--pop); color: var(--on-pop); font-weight: 800; animation: pick .4s var(--ease); }
.mode { font-size: .78rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.badge.new { display: inline-flex; gap: 4px; align-items: center; padding: 4px 12px; border-radius: 999px; background: var(--pop-soft); color: var(--pop-edge); font-weight: 800; font-size: .85rem; }
.opt { min-height: 56px; padding: 10px 16px; border-radius: 16px; border: 2px solid var(--line); background: var(--surface); box-shadow: 0 4px 0 var(--line); font-size: 1.1rem; font-weight: 600; transition: transform .12s var(--ease); }
.opt:hover:not(:disabled) { border-color: var(--pop); }
.opt:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.opt:disabled { cursor: default; }
.opt.ok { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 18%, var(--surface)); box-shadow: 0 4px 0 var(--ok-edge); }
.opt.bad { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 15%, var(--surface)); animation: shake .35s; }
@keyframes shake { 25% { translate: -6px; } 75% { translate: 6px; } }
.btn.round { width: 84px; height: 84px; border-radius: 50%; padding: 0; font-size: 2rem; }
.built { min-height: 58px; margin: 16px 0 10px; padding: 8px; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; border-bottom: 2px dashed var(--line); }
.built span { padding: 8px 12px; border-radius: 12px; background: var(--pop-soft); font-weight: 700; animation: enter .2s var(--ease); }
.tiles { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.tile { padding: 10px 14px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); box-shadow: 0 3px 0 var(--line); font-weight: 700; font-size: 1.05rem; }
.tile.used { opacity: .25; box-shadow: none; }
.card.right { border-color: var(--ok); box-shadow: 0 6px 0 var(--ok-edge); }
.card.wrong { border-color: var(--bad); box-shadow: 0 6px 0 var(--bad-edge); }
.okc { color: var(--ok); } .badc { color: var(--bad); }
.rec { color: var(--bad); font-weight: 700; animation: dot 1s infinite; }
.celebrate h2 { margin: 6px 0 16px; font-size: 1.8rem; }
.burst { display: grid; place-items: center; width: 110px; height: 110px; margin: 0 auto; border-radius: 50%; background: var(--pop); box-shadow: 0 7px 0 var(--pop-edge); font-size: 3.4rem; color: var(--on-pop); animation: pop .6s var(--ease); }
@keyframes pop { from { transform: scale(.3) rotate(-20deg); opacity: 0; } }
.stats.three { grid-template-columns: repeat(3, 1fr); }
.stats.three .stat b { font-size: 1.6rem; }
.stats.three .stat { font-size: .8rem; padding: 12px 8px; }
.unit:not(.current):not(.open) .path { display: none; }
.unit:not(.current) { padding-bottom: 14px; cursor: pointer; }
.unit:not(.current) header::after { content: ""; }
.who-card { display: flex; gap: 12px; align-items: center; padding: 16px; margin-bottom: 14px; border-radius: 20px; background: var(--surface); border: 2px solid var(--line); }
.who-card > i { font-size: 2.6rem; color: var(--pop-edge); }
.who-card small { display: block; color: var(--muted); }
a.btn { text-decoration: none; }
.form .otp { font-size: 1.6rem; letter-spacing: .5em; text-align: center; font-weight: 800; }
.seg + .form { margin-top: 14px; }

/* ===== v4: signed-out landing ===== */
body.out .tabs { display: none; }
body.out { padding-bottom: 0; }
.btn.sm { min-height: 38px; padding: 0 16px; font-size: .92rem; box-shadow: 0 3px 0 var(--pop-edge); }
.btn.big { min-height: 60px; padding: 0 30px; font-size: 1.15rem; }
main[data-route="landing"] { max-width: 1120px; }
.hero { display: grid; gap: 28px; align-items: center; min-height: min(78dvh, 720px); padding: 12px 0 24px; }
.eyebrow { display: inline-flex; gap: 6px; align-items: center; padding: 6px 14px; border-radius: 999px; background: var(--pop-soft); color: var(--pop-edge); font-weight: 700; font-size: .88rem; }
.display { font-size: clamp(2.4rem, 7vw, 4.6rem); line-height: 1.04; letter-spacing: -.045em; margin: 16px 0 14px; }
.display mark { white-space: nowrap; background: var(--pop); color: var(--on-pop); padding: 0 .12em; border-radius: 12px; }
.hero .lede { font-size: clamp(1.05rem, 2vw, 1.25rem); max-width: 56ch; }
.hero .note { display: block; margin-top: 12px; color: var(--muted); }
.hero-art { position: relative; height: 340px; }
.bubble { position: absolute; display: grid; place-items: center; padding: 22px 30px; border-radius: 34px 34px 34px 10px; font-weight: 800; letter-spacing: -.03em; white-space: nowrap; opacity: 0; transform: translateY(14px) scale(.96); }
.bubble { transition: opacity .6s var(--ease), transform .6s var(--ease); }
.bubble.in { opacity: 1; transform: none; }
.bubble.b1 { top: 6%; inset-inline-start: 4%; background: var(--pop); color: var(--on-pop); font-size: clamp(2.2rem, 6vw, 3.6rem); box-shadow: 0 8px 0 var(--pop-edge); }
.bubble.b2 { top: 44%; inset-inline-end: 2%; background: var(--ink); color: var(--bg); font-size: clamp(1.6rem, 4vw, 2.4rem); border-radius: 34px 34px 10px 34px; transition-delay: .15s; }
.bubble.b3 { bottom: 2%; inset-inline-start: 18%; background: var(--surface); border: 2px solid var(--line); font-size: clamp(1.3rem, 3vw, 1.8rem); box-shadow: 0 6px 0 var(--line); transition-delay: .3s; }
.marquee { overflow: hidden; margin: 0 -16px; padding: 18px 0; border-block: 2px solid var(--line); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee > div { display: flex; gap: 18px; width: max-content; align-items: center; animation: marquee 60s linear infinite; font-size: 1.4rem; font-weight: 800; }
.marquee i { color: var(--pop-edge); font-style: normal; }
[dir="rtl"] .marquee > div { animation-name: marquee-rtl; }
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes marquee-rtl { to { transform: translateX(50%); } }
.lsec { margin: 64px 0; }
.lsec > h2 { font-size: clamp(1.7rem, 4vw, 2.6rem); letter-spacing: -.035em; line-height: 1.15; margin: 0 0 10px; }
.how { display: grid; gap: 14px; margin-top: 20px; }
.howcard { position: relative; padding: 24px 22px; border-radius: 26px; background: var(--surface); border: 2px solid var(--line); box-shadow: 0 6px 0 var(--line); overflow: hidden; }
.howcard .num { position: absolute; top: -10px; inset-inline-end: 12px; font-size: 6rem; font-weight: 800; color: var(--line); line-height: 1; }
.howcard > i { position: relative; display: grid; place-items: center; width: 54px; height: 54px; border-radius: 16px; background: var(--pop); color: var(--on-pop); font-size: 1.7rem; box-shadow: 0 4px 0 var(--pop-edge); }
.howcard h3 { position: relative; margin: 16px 0 6px; font-size: 1.25rem; }
.howcard p, .feat p { margin: 0; color: var(--muted); }
.mosaic { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 18px; }
.mosaic figure { margin: 0; border-radius: 22px; overflow: hidden; aspect-ratio: 1; }
.mosaic img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.mosaic figure:hover img { transform: scale(1.06); }
.bento { display: grid; gap: 12px; margin-top: 18px; }
.feat { padding: 22px; border-radius: 24px; background: var(--surface); border: 2px solid var(--line); }
.feat > i { font-size: 2rem; color: var(--pop-edge); }
.feat h3 { margin: 8px 0 4px; font-size: 1.12rem; }
.feat:first-child { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.feat:first-child p { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.feat:first-child > i { color: var(--pop); }
.faq { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; display: flex; justify-content: space-between; gap: 12px; padding: 18px 2px; font-weight: 700; font-size: 1.08rem; cursor: pointer; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary i { transition: transform .25s var(--ease); color: var(--pop-edge); }
.faq[open] summary i { transform: rotate(45deg); }
.faq p { margin: 0 0 18px; color: var(--muted); max-width: 70ch; }
.endcta { display: grid; justify-items: center; gap: 18px; text-align: center; margin: 56px 0 40px; padding: 48px 20px; border-radius: 32px; background: var(--pop); color: var(--on-pop); box-shadow: 0 8px 0 var(--pop-edge); }
.endcta h2 { margin: 0; font-size: clamp(1.6rem, 4.5vw, 2.6rem); letter-spacing: -.035em; max-width: 20ch; line-height: 1.15; }
.endcta .btn { background: var(--ink); color: var(--bg); box-shadow: 0 5px 0 #000; }
@media (min-width: 720px) {
  .hero { grid-template-columns: 1.15fr .85fr; }
  .how { grid-template-columns: repeat(3, 1fr); }
  .mosaic { grid-template-columns: repeat(4, 1fr); grid-auto-rows: 180px; }
  .mosaic figure { aspect-ratio: auto; }
  .mosaic .m0 { grid-column: span 2; grid-row: span 2; }
  .mosaic .m3 { grid-column: span 2; }
  .bento { grid-template-columns: repeat(3, 1fr); }

}
@media (max-width: 719px) { .hero-art { height: 220px; } }

/* ===== v4: shelf count beside the title ===== */
.shelf h2 small { margin-inline-start: 4px; padding: 2px 10px; border-radius: 999px; background: var(--line); font-size: .78rem; }

/* ===== v4: tablet & desktop ===== */
@media (min-width: 760px) {
  .rail { grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); overflow: visible; margin: 0; padding: 0 0 6px; }
  .rail .scen { aspect-ratio: 4 / 5; }
  .scen-cats { flex-wrap: wrap; overflow: visible; margin-inline: 0; padding-inline: 0; }
}
@media (min-width: 1024px) {
  body:not(.out) { padding-bottom: 0; padding-inline-start: 232px; }
  body:not(.out) .bar { margin-inline-start: -232px; padding-inline-start: 24px; }
  .tabs { top: 64px; bottom: 0; inset-inline-start: 0; inset-inline-end: auto; width: 232px; grid-template-columns: 1fr; align-content: start; gap: 4px; padding: 18px 12px;
    border-top: 0; border-inline-end: 2px solid var(--line); }
  .tabs button { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; font-size: 1rem; }
  .tabs button i { font-size: 1.4rem; }
  .tabs button[aria-current="page"] { background: var(--pop-soft); }
  main { max-width: 1080px; padding: 32px 32px 48px; }
  main[data-route="home"], main[data-route="study"], main[data-route="stats"], main[data-route="account"], main[data-route="setup"] { max-width: 820px; }
  .composer { bottom: 0; }
}
/* v5: new-word card helpers + learner report form */
.report { display: grid; gap: 12px; margin-top: 8px; }
.report .row { flex-wrap: wrap; justify-content: center; }
.report label.chipbtn { cursor: pointer; }
.report label.chipbtn:has(input:checked) { background: var(--pop); color: var(--on-pop); border-color: var(--pop-edge); }
.report input[type=radio] { position: absolute; opacity: 0; pointer-events: none; }
.report input[name=note] { height: 48px; border-radius: var(--r); border: 2px solid var(--line); background: var(--surface); padding: 0 14px; color: var(--ink); font: inherit; }
#help .prompt { margin-top: 6px; }
.setting { display: grid; gap: 8px; margin: 18px 0; }
.setting small { color: var(--muted); }
.placecta .row { justify-content: flex-start; flex-wrap: wrap; margin-top: 10px; }
[data-gender][aria-pressed="true"] { background: var(--pop); color: var(--on-pop); border-color: var(--pop-edge); }
