/*
  Design tokens ported 1:1 from totomo-webapp's design system
  (app/design-system/colors.ts + CLAUDE.md). Single theme on purpose —
  the source system has no dark mode, background is always the
  "paperistic white" paper tone.
*/
:root{
  /* brand (max 15 codes, exactly totomo's registry — do not add more) */
  --blue:#2b76ef;        /* primary CTA, action buttons */
  --blue-soft:#56a8dd;   /* headers, primary backgrounds */
  --blue-light:#34a2db;  /* links, secondary blue */
  --blue-dark:#4a97cc;   /* hover states */
  --lime:#d5fe84;        /* selection, progress, highlights */
  --green-dark:#4eac6a;  /* accents, secondary actions / "go" */
  --green-light:#c5ee74;
  --yellow:#fcec45;      /* attention, highlights / "caution" */
  --yellow-dark:#d5a000; /* icons, accents */
  --orange:#f97316;      /* warm CTA / "no-go" attention colour */

  /* nen nhat cho badge so lieu trong thang tham chieu - chu luon dung
     gray900 (giong het pattern cua verdict-pill/place-status), KHONG
     dung mau brand lam mau chu truc tiep vi lime/yellow qua sang, tuong
     phan yeu tren nen trang. */
  --lime-soft: rgba(213,254,132,.4);
  --yellow-soft: rgba(252,236,69,.4);
  --yellow-dark-soft: rgba(213,160,0,.18);
  --orange-soft: rgba(249,115,22,.16);

  /* neutrals + background (do not count toward the 15) */
  --paper:#faf9f6;
  --white:#ffffff;
  --ink:#171717;
  --gray900:#111827;
  --gray700:#374151;
  --gray500:#6b7280;
  --gray400:#9ca3af;
  --gray300:#d1d5db;
  --gray200:#e5e7eb;
  --gray100:#f3f4f6;
  --gray50:#f9fafb;
  --dot-color: rgba(200, 195, 188, 0.4);

  /* radius scale (Tailwind rounded-xl/2xl/3xl/full) */
  --r-lg:8px; --r-xl:12px; --r-2xl:16px; --r-3xl:24px; --r-full:9999px;

  /* shadow scale (Tailwind shadow-sm/lg/xl) */
  --shadow-sm: 0 1px 2px 0 rgba(0,0,0,.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,.1), 0 8px 10px -6px rgba(0,0,0,.1);
}

*{ box-sizing:border-box; }
html{ background:var(--paper); }
body{
  color:var(--ink);
  background:
    radial-gradient(circle, var(--dot-color) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(to bottom right, rgba(86,168,221,.10), var(--paper) 45%, rgba(213,254,132,.10));
  background-attachment: fixed;
  font-family:'Be Vietnam Pro', system-ui, Arial, sans-serif;
  -webkit-font-smoothing:antialiased;
  margin:0;
}
h1, h2, .display, .mono{ font-family:'Space Grotesk', 'Be Vietnam Pro', system-ui, sans-serif; }
.mono{ font-variant-numeric:tabular-nums; }

.page{ max-width:600px; margin:0 auto; padding:20px 16px 72px; }
@media (min-width:640px){ .page{ padding:32px 24px 88px; } }

/* banner dang cover photo (kieu Facebook page) - bam sat 2 canh + dinh
   cua .page, khong sticky, cuon troi binh thuong nhu 1 anh ngay dau trang.
   Hieu ung "giay bi xe" that su can 2 lop (khong the lam bang 1 duong
   clip-path don le - nhin se giong day nui zigzag hon la giay xe):
     1. cover-banner-fiber: mieng "so giay" mau trang nam DUOI anh, canh
        tren cung lom-nham nhung AN SAU hon (xuong sau ~1 chut) so voi anh
        - phan lo ra chinh la "so giay" trang dac trung cua giay bi xe that.
     2. img: lop tren, canh duoi lom-nham TAN SO CAO (nhieu rang cua nho,
        khong phai vai dinh nui lon) de giong vet xe that thay vi zigzag.
   Ca 2 toa do deu tinh san (deterministic), khong random moi lan render. */
.cover-banner{ position:relative; margin:-20px -16px 20px; overflow:visible; }
.cover-banner-fiber{
  position:absolute; inset:0; background:#fff;
  clip-path: polygon(0% 0%, 100% 0%, 100% 83.45%, 98.103% 86.03%, 97.612% 83.76%, 95.409% 86.5%, 94.78% 87.4%, 93.304% 86.75%, 91.187% 86.54%, 90.016% 86.61%, 88.47% 87.4%, 87.053% 82.96%, 86.004% 83.99%, 84.613% 86.55%, 82.614% 85.01%, 81.472% 85.47%, 80.186% 87.35%, 78.665% 85.12%, 76.764% 86.1%, 75.605% 88.68%, 74.279% 89.27%, 73.281% 87.76%, 71.751% 85.14%, 70.175% 87.28%, 68.352% 87.33%, 67.582% 86.15%, 65.444% 85.32%, 64.124% 86.34%, 62.514% 84.66%, 61.518% 86.92%, 60.296% 85.61%, 58.773% 89.34%, 57.47% 85.82%, 55.917% 86.41%, 54.439% 87.39%, 52.609% 88.67%, 51.887% 84.72%, 50.49% 87.55%, 48.804% 84.48%, 47.64% 86.7%, 46.098% 86.98%, 44.663% 85.2%, 43.114% 83.73%, 41.74% 87.77%, 40.191% 88.25%, 38.199% 85.23%, 37.48% 84.78%, 35.567% 84.48%, 34.429% 84.16%, 33.256% 85.3%, 31.422% 86.9%, 29.77% 85.46%, 28.625% 88.76%, 27.519% 85.6%, 26.055% 87.11%, 24.78% 85.83%, 23.265% 87.52%, 21.733% 85.17%, 19.985% 86.74%, 18.254% 86.1%, 17.576% 87.27%, 15.253% 86.29%, 14.733% 86.47%, 12.996% 90.07%, 11.165% 84.99%, 9.666% 88.42%, 8.788% 89.1%, 6.715% 87.07%, 5.645% 87.66%, 3.892% 85.3%, 2.492% 85.73%, 1.18% 85.71%, 0% 85.42%);
  filter: drop-shadow(0 3px 3px rgba(0,0,0,.16));
}
.cover-banner img{
  position:relative; display:block; width:100%; aspect-ratio:3/1; object-fit:cover; object-position:50% 68%;
  clip-path: polygon(0% 0%, 100% 0%, 100% 93.4%, 98.103% 95.64%, 97.612% 93.19%, 95.409% 93.21%, 94.78% 94.67%, 93.304% 93.4%, 91.187% 95.49%, 90.016% 95.48%, 88.47% 94.5%, 87.053% 92.79%, 86.004% 92.89%, 84.613% 95.41%, 82.614% 92.7%, 81.472% 94.9%, 80.186% 95.54%, 78.665% 94.24%, 76.764% 95.76%, 75.605% 94.96%, 74.279% 95.46%, 73.281% 94.7%, 71.751% 94.83%, 70.175% 94.6%, 68.352% 94.83%, 67.582% 94.37%, 65.444% 93.52%, 64.124% 94.14%, 62.514% 93.94%, 61.518% 94.77%, 60.296% 94.67%, 58.773% 95.88%, 57.47% 94.82%, 55.917% 94.27%, 54.439% 95.42%, 52.609% 95.21%, 51.887% 94.2%, 50.49% 94.13%, 48.804% 93.53%, 47.64% 94.79%, 46.098% 93.03%, 44.663% 95.03%, 43.114% 92.72%, 41.74% 94.18%, 40.191% 94.96%, 38.199% 94.98%, 37.48% 92.6%, 35.567% 92.75%, 34.429% 91.83%, 33.256% 91.33%, 31.422% 93.2%, 29.77% 92.54%, 28.625% 95.27%, 27.519% 93.22%, 26.055% 94.68%, 24.78% 94.88%, 23.265% 93.64%, 21.733% 93.84%, 19.985% 93.74%, 18.254% 94.61%, 17.576% 94.63%, 15.253% 92.58%, 14.733% 95.35%, 12.996% 96.34%, 11.165% 94.26%, 9.666% 95.72%, 8.788% 95.55%, 6.715% 95.43%, 5.645% 96.35%, 3.892% 95.25%, 2.492% 92.59%, 1.18% 92.1%, 0% 95.12%);
  filter: drop-shadow(0 3px 2px rgba(0,0,0,.2));
}
@media (min-width:640px){
  .cover-banner{ margin:-32px -24px 24px; }
}

header.top{
  position:sticky; top:0; z-index:10; margin:0 -16px 20px; padding:14px 16px;
  background:rgba(255,255,255,.9); backdrop-filter:blur(6px);
  display:flex; justify-content:space-between; align-items:flex-end; gap:12px; flex-wrap:wrap;
  border-bottom:1px solid var(--gray200);
}
@media (min-width:640px){ header.top{ margin:0 -24px 24px; padding:16px 24px; } }
.brand h1{ font-weight:700; font-size:clamp(22px,4vw,28px); margin:0 0 2px; text-wrap:balance; color:var(--gray900); }
.brand .zigzag{ display:block; width:64px; height:10px; margin:2px 0 6px; }
.brand p{ margin:0; color:var(--gray700); font-size:13px; max-width:44ch; }
.updated{ text-align:right; font-size:11px; color:var(--gray500); line-height:1.6; }
.updated b{ color:var(--gray700); font-weight:600; }

section{ margin-bottom:28px; }
h2{ font-weight:700; font-size:19px; margin:0 0 4px; color:var(--gray900); }
.section-note{ font-size:13px; color:var(--gray500); margin:0 0 14px; max-width:60ch; line-height:1.55; }

/* date picker */
.date-bar{
  background:var(--white); border:2px solid var(--gray200); border-radius:var(--r-xl);
  padding:12px 14px; box-shadow:var(--shadow-sm); display:flex; align-items:center; gap:10px; flex-wrap:wrap;
}
.date-bar input[type=date]{
  font-family:'Space Grotesk',sans-serif; font-size:14px; color:var(--ink);
  background:var(--gray50); border:2px solid var(--gray200); border-radius:var(--r-lg); padding:7px 9px;
}
.step-btn, .today-btn{
  font-family:'Be Vietnam Pro',sans-serif; font-weight:600; font-size:13px; cursor:pointer;
  background:rgba(43,118,239,.1); color:var(--blue); border:none; border-radius:var(--r-lg); padding:8px 12px;
  transition:all .2s ease;
}
.step-btn:hover:not(:disabled), .today-btn:hover{ background:rgba(43,118,239,.18); }
.step-btn:active:not(:disabled), .today-btn:active{ transform:scale(.97); }
.step-btn:disabled{ opacity:.4; cursor:not-allowed; }
.date-range-note{ font-size:11px; color:var(--gray500); margin-left:auto; }

/* verdict */
.verdict-card{ background:var(--white); border:1px solid var(--gray200); border-radius:var(--r-2xl); padding:20px 22px; box-shadow:var(--shadow-lg); }
.verdict-top{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:10px; }
.verdict-pill{ font-weight:700; font-size:14px; padding:6px 14px; border-radius:var(--r-full); letter-spacing:.01em; border:1.5px solid transparent; }
.verdict-pill.go{ background:rgba(213,254,132,.35); color:var(--gray900); border-color:var(--green-dark); }
.verdict-pill.partial{ background:rgba(252,236,69,.35); color:var(--gray900); border-color:var(--yellow-dark); }
.verdict-pill.no-go{ background:rgba(249,115,22,.14); color:var(--gray900); border-color:var(--orange); }
.verdict-weekend{ font-size:12px; color:var(--gray500); }
.verdict-headline{ font-size:15px; line-height:1.6; color:var(--gray700); margin:0 0 10px; max-width:60ch; }
/* Goi y tach rieng theo khung gio (sang/chieu) - moi khung 1 khoi voi
   tieu de + danh sach chip rieng, vi 1 diem co the an toan sang nhung
   khong nen chieu (gop chung se mat thong tin do). */
.picks-window{ margin-bottom:12px; }
.picks-window:last-child{ margin-bottom:6px; }
.picks-window-title{ font-family:'Space Grotesk',sans-serif; font-weight:700; font-size:12.5px; color:var(--gray700); margin-bottom:7px; }
.picks{ display:flex; flex-wrap:wrap; gap:8px; }
.pick-chip{ font-size:12.5px; font-weight:600; padding:5px 11px; border-radius:var(--r-lg); display:inline-flex; align-items:center; gap:6px; }
.pick-chip.go{ background:rgba(78,172,106,.14); color:var(--green-dark); }
/* "can trong" dung nen vang + chu gray900 (khong dung yellow/orange lam
   MAU CHU truc tiep) - giu dung quy uoc tuong phan da chot cho toan app. */
.pick-chip.caution{ background:rgba(252,236,69,.35); color:var(--gray900); }
.picks-empty{ font-size:12.5px; color:var(--gray400); font-style:italic; }
/* Diem dang trung chu ky "thoi diem ly tuong" (idealTime o locations.js)
   cho ngay dang xem - mau xanh duong de khong lan voi mau an-toan/can-trong. */
.pick-ideal{ padding:1px 7px; border-radius:var(--r-full); background:rgba(43,118,239,.14); color:var(--blue-dark); font-size:11px; font-weight:700; }
.verdict-source{ font-size:11px; color:var(--gray400); margin-top:10px; }

/* location list - danh sach phang, khong con gom khoi theo weatherGroup
   (dropped theo yeu cau don gian hoa); .window-chip/.wstat-* van giu vi
   map popup (updateMapMarkers) con dung. */
.grid{ display:flex; flex-direction:column; gap:12px; }
.search-bar{ margin-bottom:4px; }
#placeSearch{
  width:100%; font-family:'Be Vietnam Pro',sans-serif; font-size:14px; color:var(--ink);
  background:var(--white); border:2px solid var(--gray200); border-radius:var(--r-xl); padding:10px 14px;
}
#placeSearch:focus{ outline:none; border-color:var(--blue); }
.search-empty{ font-size:13px; color:var(--gray500); font-style:italic; margin:0 0 12px; }
/* So lieu tach theo khung gio (map popup): moi khung 1 dong, nhan gio ben
   trai de mat doc doc duoc "sang bao nhieu / chieu bao nhieu" theo cot. */
.wstat-row{ display:flex; gap:8px; align-items:baseline; flex-wrap:wrap; padding:2px 0; }
.wstat-row + .wstat-row{ border-top:1px solid rgba(43,118,239,.18); margin-top:2px; padding-top:5px; }
.wstat-when{ font-weight:700; color:var(--gray900); white-space:nowrap; }
.wstat-hint{ font-weight:500; color:var(--gray500); font-size:11px; }
.wstat-nums{ flex:1 1 auto; min-width:0; }
.stat-badge{ color:var(--gray900); font-weight:700; padding:1px 7px; border-radius:var(--r-full); font-family:'Space Grotesk',sans-serif; }
.place{ background:var(--white); border:1px solid var(--gray200); border-radius:var(--r-2xl); overflow:hidden; box-shadow:var(--shadow-lg); transition:all .2s ease; }
.place:hover{ box-shadow:var(--shadow-xl); }
.place-img-wrap{ position:relative; }
.place-img{ display:block; width:100%; aspect-ratio:16/9; object-fit:cover; background:var(--gray100); }
/* Anh doc (chup dung): GIU NGUYEN khung 16:9 nhu anh ngang (khong doi
   aspect-ratio) de chuyen giua cac anh trong carousel khong bi layout
   shift do khung cao/thap khac nhau - chi doi object-fit sang contain de
   anh tu thu nho vua khung, chap nhan vien den 2 ben thay vi crop nang. */
.place-img.portrait{ object-fit:contain; background:var(--gray900); }
.place-img-badge{ position:absolute; left:10px; bottom:10px; font-size:10.5px; font-weight:700; color:#fff; background:rgba(17,24,39,.7); padding:4px 9px; border-radius:var(--r-full); }
.place-photo-date{ position:absolute; right:10px; bottom:10px; font-family:'Space Grotesk',sans-serif; font-variant-numeric:tabular-nums; font-size:10.5px; font-weight:600; color:#fff; background:rgba(17,24,39,.7); padding:4px 9px; border-radius:var(--r-full); }
.carousel-arrow{
  position:absolute; top:50%; transform:translateY(-50%); width:30px; height:30px; border:none; border-radius:var(--r-full);
  background:rgba(17,24,39,.55); color:#fff; font-size:18px; line-height:1; cursor:pointer; display:flex; align-items:center; justify-content:center;
}
.carousel-arrow:hover{ background:rgba(17,24,39,.75); }
.carousel-arrow.prev{ left:10px; }
.carousel-arrow.next{ right:10px; }
.carousel-dots{ position:absolute; left:0; right:0; top:10px; display:flex; justify-content:center; gap:6px; }
.carousel-dot{ width:7px; height:7px; padding:0; border:none; border-radius:50%; background:rgba(255,255,255,.55); cursor:pointer; }
.carousel-dot.active{ background:#fff; }
.place-body{ padding:16px 18px 18px; display:flex; flex-direction:column; gap:8px; }
.place-top{ display:flex; justify-content:space-between; align-items:flex-start; gap:8px; }
.place-name{ font-family:'Space Grotesk',sans-serif; font-weight:700; font-size:16px; color:var(--gray900); }
.place-kind{ font-size:11px; color:var(--gray400); text-align:right; white-space:nowrap; }
.place-status{ font-size:11px; font-weight:700; padding:4px 10px; border-radius:var(--r-full); display:inline-block; width:fit-content; border:1.5px solid transparent; }
.place-status.go{ background:rgba(213,254,132,.35); color:var(--gray900); border-color:var(--green-dark); }
.place-status.partial{ background:rgba(252,236,69,.35); color:var(--gray900); border-color:var(--yellow-dark); }
.place-status.no-go{ background:rgba(249,115,22,.14); color:var(--gray900); border-color:var(--orange); }
.place-status.loading{ background:var(--gray100); color:var(--gray400); }
.place-desc{ font-size:13px; color:var(--gray700); line-height:1.55; }
/* Chip gon (chi chu, khong icon thoi tiet) - chi con dung trong map popup,
   khong gian hep. The dia diem trong danh sach dung place-window-summary
   to hon ben duoi. */
.window-chip{ font-family:'Space Grotesk',sans-serif; font-size:11px; font-weight:600; color:var(--gray900); padding:3px 9px; border-radius:var(--r-full); border:1px solid transparent; white-space:nowrap; }
.window-chip.go{ background:rgba(213,254,132,.3); border-color:rgba(78,172,106,.45); }
.window-chip.partial{ background:rgba(252,236,69,.3); border-color:rgba(213,160,0,.45); }
.window-chip.no-go{ background:rgba(249,115,22,.12); border-color:rgba(249,115,22,.5); }
.window-chip.loading{ background:var(--gray100); border-color:var(--gray200); color:var(--gray400); }
/* Khoi tom tat thoi tiet tung buoi tren dau the dia diem trong danh sach -
   icon TO (buoi + thoi tiet WMO) de de nhin ngay tu xa, thay cho chip chu
   nho truoc day. 2 o (sang/chieu) canh nhau, mau nen theo trang thai. */
.place-window-summary{ display:flex; gap:8px; flex-wrap:wrap; }
.place-window-summary.loading{ font-size:12.5px; color:var(--gray400); }
.pw-slot{ flex:1 1 140px; display:flex; align-items:center; gap:6px; padding:7px 10px; border-radius:var(--r-lg); border:1.5px solid transparent; }
.pw-slot.go{ background:rgba(213,254,132,.3); border-color:rgba(78,172,106,.4); }
.pw-slot.partial{ background:rgba(252,236,69,.3); border-color:rgba(213,160,0,.4); }
.pw-slot.no-go{ background:rgba(249,115,22,.12); border-color:rgba(249,115,22,.45); }
.pw-daytime{ font-size:20px; line-height:1; }
.pw-weather{ font-size:24px; line-height:1; }
.pw-info{ display:flex; flex-direction:column; min-width:0; }
.pw-status{ font-family:'Space Grotesk',sans-serif; font-weight:700; font-size:12px; color:var(--gray900); white-space:nowrap; }
.pw-nums{ font-size:10.5px; color:var(--gray700); font-variant-numeric:tabular-nums; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.place-reason{ font-size:12.5px; color:var(--gray700); background:var(--gray50); border-radius:var(--r-lg); padding:8px 10px; line-height:1.5; }
/* Ghi chu nho o duoi the thay cho khoi weather-group truoc day - chi neu
   su that "dung chung du lieu" chu khong tach hang rieng nua. */
.place-group-note{ font-size:11px; color:var(--gray400); font-style:italic; }
/* badge "thoi diem ly tuong" - theo chu ky nam/thang/am lich, khac voi
   place-status/place-reason (tinh theo NGAY cu the tu thoi tiet that).
   Dung mau xanh duong rieng de khong lan voi thang mau an-toan/can-trong. */
.ideal-time{ background:rgba(52,162,219,.08); border:1px solid rgba(52,162,219,.25); border-radius:var(--r-lg); padding:8px 10px; }
.ideal-time-badge{ display:block; font-family:'Space Grotesk',sans-serif; font-weight:700; font-size:12px; color:var(--blue-dark); margin-bottom:3px; }
.ideal-time-detail{ display:block; font-size:12px; color:var(--gray700); line-height:1.5; }
.place-tags{ display:flex; flex-wrap:wrap; gap:6px; margin-top:2px; }
.tag{ font-size:11px; font-weight:600; color:var(--gray700); background:var(--gray100); padding:4px 9px; border-radius:var(--r-lg); }
.place-foot{ font-size:11px; color:var(--gray400); margin-top:2px; border-top:1px solid var(--gray100); padding-top:8px; }
.place-maps{ font-size:12px; }
.place-maps a{ color:var(--green-dark); font-weight:600; text-decoration:none; }
.place-maps a:hover{ text-decoration:underline; }
.place-sources{ font-size:11px; color:var(--gray400); }
.place-sources a{ color:var(--blue); text-decoration:none; border-bottom:1px solid rgba(43,118,239,.3); }
.place-sources a:hover{ border-bottom-color:var(--blue); }
.place-upload{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-top:2px; }
.upload-btn{
  font-size:12px; font-weight:600; color:var(--blue); background:rgba(43,118,239,.1);
  padding:7px 12px; border-radius:var(--r-lg); cursor:pointer; transition:background .2s ease;
}
.upload-btn:hover{ background:rgba(43,118,239,.18); }
.upload-status{ font-size:11.5px; color:var(--gray500); }

/* thang tham chieu - dock thanh 1 nut icon info goc duoi-phai, bam moi hien bang */
.scale-fab{
  position:fixed; right:20px; bottom:20px; z-index:120;
  width:50px; height:50px; border-radius:var(--r-full); border:none;
  background:var(--blue); color:#fff; box-shadow:var(--shadow-xl);
  display:flex; align-items:center; justify-content:center; cursor:pointer;
  transition:transform .15s ease, background .2s ease;
}
.scale-fab:hover{ background:var(--blue-dark); transform:scale(1.05); }
.scale-fab:active{ transform:scale(.96); }
.scale-fab[aria-expanded="true"]{ background:var(--blue-dark); }

.scale-fab-panel{
  position:fixed; right:20px; bottom:82px; z-index:120;
  width:min(360px, calc(100vw - 40px)); max-height:min(70vh, 560px);
  overflow-y:auto; background:var(--white); border:1px solid var(--gray200);
  border-radius:var(--r-2xl); box-shadow:var(--shadow-xl); padding:18px;
}
.scale-fab-header{ display:flex; align-items:flex-start; justify-content:space-between; gap:10px; margin-bottom:8px; }
.scale-summary-title{ font-family:'Space Grotesk',sans-serif; font-weight:700; font-size:15px; color:var(--gray900); }
.scale-summary-hint{ font-size:11.5px; color:var(--gray500); margin-top:2px; }
.scale-fab-close{
  flex:none; width:26px; height:26px; border-radius:var(--r-full); border:none;
  background:var(--gray100); color:var(--gray700); cursor:pointer; font-size:12px;
}
.scale-fab-close:hover{ background:var(--gray200); }
.scale-fab-panel .section-note{ margin:0 0 14px; }
.scale-panel{ display:flex; flex-direction:column; gap:16px; }
.scale-row-label{ font-family:'Space Grotesk',sans-serif; font-weight:700; font-size:13px; color:var(--gray900); margin-bottom:6px; }
.scale-bar{ display:flex; border-radius:var(--r-lg); overflow:hidden; }
.scale-seg{ flex:1; padding:8px 4px; text-align:center; color:var(--gray900); }
.scale-seg .tier{ font-size:11px; font-weight:700; display:block; }
.scale-seg .range{ font-family:'Space Grotesk',sans-serif; font-variant-numeric:tabular-nums; font-size:10.5px; display:block; margin-top:2px; opacity:.8; }

/* ban do */
/* position+z-index rieng: Leaflet dung transform tang toc GPU cho lop
   tile ben trong, co the "tran" len tren cac phan tu sticky dung sau no
   trong DOM neu ban than .map-card khong tu lap ngu canh stacking rieng
   voi z-index THAP HON khoi sticky (scale-collapsible dang dung 5). */
.map-card{ position:relative; z-index:1; background:var(--white); border:1px solid var(--gray200); border-radius:var(--r-2xl); overflow:hidden; box-shadow:var(--shadow-lg); }
.map-toolbar{ display:flex; justify-content:flex-end; padding:10px 12px 0; }
.map-expand-btn{
  font-size:12px; font-weight:600; color:var(--blue); background:rgba(43,118,239,.1);
  border:none; padding:7px 12px; border-radius:var(--r-lg); cursor:pointer; transition:background .2s ease;
}
.map-expand-btn:hover{ background:rgba(43,118,239,.18); }
#mapView{ height:340px; width:100%; background:var(--gray100); margin-top:8px; }
.map-legend{ display:flex; gap:16px; padding:10px 16px; font-size:12px; color:var(--gray700); border-top:1px solid var(--gray100); flex-wrap:wrap; }
.map-legend .dot{ display:inline-block; width:10px; height:10px; border-radius:50%; margin-right:6px; vertical-align:middle; }
.map-legend .dot.go{ background:var(--green-dark); }
.map-legend .dot.partial{ background:var(--yellow-dark); }
.map-legend .dot.no-go{ background:var(--orange); }

/* ban do phong to - phu toan man hinh, ghim/nhan giu nguyen nhu ban thu nho */
.map-card.map-fullscreen{
  position:fixed; inset:0; z-index:100; border-radius:0; display:flex; flex-direction:column;
}
.map-card.map-fullscreen #mapView{ flex:1; height:auto; margin-top:0; }
.map-card.map-fullscreen .map-toolbar{ padding:12px 14px; border-bottom:1px solid var(--gray200); }
body.map-open{ overflow:hidden; }

.map-popup-detail .status-line{ font-weight:700; padding:2px 0; }
.map-popup-detail .status-line.go{ color:var(--green-dark); }
.map-popup-detail .status-line.partial{ color:var(--yellow-dark); }
.map-popup-detail .status-line.no-go{ color:var(--orange); }
.map-popup-detail .reason-line{ font-size:12px; color:var(--gray700); margin:4px 0 6px; }
.map-popup-detail .map-popup-windows{ display:flex; gap:5px; flex-wrap:wrap; margin-bottom:6px; }
.map-popup-detail .map-popup-windows:empty{ display:none; }
.map-popup-detail .wstat-row{ font-size:11.5px; }
.map-popup-detail .popup-links{ display:flex; gap:10px; font-size:12px; }
.map-popup-detail .popup-links a{ color:var(--blue); text-decoration:none; }
.map-popup-detail .popup-links a:hover{ text-decoration:underline; }
.map-popup{ font-family:'Be Vietnam Pro',sans-serif; font-size:13px; }
.map-popup b{ font-family:'Space Grotesk',sans-serif; display:block; margin-bottom:4px; font-size:13.5px; }
.map-popup .map-popup-item{ display:flex; justify-content:space-between; gap:8px; padding:3px 0; border-top:1px solid var(--gray100); }
.map-popup .map-popup-item:first-of-type{ border-top:none; }
.leaflet-popup-content-wrapper{ border-radius:var(--r-lg); }

/* nhan co dinh tren moi ghim: Ten + khuyen nghi, bam vao cung zoom vao duoc */
.leaflet-tooltip.map-label{
  background:var(--white); border:1.5px solid var(--gray200); border-radius:var(--r-lg);
  box-shadow:var(--shadow-sm); padding:4px 8px; font-family:'Be Vietnam Pro',sans-serif;
  font-size:11px; color:var(--gray900); white-space:nowrap; line-height:1.5; cursor:pointer;
}
.leaflet-tooltip.map-label b{ font-family:'Space Grotesk',sans-serif; font-weight:700; margin-right:6px; }
.leaflet-tooltip.map-label.leaflet-tooltip-top::before{ border-top-color:var(--gray200); }
/* o muc zoom toan canh (moi vua fitBounds), 12 nhan de len nhau roi mat -
   an het nhan, chi giu lai cham mau trang thai; zoom gan hon lai hien ra. */
.leaflet-container.labels-collapsed .leaflet-tooltip.map-label{ display:none; }
.map-label-status{ font-size:10px; font-weight:700; padding:1px 7px; border-radius:var(--r-full); }
.map-label-status.go{ background:rgba(213,254,132,.35); color:var(--green-dark); }
.map-label-status.partial{ background:rgba(252,236,69,.35); color:var(--yellow-dark); }
.map-label-status.no-go{ background:rgba(249,115,22,.14); color:var(--orange); }
.map-label-status.loading{ background:var(--gray100); color:var(--gray400); }

footer{ margin-top:8px; padding-top:16px; border-top:1px solid var(--gray200); font-size:11px; color:var(--gray400); line-height:1.7; }
