/* Firebooks Sách nói & Ebook – giao diện tối mặc định (giống app nghe sách), có chế độ sáng */
:root {
  --nen: #0f0c0a; --nen2: #17130f; --the: #211b16; --the2: #2a231d; --vien: #342b24;
  --chu: #f6efe8; --mo: #ab9f94; --mo2: #7d7268;
  --lua: #ff6a2b; --lua2: #ffa62b; --lua-chu: #ff8a50; --xanh: #49c58d;
  --bong: 0 18px 40px rgba(0,0,0,.45);
  --r: 14px; --rong: 1240px;
  --font: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --nen: #faf6f2; --nen2: #ffffff; --the: #ffffff; --the2: #f3ece5; --vien: #e9dfd5;
  --chu: #1f1915; --mo: #6c6158; --mo2: #93877c;
  --lua: #e5531a; --lua2: #f0901a; --lua-chu: #b84310; --xanh: #1f8a5b;
  --bong: 0 14px 34px rgba(60,35,15,.14);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--nen); color: var(--chu); font: 15px/1.55 var(--font); min-height: 100vh; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input, select { font: inherit; color: inherit; }
svg { width: 22px; height: 22px; flex: none; }
img { display: block; max-width: 100%; }
h1, h2, h3 { line-height: 1.25; margin: 0; letter-spacing: -.01em; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--lua2); outline-offset: 2px; border-radius: 6px; }
.seo { padding: 90px 20px; color: var(--mo); max-width: 760px; margin: auto; }
.seo h1 { color: var(--chu); margin-bottom: 8px; }

/* ---------- đầu trang ---------- */
.dau { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 18px; padding: 12px max(16px, calc((100vw - var(--rong)) / 2)); padding-top: max(12px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--nen) 82%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid color-mix(in srgb, var(--vien) 60%, transparent); }
.logo { display: flex; align-items: center; gap: 10px; flex: none; }
.logo-lua { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: #fff; background: linear-gradient(140deg, var(--lua2), var(--lua) 55%, #e2342a); box-shadow: 0 6px 16px rgba(255,106,43,.35); }
.logo-lua svg { width: 22px; height: 22px; }
.logo-chu { font-weight: 800; font-size: 17px; line-height: 1.05; }
.logo-chu small { display: block; font-weight: 500; font-size: 11.5px; color: var(--mo); letter-spacing: .02em; }
.nav-tren { display: flex; gap: 4px; }
.nav-tren a { padding: 8px 13px; border-radius: 99px; color: var(--mo); font-weight: 600; font-size: 14.5px; }
.nav-tren a:hover { color: var(--chu); background: var(--the); }
.nav-tren a.dang { color: var(--chu); background: var(--the2); }
.o-tim { flex: 1; max-width: 380px; margin-left: auto; display: flex; align-items: center; gap: 8px; padding: 0 14px; height: 40px; border-radius: 99px; background: var(--the); border: 1px solid var(--vien); color: var(--mo); }
.o-tim input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--chu); }
.o-tim svg { width: 18px; height: 18px; }
.nut-tk { flex: none; height: 40px; padding: 0 18px; border-radius: 99px; font-weight: 700; background: var(--chu); color: var(--nen); }
.nut-tk.co { background: var(--the2); color: var(--chu); padding: 0 6px 0 6px; display: flex; align-items: center; gap: 8px; }
.nut-tk .avt { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(140deg, var(--lua2), var(--lua)); color: #fff; font-size: 13px; }
.nut-tron { width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; color: var(--chu); flex: none; }
.nut-tron:hover { background: color-mix(in srgb, var(--chu) 9%, transparent); }
.chi-dt { display: none; }

/* ---------- thanh tab dưới (điện thoại) ---------- */
.tab-duoi { display: none; }
@media (max-width: 760px) {
  .nav-tren, .o-tim { display: none; }
  .chi-dt { display: inline-grid; margin-left: auto; }
  .dau { gap: 8px; }
  .nut-tk:not(.co) { height: 36px; padding: 0 14px; font-size: 14px; }
  .tab-duoi { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; inset: auto 0 0 0; z-index: 40; padding: 6px 4px max(8px, env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--nen2) 90%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--vien); }
  .tab-duoi a { display: grid; justify-items: center; gap: 2px; font-size: 11px; font-weight: 600; color: var(--mo2); padding: 4px 0; }
  .tab-duoi a.dang { color: var(--lua-chu); }
  body { padding-bottom: 72px; }
  body.co-mini { padding-bottom: 140px; }
}

/* ---------- khung trang ---------- */
#app { outline: 0; }
.trang { max-width: var(--rong); margin: 0 auto; padding: 22px 16px 40px; }
@media (min-width: 761px) { .trang { padding: 28px 24px 60px; } body.co-mini .trang { padding-bottom: 120px; } }
.hang-dau { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 34px 0 14px; }
.hang-dau h2 { font-size: 21px; font-weight: 800; }
.hang-dau a, .hang-dau button { color: var(--mo); font-weight: 600; font-size: 14px; white-space: nowrap; }
.hang-dau a:hover { color: var(--lua-chu); }
.tieu-de-trang { font-size: 28px; font-weight: 800; margin: 6px 0 4px; }
.phu-de { color: var(--mo); margin: 0 0 18px; }

/* ---------- băng chuyền đầu trang chủ ---------- */
.hero { position: relative; border-radius: 22px; overflow: hidden; background: var(--the); min-height: 340px; isolation: isolate; }
.hero-cuon { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.hero-cuon::-webkit-scrollbar { display: none; }
.hero-o { position: relative; flex: 0 0 100%; scroll-snap-align: start; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 28px; padding: 40px 48px; min-height: 340px; overflow: hidden; }
.hero-nen { position: absolute; inset: -40px; z-index: -1; background-size: cover; background-position: center; filter: blur(40px) saturate(1.3); opacity: .55; transform: scale(1.1); }
.hero-o::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, var(--nen) 8%, color-mix(in srgb, var(--nen) 55%, transparent) 55%, transparent); }
.hero-nhan { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--lua2); margin-bottom: 10px; }
.hero h2 { font-size: clamp(24px, 3.4vw, 38px); font-weight: 800; max-width: 620px; }
.hero .tac-gia { color: var(--mo); margin: 8px 0 0; font-weight: 500; }
.hero .mo-ta { color: color-mix(in srgb, var(--chu) 80%, transparent); max-width: 560px; margin: 14px 0 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hero .nhom-nut { margin-top: 22px; }
.hero-bia { width: 200px; transform: rotate(3deg); }
.hero-bia .bia { box-shadow: 0 30px 60px rgba(0,0,0,.55); }
.hero-cham { position: absolute; left: 48px; bottom: 18px; display: flex; gap: 6px; }
.hero-cham button { width: 7px; height: 7px; border-radius: 99px; background: color-mix(in srgb, var(--chu) 35%, transparent); transition: width .25s; }
.hero-cham button.dang { width: 22px; background: var(--lua); }
@media (max-width: 760px) {
  .hero, .hero-o { min-height: 0; }
  .hero-o { grid-template-columns: 1fr; padding: 24px 20px 40px; gap: 18px; text-align: left; }
  .hero-o::after { background: linear-gradient(0deg, var(--nen) 10%, color-mix(in srgb, var(--nen) 40%, transparent)); }
  .hero-bia { width: 128px; order: -1; transform: none; }
  .hero-cham { left: 20px; }
  .hero .mo-ta { -webkit-line-clamp: 2; }
  .chi-may-tinh { display: none; }
}

/* ---------- nút ---------- */
.nhom-nut { display: flex; flex-wrap: wrap; gap: 10px; }
.nut { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 22px; border-radius: 99px; font-weight: 700; font-size: 15px; white-space: nowrap; transition: transform .15s, filter .15s; }
.nut:active { transform: scale(.97); }
.nut svg { width: 20px; height: 20px; }
.nut-chinh { background: linear-gradient(135deg, var(--lua2), var(--lua) 60%); color: #fff; box-shadow: 0 8px 22px rgba(255,106,43,.32); }
.nut-chinh:hover { filter: brightness(1.06); }
.nut-phu { background: color-mix(in srgb, var(--chu) 10%, transparent); color: var(--chu); }
.nut-phu:hover { background: color-mix(in srgb, var(--chu) 16%, transparent); }
.nut-vien { border: 1.5px solid var(--vien); color: var(--chu); }
.nut-nho { height: 36px; padding: 0 14px; font-size: 13.5px; }
.nut-day { width: 100%; }
.nut[disabled] { opacity: .5; pointer-events: none; }

/* ---------- chip chủ đề ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; margin: 0 -16px; padding-inline: 16px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 36px; padding: 0 16px; border-radius: 99px; background: var(--the); border: 1px solid var(--vien); color: var(--mo); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.chip:hover { color: var(--chu); }
.chip.dang { background: var(--chu); color: var(--nen); border-color: var(--chu); }
.chip svg { width: 16px; height: 16px; }

/* ---------- bìa & thẻ sách ---------- */
.bia { position: relative; aspect-ratio: 2 / 3; border-radius: 10px; overflow: hidden; background: var(--the2); box-shadow: 0 10px 24px rgba(0,0,0,.35); }
.bia img { width: 100%; height: 100%; object-fit: cover; }
.bia-tao { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; padding: 14% 12%; color: #fff; font-weight: 800; line-height: 1.2; font-size: clamp(12px, 1.6vw, 17px); }
.bia-tao small { font-weight: 500; opacity: .85; font-size: .72em; }
.bia-tao::before { content: ""; position: absolute; left: 10%; top: 0; bottom: 0; width: 3px; background: rgba(255,255,255,.18); }
.hang-cuon { display: grid; grid-auto-flow: column; grid-auto-columns: 148px; gap: 16px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; margin: 0 -16px; padding: 4px 16px 10px; }
.hang-cuon::-webkit-scrollbar { display: none; }
@media (min-width: 761px) { .hang-cuon { grid-auto-columns: 168px; gap: 20px; } }
.luoi { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 22px 16px; }
@media (min-width: 761px) { .luoi { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 28px 20px; } }
.the { display: block; scroll-snap-align: start; min-width: 0; }
.the .bia { transition: transform .2s, box-shadow .2s; }
.the:hover .bia { transform: translateY(-4px); box-shadow: var(--bong); }
.the h3 { font-size: 14.5px; font-weight: 700; margin-top: 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.the p { margin: 3px 0 0; color: var(--mo); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nhan-bia { position: absolute; left: 8px; top: 8px; display: flex; gap: 4px; }
.nhan-bia span { display: inline-flex; align-items: center; gap: 3px; height: 22px; padding: 0 7px; border-radius: 6px; font-size: 11px; font-weight: 700; background: rgba(15,12,10,.78); color: #fff; backdrop-filter: blur(6px); }
.nhan-bia span svg { width: 13px; height: 13px; }
.nhan-bia .mo { background: var(--xanh); }
.nhan-bia .sap { background: rgba(15,12,10,.85); color: var(--lua2); }
.thanh-nho { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(0,0,0,.45); }
.thanh-nho i { display: block; height: 100%; background: var(--lua); }

/* ---------- nghe tiếp ---------- */
.nghe-tiep { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(300px, 360px); gap: 14px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px 6px; }
.nghe-tiep::-webkit-scrollbar { display: none; }
.nt { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center; padding: 12px; border-radius: var(--r); background: var(--the); border: 1px solid var(--vien); text-align: left; }
.nt:hover { background: var(--the2); }
.nt .bia { box-shadow: none; border-radius: 8px; }
.nt b { display: block; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nt small { display: block; color: var(--mo); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.nt .thanh { height: 4px; border-radius: 9px; background: var(--vien); margin-top: 9px; overflow: hidden; }
.nt .thanh i { display: block; height: 100%; background: var(--lua); }
.nt .nut-phat-nho { width: 42px; height: 42px; }
.nut-phat-nho { background: var(--chu); color: var(--nen); border-radius: 50%; display: grid; place-items: center; }
.nut-phat-nho:hover { background: var(--chu); filter: brightness(.92); }

/* ---------- trang 1 cuốn sách ---------- */
.ct { position: relative; isolation: isolate; }
.ct-nen { position: absolute; inset: -80px 0 auto; height: 520px; z-index: -1; background-size: cover; background-position: center 30%; filter: blur(60px) saturate(1.4); opacity: .38; mask-image: linear-gradient(#000 30%, transparent); -webkit-mask-image: linear-gradient(#000 30%, transparent); }
.ct-dau { display: grid; grid-template-columns: 260px 1fr; gap: 40px; align-items: end; padding-top: 18px; }
.ct-dau .bia { box-shadow: 0 30px 60px rgba(0,0,0,.5); border-radius: 12px; }
.ct-chu h1 { font-size: clamp(26px, 3.6vw, 40px); font-weight: 800; }
.ct-chu .tac-gia { color: var(--mo); font-size: 16px; margin: 8px 0 0; }
.ct-thong-so { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 18px 0 22px; color: var(--mo); font-size: 14px; }
.ct-thong-so span { display: inline-flex; align-items: center; gap: 6px; }
.ct-thong-so svg { width: 18px; height: 18px; color: var(--lua-chu); }
.ct-chu .nhom-nut { align-items: center; }
.nut-tim { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--vien); }
.nut-tim.co { color: var(--lua); border-color: color-mix(in srgb, var(--lua) 50%, transparent); }
.nhac-mo { margin-top: 14px; font-size: 13.5px; color: var(--mo); display: flex; align-items: center; gap: 8px; }
.nhac-mo svg { width: 16px; height: 16px; }
.nhac-mo button { color: var(--lua-chu); font-weight: 700; }
@media (max-width: 760px) {
  .ct-dau { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 22px; }
  .ct-dau .bia { width: 190px; }
  .ct-thong-so, .ct-chu .nhom-nut, .nhac-mo { justify-content: center; }
  .ct-chu .nhom-nut .nut { flex: 1; max-width: 220px; }
}
.tabs { display: flex; gap: 26px; border-bottom: 1px solid var(--vien); margin: 40px 0 6px; overflow-x: auto; scrollbar-width: none; }
.tabs button { padding: 12px 0; font-weight: 700; color: var(--mo); border-bottom: 2.5px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.dang { color: var(--chu); border-color: var(--lua); }
.gioi-thieu { max-width: 760px; color: color-mix(in srgb, var(--chu) 86%, transparent); font-size: 15.5px; line-height: 1.75; white-space: pre-line; }
.ds-muc { list-style: none; padding: 0; margin: 0; max-width: 860px; }
.ds-nhom { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--mo); padding: 22px 4px 8px; }
.muc { display: grid; grid-template-columns: 38px 1fr auto; gap: 12px; align-items: center; width: 100%; padding: 12px 8px; border-radius: 12px; text-align: left; }
.muc:hover { background: var(--the); }
.muc .so { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--the2); color: var(--mo); font-size: 13px; font-weight: 700; }
.muc .so svg { width: 16px; height: 16px; }
.muc b { font-weight: 600; font-size: 14.5px; display: block; }
.muc small { color: var(--mo); font-size: 12.5px; }
.muc .phai { color: var(--mo); font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.muc.khoa b { color: var(--mo); }
.muc.dang .so { background: var(--lua); color: #fff; }
.muc.xong .so { background: color-mix(in srgb, var(--xanh) 22%, transparent); color: var(--xanh); }
.nhan-thu { font-size: 11px; font-weight: 700; color: var(--lua2); background: color-mix(in srgb, var(--lua2) 14%, transparent); padding: 2px 8px; border-radius: 99px; }

/* ---------- ô trống, thông báo ---------- */
.trong { text-align: center; padding: 56px 20px; color: var(--mo); border: 1.5px dashed var(--vien); border-radius: 18px; }
.trong svg { width: 40px; height: 40px; color: var(--mo2); margin-bottom: 10px; }
.trong h3 { color: var(--chu); font-size: 18px; margin-bottom: 6px; }
.trong .nut { margin-top: 18px; }
.thong-bao { position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 90; background: var(--chu); color: var(--nen); padding: 11px 18px; border-radius: 12px; font-weight: 600; font-size: 14px; transition: .25s; max-width: calc(100vw - 32px); box-shadow: var(--bong); }
.thong-bao.hien { opacity: 1; transform: translate(-50%, 0); }
.dang-tai { display: grid; place-items: center; padding: 120px 0; }
.vong { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--vien); border-top-color: var(--lua); animation: quay .8s linear infinite; }
@keyframes quay { to { transform: rotate(360deg); } }
.khung-xam { background: linear-gradient(90deg, var(--the) 25%, var(--the2) 50%, var(--the) 75%); background-size: 200% 100%; animation: xam 1.3s infinite; border-radius: 10px; }
@keyframes xam { to { background-position: -200% 0; } }

/* ---------- tìm kiếm ---------- */
.tim-to { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 18px; border-radius: 16px; background: var(--the); border: 1px solid var(--vien); margin: 6px 0 18px; }
.tim-to input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; font-size: 17px; color: var(--chu); }
.tim-to svg { color: var(--mo); }
.ket-qua { display: grid; gap: 4px; }
.kq { display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: center; padding: 10px; border-radius: 12px; }
.kq:hover { background: var(--the); }
.kq .bia { border-radius: 6px; box-shadow: none; }
.kq b { display: block; font-weight: 700; }
.kq small { color: var(--mo); }
.kq mark { background: color-mix(in srgb, var(--lua) 30%, transparent); color: inherit; border-radius: 3px; }
.chu-de-luoi { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.o-chu-de { position: relative; height: 92px; border-radius: 14px; padding: 14px; font-weight: 800; font-size: 16px; color: #fff; overflow: hidden; display: flex; align-items: flex-start; }
.o-chu-de img { position: absolute; right: -8px; bottom: -14px; width: 56px; transform: rotate(18deg); border-radius: 4px; box-shadow: 0 6px 14px rgba(0,0,0,.4); }

/* ---------- tủ sách, tài khoản ---------- */
.tk-the { display: flex; align-items: center; gap: 16px; padding: 20px; border-radius: 18px; background: var(--the); border: 1px solid var(--vien); margin-bottom: 18px; }
.tk-the .avt { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 20px; color: #fff; background: linear-gradient(140deg, var(--lua2), var(--lua)); }
.tk-the b { font-size: 18px; display: block; }
.tk-the small { color: var(--mo); }
.ds-cai { border-radius: 18px; background: var(--the); border: 1px solid var(--vien); overflow: hidden; margin-bottom: 18px; }
.cai { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 18px; width: 100%; text-align: left; }
.cai + .cai { border-top: 1px solid var(--vien); }
.cai:hover { background: var(--the2); }
.cai span { color: var(--mo); font-size: 14px; }
.cai svg { color: var(--mo2); width: 18px; height: 18px; }
.cai-nhom { display: flex; gap: 6px; background: var(--nen2); padding: 4px; border-radius: 99px; border: 1px solid var(--vien); }
.cai-nhom button { padding: 6px 12px; border-radius: 99px; font-size: 13px; font-weight: 600; color: var(--mo); }
.cai-nhom button.dang { background: var(--chu); color: var(--nen); }
.gioi-thieu-dv { color: var(--mo); font-size: 13.5px; text-align: center; margin: 26px 0 0; }
.gioi-thieu-dv a { color: var(--lua-chu); font-weight: 600; }

/* ---------- biểu mẫu (bảng đăng nhập) ---------- */
.form { display: grid; gap: 12px; }
.form label { display: grid; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--mo); }
.form input { height: 48px; padding: 0 14px; border-radius: 12px; border: 1.5px solid var(--vien); background: var(--nen2); color: var(--chu); font-size: 16px; outline: 0; }
.form input:focus { border-color: var(--lua); }
.form .loi { color: #ff7b6b; font-size: 13.5px; min-height: 0; margin: 0; }
.form .goi-y { color: var(--mo); font-size: 13px; margin: 0; }
.form .lien-ket { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: 14px; }
.form .lien-ket button { color: var(--lua-chu); font-weight: 600; }
.chon-che-do { display: grid; grid-template-columns: 1fr 1fr; background: var(--nen2); border-radius: 12px; padding: 4px; margin-bottom: 4px; border: 1px solid var(--vien); }
.chon-che-do button { height: 38px; border-radius: 9px; font-weight: 700; color: var(--mo); font-size: 14px; }
.chon-che-do button.dang { background: var(--the2); color: var(--chu); }
.hop-zalo { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; background: var(--nen2); border: 1px solid var(--vien); margin-top: 6px; font-size: 14px; }
.hop-zalo b { display: block; }
.hop-zalo small { color: var(--mo); }
.hop-zalo .nut { margin-left: auto; }

/* ---------- thanh phát nhỏ ---------- */
.mini { position: fixed; z-index: 45; left: 50%; transform: translateX(-50%); bottom: 16px; width: min(720px, calc(100vw - 24px)); display: flex; align-items: center; gap: 4px; padding: 8px 8px 8px 8px; border-radius: 16px;
  background: color-mix(in srgb, var(--the2) 92%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border: 1px solid var(--vien); box-shadow: var(--bong); overflow: hidden; }
@media (max-width: 760px) { .mini { bottom: calc(66px + env(safe-area-inset-bottom)); } }
.mini-tien { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: color-mix(in srgb, var(--chu) 10%, transparent); }
.mini-tien i { display: block; height: 100%; width: 0; background: var(--lua); }
.mini-mo { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; text-align: left; }
.mini-bia { width: 44px; flex: none; }
.mini-bia .bia { border-radius: 6px; box-shadow: none; }
.mini-chu { min-width: 0; }
.mini-chu b, .mini-chu small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-chu b { font-size: 14px; }
.mini-chu small { color: var(--mo); font-size: 12.5px; }
.mini .nut-phat-nho { width: 42px; height: 42px; }
.mini .nut-phat-nho svg { width: 20px; height: 20px; }

/* ---------- trình phát toàn màn hình ---------- */
.tp { position: fixed; inset: 0; z-index: 60; background: var(--nen); overflow: hidden; animation: len .28s cubic-bezier(.2,.8,.2,1); }
@keyframes len { from { transform: translateY(40px); opacity: 0; } }
.tp-nen { position: absolute; inset: -60px; background-size: cover; background-position: center; filter: blur(70px) saturate(1.5); opacity: .5; }
.tp::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--nen) 80%, transparent) 60%, var(--nen)); }
.tp-trong { position: relative; z-index: 1; height: 100%; max-width: 460px; margin: auto; display: flex; flex-direction: column; padding: max(12px, env(safe-area-inset-top)) 22px max(22px, env(safe-area-inset-bottom)); }
.tp-dau { display: flex; align-items: center; justify-content: space-between; }
.tp-nhan { font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--mo); }
.tp-bia { width: min(72vw, 300px, 32vh); margin: 2vh auto 0; }
.tp-bia .bia { border-radius: 14px; box-shadow: 0 30px 70px rgba(0,0,0,.55); transition: transform .3s; }
.tp.dung .tp-bia .bia { transform: scale(.92); }
.tp-ten { margin-top: auto; padding-top: 18px; }
@media (max-height: 700px) { .tp-bia { width: min(60vw, 24vh); margin-top: 0; } .tp-ten { padding-top: 10px; } .tp-ten h2 { font-size: 18px; } .tp-nut { margin-top: 6px; } .tp-phu { margin-top: 4px; } .nut-phat { width: 62px; height: 62px; } }
.tp-ten h2 { font-size: 21px; font-weight: 800; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tp-ten p { margin: 4px 0 0; color: var(--mo); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp-tua { margin-top: 18px; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: none; margin: 0; cursor: pointer; --p: 0%; }
input[type=range]::-webkit-slider-runnable-track { height: 5px; border-radius: 9px; background: linear-gradient(90deg, var(--chu) var(--p), color-mix(in srgb, var(--chu) 20%, transparent) var(--p)); }
input[type=range]::-moz-range-track { height: 5px; border-radius: 9px; background: color-mix(in srgb, var(--chu) 20%, transparent); }
input[type=range]::-moz-range-progress { height: 5px; border-radius: 9px; background: var(--chu); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 15px; height: 15px; border-radius: 50%; background: var(--chu); margin-top: -5px; border: 0; }
input[type=range]::-moz-range-thumb { width: 15px; height: 15px; border-radius: 50%; background: var(--chu); border: 0; }
.tp-gio { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--mo); font-variant-numeric: tabular-nums; }
.tp-nut { display: flex; align-items: center; justify-content: space-between; margin: 14px 0 6px; }
.tp-nut .nut-tron.to svg { width: 32px; height: 32px; }
.tp-nut .nut-tron.to { width: 54px; height: 54px; }
.nut-phat { width: 76px; height: 76px; border-radius: 50%; background: var(--chu); color: var(--nen); display: grid; place-items: center; box-shadow: 0 10px 30px rgba(0,0,0,.35); transition: transform .15s; }
.nut-phat:active { transform: scale(.94); }
.nut-phat svg { width: 34px; height: 34px; }
.tp-phu { display: flex; justify-content: space-around; margin-top: 14px; }
.tp-phu button { display: grid; justify-items: center; gap: 3px; font-size: 12px; color: var(--mo); font-weight: 600; min-width: 74px; }
.tp-phu button b { font-size: 15px; color: var(--chu); height: 22px; display: grid; place-items: center; }
.tp-phu button svg { color: var(--chu); }
.tp-phu button.bat svg, .tp-phu button.bat b { color: var(--lua2); }

/* ---------- bảng trượt ---------- */
.bang-nen { position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.55); animation: hien .2s; }
@keyframes hien { from { opacity: 0; } }
.bang { position: fixed; z-index: 71; left: 50%; bottom: 0; transform: translateX(-50%); width: min(560px, 100vw); max-height: 86vh; display: flex; flex-direction: column; background: var(--nen2); border-radius: 22px 22px 0 0; border: 1px solid var(--vien); border-bottom: 0; animation: truot .28s cubic-bezier(.2,.8,.2,1); padding-bottom: env(safe-area-inset-bottom); }
@keyframes truot { from { transform: translate(-50%, 60px); opacity: 0; } }
@media (min-width: 761px) { .bang { bottom: 50%; transform: translate(-50%, 50%); border-radius: 22px; border-bottom: 1px solid var(--vien); max-height: 80vh; animation: hien .2s; } }
.bang-keo { width: 40px; height: 4px; border-radius: 9px; background: var(--vien); margin: 8px auto 0; }
@media (min-width: 761px) { .bang-keo { display: none; } }
.bang-dau { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px 6px 22px; }
.bang-dau h3 { font-size: 18px; font-weight: 800; }
.bang-than { overflow-y: auto; padding: 4px 22px 22px; overscroll-behavior: contain; }
.bang-than .ds-muc { margin: 0 -8px; }
.lua-chon { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.lua-chon button { height: 46px; border-radius: 12px; background: var(--the); border: 1.5px solid var(--vien); font-weight: 700; }
.lua-chon button.dang { border-color: var(--lua); color: var(--lua-chu); background: color-mix(in srgb, var(--lua) 10%, transparent); }
.mo-khoa { text-align: center; }
.mo-khoa .bia { width: 110px; margin: 4px auto 14px; }
.mo-khoa h4 { font-size: 18px; margin: 0 0 6px; }
.mo-khoa p { color: var(--mo); margin: 0 0 16px; }
.mo-khoa .form { text-align: left; margin-top: 14px; }

/* ---------- trình đọc ebook ---------- */
.doc { --doc-nen: #ffffff; --doc-chu: #1f1b17; --doc-mo: #7a7068; --doc-vien: #ebe5de; --co: 19px; --dong: 1.75; --phong: "Literata", Georgia, serif;
  position: fixed; inset: 0; z-index: 55; background: var(--doc-nen); color: var(--doc-chu); display: flex; flex-direction: column; }
.doc[data-nen="giay"] { --doc-nen: #f5ecd9; --doc-chu: #3a2e22; --doc-mo: #85735f; --doc-vien: #e3d6bd; }
.doc[data-nen="toi"] { --doc-nen: #141210; --doc-chu: #ddd5cb; --doc-mo: #8c8178; --doc-vien: #2b2520; }
.doc[data-phong="sans"] { --phong: "Be Vietnam Pro", system-ui, sans-serif; }
.doc-dau { display: flex; align-items: center; gap: 6px; padding: max(8px, env(safe-area-inset-top)) 10px 8px; border-bottom: 1px solid var(--doc-vien); transition: transform .25s, opacity .25s; }
.doc-dau .nut-tron { color: var(--doc-chu); }
.doc-dau .ten { flex: 1; min-width: 0; text-align: center; font-size: 13.5px; font-weight: 600; color: var(--doc-mo); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-cuon { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.doc-bai { max-width: 680px; margin: 0 auto; padding: 32px 22px 80px; font-family: var(--phong); font-size: var(--co); line-height: var(--dong); }
.doc-bai .nhom { font-family: var(--font); font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--doc-mo); }
.doc-bai h1 { font-size: 1.55em; margin: 8px 0 28px; line-height: 1.3; }
.doc-bai h2 { font-size: 1.3em; margin: 1.6em 0 .6em; }
.doc-bai h3 { font-size: 1.12em; margin: 1.4em 0 .5em; }
.doc-bai p { margin: 0 0 1em; text-align: justify; hyphens: auto; }
.doc-bai blockquote { margin: 1em 0; padding-left: 1em; border-left: 3px solid var(--lua); font-style: italic; }
.doc-bai hr { border: 0; text-align: center; margin: 2em 0; }
.doc-bai hr::after { content: "• • •"; color: var(--doc-mo); }
.doc-chuyen { display: flex; gap: 10px; margin-top: 40px; font-family: var(--font); }
.doc-chuyen button { flex: 1; min-height: 56px; border-radius: 14px; border: 1.5px solid var(--doc-vien); padding: 10px 14px; text-align: left; color: var(--doc-chu); }
.doc-chuyen button small { display: block; color: var(--doc-mo); font-size: 12px; }
.doc-chuyen button b { font-size: 14px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.doc-chuyen button:last-child { text-align: right; }
.doc-chuyen button[disabled] { visibility: hidden; }
.doc-chan { display: flex; align-items: center; gap: 12px; padding: 8px 18px max(10px, env(safe-area-inset-bottom)); border-top: 1px solid var(--doc-vien); font: 12.5px var(--font); color: var(--doc-mo); transition: transform .25s, opacity .25s; }
.doc-chan .thanh { flex: 1; height: 4px; border-radius: 9px; background: var(--doc-vien); overflow: hidden; }
.doc-chan .thanh i { display: block; height: 100%; background: var(--lua); width: 0; }
.doc.an-thanh .doc-dau { transform: translateY(-100%); opacity: 0; }
.doc.an-thanh .doc-chan { transform: translateY(100%); opacity: 0; }
.doc.an-thanh .doc-dau, .doc.an-thanh .doc-chan { position: absolute; left: 0; right: 0; z-index: 2; background: var(--doc-nen); }
.doc.an-thanh .doc-dau { top: 0; } .doc.an-thanh .doc-chan { bottom: 0; }
.doc-khoa { max-width: 520px; margin: 40px auto; padding: 28px 22px; text-align: center; font-family: var(--font); border-radius: 18px; border: 1.5px solid var(--doc-vien); }
.doc-khoa svg { width: 34px; height: 34px; color: var(--lua); }
.doc-khoa h3 { margin: 10px 0 6px; }
.doc-khoa p { color: var(--doc-mo); margin: 0 0 18px; font-size: 15px; text-align: center; }
.cai-doc { display: grid; gap: 20px; }
.cai-doc .dong { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cai-doc .dong > span { font-weight: 600; }
.co-chu { display: flex; align-items: center; gap: 6px; }
.co-chu button { width: 46px; height: 40px; border-radius: 10px; background: var(--the); border: 1.5px solid var(--vien); font-weight: 700; }
.co-chu output { min-width: 40px; text-align: center; font-weight: 700; }
.mau-nen { display: flex; gap: 10px; }
.mau-nen button { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--vien); font: 700 14px "Literata", serif; }
.mau-nen button.dang { border-color: var(--lua); box-shadow: 0 0 0 3px color-mix(in srgb, var(--lua) 25%, transparent); }
.mau-nen [data-nen="sang"] { background: #fff; color: #222; }
.mau-nen [data-nen="giay"] { background: #f5ecd9; color: #3a2e22; }
.mau-nen [data-nen="toi"] { background: #141210; color: #ddd5cb; }

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