/* SapaGo — hệ thiết kế "Sổ tay đường núi"
   Nền giấy trung tính để ảnh nổi; màu chính xanh rêu; nhấn vàng lúa chín.
   Không dùng đỏ làm màu thương hiệu (ảnh Sa Pa vốn đã rất nhiều đỏ). */
:root {
  --giay: #F3EFE6;
  --giay-2: #E9E3D4;
  --trang: #FBF9F4;
  --muc: #17261F;
  --reu: #234535;
  --reu-2: #2F5D47;
  --cham: #283A6B;
  --lua: #E3A92B;
  --lua-dam: #B9841A;
  --ke: #CFC6B2;
  --mo: #56635B;
  --tot: #2A6646;
  --luu-y: #8A5A00;
  --doi: #97382A;
  --tot-nen: #DDEBDF;
  --luu-y-nen: #F6E7C3;
  --doi-nen: #F3D9D2;
  --ngay1: #2F5D47;
  --ngay2: #283A6B;
  --ngay3: #B9841A;
  --bo: 14px;
  --bong: 0 1px 0 rgba(23,38,31,.06), 0 10px 28px -14px rgba(23,38,31,.35);
  --chu: "Be Vietnam Pro", "Segoe UI", system-ui, sans-serif;
  --de: "Fraunces", "Times New Roman", serif;
  --rong: 1120px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--giay); color: var(--muc);
  font-family: var(--chu); font-size: 16px; line-height: 1.6;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
  font-variant-numeric: tabular-nums;
}
body::before { /* đường đồng mức mờ làm nền */
  content: ""; position: fixed; inset: 0; z-index: -1; opacity: .5; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='520' height='520' viewBox='0 0 520 520'%3E%3Cg fill='none' stroke='%23CFC6B2' stroke-width='1'%3E%3Cpath d='M-20 120c80-60 150 40 240 0s160-90 320-20'/%3E%3Cpath d='M-20 160c90-50 160 50 250 10s150-80 310-10'/%3E%3Cpath d='M-20 210c100-40 150 60 260 20s170-60 300 10'/%3E%3Cpath d='M-20 330c70 40 180-50 270-10s140 70 290 0'/%3E%3Cpath d='M-20 370c80 50 170-40 260 0s160 60 300-10'/%3E%3Cpath d='M-20 420c90 40 190-30 280 10s150 40 280-20'/%3E%3C/g%3E%3C/svg%3E");
}
h1, h2, h3 { font-family: var(--de); font-weight: 600; line-height: 1.15; letter-spacing: -.01em; margin: 0; }
h1 { font-size: clamp(2rem, 7vw, 3.6rem); }
h2 { font-size: clamp(1.45rem, 4.2vw, 2.1rem); }
h3 { font-size: 1.15rem; }
p { margin: 0; }
a { color: inherit; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--cham); outline-offset: 2px; border-radius: 6px; }
.an { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.bo-qua { position: absolute; left: 12px; top: -60px; background: var(--muc); color: var(--trang); padding: 10px 14px; border-radius: 8px; z-index: 100; }
.bo-qua:focus { top: 12px; }
.khung { width: min(100% - 32px, var(--rong)); margin-inline: auto; }
.nhan { font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--mo); font-weight: 600; }
.mo { color: var(--mo); }
.phan { padding: 40px 0; }
.dau-phan { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.dau-phan p { max-width: 60ch; color: var(--mo); }

/* Đầu trang */
.dau { position: sticky; top: 0; z-index: 40; background: rgba(243,239,230,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--ke); }
.dau .khung { display: flex; align-items: center; justify-content: space-between; height: 58px; }
.ten-hieu { font-family: var(--de); font-weight: 700; font-size: 1.35rem; text-decoration: none; display: flex; align-items: baseline; gap: 8px; }
.ten-hieu small { font-family: var(--chu); font-size: .68rem; font-weight: 500; color: var(--mo); letter-spacing: .08em; text-transform: uppercase; }
.dau nav { display: none; gap: 4px; }
.dau nav a { text-decoration: none; padding: 10px 14px; border-radius: 999px; font-weight: 500; font-size: .95rem; }
.dau nav a:hover { background: var(--giay-2); }
.dau nav a[aria-current="page"] { background: var(--reu); color: var(--trang); }

/* Thanh dưới (điện thoại) */
.duoi { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--trang); border-top: 1px solid var(--ke); display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding-bottom: env(safe-area-inset-bottom); }
.duoi a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 9px 4px 8px; min-height: 60px; text-decoration: none; font-size: .72rem; font-weight: 500; color: var(--mo); }
.duoi a svg { width: 24px; height: 24px; }
.duoi a[aria-current="page"] { color: var(--reu); font-weight: 700; }
.duoi a[aria-current="page"] svg { stroke-width: 2.4; }

/* Nút */
.nut { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 20px; border-radius: 999px; border: 1.5px solid var(--muc); background: transparent; color: var(--muc); font-weight: 600; text-decoration: none; transition: transform .15s ease-out, background .2s; touch-action: manipulation; }
.nut:hover { background: var(--giay-2); }
.nut:active { transform: scale(.97); }
.nut svg { width: 20px; height: 20px; flex: none; }
.nut.chinh { background: var(--lua); border-color: var(--lua); }
.nut.chinh:hover { background: #EDB840; }
.nut.reu { background: var(--reu); border-color: var(--reu); color: var(--trang); }
.nut.reu:hover { background: var(--reu-2); }
.nut[disabled], .nut[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.noi { position: fixed; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 30; box-shadow: var(--bong); }

/* Mở đầu */
.mo-dau { padding: 34px 0 10px; }
.mo-dau h1 em { font-style: italic; color: var(--reu-2); }
.mo-dau .loi { margin-top: 14px; max-width: 46ch; font-size: 1.05rem; color: var(--mo); }
.dong-tt { margin-top: 22px; display: grid; gap: 10px; background: var(--trang); border: 1px solid var(--ke); border-radius: var(--bo); padding: 14px 16px; box-shadow: var(--bong); }
.dong-tt .hang { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.dong-tt .so { font-family: var(--de); font-size: 2rem; font-weight: 600; line-height: 1; }
.dong-tt .nguon { font-size: .75rem; color: var(--mo); }

/* Huy hiệu mức thời tiết: luôn có hình + chữ, không chỉ màu */
.muc { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px 5px 8px; border-radius: 999px; font-size: .82rem; font-weight: 600; white-space: nowrap; }
.muc svg { width: 16px; height: 16px; }
.muc.tot { background: var(--tot-nen); color: var(--tot); }
.muc.luu-y { background: var(--luu-y-nen); color: var(--luu-y); }
.muc.doi { background: var(--doi-nen); color: var(--doi); }
.muc.cho { background: var(--giay-2); color: var(--mo); }

/* Bộ lọc */
.loc { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.loc button { min-height: 44px; padding: 8px 16px; border-radius: 999px; border: 1.5px solid var(--ke); background: var(--trang); color: var(--muc); font-weight: 500; font-size: .92rem; transition: background .2s, border-color .2s; }
.loc button[aria-pressed="true"] { background: var(--muc); border-color: var(--muc); color: var(--trang); }

/* Lưới thẻ ảnh */
.luoi { columns: 2; column-gap: 12px; }
.the { break-inside: avoid; display: block; margin-bottom: 12px; text-decoration: none; border-radius: var(--bo); overflow: hidden; background: var(--trang); border: 1px solid var(--ke); transition: transform .2s ease-out, box-shadow .2s; animation: len .5s ease-out both; }
.the:hover { transform: translateY(-3px); box-shadow: var(--bong); }
.the:active { transform: scale(.98); }
.the .anh { position: relative; }
.the .anh svg { width: 100%; height: 100%; }
.the .chu { padding: 11px 12px 13px; display: grid; gap: 5px; }
.the .chu h3 { font-size: 1.02rem; }
.the .chu .phu { display: flex; justify-content: space-between; gap: 8px; font-size: .78rem; color: var(--mo); }
.mau-anh { position: absolute; left: 8px; top: 8px; max-width: calc(100% - 16px); background: rgba(23,38,31,.78); color: #fff; font-size: .82rem; font-weight: 600; letter-spacing: .01em; padding: 4px 8px; border-radius: 6px; }
.do-cao { position: absolute; right: 8px; bottom: 8px; background: var(--trang); color: var(--muc); font-size: .75rem; font-weight: 600; padding: 3px 8px; border-radius: 6px; }
@keyframes len { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* Thẻ tour */
.the-tour { display: grid; gap: 0; background: var(--reu); color: var(--trang); border-radius: 20px; overflow: hidden; }
.the-tour .trong { padding: 24px 20px; display: grid; gap: 14px; }
.the-tour .nhan { color: #BFD3C6; }
.the-tour p { color: #DCE7DF; }
.so-lieu { display: flex; gap: 22px; flex-wrap: wrap; }
.so-lieu div { display: grid; }
.so-lieu b { font-family: var(--de); font-size: 1.7rem; line-height: 1.1; }
.so-lieu span { font-size: .8rem; opacity: .85; }

/* Ba lời hứa */
.hua { display: grid; gap: 12px; }
.hua li { list-style: none; background: var(--trang); border: 1px solid var(--ke); border-radius: var(--bo); padding: 16px; display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: start; }
.hua ul { margin: 0; padding: 0; display: contents; }
.hua svg { width: 28px; height: 28px; color: var(--reu-2); margin-top: 2px; }

/* Sơ đồ tuyến */
.so-do { background: var(--trang); border: 1px solid var(--ke); border-radius: 20px; padding: 16px 10px 10px; box-shadow: var(--bong); }
.so-do svg { width: 100%; height: auto; }
.so-do .nut-diem { cursor: pointer; }
.so-do .nut-diem:hover circle, .so-do .nut-diem:focus circle { stroke-width: 4; }
@media (max-width: 719px) { .so-do .nhan-diem { display: none; } .so-do svg { margin-bottom: -60px; } }
.chu-giai { display: flex; gap: 14px; flex-wrap: wrap; padding: 8px 8px 4px; font-size: .82rem; color: var(--mo); }
.chu-giai i { display: inline-block; width: 22px; height: 4px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }

/* Bản đồ */
.ban-do { height: min(80vh, 680px); min-height: 520px; border-radius: 20px; overflow: hidden; border: 1px solid var(--ke); box-shadow: var(--bong); background: #1B2A22; }
.bd-khung { position: relative; height: 100%; }
.bd-map { position: absolute; inset: 0; }
.bd-loc { position: absolute; z-index: 5; left: 10px; right: 10px; top: 10px; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.bd-loc button { flex: none; min-height: 44px; padding: 8px 14px; border-radius: 999px; border: 0; background: rgba(251,249,244,.95); color: var(--muc); font-weight: 600; font-size: .88rem; box-shadow: 0 2px 8px rgba(0,0,0,.35); display: inline-flex; align-items: center; gap: 7px; }
.bd-loc button i { width: 12px; height: 12px; border-radius: 50%; background: var(--mau); border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.3); }
.bd-loc button[aria-pressed="true"] { background: var(--muc); color: var(--trang); }
.ghim { display: grid; justify-items: center; gap: 3px; background: none; border: 0; padding: 0; cursor: pointer; font-family: var(--chu); }
.ghim .so { width: 34px; height: 34px; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg); background: var(--mau); border: 2.5px solid #fff; box-shadow: 0 3px 8px rgba(0,0,0,.55); display: grid; place-items: center; color: #10201A; font-weight: 700; font-size: .9rem; transition: transform .15s ease-out; }
.ghim .so b { transform: rotate(45deg); }
.ghim:hover .so, .ghim:focus-visible .so { transform: rotate(-45deg) scale(1.15); }
.ghim .ten { order: -1; background: rgba(16,32,26,.86); color: #fff; font-size: .74rem; font-weight: 600; padding: 3px 8px; border-radius: 6px; white-space: nowrap; max-width: 170px; overflow: hidden; text-overflow: ellipsis; }
.ghim.hn .ten { background: #fff; color: var(--muc); }
.maplibregl-popup-content { padding: 0; border-radius: 16px; overflow: hidden; font-family: var(--chu); background: var(--trang); color: var(--muc); box-shadow: 0 14px 40px rgba(0,0,0,.45); }
.maplibregl-popup-close-button { width: 36px; height: 36px; font-size: 22px; background: rgba(16,32,26,.7); color: #fff; border-radius: 50%; margin: 6px; line-height: 1; }
.maplibregl-popup-close-button:hover { background: #10201A; }
.bd-anh { aspect-ratio: 16/9; overflow: hidden; }
.bd-anh svg { width: 100%; height: 100%; }
.bd-chu { padding: 12px 14px 14px; display: grid; gap: 8px; font-size: .9rem; line-height: 1.5; }
.bd-chu .nhan { font-size: .68rem; }
.bd-chu .nut { min-height: 44px; padding: 9px 14px; font-size: .9rem; }
.bd-nguon { font-size: .68rem; color: var(--mo); }
.maplibregl-cooperative-gesture-screen { font-family: var(--chu); }
.nguon-anh { font-size: .8rem; color: var(--mo); columns: 2; column-gap: 24px; }

/* Dòng thời gian */
.ngay { margin-top: 30px; }
.ngay > header { display: flex; align-items: baseline; gap: 12px; padding-bottom: 10px; border-bottom: 2px solid var(--mau, var(--reu)); margin-bottom: 14px; }
.ngay > header h2 { color: var(--mau, var(--reu)); }
.dong { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px dashed var(--ke); display: grid; gap: 12px; }
.dong li { position: relative; }
.dong li::before { content: ""; position: absolute; left: -25px; top: 20px; width: 12px; height: 12px; border-radius: 50%; background: var(--mau, var(--reu)); border: 2px solid var(--giay); }
.dong li.chang::before { background: var(--giay); border-color: var(--mau, var(--reu)); border-radius: 3px; }
.chang-the { background: transparent; border: 1px dashed var(--ke); border-radius: var(--bo); padding: 12px 14px; display: grid; gap: 4px; font-size: .92rem; }
.chang-the b { display: flex; gap: 8px; align-items: center; }
.chang-the svg { width: 18px; height: 18px; flex: none; }
.diem-the { display: grid; grid-template-columns: 84px 1fr; gap: 12px; background: var(--trang); border: 1px solid var(--ke); border-radius: var(--bo); overflow: hidden; text-decoration: none; transition: box-shadow .2s, transform .2s; }
.diem-the:hover { box-shadow: var(--bong); transform: translateX(2px); }
.diem-the .anh svg { width: 100%; height: 100%; }
.diem-the .chu { padding: 10px 12px 10px 0; display: grid; gap: 5px; align-content: center; }
.diem-the .gio { font-size: .8rem; font-weight: 600; color: var(--mo); }

/* Trang điểm đến */
.bia { position: relative; border-radius: 0 0 24px 24px; overflow: hidden; max-height: 56vh; }
.bia svg { width: 100%; height: 100%; min-height: 240px; }
.bia-chu { margin-top: -46px; position: relative; background: var(--trang); border: 1px solid var(--ke); border-radius: 20px; padding: 20px 18px; box-shadow: var(--bong); display: grid; gap: 10px; }
.duong-dan { font-size: .85rem; color: var(--mo); padding: 14px 0 0; }
.duong-dan a { text-underline-offset: 3px; }
.o { background: var(--trang); border: 1px solid var(--ke); border-radius: var(--bo); padding: 18px 16px; display: grid; gap: 12px; }
.luoi-o { display: grid; gap: 14px; }
.ds { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.ds li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: start; }
.ds li svg { width: 20px; height: 20px; margin-top: 3px; color: var(--reu-2); }
.ds.canh-bao li svg { color: var(--luu-y); }
.ds .stt { font-family: var(--de); font-weight: 700; color: var(--lua-dam); font-size: 1.1rem; line-height: 1.4; }
.trong-rong { border: 1.5px dashed var(--ke); border-radius: var(--bo); padding: 20px 16px; text-align: center; color: var(--mo); display: grid; gap: 6px; justify-items: center; }
.trong-rong svg { width: 30px; height: 30px; }
.du-bao { display: grid; gap: 10px; }
.du-bao .hom { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 0; border-top: 1px solid var(--ke); }
.du-bao .hom:first-child { border-top: 0; padding-top: 0; }
.du-bao .hom b { font-weight: 600; }
.du-bao .hom .so { grid-column: 1 / -1; font-size: .9rem; color: var(--mo); }
.du-bao .hom .loi { grid-column: 1 / -1; font-size: .95rem; }
table.gia { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.gia th, table.gia td { text-align: left; padding: 9px 6px; border-top: 1px solid var(--ke); vertical-align: top; }
table.gia th { font-size: .84rem; letter-spacing: .01em; color: var(--mo); border-top: 0; }

/* Hỏi đáp */
.tro-chuyen { display: grid; gap: 10px; }
.tin { max-width: 85%; padding: 11px 14px; border-radius: 16px; font-size: .96rem; }
.tin.may { background: var(--trang); border: 1px solid var(--ke); border-bottom-left-radius: 4px; }
.tin.khach { background: var(--reu); color: var(--trang); justify-self: end; border-bottom-right-radius: 4px; }
.goi-y { display: flex; gap: 8px; flex-wrap: wrap; }
.goi-y button { min-height: 44px; padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--ke); background: var(--trang); color: var(--muc); font-size: .9rem; text-align: left; }
.o-nhap { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.truong { display: grid; gap: 6px; }
.truong label { font-weight: 600; font-size: .92rem; }
.truong .goi { font-size: .82rem; color: var(--mo); }
.truong input, .truong select, .truong textarea, .o-nhap input { width: 100%; min-height: 48px; padding: 11px 14px; border-radius: 12px; border: 1.5px solid var(--ke); background: var(--trang); font: inherit; color: var(--muc); }
.truong textarea { min-height: 96px; resize: vertical; }
.truong .loi { color: var(--doi); font-size: .85rem; font-weight: 500; }
.bieu-mau { display: grid; gap: 16px; }
.khan { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.khan a { display: grid; justify-items: center; gap: 2px; padding: 14px 6px; border-radius: var(--bo); background: var(--doi-nen); color: var(--doi); text-decoration: none; font-size: .8rem; font-weight: 600; text-align: center; }
.khan a b { font-family: var(--de); font-size: 1.6rem; line-height: 1; }
.bao { padding: 12px 14px; border-radius: 12px; background: var(--tot-nen); color: var(--tot); font-weight: 500; }

/* Nội bộ */
.cot-bang { display: grid; gap: 10px; }
.cot { background: var(--trang); border: 1px solid var(--ke); border-radius: var(--bo); padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.cot b { font-family: var(--de); font-size: 1.3rem; }

/* Chân trang */
.chan { margin-top: 30px; border-top: 1px solid var(--ke); padding: 22px 0 10px; font-size: .84rem; color: var(--mo); display: grid; gap: 8px; }
.dai-mau { background: var(--muc); color: var(--giay); font-size: .8rem; text-align: center; padding: 7px 12px; }

@media (min-width: 720px) {
  .luoi { columns: 3; column-gap: 16px; }
  .the { margin-bottom: 16px; }
  .hua { grid-template-columns: repeat(3, 1fr); }
  .luoi-o { grid-template-columns: 1fr 1fr; }
  .luoi-o .rong { grid-column: 1 / -1; }
  .the-tour { grid-template-columns: 1.1fr 1fr; }
  .cot-bang { grid-template-columns: repeat(4, 1fr); }
  .diem-the { grid-template-columns: 120px 1fr; }
}
@media (min-width: 960px) {
  body { padding-bottom: 0; }
  .duoi { display: none; }
  .dau nav { display: flex; }
  .luoi { columns: 4; }
  .noi { bottom: 24px; right: 24px; }
  .phan { padding: 56px 0; }
  .mo-dau { padding-top: 60px; display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; align-items: end; }
  .mo-dau .dong-tt { margin-top: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
.bia > img { position: absolute; inset: 0; width: 100% !important; height: 100% !important; aspect-ratio: auto !important; }

/* Ảnh lướt ở đầu trang điểm */
.luot-khung { position: relative; background: #10201A; }
.luot { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; height: min(62vh, 560px); min-height: 300px; }
.luot::-webkit-scrollbar { display: none; }
.luot .tam { flex: 0 0 100%; scroll-snap-align: center; position: relative; border: 0; padding: 0; background: #10201A; cursor: zoom-in; height: 100%; display: block; }
.luot .tam img, .luot .tam svg { width: 100% !important; height: 100% !important; object-fit: cover; aspect-ratio: auto !important; }
.luot .tam .ghi { position: absolute; right: 8px; bottom: 54px; background: rgba(16,32,26,.7); color: #fff; font-size: .68rem; padding: 3px 8px; border-radius: 6px; max-width: 80%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.luot .tam.het { display: grid; place-content: center; justify-items: center; gap: 10px; color: #fff; text-decoration: none; cursor: pointer; }
.luot .tam.het svg { width: 40px !important; height: 40px !important; }
.dem { position: absolute; right: 12px; top: 12px; background: rgba(16,32,26,.75); color: #fff; font-size: .8rem; font-weight: 600; padding: 5px 11px; border-radius: 999px; }
.lui { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-weight: 600; min-height: 44px; }
.lui svg { width: 22px; height: 22px; flex: none; }
.lui.noi-anh { position: absolute; left: 12px; top: 12px; z-index: 3; width: 44px; height: 44px; justify-content: center; border-radius: 50%; background: var(--trang); color: var(--muc); box-shadow: 0 2px 10px rgba(0,0,0,.4); }
.lui.chu { margin: 14px 0 6px; padding: 6px 14px 6px 8px; border-radius: 999px; background: var(--trang); border: 1px solid var(--ke); }
.mui { display: none; position: absolute; top: 50%; translate: 0 -50%; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(251,249,244,.92); color: var(--muc); place-items: center; box-shadow: 0 2px 10px rgba(0,0,0,.4); }
.mui svg { width: 22px; height: 22px; }
.mui.trai { left: 12px; } .mui.phai { right: 12px; } .mui.phai svg { rotate: 180deg; }
@media (hover: hover) and (min-width: 720px) { .mui { display: grid; } }

/* Lưới nút nhỏ */
.o-nut { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.o-nut a { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 14px; background: var(--trang); border: 1px solid var(--ke); border-radius: var(--bo); text-decoration: none; transition: transform .15s ease-out, box-shadow .2s, border-color .2s; }
.o-nut a:hover { border-color: var(--reu-2); box-shadow: var(--bong); }
.o-nut a:active { transform: scale(.97); }
.o-nut a svg { width: 24px; height: 24px; flex: none; color: var(--reu-2); }
.o-nut a span { display: grid; min-width: 0; }
.o-nut a b { font-weight: 600; font-size: .98rem; line-height: 1.25; }
.o-nut a small { font-size: .76rem; color: var(--mo); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.o-nut.nho a { min-height: 48px; padding: 8px 12px; }
.o-nut.nho a b { font-size: .88rem; font-weight: 500; }
.truoc-sau { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }
.truoc-sau .nut { justify-content: space-between; padding: 10px 14px; font-size: .88rem; font-weight: 500; border-color: var(--ke); min-width: 0; }
.truoc-sau .nut span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.truoc-sau .nut:first-child { justify-content: flex-start; }
.trang-con h1 { font-size: clamp(1.8rem, 6vw, 2.6rem); margin: 8px 0 16px; }
.trang-con .o h2 { font-size: 1.2rem; margin-top: 10px; }

/* Thư viện ảnh */
.kho-luoi { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.kho-luoi button { position: relative; border: 0; padding: 0; border-radius: 10px; overflow: hidden; aspect-ratio: 4/3; background: var(--giay-2); cursor: zoom-in; }
.kho-luoi img { width: 100%; height: 100%; object-fit: cover; }
.kho-luoi span { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(transparent, rgba(16,32,26,.85)); color: #fff; font-size: .66rem; padding: 14px 8px 5px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
dialog.xem { border: 0; padding: 0; background: #10201A; color: #fff; max-width: min(96vw, 1100px); max-height: 94vh; border-radius: 14px; overflow: hidden; }
dialog.xem::backdrop { background: rgba(0,0,0,.8); }
dialog.xem img { max-width: 100%; max-height: 78vh; margin: 0 auto; object-fit: contain; }
dialog.xem p { padding: 10px 14px 14px; font-size: .82rem; line-height: 1.5; }
dialog.xem a { color: var(--lua); }
.dong-x { position: absolute; right: 8px; top: 8px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(251,249,244,.92); color: var(--muc); font-size: 26px; line-height: 1; }
@media (min-width: 720px) { .o-nut { grid-template-columns: repeat(4, 1fr); } .kho-luoi { grid-template-columns: repeat(4, 1fr); } }
.luot .tam > img, .luot .tam > svg { position: absolute; inset: 0; }

/* Nút hỗ trợ nổi */
.ht { position: fixed; right: 14px; bottom: calc(74px + env(safe-area-inset-bottom)); z-index: 45; display: grid; justify-items: end; gap: 10px; }
.ht-nut { display: inline-flex; align-items: center; gap: 8px; min-height: 52px; padding: 12px 18px 12px 14px; border-radius: 999px; border: 0; background: var(--lua); color: var(--muc); font-weight: 700; box-shadow: 0 6px 20px rgba(23,38,31,.4); transition: transform .15s ease-out; }
.ht-nut:active { transform: scale(.96); }
.ht-nut svg { width: 24px; height: 24px; }
.ht.mo .ht-nut { background: var(--muc); color: var(--trang); }
.ht-ds { display: grid; gap: 8px; width: min(280px, calc(100vw - 28px)); animation: len .2s ease-out both; }
.ht-ds[hidden] { display: none; }
.ht-muc { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 14px 8px 10px; border-radius: 16px; border: 1px solid var(--ke); background: var(--trang); color: var(--muc); text-decoration: none; text-align: left; box-shadow: 0 6px 20px rgba(23,38,31,.28); font: inherit; cursor: pointer; }
.ht-muc:hover { border-color: var(--reu-2); }
.ht-muc .v { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--giay-2); }
.ht-muc .v svg { width: 26px; height: 26px; }
.ht-muc .v.xanh { background: var(--reu); color: #fff; }
.ht-muc .v.lua { background: var(--lua); }
.ht-muc span { display: grid; }
.ht-muc b { font-weight: 600; line-height: 1.25; }
.ht-muc small { font-size: .78rem; color: var(--mo); }
.ht-muc.tat { opacity: .62; cursor: not-allowed; }
dialog.chat { border: 0; padding: 0; margin: auto 0 0 auto; width: min(420px, 100vw); max-width: 100vw; height: min(640px, 88dvh); max-height: 88dvh; border-radius: 20px 20px 0 0; background: var(--giay); color: var(--muc); overflow: hidden; }
dialog.chat[open] { display: grid; grid-template-rows: auto 1fr auto auto auto; animation: len .25s ease-out both; }
dialog.chat::backdrop { background: rgba(16,32,26,.55); }
dialog.chat header { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 14px 12px 18px; background: var(--reu); color: var(--trang); }
dialog.chat header div { display: grid; }
dialog.chat header small { font-size: .72rem; opacity: .85; }
dialog.chat .dong-x { position: static; flex: none; }
.chat-than { overflow-y: auto; padding: 14px; display: grid; gap: 10px; align-content: start; }
dialog.chat .goi-y { padding: 0 14px 10px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
dialog.chat .goi-y button { flex: none; }
dialog.chat .o-nhap { padding: 0 14px; }
.chat-chan { padding: 10px 14px calc(12px + env(safe-area-inset-bottom)); font-size: .82rem; text-align: center; }
@media (min-width: 960px) { .ht { bottom: 22px; right: 22px; } dialog.chat { margin: auto 22px 22px auto; border-radius: 20px; } }
