/* ============ English House – modern, flat, dark-first design ============ */
/* Dark is the default theme. One accent colour (emerald). No gradients. */
:root, [data-theme="dark"] {
  --bg: #0e1116;            /* page */
  --surface: #161a21;       /* bars, lists */
  --surface-2: #1d222b;     /* bubbles, inputs */
  --surface-3: #262c37;     /* pressed / borders */
  --line: #252b35;
  --text: #e7e9ee;
  --muted: #8b93a1;
  --accent: #10b981;
  --accent-text: #34d399;
  --accent-soft: rgba(16, 185, 129, .14);
  --out: #12372d;           /* my message */
  --tick: #60a5fa;
  --good: #34d399;
  --bad: #f87171;
  --warn: #fbbf24;
  --notice-bg: rgba(251, 191, 36, .10);
  --notice-text: #f3d48b;
  --on-accent: #04140e;
  --fs: 16px;
  --radius: 16px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, "Noto Sans Malayalam", "Manjari", sans-serif;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f4f5f7; --surface: #ffffff; --surface-2: #ffffff; --surface-3: #eceef2; --line: #e5e7eb;
  --text: #111418; --muted: #5f6672; --accent: #059669; --accent-text: #047857; --accent-soft: rgba(5, 150, 105, .10);
  --out: #dcf5ea; --tick: #2563eb; --good: #047857; --bad: #dc2626; --warn: #b45309;
  --notice-bg: #fff7e0; --notice-text: #7a5a00; --on-accent: #ffffff;
  color-scheme: light;
}
[data-size="large"] { --fs: 17.5px; }
[data-size="xl"] { --fs: 19px; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: var(--fs); line-height: 1.5; -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; }
body.with-tabs { padding-bottom: calc(68px + var(--safe-b)); }
body.has-player { padding-bottom: calc(80px + var(--safe-b)); }
body.with-tabs.has-player { padding-bottom: calc(146px + var(--safe-b)); }
#app { max-width: 720px; margin: 0 auto; min-height: 100vh; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg { width: 22px; height: 22px; fill: currentColor; display: block; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* ---------- splash ---------- */
.splash { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 6px; color: var(--muted); }
.splash img { border-radius: 22px; }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 20; background: var(--bg); }
.appbar { display: flex; align-items: center; gap: 10px; min-height: 60px; padding: calc(8px + var(--safe-t)) 10px 8px 16px;
  background: var(--bg); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top .appbar { border-bottom: 0; }
.ab-t { flex: 1; min-width: 0; }
.ab-title { font-size: 1.15rem; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ab-sub { font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ab-ic { width: 40px; height: 40px; border: 0; border-radius: 12px; background: transparent; color: var(--text); display: grid; place-items: center; flex: none; }
.ab-ic:active { background: var(--surface-2); }
.appbar > .ab-ic:first-child { margin-left: -8px; }
.appbar .av { width: 40px; height: 40px; font-size: .95rem; border-radius: 12px; }

/* step switcher (segmented control) */
.tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 2px 12px 10px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.tab { text-align: center; font-weight: 600; font-size: .82rem; color: var(--muted); padding: 8px 2px; border-radius: 10px; }
.tab.on { background: var(--surface-3); color: var(--text); }
.tab.ok::after { content: " ✓"; color: var(--accent-text); }
.top:has(.tabs) { border-bottom: 1px solid var(--line); }

/* ---------- avatars (rounded squares) ---------- */
.av { width: 48px; height: 48px; border-radius: 14px; flex: none; display: grid; place-items: center; font-weight: 700; font-size: 1.05rem; background: var(--surface-2); color: var(--text); }
.av svg { width: 20px; height: 20px; }
.av.day { background: var(--accent-soft); color: var(--accent-text); }
.av.done { background: var(--accent); color: var(--on-accent); }
.av.locked { background: var(--surface-2); color: var(--muted); }
.av.review { background: rgba(96, 165, 250, .15); color: var(--tick); }
.av.partner { background: rgba(248, 113, 113, .15); color: var(--bad); }
.av.me { background: var(--accent); color: var(--on-accent); }
.av.big { width: 64px; height: 64px; font-size: 1.5rem; border-radius: 20px; }

/* ---------- home ---------- */
.strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 14px 16px 6px; }
.strip span { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 8px; text-align: center; font-size: .78rem; color: var(--muted); line-height: 1.25; }
.strip b { display: block; font-size: 1.2rem; color: var(--text); margin-bottom: 2px; }
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin: 12px 12px; overflow: hidden; }
.list-h { padding: 18px 28px 6px; font-size: .75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.list > .list-h { padding: 14px 16px 6px; }
.crow { display: flex; align-items: center; gap: 14px; padding: 0 0 0 14px; }
.crow:active:not(.static) { background: var(--surface-2); }
.crow .av { margin: 10px 0; }
.cr-body { flex: 1; min-width: 0; padding: 12px 14px 12px 0; border-bottom: 1px solid var(--line); }
.crow:last-child .cr-body { border-bottom: 0; }
.cr-top, .cr-bot { display: flex; align-items: center; gap: 8px; }
.cr-name { flex: 1; min-width: 0; font-size: 1rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cr-time { font-size: .75rem; color: var(--muted); flex: none; }
.cr-time.unread { color: var(--accent-text); font-weight: 600; }
.cr-bot { margin-top: 2px; }
.cr-prev { flex: 1; min-width: 0; font-size: .88rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 4px; }
.cr-prev.wrap { white-space: normal; display: block; }
.cr-prev svg { width: 15px; height: 15px; flex: none; }
.cr-prev .mic { color: var(--accent-text); } .cr-prev .mic.heard { color: var(--tick); }
.crow.locked { opacity: .5; }
.badge { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--accent); color: var(--on-accent); font-size: .74rem; font-weight: 700; display: grid; place-items: center; flex: none; }
.pin { color: var(--muted); } .pin svg { width: 15px; height: 15px; }
.ticks { display: inline-flex; color: var(--tick); vertical-align: middle; margin-left: 3px; }
.ticks svg { width: 16px; height: 11px; }
.fab { position: fixed; right: max(18px, calc(50% - 342px)); bottom: calc(84px + var(--safe-b)); z-index: 15; height: 54px; padding: 0 20px 0 16px; border-radius: 18px;
  background: var(--accent); color: var(--on-accent); display: flex; align-items: center; gap: 8px; font-weight: 700; }
.fab::after { content: "Continue"; }
.has-player .fab { bottom: calc(152px + var(--safe-b)); }

/* ---------- conversation ---------- */
.chat { background: var(--bg); padding: 10px 0 24px; min-height: calc(100vh - 130px); }
.msg { display: flex; padding: 2px 12px; }
.msg.in { justify-content: flex-start; }
.msg.out { justify-content: flex-end; }
.msg.tail { margin-top: 10px; }
.bubble { position: relative; max-width: min(86%, 560px); background: var(--surface-2); border: 1px solid var(--line); border-radius: 18px; padding: 9px 13px 8px; word-wrap: break-word; overflow-wrap: anywhere; }
.msg.in.tail .bubble { border-top-left-radius: 6px; }
.msg.out .bubble { background: var(--out); border-color: transparent; }
.msg.out.tail .bubble { border-top-right-radius: 6px; }
.meta { float: right; position: relative; top: 6px; margin: 0 -3px 0 12px; font-size: .68rem; color: var(--muted); white-space: nowrap; display: inline-flex; align-items: center; line-height: 1.6; }
.bubble::after { content: ""; display: block; clear: both; }
.sys { text-align: center; margin: 16px 0 8px; }
.sys span, .sys a, .sys button { display: inline-block; color: var(--muted); font-size: .72rem; font-weight: 700; letter-spacing: .08em; padding: 4px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.sys.go a, .sys.go button { color: var(--on-accent); background: var(--accent); border: 0; font-size: .92rem; font-weight: 700; letter-spacing: 0; padding: 11px 22px; border-radius: 14px; margin-top: 4px; }
.notice { margin: 10px 16px; padding: 10px 14px; background: var(--notice-bg); color: var(--notice-text); border-radius: 12px; font-size: .84rem; text-align: center; }
.notice.flat { margin: 10px 12px; }

/* lesson text */
.note .ln { min-height: .55em; }
.note .ln.good { color: var(--good); }
.note .ln.bad { color: var(--bad); }
.note strong { font-weight: 700; }
.note hr { border: 0; border-top: 1px solid var(--line); margin: 8px 0; }
.collapsed { max-height: 380px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 75%, transparent); mask-image: linear-gradient(#000 75%, transparent); }
.readmore { border: 0; background: none; color: var(--accent-text); font-weight: 600; padding: 4px 0 0; }
.hide-ml .note .ml { filter: blur(5px); cursor: pointer; }
.hide-ml .note .ml.show { filter: none; }
.media-miss { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 2px 0; }
.media-miss small { display: block; font-size: .75rem; }
.bub-link { display: block; margin-top: 8px; padding: 8px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-text); text-align: center; font-weight: 600; }

/* ---------- voice message ---------- */
.vbub { padding: 9px 12px 6px 10px; width: min(86%, 360px); }
.voice { display: flex; align-items: center; gap: 10px; }
.v-av { position: relative; width: 44px; height: 44px; flex: none; }
.v-av img { width: 44px; height: 44px; border-radius: 13px; display: block; }
.v-mic { position: absolute; right: -5px; bottom: -4px; width: 20px; height: 20px; border-radius: 50%; background: var(--surface-2); color: var(--accent-text); display: grid; place-items: center; }
.v-mic svg { width: 14px; height: 14px; }
.voice.heard .v-mic { color: var(--tick); }
.v-speed { display: none; position: absolute; inset: 8px 0; border: 0; border-radius: 12px; background: var(--surface-3); color: var(--text); font-size: .8rem; font-weight: 700; }
.voice.active .v-speed { display: block; }
.voice.active .v-av img, .voice.active .v-mic { visibility: hidden; }
.v-play { width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; flex: none; padding: 0; }
.v-play svg { width: 20px; height: 20px; }
.v-main { flex: 1; min-width: 0; }
.wave { display: flex; align-items: center; gap: 2px; height: 28px; cursor: pointer; padding-top: 4px; }
.wave i { flex: 1; min-width: 2px; border-radius: 2px; background: var(--surface-3); }
.wave i.on { background: var(--accent-text); }
[data-theme="light"] .wave i { background: #cfd4db; }
[data-theme="light"] .wave i.on { background: var(--accent); }
.v-info { display: flex; justify-content: space-between; font-size: .68rem; color: var(--muted); margin-top: 3px; }

/* ---------- choices ---------- */
.poll { display: grid; gap: 8px; margin-top: 10px; min-width: min(68vw, 300px); }
.poll-opt { display: flex; align-items: center; gap: 10px; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 10px 12px; }
.poll-opt:active:not(:disabled) { background: var(--surface-3); }
.poll-opt .radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--muted); flex: none; display: grid; place-items: center; font-size: .7rem; font-weight: 800; color: var(--on-accent); }
.poll-opt.right { border-color: var(--accent); color: var(--good); font-weight: 600; }
.poll-opt.right .radio { background: var(--accent); border-color: var(--accent); }
.poll-opt.wrong { border-color: rgba(248, 113, 113, .5); color: var(--bad); text-decoration: line-through; }
.poll-opt.wrong .radio { background: var(--bad); border-color: var(--bad); color: #fff; }
.poll-opt:disabled { cursor: default; }
.ctx { color: var(--muted); margin-bottom: 4px; }
.qn { font-weight: 700; color: var(--accent-text); }
.ml-big { font-size: 1.2rem; font-weight: 600; margin: 4px 0 2px; }
.model { margin-top: 8px; padding: 8px 11px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 6px 10px 10px 6px; font-weight: 600; white-space: pre-line; }
.model .lbl { display: block; font-size: .7rem; color: var(--accent-text); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.score { font-size: 1.2rem; margin-bottom: 2px; }
.peek-bar { height: 4px; background: var(--surface-3); border-radius: 4px; overflow: hidden; margin: 10px 0 4px; }
.peek-bar i { display: block; height: 100%; background: var(--accent); animation: shrink linear forwards; }
@keyframes shrink { from { width: 100%; } to { width: 0; } }
.flag { display: block; margin: 8px auto 0; border: 0; background: none; color: var(--muted); font-size: .75rem; }

/* your words after checking */
.mine { line-height: 1.7; }
.wok { color: var(--text); }
.wsp { color: var(--warn); text-decoration: underline wavy; text-underline-offset: 3px; }
.wbad { color: var(--bad); text-decoration: line-through; text-decoration-thickness: 2px; }
.wmiss { display: inline-block; background: var(--bad); color: #fff; font-size: .68rem; font-weight: 700; border-radius: 8px; padding: 1px 7px; vertical-align: middle; }

/* ---------- message box ---------- */
.composer { display: flex; align-items: flex-end; gap: 8px; padding: 8px 12px; position: sticky; bottom: var(--safe-b); z-index: 5; background: var(--bg); }
.with-tabs .composer { bottom: calc(68px + var(--safe-b)); }
.composer.inline { position: static; background: transparent; padding: 6px 12px 2px; }
.cmp-box { flex: 1; min-width: 0; display: flex; align-items: flex-end; background: var(--surface-2); border: 1px solid var(--line); border-radius: 22px; padding: 3px 6px; }
.cmp-box:focus-within { border-color: var(--accent); }
.cmp-box input, .cmp-box textarea { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; padding: 9px 8px; resize: none; line-height: 1.35; max-height: 220px; }
.cmp-box ::placeholder { color: var(--muted); }
.cmp-ic { border: 0; background: none; width: 38px; height: 38px; font-size: 1.05rem; flex: none; border-radius: 50%; }
.cmp-ic:disabled { opacity: .3; }
.cmp-send { width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; flex: none; }
.cmp-send svg { width: 20px; height: 20px; }
.cmp-send.alt { background: var(--surface-2); border: 1px solid var(--line); color: var(--accent-text); }
.cmp-send.listening { background: var(--bad); color: #fff; animation: pulse 1s infinite; }
.cmp-send.stop { background: var(--bad); color: #fff; font-size: 1rem; }
@keyframes pulse { 50% { transform: scale(1.08); } }
.chips { display: flex; gap: 8px; padding: 6px 14px 2px; }
.chips.right { justify-content: flex-end; }
.chips button { border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 999px; padding: 6px 13px; font-size: .82rem; font-weight: 600; }
.act { padding-bottom: 8px; }
.actprog { padding: 0 20px; }
.prog { height: 4px; background: var(--surface-3); border-radius: 4px; overflow: hidden; margin-top: 2px; }
.prog i { display: block; height: 100%; background: var(--accent); }
.prog-t { font-size: .72rem; color: var(--muted); text-align: right; margin-top: 3px; }

/* recorder */
.rec { justify-content: flex-end; align-items: center; }
.rec-hint { color: var(--muted); font-size: .8rem; margin-right: 2px; }
.rec-live { flex: 1; display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 22px; padding: 12px 16px; }
.rec-live .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--bad); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.take { padding: 8px 8px 6px; }
.take audio { height: 40px; width: min(62vw, 280px); display: block; }
.del { border: 0; background: none; color: var(--bad); font-size: .68rem; padding: 0 6px 0 0; }

/* finish */
.check-row { display: flex; gap: 10px; padding: 8px 2px; border-bottom: 1px solid var(--line); }
.check-row:last-of-type { border-bottom: 0; }
.finish-btn { text-align: center; padding: 16px 16px 4px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 14px; padding: 12px 26px; font-weight: 700;
  background: var(--accent); color: var(--on-accent); min-height: 48px; letter-spacing: .01em; }
.btn.wide { min-width: 230px; }
.btn:active { filter: brightness(.92); }

/* ---------- welcome ---------- */
.welcome { min-height: calc(100vh - 60px); padding: 48px 24px calc(30px + var(--safe-b)); text-align: center; display: flex; flex-direction: column; align-items: center; }
.wl-img { width: 112px; height: 112px; border-radius: 30px; margin: 8px 0 22px; }
.wl-emoji { font-size: 4rem; margin: 10px 0; }
.welcome h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; margin: 0 0 8px; }
.welcome > p { max-width: 340px; margin: 0 0 24px; }
.wl-form, .form { width: 100%; max-width: 380px; text-align: left; display: grid; gap: 16px; margin-bottom: 26px; }
.form { padding: 4px 16px 16px; margin: 0; max-width: none; }
.wl-form label, .form label { font-size: .8rem; color: var(--muted); font-weight: 600; display: grid; gap: 6px; }
.wl-form input, .form input { border: 1px solid var(--line); background: var(--surface-2); border-radius: 12px; padding: 12px 14px; font-size: 1rem; color: var(--text); outline: none; }
.wl-form input:focus, .form input:focus { border-color: var(--accent); }
.wl-form p { margin: 0; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; width: 100%; max-width: 380px; padding: 4px; margin-bottom: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.seg button { border: 0; background: none; color: var(--muted); font-weight: 600; padding: 10px; border-radius: 10px; }
.seg button.on { background: var(--surface-3); color: var(--text); }
.pw { position: relative; display: block; }
.pw input { width: 100%; padding-right: 64px !important; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--accent-text); font-weight: 600; font-size: .85rem; padding: 6px 8px; }
.auth-err { min-height: 1.2em; color: var(--bad); font-size: .9rem; font-weight: 600; text-align: center; }
.btn:disabled { opacity: .6; }
.form .btn { justify-self: start; }

/* ---------- couple ---------- */
.cmp { display: grid; grid-template-columns: 1fr 72px 72px; padding: 11px 16px; border-bottom: 1px solid var(--line); font-size: .92rem; }
.cmp span:not(:first-child) { text-align: center; font-weight: 700; }
.cmp.head { font-size: .75rem; color: var(--muted); padding-top: 0; }
.cmp .win { color: var(--good); }
.cmp:last-child { border-bottom: 0; }
.reactions { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 12px 14px; }
.reactions button { font-size: 1.5rem; width: 50px; height: 50px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); }
.reactions button:active { transform: scale(1.12); }
.feed { min-height: 200px; }
.sender { font-size: .78rem; font-weight: 700; color: var(--bad); }
.big-emoji { font-size: 2.1rem; line-height: 1.2; }

/* ---------- me / settings ---------- */
.prof { display: flex; align-items: center; gap: 16px; margin: 14px 12px 0; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.p-name { font-size: 1.2rem; font-weight: 700; }
.srow { display: flex; align-items: center; gap: 14px; width: 100%; padding: 13px 16px; border: 0; border-top: 1px solid var(--line); background: transparent; text-align: left; cursor: pointer; }
.list-h + .srow { border-top: 0; }
div.srow { cursor: default; }
.srow:active:not(div) { background: var(--surface-2); }
.s-ic { width: 24px; text-align: center; font-size: 1.05rem; }
.s-l { flex: 1; }
.s-v { color: var(--muted); font-size: .9rem; }
.srow.danger .s-l { color: var(--bad); }
.switch { display: inline-block; width: 42px; height: 24px; border-radius: 12px; background: var(--surface-3); position: relative; vertical-align: middle; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .15s; }
.switch.on { background: var(--accent); }
.switch.on::after { left: 21px; }
.heat-wrap { padding: 10px 16px 14px; border-top: 1px solid var(--line); }
.heat { display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; margin-bottom: 6px; }
.heat .col { display: grid; grid-template-rows: repeat(7, 1fr); gap: 3px; }
.heat i { display: block; aspect-ratio: 1; border-radius: 3px; background: var(--surface-3); }
.heat i.l1 { background: rgba(16, 185, 129, .3); } .heat i.l2 { background: rgba(16, 185, 129, .55); } .heat i.l3 { background: rgba(16, 185, 129, .8); } .heat i.l4 { background: var(--accent); }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 6px; padding: 4px 12px 14px; }
.badges .badge { background: none; min-width: 0; height: auto; border-radius: 0; display: block; font-weight: 500; text-align: center; font-size: .72rem; color: var(--muted); padding: 8px 2px; }
.badges .badge .e { display: block; font-size: 1.8rem; }
.badges .badge.off { opacity: .3; filter: grayscale(1); }
.from { text-align: center; color: var(--muted); font-size: .8rem; padding: 18px 0 26px; }
.from b { color: var(--text); letter-spacing: .08em; }
.help-t { padding: 2px 16px 14px; font-size: .95rem; }
.help-t ol { margin: 0; padding-left: 20px; } .help-t li { margin-bottom: 6px; }
.mrow { padding: 11px 16px; border-top: 1px solid var(--line); }
.m-wrong { color: var(--bad); font-size: .9rem; text-decoration: line-through; }
.m-right { color: var(--good); font-weight: 600; }
.empty-row { padding: 14px 16px; color: var(--muted); font-size: .9rem; }

/* ---------- menu ---------- */
.menu { position: fixed; top: calc(10px + var(--safe-t)); right: max(10px, calc(50% - 350px)); z-index: 40; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 12px 30px rgba(0,0,0,.35); min-width: 240px; padding: 6px; }
.menu button, .menu a { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 11px 14px; font-size: .95rem; border-radius: 10px; }
.menu button:active, .menu a:active { background: var(--surface-3); }

/* ---------- bottom tab bar ---------- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(4, 1fr); max-width: 720px; margin: 0 auto;
  background: var(--surface); border-top: 1px solid var(--line); padding: 6px 6px calc(8px + var(--safe-b)); }
.tabbar a { text-align: center; font-size: .72rem; font-weight: 600; color: var(--muted); }
.t-ic { display: grid; place-items: center; width: 56px; height: 30px; margin: 0 auto 2px; border-radius: 10px; }
.tabbar a.on { color: var(--text); }
.tabbar a.on .t-ic { background: var(--accent-soft); color: var(--accent-text); }

/* ---------- mini player ---------- */
.player { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; max-width: 720px; margin: 0 auto; background: var(--surface); border-top: 1px solid var(--line); padding: 8px 10px calc(4px + var(--safe-b)); }
.with-tabs .player { bottom: calc(66px + var(--safe-b)); padding-bottom: 4px; }
.player-top { display: flex; align-items: center; gap: 6px; }
.pbtn { border: 0; background: none; min-width: 38px; height: 38px; border-radius: 10px; font-weight: 700; font-size: .8rem; color: var(--muted); }
.pbtn.big { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; }
.pbtn.big svg { width: 20px; height: 20px; }
.pbtn.speed { background: var(--surface-2); color: var(--text); }
.player-info { flex: 1; min-width: 0; cursor: pointer; }
.player-title { font-weight: 600; font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-time { font-size: .72rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.player-seek { width: 100%; margin: 4px 0 0; accent-color: var(--accent); height: 14px; }

/* ---------- toast / confetti ---------- */
/* small "Copied"-style message */
.toast { position: fixed; left: 50%; bottom: calc(92px + var(--safe-b)); transform: translate(-50%, 10px); z-index: 50; pointer-events: none;
  background: #e7e9ee; color: #0e1116; padding: 7px 16px; border-radius: 999px; font-size: .84rem; font-weight: 600;
  box-shadow: 0 4px 14px rgba(0,0,0,.35); max-width: 86vw; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  opacity: 0; transition: opacity .18s, transform .18s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
body:not(.with-tabs) .toast { bottom: calc(28px + var(--safe-b)); }
body:not(.with-tabs).has-player .toast, .with-tabs.has-player .toast { bottom: calc(160px + var(--safe-b)); }

/* small confirm box */
.ask { position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.55); display: grid; place-items: center; padding: 24px; opacity: 0; transition: opacity .15s; }
.ask.show { opacity: 1; }
.ask-card { width: min(100%, 340px); background: var(--surface-2); border: 1px solid var(--line); border-radius: 18px; padding: 20px 18px 12px; transform: scale(.96); transition: transform .15s; }
.ask.show .ask-card { transform: none; }
.ask-card p { margin: 0 0 16px; font-size: .98rem; line-height: 1.45; }
.ask-btns { display: flex; justify-content: flex-end; gap: 8px; }
.ask-btns button { border: 0; background: none; color: var(--muted); font-weight: 700; padding: 10px 16px; border-radius: 10px; }
.ask-btns .ok { color: var(--accent-text); }
.ask-btns .danger { color: var(--bad); }
.ask-btns button:active, .ask-btns button:focus-visible { background: var(--surface-3); }
.ask-btns button:focus { outline: none; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 9px; height: 13px; border-radius: 2px; animation: fall 2.4s ease-in forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); opacity: .8; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
