/* BluePark — monochrome blue & white, with traffic-light status colours. */
:root {
  --blue-900: #071f4d;
  --blue-800: #0b3d91;
  --blue-700: #1452b8;
  --blue-600: #1e6fd9;
  --blue-400: #6fa3ea;
  --blue-200: #c9dcf6;
  --blue-100: #e6effb;
  --blue-50: #f4f8fd;
  --white: #ffffff;
  --ink: #0d1b33;
  --muted: #5b6b86;
  --line: #dde6f3;
  --free: #16a34a;
  --free-bg: #e7f7ec;
  --limited: #eab308;
  --limited-ink: #6b4f00;
  --limited-bg: #fdf6d8;
  --full: #94a3b8;
  --full-bg: #eef1f5;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(11, 61, 145, 0.12);
  --shadow-lg: 0 18px 50px rgba(7, 31, 77, 0.22);
  --top-h: 64px;
  --cities-h: 48px;
  --surface: #ffffff;
  --surface-2: #f4f8fd;
  --surface-3: #e6effb;
  --accent-ink: #0b3d91;
  --accent-ink-2: #1452b8;
  --heading: #071f4d;
  --map-water: #cfe0f5;
  --map-land: #ffffff;
  --chart-bar: #1e6fd9;
  --chart-now: #071f4d;
  color-scheme: light;
  --font: 'Inter', 'Noto Sans TC', system-ui, -apple-system, 'PingFang TC', 'Microsoft JhengHei', sans-serif;
}


/* ---------- night mode: follows the device, or the user's choice (data-theme) ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  --surface: #101d33;
  --surface-2: #0a1426;
  --surface-3: #16284a;
  --ink: #e6eefb;
  --muted: #9fb0cc;
  --line: #23385c;
  --accent-ink: #8db8ff;
  --accent-ink-2: #8db8ff;
  --heading: #dce8ff;
  --free-bg: #0f2e1d;
  --limited-bg: #33290a;
  --limited-ink: #fcd34d;
  --full-bg: #1c2638;
  --map-water: #0b1a30;
  --map-land: #13233d;
  --chart-bar: #6fa3ea;
  --chart-now: #dce8ff;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
  }
  :root:not([data-theme="light"]) .bp-osm .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(0.85) saturate(0.6); }
  :root:not([data-theme="light"]) .bp-base { fill: var(--map-land); }
  :root:not([data-theme="light"]) .leaflet-bar a, .leaflet-control-attribution { background: var(--surface) !important; color: var(--muted) !important; }
}
:root[data-theme="dark"] {
  --surface: #101d33;
  --surface-2: #0a1426;
  --surface-3: #16284a;
  --ink: #e6eefb;
  --muted: #9fb0cc;
  --line: #23385c;
  --accent-ink: #8db8ff;
  --accent-ink-2: #8db8ff;
  --heading: #dce8ff;
  --free-bg: #0f2e1d;
  --limited-bg: #33290a;
  --limited-ink: #fcd34d;
  --full-bg: #1c2638;
  --map-water: #0b1a30;
  --map-land: #13233d;
  --chart-bar: #6fa3ea;
  --chart-now: #dce8ff;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}
:root[data-theme="dark"] .bp-osm .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(0.85) saturate(0.6); }
:root[data-theme="dark"] .bp-base { fill: var(--map-land); }
:root[data-theme="dark"] .leaflet-bar a, .leaflet-control-attribution { background: var(--surface) !important; color: var(--muted) !important; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--surface-2);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.search svg, button svg, .bp-pill svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- top bar ---------- */
.topbar {
  height: var(--top-h);
  display: flex; align-items: center; gap: 16px;
  padding: 0 20px;
  background: linear-gradient(120deg, var(--blue-900), var(--blue-800) 60%, var(--blue-700));
  color: var(--white);
  position: relative; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; flex-shrink: 0; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--white); color: var(--blue-800);
  font-weight: 800; font-size: 20px;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-size: 18px; letter-spacing: 0.2px; }
.brand-text small { font-size: 11.5px; color: var(--blue-200); }
.search {
  flex: 1; max-width: 520px; margin: 0 auto;
  display: flex; align-items: center; gap: 8px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px; padding: 0 14px; height: 40px;
  transition: background 0.2s;
}
.search:focus-within { background: var(--surface); color: var(--ink); }
.search svg { opacity: 0.8; flex-shrink: 0; }
.search input { flex: 1; border: 0; outline: 0; background: transparent; min-width: 0; }
.search input::placeholder { color: inherit; opacity: 0.7; }
.top-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.btn-primary, .btn-outline, .btn-ghost, .btn-icon {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; padding: 0 16px; border-radius: 10px;
  font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap;
  border: 1px solid transparent; transition: transform 0.08s, background 0.2s, border-color 0.2s;
}
.btn-primary:active, .btn-outline:active, .btn-icon:active { transform: scale(0.97); }
.btn-primary { background: var(--blue-600); color: var(--white); }
.btn-primary:hover { background: var(--blue-700); }
.topbar .btn-primary { background: var(--white); color: var(--blue-800); }
.topbar .btn-primary:hover { background: var(--surface-3); }
.btn-outline { background: var(--surface); color: var(--accent-ink); border-color: var(--blue-200); }
.btn-outline:hover { border-color: var(--blue-600); }
.btn-ghost { background: transparent; color: inherit; border-color: rgba(255, 255, 255, 0.28); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.1); }
.btn-icon { width: 40px; padding: 0; background: var(--surface-2); color: var(--accent-ink); border-color: var(--line); font-size: 18px; }
.btn-icon.on { color: #e11d48; }
.btn-theme { width: 40px; padding: 0; }
.btn-theme svg { width: 18px; height: 18px; }
.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.danger { color: #b42318 !important; border-color: transparent !important; }

/* ---------- city tabs ---------- */
.cities {
  height: var(--cities-h);
  display: flex; gap: 8px; align-items: center;
  padding: 0 20px; overflow-x: auto; scrollbar-width: none;
  background: var(--surface); border-bottom: 1px solid var(--line);
  position: relative; z-index: 15;
}
.cities::-webkit-scrollbar { display: none; }
.cities button {
  display: inline-flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 12px 0 14px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line);
  font-weight: 600; font-size: 13.5px; color: var(--heading); white-space: nowrap;
}
.cities button span {
  font-size: 12px; font-weight: 700; color: var(--free);
  background: var(--free-bg); padding: 2px 8px; border-radius: 999px;
}
.cities button.active { background: var(--blue-800); color: var(--white); border-color: var(--accent-ink); }
.cities button.active span { background: rgba(255, 255, 255, 0.18); color: var(--white); }
.cities button.more { background: var(--surface); color: var(--accent-ink); border-color: var(--blue-200); }

/* ---------- city picker ---------- */
.region-title { margin: 14px 0 8px; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.region-title:first-of-type { margin-top: 4px; }
.city-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.city-grid button {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left;
  padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--heading);
}
.city-grid button b { font-size: 14px; }
.city-grid button small { font-size: 12px; color: var(--muted); }
.city-grid button:hover { border-color: var(--blue-200); }
.city-grid button.active { background: var(--blue-800); border-color: var(--accent-ink); color: var(--white); }
.city-grid button.active small { color: rgba(255, 255, 255, 0.8); }

/* ---------- layout ---------- */
.layout {
  display: grid; grid-template-columns: 400px 1fr;
  height: calc(100vh - var(--top-h) - var(--cities-h));
  height: calc(100dvh - var(--top-h) - var(--cities-h));
}
.panel {
  background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; min-height: 0; z-index: 10;
}
.panel-grip { display: none; }

.summary {
  margin: 16px 16px 0; padding: 16px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--blue-800), var(--blue-600));
  color: var(--white);
  display: flex; gap: 16px; align-items: stretch;
  box-shadow: var(--shadow);
}
.sum-main { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.sum-label { font-size: 12.5px; color: var(--blue-200); }
.sum-num { font-size: 34px; font-weight: 800; letter-spacing: -0.5px; line-height: 1.05; }
.summary .bar { background: rgba(255, 255, 255, 0.2); }
.summary .bar i { background: #4ade80; }
.sum-side { display: flex; flex-direction: column; justify-content: center; gap: 8px; padding-left: 16px; border-left: 1px solid rgba(255, 255, 255, 0.2); }
.sum-side div { display: flex; flex-direction: column; line-height: 1.1; }
.sum-side b { font-size: 18px; }
.sum-side span { font-size: 11.5px; color: var(--blue-200); }

.bar { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; border-radius: inherit; background: var(--blue-600); transition: width 0.6s; }

.filters { padding: 14px 16px 0; display: flex; flex-direction: column; gap: 10px; }
.seg { display: flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button {
  flex: 1; height: 32px; border: 0; border-radius: 8px; background: transparent;
  font-weight: 600; font-size: 13px; color: var(--muted); white-space: nowrap;
}
.seg button.active { background: var(--surface); color: var(--accent-ink); box-shadow: 0 1px 4px rgba(11, 61, 145, 0.15); }
.seg-full { margin-bottom: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  height: 30px; padding: 0 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  font-size: 12.5px; font-weight: 600; color: var(--muted);
}
.chip.on { background: var(--surface-3); border-color: var(--blue-600); color: var(--accent-ink); }
.list-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted); padding: 4px 0 8px; border-bottom: 1px solid var(--line); }
.list-head select { border: 0; background: transparent; font-weight: 600; color: var(--accent-ink); cursor: pointer; }

.list { list-style: none; margin: 0; padding: 8px 8px 24px; overflow-y: auto; flex: 1; }
.card {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; border-radius: 12px; cursor: pointer;
  border: 1px solid transparent; transition: background 0.15s, border-color 0.15s;
}
.card:hover, .card:focus-visible { background: var(--surface-2); outline: none; }
.card.sel { background: var(--surface-2); border-color: var(--blue-200); }
.count {
  width: 56px; height: 56px; border-radius: 12px; flex-shrink: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.05;
}
.count b { font-size: 19px; font-weight: 800; }
.count small { font-size: 10.5px; opacity: 0.8; }
.count.s-free { background: var(--free-bg); color: var(--free); }
.count.s-limited { background: var(--limited-bg); color: var(--limited-ink); }
.count.s-full { background: var(--full-bg); color: #64748b; }
.card-main { flex: 1; min-width: 0; }
.card-title { font-weight: 650; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-title .fav { color: #e11d48; font-size: 12px; }
.card-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-price { font-weight: 700; font-size: 13.5px; color: var(--accent-ink); white-space: nowrap; text-align: right; display: flex; flex-direction: column; }
.card-price small { font-size: 11px; font-weight: 600; color: var(--muted); }
.stay { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; margin-right: 10px; font-weight: 600; }
.stay select { border: 0; background: transparent; font-weight: 700; color: var(--accent-ink); cursor: pointer; }
.forecast { position: relative; margin: 0 0 16px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; }
.fc-title { margin: 0; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.fc-title small { font-weight: 600; }
.fc-sum { margin: 4px 0 10px; font-size: 14px; font-weight: 700; color: var(--heading); }
.fc-note { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.fc-plot { position: relative; }
.fc-bars { display: flex; align-items: flex-end; gap: 2px; height: 64px; border-bottom: 1px solid var(--line); }
.fc-bars i { flex: 1; background: var(--chart-bar); border-radius: 4px 4px 0 0; min-height: 2px; }
.fc-bars i.now { background: var(--chart-now); }
.fc-bars i.none { background: var(--line); }
.fc-bars i:hover { opacity: 0.8; }
.fc-tip { position: absolute; bottom: calc(100% + 6px); transform: translateX(-50%); white-space: nowrap; background: var(--heading); color: var(--surface); font-size: 12px; font-weight: 600; padding: 4px 8px; border-radius: 6px; pointer-events: none; }
.fc-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 4px; font-variant-numeric: tabular-nums; }
.fc-key { float: right; display: inline-flex; align-items: center; gap: 5px; margin-left: 8px; font-size: 11.5px; }
.fc-key i { width: 10px; height: 10px; border-radius: 2px; background: var(--chart-now); }
.reviews { margin: 0 0 16px; display: flex; flex-direction: column; gap: 10px; }
.review { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.review p { margin: 4px 0; font-size: 13.5px; color: var(--ink); }
.review small { color: var(--muted); font-size: 12px; }
.stars { color: #eab308; letter-spacing: 1px; }
.stars .off { color: var(--line); }
.star-pick { display: flex; gap: 6px; justify-content: center; margin: 12px 0 16px; }
.star-pick button { font-size: 36px; line-height: 1; border: 0; background: none; color: var(--line); cursor: pointer; padding: 4px; }
.star-pick button.on { color: #eab308; }
.earnings { list-style: none; padding: 4px 0; }
.example-note { margin: 0 0 10px; padding: 8px 10px; border-radius: 8px; background: var(--limited-bg); color: var(--limited-ink); font-size: 12.5px; font-weight: 600; }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 14px; }
.kpis div { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.kpis small { display: block; color: var(--muted); font-size: 12px; }
.kpis b { font-size: 20px; color: var(--heading); font-variant-numeric: tabular-nums; }
.month-bars { display: flex; align-items: flex-end; gap: 8px; height: 140px; margin: 8px 0 14px; border-bottom: 1px solid var(--line); }
.mb { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; position: relative; }
.mb i { width: 100%; max-width: 44px; background: var(--chart-bar); border-radius: 4px 4px 0 0; }
.mb i.now { background: var(--chart-now); }
.mb-val { font-size: 11px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mb-lab { position: absolute; bottom: -20px; font-size: 11.5px; color: var(--muted); }
.spot-table { width: 100%; border-collapse: collapse; margin-top: 28px; font-size: 12.5px; }
.spot-table th { text-align: left; color: var(--muted); font-weight: 600; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.spot-table td { padding: 8px 4px; border-bottom: 1px solid var(--line); }
.spot-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.occ { display: inline-block; width: 40px; height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; vertical-align: middle; }
.occ i { display: block; height: 100%; background: var(--chart-bar); }
.estimate { margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 13.5px; color: var(--muted); }
.estimate b { color: var(--heading); }
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.tag { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); color: var(--accent-ink-2); border: 1px solid var(--line); }
.tag-shared { background: var(--blue-800); color: var(--white); border-color: var(--accent-ink); }
.empty { padding: 32px 16px; text-align: center; color: var(--muted); font-size: 14px; line-height: 1.8; }

/* ---------- map ---------- */
.map-wrap { position: relative; min-height: 0; }
.map { position: absolute; inset: 0; background: var(--surface-3); }
.bp-osm .leaflet-tile-pane { filter: sepia(0.25) hue-rotate(175deg) saturate(1.6) brightness(1.03); }
.leaflet-container { font-family: var(--font); }
.bp-districts.leaflet-container { background: var(--map-water); }
/* district names: plain text on the map (beats Leaflet's own tooltip box) */
.leaflet-tooltip.bp-district-label { background: none; border: 0; box-shadow: none; padding: 0; font-size: 11px; font-weight: 600; color: #7d93b8; display: none; }
.leaflet-tooltip.bp-district-label::before { display: none; }
.bp-labels .leaflet-tooltip.bp-district-label { display: block; }
.bp-divicon { background: none; border: 0; }
.bp-marker-anchor { position: absolute; transform: translate(-50%, -100%); cursor: pointer; }

.bp-pill {
  display: flex; align-items: center; gap: 4px;
  padding: 4px 9px 4px 5px; border-radius: 999px;
  background: var(--surface); border: 2px solid currentColor;
  box-shadow: 0 3px 10px rgba(7, 31, 77, 0.22);
  font-weight: 800; font-size: 13px; white-space: nowrap; position: relative;
  transition: transform 0.15s;
}
.bp-pill::after {
  content: ''; position: absolute; left: 50%; bottom: -7px; transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: currentColor; border-bottom: 0;
}
.bp-pill span {
  width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center;
  background: var(--c); color: var(--white); font-size: 11px; order: -1;
}
.bp-pill svg { order: -1; }
.bp-pill b { color: var(--ink); }
.bp-pill.s-free { --c: var(--free); color: var(--free); }
.bp-pill.s-limited { --c: var(--limited); color: var(--limited); }
.bp-pill.s-limited b { color: var(--limited-ink); }
.bp-pill.s-full { --c: var(--full); color: var(--full); }
.bp-pill.s-full b { color: #64748b; }
.bp-pill.shared { background: var(--blue-800); border-color: var(--accent-ink); color: var(--white); padding: 4px 10px 4px 7px; font-size: 12px; }
.bp-pill.shared::after { border-top-color: var(--accent-ink); }
.bp-pill.shared svg { width: 14px; height: 14px; }
.bp-pill.shared.s-free svg { stroke: #4ade80; }
.bp-pill.shared.s-full { background: var(--full); border-color: var(--full); }
.bp-pill.shared.s-full::after { border-top-color: var(--full); }
.bp-pill.street { border-style: dashed; border-radius: 8px; padding: 3px 7px 3px 8px; font-size: 12px; }
.bp-pill.street::after { display: none; }
.bp-pill.street svg { width: 14px; height: 14px; order: 0; }
.tag-street { background: var(--surface); border-style: dashed; }
.bp-pill:hover { transform: scale(1.08); }
.bp-pill.sel { transform: scale(1.18); box-shadow: 0 0 0 4px rgba(30, 111, 217, 0.35), 0 6px 18px rgba(7, 31, 77, 0.3); }

.bp-city {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 104px; height: 104px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.95); border: 4px solid currentColor;
  box-shadow: var(--shadow-lg); transform: translateY(50%);
  color: var(--free); transition: transform 0.15s;
}
.bp-city:hover { transform: translateY(50%) scale(1.06); }
.bp-city b { font-size: 22px; font-weight: 800; color: var(--heading); }
.bp-city span { font-size: 12px; font-weight: 600; color: var(--muted); }
.bp-city.s-limited { color: var(--limited); }
.bp-city.s-full { color: var(--full); }
.bp-city.region { width: 120px; height: 120px; }
.bp-city.region span { font-size: 13px; }
.bp-city.small { width: 76px; height: 76px; border-width: 3px; }
.bp-city.small b { font-size: 16px; }
.bp-city.small span { font-size: 11px; }

.bp-user-dot {
  width: 18px; height: 18px; border-radius: 50%; transform: translateY(50%);
  background: var(--blue-600); border: 3px solid var(--white);
  box-shadow: 0 0 0 8px rgba(30, 111, 217, 0.2);
}
.bp-pin {
  width: 30px; height: 30px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  background: var(--blue-800); border: 3px solid var(--white); box-shadow: var(--shadow-lg);
}

.legend, .live-badge {
  position: absolute; z-index: 500;
  background: var(--surface); backdrop-filter: blur(6px);
  border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow);
  font-size: 12px; font-weight: 600; color: var(--heading);
}
.legend { top: 14px; left: 14px; display: flex; gap: 12px; padding: 7px 14px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend { align-items: center; flex-wrap: wrap; }
.heat-btn { border: 1px solid var(--line); background: var(--surface); color: var(--accent-ink); border-radius: 999px; padding: 3px 12px; font-size: 12px; font-weight: 700; }
.heat-btn.on { background: var(--blue-800); color: var(--white); border-color: var(--accent-ink); }
.heat-note { color: var(--muted); font-size: 11px; font-weight: 600; flex-basis: 100%; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.s-free { background: var(--free); }
.dot.s-limited { background: var(--limited); }
.dot.s-full { background: var(--full); }
.live-badge { top: 14px; right: 14px; padding: 7px 12px; display: flex; align-items: center; gap: 6px; }
.live-badge i { width: 8px; height: 8px; border-radius: 50%; background: var(--free); animation: pulse 2s infinite; }
.live-badge span { color: var(--muted); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.5); } 100% { box-shadow: 0 0 0 8px rgba(22, 163, 74, 0); } }
.fab-locate {
  position: absolute; z-index: 500; right: 14px; bottom: 130px;
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line); color: var(--accent-ink-2);
  box-shadow: var(--shadow); display: grid; place-items: center;
}
.leaflet-bottom.leaflet-right .leaflet-control-zoom { margin-bottom: 20px; margin-right: 14px; border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 12px; overflow: hidden; }
.leaflet-control-zoom a { color: var(--accent-ink) !important; width: 42px !important; height: 40px !important; line-height: 40px !important; }
.pick-banner {
  position: absolute; z-index: 600; left: 50%; top: 60px; transform: translateX(-50%);
  background: var(--blue-800); color: var(--white); padding: 10px 10px 10px 18px; border-radius: 999px;
  box-shadow: var(--shadow-lg); font-weight: 600; font-size: 14px; display: flex; gap: 12px; align-items: center; white-space: nowrap;
}
.pick-banner[hidden] { display: none; }
.pick-banner button { border: 0; background: rgba(255, 255, 255, 0.18); color: var(--white); border-radius: 999px; padding: 6px 12px; font-weight: 600; }
body.picking .map { cursor: crosshair; }
body.picking .leaflet-container { cursor: crosshair; }
.map-error { padding: 40px; text-align: center; color: var(--muted); }

/* ---------- detail drawer ---------- */
.detail {
  position: fixed; z-index: 700; top: calc(var(--top-h) + var(--cities-h) + 12px); right: 12px; bottom: 12px;
  width: 380px; overflow-y: auto;
  background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg);
  padding: 22px; transform: translateX(calc(100% + 24px)); transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.detail.open { transform: none; }
.detail-close {
  position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 50%;
  border: 0; background: var(--surface-2); font-size: 22px; line-height: 1; color: var(--muted);
}
.kind { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: var(--blue-600); }
.kind.shared { color: var(--accent-ink); }
.detail h2 { margin: 6px 40px 4px 0; font-size: 21px; line-height: 1.25; }
.detail-head p { margin: 2px 0; color: var(--muted); font-size: 13.5px; }
.rating { color: var(--ink) !important; font-weight: 700; }
.rating span { color: var(--muted); font-weight: 500; }
.avail { margin: 16px 0; padding: 14px; border-radius: 14px; }
.avail.s-free { background: var(--free-bg); }
.avail.s-free .bar i { background: var(--free); }
.avail.s-limited { background: var(--limited-bg); }
.avail.s-limited .bar i { background: var(--limited); }
.avail.s-full { background: var(--full-bg); }
.avail .bar { background: rgba(255, 255, 255, 0.8); }
.avail-num b { font-size: 32px; font-weight: 800; }
.avail.s-free .avail-num b { color: var(--free); }
.avail.s-limited .avail-num b { color: var(--limited-ink); }
.avail-num span { color: var(--muted); font-weight: 600; margin-left: 4px; }
.avail small { display: block; margin-top: 8px; color: var(--muted); font-size: 12.5px; }
.prices { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; margin-bottom: 12px; }
.prices div { border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; }
.prices b { font-size: 16px; color: var(--accent-ink); }
.prices span { font-size: 11.5px; color: var(--muted); }
.host { display: flex; gap: 12px; align-items: center; margin: 16px 0; padding: 12px; border-radius: 12px; background: var(--surface-2); }
.host b { font-size: 14px; }
.host small { display: block; color: var(--muted); font-size: 12px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--blue-800); color: var(--white); display: grid; place-items: center; font-weight: 700; }
.verified { color: var(--free); font-size: 12px; font-weight: 700; }
.desc { font-size: 14px; color: var(--muted); line-height: 1.6; }
.detail-actions { display: flex; gap: 8px; margin-top: 18px; }
.detail-actions .btn-primary { flex: 1; }
.detail-actions .btn-outline { flex: 1; }

/* ---------- modal ---------- */
.modal {
  background: var(--surface); color: var(--ink);
  border: 0; padding: 0; border-radius: 20px; width: min(480px, calc(100vw - 24px));
  max-height: calc(100dvh - 32px); box-shadow: var(--shadow-lg); color: var(--ink);
}
.modal::backdrop { background: rgba(7, 31, 77, 0.45); backdrop-filter: blur(2px); }
.modal-body { padding: 22px; overflow-y: auto; max-height: calc(100dvh - 32px); }
.m-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.m-head h3 { margin: 0; font-size: 19px; }
.m-x { border: 0; background: var(--surface-2); width: 34px; height: 34px; border-radius: 50%; font-size: 22px; line-height: 1; color: var(--muted); }
.m-sub { margin: 0 0 16px; color: var(--muted); font-size: 13.5px; }
.modal label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--heading); margin-bottom: 12px; }
.modal input:not([type=radio]):not([type=file]), .modal select, .modal textarea {
  height: 42px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); font-weight: 500; outline: none;
}
.modal textarea { height: auto; padding: 10px 12px; resize: vertical; }
.modal input:focus, .modal select:focus, .modal textarea:focus { border-color: var(--blue-600); background: var(--surface); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stepper { display: flex; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: 10px; height: 42px; background: var(--surface-2); }
.stepper button { width: 44px; height: 100%; border: 0; background: transparent; font-size: 20px; color: var(--accent-ink); }
.pays { border: 0; padding: 0; margin: 0 0 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pays legend { font-size: 13px; font-weight: 600; color: var(--heading); margin-bottom: 6px; }
.pay { flex-direction: row !important; align-items: center; gap: 8px !important; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; margin: 0 !important; font-size: 12.5px !important; cursor: pointer; }
.pay.on { border-color: var(--blue-600); background: var(--surface-2); }
.pay input { accent-color: var(--blue-600); }
.totals { margin: 8px 0 0; padding: 12px 0; border-top: 1px dashed var(--line); }
.totals div { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); padding: 3px 0; }
.totals dd, .totals dt { margin: 0; }
.totals .grand { color: var(--ink); font-weight: 800; font-size: 17px; }
.m-actions { display: flex; gap: 10px; margin-top: 12px; }
.m-actions > * { flex: 1; }
.success { text-align: center; padding: 10px 0; }
.check { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 12px; display: grid; place-items: center; background: var(--free-bg); color: var(--free); font-size: 32px; font-weight: 800; }
.success h3 { margin: 0 0 8px; }
.success p { color: var(--muted); line-height: 1.6; }
.code { margin: 16px auto; padding: 14px; border-radius: 12px; background: var(--surface-2); border: 1px dashed var(--blue-400); }
.code small { display: block; color: var(--muted); font-size: 12px; }
.code b { font-size: 24px; letter-spacing: 3px; color: var(--accent-ink); font-family: ui-monospace, monospace; }

.steps { list-style: none; display: flex; gap: 6px; padding: 0; margin: 12px 0 18px; }
.steps li { flex: 1; display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); padding-top: 8px; border-top: 3px solid var(--line); }
.steps li i { font-style: normal; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--line); font-size: 11px; }
.steps li.on, .steps li.done { color: var(--accent-ink); border-color: var(--blue-600); }
.steps li.on i, .steps li.done i { background: var(--blue-600); color: var(--white); }
.pick-box { padding: 16px; border-radius: 14px; border: 2px dashed var(--blue-200); background: var(--surface-2); margin-bottom: 14px; text-align: center; }
.pick-box.ok { border-style: solid; border-color: var(--free); background: var(--free-bg); }
.pick-box b { display: block; }
.pick-box small { color: var(--muted); }
.pick-box .closed-city { color: var(--heading); font-weight: 600; margin-bottom: 10px; }
.pick-box > a.btn-outline { display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--blue-200); text-decoration: none; margin-bottom: 10px; }
.row { display: flex; gap: 8px; justify-content: center; margin-top: 10px; flex-wrap: wrap; }
.upload { position: relative; display: block; border: 2px dashed var(--blue-200); border-radius: 12px; padding: 16px; text-align: center; color: var(--muted); font-weight: 500; }
.upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.days { display: flex; gap: 6px; margin-bottom: 14px; }
.days button { flex: 1; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: 13px; color: var(--muted); }
.days button.on { background: var(--blue-800); border-color: var(--accent-ink); color: var(--white); }
.hint { font-size: 13px; color: var(--accent-ink-2); margin: -4px 0 14px; }
.earn { margin: 4px 0 0; padding: 12px; border-radius: 12px; background: var(--free-bg); color: var(--free); font-weight: 700; text-align: center; }
.modal .chips { margin-bottom: 14px; }

.mine-list { list-style: none; margin: 0; padding: 0; }
.account { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; margin: 10px 0 12px; border-radius: 12px; background: var(--surface-2); font-size: 13px; color: var(--heading); }
.account .btn-ghost { color: var(--accent-ink); border-color: var(--blue-200); }
.host-bookings { margin-top: 6px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.host-bookings small { display: block; }
.host-bookings small.cancelled { text-decoration: line-through; opacity: 0.6; }
.mine-item .btn-ghost { color: var(--accent-ink); border-color: var(--line); }
.photos { display: flex; gap: 8px; overflow-x: auto; margin: 12px 0; padding-bottom: 4px; }
.photos img { height: 120px; border-radius: 12px; object-fit: cover; flex-shrink: 0; }
.thumbs { display: flex; gap: 8px; margin: -4px 0 14px; }
.thumbs span { position: relative; }
.thumbs img { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; display: block; }
.thumbs button { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: var(--blue-900); color: var(--white); font-size: 14px; line-height: 1; }
button:disabled { opacity: 0.6; cursor: progress; }
:focus-visible { outline: 3px solid var(--blue-400); outline-offset: 2px; }
.btn-watch { display: block; width: 100%; margin-top: 14px; padding: 11px 14px; border-radius: 10px; border: 1px dashed var(--blue-400); background: var(--surface-2); color: var(--accent-ink); font-weight: 600; font-size: 13.5px; text-align: left; }
.btn-watch.on { border-style: solid; border-color: var(--blue-600); background: var(--surface-3); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
.mine-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.mine-item b { display: block; font-size: 14.5px; }
.mine-item small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.mine-item code { color: var(--accent-ink); font-weight: 700; }
.mine-item.cancelled { opacity: 0.55; }
.mine-item.clickable { cursor: pointer; }
.mine-item .row { margin: 0; flex-wrap: nowrap; }
.pill-muted { font-size: 12px; color: var(--muted); }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--full); margin-right: 6px; }
.status-dot.on { background: var(--free); }

.toast {
  position: fixed; z-index: 2000; left: 50%; bottom: 28px; transform: translate(-50%, 20px);
  background: var(--blue-900); color: var(--white); padding: 12px 18px; border-radius: 12px;
  font-size: 14px; font-weight: 600; box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.tabbar { display: none; }

/* ---------- mobile ---------- */
@media (max-width: 860px) {
  :root { --top-h: 58px; --cities-h: 46px; }
  .topbar { padding: 0 12px; gap: 10px; }
  .brand-text small { display: none; }
  .brand-text strong { font-size: 16px; }
  .hide-sm { display: none; }
  .search { height: 38px; min-width: 0; padding: 0 12px; }
  .topbar { overflow: hidden; }
  .btn-ghost { height: 36px; padding: 0 10px; }
  .cities { padding: 0 12px; }

  .layout { display: block; height: calc(100dvh - var(--top-h) - var(--cities-h)); position: relative; }
  .map-wrap { position: absolute; inset: 0; }
  .panel {
    position: fixed; z-index: 650; left: 0; right: 0; bottom: 0;
    height: calc(100dvh - var(--top-h) - var(--cities-h) - 40px);
    border-radius: 20px 20px 0 0; border: 0; box-shadow: var(--shadow-lg);
    transform: translateY(calc(100% - 152px)); transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    padding-bottom: 64px;
  }
  body.list-open .panel { transform: none; }
  .panel-grip { display: block; height: 22px; flex-shrink: 0; cursor: pointer; position: relative; }
  .panel-grip::after { content: ''; position: absolute; left: 50%; top: 8px; width: 40px; height: 5px; border-radius: 3px; background: var(--line); transform: translateX(-50%); }
  .summary { margin: 0 12px; padding: 12px 14px; }
  .sum-num { font-size: 26px; }
  .filters { padding: 12px 12px 0; }
  .legend { top: 10px; left: 10px; padding: 6px 10px; gap: 8px; font-size: 11px; }
  .heat-note { display: none; }
  .legend { flex-wrap: nowrap; white-space: nowrap; }
  .heat-btn { padding: 2px 9px; font-size: 11px; }
  .live-badge { top: 50px; left: 10px; right: auto; font-size: 11px; padding: 5px 10px; }
  .fab-locate { bottom: 230px; right: 10px; }
  .leaflet-bottom.leaflet-right { display: none; }

  .detail {
    top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 78dvh;
    border-radius: 20px 20px 0 0; padding: 20px 18px calc(84px + env(safe-area-inset-bottom));
    transform: translateY(105%);
  }

  .tabbar {
    display: flex; position: fixed; z-index: 800; left: 0; right: 0; bottom: 0;
    height: calc(64px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: var(--surface); border-top: 1px solid var(--line);
  }
  .tabbar button {
    flex: 1; border: 0; background: none; color: var(--muted);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    font-size: 11px; font-weight: 600;
  }
  .tabbar button.active { color: var(--accent-ink); }
  .tabbar .tab-rent svg { background: var(--blue-800); color: var(--white); border-radius: 10px; padding: 4px; width: 30px; height: 30px; }
  .tabbar .tab-rent span { white-space: nowrap; }
  .modal { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 20px 20px 0 0; max-height: 92dvh; }
  .modal-body { max-height: 92dvh; padding-bottom: calc(22px + env(safe-area-inset-bottom)); }
  .toast { bottom: 84px; }
  .pick-banner { top: 50px; font-size: 13px; }
}
@media (max-width: 520px) {
  .brand-text { display: none; }
  .search input::placeholder { font-size: 13px; }
}
