/* หน้าแผนที่: แผนที่เต็มจอ + แถบค้นหา/ชั้นข้อมูลด้านบน + แผงรายละเอียดด้านล่าง (ตาม mockup มือถือ 2) */
.map-page { overflow: hidden; height: 100vh; height: 100dvh; }
#map { position: fixed; inset: 0 0 calc(68px + env(safe-area-inset-bottom)) 0; background: #E9EEE8; }

.map-top { position: fixed; top: 0; left: 0; right: 0; padding: 16px 16px 0; display: flex; flex-direction: column; gap: 10px; max-width: 480px; margin: 0 auto; pointer-events: none; z-index: 2; }
.map-top > * { pointer-events: auto; }
.map-search { position: relative; }
.map-brand-row { display: flex; align-items: center; gap: 8px; }
.brand-icon { flex-shrink: 0; display: block; width: 48px; height: 48px; padding: 4px; border-radius: 14px; background: var(--card); box-shadow: 0 2px 8px rgba(19, 34, 46, .08); }
.brand-icon img { display: block; border-radius: 10px; }
.map-brand-row .search-box { flex: 1; min-width: 0; }
.search-box { display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 14px; border-radius: 24px; background: var(--card); border: 1px solid var(--border); box-shadow: 0 2px 8px rgba(19, 34, 46, .08); }
.search-box input { flex: 1; min-width: 0; border: 0; outline: none; font: inherit; background: transparent; color: var(--ink); }

.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex-shrink: 0; min-height: 44px; padding: 0 16px; border-radius: 22px; border: 1px solid var(--border); background: var(--card); font-size: .93rem; box-shadow: 0 1px 4px rgba(19, 34, 46, .06); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.chip.soon { color: #8A959E; }

.locate { position: fixed; right: 16px; bottom: calc(68px + 132px + env(safe-area-inset-bottom)); width: 48px; height: 48px; border-radius: 24px; border: 1px solid var(--border); background: var(--card); display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(19, 34, 46, .12); z-index: 2; }

.sheet-panel { position: fixed; left: 0; right: 0; bottom: calc(68px + env(safe-area-inset-bottom)); max-width: 480px; margin: 0 auto; padding: 10px 16px 16px; background: var(--card); border-radius: 20px 20px 0 0; box-shadow: 0 -4px 16px rgba(19, 34, 46, .12); z-index: 2; max-height: 50vh; overflow-y: auto; }
.grip-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; width: 100%; min-height: 28px; margin: -6px 0 6px; padding: 6px 0 0; border: 0; background: none; touch-action: none; }
.grip { width: 40px; height: 4px; border-radius: 2px; background: var(--border); }
.peek { display: none; font-size: .87rem; color: var(--muted); }
/* ย่อแผง: เหลือแถบจับ + ข้อความชวนแตะ (สูง ~52px) */
.sheet-panel { transition: transform .22s ease; }
.sheet-collapsed .sheet-panel { transform: translateY(calc(100% - 52px)); overflow: hidden; }
.sheet-collapsed .peek { display: block; }
.locate { transition: bottom .22s ease; }
.sheet-collapsed .locate { bottom: calc(68px + 68px + env(safe-area-inset-bottom)); }
.sheet-collapsed .maplibregl-ctrl-bottom-right { bottom: 56px; }
.hint-line { margin: 0; color: var(--muted); font-size: .93rem; }
.legend { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: .8rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 4px; }

.st-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.st-kind { font-size: .8rem; color: var(--muted); }
.st-head h2 { margin: 2px 0 0; font-size: 1.27rem; font-weight: 700; line-height: 1.3; }
.st-close { flex-shrink: 0; width: 44px; height: 44px; margin: -8px -10px 0 0; border: 0; background: none; color: var(--muted); font-size: 1.4rem; line-height: 1; }
.st-value { margin-top: 10px; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.st-value .num { font-family: 'Anuphan', sans-serif; font-size: 2rem; font-weight: 700; line-height: 1; }
.st-value .unit { color: var(--muted); font-size: .87rem; }
.st-label { margin-top: 6px; display: flex; align-items: center; gap: 6px; font-weight: 600; }
.bar { margin-top: 12px; height: 12px; border-radius: 6px; background: var(--line); position: relative; overflow: visible; }
.bar-fill { height: 12px; border-radius: 6px; max-width: 100%; }
.bar-mark { position: absolute; top: -4px; width: 2px; height: 20px; background: #A3211A; }
.bar-legend { margin-top: 6px; display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); }
.st-meta { margin-top: 10px; font-size: .87rem; color: var(--muted); }
.st-meta.stale { color: #8A4300; font-weight: 600; }

.place-results.floating { position: absolute; top: 54px; left: 0; right: 0; padding: 8px; border-radius: 16px; background: var(--card); box-shadow: 0 6px 20px rgba(19, 34, 46, .18); max-height: 50vh; overflow-y: auto; }

.map-error { position: fixed; left: 16px; right: 16px; top: 140px; z-index: 3; max-width: 448px; margin: 0 auto; }

.me-dot { width: 22px; height: 22px; border-radius: 11px; background: #2F6FD6; border: 4px solid #fff; box-shadow: 0 0 0 10px rgba(47, 111, 214, .18); }
.maplibregl-ctrl-attrib { font-size: 10px; }
.maplibregl-ctrl-bottom-right { bottom: 132px; }

/* เรดาร์ฝน */
.radar-ctl { margin-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .87rem; font-weight: 600; }
.ghost.small { min-height: 40px; padding: 0 12px; font-size: .87rem; }
.official-radar { margin-top: 8px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.radar-thumb { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--ink); font-size: .8rem; }
.radar-thumb img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; background: var(--ground); border: 1px solid var(--line); }
.radar-thumb small { color: var(--muted); }

/* เมนูล่างต้องอยู่เหนือแผง — แผงที่ย่อจะเลื่อนลงไปซ่อนใต้เมนู */
.map-page .nav { z-index: 5; }
