/* ส่วนที่ design system ไม่ได้กำหนด: responsive ของ shell, overlay, ฟอร์มแบบ controlled */
html, body, #root { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-sans, 'Noto Sans Thai', 'Noto Sans', Sarabun, system-ui, sans-serif); }
.me-shell { min-height: 100vh; }
.app-link { color: inherit; text-decoration: none; }
a.me-link, .me-link { color: var(--teal-700); cursor: pointer; text-decoration: none; }
a.me-link:hover { text-decoration: underline; }
.row-link { color: inherit; text-decoration: none; display: block; }
.row-link:hover .me-cell-title { color: var(--teal-700); text-decoration: underline; }

/* overlay */
.overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; }
.overlay .me-scrim { position: absolute; inset: 0; background: var(--scrim); }
.overlay .me-modal { max-height: calc(100vh - 32px); overflow: auto; z-index: 1; }
.overlay-right { place-items: stretch end; padding: 0; }
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: 24px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.me-mtab { display: none; }

/* shell responsive: ≥1280 sidebar เต็ม · 1024–1279 icon rail · 768–1023 icon rail 1 คอลัมน์ · <768 มือถือ */
@media (max-width: 1279px) { .me-shell { grid-template-columns: 72px 1fr; } .me-shell .me-side { padding: var(--space-4) var(--space-2); align-items: center; } .me-shell .nav-label, .me-shell .me-nav-sec, .me-shell .me-ws, .me-shell .me-brand-sub, .me-shell .side-user-text { display: none; } .me-shell .me-nav-item { justify-content: center; padding: 0; width: 44px; } .me-shell .me-nav-item .me-count { display: none; } .me-shell .logo-full { display: none; } .me-shell .logo-mark { display: block; } }
@media (min-width: 1280px) { .logo-mark { display: none; } }
@media (max-width: 767px) {
  .me-shell { grid-template-columns: 1fr; }
  .me-shell .me-side { display: none; }
  .me-top { padding: 0 var(--space-3); height: 56px; }
  .me-page { padding: var(--space-4); padding-bottom: 88px; }
  .me-mtab { display: grid; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; }
  .hide-mobile { display: none !important; }
  .me-modal { max-width: 100%; }
}
.me-top .crumbs { min-width: 0; overflow: hidden; }

/* ฟอร์ม controlled */
.me-input input, .me-input select, .me-input textarea { font: inherit; color: inherit; background: transparent; border: 0; outline: 0; width: 100%; min-width: 0; }
.me-input:focus-within { outline: 2px solid var(--teal-600); outline-offset: 2px; }
.me-check input { position: absolute; opacity: 0; pointer-events: none; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
@media (max-width: 767px) { .form-grid { grid-template-columns: 1fr; } }
.toolbar { display: flex; gap: var(--space-3); flex-wrap: wrap; align-items: center; }
.toolbar .grow { flex: 1; min-width: 200px; }
.pager { display: flex; align-items: center; justify-content: space-between; padding: var(--space-3) var(--space-4); border-top: 1px solid var(--border); color: var(--ink-3); font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.login-wrap { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; background: var(--surface); }
@media (max-width: 899px) { .login-wrap { grid-template-columns: 1fr; } .login-brand { display: none !important; } }
.copy-box { font-family: var(--font-mono, monospace); font-size: 13px; background: var(--surface-3); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; word-break: break-all; }
.skip-link { position: absolute; left: -999px; } .skip-link:focus { left: 8px; top: 8px; z-index: 300; background: var(--surface); padding: 8px 12px; border-radius: 8px; }

a.me-nav-item, a.me-nav-item:hover { text-decoration: none; }
.me-tab, .me-tab:hover { text-decoration: none; }
.me-table-wrap { overflow-x: auto; }

/* แผนที่กองรถ: หมุดตามสถานะ (สี + ไอคอน ไม่ใช้สีอย่างเดียว) */
.pin { position: relative; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: #fff; border: 2px solid #fff; box-shadow: var(--shadow-2); transition: transform .15s; }
.pin-ok { background: var(--ok-500); } .pin-warn { background: var(--warn-50); color: var(--warn-700); border-color: var(--warn-500); } .pin-neutral { background: var(--neutral-400); }
.pin-stale { border-style: dashed; border-color: var(--ink-3); }
.pin-sel { transform: scale(1.25); box-shadow: 0 0 0 3px var(--teal-600), var(--shadow-3); z-index: 10; } .pin-hover { transform: scale(1.2); box-shadow: 0 0 0 3px var(--teal-300), var(--shadow-3); }
.pin-badge { position: absolute; right: -6px; top: -6px; width: 16px; height: 16px; border-radius: 50%; background: var(--warn-50); color: var(--warn-700); border: 1px solid var(--warn-500); display: grid; place-items: center; font-style: normal; }
.pin-cluster { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; box-shadow: var(--shadow-2); border: 2px solid #fff; }
.pin-cluster span { width: 30px; height: 30px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: var(--ink); }
.map-tools { position: absolute; left: 58px; top: 12px; z-index: 500; display: flex; gap: 8px; flex-wrap: wrap; }
.map-nolist { position: absolute; left: 12px; top: 56px; z-index: 500; width: 260px; max-height: 280px; overflow: auto; }
.map-legend { position: absolute; left: 12px; bottom: 12px; z-index: 500; display: flex; gap: 12px; flex-wrap: wrap; background: rgba(255,255,255,.92); border: 1px solid var(--border); border-radius: 8px; padding: 4px 10px; font-size: 12px; color: var(--ink-2); }
.map-legend span { display: inline-flex; align-items: center; gap: 4px; } .map-legend .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.map-legend .dot.ok { background: var(--ok-500); } .map-legend .dot.warn { background: var(--warn-500); } .map-legend .dot.neutral { background: var(--neutral-400); }
.me-leaflet-pop .leaflet-popup-content-wrapper { border-radius: var(--radius-lg); padding: 0; box-shadow: var(--shadow-3); }
.me-leaflet-pop .leaflet-popup-content { margin: 14px; font-family: inherit; }
/* การ์ดในป๊อปอัป: ห้ามใช้คลาส me-map-info ของ design-system (position:absolute + ลูกศรของตัวเอง ทำให้กล่องป๊อปอัปหดเหลือ 1px) */
.map-pop-card { display: flex; flex-direction: column; gap: 10px; width: 260px; max-width: 100%; }
.leaflet-container { font-family: inherit; }
.me-chart { position: relative; }
.cursor-line { position: absolute; top: 14px; bottom: 26px; width: 0; border-left: 2px solid var(--teal-600); pointer-events: none; }
.th-sort { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; font: inherit; font-weight: inherit; color: inherit; }
.th-sort:focus-visible { outline: 2px solid var(--teal-600); outline-offset: 2px; border-radius: 4px; }
.pager-size { font: inherit; font-size: 13px; border: 1px solid var(--border-strong); border-radius: 6px; padding: 4px 6px; background: var(--surface); color: var(--ink); }
.fleet-split { align-items: start; }
@media (max-width: 1279px) { .fleet-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } .fleet-split { grid-template-columns: 1fr; } }
@media (max-width: 767px) { .fleet-kpis { grid-template-columns: 1fr; } }
tr.sel { background: var(--teal-50); }
.history-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--space-6); align-items: start; }
@media (max-width: 1279px) { .history-grid { grid-template-columns: 1fr; } }
.me-chart { position: relative; }
.today-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--space-4); }
@media (max-width: 1279px) { .today-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 767px) { .today-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.vehicle-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-6); align-items: start; }
.vehicle-cols.stretch { align-items: stretch; }
.vehicle-cols.stretch > * { height: 100%; box-sizing: border-box; }
.packs-grid > .me-stack { display: flex; flex-direction: column; height: 100%; }
.packs-grid > .me-stack > .me-card { flex: 1 1 auto; }
.packs-grid > .me-card { height: 100%; box-sizing: border-box; }
@media (max-width: 1023px) { .vehicle-cols { grid-template-columns: 1fr; } }
.packs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--space-4); }
.mono-line { font-variant-numeric: tabular-nums; }

/* มือถือ: ส่วนที่ design system ตั้งความกว้างขั้นต่ำไว้ต้องย่อได้ และแท็บเลื่อนแนวนอนภายในตัวเอง ไม่ให้ทั้งหน้าล้น */
@media (max-width: 767px) {
  .me-card div[style*="min-width: 380px"] { min-width: 0 !important; flex-basis: 100%; }
  .me-tabs { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: thin; }
  .me-tabs .me-tab { flex: none; white-space: nowrap; }
  .me-page { min-width: 0; overflow-x: hidden; }
  .me-table-wrap { max-width: 100%; }
}
.overlay-right .me-card[role="dialog"] { max-width: none; }
.me-mtab .me-count { position: absolute; top: 6px; left: 52%; }
.me-nav-item.sub { padding-left: 34px; }
.overlay-bottom { place-items: end stretch; padding: 0; }
.overlay-bottom > div { display: contents; }
.cat-strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--space-3); }
.cat-card { text-align: left; padding: 14px; cursor: pointer; font: inherit; color: inherit; }
.cat-card.cat-on { border-color: var(--teal-600); background: var(--teal-50); }
@media (max-width: 1279px) { .cat-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 767px) { .cat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.event-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: var(--space-6); align-items: start; }
@media (max-width: 1279px) { .event-grid { grid-template-columns: 1fr; } }
.builder-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: var(--space-6); align-items: start; }
.builder-side { position: sticky; top: 80px; }
@media (max-width: 1279px) { .builder-grid { grid-template-columns: 1fr; } .builder-side { position: static; } }
.cond-row { display: grid; grid-template-columns: minmax(0, 2fr) 110px minmax(0, 1fr) 40px; gap: 10px; align-items: end; }
@media (max-width: 767px) { .cond-row { grid-template-columns: 1fr 1fr; } }
code.expr { font-family: var(--font-mono, monospace); font-size: 12.5px; background: var(--surface-3); border-radius: 6px; padding: 2px 6px; word-break: break-word; }
.expr-preview { display: flex; flex-direction: column; gap: 4px; }
.picker { max-height: 180px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; display: grid; gap: 6px; }
.me-input textarea { width: 100%; background: transparent; border: 0; outline: 0; font: inherit; }
.dest-row { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.dest-row:first-child { border-top: 0; }
.wiz-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--space-6); align-items: start; }
@media (max-width: 1023px) { .wiz-grid { grid-template-columns: 1fr; } }
.cmd-card { display: flex; flex-direction: column; gap: 4px; width: 100%; padding: 14px; border: 1px solid var(--border-strong); border-radius: var(--radius-md); background: var(--surface); font: inherit; color: inherit; cursor: pointer; text-align: left; }
.cmd-card:disabled { cursor: not-allowed; opacity: .65; background: var(--surface-2); }
.cmd-card.on { border-color: var(--teal-600); background: var(--teal-50); box-shadow: 0 0 0 1px var(--teal-600); }
.picker.tall { max-height: 360px; }
.me-check input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }

/* แถบแจ้งเวอร์ชันใหม่ (หน้าที่เปิดค้างเป็นรุ่นเก่า) */
.new-version-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 2000; display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap; padding: 8px 16px; background: var(--navy-900); color: var(--on-navy); font-size: 14px; box-shadow: 0 2px 8px rgba(0,0,0,.25); }

/* ---- ระยะห่างระหว่างการ์ดให้แคบลง ---- */
.me-page { gap: var(--space-4); padding: var(--space-5); }
.me-kpis { gap: var(--space-3); }
.me-split, .history-grid, .builder-grid { gap: var(--space-4); }
.fleet-kpis + .me-card, .me-page > .me-stack { gap: var(--space-3); }
@media (max-width: 767px) { .me-page { gap: var(--space-3); } }

/* ---- กระดิ่ง "รถที่ควรดู" ---- */
.watch-bell { position: relative; }
.watch-btn { all: unset; box-sizing: border-box; position: relative; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; cursor: pointer; color: var(--ink-2); }
.watch-btn:hover { background: var(--surface-3); }
.watch-btn:focus-visible { outline: 2px solid var(--teal-600); outline-offset: 2px; }
.watch-count { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--warn-500); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--surface); }
.watch-count.crit { background: var(--crit-500); }
.watch-pop { position: absolute; right: 0; top: calc(100% + 8px); width: 400px; max-width: calc(100vw - 24px); max-height: min(70vh, 640px); display: flex; flex-direction: column; z-index: 1500; box-shadow: var(--shadow-3); padding: 0; overflow: hidden; }
.watch-list { overflow: auto; }
.watch-row { display: block; padding: 12px 16px; border-top: 1px solid var(--border); }
@media (max-width: 767px) { .watch-bell { position: static; } .watch-pop { position: fixed; left: 12px; right: 12px; top: 60px; width: auto; max-height: calc(100vh - 80px); } }

/* ---- ข้อมูลย้อนหลัง: แผนที่เล่นย้อนหลังใหญ่ขึ้น และค้างอยู่ขณะเลื่อนดูกราฟ ---- */
.history-grid { grid-template-columns: minmax(0, 1fr) minmax(420px, 42%); }
.history-side { position: sticky; top: 76px; max-height: calc(100vh - 92px); overflow: auto; }
@media (max-width: 1279px) { .history-grid { grid-template-columns: 1fr; } .history-side { position: static; } }

/* คำสั่ง: รายละเอียดคำสั่งที่เลือก + กล่องข้อความที่อุปกรณ์ตอบ */
.cmd-detail { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-2, var(--surface)); }
.reply-box { display: block; font-family: var(--font-mono); font-size: 12px; line-height: 1.5; padding: 6px 8px; background: var(--surface-3); border-radius: 6px; overflow-wrap: anywhere; white-space: pre-wrap; max-height: 120px; overflow: auto; }

.volt-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 4px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; cursor: pointer; }
.volt-chip i { width: 10px; height: 10px; border-radius: 50%; }
.volt-chip[data-off="1"] { color: var(--ink-3); background: var(--surface-2); text-decoration: line-through; }
.volt-chip[data-off="1"] i { opacity: .35; }
.volt-chip:focus-visible { outline: 2px solid var(--teal-500); outline-offset: 2px; }

/* ===== ธีมมืด: ทับ token ของ design system (ไม่แก้ tokens.css) ===== */
:root[data-theme="dark"] {
  color-scheme: dark;
  --navy-950: #060D17; --navy-900: #0E1A2A; --navy-800: #1A3352; --navy-200: #A9BBD0; --on-navy: #F3F7FB;
  --teal-700: #6FD6CB; --teal-600: #0A7A72; --teal-500: #19B3A8; --teal-300: #6FD0C6; --teal-100: #12403D; --teal-50: #0F2B2A; --on-teal: #FFFFFF;
  --bg: #0A111B; --surface: #121B27; --surface-2: #16212F; --surface-3: #1D2A3B;
  --border: #243246; --border-strong: #8190A3;
  --ink: #E8EEF5; --ink-2: #BAC6D3; --ink-3: #98A6B8; --ink-disabled: #5E6C7E;
  --ok-700: #72D69B; --ok-500: #2BB673; --ok-50: #11301F;
  --warn-700: #F4BB5E; --warn-500: #E8960C; --warn-50: #382A0E;
  --crit-700: #FF9088; --crit-500: #F0554A; --crit-50: #3A1714;
  --neutral-700: #BAC6D3; --neutral-400: #8B96A5; --neutral-50: #1D2A3B;
  --info-700: #94B8F7; --info-500: #4C8BF0; --info-50: #14243F;
  --series-1: #3DCBBE; --series-2: #7FA2F2; --series-3: #E083B6; --series-4: #E8AE3C;
  --map-land: #1B2430; --map-water: #14283A; --map-road: #2A3646; --map-road-major: #4A4130; --map-park: #1B2D24;
  --scrim: rgba(0, 0, 0, 0.62);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4); --shadow-2: 0 4px 12px rgba(0, 0, 0, 0.45); --shadow-3: 0 16px 40px rgba(0, 0, 0, 0.6);
}
:root[data-theme="dark"] .me-btn-primary:hover { background: var(--teal-500); }
:root[data-theme="dark"] .me-banner.me-tone-ok { box-shadow: inset 0 0 0 1px #1E5236; }
:root[data-theme="dark"] .me-banner.me-tone-warn { box-shadow: inset 0 0 0 1px #6B4D12; }
:root[data-theme="dark"] .me-banner.me-tone-crit { box-shadow: inset 0 0 0 1px #7A2A24; }
:root[data-theme="dark"] .me-banner.me-tone-info { box-shadow: inset 0 0 0 1px #24437A; }
:root[data-theme="dark"] .me-map-legend, :root[data-theme="dark"] .map-legend, :root[data-theme="dark"] .me-flow-legend { background: rgba(18, 27, 39, .92); color: var(--ink-2); }
:root[data-theme="dark"] .pin-cluster span { background: var(--surface); }
/* แผ่นที่ OSM เป็นภาพสว่าง: หรี่และกลับสีให้เข้ากับธีมมืด */
:root[data-theme="dark"] .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.9) saturate(.7); }
:root[data-theme="dark"] .leaflet-container { background: var(--map-water); }
:root[data-theme="dark"] .leaflet-popup-content-wrapper, :root[data-theme="dark"] .leaflet-popup-tip { background: var(--surface); color: var(--ink); }
:root[data-theme="dark"] img.logo-light-only { filter: none; }
.theme-btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--ink-2); font: inherit; font-size: 12.5px; cursor: pointer; }
.theme-btn:hover { background: var(--surface-3); color: var(--ink); }
.theme-btn:focus-visible { outline: 2px solid var(--teal-500); outline-offset: 2px; }
@media (max-width: 720px) { .theme-btn span { display: none; } }

.kb-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 20px; border: 0; border-top: 1px solid var(--border); background: none; color: var(--ink); font: inherit; cursor: pointer; text-align: left; }
.kb-row:hover { background: var(--surface-3); }
.kb-row:focus-visible { outline: 2px solid var(--teal-500); outline-offset: -2px; }

.me-input textarea { height: auto; min-height: 64px; padding-top: 8px; padding-bottom: 8px; line-height: 1.5; resize: vertical; }
.opt-chip { display: inline-flex; align-items: center; min-height: 32px; padding: 4px 12px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; cursor: pointer; }
.opt-chip:hover { background: var(--surface-3); }
.opt-chip[aria-pressed="true"] { background: var(--teal-50); border-color: var(--teal-600); color: var(--teal-700); font-weight: 600; }
.opt-chip:focus-visible { outline: 2px solid var(--teal-500); outline-offset: 2px; }

/* หน้าสถานที่ที่รถแวะ: แถบตัวกรอง (ชิปคลิกเลือกหมวดมาตรฐาน + dropdown หมวดที่เพิ่มเอง/จังหวัด) */
.places-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-3) var(--space-4); padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--border); }
.places-filters .me-seg { flex-wrap: wrap; max-width: 100%; }
.places-count { margin-left: 6px; font-size: 12px; font-weight: 500; color: var(--ink-3); font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .places-filters .me-field { min-width: 0; width: 100%; } }

/* หน้าสถานที่ที่รถแวะ: แท็บแผนที่ (วงกลมซ้อนบนแผนที่จริง) */
.places-map-wrap { position: relative; }
.places-map-canvas { position: relative; height: clamp(440px, 64vh, 720px); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.places-map-tools { position: absolute; left: 58px; top: 12px; right: 12px; z-index: 500; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; pointer-events: none; }
.places-map-tools > * { pointer-events: auto; }
.places-chip { display: inline-flex; align-items: center; background: rgba(255,255,255,.94); border: 1px solid var(--border); border-radius: 8px; padding: 4px 10px; font-size: 13px; color: var(--ink-2); box-shadow: var(--shadow-1); }
.places-map-tools .me-seg { box-shadow: var(--shadow-1); }
.places-map-el { position: absolute; inset: 0; background: var(--map-land); }
.places-map-loading { position: absolute; right: 12px; top: 12px; z-index: 500; background: rgba(255,255,255,.94); border: 1px solid var(--border); border-radius: 8px; padding: 4px 10px; }
.places-map-empty { position: absolute; inset: 0; z-index: 400; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.7); pointer-events: none; }
.places-legend { display: flex; flex-wrap: wrap; gap: var(--space-4) var(--space-8, 40px); align-items: flex-end; padding: var(--space-4) var(--space-5); }
.places-legend-item { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.places-legend-sizes { display: flex; align-items: flex-end; gap: 14px; }
.places-legend-sizes span { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; color: var(--ink-3); }
.places-legend-sizes i { display: block; border-radius: 50%; background: rgba(215, 48, 39, .35); border: 1.5px solid #8a2a20; }
.places-grad { height: 12px; width: 260px; max-width: 100%; border-radius: 6px; border: 1px solid rgba(0,0,0,.18); }
.places-grad-ticks { display: flex; justify-content: space-between; width: 260px; max-width: 100%; font-size: 12px; color: var(--ink-3); }
.places-pop { padding: 12px 14px; min-width: 210px; }
.places-pop-title { font-weight: 700; font-size: 15px; }
.places-pop-sub { color: var(--ink-3); font-size: 12px; margin-bottom: 8px; }
.places-pop-dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 14px; margin: 0 0 8px; font-size: 13px; }
.places-pop-dl dt { color: var(--ink-3); } .places-pop-dl dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.places-pop-link { font-size: 13px; }
.places-tip { font-size: 12px; line-height: 1.4; }
@media (max-width: 640px) { .places-map-canvas { height: 440px; } .places-map-tools { position: static; padding: 10px var(--space-4); } } /* มือถือ: ปุ่มควบคุมอยู่เหนือแผนที่ ไม่บังข้อมูล */

/* ช่องเลือก (dropdown) ทั้งโปรเจ็ค: คลิกได้ทั้งกล่อง (รวมขอบและลูกศรด้านขวา) ไม่ใช่เฉพาะตัวอักษร
   — padding ของกล่องย้ายเข้าไปอยู่ใน select (select ยังอยู่ใน flow จึงกำหนดความกว้างตามเนื้อหาเหมือนเดิม), ไอคอนวางทับแบบไม่รับเมาส์ */
.me-input.me-select { position: relative; padding: 0; cursor: pointer; }
.me-input.me-select select { flex: 1; width: 100%; height: 100%; padding: 0 40px 0 var(--space-3); cursor: pointer; text-overflow: ellipsis; }
.me-input.me-select > svg { position: absolute; top: 50%; transform: translateY(-50%); pointer-events: none; }
.me-input.me-select > svg:last-child { right: 12px; }
.me-input.me-select > svg:first-child:not(:last-child) { left: 12px; }
.me-input.me-select > svg:first-child:not(:last-child) ~ select { padding-left: 38px; }
.me-input.me-select.me-input-disabled, .me-input.me-select.me-input-disabled select { cursor: not-allowed; }
/* ช่องเลือกแบบพิมพ์ค้นหา (combobox) */
.me-combo { position: relative; cursor: text; }
.me-combo-clear { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border: 0; border-radius: 50%; background: none; color: var(--ink-3); cursor: pointer; }
.me-combo-clear:hover { background: var(--surface-3); color: var(--ink); }
.me-combo-list { position: absolute; left: -1px; right: -1px; top: calc(100% + 4px); z-index: 1200; max-height: 280px; overflow: auto; margin: 0; padding: 4px; list-style: none; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow-3); }
.me-combo-opt { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 14px; }
.me-combo-opt.active { background: var(--surface-3); } .me-combo-opt.selected { font-weight: 700; }
.me-combo-hint { color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.me-combo-empty { padding: 10px; color: var(--ink-3); font-size: 13px; }
.places-legend-line { display: block; width: 44px; border-radius: 3px; background: #1565c0; }
