/* RangeBites — Quiet Precision: graphite/slate default; amber only for deals */
:root {
  --bg: #12151a;
  --surface: #1c2129;
  --surface-2: #272d38;
  --border: rgba(255, 255, 255, 0.09);
  --text: #f2f4f7;
  --text-secondary: #b8bfcc;
  --muted: #8a93a5;
  /* Soft slate-blue-gray accents — NOT teal-as-brand */
  --accent: #c5ccd8;
  --accent-strong: #9aa7bd;
  --accent-dim: rgba(154, 167, 189, 0.18);
  --distance: #dce3ef;
  --distance-bg: rgba(220, 227, 239, 0.12);
  /* Amber reserved for deals */
  --deal: #ffc43a;
  --deal-hot: #ff9f1c;
  --deal-bg: rgba(255, 196, 58, 0.16);
  --danger: #ff6b6b;
  --radius: 18px;
  --radius-sm: 12px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --z-map-glow: 5;
  --z-header: 1050; /* above Leaflet controls (~1000); below onboarding/sheets */
  --z-onboarding: 1100;
  --z-sheet: 1200;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 16px; line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
a { color: var(--accent-strong); }

.app {
  display: flex; flex-direction: column;
  min-height: 100%; min-height: 100dvh;
  max-width: 480px; margin: 0 auto;
  background:
    radial-gradient(110% 55% at 50% -12%, rgba(154, 167, 189, 0.12), transparent 55%),
    radial-gradient(70% 35% at 100% 18%, rgba(154, 167, 189, 0.05), transparent 50%),
    var(--bg);
  position: relative;
}

.header {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(12px + var(--safe-top)) 16px 12px;
  /* Solid backdrop — content never bleeds through while sticky */
  background: var(--bg);
  background-image: linear-gradient(180deg, var(--bg) 0%, #141820 100%);
  backdrop-filter: none; -webkit-backdrop-filter: none;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: var(--z-header);
  isolation: isolate;
}

.header-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.visit-count {
  display: flex; flex-direction: column; align-items: flex-end; justify-content: center;
  min-width: 2.4rem; padding: 4px 2px; text-decoration: none; line-height: 1.1;
}
.visit-count-num {
  font-size: 0.92rem; font-weight: 800; letter-spacing: -0.03em;
  color: var(--distance); font-variant-numeric: tabular-nums;
}
.visit-count-label {
  font-size: 0.62rem; font-weight: 650; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted);
}
.visit-count:hover .visit-count-num { color: var(--text); }
.brand { display: flex; flex-direction: column; gap: 3px; max-width: calc(100% - 110px); }
.brand h1 {
  margin: 0; font-size: 1.3rem; font-weight: 800;
  letter-spacing: -0.03em; color: var(--text);
}
.brand .tagline {
  font-size: 0.88rem; color: var(--text-secondary); font-weight: 650;
  line-height: 1.35;
}

.icon-btn {
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 1.15rem; flex-shrink: 0;
}
.icon-btn:active { transform: scale(0.95); }

.hero-tip {
  margin: 12px 14px 0;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(154, 167, 189, 0.1);
  border: 1px solid rgba(154, 167, 189, 0.22);
  font-size: 0.88rem; color: var(--text);
  font-weight: 550;
}
.hero-tip span { color: var(--text); font-weight: 700; } /* Quiet Precision: amber only on deal chrome */ /* slate — amber only for deals */

.banner {
  margin: 10px 14px 0; padding: 11px 13px;
  border-radius: var(--radius-sm); font-size: 0.84rem;
  line-height: 1.35; display: none;
}
.banner.show { display: block; }
.banner-demo {
  background: rgba(154, 167, 189, 0.1);
  border: 1px solid rgba(154, 167, 189, 0.28); color: #d5dbe6;
}
.banner-privacy {
  background: rgba(154, 167, 189, 0.1);
  border: 1px solid rgba(154, 167, 189, 0.25); color: #d5dbe6;
}
.banner-warn {
  background: rgba(255, 120, 90, 0.12);
  border: 1px solid rgba(255, 140, 110, 0.4); color: #ffd0c4;
}
.banner strong { font-weight: 700; }

.controls { padding: 14px 14px 8px; display: flex; flex-direction: column; gap: 12px; }

.locate-row {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: stretch;
}
.place-search { display: flex; flex-direction: column; gap: 6px; }
.place-search-label {
  font-size: 0.72rem; font-weight: 750; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted);
}
.place-search-row { display: flex; gap: 8px; align-items: stretch; }
.place-search-row input {
  flex: 1 1 auto; min-width: 0; min-height: 48px;
  padding: 12px 14px; border-radius: 14px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font: inherit;
}
.place-search-row input:focus {
  outline: 2px solid rgba(220, 227, 239, 0.4); outline-offset: 1px;
}
.place-search-row .btn-secondary { flex: 0 0 auto; min-height: 48px; }

.btn-primary {
  flex: 1 1 160px; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 16px 18px; border-radius: 999px;
  background: linear-gradient(180deg, #3a4250 0%, #2a313c 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text);
  font-weight: 800; font-size: 1.05rem; letter-spacing: -0.01em;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), 0 1px 0 rgba(255,255,255,0.08) inset;
}
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled,
.btn-primary.busy { opacity: 0.6; cursor: wait; }
.btn-primary .pulse {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--distance);
  box-shadow: 0 0 0 0 rgba(220, 227, 239, 0.35);
  animation: pulse 1.4s infinite;
}
.btn-primary.busy .pulse { animation-duration: 0.7s; }

.btn-secondary {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  padding: 14px 16px; border-radius: 999px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--text-secondary);
  font-weight: 700; font-size: 0.92rem; letter-spacing: -0.01em;
  white-space: nowrap;
}
.btn-secondary:active { transform: scale(0.98); }
.btn-secondary:disabled { opacity: 0.55; cursor: wait; }

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(220, 227, 239, 0.35); }
  70% { box-shadow: 0 0 0 12px rgba(220, 227, 239, 0); }
  100% { box-shadow: 0 0 0 0 rgba(220, 227, 239, 0); }
}

.section-label {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted); padding: 0 2px;
}

.chips {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.chips::-webkit-scrollbar { display: none; }

.chip {
  flex: 0 0 auto; padding: 10px 16px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-secondary); font-size: 0.88rem; font-weight: 650;
  transition: transform 0.12s ease, background 0.12s ease;
}
.chip.active {
  background: rgba(220, 227, 239, 0.14);
  border-color: rgba(220, 227, 239, 0.35);
  color: var(--distance);
  box-shadow: 0 0 0 1px rgba(220, 227, 239, 0.08);
  transform: scale(1.03);
}

.filters { display: flex; gap: 8px; flex-wrap: wrap; }

.filter-toggle, .filter-select {
  padding: 9px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--muted); font-size: 0.82rem; font-weight: 650;
}
.filter-toggle[hidden] { display: none; }
.filter-toggle.active {
  /* Slate/graphite only — amber is reserved for deal pins/badges/CTAs (not filters) */
  color: var(--distance);
  background: rgba(220, 227, 239, 0.12);
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 0 0 1px rgba(220, 227, 239, 0.06);
}
/* Explicit: Has deal filter active stays graphite, never amber gradient */
#filterDeal.active,
.filter-toggle.active {
  background: rgba(220, 227, 239, 0.12) !important;
  background-image: none !important;
  color: var(--distance) !important;
  border-color: rgba(255, 255, 255, 0.28) !important;
}
.filter-select {
  appearance: none; -webkit-appearance: none; padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%238a93a5' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  color: var(--text-secondary);
}

.status-line {
  font-size: 0.8rem; color: var(--muted); padding: 0 2px; min-height: 1.2em;
}

.map-wrap {
  margin: 6px 14px 12px; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border);
  height: 240px; min-height: 240px; max-height: 240px;
  flex: 0 0 240px; /* rail/list fill must not shrink the map */
  background: var(--surface); position: relative;
  box-shadow: 0 12px 32px rgba(0,0,0,0.35);
}
#map { width: 100%; height: 100%; min-height: 240px; background: #161a21; }

/* Quiet Precision: OSM raster is light; invert the tile pane only so pins/labels stay honest */
.leaflet-tile-pane {
  filter: invert(1) hue-rotate(180deg) brightness(0.85) contrast(0.95);
  -webkit-filter: invert(1) hue-rotate(180deg) brightness(0.85) contrast(0.95);
}

/* Locate → Glow: one clean premium pulse */
.radar-glow {
  pointer-events: none;
  position: absolute; inset: 0; z-index: var(--z-map-glow);
  display: grid; place-items: center;
  opacity: 0;
}
.radar-glow.active { opacity: 1; }
.radar-glow svg {
  width: min(72%, 200px); height: auto;
  overflow: visible;
  filter: drop-shadow(0 0 12px rgba(220, 227, 239, 0.22));
}
.radar-glow .ring {
  fill: none;
  stroke: rgba(220, 227, 239, 0.55);
  stroke-width: 1.75;
  transform-origin: center;
  opacity: 0;
}
.radar-glow .ring-soft {
  stroke: rgba(220, 227, 239, 0.22);
  stroke-width: 1;
}
.radar-glow.active .ring {
  animation: radarRing 1.25s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.radar-glow.active .ring-soft { animation-delay: 0.08s; }
.radar-glow .core {
  fill: rgba(220, 227, 239, 0.7);
  opacity: 0;
}
.radar-glow.active .core {
  animation: radarCore 1.25s ease-out forwards;
}

@keyframes radarRing {
  0% { opacity: 0.65; transform: scale(0.28); }
  55% { opacity: 0.28; }
  100% { opacity: 0; transform: scale(1.08); }
}
@keyframes radarCore {
  0% { opacity: 0.85; transform: scale(1); }
  35% { opacity: 0.4; }
  100% { opacity: 0; transform: scale(0.6); }
}

.leaflet-container { background: #161a21; font: inherit; }
.leaflet-control-attribution {
  background: rgba(18, 21, 26, 0.8) !important;
  color: var(--muted) !important; font-size: 9px !important;
}
.leaflet-control-attribution a { color: var(--accent-strong) !important; }

.radar-marker {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent-strong);
  border: 2px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 0 3px rgba(154, 167, 189, 0.22);
}
.radar-marker.deal {
  width: 16px; height: 16px;
  background: linear-gradient(180deg, #ffd56a, #ff9f1c);
  border: 2px solid #fff8e8;
  box-shadow:
    0 0 0 3px rgba(255, 159, 28, 0.28),
    0 0 8px rgba(255, 196, 58, 0.28),
    0 2px 6px rgba(0, 0, 0, 0.3);
  animation: dealGlow 0.95s ease-out 1; /* soft one-shot — not infinite / flashy */
}
.place-marker { width: 14px; height: 14px; border-radius: 50%; background: var(--accent-strong); border: 2px solid #fff; }
.place-marker.has-deal {
  background: linear-gradient(180deg, #ffd56a, #ff9f1c);
  box-shadow: 0 0 0 3px rgba(255, 159, 28, 0.28), 0 0 8px rgba(255, 196, 58, 0.28);
  animation: dealGlow 0.95s ease-out 1;
}
@keyframes dealGlow {
  0% { box-shadow: 0 0 0 2px rgba(255,159,28,0.3), 0 0 4px rgba(255,196,58,0.22); transform: scale(1); }
  40% { box-shadow: 0 0 0 5px rgba(255,159,28,0.14), 0 0 10px rgba(255,196,58,0.28); transform: scale(1.04); }
  100% { box-shadow: 0 0 0 3px rgba(255,159,28,0.28), 0 0 8px rgba(255,196,58,0.28); transform: scale(1); }
}

.list-section { padding: 0 14px calc(20px + var(--safe-bottom)); flex: 1; }
.list-header {
  display: flex; align-items: center; justify-content: space-between;
  margin: 4px 2px 12px; gap: 10px;
}
.list-header-left {
  display: flex; align-items: center; gap: 10px; min-width: 0;
}
.list-header h2 { margin: 0; font-size: 1.15rem; font-weight: 800; letter-spacing: -0.02em; }
.list-header #resultCount,
.list-header .hint { font-size: 0.78rem; color: var(--muted); flex-shrink: 0; }
.deal-count,
.list-header #dealCount {
  display: inline-flex; align-items: center;
  padding: 4px 10px; border-radius: 999px;
  font-size: 0.72rem; font-weight: 800;
  letter-spacing: 0.02em; text-transform: uppercase;
  color: #1a1400;
  background: linear-gradient(180deg, #ffe08a, #ffb020);
  box-shadow: 0 2px 10px rgba(255, 176, 32, 0.35);
  margin-left: 0;
}
.deal-count[hidden],
.list-header #dealCount[hidden] { display: none !important; }
.list-header-meta { display: flex; align-items: baseline; gap: 4px; }

.place-list { display: flex; flex-direction: column; gap: 10px; list-style: none; margin: 0; padding: 0; }

.place-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 13px 11px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.2);
  transition: transform 0.12s ease, border-color 0.12s ease;
  cursor: pointer;
}
.place-card.has-deal {
  border-color: rgba(255, 176, 32, 0.45);
  background: linear-gradient(160deg, rgba(255,196,58,0.09) 0%, var(--surface) 38%);
  box-shadow: 0 6px 18px rgba(255, 159, 28, 0.08), 0 4px 14px rgba(0,0,0,0.2);
}
.place-card:active { transform: scale(0.99); }
.place-card.selected {
  border-color: rgba(220, 227, 239, 0.55);
  box-shadow: 0 0 0 2px rgba(220, 227, 239, 0.28), 0 8px 22px rgba(0,0,0,0.28);
}
.place-card.has-deal.selected {
  border-color: rgba(255, 176, 32, 0.85);
  box-shadow: 0 0 0 2px rgba(255, 176, 32, 0.35), 0 8px 24px rgba(255, 159, 28, 0.18);
}
.radar-marker.active-pin {
  outline: 2px solid #fff;
  outline-offset: 2px;
  transform: scale(1.15);
  box-shadow: 0 0 0 5px rgba(220, 227, 239, 0.4), 0 0 12px rgba(220, 227, 239, 0.28);
}
.radar-marker.deal.active-pin {
  outline-color: #fff8e8;
  transform: scale(1.18);
  box-shadow: 0 0 0 5px rgba(255, 159, 28, 0.35), 0 0 12px rgba(255, 196, 58, 0.3);
}

/* Quiet Precision — Sponsored pin caption (map path) */
.leaflet-div-icon.sponsored-pin-icon {
  background: transparent;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: visible;
}
.radar-marker.sponsored {
  box-shadow: 0 0 0 3px rgba(220, 227, 239, 0.28);
}
.pin-sponsored {
  margin-top: 2px;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(18, 20, 24, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 1px 6px;
  border-radius: 999px;
  white-space: nowrap;
  line-height: 1.3;
  pointer-events: none;
}
.popup-sponsored {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #4a5568;
  border: 1px solid rgba(0, 0, 0, 0.14);
  padding: 1px 6px;
  border-radius: 999px;
}

.place-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.place-main { min-width: 0; flex: 1; }
.place-name {
  margin: 0; font-size: 1.02rem; font-weight: 760;
  letter-spacing: -0.02em; line-height: 1.25;
}
.place-distance {
  flex: 0 0 auto;
  display: flex; flex-direction: column; align-items: flex-end; gap: 1px;
  font-size: 0.88rem; font-weight: 820;
  color: var(--distance); background: var(--distance-bg);
  padding: 7px 12px; border-radius: 14px;
  letter-spacing: -0.01em; align-self: flex-start;
  border: 1px solid rgba(220, 227, 239, 0.18);
  min-width: 4.5rem; text-align: right;
}
.place-distance .dist-mi { font-size: 0.92rem; font-weight: 850; line-height: 1.15; }
.place-distance .dist-walk {
  font-size: 0.68rem; font-weight: 650; color: var(--muted);
  letter-spacing: 0; text-transform: none;
}
.sheet-dist { color: var(--distance); font-weight: 850; }

.place-meta { margin-top: 3px; font-size: 0.78rem; color: var(--muted); line-height: 1.3; }

.badge-row { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.badge {
  font-size: 0.7rem; font-weight: 750; padding: 3px 8px;
  border-radius: 999px; background: var(--surface-2); color: var(--text-secondary);
}
.badge-deal {
  background: linear-gradient(180deg, #ffe08a, #ffb020);
  color: #1a1400;
  box-shadow: 0 2px 10px rgba(255, 176, 32, 0.35);
  text-transform: uppercase; letter-spacing: 0.03em;
  cursor: pointer; font-weight: 800;
}
.badge-coupon {
  background: rgba(255, 159, 28, 0.18);
  border: 1px solid rgba(255, 159, 28, 0.45);
  color: #ffd27a;
}
.badge-open {
  background: rgba(154, 167, 189, 0.16);
  color: #d5dbe6;
}
.badge-closed {
  background: rgba(255, 107, 107, 0.14);
  color: #ffb0b0;
}
.badge-sponsored {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.deal-callout {
  margin-top: 8px; padding: 12px 13px;
  border-radius: 10px;
  background: rgba(255, 196, 58, 0.09);
  border: 1px solid rgba(255, 196, 58, 0.28);
  color: #ffe29a;
  line-height: 1.35;
}
.deal-sample {
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffe29a;
  line-height: 1.3;
  margin: 0 0 6px;
}
.deal-callout-detail {
  font-size: 0.95rem; font-weight: 600; color: #ffe29a; line-height: 1.4;
}

/* Contact + hours (Quiet Precision — slate; amber stays on deals) */
.place-contact {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.contact-link {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--text-secondary);
  text-decoration: none;
  min-height: 28px;
  width: fit-content;
}
.contact-link:hover { color: var(--text); text-decoration: underline; }
.contact-value { font-weight: 550; color: var(--muted); }
.contact-demo {
  font-size: 0.95rem; font-weight: 750; color: var(--text);
  line-height: 1.35; margin-bottom: 4px;
}
.contact-hours {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.35;
}
.contact-label {
  font-weight: 700;
  color: var(--text-secondary);
  margin-right: 4px;
}

/* Honest reviews — Maps handoff; no fake stars */
.reviews-block {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.reviews-warn {
  margin: 4px 0 0;
  font-size: 0.78rem;
  color: #c9b27a;
  font-weight: 650;
  line-height: 1.35;
}
.reviews-copy {
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 6px;
  line-height: 1.35;
}
.reviews-row { margin-top: 0; gap: 6px; }
.nav-btn.reviews-cta {
  flex: 1;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 12px 8px;
  min-height: 44px;
  background: var(--surface-2);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.reviews-copy strong { color: var(--text-secondary); font-weight: 750; }
.nav-btn.reviews-cta:hover { color: var(--text); }
.osm-rating {
  font-size: 0.78rem;
  margin-bottom: 4px;
  color: var(--text-secondary);
}
.osm-rating-value { font-weight: 780; color: var(--text); }
.osm-rating-src {
  font-size: 0.68rem;
  font-weight: 650;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.sheet-actions .reviews-block {
  margin-top: 4px;
  padding-top: 10px;
}
.sheet-body .place-contact { margin: 0 0 12px; }


.nav-row { display: flex; gap: 7px; margin-top: 11px; }
.nav-btn {
  flex: 1; text-align: center; text-decoration: none;
  padding: 12px 10px; border-radius: 11px;
  min-height: 44px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.82rem; font-weight: 750;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border);
}
.nav-btn.primary-nav {
  flex: 1.35;
  background: linear-gradient(180deg, #3f4756 0%, #2c3340 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28), 0 1px 0 rgba(255,255,255,0.06) inset;
  font-weight: 800;
}
.nav-btn.primary {
  background: linear-gradient(180deg, #ffd56a, #ffb020);
  color: #1a1400; border: none;
  box-shadow: 0 4px 14px rgba(255, 176, 32, 0.28);
}
.nav-btn.deal-cta {
  flex: 1.45;
  background: linear-gradient(180deg, #ffe08a, #ffb020);
  color: #1a1400; border: none;
  box-shadow: 0 5px 16px rgba(255, 176, 32, 0.38);
  font-weight: 850;
  letter-spacing: -0.01em;
}
.nav-btn.deal-cta:active,
.nav-btn.primary-nav:active { transform: scale(0.98); }

.empty, .loading, .loading-block {
  text-align: center; padding: 28px 16px; color: var(--muted); font-size: 0.92rem;
  list-style: none;
}
.empty strong { display: block; color: var(--text); margin-bottom: 6px; font-size: 1.05rem; }
.empty .empty-cta {
  display: flex; gap: 8px; justify-content: center; flex-wrap: wrap;
  margin-top: 14px;
}
.empty .empty-cta .btn-primary,
.empty .empty-cta .btn-secondary {
  flex: 0 1 auto; min-height: 44px; padding: 12px 16px; font-size: 0.9rem;
}
.loading-block {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 22px 16px; color: var(--muted); font-size: 0.85rem; font-weight: 550;
}
.spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid rgba(220, 227, 239, 0.12);
  border-top-color: var(--distance);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.deal-note {
  margin: 16px 2px 0; font-size: 0.72rem; color: var(--muted); line-height: 1.4;
  text-align: center;
}

/* Bottom sheets (About + Deal detail) */
.sheet-backdrop {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: calc(var(--z-sheet) - 1);
}
.sheet-backdrop.open {
  opacity: 1; pointer-events: auto;
}

.sheet {
  position: fixed; left: 50%; bottom: 0;
  transform: translate(-50%, 110%);
  width: 100%; max-width: 480px;
  max-height: min(88vh, 640px);
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  border: 1px solid var(--border);
  border-bottom: none;
  z-index: var(--z-sheet);
  display: flex; flex-direction: column;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  padding-bottom: var(--safe-bottom);
  overflow: hidden; /* avoid layout jump when content paints */
}
.sheet.open { transform: translate(-50%, 0); }

.sheet-handle {
  width: 40px; height: 4px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  margin: 10px auto 4px;
}
.sheet-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 16px 12px;
  border-bottom: 1px solid var(--border);
}
.sheet-header h2 { margin: 0; font-size: 1.1rem; font-weight: 800; }
.sheet-body {
  overflow: auto; padding: 14px 16px 24px;
  -webkit-overflow-scrolling: touch;
}
.sheet-body h3 {
  margin: 18px 0 8px; font-size: 0.95rem; font-weight: 750;
  color: var(--text);
}
.sheet-body h3:first-child { margin-top: 4px; }
.sheet-body p, .sheet-body li {
  color: var(--text-secondary); font-size: 0.9rem; line-height: 1.45;
}
.sheet-body ul { padding-left: 18px; margin: 8px 0; }
.sheet-body .fine { font-size: 0.75rem; color: var(--muted); margin-top: 20px; }

.deal-sheet-label {
  display: inline-block;
  margin: 0 0 10px;
  padding: 5px 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffe08a, #ffb020);
  color: #1a1400;
  font-size: 0.78rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.deal-sheet-place {
  margin: 0 0 6px; font-size: 1.2rem; font-weight: 800;
}
.deal-sheet-meta { font-size: 0.85rem; color: var(--muted); margin-bottom: 14px; }
.deal-sheet-detail {
  padding: 12px 14px; border-radius: 12px;
  background: rgba(255, 196, 58, 0.1);
  border: 1px solid rgba(255, 196, 58, 0.28);
  color: #ffe29a; font-size: 0.95rem; font-weight: 600;
  margin-bottom: 12px;
}
.deal-sheet-detail .deal-sample { margin-bottom: 8px; }
.deal-sheet-disclosure {
  font-size: 0.92rem; color: var(--text-secondary); line-height: 1.4;
  margin-bottom: 16px;
}
.sheet-actions { display: flex; flex-direction: column; gap: 8px; }
.sheet-actions .nav-row { margin-top: 0; }
.sheet-actions .nav-btn {
  min-height: 44px;
  padding: 14px 12px;
  font-size: 0.92rem;
}
.sheet-actions .nav-btn.deal-cta { width: 100%; }

/* First-run onboarding */
.onboarding {
  position: fixed; inset: 0; z-index: var(--z-onboarding);
  display: none; align-items: flex-end; justify-content: center;
  background: rgba(8, 10, 14, 0.72);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  padding: 16px; padding-bottom: calc(16px + var(--safe-bottom));
}
.onboarding.show { display: flex; }
.onboarding-card {
  width: 100%; max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 22px 20px 18px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
}
.onboarding-step { display: none; }
.onboarding-step.active { display: block; }
.onboarding-kicker {
  font-size: 0.7rem; font-weight: 750; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 8px;
}
.onboarding-step h2 {
  margin: 0 0 10px; font-size: 1.35rem; font-weight: 800;
  letter-spacing: -0.02em;
}
.onboarding-step p {
  margin: 0; color: var(--text-secondary); font-size: 0.95rem; line-height: 1.45;
}
.onboarding-step .accent-amber { color: var(--deal); font-weight: 700; }
.onboarding-dots {
  display: flex; gap: 6px; justify-content: center; margin: 18px 0 14px;
}
.onboarding-dots span {
  width: 7px; height: 7px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
}
.onboarding-dots span.active { background: var(--distance); }
.onboarding-actions {
  display: flex; gap: 8px; align-items: center;
}
.onboarding-actions .btn-skip {
  flex: 0 0 auto; padding: 12px 14px;
  color: var(--muted); font-weight: 650; font-size: 0.9rem;
}
.onboarding-actions .btn-next {
  flex: 1; padding: 13px 16px; border-radius: 999px;
  background: linear-gradient(180deg, #3a4250, #2a313c);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text); font-weight: 800; font-size: 0.95rem;
}
.onboarding-actions .btn-next.final {
  background: linear-gradient(180deg, #3a4250, #2a313c);
  color: var(--text); border: 1px solid rgba(255, 255, 255, 0.12);
}


/* Quiet Precision empty / loading */
.hero-tip.hidden, .hero-tip[hidden] { display: none !important; }
.skeleton-block { display: flex; flex-direction: column; gap: 10px; padding: 4px 0 8px; }
.skeleton-card {
  height: 72px; border-radius: var(--radius);
  background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
  border: 1px solid var(--border);
}
@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
.list-appear .place-card {
  animation: cardIn 0.28s ease-out both;
  animation-delay: calc(var(--i, 0) * 0.04s);
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.badge-deal.pulse-once {
  animation: badgePulse 0.7s ease-out 1;
}
@keyframes badgePulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.06); }
  100% { transform: scale(1); }
}


@media (prefers-reduced-motion: reduce) {
  .radar-glow.active .ring,
  .radar-glow.active .core,
  .radar-marker.deal,
  .place-marker.has-deal,
  .badge-deal.pulse-once,
  .list-appear .place-card,
  .skeleton-card,
  .btn-primary .pulse { animation: none !important; }
}


/* ---- Overnight: trust strip, walk/diet chips, deal rail, disclosures ---- */
.trust-strip {
  margin: 10px 14px 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(154, 167, 189, 0.08);
  border: 1px solid rgba(154, 167, 189, 0.22);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 0.8rem; color: var(--text-secondary);
}
.trust-strip[hidden] { display: none !important; }
.trust-copy { flex: 1; line-height: 1.35; }
.btn-clear-now {
  flex: 0 0 auto;
  padding: 8px 12px; border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text); font-weight: 700; font-size: 0.78rem;
}
.btn-clear-now:active { transform: scale(0.97); }

.what-leaves {
  margin: 0; padding: 0 2px;
  font-size: 0.74rem; color: var(--muted); line-height: 1.4;
}
.what-leaves strong { color: var(--text-secondary); font-weight: 700; }

.label-hint {
  text-transform: none; letter-spacing: 0; font-weight: 550;
  color: var(--muted); font-size: 0.68rem; margin-left: 4px;
}

.chips-walk .chip-walk.active,
.chips-diet .chip-diet.active {
  background: rgba(220, 227, 239, 0.14);
  border-color: rgba(220, 227, 239, 0.35);
  color: var(--distance);
  box-shadow: 0 0 0 1px rgba(220, 227, 239, 0.08);
  transform: scale(1.03);
}

.deal-rail-wrap {
  margin: 0 0 14px;
}
.deal-rail-wrap[hidden] { display: none !important; }
.deal-rail-label {
  font-size: 0.82rem; font-weight: 750; color: var(--deal);
  margin: 0 2px 8px; letter-spacing: -0.01em;
}
.deal-rail-sub {
  display: inline; margin-left: 6px;
  font-size: 0.7rem; font-weight: 550; color: var(--muted);
}
.deal-rail {
  display: flex; gap: 10px; overflow-x: auto;
  padding: 2px 2px 8px; scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  max-height: 120px; /* keep rail compact — map height stays fixed */
}
.deal-rail::-webkit-scrollbar { display: none; }
.deal-rail-card {
  flex: 0 0 auto; width: min(72vw, 220px);
  padding: 12px 14px;
  min-height: 44px;
  border-radius: var(--radius-sm);
  background: linear-gradient(165deg, rgba(255,196,58,0.16) 0%, var(--surface) 55%);
  border: 1px solid rgba(255, 176, 32, 0.5);
  box-shadow: 0 6px 18px rgba(255, 159, 28, 0.12);
  text-align: left; color: inherit; cursor: pointer;
}
.deal-rail-card:active { transform: scale(0.98); }
.deal-rail-card.selected {
  border-color: rgba(255, 176, 32, 0.9);
  box-shadow: 0 0 0 2px rgba(255, 176, 32, 0.4), 0 6px 18px rgba(255, 159, 28, 0.2);
}
.deal-rail-card .rail-deal {
  display: inline-block;
  font-size: 0.68rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.04em; color: #1a1400;
  background: linear-gradient(180deg, #ffe08a, #ffb020);
  padding: 3px 8px; border-radius: 999px; margin-bottom: 8px;
}
.deal-rail-card .rail-name {
  display: block; font-size: 0.95rem; font-weight: 750;
  letter-spacing: -0.015em; margin-bottom: 4px;
}
.deal-rail-card .rail-meta {
  font-size: 0.74rem; color: var(--muted);
}
.deal-rail-card .rail-sponsored {
  display: inline-block; margin-top: 6px;
  font-size: 0.65rem; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--muted);
  border: 1px solid rgba(255,255,255,0.18);
  padding: 2px 7px; border-radius: 999px;
}

.affiliate-line {
  font-size: 0.74rem; color: var(--muted); line-height: 1.4;
  margin: 0 0 12px;
}

.analytics-note { display: block; margin-top: 6px; font-size: 0.78rem; color: var(--muted); line-height: 1.35; }


/* iPhone-width: keep sticky header + safe-area top intact */
@media (max-width: 430px) {
  .header {
    padding-top: calc(12px + var(--safe-top));
    padding-left: 16px;
    padding-right: 16px;
  }
  .map-wrap,
  #map {
    height: 240px; min-height: 240px; max-height: 240px;
  }
}

/* --- Phone + desktop polish (layout job) --- */
html, body { overflow-x: hidden; max-width: 100%; }
.app, .stage, .place-card, .sheet { min-width: 0; }
.place-card { overflow-wrap: anywhere; }

.privacy-one-line { display: none; margin: 0; font-size: 0.82rem; color: var(--text-secondary); }
.privacy-about {
  display: inline; padding: 0; margin-left: 4px;
  color: var(--accent-strong); font-weight: 700; text-decoration: underline;
  min-height: 44px; background: none; border: none; cursor: pointer;
}
.icon-btn { width: 44px; height: 44px; min-width: 44px; min-height: 44px; }
.chip, .filter-toggle, .filter-select, .btn-secondary { min-height: 44px; }
.btn-primary { min-height: 44px; }

.nav-row { flex-wrap: wrap; }
.nav-btn {
  flex: 1 1 calc(50% - 7px);
  min-width: 0;
  max-width: 100%;
}
.place-contact {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 6px;
}
.contact-link {
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 11px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  align-items: center;
}
.contact-hours { flex: 1 1 100%; }

/* Phone: collapse chrome so Locate / map / deal rail fit first screen */
@media (max-width: 767px) {
  .privacy-one-line { display: block; }
  .privacy-full { display: none; }
  .hero-tip,
  .what-leaves,
  .trust-strip,
  .section-label-walk,
  .chips-walk,
  .section-label-diet,
  .chips-diet,
  .filters { display: none !important; }
  .banner-privacy { padding: 8px 12px; margin: 8px 14px 0; }
  .controls { padding: 10px 14px 4px; gap: 8px; }
  .map-wrap { margin-top: 4px; }
  .sheet {
    padding-bottom: calc(12px + var(--safe-bottom));
  }
}

/* Desktop ≥768: wider chrome, map + Nearby side by side, taller map */
@media (min-width: 768px) {
  .app { max-width: 1180px; }
  .privacy-one-line { display: none; }
  .privacy-full { display: block; }
  .hero-tip, .what-leaves, .trust-strip { display: none !important; }
  .banner-privacy, .banner-demo, .banner-warn { padding: 8px 14px; margin: 8px 16px 0; font-size: 0.84rem; }
  .controls { padding: 8px 16px 8px; gap: 6px; }
  .stage {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 12px 18px;
    align-items: stretch;
    padding: 0 16px 20px; flex: 1 1 auto; min-height: 420px;
  }
  .map-wrap {
    margin: 0;
    height: calc(100dvh - 280px);
    min-height: 420px;
    max-height: none;
    flex: none;
  }
  #map { min-height: 420px; height: 100%; }
  .list-section {
    padding: 0 0 calc(20px + var(--safe-bottom));
    min-width: 0;
    max-height: calc(100dvh - 280px); height: calc(100dvh - 280px);
    overflow: auto;
  }
  /* Deal sheet as centered modal */
  .sheet {
    top: 50%;
    bottom: auto;
    left: 50%;
    width: min(480px, 92vw);
    max-width: 480px;
    max-height: min(80vh, 720px);
    border-radius: 20px;
    border-bottom: 1px solid var(--border);
    transform: translate(-50%, -46%) scale(0.98);
    opacity: 0;
    pointer-events: none;
    padding-bottom: 16px;
  }
  .sheet.open {
    transform: translate(-50%, -50%);
    opacity: 1;
    pointer-events: auto;
  }
}

.deal-rail-wrap.is-empty .deal-rail-label { color: var(--muted); }
.deal-empty {
  margin: 0;
  padding: 10px 12px;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
}

.empty-waitlist { margin: 12px 0 0; font-size: 0.82rem; }
.empty-waitlist a { color: var(--muted); text-decoration: none; }
.empty-waitlist a:hover { color: var(--text); }

/* Open-now status strip — OSM hours only. Not a stock ticker. */
.open-strip {
  margin: 10px 0 4px;
  padding: 10px 2px 2px;
}
.open-strip[hidden] { display: none !important; }
.open-strip-label {
  font-size: 0.78rem; font-weight: 750; color: var(--text-secondary);
  margin: 0 2px 8px; letter-spacing: 0.02em; text-transform: uppercase;
}
.open-strip-track {
  display: flex; gap: 8px; overflow-x: auto;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
  padding-bottom: 4px;
}
.open-strip-track::-webkit-scrollbar { display: none; }
.open-pill {
  flex: 0 0 auto;
  display: flex; align-items: baseline; gap: 6px;
  padding: 8px 12px; border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.88rem; font-weight: 650;
  min-height: 40px;
}
.open-pill .open-mark {
  font-size: 0.72rem; font-weight: 800; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--text-secondary);
}
.open-strip-empty {
  margin: 0 2px 8px;
  font-size: 0.92rem; font-weight: 650; color: var(--muted); line-height: 1.35;
}
