
.chip { min-height: var(--tap); background: var(--surface-2); color: var(--ink); padding: 6px 14px; font-size: calc(14px * var(--fs)); line-height: 1.35; white-space: nowrap; flex: none; }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--surface); font-weight: 700; }
.link {
  border: 0; background: none; color: var(--accent); text-decoration: underline; cursor: pointer;
  min-height: var(--tap); padding: 4px 8px; font-size: calc(13px * var(--fs));
}
/* ---------- แผงล่าง ---------- */
.sheet {
  position: absolute; left: 0; right: 0; bottom: var(--tab-h); z-index: 2;
  background: var(--surface); border-radius: var(--r-sheet) var(--r-sheet) 0 0; box-shadow: var(--shadow-sheet);
  padding: 0 12px 8px;
  /* พับ = เห็นแค่ peek · .open = กาง · FAB ติดขอบบนแผงจึงเลื่อนตาม */
  transform: translateY(calc(100% - var(--peek))); transition: transform .28s var(--ease-out);
}
.sheet.open { transform: none; }
.peek { position: relative; display: flex; align-items: center; gap: 8px; height: var(--peek); padding-top: 10px; }
.peek .handle { position: absolute; inset: 0 -12px; width: auto; height: auto; }
.peek .handle span { position: absolute; top: 8px; left: 50%; margin-left: -18px; }
.peek-sum { position: relative; flex: 1; min-width: 0; margin: 0; font-weight: 700; font-size: calc(15px * var(--fs)); pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.peek-btn { position: relative; flex: none; min-height: var(--tap); margin-bottom: 6px; padding: 4px 18px; border: 0; border-radius: var(--pill); font-weight: 700; font-size: calc(19px * var(--fs)); background: var(--brand); color: var(--surface); box-shadow: var(--shadow-hard); }
/* พับ: ซ่อนจากโฟกัส/โปรแกรมอ่านจอ */
.sheet:not(.open) .sheet-panel { visibility: hidden; transition: visibility 0s .28s; }
/* กาง: เว้นที่ให้ FAB อยู่ใต้แถบค้นหา */
.sheet-panel { max-height: calc(100vh - var(--tab-h) - var(--peek) - 330px); max-height: calc(100dvh - var(--tab-h) - var(--peek) - 330px); overflow-y: auto; overscroll-behavior: contain; }
.float-row {
  position: absolute; left: 8px; right: 8px; bottom: calc(100% + 12px); /* +ขอบบนแผง 2px = ห่างแถบ 10px */
  display: flex; justify-content: flex-end; align-items: flex-end; gap: 8px; pointer-events: none;
}
.float-row > * { pointer-events: auto; }
.fab-col {
  flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 12px;
  transform-origin: 100% 100%; transition: transform .22s var(--ease-out), opacity .22s ease;
}
.fab-col.moving { transform: scale(.86); opacity: .82; } /* ยุบเบา ๆ ตอนเลื่อนแผนที่ ขยายกลับเมื่อหยุด */
.loc-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; padding: 0; cursor: pointer;
  border: 1px solid var(--hair); border-radius: 50%; background: var(--surface); color: var(--ink);
  box-shadow: 0 2px 8px var(--shadow);
  transition: transform .18s var(--spring), box-shadow .15s ease, background-color .15s ease;
}
@media (hover: hover) { .loc-btn:hover { box-shadow: 0 3px 12px var(--shadow), 0 1px 3px var(--shadow); } }
.loc-btn:active { transform: scale(.96); transition-duration: .08s; }
.loc-btn:focus-visible { outline: 2px solid var(--info); outline-offset: 2px; }
.loc-btn[aria-busy="true"] { background: var(--bg); cursor: progress; }
.loc-btn[aria-busy="true"] .ico { animation: loc-spin 1.6s linear infinite; }
@keyframes loc-spin { to { transform: rotate(360deg); } }
/* .fab ทั่วไป (หน้าอื่น) = ปุ่มเต็มความกว้างสีอ่อนเหมือนเดิม */
.fab {
  display: flex; width: 100%; margin-top: 8px; padding: 8px 16px; font-weight: 700; font-size: calc(14px * var(--fs));
  background: var(--surface-2); color: var(--ink);
}
.fab-col .fab {
  display: inline-flex; width: auto; margin: 0 0 6px; gap: 6px; min-height: 56px; padding: 4px 8px 4px 16px; border-radius: var(--pill); white-space: nowrap;
  font-weight: 700; font-size: 17px; background: var(--brand); color: var(--surface); box-shadow: var(--shadow-hard);
}
.fab-col .ico { flex: none; }
.pts-chip {
  margin-left: 2px; padding: 4px 10px; border-radius: 999px; font-size: calc(12px * var(--fs)); line-height: 1.3;
  background: var(--gold-soft); color: var(--gold-ink);
}
.credit {
  margin: 0; padding: 4px 8px; font-size: calc(11px * var(--fs)); line-height: 1.4; text-align: right;
  background: rgba(255, 255, 255, .9); border-radius: var(--r); color: var(--ink);
}
.credit a { color: var(--ink); }
.map-attrib {
  position: absolute; left: 8px; top: 120px; z-index: 3; margin: 0; padding: 0;
  max-width: calc(100% - 16px); white-space: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
  font-size: 9px; line-height: 14px; color: rgba(43, 21, 32, .74); text-shadow: 0 1px 0 rgba(255, 255, 255, .85);
  background: transparent !important; box-shadow: none; border: 0; border-radius: 0;
}
.map-attrib::-webkit-scrollbar { display: none; }
.map-attrib a { color: inherit; }
.maplibregl-ctrl-top-left .maplibregl-ctrl.map-attrib { margin: 0; } /* ชนะ margin 10px ของ MapLibre */
.map-page .maplibregl-ctrl-top-left { right: 0; } /* ให้ max-width 100% อิงความกว้างแผนที่ */
.handle {
  display: block; width: 100%; height: var(--tap); border: 0; background: none; cursor: pointer; padding: 0;
}
.handle span { display: block; width: 36px; height: 4px; margin: 0 auto; border-radius: var(--pill); background: var(--surface-2); }
.area-title { margin: 0 0 4px; font-size: calc(16px * var(--fs)); }
.stats { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin: 0 0 8px; }
.stats div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 4px 8px; min-width: 0; }
.stats dt { font-size: calc(11px * var(--fs)); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stats dd { margin: 0; font-size: calc(17px * var(--fs)); font-weight: 700; font-variant-numeric: tabular-nums; }
.legend-box summary {
  display: flex; align-items: center; min-height: var(--tap); cursor: pointer; font-size: calc(13px * var(--fs)); font-weight: 700; color: var(--accent);
}
.legend-box[open] .legend { animation: rise-sm .2s var(--ease-out); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: calc(12px * var(--fs)); margin-bottom: 8px; }
.legend > span { display: inline-flex; align-items: center; gap: 4px; }
.legend img { image-rendering: pixelated; }
.legend .txt b { color: var(--promo); }
.legend .promo.dim img { opacity: .4; } /* หมุดร้านแนะนำ = user_pin_promo.png ตรง ๆ (แสงม่วงอยู่ในภาพแล้ว) */
.legend .promo.dim .txt, .legend .promo.dim .txt b { color: var(--muted); }
/* legend 3 บรรทัด: ตัวอย่างหมุดขนาดจริงในคอลัมน์กว้าง 34px ให้ข้อความตรงกัน */
.legend3 { flex-direction: column; gap: 6px; }
.legend3 > span { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 8px; }
.legend3 > span > :first-child { justify-self: center; }
.legend3 > span:not(.promo) .txt b { color: var(--ink); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0; scrollbar-width: none; }
/* fade 28px = right padding, so the last chip is clear at scroll end */
.sheet .chips {
  scroll-snap-type: x proximity; scroll-padding-left: 0; padding-right: 28px;
  -webkit-mask-image: linear-gradient(to right, black calc(100% - 28px), transparent);
  mask-image: linear-gradient(to right, black calc(100% - 28px), transparent);
}
.sheet .chips .chip { scroll-snap-align: start; }
.sheet-body { margin-top: 8px; }
.dot { flex: none; width: 10px; height: 10px; margin-top: 8px; border-radius: 0; }
.dot.lv1, .dot.lv2, .dot.lv3 { display: inline-block; box-shadow: 0 0 0 1px var(--line); }
.dot.lv1 { background: var(--gold-soft); }
.dot.lv2 { background: var(--gold); }
.dot.lv3 { background: var(--gold-ink); }
.legend .dot { margin: 0 8px; vertical-align: middle; }
.badge .dot { width: 8px; height: 8px; margin: 0 4px 0 0; box-shadow: 0 0 0 1px var(--line); vertical-align: 0; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { border-bottom: 1px solid var(--line); }
.list .empty { display: flex; align-items: center; gap: 12px; padding: 12px 4px; color: var(--muted); }
.row {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; text-align: left; border: 0; background: none;
  padding: 10px 4px; cursor: pointer;
}
.row:hover { background: var(--surface); }
.row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-top { display: flex; align-items: baseline; gap: 8px; }
.row-name { flex: 1; min-width: 0; font-size: calc(17px * var(--fs)); font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.row-top .badge.rv { flex: none; font-size: calc(13px * var(--fs)); font-weight: 400; color: var(--muted); white-space: nowrap; }
.row-meta { font-size: calc(13px * var(--fs)); line-height: 1.35; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .badges { margin-top: 2px; }
.more { display: flex; width: 100%; margin: 8px 0; padding: 8px; background: var(--surface-2); font-weight: 700; }
.badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.badge { font-size: calc(12px * var(--fs)); line-height: 1.6; padding: 0 8px; border-radius: var(--pill); border: 0; background: var(--surface-2); color: var(--brand-deep); }
.badge.dup { background: var(--gold-soft); color: var(--gold-ink); }
.badge.rv { border: 0; padding: 0; background: none; color: var(--ink); font-weight: 700; }
.badge.rv .st { width: 12px; height: 12px; fill: currentColor; color: var(--star); margin-right: 3px; vertical-align: -1px; }
.badge.ok { background: var(--gold-soft); color: var(--gold-ink); }
.badge.pick { background: var(--gold); color: var(--ink); font-weight: 700; }
.badge.pick-why { border: 0; background: none; color: var(--muted); }
.badge.unv { background: var(--bg); color: var(--muted); }
/* ---------- แผงตัวกรอง (bottom sheet) ---------- */
.fsheet { position: fixed; inset: 0; z-index: 10; }
.fsheet-scrim {
  position: absolute; inset: 0; width: 100%; border: 0; padding: 0; cursor: pointer;
  background: rgba(43, 21, 32, .45); animation: fade-in .2s ease;
}
.fsheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 85vh; overflow-y: auto;
  background: var(--surface); border-radius: var(--r-sheet) var(--r-sheet) 0 0; box-shadow: var(--shadow-sheet);
  padding: 8px 16px calc(env(safe-area-inset-bottom) + 16px);
  animation: sheet-up .28s var(--ease-out);
}
.fsheet .grab { display: block; width: 36px; height: 4px; margin: 0 auto 8px; border-radius: var(--pill); background: var(--surface-2); }
.fsheet h2 { margin: 0 0 4px; font-size: calc(18px * var(--fs)); }
.fsheet h3 { margin: 12px 0 4px; font-size: calc(13px * var(--fs)); color: var(--muted); }
.fsheet-foot { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.fsheet-foot .btn-main { flex: 1; width: auto; }
@media (min-width: 900px) {
  .fsheet-panel { left: 50%; right: auto; width: 480px; margin-left: -240px; border: 1px solid var(--line); border-bottom: 0; }
}
/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 64px); z-index: 30;
  width: max-content; max-width: calc(100% - 32px); padding: 8px 16px; /* max-content: left 50% ทำให้กล่องหดเหลือครึ่งจอ ข้อความยาวจึงตัดบรรทัด */ font-size: calc(14px * var(--fs)); font-weight: 700;
  background: var(--ink); color: var(--surface); border-radius: var(--r);
  opacity: 0; pointer-events: none; transform: translate(-50%, 0);
}
.toast.show { opacity: 1; animation: toast 2.6s var(--ease-out) both; }
/* ---------- การ์ดร้าน = ชีตล่าง (รอบ GG · UI_SYSTEM_V1) ---------- */
.maplibregl-popup { z-index: 4; }
.shop-pop { position: fixed !important; top: auto !important; left: 0 !important; right: 0; bottom: var(--tab-h); transform: none !important; max-width: 480px !important; margin: 0 auto; }
.shop-pop .maplibregl-popup-tip { display: none; }
.maplibregl-popup-content {
  width: 100%; max-height: calc(100dvh - var(--tab-h) - 120px); overflow-y: auto;
  font-family: var(--font); border-radius: var(--r-sheet) var(--r-sheet) 0 0; padding: 12px 16px 8px;
  box-shadow: var(--shadow-sheet); animation: rise-sm .18s var(--ease-out);
}
.card-head { display: flex; align-items: flex-start; gap: 8px; }
.card-head .pin-spr { --h: 28px; margin-top: 2px; }
.card h3 { flex: 1; min-width: 0; margin: 0; font-size: calc(17px * var(--fs)); line-height: 1.4; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-x { flex: none; width: var(--tap); height: var(--tap); margin: -8px -6px 0 0; border: 0; background: none; font-size: calc(20px * var(--fs)); line-height: 1; color: var(--ink-2); cursor: pointer; }
.card .badges { margin-top: 8px; }
.card .badges:empty { display: none; }
.card p { margin: 4px 0; font-size: calc(13px * var(--fs)); }
.card .addr { overflow-wrap: anywhere; }
.card-meta { margin-top: 8px !important; color: var(--muted); }
.card-meta .rv { color: var(--ink); }
.card-meta .st { width: 12px; height: 12px; fill: currentColor; color: var(--star); margin-right: 3px; vertical-align: -1px; }
.card-btns { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 8px; margin-top: 12px; }
.card .card-btns > * { min-width: 0; min-height: 48px; margin: 0; padding: 0 8px; border: 0; border-radius: var(--pill); display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--ink); font-weight: 700; font-size: calc(15px * var(--fs)); text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: transform .18s var(--spring); }
.card-btns > :active { transform: scale(.96); transition-duration: .08s; }
.card-btns .go { background: var(--brand); color: var(--surface); font-size: calc(19px * var(--fs)); box-shadow: var(--shadow-hard); }
.card-btns { margin-bottom: 6px; }
.rate-link { display: block; min-height: var(--tap); margin: 4px auto 0; padding: 0 12px; border: 0; background: none; color: var(--brand-deep);
  font-weight: 700; font-size: calc(15px * var(--fs)); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.card-more { border-top: 1px solid var(--line); }
.card-more summary { min-height: var(--tap); display: flex; align-items: center; color: var(--muted); font-size: calc(13px * var(--fs)); cursor: pointer; }
.tel-link { display: flex; align-items: center; min-height: var(--tap); font-weight: 700; }
.sub-sheet { width: 100%; max-width: 480px; max-height: 90dvh; margin: auto auto 0; padding: 0; border: 0; border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sheet); overflow: auto; }
.sub-sheet::backdrop { background: rgb(0 0 0 / 40%); }
.sub-sheet[open] { animation: rise-sm .2s var(--ease-out); }
.sub-box { position: relative; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }
.sub-box .card-x { position: absolute; top: 8px; right: 4px; margin: 0; }
.sub-box .star-form { margin: 0; gap: 12px; }
.sub-box .sf-shop { margin-right: 40px; font-size: calc(17px * var(--fs)); line-height: 1.4; overflow-wrap: anywhere; }
.sub-box .stars { gap: 8px; }
.sub-box .star { flex: 1; min-height: 48px; border-radius: var(--r-input); }
.sub-box .btn-main { min-height: 48px; }
.sf-pts { font-size: calc(13px * var(--fs)); color: var(--muted); }
.badge.legacy { background: var(--surface-alt); }
.star-form .own-note { font-weight: 700; color: var(--accent); }
.star-form :disabled { opacity: .45; cursor: not-allowed; }
.peek-clear { position: relative; flex: none; padding: 4px 10px; }
.peek-clear:not([hidden]) ~ .peek-btn { padding: 4px 12px; }
.peek-sum { white-space: normal; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.h-ic { display: flex; align-items: center; gap: 8px; }
.h-ic .hunt-ic { width: auto; height: 28px; }
.rank td { padding: 8px 4px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.hof-empty { margin: 8px 0 0; color: var(--muted); }
.box h2 .count { color: var(--muted); font-size: calc(15px * var(--fs)); }
.ms-full p { margin: 0; }
.ms-full .hunt-ic { width: auto; height: 120px; }
.missions { list-style: none; margin: 8px 0 0; padding: 0; }
/* การ์ดร้านเด็ดในแผงหน้าเขต/ผลค้นหา */
.hot-box { margin: 0 0 8px; padding: 10px 12px; border-radius: 16px; background: var(--surface-2); }
.hot-h { margin: 0 0 6px; font-size: calc(15px * var(--fs)); }
.hot-empty, .hot-note { margin: 0; color: var(--muted); font-size: calc(13px * var(--fs)); }
.hot-note { margin-top: 6px; font-size: calc(11px * var(--fs)); }
.hot-item { padding: 6px 0; border-bottom: 1px solid var(--line); }
.hot-name { font-weight: 700; color: var(--ink); }
.hot-why { margin: 2px 0 4px; font-size: calc(13px * var(--fs)); }
.hot-snooze { background: var(--surface); }
.card .eat-btn { margin-top: 8px; }
.eat-btn[aria-pressed="true"] { background: var(--gold); }
.km-badge { display: inline-block; margin: 2px 0 0; font-size: calc(11px * var(--fs)); }
/* ---------- คัดร้าน: โหมดวางหมุด + ฟอร์ม (prototype เก็บในเครื่อง) ---------- */
.pin-ui { position: absolute; inset: 0 0 var(--tab-h) 0; z-index: 5; pointer-events: none; }
.pin-center { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -100%); } /* .pin-spr ปลายอยู่กลางขอบล่างพอดี */
.pin-bar {
  position: absolute; left: 8px; right: 8px; bottom: 8px; pointer-events: auto; text-align: center;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-card); padding: 12px; border-radius: var(--r);
  animation: rise .28s var(--ease-out);
}
@media (min-width: 900px) { .pin-bar { left: auto; right: 8px; width: 340px; } }
.pin-bar p { margin: 0 0 8px; font-weight: 700; }
.pin-bar .btn-main { width: 100%; }
.pin-mode .top, .pin-mode .sheet, .pin-mode .tabbar { opacity: .35; pointer-events: none; }
.sheet-form { position: fixed; inset: 0; z-index: 10; background: rgba(43, 21, 32, .45); overflow-y: auto; padding: 16px 12px; animation: fade-in .2s ease; }
.sheet-form form { max-width: 480px; margin: 0 auto; background: var(--surface); border-radius: var(--r-sheet); animation: rise .28s var(--ease-out); }
.sheet-form label, .sheet-form legend { display: block; font-weight: 700; margin: 12px 0 4px; }
.sheet-form fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.sheet-form input:not([type="checkbox"]), .review-form textarea {
  width: 100%; box-sizing: border-box; font: inherit; padding: 8px; min-height: var(--tap); border: 1px solid var(--ink-2); border-radius: var(--r-input); background: var(--surface);
}
.sheet-form .row { display: flex; gap: 8px; margin-top: 8px; }
.sheet-form .row input { flex: 1; min-width: 0; }
.sheet-form .req { color: var(--accent); font-weight: 400; }
.sheet-form .opt { color: var(--muted); font-weight: 400; }
.sheet-form label.chk {
  display: inline-flex; align-items: center; gap: 4px; margin: 0; font-weight: 400; min-height: var(--tap);
  background: var(--surface-2); padding: 4px 12px; cursor: pointer; border-radius: var(--pill);
}
.sheet-form label.chk:has(input:checked) { background: var(--accent); color: var(--surface); }
.sheet-form .btn-main { width: 100%; margin-top: 12px; }
.preview { display: block; max-width: 100%; max-height: 160px; object-fit: contain; /* รูปผู้ใช้สัดส่วนไม่แน่นอน: กล่อง 240x160 คงที่ */ margin-top: 8px; border: 1px solid var(--line); }
.err-text { color: var(--accent); font-weight: 700; min-height: 1em; margin: 8px 0 0; }
.badge.wait { background: var(--gold-soft); color: var(--gold-ink); }
.card .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.review-form { margin-top: 8px; }
.review-form .chip { margin-top: 4px; }
.pts-msg { font-weight: 700; color: var(--accent); }
