/* Soft sky: pale blue ground, night-blue ink, one clear blue for picks; you are the only warm dot.
   Rows are soft cards on blue. Header scrolls, chips stick, tab bar fixed; the map view fills the screen. */
:root {
  --sky: oklch(0.965 0.018 235);
  --card: oklch(0.995 0.004 235);
  --ink: oklch(0.28 0.05 255);
  --mute: oklch(0.5 0.035 250);
  --line: oklch(0.9 0.022 238);
  --blue: oklch(0.62 0.11 245);
  --blue-soft: oklch(0.92 0.04 238);
  --blue-deep: oklch(0.45 0.11 255);
  --you: oklch(0.63 0.17 30);
  --moss: oklch(0.5 0.12 160);
  --shadow: oklch(0.25 0.04 255 / 0.14);
  --display: 'Bricolage Grotesque', 'Avenir Next', system-ui, sans-serif;
  --body: 'Figtree', system-ui, -apple-system, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  --tabbar: calc(68px + var(--safe-b));
  color-scheme: light;
}
* { box-sizing: border-box; }
/* No page scrollbar: it would appear and vanish between tabs and shift the page sideways. Scrolling still works. */
html { -webkit-text-size-adjust: 100%; scrollbar-width: none; }
html::-webkit-scrollbar { display: none; }
body {
  margin: 0; background: var(--sky); color: var(--ink);
  font: 16px/1.4 var(--body); -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: var(--safe-t); background: var(--sky); z-index: 20; }
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { color: var(--blue-deep); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
[hidden] { display: none !important; }

.disp { font-family: var(--display); font-weight: 700; letter-spacing: -0.02em; text-wrap: balance; }
.cap { font-size: 12px; font-weight: 600; letter-spacing: 0.03em; color: var(--mute); }
.mute { color: var(--mute); }

.app { max-width: 560px; margin: 0 auto; min-height: 100vh; padding-bottom: calc(var(--tabbar) + 12px); }

.top { padding: calc(var(--safe-t) + 12px) var(--gutter-r) 14px var(--gutter-l); display: flex; flex-direction: column; gap: 14px; }
.where { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.loc { display: flex; align-items: center; gap: 8px; min-height: 34px; min-width: 0; text-align: left; }
.loc .cap { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.dot { width: 10px; height: 10px; border-radius: 5px; background: var(--you); flex-shrink: 0; }
.dot.wait { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.25; } }
.radius { height: 32px; padding: 0 12px 0 10px; border-radius: 16px; background: var(--card); color: var(--blue-deep); font-size: 13px; font-weight: 700; flex-shrink: 0; display: flex; align-items: center; gap: 6px; }
h1 { margin: 0; font-size: 40px; line-height: 1; }
h1 span { display: block; }
h1 .sub { color: var(--blue); }

.searchbar {
  height: 52px; border-radius: 26px; background: var(--card); box-shadow: 0 1px 0 var(--line);
  display: flex; align-items: center; gap: 10px; padding: 0 8px 0 18px; border: 2px solid transparent;
}
.searchbar:focus-within { border-color: var(--blue); }
.searchbar input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: 16px; height: 100%; }
.searchbar input::placeholder { color: var(--mute); }
.searchbar input::-webkit-search-cancel-button { display: none; }
.ic { display: block; flex-shrink: 0; }
.lead { color: var(--blue); display: flex; }
.clear { width: 40px; height: 40px; color: var(--mute); display: flex; align-items: center; justify-content: center; }

.chips {
  position: sticky; top: var(--safe-t); z-index: 5; background: var(--sky);
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  padding: 4px var(--gutter-r) 12px var(--gutter-l);
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  height: 38px; padding: 0 15px; border-radius: 19px; background: var(--card);
  display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; white-space: nowrap; flex-shrink: 0;
  padding-left: 12px;
}
.chip .ic { color: var(--blue); }
.chip.on { background: var(--ink); color: var(--card); }
.chip.on .ic { color: oklch(0.8 0.08 240); }
.chip .n { font-size: 12px; opacity: 0.55; font-variant-numeric: tabular-nums; }

.list { display: flex; flex-direction: column; gap: 8px; padding: 0 var(--gutter-r) 0 var(--gutter-l); min-height: 40vh; }
.row {
  display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 14px; align-items: center; width: 100%;
  padding: 12px 14px; background: var(--card); border-radius: 18px; text-align: left;
}
.row:active { background: var(--blue-soft); }
.mark {
  width: 48px; height: 48px; border-radius: 24px; background: var(--blue-soft); color: var(--blue-deep);
  display: flex; align-items: center; justify-content: center; position: relative;
}
.mark.star { background: var(--blue); color: var(--card); }
.mark.must { background: var(--ink); color: var(--card); }
.mark.must .badge { color: oklch(0.78 0.14 80); }
.mark.chain { background: var(--sky); color: var(--mute); }
.badge {
  position: absolute; right: -2px; top: -2px; width: 20px; height: 20px; border-radius: 10px;
  background: var(--card); color: var(--blue); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 3px var(--shadow);
}
.r-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.r-name { font-size: 17px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.r-addr { font-size: 14px; color: var(--mute); line-height: 1.35; }
.r-tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.r-tags .sep { width: 3px; height: 3px; border-radius: 2px; background: var(--line); }
.pick.quiet { color: var(--mute); font-weight: 600; }
.pick { display: flex; align-items: center; gap: 3px; color: var(--blue-deep); font-size: 12px; font-weight: 700; }
.mins { text-align: right; font-variant-numeric: tabular-nums; }
.mins b { display: block; font-family: var(--display); font-size: 24px; line-height: 1; }

.note { padding: 24px 20px; background: var(--card); border-radius: 22px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.note .disp { font-size: 26px; line-height: 1.05; margin: 0; }
.note p { margin: 0; color: var(--mute); max-width: 36ch; }
.suggest { display: flex; flex-wrap: wrap; gap: 8px; }
.suggest .chip { background: var(--sky); }
.tier-h { display: flex; align-items: center; gap: 8px; padding: 14px 4px 2px; font-family: var(--display); font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.tier-h:first-child { padding-top: 0; }
.tier-h .ic { color: var(--blue); }
.tier-h.t0 .ic { color: oklch(0.7 0.14 75); }
.tier-h.t3 { color: var(--mute); }
.tier-h.t3 .ic { color: var(--mute); }
.tier-h .n { font-family: var(--body); font-size: 13px; font-weight: 600; color: var(--mute); }
.more { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 16px; font-weight: 700; color: var(--blue-deep); }
.section-h { padding: 14px 4px 2px; }

.skel { padding: 12px 14px; display: grid; grid-template-columns: 48px 1fr; gap: 14px; background: var(--card); border-radius: 18px; }
.skel i { display: block; border-radius: 8px; background: var(--blue-soft); animation: pulse 1.2s ease-in-out infinite; }
.skel > i { height: 48px; border-radius: 24px; }
.skel div { display: flex; flex-direction: column; gap: 8px; justify-content: center; }
.skel div i:first-child { height: 14px; width: 70%; }
.skel div i:last-child { height: 10px; width: 35%; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--card); border-top: 1px solid var(--line);
  display: flex; justify-content: center;
  padding: 8px max(12px, env(safe-area-inset-right, 0px)) calc(8px + var(--safe-b)) max(12px, env(safe-area-inset-left, 0px));
}
.tab { flex: 1; max-width: 140px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 12px; font-weight: 600; color: var(--mute); min-height: 52px; }
.tab .pill { width: 56px; height: 32px; border-radius: 16px; display: flex; align-items: center; justify-content: center; transition: background 0.15s; }
.tab.on { color: var(--blue-deep); }
.tab.on .pill { background: var(--blue-soft); }

/* Map view: the whole screen above the tab bar */
.mapview { position: fixed; inset: 0 0 var(--tabbar) 0; z-index: 30; background: var(--blue-soft); }
.big-map { position: absolute; inset: 0; }
.map-top { position: absolute; z-index: 600; top: calc(var(--safe-t) + 10px); left: 0; right: 0; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.map-top > * { pointer-events: auto; }
.map-top .chips { position: static; background: none; padding-block: 0 4px; }
.map-top .chip:not(.on) { box-shadow: 0 2px 8px var(--shadow); }
.map-status { align-self: flex-start; margin-left: var(--gutter-l); height: 28px; padding: 0 12px 0 10px; border-radius: 14px; background: var(--card); box-shadow: 0 2px 8px var(--shadow); display: flex; align-items: center; gap: 6px; }
.map-status .ic { color: var(--blue); }
.recenter {
  position: absolute; z-index: 600; right: calc(env(safe-area-inset-right, 0px) + 14px); bottom: 16px;
  width: 48px; height: 48px; border-radius: 24px; background: var(--card); box-shadow: 0 4px 14px var(--shadow);
  display: flex; align-items: center; justify-content: center; color: var(--you);
}
.map-card {
  position: absolute; z-index: 650; left: var(--gutter-l); right: var(--gutter-r); bottom: 14px; max-width: 528px; margin: 0 auto;
  background: var(--card); border-radius: 22px; padding: 14px; box-shadow: 0 10px 30px var(--shadow);
  display: flex; flex-direction: column; gap: 12px;
}
.map-card .row { padding: 0; background: none; }
.map-card .pair .btn { height: 46px; }

/* Detail: map on top, sky sheet over it */
.detail, .picker { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; background: var(--sky); }
.detail { animation: rise 0.22s ease-out; }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .detail, .dot.wait, .skel i { animation: none; } }
.d-map { height: 36vh; min-height: 220px; flex-shrink: 0; background: var(--blue-soft); }
.d-close, .d-save-top {
  position: absolute; z-index: 1000; top: calc(var(--safe-t) + 12px); left: calc(env(safe-area-inset-left, 0px) + 14px);
  width: 44px; height: 44px; border-radius: 22px; background: var(--card); box-shadow: 0 2px 10px var(--shadow);
  display: flex; align-items: center; justify-content: center;
}
.d-save-top { left: auto; right: calc(env(safe-area-inset-right, 0px) + 14px); color: var(--blue-deep); }
.d-save-top.on { background: var(--blue); color: var(--card); }
.sheet {
  flex: 1; margin-top: -26px; position: relative; z-index: 500; background: var(--sky); border-radius: 26px 26px 0 0;
  padding: 18px var(--gutter-r) calc(20px + var(--safe-b)) var(--gutter-l); display: flex; flex-direction: column; gap: 14px; overflow-y: auto;
  max-width: 560px; width: 100%; margin-left: auto; margin-right: auto;
}
.tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tag { height: 30px; padding: 0 12px 0 10px; border-radius: 15px; background: var(--card); display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.tag .ic { color: var(--blue); }
.tag.star .ic, .tag.blue .ic { color: inherit; }
.tag.blue { color: var(--blue-deep); }
.tag.star { background: var(--blue); color: var(--card); }
.tag.must { background: var(--ink); color: var(--card); }
.detail h2 { font-size: 36px; line-height: 1; margin: 0; overflow-wrap: anywhere; }
.facts { display: flex; flex-direction: column; background: var(--card); border-radius: 18px; padding: 2px 16px; }
.fact { padding: 12px 0; display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 12px; align-items: start; }
.fact > .ic { color: var(--blue); margin-top: 2px; }
.fact-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.now { display: block; white-space: normal; font-size: 16px; margin-bottom: 2px; }
.now .open { color: var(--moss); font-weight: 700; }
.now .closed { color: var(--you); font-weight: 700; }
.fact + .fact { border-top: 1px solid var(--line); }
.fact .v { font-size: 17px; line-height: 1.4; white-space: pre-line; user-select: text; }
.fact .v.small { font-size: 15px; }
.actions { margin-top: auto; padding-top: 6px; display: flex; flex-direction: column; gap: 10px; }
.pair { display: flex; gap: 10px; }
.pair > * { flex: 1; }
.btn { height: 54px; border-radius: 27px; display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; font-size: 16px; text-decoration: none; }
.btn.fill { background: var(--blue-deep); color: var(--card); }
.btn.soft { background: var(--blue-soft); color: var(--blue-deep); }
.btn.soft.on { background: var(--blue); color: var(--card); }

.leaflet-container { font-family: var(--body); background: var(--blue-soft); }
.tiles { filter: saturate(0.55) hue-rotate(-8deg) brightness(1.04); }
.pin-me { border-radius: 50%; background: var(--you); border: 3px solid var(--card); box-shadow: 0 0 0 7px oklch(0.63 0.17 30 / 0.2); }
.pin-wrap { background: none; border: 0; }
.pin-it {
  width: 36px; height: 36px; border-radius: 18px; background: var(--ink); color: var(--card); border: 3px solid var(--card);
  box-shadow: 0 4px 12px var(--shadow); display: flex; align-items: center; justify-content: center; box-sizing: border-box;
}
.leaflet-control-attribution { font-size: 10px; }

.picker { background: oklch(0.28 0.05 255 / 0.35); justify-content: flex-end; }
.picker .sheet { flex: 0 1 auto; margin-top: 0; max-height: 88vh; gap: 12px; }
.picker h2 { font-size: 34px; margin: 0; }
.picker p { margin: 0; }
.picker .searchbar { box-shadow: none; }
.p-results { display: flex; flex-direction: column; gap: 6px; }
.p-results button { text-align: left; padding: 10px 14px; background: var(--card); border-radius: 14px; display: flex; flex-direction: column; gap: 2px; }
.p-presets { display: flex; flex-wrap: wrap; gap: 8px; }
