/* Self-hosted fonts (OFL, subset to Thai + Latin) — no request to Google, see vendor/fonts/OFL-*.txt */
@font-face { font-family: "Anuphan"; src: url("vendor/fonts/anuphan-var.woff") format("woff"); font-weight: 100 700; font-display: swap; }
@font-face { font-family: "Chonburi"; src: url("vendor/fonts/chonburi.woff") format("woff"); font-weight: 400; font-display: swap; }

/* Layout: one-screen app. An intro globe spins and dives into Thailand, then hands over to a
   flat province map. The search panel floats left on desktop and sits under the map on phones.
   Skin: orange on black by default; a white skin is one click away (data-skin on <html>).
   Uses its own data-skin attribute on purpose, so the site's look does not follow the OS theme. */
:root {
  --sea: #0a0a0b;
  --land: #1b1b1d;
  --land-edge: #3b3a3d;
  --land-hover: #29292c;
  --origin: #ff7a1a;          /* the customer's province + pin */
  --route: #ff9a3d;           /* routes and destination pins */
  --route-soft: #2c1a0c;
  --on-accent: #120a03;
  --surface: #131315;
  --ink: #f4efe9;
  --muted: #a39d96;
  --line: #2a2a2d;
  --focus: #ffc58f;
  --glow: rgb(255 122 26 / 0.35);
  --shadow: 0 12px 34px rgb(0 0 0 / 0.55);
  --font-display: "Chonburi", "Anuphan", "Noto Sans Thai", serif;
  --font-body: "Anuphan", "Noto Sans Thai", "Leelawadee UI", system-ui, sans-serif;
  --r: 14px;
  color-scheme: dark;
}
:root[data-skin="light"] {
  --sea: #f4f2ef; --land: #ffffff; --land-edge: #d9d3cc; --land-hover: #fff1e5;
  --origin: #c24e00; --route: #d35f00; --route-soft: #ffeedd; --on-accent: #ffffff;
  --surface: #ffffff; --ink: #161412; --muted: #6b645d; --line: #ebe6e0; --focus: #b84a00;
  --glow: rgb(232 93 0 / 0.22); --shadow: 0 12px 30px rgb(40 24 10 / 0.12);
  color-scheme: light;
}

html, body { height: 100%; }
body { margin: 0; background: var(--sea); color: var(--ink); font: 15px/1.55 var(--font-body); }
a { color: var(--origin); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.app { height: 100%; display: flex; flex-direction: column; }
.bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-block: 10px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  background: var(--surface); border-bottom: 1px solid var(--line); z-index: 2;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 22px; height: 22px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--route); box-shadow: inset 0 0 0 6px var(--surface); outline: 2px solid var(--route); }
.brand-name { font-family: var(--font-display); font-size: 1.2rem; letter-spacing: 0.01em; }
.bar-link { color: var(--muted); text-decoration: none; font-size: 0.92rem; }
.bar-link:hover { color: var(--ink); }

.stage { position: relative; flex: 1; min-height: 0; display: flex; }
.map-wrap { position: relative; flex: 1; min-height: 0; display: flex; }
.map { flex: 1; min-height: 0; background: var(--sea); }
.leaflet-container { background: var(--sea); font: inherit; }

.panel {
  position: absolute; z-index: 1000; top: 16px; bottom: 16px; left: max(16px, env(safe-area-inset-left, 0px));
  width: 380px; max-width: calc(100% - 32px); overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 6px;
  background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px;
}
@media (max-width: 720px) {
  .stage { flex-direction: column; }
  .map-wrap { flex: 0 0 46%; }
  .panel {
    position: static; width: auto; max-width: none; flex: 1; min-height: 0; border-radius: var(--r) var(--r) 0 0;
    margin-top: 0; padding-block: 16px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
    padding-bottom: max(16px, env(safe-area-inset-bottom, 0px));
  }
}

.step { padding-block: 8px; border-bottom: 1px solid var(--line); }
.step-title { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; font-size: 1rem; font-weight: 600; text-wrap: balance; }
.step-no { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 0.8rem; font-weight: 700; color: var(--surface); background: var(--origin); }
.more summary { cursor: pointer; list-style: none; margin: 0; }
.more summary::-webkit-details-marker { display: none; }
.more[open] summary { margin-bottom: 10px; }
.optional { margin-left: auto; font-size: 0.78rem; font-weight: 500; color: var(--muted); }

.row { display: flex; gap: 8px; }
.row .field { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lbl { display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; color: var(--muted); }
.field { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; min-height: 42px; box-sizing: border-box; width: 100%; }
.btn { font: inherit; font-weight: 600; border-radius: 10px; padding: 9px 12px; min-height: 42px; cursor: pointer; border: 1px solid transparent; }
.btn.ghost { background: transparent; color: var(--origin); border-color: var(--line); white-space: nowrap; }
.btn.ghost:hover { border-color: var(--origin); }
.hint { margin: 6px 0 0; color: var(--muted); font-size: 0.86rem; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font: inherit; font-size: 0.92rem; padding: 7px 13px; border-radius: 999px; cursor: pointer; background: transparent; color: var(--ink); border: 1px solid var(--line); }
.chip:hover { border-color: var(--route); }
.chip[aria-checked="true"] { background: var(--route); border-color: var(--route); color: var(--on-accent); font-weight: 600; }

.results { padding-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.empty-title { margin: 0; font-weight: 600; }
.summary-line { margin: 0; color: var(--muted); font-size: 0.88rem; }
.summary-line strong { color: var(--ink); }
.place-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.place { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: start; padding: 10px 4px; border-bottom: 1px solid var(--line); cursor: pointer; border-radius: 8px; }
.place:hover, .place.active { background: var(--route-soft); }
.place-no { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 0.78rem; font-weight: 700; background: var(--route); color: var(--on-accent); font-variant-numeric: tabular-nums; }
.place-name { margin: 0; font-weight: 600; line-height: 1.35; min-width: 0; }
.place-meta { margin: 2px 0 0; color: var(--muted); font-size: 0.84rem; }
.place-dist { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 0.9rem; white-space: nowrap; }

.section-title { margin: 8px 0 0; font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.hotel { display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.hotel-name { margin: 0; font-weight: 600; min-width: 0; }
.hotel-meta { margin: 2px 0 0; color: var(--muted); font-size: 0.84rem; font-variant-numeric: tabular-nums; }
.tag { display: inline-block; font-size: 0.72rem; padding: 1px 7px; border-radius: 999px; background: var(--line); color: var(--muted); }
.book { align-self: center; font-size: 0.85rem; font-weight: 600; white-space: nowrap; text-decoration: none; color: var(--on-accent); background: var(--origin); padding: 7px 11px; border-radius: 8px; }
.book[aria-disabled="true"] { background: var(--line); color: var(--muted); pointer-events: none; }

.panel-foot { margin-top: auto; padding-top: 12px; color: var(--muted); font-size: 0.75rem; display: flex; flex-direction: column; gap: 4px; }
.panel-foot p { margin: 0; }
.panel-foot a { color: inherit; }

/* Map pieces */
.pin { width: 26px; height: 26px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); display: grid; place-items: center; box-shadow: 0 3px 8px rgb(0 0 0 / 0.25); }
.pin span { transform: rotate(45deg); color: var(--on-accent); font: 700 12px/1 var(--font-body); font-variant-numeric: tabular-nums; }
.pin.origin { background: var(--origin); width: 32px; height: 32px; box-shadow: 0 0 0 5px var(--glow), 0 3px 8px rgb(0 0 0 / 0.3); }
.pin.dest { background: var(--route); }
.route { stroke-dasharray: 6 7; animation: draw 1.1s ease-out both; }
@keyframes draw { from { stroke-dashoffset: 400; opacity: 0; } to { stroke-dashoffset: 0; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .route { animation: none; } }

.leaflet-popup-content-wrapper { background: var(--surface); color: var(--ink); border-radius: 12px; box-shadow: var(--shadow); }
.leaflet-popup-tip { background: var(--surface); }
.leaflet-popup-content { margin: 12px 14px; font: 14px/1.45 var(--font-body); min-width: 190px; }
.pop-act { display: inline-block; font-size: 0.75rem; font-weight: 600; color: var(--route); background: var(--route-soft); padding: 2px 8px; border-radius: 999px; }
.pop-name { margin: 6px 0 2px; font-size: 1rem; font-weight: 700; }
.pop-meta { margin: 0 0 8px; color: var(--muted); font-size: 0.84rem; }
.leaflet-container a.pop-link { font-weight: 600; color: var(--origin); }
.leaflet-tooltip.prov-label { background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: none; font: 600 12px var(--font-body); }
.leaflet-control-attribution { background: color-mix(in srgb, var(--surface) 85%, transparent) !important; color: var(--muted); }
.leaflet-control-attribution a { color: var(--muted); }
.leaflet-bar a { background: var(--surface); color: var(--ink); border-color: var(--line); }

/* Header actions + skin toggle */
.bar-actions { display: flex; align-items: center; gap: 14px; }
.skin { font: inherit; font-size: 0.85rem; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  color: var(--ink); background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px 6px 8px; min-height: 36px; }
.skin:hover { border-color: var(--origin); }
.skin-dot { width: 16px; height: 16px; border-radius: 50%; background: linear-gradient(90deg, #0a0a0b 50%, #ffffff 50%); box-shadow: inset 0 0 0 2px var(--origin); }

/* Intro globe overlay (sits on the map, fades out once Thailand fills the view) */
.globe { position: absolute; inset: 0; z-index: 900; width: 100%; height: 100%; background: var(--sea); transition: opacity 1.1s ease; cursor: pointer; }
.globe.done { opacity: 0; pointer-events: none; }
.globe-skip { position: absolute; z-index: 960; right: max(16px, env(safe-area-inset-right, 0px)); bottom: 16px; font: inherit; font-size: 0.82rem;
  color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.globe-skip[hidden] { display: none; }
@media (min-width: 721px) { .globe-skip { right: 24px; bottom: 24px; } }

/* Mascot: Nong Som */
.mascot { width: 56px; height: 56px; transform-origin: 50% 90%; animation: idle 2.4s ease-in-out infinite; filter: drop-shadow(0 4px 6px rgb(0 0 0 / 0.35)); }
.mascot.flip svg { transform: scaleX(-1); }
.mascot .m-skin { fill: var(--origin); }
.mascot .m-ear { fill: var(--route); }
.mascot .m-pack { fill: var(--ink); }
.mascot .m-pack-flap { fill: var(--surface); opacity: 0.85; }
.mascot .m-eye { fill: var(--on-accent); }
.mascot :is(.m-skin, .m-ear, .m-pack) { stroke: var(--on-accent); stroke-width: 1.6; }
.mascot .m-shine { fill: #fff; }
.mascot .m-cheek { fill: #ff4d6d; opacity: 0.55; }
.mascot .m-line { stroke: var(--on-accent); stroke-width: 1.6; stroke-linecap: round; }
.mascot .m-shadow { fill: rgb(0 0 0 / 0.28); }
.mascot.drop { animation: drop 1.1s cubic-bezier(.3, 1.4, .5, 1) both, idle 2.4s ease-in-out 1.1s infinite; }
.mascot.walk { animation: hop 0.36s ease-in-out infinite; }
@keyframes idle { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-3px) rotate(-2deg); } }
@keyframes hop { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-7px) rotate(4deg); } }
@keyframes drop { 0% { transform: translateY(-160px) scale(0.6); opacity: 0; } 60% { opacity: 1; } 100% { transform: translateY(0) scale(1); } }

/* Fly-through clouds (canvas, drawn by clouds.js) — above the globe so they cover its hand-over */
.clouds { position: absolute; inset: 0; z-index: 950; width: 100%; height: 100%; pointer-events: none; }
.map-wrap.flying .leaflet-map-pane { will-change: transform; }

/* Results arrive one row at a time */
.place, .hotel, .summary-line { animation: rise 0.45s cubic-bezier(.2, .7, .2, 1) both; }
.place:nth-child(2) { animation-delay: 0.05s; } .place:nth-child(3) { animation-delay: 0.1s; }
.place:nth-child(4) { animation-delay: 0.15s; } .place:nth-child(5) { animation-delay: 0.2s; }
.place:nth-child(6) { animation-delay: 0.25s; } .place:nth-child(7) { animation-delay: 0.3s; }
.place:nth-child(8) { animation-delay: 0.35s; } .hotel { animation-delay: 0.4s; }
.empty { animation: rise 0.35s ease-out both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.chip, .btn, .skin, .place, .book { transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .15s ease; }
.chip:active, .btn:active { transform: scale(0.97); }
body, .panel, .bar { transition: background-color .35s ease, color .35s ease; }
/* Animate the inner box only: Leaflet positions .leaflet-popup itself with a transform. */
.leaflet-popup-content-wrapper { animation: pop 0.28s cubic-bezier(.2, .9, .3, 1.2) both; transform-origin: 50% 100%; }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(0.96); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .place, .hotel, .summary-line, .empty, .leaflet-popup-content-wrapper { animation: none; } }

/* Tuk-tuk ride */
.mascot.ride { width: 76px; height: 57px; animation: none; }
.mascot.ride .m-car { animation: bump 0.32s ease-in-out infinite; transform-origin: 50% 90%; }
.mascot.ride .m-rider { animation: bump 0.32s ease-in-out 0.08s infinite; }
.mascot .m-hull { fill: var(--ink); stroke: var(--on-accent); stroke-width: 1.4; }
.mascot .m-roof { fill: var(--origin); stroke: var(--on-accent); stroke-width: 1.4; }
.mascot .m-frame { fill: var(--muted); }
.mascot .m-window { fill: var(--surface); opacity: 0.8; }
.mascot .m-lamp { fill: #ffd166; }
.mascot .m-wheel { fill: var(--on-accent); stroke: var(--muted); stroke-width: 1.4; }
.mascot .m-hub { fill: var(--muted); }
.mascot.arrive { animation: arrive 0.5s ease-out both, idle 2.4s ease-in-out 0.5s infinite; }
@keyframes bump { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
@keyframes arrive { from { transform: translateY(-14px) scale(0.85); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .mascot.ride .m-car, .mascot.ride .m-rider, .mascot.arrive { animation: none; } }

/* ?debug panel (bug reports) */
.debug-panel { position: fixed; z-index: 5000; left: max(12px, env(safe-area-inset-left, 0px)); right: max(12px, env(safe-area-inset-right, 0px));
  bottom: max(12px, env(safe-area-inset-bottom, 0px)); max-width: 560px; margin-inline: auto; max-height: 55vh; overflow: auto;
  background: var(--surface); color: var(--ink); border: 2px solid var(--origin); border-radius: 12px; box-shadow: var(--shadow); padding: 12px; }
.debug-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; font-size: 0.85rem; }
.debug-head span { color: var(--muted); }
.debug-panel pre { margin: 0; white-space: pre-wrap; word-break: break-word; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--sea); padding: 10px; border-radius: 8px; }
.debug-actions { display: flex; gap: 8px; margin-top: 8px; }
.debug-actions button { font: inherit; font-size: 0.85rem; font-weight: 600; padding: 7px 12px; border-radius: 8px; cursor: pointer; border: 1px solid var(--line); background: transparent; color: var(--ink); }
.debug-actions #debug-copy { background: var(--origin); color: var(--on-accent); border-color: var(--origin); }

@media (max-width: 720px) { .leaflet-control-attribution { font-size: 10px; } }

/* Leaflet shapes get a rectangular browser focus ring after a tap; the orange border already shows the selection. */
.leaflet-interactive:focus, .leaflet-interactive:focus-visible { outline: none; }

/* ---------- Activity bar with icons (scrolls sideways) ---------- */
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; gap: 4px; margin-inline: -4px; padding: 2px 4px 8px; scroll-snap-type: x proximity; scrollbar-width: thin;
  -webkit-mask: linear-gradient(90deg, transparent, #000 10px, #000 calc(100% - 22px), transparent); mask: linear-gradient(90deg, transparent, #000 10px, #000 calc(100% - 22px), transparent); }
.chip-ic { flex: none; scroll-snap-align: start; display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 72px; padding: 9px 8px 8px;
  border: 0; border-radius: 12px; color: var(--muted); font-size: 0.78rem; line-height: 1.2; text-align: center; }
.chip-ic span { max-width: 9ch; }
.chip-ic .ic { color: var(--ink); opacity: 0.85; }
.chip-ic:hover { background: var(--land-hover); color: var(--ink); }
.chip-ic[aria-checked="true"] { background: var(--route-soft); color: var(--origin); font-weight: 700; box-shadow: inset 0 -2px 0 var(--origin); }
.chip-ic[aria-checked="true"] .ic { color: var(--origin); opacity: 1; }

/* ---------- Start screen ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stats div { display: flex; flex-direction: column; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--sea); }
.stats strong { font-family: var(--font-display); font-weight: 400; font-size: 1.35rem; line-height: 1.2; color: var(--origin); font-variant-numeric: tabular-nums; }
.stats span { font-size: 0.78rem; color: var(--muted); }
.ideas { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.idea { font: inherit; text-align: left; cursor: pointer; display: grid; grid-template-columns: 34px 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center;
  padding: 10px; border-radius: 12px; border: 1px solid var(--line); background: transparent; color: var(--ink); transition: border-color .2s ease, transform .15s ease, background-color .2s ease; animation: rise .45s cubic-bezier(.2,.7,.2,1) both; }
.idea:nth-child(2) { animation-delay: .05s; } .idea:nth-child(3) { animation-delay: .1s; } .idea:nth-child(4) { animation-delay: .15s; } .idea:nth-child(5) { animation-delay: .2s; } .idea:nth-child(6) { animation-delay: .25s; }
.idea:hover { border-color: var(--origin); background: var(--route-soft); }
.idea:active { transform: scale(0.98); }
.idea-ic { grid-row: span 2; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--route-soft); color: var(--origin); }
.idea-title { font-weight: 600; font-size: 0.9rem; line-height: 1.3; min-width: 0; }
.idea-meta { font-size: 0.76rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; }
.quick-btn { font: inherit; font-size: 0.86rem; display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--ink); cursor: pointer; }
.quick-btn:hover { border-color: var(--origin); }
.quick-btn .ic { color: var(--origin); }
.quick-btn b { font-weight: 700; color: var(--origin); font-variant-numeric: tabular-nums; }

/* ---------- Trip ---------- */
.trip-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 12px;
  background: linear-gradient(135deg, var(--route-soft), transparent 75%); border: 1px solid color-mix(in srgb, var(--origin) 45%, var(--line)); animation: rise .45s ease both; }
.trip-card.active { display: block; }
.trip-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.trip-title { margin: 0; font-weight: 700; font-size: 0.95rem; }
.trip-meta, .trip-status { margin: 2px 0 0; font-size: 0.82rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.btn.primary { background: var(--origin); color: var(--on-accent); white-space: nowrap; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.small { min-height: 32px; padding: 5px 10px; font-size: 0.82rem; }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.timeline li { position: relative; display: grid; grid-template-columns: 24px 1fr; gap: 10px; padding: 6px 0; transition: opacity .3s ease; }
.timeline li:not(:last-child)::after { content: ""; position: absolute; left: 11px; top: 30px; bottom: -6px; width: 2px; background: var(--line); }
.timeline li.done::after { background: var(--origin); }
.tl-dot { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 0.75rem; font-weight: 700; border: 2px solid var(--origin); color: var(--origin); background: var(--surface); z-index: 1; font-variant-numeric: tabular-nums; }
.timeline li.done .tl-dot, .timeline li.now .tl-dot { background: var(--origin); color: var(--on-accent); }
.timeline li.now .tl-dot { box-shadow: 0 0 0 4px var(--glow); }
.tl-name { margin: 0; font-weight: 600; font-size: 0.9rem; line-height: 1.3; }
.tl-leg { margin: 1px 0 0; font-size: 0.78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.trip-line { stroke-linecap: round; filter: drop-shadow(0 0 4px var(--glow)); }
.trip-stop { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font: 700 11px/1 var(--font-body); background: var(--ink); color: var(--surface); border: 2px solid var(--origin); }
.hotels { display: flex; flex-direction: column; gap: 8px; scroll-margin-top: 12px; }

/* ---------- Klook-style popup card ---------- */
.pop-wrap .leaflet-popup-content-wrapper { padding: 0; overflow: hidden; }
.pop-wrap .leaflet-popup-content { margin: 0; min-width: 240px; }
.pop-band { display: flex; align-items: center; gap: 8px; padding: 9px 14px; background: var(--origin); color: var(--on-accent); font-weight: 700; font-size: 0.85rem; }
.pop-rank { margin-left: auto; font-weight: 600; font-size: 0.75rem; opacity: 0.85; }
.pop-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; }
.pop-body .pop-name { margin: 0; font-size: 1.05rem; font-weight: 700; line-height: 1.3; }
.pop-body .pop-en { margin: -6px 0 0; font-size: 0.8rem; color: var(--muted); }   /* beats Leaflet's .leaflet-popup-content p margin */
.pop-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pop-facts span { display: flex; flex-direction: column; gap: 1px; padding: 7px 8px; border-radius: 9px; background: var(--sea); font-size: 0.7rem; line-height: 1.25; color: var(--muted); }
.pop-facts b { font-size: 0.86rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.pop-body .pop-meta { margin: 0; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pop-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.leaflet-container .pop-btn { font: inherit; font-size: 0.82rem; font-weight: 600; text-align: center; text-decoration: none; padding: 8px 6px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--line); background: transparent; color: var(--ink); }
.leaflet-container .pop-btn:hover { border-color: var(--origin); }
.leaflet-container .pop-btn.primary { background: var(--origin); border-color: var(--origin); color: var(--on-accent); }
.leaflet-container .pop-btn[aria-disabled="true"] { grid-column: 1 / -1; color: var(--muted); border-style: dashed; cursor: default; }
@media (prefers-reduced-motion: reduce) { .idea, .trip-card { animation: none; } }

/* During a trip, the numbered trip stops lead; result-rank pins step back. */
.map-wrap.trip-on .pin.dest { opacity: 0.35; transform: rotate(-45deg) scale(0.8); }

/* ---------- Document pages (about / terms / privacy) ---------- */
html:has(main.doc), html:has(main.doc) body { height: auto; }
body:has(main.doc) { background: var(--surface); }
.doc { max-width: 680px; margin: 0 auto; padding-block: 28px 48px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.doc h1 { font-family: var(--font-display); font-weight: 400; font-size: 1.9rem; line-height: 1.25; margin: 0 0 8px; text-wrap: balance; }
.doc h2 { font-size: 1.1rem; margin: 32px 0 6px; text-wrap: balance; }
.doc p, .doc li { color: var(--ink); max-width: 65ch; }
.doc li + li { margin-top: 4px; }
.doc .lead { color: var(--muted); font-size: 1.05rem; }
.doc ul, .doc ol { padding-left: 1.2em; }
.doc .note { padding: 12px 14px; border-radius: 10px; background: var(--sea); color: var(--muted); font-size: 0.9rem; max-width: none; }
.updated { color: var(--muted); font-size: 0.85rem; }
.doc-nav { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 20px; }
.doc-nav a { font-size: 0.85rem; text-decoration: none; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink); }
.doc-nav a[aria-current="page"] { background: var(--route-soft); border-color: var(--origin); color: var(--origin); font-weight: 600; }
.doc .tbl { overflow-x: auto; }
.doc table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.doc th { color: var(--muted); font-weight: 600; font-size: 0.8rem; }
