/* Yalla Talk — look & feel */
:root {
  --bg: #FFF6EE;
  --card: #FFFFFF;
  --ink: #1E1B3A;
  --muted: #77738F;
  --line: #F0E6DC;
  --brand: #FF5A3C;
  --brand-2: #FF3D6E;
  --brand-soft: #FFE9E1;
  --good: #16A866;
  --good-soft: #E3F7EC;
  --warn: #E9930C;
  --warn-soft: #FFF1D9;
  --bad: #E9445A;
  --bad-soft: #FDE6E9;
  --sky: #4D74FF;
  --sky-soft: #E6ECFF;
  --violet: #8B5CF6;
  --r: 22px;
  --shadow: 0 1px 0 rgba(30, 27, 58, .04), 0 8px 24px -12px rgba(30, 27, 58, .18);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font-family: 'Rubik', -apple-system, 'Segoe UI', sans-serif;
  font-size: 16px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
  min-height: 100dvh;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
input { font: inherit; }
[dir="ltr"] { text-align: left; unicode-bidi: isolate; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }
h1, h2 { margin: 0; letter-spacing: -.01em; }
h1 { font-size: 26px; font-weight: 800; }
h2 { font-size: 21px; font-weight: 700; }
p { margin: 0; }

/* ---------- page layout ---------- */
#app { max-width: 540px; margin: 0 auto; min-height: 100dvh; }
.page { padding: calc(14px + var(--safe-t)) 18px calc(110px + var(--safe-b)); display: flex; flex-direction: column; gap: 14px; }
.page.center { align-items: center; text-align: center; justify-content: center; min-height: 100dvh; padding-bottom: 40px; }
.top { display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
.top .title { font-size: 28px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; letter-spacing: -.02em; }
.icon-btn { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: var(--card); box-shadow: var(--shadow); color: var(--ink); font-size: 24px; }
.icon-btn:active { transform: scale(.94); }

.card { background: var(--card); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); }
.hello h1 { font-size: 25px; }
.hello p { margin-top: 2px; }

/* ---------- buttons ---------- */
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 52px; padding: 12px 18px; border-radius: 16px; font-weight: 600; font-size: 17px; transition: transform .12s, filter .12s; }
.btn:active { transform: scale(.97); }
.btn.primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; box-shadow: 0 10px 22px -10px rgba(255, 70, 80, .7); }
.btn.ghost { background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.big { min-height: 58px; font-size: 18px; font-weight: 700; }
.btn.small { min-height: 40px; font-size: 15px; padding: 8px 12px; width: auto; }
.link { color: var(--muted); font-size: 15px; text-decoration: underline; text-underline-offset: 3px; padding: 8px; }
.row { display: flex; gap: 10px; }
.row.btns { margin-top: 14px; }
.row.btns .btn { flex: 1; }
.row.links { justify-content: center; gap: 18px; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 5px 11px; border-radius: 99px; background: var(--brand-soft); color: var(--brand); font-weight: 600; font-size: 13px; }
.pill.soft { background: #F4F1FF; color: var(--violet); }
.chip { align-self: flex-start; display: inline-block; padding: 4px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 600; background: #F2EFEA; color: var(--muted); }
.chip.trap { background: var(--warn-soft); color: #B56C00; }
.chip.work { background: var(--sky-soft); color: var(--sky); }
.chip.life { background: var(--good-soft); color: var(--good); }
.chip.talk { background: var(--brand-soft); color: var(--brand); }
.mini { background: #F5F1EC; border-radius: 99px; padding: 6px 11px; font-size: 13.5px; font-weight: 500; }
.mini:active { transform: scale(.95); }

/* ---------- home ---------- */
.streak { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; gap: 4px 14px; align-items: center; }
.flame { font-size: 40px; filter: grayscale(1) opacity(.45); grid-row: 1; }
.flame.lit { filter: none; animation: flick 2.4s ease-in-out infinite; }
@keyframes flick { 0%, 100% { transform: rotate(-3deg) scale(1); } 50% { transform: rotate(3deg) scale(1.06); } }
.streak-main b { font-size: 30px; font-weight: 800; }
.streak-main span { font-weight: 600; }
.freeze { font-size: 13px; color: var(--muted); }
.week { grid-column: 1 / -1; display: flex; justify-content: space-between; margin-top: 10px; padding-top: 12px; border-top: 1px dashed var(--line); }
.wd { display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); }
.wd i { width: 28px; height: 28px; border-radius: 10px; background: #F4EEE7; display: block; }
.wd.done i { background: linear-gradient(135deg, var(--brand), var(--brand-2)); box-shadow: 0 4px 10px -4px rgba(255, 70, 80, .7); }
.wd.frozen i { background: #CFE3FF; }
.wd.today i { box-shadow: inset 0 0 0 2px var(--brand); }

.hero { display: flex; flex-direction: column; gap: 14px; background: linear-gradient(160deg, #fff 55%, #FFF0EA); }
.hero-top { display: flex; gap: 8px; }
.plan { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.plan li { display: flex; gap: 12px; align-items: center; }
.plan b { display: block; font-weight: 600; }
.plan small { color: var(--muted); font-size: 13.5px; }
.dot { flex: none; width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-weight: 700; }
.d1 { background: var(--sky); } .d2 { background: var(--violet); } .d3 { background: var(--brand); }
.hero.done { align-items: center; text-align: center; background: linear-gradient(160deg, #fff 50%, var(--good-soft)); }
.done-badge { width: 60px; height: 60px; border-radius: 50%; background: var(--good); color: #fff; display: grid; place-items: center; animation: pop .5s cubic-bezier(.2, 1.6, .4, 1); }
.done-badge svg { width: 30px; height: 30px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stats.small { grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); width: 100%; }
.stat { background: var(--card); border-radius: 16px; padding: 12px 6px; text-align: center; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 22px; font-weight: 800; line-height: 1.1; }
.stat span { font-size: 12px; color: var(--muted); line-height: 1.2; display: block; margin-top: 3px; }
.cando p { margin-top: 8px; font-weight: 500; }

/* ---------- tab bar ---------- */
.tabbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 540px; display: flex; justify-content: space-around; padding: 8px 8px calc(8px + var(--safe-b)); background: rgba(255, 252, 248, .92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); z-index: 10; }
.tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0; font-size: 12px; color: #A7A2B8; font-weight: 500; }
.tabbar button.on { color: var(--brand); }
.tabbar button:active { transform: scale(.94); }

/* ---------- session ---------- */
.session { min-height: 100dvh; display: flex; flex-direction: column; padding: calc(10px + var(--safe-t)) 18px calc(20px + var(--safe-b)); }
.s-top { display: flex; align-items: center; gap: 12px; }
.segs { flex: 1; display: flex; gap: 6px; }
.seg { flex: 1; height: 8px; border-radius: 99px; background: #EEE5DB; overflow: hidden; }
.seg i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand-2), var(--brand)); border-radius: 99px; transition: width .4s; }
[dir="rtl"] .seg i { margin-right: 0; margin-left: auto; background: linear-gradient(270deg, var(--brand-2), var(--brand)); }
.s-label { text-align: center; font-size: 13.5px; color: var(--muted); font-weight: 600; margin: 8px 0 4px; min-height: 20px; }
.s-body { flex: 1; display: flex; flex-direction: column; }

.cardx { display: flex; flex-direction: column; gap: 14px; background: var(--card); border-radius: 26px; padding: 22px 18px; box-shadow: var(--shadow); margin-top: 6px; animation: rise .35s cubic-bezier(.2, .9, .3, 1.1); }
.cardx.center { align-items: center; text-align: center; padding: 34px 20px; }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.he-big { font-size: 27px; font-weight: 700; text-align: center; line-height: 1.3; padding: 18px 4px 4px; }
.he-mid { font-size: 20px; font-weight: 600; text-align: center; }
.en-big { font-size: 22px; font-weight: 600; line-height: 1.35; display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; text-align: center !important; background: #F8F5F1; border-radius: 16px; padding: 14px; width: 100%; }
.en-big .spk { color: var(--brand); display: inline-flex; }
.en-title { text-align: center !important; font-size: 22px; }
.said { font-size: 15.5px; padding: 10px 14px; background: #F8F5F1; border-radius: 14px; }
.said.again.good { background: var(--good-soft); }
.said.again.close, .said.again.wrong { background: var(--warn-soft); }
.said-big { font-size: 20px; font-weight: 500; background: var(--bad-soft); border-radius: 16px; padding: 14px; color: #8C2433; text-decoration: line-through; text-decoration-color: rgba(233, 68, 90, .45); }
.q { font-weight: 600; font-size: 17px; text-align: center; }
.answer { display: flex; flex-direction: column; gap: 10px; }
.result { display: flex; flex-direction: column; gap: 10px; border-radius: 20px; padding: 14px; animation: rise .3s; }
.result.good { background: var(--good-soft); }
.result.close { background: var(--warn-soft); }
.result.wrong { background: var(--bad-soft); }
.result .en-big { background: rgba(255, 255, 255, .75); }
.r-title { font-weight: 700; font-size: 18px; text-align: center; }
.tip { background: rgba(255, 255, 255, .8); border-radius: 14px; padding: 10px 12px; font-size: 15.5px; }
.cardx > .tip { background: #F7F3FF; }
.tip.soft { color: var(--muted); }
.alt { font-size: 14.5px; }
.score { font-size: 46px; font-weight: 800; text-align: center; line-height: 1; }
.score small { font-size: 18px; color: var(--muted); font-weight: 600; }
.diff { font-size: 20px; line-height: 1.6; text-align: center !important; }
.diff span, .legend span { padding: 1px 4px; border-radius: 6px; }
.diff .hit, .legend .hit { background: var(--good-soft); color: #0E7A49; }
.diff .low, .legend .low { background: var(--warn-soft); color: #A45F00; }
.diff .miss, .legend .miss { background: var(--bad-soft); color: #B42339; text-decoration: underline wavy; }
.legend { display: flex; gap: 10px; justify-content: center; font-size: 12.5px; }

/* thinking dots */
.thinking { display: flex; gap: 6px; justify-content: center; padding: 14px; }
.thinking i { width: 9px; height: 9px; border-radius: 50%; background: var(--brand); animation: bounce 1s infinite; }
.thinking i:nth-child(2) { animation-delay: .15s; } .thinking i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 80%, 100% { transform: translateY(0); opacity: .35; } 40% { transform: translateY(-7px); opacity: 1; } }

/* ---------- mic ---------- */
.mic-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 12px 0 4px; }
.mic { --lv: 0; position: relative; width: 86px; height: 86px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); box-shadow: 0 14px 30px -12px rgba(255, 60, 90, .8); transition: transform .15s; }
.mic svg { position: relative; z-index: 1; }
.mic:active { transform: scale(.94); }
.mic-ring { position: absolute; inset: -8px; border-radius: 50%; border: 3px solid var(--brand); opacity: 0; transform: scale(calc(1 + var(--lv) * .35)); transition: transform .08s linear; }
.mic.on { background: linear-gradient(135deg, #FF3D6E, #E0245E); }
.mic.on .mic-ring { opacity: .55; }
.mic.on::after { content: ''; position: absolute; inset: -16px; border-radius: 50%; background: rgba(255, 70, 100, .12); animation: breathe 1.6s ease-in-out infinite; }
.mic.wait { background: #C9C3D6; box-shadow: none; }
.mic.wait svg { animation: pulse 1s infinite; }
@keyframes breathe { 0%, 100% { transform: scale(.92); opacity: .5; } 50% { transform: scale(1.08); opacity: 1; } }
@keyframes pulse { 50% { opacity: .35; } }
.mic-label { font-weight: 600; color: var(--muted); font-size: 15px; text-align: center; }
.mic-hint { font-size: 13px; color: var(--muted); }
.type-box { display: flex; flex-direction: column; gap: 10px; }
.field { width: 100%; min-height: 52px; border-radius: 14px; border: 1.5px solid var(--line); background: #fff; padding: 12px 14px; font-size: 17px; outline: none; color: var(--ink); }
.field:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }

/* ---------- ear ---------- */
.play-big { align-self: center; width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; background: var(--sky-soft); color: var(--sky); margin: 8px 0; transition: transform .15s; }
.play-big svg { width: 38px; height: 38px; }
.play-big:active { transform: scale(.93); }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice { min-height: 74px; border-radius: 20px; background: #F8F5F1; font-size: 25px; font-weight: 700; box-shadow: inset 0 0 0 2px var(--line); transition: transform .12s, background .2s; text-align: center !important; }
.choice:active { transform: scale(.96); }
.choice.good { background: var(--good-soft); box-shadow: inset 0 0 0 2.5px var(--good); color: #0E7A49; animation: pop .35s; }
.choice.bad { background: var(--bad-soft); box-shadow: inset 0 0 0 2.5px var(--bad); color: #B42339; animation: shake .35s; }
.choice.he { font-size: 17px; font-weight: 500; min-height: 56px; text-align: right !important; padding: 12px 16px; }
.options { display: flex; flex-direction: column; gap: 10px; }
.pairs-demo { flex-wrap: wrap; justify-content: center; }
@keyframes pop { 0% { transform: scale(.85); } 60% { transform: scale(1.06); } 100% { transform: scale(1); } }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* ---------- conversation ---------- */
.scen { align-items: center; text-align: center; }
.scen-emoji { font-size: 46px; line-height: 1; }
.goal { background: var(--brand-soft); color: #B23A1F; border-radius: 14px; padding: 10px 14px; font-weight: 600; font-size: 15px; }
.goal.small { font-size: 13.5px; padding: 7px 12px; align-self: stretch; text-align: center; }
.howto { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; text-align: right; font-size: 14.5px; color: var(--muted); align-self: stretch; }
.call { height: calc(100dvh - 96px - var(--safe-t) - var(--safe-b)); display: flex; flex-direction: column; gap: 8px; min-height: 420px; }
.call-head { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 20px; padding: 12px 14px; box-shadow: var(--shadow); }
.call-head b { font-size: 17px; }
.status { font-size: 13.5px; }
.timer { margin-inline-start: auto; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--muted); }
.avatar { --hue: 20; position: relative; width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 22px; background: linear-gradient(135deg, hsl(var(--hue) 85% 62%), hsl(calc(var(--hue) + 40) 80% 52%)); flex: none; }
.avatar span { position: relative; z-index: 1; }
.avatar .pulse { position: absolute; inset: 0; border-radius: 50%; background: inherit; opacity: 0; }
.avatar.talking .pulse { animation: ring 1.2s ease-out infinite; }
@keyframes ring { 0% { transform: scale(1); opacity: .6; } 100% { transform: scale(1.7); opacity: 0; } }
.msgs { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px 2px 8px; -webkit-overflow-scrolling: touch; }
.msg { display: flex; flex-direction: column; max-width: 88%; gap: 4px; animation: rise .3s; }
.msg.ai { align-self: flex-start; }
.msg.me { align-self: flex-end; }
.bubble { padding: 11px 14px; border-radius: 20px; font-size: 17px; line-height: 1.4; }
.msg.ai .bubble { background: var(--card); box-shadow: var(--shadow); border-start-start-radius: 6px; cursor: pointer; }
.msg.me .bubble { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; border-start-end-radius: 6px; }
.tr { font-size: 14.5px; color: var(--muted); padding: 0 6px; }
.tr:empty { display: none; }
.msg-actions { display: flex; gap: 6px; }
.msg-actions .mini { padding: 4px 9px; font-size: 12.5px; }
.hints { flex: none; display: flex; flex-direction: column; gap: 6px; max-height: 32%; overflow-y: auto; }
.hints:empty { display: none; }
.hint-chip { display: flex; flex-direction: column; gap: 1px; background: #F4F1FF; border-radius: 14px; padding: 8px 12px; text-align: right; font-size: 15px; }
.hint-chip small { font-size: 13px; }
.hint-chip span { font-weight: 600; color: #5B3FD0; }
.hint-chip small { color: var(--muted); }
.call-ctrl { flex: none; display: flex; align-items: center; justify-content: space-around; padding: 6px 0 2px; }
.ctrl { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 72px; font-size: 13px; font-weight: 600; color: var(--muted); }
.ctrl svg { width: 48px; height: 48px; padding: 13px; border-radius: 50%; background: var(--card); box-shadow: var(--shadow); color: var(--ink); }
.ctrl.end.ready svg { background: var(--good); color: #fff; animation: pop .4s; }
.call[data-mode="speaking"] .call-mic, .call[data-mode="thinking"] .call-mic { background: #CFC9DB; box-shadow: none; }
.call[data-mode="listening"] .call-mic { background: linear-gradient(135deg, #FF3D6E, #E0245E); }
.call[data-mode="listening"] .call-mic .mic-ring { opacity: .55; }
.call[data-mode="listening"] .call-mic::after { content: ''; position: absolute; inset: -16px; border-radius: 50%; background: rgba(255, 70, 100, .12); animation: breathe 1.6s ease-in-out infinite; }

/* ---------- finish & feedback ---------- */
.finish { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; padding-top: 8vh; }
.big-emoji { font-size: 64px; line-height: 1; }
.big-emoji.pop { animation: pop .6s cubic-bezier(.2, 1.6, .4, 1); font-size: 84px; }
.big-emoji.bob { animation: bob 1.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-8px) rotate(-4deg); } }
.praise { font-size: 17px; font-weight: 500; text-align: center; background: var(--good-soft); border-radius: 16px; padding: 12px 14px; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 50; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 3px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(720deg); } }

/* ---------- listening ---------- */
.player { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.bar { width: 100%; height: 8px; border-radius: 99px; background: #EEE5DB; overflow: hidden; direction: ltr; }
.bar i { display: block; height: 100%; width: 0; background: var(--sky); }
.clip-text { background: #F8F5F1; border-radius: 16px; padding: 14px; font-size: 16.5px; line-height: 1.6; }
.spin { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--sky-soft); border-top-color: var(--sky); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- talks tab ---------- */
.scen-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.scen-card { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; text-align: right; padding: 16px; position: relative; transition: transform .12s; }
.scen-card:active { transform: scale(.97); }
.scen-card b { display: block; font-size: 15.5px; line-height: 1.3; }
.scen-card small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.3; margin-top: 3px; }
.scen-card .scen-emoji { font-size: 32px; }
.scen-card.free { flex-direction: row; align-items: center; gap: 14px; background: linear-gradient(135deg, #FFF0EA, #FFE4EC); }
.scen-card.free b { font-size: 17px; }
.done-n { position: absolute; top: 10px; left: 12px; font-size: 12px; color: var(--good); font-weight: 700; }

/* ---------- notebook ---------- */
.filters { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.filters button { flex: none; padding: 8px 14px; border-radius: 99px; background: var(--card); box-shadow: inset 0 0 0 1.5px var(--line); font-size: 14px; font-weight: 500; }
.filters button.on { background: var(--ink); color: #fff; box-shadow: none; }
.nb { display: flex; flex-direction: column; gap: 8px; }
.nb-row { display: flex; gap: 12px; align-items: flex-start; background: var(--card); border-radius: 18px; padding: 14px; box-shadow: var(--shadow); }
.nb-play { flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; }
.nb-text { flex: 1; min-width: 0; }
.nb-text .en { font-weight: 600; font-size: 16.5px; }
.nb-text .he { color: var(--muted); font-size: 14.5px; }
.nb-text .was { color: #B42339; font-size: 13px; text-decoration: line-through; opacity: .75; }
.nb-text .meta { font-size: 12px; color: var(--muted); margin-top: 4px; }
.lvl { color: var(--brand); letter-spacing: 1px; margin-inline-end: 6px; }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; }

/* ---------- progress ---------- */
.sec-title { font-weight: 700; margin-bottom: 12px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal i { aspect-ratio: 1; border-radius: 8px; background: #F4EEE7; display: block; }
.cal i.done { background: #FFB4A0; }
.cal i.done.plus { background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.cal i.frozen { background: #CFE3FF; }
.cal i.today { box-shadow: inset 0 0 0 2px var(--ink); }
.legend.done, .legend .done, .legend .plus, .legend .frozen { color: var(--muted); }
.legend .done::before, .legend .plus::before, .legend .frozen::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 4px; vertical-align: -1px; }
.legend .done::before { background: #FFB4A0; } .legend .plus::before { background: var(--brand); } .legend .frozen::before { background: #CFE3FF; }
.card .legend { margin-top: 10px; }
.bars { display: flex; align-items: flex-end; gap: 5px; height: 110px; direction: ltr; }
.bars .b { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.bars .b i { width: 100%; border-radius: 6px 6px 3px 3px; background: linear-gradient(180deg, var(--brand), var(--brand-2)); display: block; min-height: 3px; }
.bars .b span { font-size: 10px; color: var(--muted); }
.hbar { display: grid; grid-template-columns: 96px 1fr 42px; align-items: center; gap: 10px; margin: 8px 0; font-size: 14px; }
.hbar > div { height: 10px; background: #F4EEE7; border-radius: 99px; overflow: hidden; }
.hbar i { display: block; height: 100%; border-radius: 99px; }
.hbar i.g { background: var(--good); } .hbar i.y { background: var(--warn); } .hbar i.r { background: var(--bad); }
.hbar b { font-size: 13px; text-align: left; }
.cando-list { margin: 0; padding-inline-start: 20px; display: flex; flex-direction: column; gap: 6px; }
.recs { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.rec-item { display: flex; align-items: center; gap: 10px; background: #F8F5F1; border-radius: 14px; padding: 10px 14px; font-weight: 500; }
.rec-item svg { color: var(--brand); }
.prompt-en { background: #F4F1FF; color: #4B32B8; border-radius: 16px; padding: 14px; font-size: 18px; font-weight: 600; text-align: center !important; }

/* ---------- sheet ---------- */
.sheet-bg { position: fixed; inset: 0; background: rgba(20, 16, 40, 0); z-index: 40; display: flex; align-items: flex-end; justify-content: center; transition: background .3s; }
.sheet-bg.show { background: rgba(20, 16, 40, .38); }
.sheet { width: 100%; max-width: 540px; max-height: 88dvh; overflow-y: auto; background: var(--bg); border-radius: 28px 28px 0 0; padding: 10px 20px calc(24px + var(--safe-b)); display: flex; flex-direction: column; gap: 10px; transform: translateY(100%); transition: transform .32s cubic-bezier(.2, .9, .3, 1); }
.sheet-bg.show .sheet { transform: none; }
.grab { width: 44px; height: 5px; border-radius: 99px; background: #DDD3C8; align-self: center; margin-bottom: 6px; }
.sheet label { font-weight: 600; font-size: 14.5px; margin-top: 6px; }
.opts { display: flex; flex-direction: column; gap: 8px; }
.opts.row2 { flex-direction: row; flex-wrap: wrap; }
.opts.row2 button { flex: 1 1 40%; }
.opts button { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--card); border-radius: 14px; padding: 12px 14px; box-shadow: inset 0 0 0 1.5px var(--line); font-weight: 500; text-align: right; }
.opts.row2 button { justify-content: center; text-align: center; }
.opts button.on { box-shadow: inset 0 0 0 2.5px var(--brand); background: var(--brand-soft); }
.opts .spk { color: var(--brand); display: inline-flex; }
.opts.col button { min-height: 58px; font-size: 17px; justify-content: center; }
.note { background: #F4F1FF; border-radius: 14px; padding: 12px; font-size: 14px; }

/* ---------- onboarding ---------- */
.onboard { min-height: 100dvh; justify-content: center; }
.ob { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 16px; }
.ob h1 { font-size: 30px; }
.lead { font-size: 19px; font-weight: 500; }
.logo.big { filter: drop-shadow(0 16px 28px rgba(255, 70, 90, .35)); }
.ob-list { list-style: none; margin: 8px 0; padding: 0; display: flex; flex-direction: column; gap: 12px; text-align: right; width: 100%; }
.ob-list li { display: flex; gap: 14px; align-items: center; background: var(--card); border-radius: 18px; padding: 14px; box-shadow: var(--shadow); }
.ob-list span { font-size: 28px; }
.ob-list b { display: block; }
.ob-list small { color: var(--muted); font-size: 13.5px; }
.ob .opts { width: 100%; }
.ob .answer { width: 100%; }
.steps { text-align: right; display: flex; flex-direction: column; gap: 10px; background: var(--card); border-radius: 18px; padding: 16px 34px 16px 16px; margin: 0; box-shadow: var(--shadow); width: 100%; }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: calc(96px + var(--safe-b)); transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 14px; font-size: 15px; opacity: 0; transition: .3s; z-index: 60; max-width: 90vw; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- login & account ---------- */
.login { gap: 12px; }
.login-box { width: 100%; display: flex; flex-direction: column; gap: 8px; text-align: right; margin-top: 14px; }
.login-box label { font-weight: 600; font-size: 14.5px; }
.login-box .btn { margin-top: 8px; }
.login-box p { text-align: center; margin-top: 6px; }
.acct { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 14px; padding: 12px 14px; box-shadow: inset 0 0 0 1.5px var(--line); font-size: 14px; }
.acct .btn { flex: none; }
