/* BeCut web. Màu một chỗ, chép từ enum Mau (ios/ClipNhanh/ManChinh.swift), 01-cho-thiet-ke mục 6.
   Chữ giao diện Be Vietnam Pro (brand-style 16.1). Màu cuối (vàng #F2C14E hay champagne) chờ Quỳnh chốt: chỉ sửa ở :root. */
:root {
  --nen: #0F0F11; --the: #1B1B1F; --the2: #2A2A30; --vien: #2E2E34; --vien-dut: #3A3A40;
  --chu: #F4F1EA; --chu-phu: #D9D4C8; --mo-ta: #B9B3A6; --mo: #9E988B;
  --vang: #F2C14E; --nen-luot: #2A2410; --than: #16161A;
  --cam: #F5B36B; --nen-cam: #33240F; --xanh: #7FDCA4; --nen-xanh: #16301F; --do: #F28B82; --nen-do: #361816;
  --bo: 16px; --tren: env(safe-area-inset-top); --duoi: env(safe-area-inset-bottom);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--nen); color: var(--chu); }
body { font: 16px/1.45 "Be Vietnam Pro", -apple-system, system-ui, sans-serif; min-height: 100dvh; overscroll-behavior-y: none; }
button { font: inherit; color: inherit; }
.an { display: none !important; }
.so { font-variant-numeric: tabular-nums; }
.cho-mo { display: grid; place-items: center; height: 100dvh; font-weight: 800; font-size: 28px; color: var(--vang); }

/* ---------- khung trang ---------- */
.trang { max-width: 520px; margin: 0 auto; padding: calc(var(--tren) + 10px) 16px calc(var(--duoi) + 132px); }
.thanh-tren { display: flex; align-items: center; gap: 10px; min-height: 48px; }
.thanh-tren h1 { font-size: 18px; font-weight: 700; margin: 0; flex: 1; text-align: center; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 20px; flex: 1; }
.logo b { color: var(--vang); font-weight: 800; }
.logo svg { width: 30px; height: 30px; }
.tieu-de-lon { font-size: 30px; font-weight: 800; margin: 14px 0 6px; letter-spacing: -0.3px; }
.nhan-muc { font-size: 12px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; color: var(--mo); margin: 18px 0 8px; }
.phu { color: var(--mo-ta); font-size: 14px; }
.mo { color: var(--mo); font-size: 13px; }

.nut-tron { width: 44px; height: 44px; border-radius: 22px; border: 0; background: var(--the2); display: grid; place-items: center; cursor: pointer; flex: none; }
.nut-tron svg { width: 22px; height: 22px; }
.cham { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--mo-ta); background: var(--the); border: 1px solid var(--vien);
  border-radius: 999px; padding: 6px 12px; min-height: 36px; cursor: pointer; }
.cham i { width: 8px; height: 8px; border-radius: 4px; background: var(--mo); }
.cham.ok i { background: var(--xanh); } .cham.loi i { background: var(--do); }

/* ---------- thẻ ---------- */
.the { background: var(--the); border: 1px solid var(--vien); border-radius: 18px; padding: 14px; margin: 12px 0; }
.the-buoc { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.so-buoc { width: 28px; height: 28px; border-radius: 14px; background: var(--the2); color: var(--chu-phu); font-weight: 700; font-size: 14px;
  display: grid; place-items: center; flex: none; }
.the-buoc.xong .so-buoc { background: var(--vang); color: var(--than); }
.the-buoc .giua { flex: 1; min-width: 0; }
.the-buoc > svg { width: 20px; height: 20px; color: var(--mo); flex: none; align-self: center; }
.dong-nhap .chu-nut { padding: 0 4px; min-height: 0; }
svg { flex-shrink: 0; }
.the-buoc .ten { font-weight: 700; font-size: 16px; }
.the-buoc .tom { color: var(--mo-ta); font-size: 14px; margin-top: 2px; }
.the-buoc .vang { color: var(--vang); font-weight: 600; }
.mot-dong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.anh-dau { width: 64px; height: 114px; border-radius: 10px; background: var(--the2); border: 1px dashed var(--vien-dut); flex: none; object-fit: cover; }
img.anh-dau { border-style: solid; border-color: var(--vien); }
.o-phong { width: 64px; height: 114px; border-radius: 10px; flex: none; overflow: hidden; background: #222; }
.o-phong canvas { width: 100%; height: 100%; display: block; }

/* ---------- nút ---------- */
.nut { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 56px; border-radius: 18px; border: 0;
  font-weight: 700; font-size: 17px; cursor: pointer; text-decoration: none; padding: 0 18px; transition: transform .12s ease, opacity .2s; }
.nut:active { transform: scale(0.98); }
.nut-vang { background: var(--vang); color: var(--than); }
.nut-tham { background: var(--the2); color: var(--chu); }
.nut-vien { background: transparent; color: var(--chu); border: 1px solid var(--vien-dut); }
.nut-nho { min-height: 44px; width: auto; border-radius: 14px; font-size: 15px; padding: 0 16px; }
.nut:disabled { opacity: 0.35; cursor: default; transform: none; }
.nut svg { width: 20px; height: 20px; }
.hang-nut { display: flex; gap: 10px; }
.hang-nut > * { flex: 1; }
.chu-nut { background: none; border: 0; color: var(--vang); font-weight: 700; font-size: 15px; cursor: pointer; padding: 10px 4px; min-height: 44px; }
.chu-nut:disabled { color: var(--mo); }

.day-co-dinh { position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(var(--duoi) + 12px);
  background: linear-gradient(to top, var(--nen) 70%, rgba(15,15,17,0)); z-index: 5; }
.day-co-dinh > div { max-width: 520px; margin: 0 auto; }
.day-co-dinh .phu { text-align: center; margin-top: 8px; }

/* tiến độ */
.thanh-tien { height: 8px; background: var(--the2); border-radius: 4px; overflow: hidden; }
.thanh-tien > i { display: block; height: 100%; width: 0; background: var(--vang); border-radius: 4px; transition: width .3s ease; }
.chang { display: flex; gap: 6px; margin-top: 10px; }
.chang div { flex: 1; font-size: 12px; color: var(--mo); }
.chang div b { display: block; height: 4px; border-radius: 2px; background: var(--the2); margin-bottom: 6px; }
.chang div.dang { color: var(--chu); } .chang div.dang b { background: var(--vang); }
.chang div.xong b { background: var(--xanh); }

/* khối báo */
.khoi { border-radius: 14px; padding: 12px 14px; font-size: 14px; display: flex; gap: 10px; align-items: flex-start; margin: 10px 0; }
.khoi svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.khoi-loi { background: var(--nen-do); color: var(--chu-phu); } .khoi-loi svg { color: var(--do); }
.khoi-cam { background: var(--nen-cam); color: var(--chu-phu); } .khoi-cam svg { color: var(--cam); }
.khoi-xanh { background: var(--nen-xanh); color: var(--chu-phu); } .khoi-xanh svg { color: var(--xanh); }
.nhan { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; vertical-align: 1px; }
.nhan-vang { background: var(--vang); color: var(--than); } .nhan-cam { background: var(--nen-cam); color: var(--cam); }
.nhan-xanh { background: var(--nen-xanh); color: var(--xanh); } .nhan-do { background: var(--nen-do); color: var(--do); }
.nhan-luot { background: var(--nen-luot); color: var(--vang); font-size: 12px; padding: 4px 9px; border-radius: 8px; }

/* chip, phân đoạn, công tắc, thanh trượt */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 40px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--vien); background: var(--the); color: var(--chu-phu);
  font-size: 14px; font-weight: 600; cursor: pointer; }
.chip.chon { background: var(--vang); color: var(--than); border-color: var(--vang); }
.phan-doan { display: flex; background: var(--than); border-radius: 12px; padding: 3px; gap: 3px; }
.phan-doan button { flex: 1; min-height: 40px; border: 0; border-radius: 10px; background: none; color: var(--mo-ta); font-weight: 600; font-size: 14px; cursor: pointer; }
.phan-doan button.chon { background: var(--chu); color: var(--than); }
.dong-chinh { display: flex; align-items: center; gap: 12px; min-height: 48px; }
.dong-chinh .giua { flex: 1; }
.cong-tac { position: relative; width: 51px; height: 31px; flex: none; }
.cong-tac input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.cong-tac i { position: absolute; inset: 0; border-radius: 16px; background: var(--the2); transition: background .2s; pointer-events: none; }
.cong-tac i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 14px; background: #fff; transition: transform .2s; }
.cong-tac input:checked + i { background: var(--vang); }
.cong-tac input:checked + i::after { transform: translateX(20px); }
input[type=range] { width: 100%; accent-color: var(--vang); height: 32px; }
input[type=range]:disabled { opacity: 0.35; }
.cham-mau { width: 40px; height: 40px; border-radius: 20px; border: 2px solid var(--vien); cursor: pointer; }
.cham-mau.chon { border-color: var(--vang); box-shadow: 0 0 0 2px var(--nen) inset; }

/* ô nhập */
.o-nhap { width: 100%; min-height: 48px; background: var(--than); color: var(--chu); border: 1px solid var(--vien); border-radius: 12px; padding: 12px 14px;
  font: 16px/1.4 "Be Vietnam Pro", system-ui, sans-serif; }
textarea.o-nhap { min-height: 96px; resize: vertical; }
.o-nhap:focus { outline: none; border-color: var(--vang); }
label.nhan-o { display: block; font-size: 14px; color: var(--mo-ta); margin: 12px 0 6px; }

/* ---------- Chọn Phong Cách ---------- */
/* hàng nhóm công dụng (D19): cuộn ngang, một dòng, ô bấm cao 40px */
.hang-nhom { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 4px; scrollbar-width: none; margin-top: 4px; }
.hang-nhom::-webkit-scrollbar { display: none; }
.hang-nhom button { flex: none; min-height: 40px; padding: 0 14px; border-radius: 20px; border: 1px solid var(--vien); background: var(--the);
  color: var(--chu-phu); font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.hang-nhom button.chon { background: var(--chu); color: var(--than); border-color: var(--chu); }
.mo-nhom { margin: 6px 0 8px; }
.nhan-nhom { font-size: 13px; color: var(--mo-ta); margin: 12px 0 6px; font-weight: 600; }
.hang-mau { gap: 10px; }
.hang-phong { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 10px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.hang-phong::-webkit-scrollbar { display: none; }
.o-mau { flex: 0 0 84px; scroll-snap-align: start; background: none; border: 0; padding: 0; cursor: pointer; text-align: center; }
.o-mau canvas { width: 84px; height: 149px; border-radius: 12px; border: 2px solid transparent; display: block; background: #222; }
.o-mau.chon canvas { border-color: var(--vang); }
.o-mau span { display: block; font-size: 12px; color: var(--mo-ta); margin-top: 5px; line-height: 1.25; }
.o-mau.chon span { color: var(--chu); font-weight: 700; }
.xem-mau { display: flex; gap: 14px; align-items: flex-start; }
.xem-mau canvas { width: 120px; height: 213px; border-radius: 14px; background: #222; flex: none; }

/* ---------- Xem nháp ---------- */
#lop-nhap { position: fixed; inset: 0; background: #000; z-index: 20; display: flex; flex-direction: column;
  padding: calc(var(--tren) + 6px) 12px calc(var(--duoi) + 10px); }
.nhap-tren { display: flex; align-items: center; gap: 10px; min-height: 48px; max-width: 520px; width: 100%; margin: 0 auto; }
.nhap-tren .giua { flex: 1; min-width: 0; text-align: center; }
.nhap-tren .ten { font-weight: 700; font-size: 15px; }
.nhap-khung-ngoai { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 6px 0; }
.nhap-khung { position: relative; height: 100%; max-width: 100%; aspect-ratio: 9 / 16; border-radius: 16px; overflow: hidden; background: #111; }
.nhap-canvas { width: 100%; height: 100%; display: block; }
.nhap-video-an { position: absolute; width: 2px; height: 2px; opacity: 0; pointer-events: none; left: 0; top: 0; }
.nhap-phat { position: absolute; inset: 0; display: grid; place-items: center; background: none; border: 0; cursor: pointer; }
.nhap-phat span { width: 68px; height: 68px; border-radius: 34px; background: rgba(0,0,0,.5); display: grid; place-items: center; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.nhap-phat svg { width: 30px; height: 30px; color: #fff; }
.nhap-phat.dang span { opacity: 0; transition: opacity .3s; }
.nhap-tua { position: absolute; left: 10px; right: 10px; bottom: 8px; display: flex; align-items: center; gap: 8px; font-size: 12px; color: #fff; text-shadow: 0 1px 3px #000; }
.nhap-tua input { flex: 1; height: 28px; }
.nhap-duoi { max-width: 520px; width: 100%; margin: 0 auto; }
.dong-nhap { display: flex; align-items: center; gap: 10px; background: var(--the); border-radius: 14px; padding: 10px 12px; margin: 8px 0; cursor: pointer; border: 1px solid var(--vien); }
.dong-nhap svg { width: 22px; height: 22px; color: var(--vang); flex: none; }
.dong-nhap .giua { flex: 1; min-width: 0; }
.dong-nhap .ten { font-weight: 700; font-size: 15px; }

/* ---------- tấm trượt lên ---------- */
#tam { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; }
.tam-ruot { background: var(--nen); width: 100%; max-width: 560px; border-radius: 22px 22px 0 0; max-height: 88dvh; overflow-y: auto;
  padding: 8px 16px calc(var(--duoi) + 110px); animation: truot-len .28s cubic-bezier(.2,.9,.3,1); position: relative; }
.tam-ruot.nua { max-height: 58dvh; }
.tam-ruot .tay-nam { width: 40px; height: 5px; border-radius: 3px; background: var(--vien-dut); margin: 4px auto 6px; }
.tam-day { position: sticky; bottom: calc(-1 * (var(--duoi) + 110px)); margin: 12px -16px calc(-1 * (var(--duoi) + 110px)); padding: 12px 16px calc(var(--duoi) + 12px);
  background: linear-gradient(to top, var(--nen) 75%, rgba(15,15,17,0)); }
@keyframes truot-len { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .tam-ruot { animation: none; } .nut, .thanh-tien > i { transition: none; } }

/* thông báo nổi */
#bao { position: fixed; left: 50%; bottom: calc(var(--duoi) + 96px); transform: translateX(-50%); z-index: 60; max-width: min(92vw, 480px);
  background: var(--chu); color: var(--than); font-weight: 600; font-size: 14px; padding: 10px 16px; border-radius: 14px; box-shadow: 0 6px 24px rgba(0,0,0,.4);
  opacity: 0; pointer-events: none; transition: opacity .25s; }
#bao.hien { opacity: 1; }

.cuon-ngang { overflow-x: auto; }

/* cảnh trám */
.the-canh { display: flex; gap: 12px; }
.the-canh .anh { width: 72px; height: 128px; border-radius: 10px; object-fit: cover; background: var(--the2); flex: none; }
.the-canh .giua { flex: 1; min-width: 0; }
.the-canh a { color: var(--mo-ta); }

/* màn hướng dẫn */
.buoc-hd { display: flex; gap: 12px; align-items: center; margin: 12px 0; }
.buoc-hd .so-buoc { background: var(--vang); color: var(--than); }
pre.chep { white-space: pre-wrap; word-break: break-word; background: var(--than); border: 1px solid var(--vien); border-radius: 12px; padding: 12px; font-size: 13px; max-height: 200px; overflow: auto; }

/* Tài khoản bản nội bộ (D24) */
.dai-luot { display: flex; align-items: center; gap: 12px; }
.dai-luot .giua { flex: 1; min-width: 0; }
.dai-luot .so-luot { font-size: 16px; }
.dai-luot .so-luot b { font-size: 24px; color: var(--vang); font-variant-numeric: tabular-nums; margin-right: 4px; }
.dai-luot.sap_het .so-luot b, .dai-luot.het .so-luot b, .dai-luot.tran_ngay .so-luot b { color: #F08A4B; }
.dong-tk { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin: -4px 0 8px; }
.dong-tk .email { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dong-tk .chu-nut { flex: none; white-space: nowrap; }
.o-ma { font-size: 28px; letter-spacing: 0.4em; text-align: center; font-variant-numeric: tabular-nums; }
.qr { display: grid; place-items: center; background: #fff; border-radius: 18px; padding: 12px; margin: 12px auto; max-width: 324px; }
.qr img { width: 100%; height: auto; display: block; }
.dong-ck { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--vien); }
.dong-ck:last-child { border-bottom: 0; }
.dong-ck .phu { flex: none; width: 110px; }
.dong-ck b { flex: 1; min-width: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }

/* ---------- đăng ký (D25) ---------- */
.chon-nhom { display: flex; flex-wrap: wrap; gap: 8px; }
.chon-nhom .cham { min-height: 44px; font-size: 15px; }
.chon-nhom .cham.ok { color: var(--chu); border-color: var(--vang); }
.o-bay { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.dong-tk a.chu-nut { text-decoration: none; display: inline-flex; align-items: center; }
div.nhan-o { font-size: 14px; color: var(--mo-ta); margin: 12px 0 6px; }
