/* Thuy To Viral Short Studio — giao diện tối kiểu phòng dựng, tông thương hiệu Thúy Tô */
:root {
  --nen: #14110f;
  --mat: #1d1917;
  --mat2: #26211e;
  --mat3: #312a26;
  --vien: #3a322d;
  --chu: #f4efea;
  --chu2: #c9bfb6;
  --mo: #9a8f86;
  --nhan: #e8aa82;
  --nhan-dam: #d98f63;
  --nhan-nhat: rgba(232, 170, 130, 0.14);
  --kem: #c0afa0;
  --nau: #6f5f55;
  --ok: #6cc28f;
  --loi: #ff7a6b;
  --vang: #ffd400;
  --r: 12px;
  --r-nho: 8px;
  --bong: 0 10px 40px rgba(0, 0, 0, 0.45);
  --font: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --tren: env(safe-area-inset-top, 0px);
  --duoi: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--nen); color: var(--chu); font-family: var(--font); font-size: 14px; -webkit-text-size-adjust: 100%; }
body { overflow: hidden; overscroll-behavior: none; -webkit-tap-highlight-color: transparent; }
#app { height: 100%; display: flex; flex-direction: column; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--nhan); }
h1, h2, h3, h4 { margin: 0; font-weight: 800; letter-spacing: -0.01em; }
p { margin: 0 0 8px; line-height: 1.55; }
.an { display: none !important; }
.mo { color: var(--mo); }
.nho { font-size: 12px; }

.man-cho { flex: 1; display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--kem); }
.man-cho img { border-radius: 20px; animation: tho 1.6s ease-in-out infinite; }
@keyframes tho { 50% { transform: scale(0.94); opacity: 0.7; } }

/* ---------- nút & ô nhập */
.nut { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--vien); background: var(--mat2); cursor: pointer; font-weight: 600; white-space: nowrap; transition: background 0.15s, border-color 0.15s, transform 0.1s; touch-action: manipulation; }
.nut:hover { background: var(--mat3); }
.nut:active { transform: scale(0.97); }
.nut:disabled { opacity: 0.45; pointer-events: none; }
.nut.chinh { background: var(--nhan); border-color: var(--nhan); color: #20150f; }
.nut.chinh:hover { background: var(--nhan-dam); }
.nut.to { min-height: 48px; padding: 0 22px; font-size: 15px; border-radius: 12px; }
.nut.nho { min-height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.nut.trong { background: transparent; border-color: transparent; }
.nut.trong:hover { background: var(--mat2); }
.nut.nguy { color: var(--loi); }
.nut-icon { width: 36px; height: 36px; padding: 0; border-radius: 10px; border: 0; background: transparent; cursor: pointer; display: inline-grid; place-items: center; font-size: 18px; color: var(--chu2); }
.nut-icon:hover { background: var(--mat2); color: var(--chu); }
.nut-icon.bat { color: var(--nhan); background: var(--nhan-nhat); }

.o { width: 100%; min-height: 40px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--vien); background: var(--nen); outline: none; }
.o:focus { border-color: var(--nhan); box-shadow: 0 0 0 3px var(--nhan-nhat); }
textarea.o { min-height: 84px; resize: vertical; line-height: 1.5; }
select.o { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--mo) 50%), linear-gradient(135deg, var(--mo) 50%, transparent 50%); background-position: calc(100% - 17px) 17px, calc(100% - 12px) 17px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
label.nhan-o { display: block; font-size: 12.5px; font-weight: 600; color: var(--chu2); margin: 12px 0 6px; }
.dong { display: flex; align-items: center; gap: 8px; }
.dong.cach { justify-content: space-between; }
.dong.boc { flex-wrap: wrap; }
.cot { display: flex; flex-direction: column; gap: 8px; }

/* thanh trượt */
.truot { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; margin: 10px 0; }
.truot > span:first-child { font-size: 12.5px; color: var(--chu2); }
.truot > output { font-size: 12px; color: var(--mo); min-width: 38px; text-align: right; font-variant-numeric: tabular-nums; }
.truot input[type=range] { grid-column: 1 / -1; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: var(--vien); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -6px; border-radius: 50%; background: var(--chu); border: 3px solid var(--nhan); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 4px; background: var(--vien); }
input[type=range]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--chu); border: 3px solid var(--nhan); }
input[type=color] { width: 36px; height: 30px; padding: 0; border: 1px solid var(--vien); border-radius: 8px; background: none; cursor: pointer; }
.cong-tac { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; cursor: pointer; }
.cong-tac input { appearance: none; width: 38px; height: 22px; border-radius: 22px; background: var(--vien); position: relative; cursor: pointer; transition: background 0.2s; flex: none; margin: 0; }
.cong-tac input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform 0.2s; }
.cong-tac input:checked { background: var(--nhan); }
.cong-tac input:checked::after { transform: translateX(16px); }
.chon-nhom { display: flex; flex-wrap: wrap; gap: 6px; }
.chon-nhom button { padding: 7px 12px; border-radius: 9px; border: 1px solid var(--vien); background: var(--mat2); cursor: pointer; font-size: 12.5px; font-weight: 600; }
.chon-nhom button:disabled { opacity: 0.35; cursor: not-allowed; text-decoration: line-through; }
.chon-nhom button.bat { background: var(--nhan-nhat); border-color: var(--nhan); color: var(--nhan); }

/* ---------- đầu trang */
.dau { display: flex; align-items: center; gap: 12px; padding: calc(8px + var(--tren)) 16px 8px; min-height: 56px; border-bottom: 1px solid var(--vien); background: var(--mat); flex: none; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; min-width: 0; }
.logo img { width: 34px; height: 34px; border-radius: 9px; flex: none; }
.logo b { font-size: 15px; font-weight: 800; white-space: nowrap; }
.logo small { display: block; font-size: 11px; color: var(--mo); font-weight: 500; }
.dau .gian { flex: 1; }

/* ---------- trang chủ */
.trang { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.khung { max-width: 1180px; margin: 0 auto; padding: 22px 16px calc(40px + var(--duoi)); }
.hero { display: grid; grid-template-columns: 1.2fr 1fr; gap: 18px; margin-bottom: 26px; }
.hero-chinh { position: relative; overflow: hidden; border-radius: 18px; padding: 26px; background: radial-gradient(120% 140% at 0% 0%, #4a3b33 0%, #2a221e 45%, #1d1917 100%); border: 1px solid var(--vien); display: flex; flex-direction: column; justify-content: space-between; min-height: 210px; }
.hero-chinh h1 { font-size: 26px; line-height: 1.2; margin-bottom: 8px; }
.hero-chinh h1 em { font-style: normal; color: var(--nhan); }
.hero-chinh p { color: var(--chu2); max-width: 460px; }
.hero-nut { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.hero-phu { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.o-nhanh { border-radius: 16px; padding: 16px; background: var(--mat); border: 1px solid var(--vien); cursor: pointer; display: flex; flex-direction: column; gap: 6px; transition: border-color 0.15s, transform 0.15s; text-align: left; }
.o-nhanh:hover { border-color: var(--nhan); transform: translateY(-2px); }
.o-nhanh .bieu { font-size: 24px; }
.o-nhanh b { font-size: 14px; }
.o-nhanh span { font-size: 12px; color: var(--mo); line-height: 1.45; }
.tieu-muc { display: flex; align-items: baseline; justify-content: space-between; margin: 28px 0 12px; }
.tieu-muc h2 { font-size: 17px; }
.luoi-tinh-nang { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.luoi-du-an { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.the-du-an { border-radius: 14px; overflow: hidden; background: var(--mat); border: 1px solid var(--vien); cursor: pointer; position: relative; }
.the-du-an:hover { border-color: var(--kem); }
.the-du-an .anh { aspect-ratio: 3 / 4; background: #0c0a09 center / cover no-repeat; display: grid; place-items: center; color: var(--mo); font-size: 28px; }
.the-du-an .ten { padding: 8px 10px 2px; font-weight: 700; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.the-du-an .phu { padding: 0 10px 10px; font-size: 11.5px; color: var(--mo); }
.the-du-an .menu { position: absolute; top: 6px; right: 6px; background: rgba(0, 0, 0, 0.55); border-radius: 8px; }
.trong-rong { padding: 36px 16px; text-align: center; color: var(--mo); border: 1px dashed var(--vien); border-radius: 14px; }
.bang-canh-bao { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 12px; background: var(--nhan-nhat); border: 1px solid rgba(232, 170, 130, 0.35); margin-bottom: 18px; }
.bang-canh-bao p { margin: 0; flex: 1; }
.chan-trang { text-align: center; color: var(--mo); font-size: 12px; margin-top: 36px; }

/* ---------- trang công cụ (cắt tự động, đánh giá…) */
.cong-cu { max-width: 980px; margin: 0 auto; padding: 18px 16px calc(40px + var(--duoi)); }
.cong-cu > h1 { font-size: 22px; margin: 6px 0 4px; }
.cong-cu > .mo-ta { color: var(--chu2); margin-bottom: 18px; }
.the { background: var(--mat); border: 1px solid var(--vien); border-radius: 16px; padding: 16px; margin-bottom: 14px; }
.the h3 { font-size: 15px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.the h3 .so { width: 24px; height: 24px; border-radius: 50%; background: var(--nhan); color: #20150f; font-size: 12px; display: grid; place-items: center; flex: none; }
.luoi2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; }
.vung-tha { border: 2px dashed var(--vien); border-radius: 14px; padding: 26px 16px; text-align: center; cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.vung-tha:hover, .vung-tha.dang-keo { border-color: var(--nhan); background: var(--nhan-nhat); }
.vung-tha .bieu { font-size: 30px; }
.tep-da-chon { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 12px; background: var(--mat2); }
.tep-da-chon img, .tep-da-chon .anh-o { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; background: #000; flex: none; }
.tien-trinh { margin: 12px 0; }
.tien-trinh .vach { height: 8px; border-radius: 8px; background: var(--vien); overflow: hidden; }
.tien-trinh .vach > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--nhan-dam), var(--nhan)); transition: width 0.3s; }
.tien-trinh .chu { font-size: 12.5px; color: var(--chu2); margin-top: 6px; }
.ds-doan { display: flex; flex-direction: column; gap: 10px; }
.doan { display: grid; grid-template-columns: auto 1fr; gap: 12px; padding: 12px; border-radius: 14px; background: var(--mat2); border: 1px solid var(--vien); }
.doan.bo { opacity: 0.45; }
.doan .diem { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-weight: 900; font-size: 16px; background: var(--nhan-nhat); color: var(--nhan); }
.doan .tieu { font-weight: 800; }
.doan .moc-tg { font-size: 12px; color: var(--mo); font-variant-numeric: tabular-nums; }
.doan .loi { font-size: 12.5px; color: var(--chu2); margin: 6px 0; max-height: 64px; overflow: auto; }
.doan .chinh-mep { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.xem-duyet { position: sticky; top: 0; z-index: 3; background: #000; border-radius: 14px; overflow: hidden; margin-bottom: 12px; }
.xem-duyet video { display: block; width: 100%; max-height: 42vh; background: #000; }
.ket-qua-short { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.diem-lon { font-size: 44px; font-weight: 900; color: var(--nhan); line-height: 1; }
.thanh-diem { display: grid; grid-template-columns: 150px 1fr 34px; gap: 10px; align-items: center; margin: 8px 0; font-size: 13px; }
.thanh-diem .v { height: 8px; border-radius: 8px; background: var(--vien); overflow: hidden; }
.thanh-diem .v i { display: block; height: 100%; background: var(--nhan); }
.ds-y { margin: 6px 0 0; padding-left: 18px; line-height: 1.6; }
.hop-chu { white-space: pre-wrap; background: var(--nen); border: 1px solid var(--vien); border-radius: 12px; padding: 12px; line-height: 1.6; font-size: 13px; max-height: 420px; overflow: auto; }

/* ---------- trình dựng */
.bien-tap { flex: 1; display: grid; grid-template-columns: 330px minmax(0, 1fr) 300px; grid-template-rows: minmax(0, 1fr) auto; min-height: 0; }
.bang-trai { grid-row: 1; display: grid; grid-template-columns: 64px 1fr; border-right: 1px solid var(--vien); background: var(--mat); min-height: 0; }
.the-trai { display: flex; flex-direction: column; gap: 2px; padding: 8px 4px; border-right: 1px solid var(--vien); overflow-y: auto; }
.the-trai button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 2px; border: 0; background: transparent; border-radius: 10px; cursor: pointer; color: var(--mo); font-size: 10.5px; font-weight: 600; }
.the-trai button .i { font-size: 19px; line-height: 1; }
.the-trai button:hover { color: var(--chu); background: var(--mat2); }
.the-trai button.bat { color: var(--nhan); background: var(--nhan-nhat); }
.noi-dung-trai { overflow-y: auto; padding: 14px; min-height: 0; }
.noi-dung-trai h4 { font-size: 13px; margin: 4px 0 10px; color: var(--chu2); }
.luoi-media { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.o-media { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #0b0908 center / cover; border: 1px solid var(--vien); cursor: pointer; }
.o-media .dai { position: absolute; right: 5px; bottom: 5px; font-size: 10.5px; padding: 1px 5px; border-radius: 5px; background: rgba(0, 0, 0, 0.65); }
.o-media .loai { position: absolute; left: 5px; top: 5px; font-size: 12px; }
.o-media .them { position: absolute; right: 5px; top: 5px; width: 24px; height: 24px; border-radius: 50%; background: var(--nhan); color: #20150f; display: grid; place-items: center; font-weight: 900; opacity: 0; transition: opacity 0.15s; }
.o-media:hover .them { opacity: 1; }
.o-media .ten-am { position: absolute; inset: auto 6px 22px 6px; font-size: 11px; line-height: 1.3; max-height: 30px; overflow: hidden; }
.luoi-mau { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.mau-chu { padding: 14px 8px; border-radius: 10px; background: #0c0a09; border: 1px solid var(--vien); cursor: pointer; text-align: center; font-weight: 800; font-size: 15px; min-height: 58px; display: grid; place-items: center; }
.mau-chu:hover { border-color: var(--nhan); }
.luoi-nhan { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.luoi-nhan button { aspect-ratio: 1; font-size: 26px; border-radius: 10px; border: 1px solid transparent; background: var(--mat2); cursor: pointer; font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif; }
.luoi-nhan button:hover { border-color: var(--nhan); }
.luoi-loc { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.o-loc { cursor: pointer; text-align: center; font-size: 11.5px; color: var(--chu2); }
.o-loc canvas { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; border: 2px solid transparent; display: block; margin-bottom: 4px; background: #000; }
.o-loc.bat canvas { border-color: var(--nhan); }
.o-loc.bat { color: var(--nhan); }

.man-xem { grid-row: 1; display: flex; flex-direction: column; min-height: 0; min-width: 0; background: #0b0908; }
.khung-xem { flex: 1; min-height: 0; display: grid; place-items: center; padding: 14px; position: relative; overflow: hidden; }
.khung-xem .bao-canvas { position: relative; box-shadow: var(--bong); }
.khung-xem canvas { display: block; width: 100%; height: 100%; background: #000; border-radius: 4px; }
.lop-chon { position: absolute; border: 1.5px solid var(--nhan); border-radius: 3px; pointer-events: none; }
.lop-chon .goc { position: absolute; right: -9px; bottom: -9px; width: 18px; height: 18px; border-radius: 50%; background: var(--nhan); border: 2px solid #fff; pointer-events: auto; cursor: nwse-resize; touch-action: none; }
.lop-chon .xoay { position: absolute; left: 50%; top: -30px; width: 18px; height: 18px; margin-left: -9px; border-radius: 50%; background: #fff; border: 2px solid var(--nhan); pointer-events: auto; cursor: grab; touch-action: none; }
.dieu-khien { display: flex; align-items: center; gap: 10px; padding: 6px 14px 8px; }
.dieu-khien .gio { font-variant-numeric: tabular-nums; font-size: 12.5px; color: var(--chu2); min-width: 120px; }
.dieu-khien .nut-phat { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--chu); color: #111; font-size: 18px; cursor: pointer; display: grid; place-items: center; }

.bang-phai { grid-row: 1; border-left: 1px solid var(--vien); background: var(--mat); overflow-y: auto; min-height: 0; }
.bang-phai .dau-bang { position: sticky; top: 0; background: var(--mat); z-index: 2; padding: 12px 14px 0; border-bottom: 1px solid var(--vien); }
.bang-phai .dau-bang h3 { font-size: 14px; margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; }
.the-ngang { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.the-ngang::-webkit-scrollbar { display: none; }
.the-ngang button { padding: 8px 10px; border: 0; background: none; cursor: pointer; font-weight: 600; font-size: 12.5px; color: var(--mo); border-bottom: 2px solid transparent; white-space: nowrap; }
.the-ngang button.bat { color: var(--chu); border-bottom-color: var(--nhan); }
.bang-phai .than { padding: 6px 14px 20px; }

/* dòng thời gian */
.vung-tg { grid-column: 1 / -1; grid-row: 2; border-top: 1px solid var(--vien); background: var(--mat); display: flex; flex-direction: column; height: 300px; min-height: 180px; }
.cong-cu-tg { display: flex; align-items: center; gap: 4px; padding: 6px 10px; border-bottom: 1px solid var(--vien); overflow-x: auto; scrollbar-width: none; flex: none; }
.cong-cu-tg::-webkit-scrollbar { display: none; }
.cong-cu-tg .nut-cc { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 54px; padding: 4px 6px; border: 0; background: none; border-radius: 8px; cursor: pointer; color: var(--chu2); font-size: 10.5px; font-weight: 600; }
.cong-cu-tg .nut-cc .i { font-size: 17px; line-height: 1.1; }
.cong-cu-tg .nut-cc:hover { background: var(--mat2); color: var(--chu); }
.cong-cu-tg .nut-cc:disabled { opacity: 0.35; pointer-events: none; }
.cong-cu-tg .phan-cach { width: 1px; height: 28px; background: var(--vien); margin: 0 4px; flex: none; }
.tg { flex: 1; min-height: 0; position: relative; display: grid; grid-template-columns: 92px 1fr; }
.tg-nhan { border-right: 1px solid var(--vien); padding-top: 26px; overflow: hidden; background: var(--mat); z-index: 2; }
.tg-nhan .nr { display: flex; align-items: center; gap: 2px; padding: 0 4px 0 8px; font-size: 11px; color: var(--mo); border-bottom: 1px solid transparent; }
.tg-nhan .nr span { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tg-nhan .nr button { border: 0; background: none; cursor: pointer; font-size: 12px; padding: 2px; color: var(--mo); border-radius: 5px; }
.tg-nhan .nr button:hover { color: var(--chu); background: var(--mat2); }
.tg-cuon { overflow: auto; position: relative; touch-action: pan-x pan-y; scrollbar-width: thin; }
.tg-trong { position: relative; min-height: 100%; }
.thuoc { position: sticky; top: 0; height: 26px; background: var(--mat); z-index: 3; border-bottom: 1px solid var(--vien); cursor: pointer; }
.thuoc canvas { display: block; height: 26px; }
.hang { position: relative; border-bottom: 1px solid rgba(255, 255, 255, 0.03); }
.doan-tg { position: absolute; top: 4px; bottom: 4px; border-radius: 7px; overflow: hidden; cursor: grab; border: 1.5px solid transparent; touch-action: none; user-select: none; -webkit-user-select: none; }
.doan-tg.video, .doan-tg.anh { background: #2b3440; }
.doan-tg.lop { background: #3b3148; }
.doan-tg.chu { background: #54402f; }
.doan-tg.nhan { background: #4a3a4f; }
.doan-tg.am { background: #213a31; }
.doan-tg.phu_de { background: #4b4526; }
.doan-tg canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.doan-tg .nhan-d { position: absolute; left: 6px; top: 2px; font-size: 10.5px; font-weight: 700; white-space: nowrap; text-shadow: 0 1px 2px #000; pointer-events: none; max-width: calc(100% - 12px); overflow: hidden; text-overflow: ellipsis; }
.doan-tg.chon { border-color: #fff; box-shadow: 0 0 0 1px var(--nhan); z-index: 2; }
.doan-tg .mep { position: absolute; top: 0; bottom: 0; width: 12px; background: rgba(255, 255, 255, 0.85); display: none; cursor: ew-resize; touch-action: none; }
.doan-tg .mep::after { content: ''; position: absolute; left: 4px; top: 30%; bottom: 30%; width: 2px; border-radius: 2px; background: #333; }
.doan-tg.chon .mep { display: block; }
.doan-tg .mep.t { left: 0; border-radius: 6px 0 0 6px; }
.doan-tg .mep.p { right: 0; border-radius: 0 6px 6px 0; }
.nut-cc-chuyen { position: absolute; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 6px; border: 1px solid var(--vien); background: var(--mat2); z-index: 3; cursor: pointer; font-size: 11px; display: grid; place-items: center; padding: 0; }
.nut-cc-chuyen.co { background: var(--nhan); color: #20150f; border-color: var(--nhan); }
.dau-doc { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #fff; z-index: 4; pointer-events: none; }
.dau-doc::before { content: ''; position: absolute; top: 0; left: -6px; border: 7px solid transparent; border-top: 9px solid #fff; }
.tay-keo-tg { height: 8px; cursor: ns-resize; flex: none; margin-top: -4px; position: relative; z-index: 5; }

/* thanh dưới (điện thoại) */
.thanh-duoi { display: none; }
.man-bang { display: contents; }

/* ---------- hộp thoại & thông báo */
.modal-nen { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); display: grid; place-items: center; z-index: 100; padding: 16px; backdrop-filter: blur(3px); }
.modal { width: 100%; background: var(--mat); border: 1px solid var(--vien); border-radius: 18px; box-shadow: var(--bong); max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
.modal-dau { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 0; }
.modal-dau h3 { font-size: 16px; }
.nut-x { width: 32px; height: 32px; border: 0; border-radius: 8px; background: none; color: var(--mo); font-size: 22px; cursor: pointer; }
.modal-than { padding: 12px 16px; overflow-y: auto; }
.modal-chan { display: flex; justify-content: flex-end; gap: 8px; padding: 0 16px 16px; flex-wrap: wrap; }
#toasts { position: fixed; left: 50%; bottom: calc(24px + var(--duoi)); transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 200; pointer-events: none; width: min(92vw, 440px); }
.toast { padding: 11px 16px; border-radius: 12px; background: #f4efea; color: #1d1917; font-weight: 600; box-shadow: var(--bong); transition: opacity 0.35s, transform 0.35s; text-align: center; }
.toast.loi { background: #ff7a6b; color: #2a0d08; }
.toast.ok { background: #6cc28f; color: #0b2515; }
.toast.an { opacity: 0; transform: translateY(8px); }

/* ---------- đăng ký */
.dang-ky { flex: 1; overflow-y: auto; display: grid; place-items: center; padding: calc(20px + var(--tren)) 16px calc(20px + var(--duoi)); background: radial-gradient(90% 60% at 50% 0%, #3a2e28 0%, var(--nen) 70%); }
.the-dk { width: 100%; max-width: 440px; background: var(--mat); border: 1px solid var(--vien); border-radius: 22px; padding: 26px 22px; box-shadow: var(--bong); }
.the-dk .dau-dk { text-align: center; margin-bottom: 18px; }
.the-dk .dau-dk img { width: 76px; height: 76px; border-radius: 20px; }
.the-dk h1 { font-size: 21px; margin: 12px 0 4px; }
.the-dk .phu { color: var(--mo); font-size: 13px; }
.the-dk .loi-o { color: var(--loi); font-size: 12px; margin-top: 4px; min-height: 0; }
.hoac { display: flex; align-items: center; gap: 10px; color: var(--mo); font-size: 12px; margin: 16px 0 4px; }
.hoac::before, .hoac::after { content: ''; flex: 1; height: 1px; background: var(--vien); }
.nut-google { display: flex; justify-content: center; min-height: 44px; }
.nut-google iframe { color-scheme: light; } /* khung Google là trang sáng: khác chế độ màu với trang tối thì trình duyệt tô nền trắng quanh nút */
.da-google { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--mat2); font-size: 13px; }

/* cài đặt */
.buoc-huong-dan { margin: 8px 0 0; padding-left: 20px; line-height: 1.7; color: var(--chu2); }
.trang-thai-ket-noi { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 12.5px; padding: 4px 10px; border-radius: 20px; }
.trang-thai-ket-noi.ok { background: rgba(108, 194, 143, 0.15); color: var(--ok); }
.trang-thai-ket-noi.chua { background: rgba(255, 122, 107, 0.12); color: var(--loi); }

/* ---------- ĐIỆN THOẠI */
@media (max-width: 1180px) {
  .bien-tap { grid-template-columns: 300px minmax(0, 1fr) 270px; }
}
@media (max-width: 980px) and (min-width: 821px) {
  .bien-tap { grid-template-columns: 280px minmax(0, 1fr); }
  .bang-phai { position: fixed; right: 0; top: 56px; bottom: 300px; width: 290px; z-index: 20; box-shadow: var(--bong); }
  .bang-phai.dong-lai { display: none; }
}
@media (max-width: 820px) {
  body { font-size: 14.5px; }
  .dau { padding: calc(6px + var(--tren)) 10px 6px; min-height: 50px; gap: 8px; }
  .logo b { font-size: 13.5px; }
  .logo small { display: none; }
  .hero { grid-template-columns: 1fr; }
  .hero-chinh { min-height: 0; padding: 20px; }
  .hero-chinh h1 { font-size: 21px; }
  .luoi-tinh-nang { grid-template-columns: 1fr 1fr; gap: 10px; }
  .luoi-du-an { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .luoi2 { grid-template-columns: 1fr; }
  .thanh-diem { grid-template-columns: 110px 1fr 30px; }

  .bien-tap { display: flex; flex-direction: column; }
  .man-xem { flex: 1; min-height: 0; }
  .khung-xem { padding: 8px; }
  .dieu-khien { padding: 2px 10px 4px; }
  .dieu-khien .nut-phat { width: 40px; height: 40px; }
  .vung-tg { height: 36vh; min-height: 170px; }
  .tg { grid-template-columns: 44px 1fr; }
  .tg-nhan .nr span { display: none; }
  .tay-keo-tg { display: none; }
  .bang-trai, .bang-phai { position: fixed; left: 0; right: 0; bottom: calc(58px + var(--duoi)); max-height: 56vh; z-index: 30; border: 0; border-top: 1px solid var(--vien); border-radius: 18px 18px 0 0; box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.55); transform: translateY(calc(100% + 90px)); transition: transform 0.25s ease; display: block; }
  .bang-trai.mo-ra, .bang-phai.mo-ra { transform: none; }
  .bang-trai { display: flex; flex-direction: column; }
  .bang-trai .the-trai { display: none; }
  .noi-dung-trai { max-height: 56vh; padding-top: 6px; }
  .bang-phai { overflow-y: auto; }
  .nam-keo { display: block; width: 44px; height: 5px; border-radius: 5px; background: var(--vien); margin: 8px auto 2px; }
  .thanh-duoi { display: flex; flex: none; overflow-x: auto; gap: 2px; padding: 4px 6px calc(4px + var(--duoi)); background: var(--mat); border-top: 1px solid var(--vien); scrollbar-width: none; }
  .thanh-duoi::-webkit-scrollbar { display: none; }
  .thanh-duoi button { flex: none; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 62px; padding: 6px 4px; border: 0; background: none; color: var(--chu2); font-size: 10.5px; font-weight: 600; border-radius: 10px; cursor: pointer; }
  .thanh-duoi button .i { font-size: 19px; line-height: 1.1; }
  .thanh-duoi button.bat { color: var(--nhan); }
  .an-dt { display: none !important; }
}
@media (min-width: 821px) {
  .nam-keo { display: none; }
  .chi-dt { display: none !important; }
}
