/*
 * Khuôn app (mobile-first). Màu kế thừa site BE: nền nâu than ấm, chữ kem, vàng (--now) = "đang ở đây / tiến độ".
 * Bố cục: 1 cột điện thoại (tối đa 480px). Trên laptop cột này nằm giữa màn hình.
 * Khoảng cách chỉ dùng các bậc 4 · 8 · 12 · 16 · 20 · 24 · 32 · 48.
 */
@font-face { font-family: "Be Vietnam Pro"; src: url(fonts/BeVietnamPro-Regular.ttf) format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Be Vietnam Pro"; src: url(fonts/BeVietnamPro-SemiBold.ttf) format("truetype"); font-weight: 500 600; font-display: swap; }
@font-face { font-family: "Be Vietnam Pro"; src: url(fonts/BeVietnamPro-Bold.ttf) format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Be Vietnam Pro"; src: url(fonts/BeVietnamPro-ExtraBold.ttf) format("truetype"); font-weight: 800 900; font-display: swap; }

:root {
  --font: "Be Vietnam Pro", -apple-system, "Helvetica Neue", Arial, sans-serif;
  --pad: 20px; --r: 20px; --r2: 14px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --top: env(safe-area-inset-top); --bottom: env(safe-area-inset-bottom);

  --bg: #1a1815; --outer: #100f0d; --surface: #24211c; --raised: #2f2b25; --sunk: #13110f;
  --ink: #eee7da; --ink-2: #d9d1c3; --muted: #a8a091; --faint: #8f8778;
  --line: rgb(238 231 218 / .09); --track: rgb(238 231 218 / .14);
  --glass: rgb(238 231 218 / .1); --glass-hover: rgb(238 231 218 / .16); --hover: rgb(238 231 218 / .05);
  --act: #eee7da; --act-hover: #fffaf0; --on-act: #1a1815;
  --now: #f2c46d; --now-soft: rgb(242 196 109 / .14); --on-now: #1a1815;
  --ok: #6fd69a; --ok-soft: rgb(111 214 154 / .14); --on-ok: #10261a;
  --bad: #ff8f80; --bad-soft: rgb(255 143 128 / .14); --on-bad: #2d100c;
  --you: #8ab4ff; --you-soft: rgb(138 180 255 / .14);
  --sel: rgb(242 196 109 / .35); --shadow: rgb(0 0 0 / .55); --scrim: rgb(0 0 0 / .55);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f6f3ec; --outer: #e7e1d5; --surface: #fffdf8; --raised: #efe9dd; --sunk: #ece6da;
  --ink: #1d1b17; --ink-2: #3d3830; --muted: #5f584c; --faint: #6b6356;
  --line: rgb(29 27 23 / .1); --track: rgb(29 27 23 / .12);
  --glass: rgb(29 27 23 / .07); --glass-hover: rgb(29 27 23 / .12); --hover: rgb(29 27 23 / .045);
  --act: #1d1b17; --act-hover: #000; --on-act: #f6f3ec;
  --now: #9a5d06; --now-soft: rgb(161 98 7 / .12); --on-now: #fff;
  --ok: #1d7a4b; --ok-soft: rgb(29 122 75 / .11); --on-ok: #fff;
  --bad: #b42318; --bad-soft: rgb(180 35 24 / .1); --on-bad: #fff;
  --you: #2456c4; --you-soft: rgb(36 86 196 / .1);
  --sel: rgb(161 98 7 / .22); --shadow: rgb(60 45 20 / .22); --scrim: rgb(29 27 23 / .45);
  color-scheme: light;
}

/* ── Nền tảng ── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--outer); }
body { margin: 0; font: 400 16px/1.55 var(--font); color: var(--ink); background: var(--outer); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none; }
::selection { background: var(--sel); color: var(--ink); }
:focus-visible { outline: 2px solid var(--now); outline-offset: 2px; }
[tabindex="-1"]:focus { outline: none; }
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; border: 0; background: none; padding: 0; }
input, textarea { font: inherit; color: var(--ink); caret-color: var(--now); }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { width: 22px; height: 22px; flex: none; }

/* ── Khung app: 1 cột điện thoại ── */
.app { position: relative; width: 100%; max-width: 480px; min-height: 100dvh; margin: 0 auto; background: var(--bg); display: flex; flex-direction: column; }
@media (min-width: 560px) { .app { box-shadow: 0 0 0 1px var(--line), 0 30px 80px -30px var(--shadow); } }
.main { flex: 1; display: flex; flex-direction: column; gap: 16px; padding: 8px var(--pad) 24px; animation: enter .22s var(--ease); }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } }

/* Tiêu đề lớn của tab */
.lt { padding-top: calc(var(--top) + 20px); font: 900 2rem/1.1 var(--font); letter-spacing: -0.03em; }
.eb { font: 600 .8125rem/1.3 var(--font); color: var(--muted); }
.h2 { font: 900 1.625rem/1.15 var(--font); letter-spacing: -0.02em; }
.h3 { font: 800 1.125rem/1.3 var(--font); }
.nt { font-size: .875rem; line-height: 1.5; color: var(--muted); }
.sec { font: 700 .8125rem var(--font); color: var(--muted); margin-top: 8px; }

/* Thanh trên trong bài / màn con: nút đóng + tiến độ */
.ab { position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; gap: 8px; padding: calc(var(--top) + 8px) 12px 8px; background: var(--bg); }
.ab small { font: 700 .75rem var(--font); color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.segp { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.segp a { display: flex; align-items: center; min-height: 32px; border-radius: 6px; }
.segp a i { flex: 1; }
.segp a:focus-visible { outline: 2px solid var(--now); outline-offset: 2px; }
.segp i { height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; }
.segp i b { display: block; height: 100%; width: 0; background: var(--now); border-radius: 3px; transition: width .3s var(--ease); }
.segp i.d b { background: var(--ok); width: 100%; }
.pbar { height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; }
.pbar b { display: block; height: 100%; background: var(--now); border-radius: 3px; transition: width .3s var(--ease); }

/* Vùng dưới cố định */
.bot { position: sticky; bottom: 0; z-index: 20; display: grid; gap: 10px; padding: 12px var(--pad) calc(var(--bottom) + 16px); background: var(--bg); }
.bot.sheet { border-radius: 24px 24px 0 0; animation: up .24s var(--ease); }
.bot.sheet.ok { background: color-mix(in srgb, var(--ok) 16%, var(--bg)); }
.bot.sheet.bad { background: color-mix(in srgb, var(--bad) 16%, var(--bg)); }
.sheet-h { display: flex; align-items: center; gap: 8px; font: 800 1.125rem var(--font); }
.sheet.ok .sheet-h { color: var(--ok); }
.sheet.bad .sheet-h { color: var(--bad); }
.sheet p { font-size: .9375rem; color: var(--ink-2); }
.sheet .en { font-weight: 700; color: var(--ink); }
@keyframes up { from { transform: translateY(24px); opacity: 0; } }

/* Thanh tab */
.tabs { position: sticky; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(4, 1fr); padding: 4px 8px calc(var(--bottom) + 4px); background: var(--surface); box-shadow: 0 -1px 0 var(--line); }
.tab { position: relative; display: grid; justify-items: center; gap: 2px; min-height: 52px; padding: 6px 0 4px; font: 600 .6875rem var(--font); color: var(--faint); transition: color .15s; }
.tab .ic { width: 24px; height: 24px; }
.tab[aria-current] { color: var(--now); }
.tab em { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--bad); color: var(--on-bad); font: 700 .6875rem/18px var(--font); font-style: normal; text-align: center; }

/* ── Nút ── */
.cta { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 54px; padding: 0 20px; border-radius: 16px; background: var(--act); color: var(--on-act); font: 800 1.0625rem var(--font); transition: transform .1s ease-out, opacity .15s, background .15s; }
.cta:active { transform: scale(.98); }
.cta:disabled { opacity: .35; cursor: default; transform: none; }
.cta.ghost { background: var(--glass); color: var(--ink); }
.cta.ok { background: var(--ok); color: var(--on-ok); }
.cta.bad { background: var(--bad); color: var(--on-bad); }
.cta.no { background: var(--bad-soft); color: var(--bad); }
.cta.sm { min-height: 48px; font-size: 1rem; border-radius: 14px; }
.cta small { display: block; font: 600 .6875rem var(--font); opacity: .75; }
.cta.col { flex-direction: column; gap: 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pill { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 18px; border-radius: 999px; background: var(--act); color: var(--on-act); font: 800 .9375rem var(--font); white-space: nowrap; }
.pill.ghost { background: var(--glass); color: var(--ink); }
.pill .ic { width: 18px; height: 18px; }
.pill.on { background: var(--bad-soft); color: var(--bad); }
.link.sm { min-height: 32px; font-size: .8125rem; }
.link.flag { gap: 4px; text-decoration: none; color: var(--faint); }
.link.flag .ic { width: 14px; height: 14px; }
.vw .flag-r { margin-left: auto; min-width: 32px; justify-content: flex-end; }
.heard .hit { color: var(--ink); }
.heard .miss { color: var(--faint); text-decoration: underline dotted; text-underline-offset: 4px; }
dialog.dlg { border: 0; border-radius: 20px; padding: 20px; width: min(440px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); box-shadow: 0 12px 40px var(--shadow); }
dialog.dlg::backdrop { background: rgb(0 0 0 / .45); }
dialog.dlg form { display: grid; gap: 12px; }
.link { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); font: 600 .9375rem var(--font); text-decoration: underline; text-underline-offset: 3px; }
.ib { display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 999px; background: var(--glass); color: var(--ink); transition: background .15s, transform .1s; }
.ib:active { transform: scale(.94); }
.ib.plain { background: transparent; }
.ib.act { background: var(--act); color: var(--on-act); }
.ib.big { width: 64px; height: 64px; }
.ib.big .ic { width: 28px; height: 28px; }
.ib:disabled { opacity: .35; cursor: default; }

/* ── Thẻ, danh sách ── */
.card { background: var(--surface); border-radius: var(--r); padding: 18px; display: grid; gap: 12px; align-content: start; }
.card.now { background: var(--now-soft); }
.row { display: flex; align-items: center; gap: 12px; }
.sp { flex: 1; }
.big-n { font: 900 3rem/1 var(--font); color: var(--now); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.steps span { display: grid; gap: 6px; font: 600 .6875rem var(--font); color: var(--faint); }
.steps span i { height: 4px; border-radius: 2px; background: var(--track); overflow: hidden; }
.steps span i b { display: block; height: 100%; background: var(--now); }
.steps span.d { color: var(--muted); }
.steps span.d i b { background: var(--ok); width: 100%; }
.steps span.n { color: var(--ink); }
.list { background: var(--surface); border-radius: var(--r); padding: 0 16px; }
.li { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; align-items: center; min-height: 60px; padding: 10px 0; border-top: 1px solid var(--line); text-align: left; width: 100%; }
.li:first-child { border-top: 0; }
.li.nol { grid-template-columns: minmax(0, 1fr) auto; }
.li b { display: block; font: 700 .9375rem/1.3 var(--font); }
.li .s { display: block; font-size: .8125rem; color: var(--muted); line-height: 1.35; }
.li em { font: 600 .75rem var(--font); font-style: normal; color: var(--faint); white-space: nowrap; }
.li em.now { color: var(--now); }
.li em.ok { color: var(--ok); }
.li .chev { width: 18px; height: 18px; color: var(--faint); }
.li.off b { color: var(--muted); font-weight: 600; }
.num { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--raised); font: 800 .875rem var(--font); color: var(--muted); }
.li.n .num { background: var(--now); color: var(--on-now); }
.li.d .num { background: var(--ok-soft); color: var(--ok); }
.li .num .ic { width: 18px; height: 18px; }
.li .ib { width: 36px; height: 36px; }
.li .ib .ic { width: 16px; height: 16px; }
.li.danger b { color: var(--bad); }
.mbar { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; max-width: 160px; margin-top: 6px; }
.mbar i { height: 3px; border-radius: 2px; background: var(--track); overflow: hidden; }
.mbar b { display: block; height: 100%; background: var(--now); }
.mbar i.d b { background: var(--ok); width: 100%; }
.qhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.qhead .qt { margin: 0; }
.link.back { gap: 4px; text-decoration: none; font-size: .875rem; }
.link.back .ic { width: 16px; height: 16px; }
.vw { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; align-items: start; padding: 14px 0; border-top: 1px solid var(--line); transition: background .2s var(--ease); }
.vw:first-child { border-top: 0; }
.vw.cur { background: var(--now-soft); }
.vw .vt { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.vw .vt b { font: 800 1.0625rem/1.3 var(--font); }
.ipa { font: 400 .8125rem var(--font); color: var(--muted); }
.vw .pos { font: 600 .6875rem/1 var(--font); color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 3px 6px; }
.flash .vx { display: block; text-align: center; margin-top: 4px; min-height: 32px; font-size: .9375rem; line-height: 1.45; color: var(--muted); }
.vw .m { font-size: .9375rem; margin-top: 2px; }
.vw .vx { display: block; text-align: left; margin-top: 6px; min-height: 32px; font-size: .875rem; line-height: 1.45; color: var(--muted); }
.li b .ipa { font-weight: 400; }

/* Hội thoại kiểu tin nhắn */
.chat { display: grid; gap: 10px; align-content: start; }
.msg { max-width: 84%; display: grid; gap: 2px; text-align: left; }
.msg small { font: 700 .6875rem var(--font); color: var(--faint); padding: 0 12px; }
.bub { padding: 10px 14px; border-radius: 18px 18px 18px 6px; background: var(--surface); font-size: 1.0625rem; line-height: 1.45; transition: box-shadow .15s; }
.msg.me { justify-self: end; }
.msg.me small { text-align: right; }
.msg.me .bub { border-radius: 18px 18px 6px 18px; background: var(--you-soft); }
.msg.cur .bub { box-shadow: inset 0 0 0 2px var(--now); }
.bub .vi { display: block; margin-top: 4px; font-size: .8125rem; color: var(--muted); }
.chat.hid .bub .en, .msg.hid .bub .en { color: transparent; text-shadow: 0 0 10px var(--muted); user-select: none; }
.msg .bub.ask { background: transparent; box-shadow: inset 0 0 0 2px var(--now); font-size: 1rem; color: var(--muted); }
.chat.hid .bub .vi, .chat:not(.vi-on) .bub .vi { display: none; }
.dock { position: sticky; bottom: 0; z-index: 20; display: grid; gap: 12px; padding: 14px var(--pad) calc(var(--bottom) + 16px); background: var(--surface); border-radius: 24px 24px 0 0; }
.ctl { display: flex; align-items: center; justify-content: space-between; }
.mini { display: grid; justify-items: center; gap: 2px; width: 60px; font: 600 .6875rem var(--font); color: var(--muted); }
.mini .ib { pointer-events: none; }
.mini[aria-pressed="true"] { color: var(--now); }
.mini[aria-pressed="true"] .ib { background: var(--now-soft); color: var(--now); }
.mini .ib .ic { width: 20px; height: 20px; }

/* Ngữ pháp */
.fx { display: grid; gap: 6px; }
.fx div { display: grid; grid-template-columns: 1.15fr .9fr 1.25fr; gap: 6px; }
.fx span { padding: 8px 10px; border-radius: 10px; background: var(--raised); font: 600 .875rem/1.3 var(--font); }
.fx span.k { background: var(--now-soft); color: var(--now); font-weight: 800; }
.fx span:nth-child(2) { text-align: center; }
.mk { display: grid; gap: 4px; padding: 12px 14px; border-radius: var(--r2); background: var(--surface); }
.mk s { color: var(--bad); text-decoration-thickness: 2px; }
.mk b { color: var(--ok); }
.mk span { font-size: .8125rem; color: var(--muted); }
.ex { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; align-items: center; text-align: left; width: 100%; padding: 6px 0; }
.ex p { font-size: 1rem; line-height: 1.35; }
.ex p span { display: block; font-size: .8125rem; color: var(--muted); }
mark { background: none; color: var(--now); font-weight: 800; }

/* Câu hỏi */
.qt { display: flex; align-items: center; gap: 6px; font: 700 .8125rem var(--font); color: var(--muted); }
.qt .ic { width: 16px; height: 16px; color: var(--now); }
.q { font: 800 1.5rem/1.4 var(--font); letter-spacing: -0.01em; }
.q.sm { font-size: 1.25rem; }
.gap { display: inline-block; min-width: 72px; border-bottom: 3px solid var(--now); color: var(--now); line-height: 1.2; }
.gap.ok { border-bottom-color: var(--ok); color: var(--ok); }
.opts { display: grid; gap: 10px; }
.opt { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 56px; padding: 10px 18px; border-radius: 16px; background: var(--surface); box-shadow: inset 0 0 0 2px var(--line); font: 700 1.0625rem/1.35 var(--font); text-align: left; transition: background .15s, box-shadow .15s, opacity .15s; }
.opt .ic { margin-left: auto; }
.opt.ok { background: var(--ok-soft); box-shadow: inset 0 0 0 2px var(--ok); color: var(--ok); }
.opt.bad { background: var(--bad-soft); box-shadow: inset 0 0 0 2px var(--bad); color: var(--bad); }
.opt.pick { background: var(--now-soft); box-shadow: inset 0 0 0 2px var(--now); }
.opt.dim { opacity: .45; }
.opt.idk { min-height: 48px; justify-content: center; background: transparent; box-shadow: none; color: var(--muted); font-size: .9375rem; }
.blank { display: inline-block; width: 6ch; height: 40px; margin: 2px 0; padding: 0 6px; border: 0; border-bottom: 3px solid var(--now); border-radius: 0; background: var(--sunk); font: 800 1.25rem var(--font); text-align: center; vertical-align: baseline; }
.blank:focus { outline: none; background: var(--now-soft); }
.blank.ok { border-bottom-color: var(--ok); color: var(--ok); }
.blank.bad { border-bottom-color: var(--bad); color: var(--bad); }
.ans { min-height: 116px; display: flex; flex-wrap: wrap; gap: 8px; align-content: start; padding: 12px 0; border-top: 2px solid var(--line); border-bottom: 2px solid var(--line); }
.bank { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.w { min-height: 46px; padding: 0 16px; display: inline-flex; align-items: center; border-radius: 12px; background: var(--surface); box-shadow: inset 0 0 0 2px var(--line), inset 0 -3px 0 var(--line); font: 700 1.0625rem var(--font); transition: transform .1s; }
.w:active { transform: scale(.96); }
.w.used { background: var(--raised); color: transparent; box-shadow: none; pointer-events: none; }
.tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tool { display: grid; justify-items: center; gap: 6px; padding: 14px 4px; border-radius: 16px; background: var(--surface); font: 700 .8125rem var(--font); }
.tool .ic { width: 26px; height: 26px; }
.tool:disabled { opacity: .35; cursor: default; }
.tool.rec { background: var(--bad-soft); color: var(--bad); }
.tool.rec.on { background: var(--bad); color: var(--on-bad); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px var(--bad-soft); } }

/* Ôn: thẻ nhớ */
.flash { flex: 1; display: grid; align-content: center; justify-items: center; gap: 18px; text-align: center; padding: 24px 0; }
.flash .vi2 { font: 800 1.5rem/1.35 var(--font); }
.flash .en2 { font: 800 1.375rem/1.4 var(--font); color: var(--now); }

/* Ô nhập dài */
.field { width: 100%; min-height: 48px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r2); background: var(--sunk); font-size: 1rem; line-height: 1.5; }
.field:focus { outline: none; border-color: var(--now); }
textarea.field { resize: vertical; min-height: 140px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 4px 12px; border-radius: 999px; background: var(--glass); color: var(--ink-2); font: 600 .8125rem var(--font); }
.chip.on { background: var(--ok-soft); color: var(--ok); }
.chip .ic { width: 14px; height: 14px; }
.box { padding: 12px 14px; border-radius: var(--r2); background: var(--sunk); }
.sched { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.sched span { display: grid; gap: 2px; padding: 8px 10px; border-radius: 12px; background: var(--raised); font-size: .75rem; color: var(--muted); }
.sched span b { font: 800 .875rem var(--font); color: var(--ink); white-space: nowrap; }
.sched span:first-child { background: var(--now-soft); }
.sched span:first-child b { color: var(--now); }
.seg2 { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 12px; background: var(--raised); min-width: 150px; }
.seg2 button { min-height: 36px; border-radius: 9px; font: 700 .875rem var(--font); color: var(--muted); }
.seg2 button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px var(--shadow); }

/* Kết quả */
.res div { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); font-size: .9375rem; }
.res div:first-child { border-top: 0; }
.res div span:last-child { font-weight: 800; font-variant-numeric: tabular-nums; }
.res .y { color: var(--ok); }
.res .x { color: var(--bad); }
.res .h span { color: var(--now); font-weight: 800; }
.stat { display: flex; gap: 32px; }
.stat div { display: grid; }
.stat b { font: 900 2.25rem/1 var(--font); font-variant-numeric: tabular-nums; }
.stat .ok b { color: var(--ok); }
.stat .bad b { color: var(--bad); }
.stat span { font-size: .875rem; color: var(--muted); }

/* Thông báo ngắn */
.toast { position: fixed; left: 50%; top: calc(var(--top) + 64px); z-index: 90; transform: translateX(-50%); width: max-content; max-width: min(440px, calc(100vw - 32px)); padding: 12px 18px; border-radius: 14px; background: var(--act); color: var(--on-act); font: 700 .9375rem var(--font); box-shadow: 0 12px 32px -8px var(--shadow); animation: fade .2s ease-out; }
@keyframes fade { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
/* Màn rất hẹp (320px): thu nút nhỏ và ô lịch ôn để không tràn ngang */
@media (max-width: 350px) { .mini { width: 52px; } .sched span { padding: 8px 4px; } .sched span b { font-size: .8125rem; } }
/* Nghe lần lượt: dòng đang phát không chui dưới nút đáy; nút Dừng luôn trong tầm bấm */
.vw { scroll-margin: 130px 0 120px; }
#all { position: sticky; top: calc(var(--top) + 64px); z-index: 10; }
#all[data-on] { background: var(--raised); box-shadow: 0 2px 12px rgb(0 0 0 / .25); }

/* Tài khoản (sync.js) */
.brk { overflow-wrap: anywhere; }
.nt.err { color: var(--bad); }
label.sec { display: block; margin-top: 0; }
