:root {
  --paper: #F3F4F1; --panel: #FFFFFF; --ink: #1E2A26; --muted: #5E6D68; --line: #D8DED9;
  --brand: #0F5C4D; --brand-2: #E7F1EE; --cao: #C8352B; --cao-bg: #FCECEA; --vua: #A86410; --vua-bg: #FDF3E3;
  --tt: #2F5E8C; --tt-bg: #EAF1F8; --ok: #2E9E5B; --amber: #E8A33D;
  --fs: clamp(14px, .82rem + .2vw, 15.5px);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 400 var(--fs)/1.5 "Be Vietnam Pro", system-ui, sans-serif; color: var(--ink); background: var(--paper); }
button, input, select, textarea { font: inherit; color: inherit; }

.top { height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 16px; background: var(--brand); color: #fff; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; min-width: 0; }
.brand b { display: block; font-size: 1.05em; white-space: nowrap; }
.brand small { display: block; opacity: .8; font-size: .8em; white-space: nowrap; }
.logo.co-anh { background: none; padding: 0; overflow: hidden; } .logo.co-anh img { width: 100%; height: 100%; display: block; }
.logo { width: 38px; height: 38px; border-radius: 9px; background: #fff; color: var(--brand); display: grid; place-items: center; font-weight: 700; flex: none; }
.tk { font-size: .85em; opacity: .9; text-align: right; }
.tk b { font-size: 1.1em; }

.wrap { display: grid; grid-template-columns: 1fr 420px; height: calc(100dvh - 56px); }
.mapwrap { position: relative; min-height: 0; }
#map { position: absolute; inset: 0; background: #ccd; }
.mapwrap.picking #map { cursor: crosshair; }
.pickhint { position: absolute; z-index: 800; top: 12px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 99px; font-size: .9em; box-shadow: 0 4px 14px rgba(0,0,0,.25); white-space: nowrap; }
.chu-giai { position: absolute; z-index: 700; left: 10px; bottom: 26px; background: rgba(255,255,255,.94); border-radius: 10px; padding: 6px 10px; display: flex; gap: 12px; font-size: .78em; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.chu-giai span { display: flex; align-items: center; gap: 5px; }
.sw { width: 14px; height: 10px; border-radius: 2px; display: inline-block; }
.sw.cong { background: rgba(255,90,78,.35); border: 1.5px solid #FF5A4E; }
.dot { width: 11px; height: 11px; flex: none; border-radius: 50%; display: inline-block; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.2); }
.dot.moi { background: var(--amber); } .dot.xong { background: var(--ok); }

.side { background: var(--panel); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.tabs { display: flex; border-bottom: 1px solid var(--line); flex: none; }
.tabs button { flex: 1; border: 0; background: none; padding: 12px 6px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; }
.tabs button.on { color: var(--brand); border-bottom-color: var(--brand); }
.pane { padding: 14px 16px 28px; overflow-y: auto; flex: 1; }

.buoc { display: flex; align-items: center; gap: 8px; font-weight: 600; margin: 16px 0 8px; }
.buoc:first-child { margin-top: 2px; }
.buoc span { width: 22px; height: 22px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: .78em; flex: none; }
.buoc em { font-style: normal; font-weight: 400; color: var(--muted); font-size: .9em; }
select, input, textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; min-height: 44px; }
textarea { resize: vertical; }
select:focus, input:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--brand); background: var(--brand); color: #fff; font-weight: 600; cursor: pointer; text-align: center; }
.btn.ghost { background: #fff; color: var(--brand); }
.btn.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn:disabled { opacity: .6; cursor: wait; }
.btn.send { width: 100%; margin-top: 16px; font-size: 1.05em; min-height: 50px; }
.btn.sm { min-height: 34px; padding: 4px 10px; font-size: .88em; }
.btn.danger { background: #fff; color: var(--cao); border-color: var(--cao); }
.vt { margin-top: 8px; font-size: .9em; color: var(--muted); }
.vt b { color: var(--ink); }
.note { color: var(--muted); font-size: .86em; margin: 8px 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; }
.msg { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--cao-bg); color: var(--cao); font-size: .92em; }

.tc { margin-top: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #FAFBF9; }
.tc-h { font-weight: 600; font-size: .9em; color: var(--brand); margin-bottom: 6px; }
.tc table { width: 100%; border-collapse: collapse; font-size: .9em; }
.tc th { text-align: left; font-weight: 500; color: var(--muted); padding: 3px 8px 3px 0; white-space: nowrap; vertical-align: top; width: 1%; }
.tc td { padding: 3px 0; }
.cb { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; }
.cb li { padding: 8px 10px 8px 34px; border-radius: 9px; font-size: .88em; position: relative; line-height: 1.45; }
.cb li::before { position: absolute; left: 10px; top: 7px; font-weight: 700; }
.cb li.cao { background: var(--cao-bg); color: #7d1d16; } .cb li.cao::before { content: "⚠"; color: var(--cao); }
.cb li.vua { background: var(--vua-bg); color: #6b3f07; } .cb li.vua::before { content: "!"; color: var(--vua); left: 14px; }
.cb li.tt { background: var(--tt-bg); color: #1d3d5c; } .cb li.tt::before { content: "i"; color: var(--tt); left: 14px; font-style: italic; }
.tag { display: inline-block; padding: 0 7px; border-radius: 99px; font-size: .8em; font-weight: 600; }
.tag.cao { background: var(--cao); color: #fff; }

.thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.th { position: relative; width: 88px; height: 88px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.th img { width: 100%; height: 100%; object-fit: cover; }
.th button { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0,0,0,.65); color: #fff; cursor: pointer; font-size: 12px; }

.da-gui { text-align: center; padding: 24px 8px; }
.ok-ic { width: 56px; height: 56px; border-radius: 50%; background: var(--ok); color: #fff; font-size: 30px; display: grid; place-items: center; margin: 0 auto 8px; }
.da-gui .ma { font-size: 1.6em; font-weight: 700; letter-spacing: .04em; color: var(--brand); background: var(--brand-2); border-radius: 12px; padding: 10px; margin: 6px 0 10px; user-select: all; }

.the { border: 1px solid var(--line); border-left: 4px solid var(--amber); border-radius: 12px; padding: 10px 12px; margin: 10px 0; background: #fff; }
.the.da-xong { border-left-color: var(--ok); }
.the header { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.the p { margin: 6px 0; font-size: .92em; }
.meta { color: var(--muted); font-size: .8em; margin-top: 3px; }
.st { font-size: .75em; font-weight: 600; padding: 2px 8px; border-radius: 99px; white-space: nowrap; background: #FFF1DC; color: #8a5a10; }
.st.da_xu_ly, .st.khong_vp { background: #E2F4E9; color: #1f6e40; }
.st.tu_choi { background: #eee; color: #555; }
.st.moi { background: var(--cao-bg); color: var(--cao); }
.ga { display: flex; gap: 6px; align-items: center; margin: 6px 0; flex-wrap: wrap; }
.ga span { font-size: .75em; color: var(--muted); width: 100%; }
.ga img { width: 76px; height: 60px; object-fit: cover; border-radius: 7px; display: block; }
.kq { background: #EEF7F1; border-radius: 9px; padding: 7px 10px; font-size: .88em; margin-top: 6px; }
.pop .the { margin: 0; border: 0; border-left: 0; padding: 0; }
.leaflet-popup-content { margin: 12px 14px; font-family: "Be Vietnam Pro", system-ui, sans-serif; }

.ghim span { display: block; width: 30px; height: 30px; border-radius: 50% 50% 50% 0; background: #C8352B; transform: rotate(-45deg); border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.4); margin-left: 0; }
.ghim span::after { content: ""; position: absolute; width: 10px; height: 10px; border-radius: 50%; background: #fff; left: 7px; top: 7px; }
.row2 .btn { font-size: .93em; padding: 8px 8px; }
.loi { color: var(--cao); }

/* ----- nút và bảng chọn lớp bản đồ ----- */
.hd-r { display: flex; align-items: center; gap: 12px; }
.qt-link { color: #fff; text-decoration: none; font-size: .82em; font-weight: 600; border: 1px solid rgba(255,255,255,.5); border-radius: 99px; padding: 4px 10px; white-space: nowrap; }
.qt-link:hover { background: rgba(255,255,255,.15); }
.leaflet-control-layers { border: 0 !important; border-radius: 10px !important; box-shadow: 0 2px 10px rgba(0,0,0,.22) !important; }
.leaflet-control-layers-toggle, .leaflet-touch .leaflet-control-layers-toggle { width: 34px !important; height: 34px !important; border-radius: 10px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230F5C4D' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M12 3 2 8l10 5 10-5-10-5Z'/%3E%3Cpath d='m2 13 10 5 10-5' opacity='.65'/%3E%3Cpath d='m2 17.5 10 5 10-5' opacity='.35'/%3E%3C/svg%3E") center / 20px no-repeat !important; }
.leaflet-control-layers-expanded { padding: 8px 12px 8px 10px !important; font: 500 12.5px/1.3 "Be Vietnam Pro", system-ui, sans-serif; color: var(--ink); min-width: 210px; }
.lc-tieude { font-weight: 700; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px 2px; }
.leaflet-control-layers label { margin: 0; }
.leaflet-control-layers label > span, .leaflet-control-layers label > div { display: flex; align-items: center; gap: 6px; padding: 3px 0; cursor: pointer; }
.leaflet-control-layers-selector { margin: 0 !important; width: 14px; height: 14px; accent-color: var(--brand); min-height: 0; flex: none; }
.leaflet-control-layers-separator { margin: 6px -12px 6px -10px !important; border-top-color: var(--line) !important; }
.lc { display: inline-flex; align-items: center; gap: 7px; }
.lc small { color: var(--muted); font-weight: 400; }
.lc-ic { width: 18px; height: 13px; border-radius: 3px; flex: none; display: inline-block; }
.lc-ic.ve-tinh { background: linear-gradient(135deg, #3d5a3a 0 40%, #7a8f5c 40% 65%, #b7a77a 65%); }
.lc-ic.duong-pho { background: #f1efe9; border: 1px solid #d8d4c8; position: relative; }
.lc-ic.duong-pho::after { content: ""; position: absolute; left: 0; right: 0; top: 5px; height: 2px; background: #f4c542; }
.lc-ic.thua { background: rgba(255,90,78,.25); border: 1.5px solid #FF5A4E; }
.lc-ic.qh { background: linear-gradient(90deg, #E4F09A 0 33%, #F2C17D 33% 66%, #E5484D 66%); }
.lc-ic.gt { background: none; height: 4px; border-radius: 2px; background: #8a8f98; }
.lc-ic.xom { background: none; height: 0; border-top: 3.5px dashed #F2B700; border-radius: 0; }
.lc-ic.xa { background: none; height: 0; border-top: 4px dashed #C2187F; border-radius: 0; }
@media (max-width: 900px) { .qt-link { padding: 3px 8px; } }

/* chấm xanh vị trí thiết bị */
.tb-dot span { display: block; width: 18px; height: 18px; border-radius: 50%; background: #1A73E8; border: 3px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.2), 0 0 0 6px rgba(26,115,232,.25); animation: tb 2s infinite; }
@keyframes tb { 50% { box-shadow: 0 0 0 1px rgba(0,0,0,.2), 0 0 0 11px rgba(26,115,232,.08); } }
.qr-gui { display: flex; justify-content: center; margin: 10px 0 0; }
.qr-gui img { border: 1px solid var(--line); border-radius: 8px; }

/* theo dõi khâu xử lý */
button.tk { background: none; border: 0; color: #fff; cursor: pointer; padding: 4px 6px; border-radius: 8px; }
button.tk:hover { background: rgba(255,255,255,.15); }
.loc-td { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.loc-td button { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 4px 10px; font-size: .8em; cursor: pointer; }
.loc-td button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.td { border: 1px solid var(--line); border-left: 4px solid var(--amber); border-radius: 12px; padding: 10px 12px; margin: 8px 0; background: #fff; }
.td.da-xong { border-left-color: var(--ok); }
.td header { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.buoc4 { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); padding: 0; margin: 10px 0 2px; }
.buoc4 li { position: relative; text-align: center; font-size: .72em; color: var(--muted); }
.buoc4 li i { display: block; width: 14px; height: 14px; border-radius: 50%; margin: 0 auto 4px; background: #fff; border: 2px solid var(--line); position: relative; z-index: 1; }
.buoc4 li::before { content: ""; position: absolute; top: 6px; left: -50%; right: 50%; height: 2px; background: var(--line); }
.buoc4 li:first-child::before { display: none; }
.buoc4 li.qua i { background: var(--brand); border-color: var(--brand); }
.buoc4 li.qua::before, .buoc4 li.dang::before { background: var(--brand); }
.buoc4 li.dang i { background: #fff; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-2); }
.buoc4 li.dang span { color: var(--brand); font-weight: 700; }
.td.da-xong .buoc4 li.dang i { background: var(--ok); border-color: var(--ok); box-shadow: none; }
.xem-kq { display: inline-block; margin-top: 6px; font-size: .85em; font-weight: 600; color: var(--brand); }

/* nhãn tên xóm trên bản đồ */
.nhan-xom { background: none; border: 0; }
.nhan-xom span { display: inline-block; transform: translate(-50%, -50%); white-space: nowrap; font: 700 12.5px/1.2 "Be Vietnam Pro", system-ui, sans-serif; color: #FFE680; letter-spacing: .02em; text-shadow: 0 0 3px #000, 0 0 6px rgba(0,0,0,.8); text-transform: uppercase; }
.nhan-xom.uoc span { color: #FFF3B8; font-style: italic; }
.lc-ic.ten-xom { background: none; width: 18px; height: 13px; font: 800 10px/13px sans-serif; color: #b38f00; text-align: center; }
.lc-ic.ten-xom::before { content: "Aa"; }
.tt-diem { background: rgba(30,42,38,.88); color: #fff; border: 0; border-radius: 8px; padding: 4px 8px; font: 500 12px/1.35 "Be Vietnam Pro", system-ui, sans-serif; box-shadow: 0 2px 6px rgba(0,0,0,.3); text-align: center; }
.tt-diem::before { border-top-color: rgba(30,42,38,.88) !important; }
.tt-diem i { opacity: .75; font-size: .9em; }
.uoc-note { color: var(--muted); }
.bb-mini { width: 60px; height: 60px; border-radius: 7px; background: var(--cao); color: #fff; font-weight: 800; font-size: .8em; display: grid; place-items: center; text-decoration: none; }

/* kích thước cạnh thửa, số thửa (hiện khi phóng to) */
.kt-canh, .nhan-thua { background: none; border: 0; }
.kt-canh span { position: absolute; white-space: nowrap; font: 600 10.5px/1 "Be Vietnam Pro", system-ui, sans-serif; color: #fff; text-shadow: 0 0 2px #000, 0 0 4px #000, 0 0 1px #000; pointer-events: none; }
.leaflet-zoom-anim .kt-canh, .leaflet-zoom-anim .nhan-thua { display: none; }
.nhan-thua { pointer-events: none; }
.nhan-thua b, .nhan-thua i { position: absolute; transform: translate(-50%, -100%); white-space: nowrap; font: 700 12px/1.1 "Be Vietnam Pro", system-ui, sans-serif; color: #FFE680; text-shadow: 0 0 2px #000, 0 0 4px #000; }
.nhan-thua i { transform: translate(-50%, 2px); font-style: normal; font-weight: 600; font-size: 10.5px; color: #fff; }

.lc-ic.dd { background: none; border: 0; width: 14px; height: 14px; position: relative; }
.lc-ic.dd::before { content: ""; position: absolute; left: 2px; top: 0; width: 10px; height: 10px; border-radius: 50% 50% 50% 0; background: #E5484D; transform: rotate(-45deg); }
.lc-ic.dd::after { content: ""; position: absolute; left: 5px; top: 3px; width: 4px; height: 4px; border-radius: 50%; background: #fff; }
.gt-them { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.gt-them label { font-size: .85em; color: var(--muted); display: block; margin-bottom: 4px; }
.gt-them input { width: 100%; }
.gt-goi { font-size: .85em; color: var(--muted); margin: 6px 0 0; }
.pop-thua { font-size: .9em; line-height: 1.45; }
.pop-thua table { margin-top: 6px; border-collapse: collapse; }
.pop-thua th { text-align: left; color: var(--muted); font-weight: 500; padding: 2px 8px 2px 0; vertical-align: top; white-space: nowrap; }
.pop-thua td { padding: 2px 0; }

.goi-y-thua { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); z-index: 800; background: rgba(15,92,77,.92); color: #fff; font-size: 12.5px; font-weight: 600; padding: 6px 12px; border-radius: 99px; pointer-events: none; white-space: nowrap; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.goi-y-thua[hidden] { display: none; }
.lc-xom small { color: var(--muted); font-weight: 400; margin-left: 2px; }
.lc-xom .lc-tieude small { text-transform: none; letter-spacing: 0; }
.lc-xom-nut { display: flex; gap: 6px; margin: 0 0 4px 2px; }
.lc-xom-nut button { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 2px 9px; font: inherit; font-size: 11.5px; cursor: pointer; }
.lc-xom-ds label > span { position: relative; padding-right: 22px !important; }
.lc-den { position: absolute; right: 0; text-decoration: none; color: var(--brand); font-weight: 700; padding: 0 4px; }
.lc-den:hover { background: var(--line); border-radius: 6px; }


/* Giao thông, công trình xã Nam Đàn */
.lc-ic.gt { height: 5px; border-radius: 3px; background: linear-gradient(90deg, #D9480F 0 25%, #C2255C 25% 45%, #F08C00 45% 65%, #1C7ED6 65% 85%, #2B8A3E 85%); }
.lc-ic.ct { background: #C92A2A; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); width: 12px; height: 12px; border: 2px solid #fff; box-shadow: 0 0 0 1px #FFD43B; margin: 0 3px; }
/* Ghim công trình: giọt nước, viền trắng dày, bóng đổ – to và khác hẳn biểu tượng tròn nhỏ của Google */
.ct-ghim { background: none; border: 0; }
.ct-ghim b { position: absolute; left: 0; top: 0; width: var(--c); height: var(--c); box-sizing: border-box; background: var(--m);
  border: 3px solid #fff; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); transform-origin: 50% 50%;
  box-shadow: -2px 3px 6px rgba(0,0,0,.45), 0 0 0 1.5px rgba(0,0,0,.25); display: grid; place-items: center; cursor: pointer; transition: transform .12s; }
.ct-ghim b i { transform: rotate(45deg); font-style: normal; line-height: 1; font-size: calc(var(--c) * .46); color: #fff;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.35)); }
.ct-ghim:hover b { transform: rotate(-45deg) scale(1.12); }
.ct-ghim.ct-co-quan b { border-width: 3.5px; box-shadow: -2px 4px 8px rgba(0,0,0,.5), 0 0 0 2px #FFD43B; }   /* cơ quan: viền vàng nổi bật */
.ct-ghim.ct-truong b, .ct-ghim.ct-y-te b { box-shadow: -2px 4px 7px rgba(0,0,0,.45), 0 0 0 1.5px rgba(0,0,0,.3); }
.ct-nhan span { display: inline-block; transform: translate(-50%, 7px); white-space: nowrap; font: 700 11.5px/1.2 system-ui, sans-serif; color: #1b1f24;
  text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 2px #fff; pointer-events: none; }
.ct-pop b { font-size: 14px; } .ct-pop .ct-loai { color: #5c636a; font-size: 12px; margin: 2px 0 6px; }
.ct-pop table { border-collapse: collapse; font-size: 12.5px; } .ct-pop th { text-align: left; vertical-align: top; padding: 3px 8px 3px 0; color: #5c636a; font-weight: 600; white-space: nowrap; }
.ct-pop td { padding: 3px 0; }
.tt-gt { font-size: 12px; }

/* Chỉ đường đến công trình (Google Maps, điểm đi = vị trí thiết bị) */
.leaflet-container a.btn-dir, .btn-dir { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font: 600 12.5px/1.2 inherit; color: #fff !important;
  background: #1A73E8; border: 0; border-radius: 7px; padding: 8px 12px; cursor: pointer; text-decoration: none; }
.btn-dir:hover { background: #155DBF; }
.vt-info { font-size: 11.5px; line-height: 1.45; color: #5c636a; margin-top: 6px; max-width: 290px; }
.vt-info:empty { display: none; } .vt-info .ok { color: #1E7B34; } .vt-info .warn { color: #9A5B00; }
.vt-cham i { display: block; width: 20px; height: 20px; border-radius: 50%; background: #1A73E8; border: 3px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.25), 0 2px 6px rgba(0,0,0,.35); box-sizing: border-box; cursor: grab; }

/* Hai trang riêng: UBND xã (xanh lục) và Công an xã (xanh dương) */
body.trang-cong_an { --brand: #1F3F99; --brand-2: #E7EEFC; }
.trang-gt { font-size: 13px; line-height: 1.5; background: var(--brand-2); color: #1b1f24; border-radius: 10px; padding: 9px 12px; margin-bottom: 12px; }
.trang-gt a { display: block; margin-top: 3px; font-weight: 600; color: var(--brand); text-decoration: none; }

/* =====================================================================
   ĐIỆN THOẠI VÀ IPAD – bố cục kiểu ứng dụng giống trang Thông tin xóm, Góp ý quy hoạch:
   bản đồ luôn ở trên, khung phản ánh ở dưới cuộn riêng (không cuộn mất bản đồ);
   nút phóng to/thu nhỏ bản đồ; khi chọn vị trí trên bản đồ thì bản đồ tự mở lớn.
   ===================================================================== */
.nut-bd { display: none; }
@media (min-width: 901px) and (max-width: 1199px) {          /* iPad nằm ngang, máy tính nhỏ */
  .wrap { grid-template-columns: 1fr 370px; }
  .pane { padding: 12px 14px 24px; }
}
@media (max-width: 900px) {                                   /* iPad dựng đứng, điện thoại */
  html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
  .top { height: 52px; padding: 0 12px; padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
  .brand small { overflow: hidden; text-overflow: ellipsis; }
  .brand > span:last-child { min-width: 0; }
  .brand b { overflow: hidden; text-overflow: ellipsis; }
  .tk { display: none; }
  .wrap { grid-template-columns: 1fr; grid-template-rows: 50% minmax(0, 1fr); height: calc(100dvh - 52px); }
  body.bd-lon .wrap { grid-template-rows: 78% minmax(0, 1fr); }
  .mapwrap { height: auto; min-height: 0; }
  .side { border-left: 0; border-top: 1px solid var(--line); min-height: 0; overflow: hidden; box-shadow: 0 -4px 14px rgba(0,0,0,.08); position: relative; z-index: 2; }
  .tabs { flex: none; }
  .tabs button { padding: 11px 4px; font-size: .92em; }
  .pane { overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 12px 14px calc(24px + env(safe-area-inset-bottom)); }
  /* chữ trong ô nhập >= 16px để iPhone/iPad không tự phóng to trang khi chạm vào ô */
  select, input, textarea { font-size: 16px; }
  .chu-giai { left: 8px; bottom: 22px; font-size: .72em; gap: 8px; padding: 5px 8px; }
  .pickhint { white-space: normal; text-align: center; width: max-content; max-width: calc(100% - 24px); top: 10px; }
  .nut-bd { display: flex; align-items: center; gap: 6px; position: absolute; z-index: 750; right: 10px; bottom: 50px; border: 0; border-radius: 99px;
    background: #fff; color: var(--brand); font: 600 12.5px/1 "Be Vietnam Pro", system-ui, sans-serif; padding: 9px 12px; box-shadow: 0 2px 10px rgba(0,0,0,.25); cursor: pointer; }
  .leaflet-control-layers-expanded { max-width: calc(100vw - 70px); }
  .leaflet-popup-content { margin: 10px 12px; }
}
@media (min-width: 601px) and (max-width: 900px) {            /* iPad dựng đứng: bản đồ cao hơn, chữ thoáng hơn */
  .wrap { grid-template-rows: 56% minmax(0, 1fr); }
  .pane { padding: 16px 22px calc(28px + env(safe-area-inset-bottom)); }
  .tabs button { padding: 13px 6px; font-size: 1em; }
}
@media (max-width: 380px) {                                   /* điện thoại màn hình nhỏ */
  .brand small { display: none; }
  .qt-link { font-size: .76em; padding: 3px 7px; }
  .chu-giai span:first-child { display: none; }
}
@media (max-width: 900px) and (orientation: landscape) and (max-height: 520px) {   /* điện thoại xoay ngang: bản đồ bên trái, khung bên phải */
  .top { height: 44px; }
  .wrap { grid-template-columns: 1fr 340px; grid-template-rows: none; height: calc(100dvh - 44px); }
  .side { border-top: 0; border-left: 1px solid var(--line); }
  .nut-bd { display: none; }
}
