/* Nara (Նարա): your companion in Armenia. Design system v3, "tactile".
   What the best learning apps share (Duolingo, Babbel, Busuu, Memrise, Speak), made our own:
   - solid surfaces, no glass, no blur, no gradients: things look like objects you can press;
   - every pressable thing has a hard "ledge" under it and sinks into it when pressed;
   - one strong colour per meaning: pomegranate red = go/next, apricot = XP and streak, Sevan blue = listen, leaf green = right;
   - heavy, big type for the moments that matter (question, result, streak); quiet type everywhere else;
   - a fixed app bar at the top (streak, XP, level) and a fixed tab bar at the bottom, like a native app;
   - in a lesson: progress bar on top, one action button pinned at the bottom, a full-width feedback panel with sound. */
:root{
  --bg:#fff8f5; --surface:#ffffff; --sunk:#f7eeee;
  --line:#f0e2e4; --line-2:#e3d0d4;            /* borders, and the ledge under neutral things */
  --fill:#f6ecee; --fill-2:#eddde1;
  --ink:#3b2530; --ink-2:#5e4752; --muted:#9a8590;
  --red:#e8344e; --red-d:#b9223b; --red-soft:#ffe6ea;
  --apr:#ff9f1c; --apr-d:#d27b00; --apr-soft:#fff1d9;
  --sky:#1fa5e8; --sky-d:#1180ba; --sky-soft:#dff3fe;
  --grn:#3bbf5a; --grn-d:#279443; --grn-soft:#e1f7e6;
  --plum:#9b59d0; --plum-d:#7a3fae;
  --off:#e9dfe2; --off-d:#d3c4c9; --off-ink:#b3a2a9;   /* locked / disabled */
  --solid:var(--surface); --glass:var(--surface); --edge:var(--line); --hair:var(--line);
  --sh:0 2px 0 var(--line); --sh-lg:0 4px 0 var(--line);
  --blur:none;
  --wall:var(--bg); --doodle:rgba(180,90,110,.07);
  --f-ui:"Vazirmatn",system-ui,sans-serif;
  --f-hy:"Noto Sans Armenian","Vazirmatn",system-ui,sans-serif;
  --f-lat:"Nunito",system-ui,sans-serif;
  --r-xl:24px; --r-l:20px; --r-m:16px; --r-s:12px;
  --tabh:66px;
  color-scheme:light;
}
@media (prefers-color-scheme:dark){:root{
  --bg:#17101a; --surface:#221923; --sunk:#1c141e;
  --line:#352838; --line-2:#2a1f2c;
  --fill:#2b2030; --fill-2:#36293a;
  --ink:#f7ecf1; --ink-2:#dccbd4; --muted:#a8939f;
  --red:#f0475f; --red-d:#a92139; --red-soft:#3d1b26;
  --apr:#ffaa33; --apr-d:#ffbe63; --apr-soft:#3a2914;
  --sky:#33b0ee; --sky-d:#7fcdf5; --sky-soft:#13293a;
  --grn:#4cc96a; --grn-d:#7fe09a; --grn-soft:#143120;
  --plum-d:#c99ae8;
  --off:#2e2431; --off-d:#241b27; --off-ink:#6f5f74;
  --doodle:rgba(255,190,210,.045);
  color-scheme:dark}}

*{box-sizing:border-box}
[hidden]{display:none!important}
html,body{margin:0}
html{background:var(--bg)}
body{background:var(--bg);color:var(--ink);font:500 16px/1.7 var(--f-ui);-webkit-tap-highlight-color:transparent;-webkit-font-smoothing:antialiased;
  -webkit-text-size-adjust:100%;overscroll-behavior-y:none;
  padding:0 max(16px,env(safe-area-inset-right)) calc(var(--tabh) + 22px + env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left))}
body.lesson{padding-top:max(10px,env(safe-area-inset-top));padding-bottom:max(20px,env(safe-area-inset-bottom))}
main{max-width:560px;margin:0 auto;display:flex;flex-direction:column;gap:16px}
h1{font-size:1.75rem;font-weight:900;margin:0;line-height:1.35;text-wrap:balance}
h2{font-size:1.25rem;font-weight:900;margin:0;line-height:1.45}
p{margin:0}
.muted{color:var(--muted)} .small{font-size:.86rem} .center{text-align:center}
::selection{background:var(--red-soft)}

.hy{font-family:var(--f-hy);font-weight:700;direction:ltr;text-align:left;line-height:1.3}
.hy.big{font-size:2.6rem;font-weight:800}
.hy.mid{font-size:1.4rem}
.lat{font-family:var(--f-lat);font-weight:800;font-size:.9rem;color:var(--muted);direction:ltr;text-align:left}
.pr{font-size:.98rem;color:var(--ink-2);font-weight:600}

/* wordmark */
.brand{display:inline-flex;align-items:center;gap:7px;font-weight:900;font-size:1.35rem;color:var(--red);line-height:1}
.brand::before{content:"";width:12px;height:12px;border-radius:50%;background:var(--red);box-shadow:inset -2px -2px 0 var(--red-d)}

/* ---------- buttons: solid, with a ledge; pressing sinks them into it ---------- */
button{font:800 1.02rem var(--f-ui);border-radius:var(--r-m);border:2px solid var(--line);background:var(--surface);color:var(--ink-2);
  padding:11px 18px;cursor:pointer;min-height:52px;box-shadow:0 4px 0 var(--line-2);
  transition:transform .08s ease,box-shadow .08s ease,background .15s,border-color .15s,color .15s;-webkit-user-select:none;user-select:none;touch-action:manipulation}
button:active:not([disabled]){transform:translateY(4px);box-shadow:0 0 0 var(--line-2)}
button.primary,button.green,button.sky,button.apr{border:0;color:#fff;padding:13px 20px}
button.primary{background:var(--red);box-shadow:0 4px 0 var(--red-d)}
button.green{background:var(--grn);box-shadow:0 4px 0 var(--grn-d)}
button.sky{background:var(--sky);box-shadow:0 4px 0 var(--sky-d)}
button.apr{background:var(--apr);box-shadow:0 4px 0 var(--apr-d)}
@media (prefers-color-scheme:dark){button.green{box-shadow:0 4px 0 #1f7a36}button.sky{box-shadow:0 4px 0 #0f6a9b}button.apr{box-shadow:0 4px 0 #b86a00;color:#2a1700}}
button.ghost{background:transparent;border:0;box-shadow:none;color:var(--sky-d);min-height:44px}
button.ghost:active:not([disabled]){transform:none;opacity:.6}
button.wide{width:100%}
button.big{min-height:58px;font-size:1.12rem}
button.small{min-height:40px;padding:6px 14px;font-size:.88rem;border-radius:12px;box-shadow:0 3px 0 var(--line-2)}
button.small.green,button.small.sky,button.small.primary{padding:8px 14px}
button.small:active:not([disabled]){transform:translateY(3px)}
button:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid var(--sky);outline-offset:2px}
button[disabled]{cursor:not-allowed;background:var(--off)!important;color:var(--off-ink)!important;border-color:var(--off)!important;box-shadow:0 4px 0 var(--off-d)!important}
/* listen buttons: blue squares with a speaker / a turtle (drawn, not emoji) */
button.snd{width:46px;height:46px;min-height:46px;padding:0;border-radius:14px;border:0;font-size:0;background:var(--sky);color:#fff;box-shadow:0 4px 0 var(--sky-d);position:relative}
button.snd::before{content:"";position:absolute;inset:0;margin:auto;width:24px;height:24px;background:currentColor;
  -webkit-mask:var(--i-spk) center/contain no-repeat;mask:var(--i-spk) center/contain no-repeat}
button.snd[data-slow]{background:var(--surface);color:var(--sky);border:2px solid var(--line);box-shadow:0 4px 0 var(--line-2)}
button.snd[data-slow]::before{-webkit-mask-image:var(--i-slow);mask-image:var(--i-slow);width:26px;height:26px}
button.snd[data-lang="fa"]{background:var(--surface);color:var(--sky);border:2px solid var(--line);box-shadow:0 4px 0 var(--line-2)}
.wi button.snd{width:40px;height:40px;min-height:40px;border-radius:12px}
.wi button.snd::before{width:21px;height:21px}
button.rec{animation:pulse 1s ease-in-out infinite}
@keyframes pulse{50%{filter:brightness(1.12)}}
:root{
  --i-spk:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 9.2h3.3L12 5v14l-4.7-4.2H4z' fill='%23000'/%3E%3Cpath d='M15.5 8.5a5 5 0 0 1 0 7M18.3 6a8.6 8.6 0 0 1 0 12' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E");
  --i-slow:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M2.8 16.2a7.6 6.8 0 0 1 15.2 0z'/%3E%3Ccircle cx='20' cy='13.4' r='2.4'/%3E%3Cpath d='M17 14.6h2v1.6h-2zM4.6 16h3.2v3.2H4.6zM12.8 16H16v3.2h-3.2zM1.2 15.2l1.8.6v.8l-1.8-.2z'/%3E%3C/svg%3E");
  --i-mic:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='8.5' y='2.5' width='7' height='12' rx='3.5' fill='%23000'/%3E%3Cpath d='M5.5 11a6.5 6.5 0 0 0 13 0M12 17.5V21' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E");
  --i-kb:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='2.5' y='6' width='19' height='12' rx='2.5' fill='none' stroke='%23000' stroke-width='2'/%3E%3Cpath d='M6 10h.01M9.5 10h.01M13 10h.01M16.5 10h1.5M6 13.5h.01M8.5 14h7' stroke='%23000' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E");
  --i-bulb:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 17.5h6M10 21h4M12 3a6 6 0 0 0-3.5 10.9c.6.5 1 1.2 1 2V16h5v-.1c0-.8.4-1.5 1-2A6 6 0 0 0 12 3z' fill='none' stroke='%23000' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.row{display:flex;flex-wrap:wrap;gap:10px;align-items:center}
.grow{flex:1}

/* ---------- surfaces: white with a border and a ledge ---------- */
.card{background:var(--surface);border:2px solid var(--line);box-shadow:0 4px 0 var(--line);border-radius:var(--r-l);padding:18px;display:flex;flex-direction:column;gap:12px}
button.card{box-shadow:0 4px 0 var(--line-2)}
.note{background:var(--sunk);border-radius:var(--r-m);padding:12px 14px;font-size:.96rem}
.fb{border-radius:var(--r-m);padding:12px 14px;font-weight:800;border:2px solid transparent}
.fb.ok{background:var(--grn-soft);color:var(--grn-d);border-color:color-mix(in srgb,var(--grn) 35%,transparent)}
.fb.bad{background:var(--red-soft);color:var(--red-d);border-color:color-mix(in srgb,var(--red) 30%,transparent)}
@media (prefers-color-scheme:dark){.fb.bad,.opts button.wrong,.dock .status.listen,.dock .status.err,.pill.bad{color:#ff9aab!important}}
.pill{display:inline-flex;align-items:center;gap:6px;font-size:.82rem;font-weight:800;padding:4px 12px;border-radius:10px;background:var(--fill);color:var(--muted)}
.pill.ok{background:var(--grn-soft);color:var(--grn-d)}
.pill.new{background:var(--apr-soft);color:var(--apr-d);font-family:var(--f-hy);cursor:pointer;direction:ltr}
.pill.smart{font-family:var(--f-ui);direction:rtl;cursor:default;align-self:flex-start}

/* mascot + speech bubble (the picture itself is hidden; the one live Nara stands on the bubble) */
.say{display:flex;align-items:flex-end;gap:10px}
.bubble{position:relative;background:var(--surface);border:2px solid var(--line);box-shadow:0 4px 0 var(--line);
  border-radius:20px;padding:13px 16px;font-weight:700;flex:1}
.nur{flex:none;overflow:visible}

/* ---------- app bar (top) ---------- */
.topbar{position:sticky;top:0;z-index:6;display:flex;align-items:center;justify-content:space-between;gap:8px;
  margin:0 calc(-1 * max(16px,env(safe-area-inset-left)));padding:max(10px,env(safe-area-inset-top)) max(16px,env(safe-area-inset-left)) 10px;
  background:var(--bg);border-bottom:2px solid var(--line)}
.chips{display:flex;gap:4px}
.chip{display:inline-flex;align-items:center;gap:5px;font-weight:900;font-size:1rem;padding:6px 9px;border-radius:12px;font-family:var(--f-ui)}
.chip svg{width:22px;height:22px;flex:none}
.chip.fire{color:var(--apr)} .chip.xp{color:var(--sky)} .chip.lvl{color:var(--red)}
.chip.off{color:var(--off-ink)}

/* home hero: Yerevan at dusk; Nara stands on it */
.yvn{position:relative;border-radius:var(--r-xl);overflow:hidden;margin:0;background:#f8c9b8;border:2px solid var(--line);box-shadow:0 4px 0 var(--line)}
.yvn svg.scene,.yvn img.scene{display:block;width:100%;height:auto}
.yvn::after{content:"";position:absolute;inset:auto 0 0 0;height:60%;background:linear-gradient(to top,rgba(60,14,32,.5),transparent);pointer-events:none}
.yvn .topbar{position:absolute;inset:12px 12px auto 12px;z-index:1;background:none;border:0;margin:0;padding:0}
.yvn .hello{position:absolute;inset:auto 18px 14px auto;color:#fff;text-shadow:0 1px 8px rgba(60,12,30,.45);text-align:right;z-index:1}
.yvn .hello b{display:block;font-size:1.6rem;font-weight:900;line-height:1.2}
.yvn .hello span{font-weight:700;opacity:.95}
.yvn .hello .hi{display:block;text-align:right;color:#fff;font-size:1rem;font-weight:800;opacity:.95}

/* progress bars: thick, rounded, with a light stripe on top */
.bar,.gbar{height:16px;border-radius:99px;background:var(--fill-2);overflow:hidden;flex:none;position:relative}
.bar>i,.gbar>i{display:block;height:100%;border-radius:99px;background:var(--grn);transition:width .45s cubic-bezier(.34,1.3,.64,1);position:relative;min-width:16px}
.bar>i::after,.gbar>i::after{content:"";position:absolute;left:8px;right:8px;top:4px;height:4px;border-radius:9px;background:rgba(255,255,255,.35)}
.gbar>i{background:var(--apr)}
.goal{display:flex;align-items:center;gap:12px}

/* ---------- the learning path ---------- */
.unit{background:var(--red);color:#fff;border-radius:var(--r-l);padding:16px 18px;display:flex;align-items:center;justify-content:space-between;gap:12px;box-shadow:0 5px 0 var(--red-d)}
.unit h2{color:#fff;font-size:1.3rem} .unit p{opacity:.92;font-size:.92rem;font-weight:700}
.unit button{background:rgba(255,255,255,.16);border:2px solid rgba(255,255,255,.35);color:#fff;box-shadow:0 4px 0 rgba(0,0,0,.18);min-height:48px;width:52px;padding:0;flex:none}
.unit button .ico{width:26px;height:26px}
.path{display:flex;flex-direction:column;align-items:center;gap:22px;padding:22px 0 6px;position:relative}
.node-wrap{display:flex;flex-direction:column;align-items:center;gap:6px;position:relative;z-index:1}
.node{width:76px;height:70px;border-radius:50%;display:grid;place-items:center;padding:0;border:0;position:relative;
  background:var(--off);color:var(--off-ink);box-shadow:0 7px 0 var(--off-d)}
.node:active:not([disabled]){transform:translateY(7px);box-shadow:0 0 0 var(--off-d)}
.node .ico{width:34px;height:34px;stroke-width:2.6}
.node.done{background:var(--apr);color:#fff;box-shadow:0 7px 0 var(--apr-d)}
.node.cur{background:var(--red);color:#fff;box-shadow:0 7px 0 var(--red-d)}
.node.open{background:var(--sky);color:#fff;box-shadow:0 7px 0 var(--sky-d)}
.node.done:active,.node.cur:active,.node.open:active{box-shadow:0 0 0 transparent}
.node[disabled]{background:var(--off)!important;color:var(--off-ink)!important;box-shadow:0 7px 0 var(--off-d)!important;opacity:1}
.node-wrap.cur::before{content:"";position:absolute;top:-9px;width:94px;height:94px;border-radius:50%;border:7px solid var(--fill-2);pointer-events:none}
.node-wrap.cur .ring{position:absolute;top:-9px;width:94px;height:94px;pointer-events:none;transform:rotate(-90deg)}
.node-wrap.cur .ring circle{fill:none;stroke:var(--red);stroke-width:7;stroke-linecap:round}
.node-wrap .lbl{font-weight:900;font-size:.95rem;margin-top:6px}
.node-wrap .sub{font-size:.78rem;color:var(--muted);margin-top:-8px;font-weight:700}
.start-tip{position:absolute;top:-52px;background:var(--surface);border:2px solid var(--line);border-radius:12px;padding:3px 14px;font-weight:900;color:var(--red);white-space:nowrap;
  box-shadow:0 3px 0 var(--line);animation:tip 1.4s ease-in-out infinite;z-index:2}
.start-tip::after{content:"";position:absolute;left:50%;bottom:-7px;width:11px;height:11px;background:var(--surface);border:2px solid var(--line);border-top:0;border-left:0;transform:translateX(-50%) rotate(45deg)}
@keyframes tip{50%{transform:translateY(-5px)}}
.ico{width:34px;height:34px;fill:none;stroke:currentColor;stroke-width:2.3;stroke-linecap:round;stroke-linejoin:round}

/* ---------- tab bar: fixed, full width, like a native app ---------- */
.tabs{position:fixed;left:0;right:0;bottom:0;z-index:8;background:var(--surface);border-top:2px solid var(--line);
  display:flex;justify-content:center;padding:6px max(10px,env(safe-area-inset-left)) max(6px,env(safe-area-inset-bottom))}
.tabs button{border:2px solid transparent;background:transparent;box-shadow:none;min-height:56px;flex:1;max-width:108px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0;
  padding:3px 2px;font-size:.7rem;font-weight:800;color:var(--muted);border-radius:14px;margin:0 2px}
.tabs button:active:not([disabled]){transform:scale(.94);box-shadow:none}
.tabs svg{width:28px;height:28px}
.tabs .t-line{fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.tabs .t-fill{fill:transparent}
.tabs button.on{color:var(--red);background:var(--red-soft);border-color:color-mix(in srgb,var(--red) 40%,transparent)}
.tabs button.on .t-fill{fill:currentColor;opacity:.25}

/* ---------- lesson chrome ---------- */
.top{display:flex;align-items:center;gap:14px;min-height:48px}
#back{width:40px;height:40px;min-height:40px;padding:0;border:0;box-shadow:none;background:transparent;font-size:1.35rem;color:var(--off-ink);font-weight:900}
#back:active{transform:scale(.9)}
#skip{min-height:34px;padding:2px 12px;font-size:.8rem;box-shadow:0 3px 0 var(--line-2)}
.ltitle{font-weight:900;color:var(--ink-2);font-size:1.02rem}
.top .bar{flex:1}
.combo{font-weight:900;color:var(--apr);font-size:.9rem;margin:-10px 0 -6px;text-align:start;animation:pop .35s cubic-bezier(.34,1.56,.64,1)}
@keyframes pop{from{transform:scale(.6);opacity:0}}
/* the action pinned at the bottom of a lesson screen */
.foot{position:sticky;bottom:0;z-index:4;margin:auto calc(-1 * max(16px,env(safe-area-inset-left))) 0;padding:14px max(16px,env(safe-area-inset-left)) max(16px,env(safe-area-inset-bottom));
  background:var(--bg);border-top:2px solid var(--line);display:flex;flex-direction:column;gap:10px}
body.lesson:has(.foot){padding-bottom:0}
body.lesson:has(.foot) main{min-height:calc(100dvh - max(10px,env(safe-area-inset-top)))}

/* word card */
.card.word{align-items:stretch;gap:10px}
.card.word .hy.big{font-size:2.8rem}

/* answer tiles */
.opts{display:flex;flex-direction:column;gap:12px}
.opts button,.roles button{text-align:right;font-weight:700;font-size:1.04rem;color:var(--ink);padding:13px 16px;min-height:56px}
.opts button.on,.choices button.on,.roles button.on,.scene.on{background:var(--sky-soft);border-color:var(--sky);color:var(--sky-d);box-shadow:0 4px 0 var(--sky)}
.opts button.right{background:var(--grn-soft)!important;border-color:var(--grn)!important;color:var(--grn-d)!important;box-shadow:0 4px 0 var(--grn)!important;opacity:1}
.opts button.wrong{background:var(--red-soft)!important;border-color:var(--red)!important;color:var(--red-d)!important;box-shadow:0 4px 0 var(--red)!important;opacity:1;animation:shake .4s}
.opts button[disabled]:not(.right):not(.wrong){background:var(--surface)!important;color:var(--muted)!important;border-color:var(--line)!important;box-shadow:0 4px 0 var(--line)!important;opacity:.6}
@keyframes shake{20%,60%{transform:translateX(-6px)}40%,80%{transform:translateX(6px)}}

/* ---------- feedback panel: full width, coloured, with an icon and one big button ---------- */
.sheet{position:fixed;left:0;right:0;bottom:0;padding:18px max(16px,env(safe-area-inset-left)) max(18px,env(safe-area-inset-bottom));z-index:20;
  animation:up .26s cubic-bezier(.2,.9,.3,1.05);max-height:86vh;overflow-y:auto}
.sheet>div{max-width:560px;margin:0 auto;display:flex;flex-direction:column;gap:10px}
.sheet.ok{background:var(--grn-soft);color:var(--ink)} .sheet.bad{background:var(--red-soft);color:var(--ink)}
.sheet h2{font-size:1.45rem;display:flex;align-items:center;gap:10px}
.sheet h2 .badge{width:36px;height:36px;border-radius:50%;display:grid;place-items:center;flex:none;background:var(--surface)}
.sheet h2 .badge svg{width:22px;height:22px;fill:none;stroke-width:3.4;stroke-linecap:round;stroke-linejoin:round}
.sheet.ok h2{color:var(--grn-d)} .sheet.ok .badge svg{stroke:var(--grn)}
.sheet.bad h2{color:var(--red-d)} .sheet.bad .badge svg{stroke:var(--red)}
@media (prefers-color-scheme:dark){.sheet.bad h2{color:#ff9aab}}
.sheet .ex,.nurans .ex{border-top:2px solid var(--line);padding-top:8px;display:flex;flex-direction:column;gap:4px}
.sheet .ghost{color:var(--ink-2)}
@keyframes up{from{transform:translateY(100%)}to{transform:none}}

/* inputs */
input[type=text]{font:700 1.1rem var(--f-hy);width:100%;padding:12px 16px;border-radius:var(--r-m);border:2px solid var(--line);background:var(--sunk);color:var(--ink);direction:ltr;text-align:left;min-height:54px;transition:border-color .15s,background .15s}
input[type=text]:focus{border-color:var(--sky);background:var(--surface);outline:0}
input.fa{font-family:var(--f-ui);direction:rtl;text-align:right}
input::placeholder{color:var(--muted);font-family:var(--f-ui);font-weight:600}
.row input[type=text]{flex:1;width:auto;min-width:0}
select{font:800 1rem var(--f-ui);padding:8px 12px;border-radius:var(--r-s);border:2px solid var(--line);background:var(--surface);color:var(--ink);box-shadow:0 3px 0 var(--line-2)}
label.set{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:8px 0;font-weight:700}
label.set+label.set{border-top:2px solid var(--line);padding-top:12px}
/* switches instead of checkboxes */
input[type=checkbox]{appearance:none;-webkit-appearance:none;width:50px;height:30px;border-radius:99px;background:var(--fill-2);position:relative;flex:none;cursor:pointer;margin:0;transition:background .2s}
input[type=checkbox]::after{content:"";position:absolute;top:3px;right:3px;width:24px;height:24px;border-radius:50%;background:#fff;box-shadow:0 2px 0 rgba(0,0,0,.12);transition:right .2s cubic-bezier(.34,1.4,.64,1)}
input[type=checkbox]:checked{background:var(--grn)}
input[type=checkbox]:checked::after{right:23px}

/* welcome */
.hero{display:flex;flex-direction:column;align-items:center;text-align:center;gap:12px;padding-top:12px}
.welcome .yvn{margin:0 0 4px}

.wordmark{font-weight:900;font-size:3.4rem;line-height:1;color:var(--red)}
.wordmark .hy{font-size:1.15rem;color:var(--muted);text-align:center;font-weight:800;letter-spacing:.04em;display:block;margin-top:8px}
.tagline{font-size:1.25rem;font-weight:900}
.choices{display:grid;grid-template-columns:repeat(2,1fr);gap:12px}
.choices button{min-height:88px;font-size:.94rem;line-height:1.45;color:var(--ink);border-radius:var(--r-l)}
.knowme{align-items:flex-start;text-align:right;gap:4px;cursor:pointer;font:inherit;color:inherit}

/* ---------- lesson complete ---------- */
.celebrate{display:flex;flex-direction:column;align-items:center;text-align:center;gap:14px;padding-top:28px;position:relative}
.celebrate h1{font-size:1.9rem;color:var(--apr)}
.seeds{position:fixed;inset:0;pointer-events:none;overflow:hidden;z-index:30}
.seeds i{position:absolute;top:38%;left:50%;width:10px;height:13px;border-radius:50% 50% 45% 45%;background:var(--red);opacity:0;animation:seed 1.4s cubic-bezier(.2,.7,.3,1) forwards}
.seeds i:nth-child(3n){background:var(--apr)} .seeds i:nth-child(4n){background:var(--sky)} .seeds i:nth-child(5n){background:var(--grn)}
@keyframes seed{0%{opacity:1;transform:translate(0,0) rotate(0)}100%{opacity:0;transform:translate(var(--x),var(--y)) rotate(var(--r))}}
.tiles{display:flex;gap:10px;justify-content:center;flex-wrap:nowrap;width:100%}
.tile{flex:1;max-width:150px;border-radius:16px;overflow:hidden;text-align:center;background:var(--apr);border:2px solid var(--apr);animation:pop .4s cubic-bezier(.34,1.56,.64,1) both}
.tile:nth-child(2){animation-delay:.12s} .tile:nth-child(3){animation-delay:.24s}
.tile b{display:block;color:#fff;font-size:.78rem;font-weight:900;padding:5px 6px 4px}
.tile span{display:flex;align-items:center;justify-content:center;gap:4px;font-size:1.35rem;font-weight:900;padding:10px 6px;color:var(--apr);background:var(--surface);border-radius:13px 13px 13px 13px;min-height:56px}
.tile.g{background:var(--grn);border-color:var(--grn)} .tile.g span{color:var(--grn)}
.tile.r{background:var(--red);border-color:var(--red)} .tile.r span{color:var(--red)}

/* words list */
.wl{display:flex;flex-direction:column;background:var(--surface);border:2px solid var(--line);box-shadow:0 4px 0 var(--line);border-radius:var(--r-l);overflow:hidden}
.wi{display:flex;align-items:center;gap:12px;padding:12px 14px;background:transparent}
.wi+.wi{border-top:2px solid var(--line)}
.wi .hy{font-size:1.2rem}
.wi .m{flex:1;color:var(--ink-2);font-weight:700;text-align:left}
.boxdots{display:flex;gap:3px}
.boxdots i{width:8px;height:14px;border-radius:3px;background:var(--fill-2)}
.boxdots i.on{background:var(--apr)}

/* profile */
.statgrid{display:grid;grid-template-columns:repeat(2,1fr);gap:12px}
.stat{border-radius:var(--r-l);padding:14px;display:flex;gap:10px;align-items:center;background:var(--surface);border:2px solid var(--line);box-shadow:0 4px 0 var(--line)}
.stat .si{font-size:1.6rem;line-height:1}
.stat b{display:block;font-size:1.3rem;font-weight:900;line-height:1.2}
.stat span{font-size:.8rem;color:var(--muted);font-weight:700}

/* ---------- conversation, ask Nara, translator ---------- */
.scenes{display:grid;grid-template-columns:repeat(2,1fr);gap:12px}
.scene{display:flex;flex-direction:column;align-items:center;gap:4px;min-height:92px;color:var(--ink);border-radius:var(--r-l)}
.scene .ic{font-size:1.8rem;line-height:1}
.roles{display:flex;flex-direction:column;gap:10px}
.chat{display:flex;flex-direction:column;gap:12px}
.msg{max-width:86%;border-radius:20px;padding:11px 14px;display:flex;flex-direction:column;gap:6px;border:2px solid var(--line);box-shadow:0 3px 0 var(--line)}
.msg.tutor{align-self:flex-end;background:var(--surface);border-end-start-radius:6px}
.msg.me{align-self:flex-start;background:var(--red-soft);border-color:color-mix(in srgb,var(--red) 22%,transparent);box-shadow:0 3px 0 color-mix(in srgb,var(--red) 22%,transparent);border-end-end-radius:6px}
.msg.me .hy{font-size:1.1rem}
.msg.me>div{unicode-bidi:plaintext;text-align:start}
.msg details summary{cursor:pointer;color:var(--sky-d);font-weight:800;list-style:none}
.msg details summary::-webkit-details-marker{display:none}
.nurans{max-width:96%}
.hint{border-top:2px solid var(--line);padding-top:10px}
.dock{position:sticky;bottom:0;margin:0 calc(-1 * max(16px,env(safe-area-inset-left)));padding:12px max(16px,env(safe-area-inset-left)) max(14px,env(safe-area-inset-bottom));display:flex;flex-direction:column;gap:10px;
  background:var(--bg);border-top:2px solid var(--line);z-index:4}
body:not(.lesson) .dock{bottom:calc(var(--tabh) + 2px + env(safe-area-inset-bottom));padding-bottom:12px}
.dock .mic-row{display:flex;align-items:center;justify-content:center;gap:22px}
.mic{width:84px;height:80px;min-height:80px;border-radius:50%;padding:0;font-size:0;color:#fff;border:0;background:var(--red);box-shadow:0 6px 0 var(--red-d);position:relative}
.mic::before,.askmic::before,.trbtn .ic::before,.dock .side::before{content:"";position:absolute;inset:0;margin:auto;background:currentColor;-webkit-mask:var(--i-mic) center/contain no-repeat;mask:var(--i-mic) center/contain no-repeat}
.mic::before{width:36px;height:36px}
.mic:active:not([disabled]){transform:translateY(6px);box-shadow:0 0 0 var(--red-d)}
.mic.rec,.trbtn.rec{animation:ring 1.2s ease-in-out infinite;opacity:1}
@keyframes ring{0%,100%{outline:0 solid rgba(232,52,78,.35)}50%{outline:14px solid rgba(232,52,78,0)}}
.dock .side{width:54px;height:54px;min-height:54px;padding:0;border-radius:50%;font-size:0;color:var(--ink-2);position:relative}
.dock .side::before{width:24px;height:24px}
.dock #hint::before,.dock #help::before{-webkit-mask-image:var(--i-bulb);mask-image:var(--i-bulb);color:var(--apr)}
.dock #kb::before{-webkit-mask-image:var(--i-kb);mask-image:var(--i-kb)}
.dock .status{text-align:center;font-size:.92rem;font-weight:800;color:var(--muted);min-height:1.5em}
.dock .status.listen{color:var(--red-d)} .dock .status.think,.dock .status.speak{color:var(--sky-d)}
.dock .status.turn{color:var(--ink);background:var(--apr-soft);border-radius:14px;padding:8px 14px;align-self:center}
.dock .status.err{color:var(--red-d)}
.mic.nudge{animation:ring 1.2s ease-in-out infinite}
/* thinking: three bouncing seeds; a caret while the answer is being written */
.dots{display:inline-flex;gap:4px;margin-inline-start:6px;vertical-align:middle}
.dots i{width:8px;height:8px;border-radius:50%;background:var(--red);opacity:.35;animation:dot 1.1s ease-in-out infinite}
.dots i:nth-child(2){animation-delay:.15s;background:var(--apr)} .dots i:nth-child(3){animation-delay:.3s;background:var(--sky)}
@keyframes dot{0%,100%{transform:translateY(0);opacity:.35}40%{transform:translateY(-5px);opacity:1}}
.thinking{display:inline-flex;align-items:center;flex-wrap:wrap}
.note.live{white-space:pre-wrap}
.caret{display:inline-block;width:2px;height:1.1em;background:var(--red);margin-inline-start:2px;vertical-align:text-bottom;animation:blinkc .8s steps(1) infinite}
@keyframes blinkc{50%{opacity:0}}
.pill.sug,button.pill{font:700 .88rem var(--f-ui);min-height:38px;padding:5px 14px;cursor:pointer;text-align:right;border-radius:12px;color:var(--ink);box-shadow:0 3px 0 var(--line-2);border:2px solid var(--line);background:var(--surface)}
.pill.sug:active{transform:translateY(3px);box-shadow:none}
.pill.sug.on{background:var(--sky-soft);color:var(--sky-d);border-color:var(--sky);box-shadow:0 3px 0 var(--sky)}
.askbox{background:var(--surface);border:2px solid var(--line);box-shadow:0 4px 0 var(--line-2);border-radius:20px;padding:6px;flex-wrap:nowrap;position:sticky;bottom:calc(var(--tabh) + 14px + env(safe-area-inset-bottom));z-index:4}
.askbox input[type=text]{flex:1;border:0;background:transparent;min-height:46px;padding:8px 10px}
.askbox button.primary{border-radius:14px;min-height:46px;padding:8px 16px}
.askmic{width:46px;height:46px;min-height:46px;padding:0;border-radius:14px;font-size:0;background:var(--red);color:#fff;flex:none;border:0;box-shadow:0 4px 0 var(--red-d);position:relative}
.askmic::before{width:22px;height:22px}
.askmic.rec{animation:ring 1.2s ease-in-out infinite}
.card.drill{gap:6px;margin-top:12px}

/* translator */
.trhead{background:var(--sky);color:#fff;border-radius:var(--r-l);padding:16px 16px 14px;display:flex;flex-direction:column;gap:10px;position:relative;overflow:hidden;box-shadow:0 5px 0 var(--sky-d)}
.trhead h1{color:#fff;font-size:1.4rem}
.trhead p{opacity:.95;font-size:.9rem;font-weight:700}
.trhead .flags{position:absolute;inset:14px auto auto 14px;font-size:1.4rem;letter-spacing:4px}
.trscenes{display:flex;gap:8px;overflow-x:auto;padding:2px 2px 6px;scrollbar-width:none}
.trscenes::-webkit-scrollbar{display:none}
.trscenes .pill{flex:none;background:rgba(255,255,255,.16);color:#fff;border:2px solid rgba(255,255,255,.35);box-shadow:0 3px 0 rgba(0,0,0,.15)}
.trscenes .pill.on{background:#fff;color:var(--sky-d);border-color:#fff}
.trl .trfa{font-size:1.2rem;font-weight:900;line-height:1.6}
.trdock{gap:10px}
.trbtns{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.trbtn{min-height:92px;border-radius:22px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0;color:#fff;padding:8px;border:0}
.trbtn .ic{display:block;width:30px;height:30px;font-size:0;position:relative;margin-bottom:2px}
.trbtn small{font-weight:700;opacity:.95}
.trbtn.me{background:var(--red);box-shadow:0 5px 0 var(--red-d)}
.trbtn.them{background:var(--sky);box-shadow:0 5px 0 var(--sky-d)}
.trbtn:active:not([disabled]){transform:translateY(5px);box-shadow:none}
.trtools{justify-content:space-between}
.trtools label{display:flex;align-items:center;gap:8px;font-weight:700;color:var(--muted)}
.trtools input[type=checkbox]{width:42px;height:26px}
.trtools input[type=checkbox]::after{width:20px;height:20px}
.trtools input[type=checkbox]:checked::after{right:19px}
.showcard{position:fixed;inset:0;z-index:50;background:var(--bg);display:flex;flex-direction:column;justify-content:center;align-items:center;gap:28px;padding:24px}
.showcard .hy{font-size:clamp(2rem,9vw,3.4rem);font-weight:800;text-align:center;line-height:1.35}
.showcard #shx{position:absolute;top:max(14px,env(safe-area-inset-top));right:16px;width:44px;height:44px;min-height:44px;padding:0;border-radius:50%;font-size:1.2rem;color:var(--ink-2)}
.showcard .row{justify-content:center}
.toast{position:fixed;left:50%;top:max(14px,env(safe-area-inset-top));transform:translateX(-50%);background:var(--ink);color:var(--bg);
  padding:11px 18px;border-radius:16px;font-weight:800;font-size:.92rem;z-index:60;max-width:90vw;text-align:center;box-shadow:0 4px 0 rgba(0,0,0,.18);animation:drop .3s cubic-bezier(.2,.9,.3,1.2)}
@keyframes drop{from{transform:translate(-50%,-140%)}to{transform:translate(-50%,0)}}
.testmode{font-size:.84rem;color:var(--muted);text-align:center}

/* loading: shimmering placeholders shaped like the screen that is coming */
.skel{display:flex;flex-direction:column;gap:12px;width:100%}
.skel i{display:block;height:56px;border-radius:16px;background:linear-gradient(90deg,var(--fill) 0%,var(--fill-2) 50%,var(--fill) 100%) 0 0/200% 100%;animation:shim 1.2s linear infinite}
.skel i.t{height:26px;width:60%;border-radius:10px}
.skel i.c{height:120px;border-radius:20px}
@keyframes shim{to{background-position:-200% 0}}

@media (prefers-reduced-motion:reduce){.askmic.rec,.dots i,.caret,.mic.nudge,.start-tip,button.rec,.mic.rec,.trbtn.rec,.sheet,.seeds i,.toast,.skel i,.tile,.combo,.opts button.wrong{animation:none!important}.seeds{display:none}}
