/* =========================================
   RESET & ROOT
========================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:   #16C19D;
  --primary-2: #0ea5e9;
  --pos:       #16C19D;
  --neu:       #eab308;
  --neg:       #EF476F;
  --orange:    #f59e0b;

  --bg:        #f0f4f8;
  --surface:   #ffffff;
  --text:      #0f172a;
  --text-2:    #4b5563;
  --muted:     #6b7280;
  --border:    #e2e8f0;
  --border-2:  #cbd5e1;

  --teal-dim:  rgba(22,193,157,0.10);
  --teal-ring: rgba(22,193,157,0.28);
  --shadow:    0 2px 12px rgba(15,23,42,0.08);
  --shadow-lg: 0 8px 40px rgba(15,23,42,0.14);

  --r-sm: 10px; --r-md: 14px; --r-lg: 18px; --r-xl: 24px;
}

html, body {
  height: 100%; overflow: hidden;
  font-family: 'DM Sans', sans-serif;
  -webkit-font-smoothing: antialiased;
  color: var(--text);
}

button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select { font-family: inherit; }

/* =========================================
   APP SHELL
========================================= */
.app { position: fixed; inset: 0; overflow: hidden; }

.step {
  position: absolute; inset: 0;
  opacity: 0; pointer-events: none;
  transition: opacity 0.45s ease, transform 0.45s cubic-bezier(.22,1,.36,1);
  transform: translateY(18px); overflow-y: auto;
}
.step.active { opacity: 1; pointer-events: all; transform: translateY(0); }

/* =========================================
   PROGRESS BAR — sleek minimal
========================================= */
.progress-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(255,255,255,0.96);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
  padding: 12px 0 10px;
  display: flex; justify-content: center;
  transform: translateY(-100%);
  transition: transform 0.4s cubic-bezier(.22,1,.36,1);
}
.progress-bar.show { transform: translateY(0); }
.prog-steps { display: flex; align-items: center; }
.prog-step { display: flex; align-items: center; gap: 6px; }
.prog-circle {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--border-2);
  transition: all 0.3s;
}
.prog-step.active .prog-circle { background: var(--primary); box-shadow: 0 0 0 3px rgba(22,193,157,0.2); width: 10px; height: 10px; }
.prog-step.done .prog-circle { background: var(--primary); }
.prog-label { font-size: 0.62rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.prog-step.active .prog-label { color: var(--primary); }
.prog-step.done .prog-label { color: var(--primary); }
.prog-line { width: 48px; height: 2px; background: var(--border); margin: 0 10px; transition: background 0.4s; }
.prog-line.done { background: var(--primary); }

/* =========================================
   STEP 1 — WELCOME
========================================= */
#step-1 {
  background: #f8fafc;
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 28px 24px;
}
.s1-bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 900px 700px at 20% 30%, rgba(22,193,157,0.08), transparent 60%),
    radial-gradient(ellipse 700px 600px at 80% 70%, rgba(14,165,233,0.07), transparent 60%);
}
.s1-wrap {
  position: relative; z-index: 1;
  width: 100%; max-width: 1100px;
  display: flex; flex-direction: column; align-items: center; gap: 24px;
}
.s1-branding { text-align: center; }

/* Logo — ALL green */
.brand {
  font-family: 'Syne', sans-serif;
  font-size: clamp(3.5rem, 10vw, 5.5rem);
  font-weight: 800; line-height: 0.9;
  letter-spacing: -0.04em; text-align: center;
  color: var(--primary);
}

.tagline {
  font-size: 0.68rem; font-weight: 800; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--muted); margin-top: 10px;
}
.headline {
  font-family: 'Syne', sans-serif;
  font-size: clamp(1.15rem, 2.2vw, 1.5rem);
  font-weight: 700; text-align: center; letter-spacing: -0.02em;
  line-height: 1.3; color: var(--text);
}
.headline .grad {
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.subtitle { font-size: 0.82rem; color: var(--muted); text-align: center; max-width: 400px; margin: 0 auto; }

/* City card — wider */
.city-card {
  width: 100%; max-width: 960px;
  background: rgba(255,255,255,0.9);
  border: 1.5px solid var(--border);
  border-radius: var(--r-xl);
  padding: 32px 72px 28px;
  box-shadow: 0 20px 60px rgba(15,23,42,0.1), 0 0 0 1px rgba(22,193,157,0.08);
  position: relative; overflow: hidden;
}
.city-card::before {
  content: ''; position: absolute; inset: 0;
  border-radius: inherit; border: 2px solid rgba(22,193,157,0.12); pointer-events: none;
}
.city-prompt {
  font-family: 'Syne', sans-serif; font-size: 1.2rem;
  font-weight: 700; color: var(--text);
  text-align: center; margin-bottom: 18px;
  display: flex; align-items: baseline; justify-content: center;
  flex-wrap: wrap; gap: 6px;
}
.city-input {
  background: transparent; border: none;
  border-bottom: 3px solid rgba(15,23,42,0.2);
  padding: 4px 8px; min-width: 200px; flex: 0 1 280px;
  font-family: 'Syne', sans-serif; font-size: inherit; font-weight: 800;
  color: var(--primary); text-align: center;
  outline: none; transition: border-color 0.2s;
}
.city-input:focus { border-bottom-color: var(--primary); }
.city-input::placeholder { color: rgba(15,23,42,0.25); font-weight: 700; }

.city-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 20px; }
.city-chip {
  background: rgba(22,193,157,0.07); border: 2px solid rgba(22,193,157,0.25);
  border-radius: var(--r-md); padding: 12px 8px;
  font-family: 'Syne', sans-serif; font-weight: 700; font-size: 0.8rem; color: var(--text);
  transition: all 0.18s; text-align: center;
}
.city-chip:hover { background: rgba(22,193,157,0.14); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(22,193,157,0.15); }
.city-chip.selected { background: rgba(22,193,157,0.18); border-color: var(--primary); box-shadow: 0 0 0 3px rgba(22,193,157,0.15); }

.start-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; background: var(--primary); color: #fff;
  border-radius: var(--r-md); padding: 14px 20px;
  font-family: 'Syne', sans-serif; font-size: 0.95rem; font-weight: 800;
  box-shadow: 0 10px 28px rgba(22,193,157,0.25); transition: all 0.2s; opacity: 0.5;
}
.start-btn.ready { opacity: 1; cursor: pointer; }
.start-btn.ready:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(22,193,157,0.32); }

@media (max-width: 640px) {
  #step-1 { padding: 20px 16px; }
  .s1-wrap { gap: 16px; }
  .city-prompt { font-size: 1rem; flex-wrap: wrap; white-space: normal; }
  .city-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .city-card { padding: 24px 20px 20px; max-width: 100%; }
  .city-chip { padding: 12px 10px; font-size: 0.78rem; }
  .city-input { width: 160px; font-size: 1rem; }
}

/* =========================================
   STEP 2 — SEARCH (clean green bg, no icons)
========================================= */
#step-2 {
  background: var(--primary);
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 70px 40px 40px;
}
.s2-wrap {
  position: relative; z-index: 1;
  width: 100%; max-width: 940px;
  display: flex; flex-direction: column; align-items: center;
}
.city-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.25); border: 1.5px solid rgba(255,255,255,0.4);
  border-radius: 999px; padding: 8px 20px;
  font-family: 'Syne', sans-serif; font-size: 0.9rem; font-weight: 800; color: #fff; margin-bottom: 12px;
}
.s2-title {
  font-family: 'Syne', sans-serif; font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  font-weight: 800; color: #fff; text-align: center; margin-bottom: 18px;
}
.search-card {
  width: 100%; background: rgba(255,255,255,0.96);
  border: 1.5px solid rgba(255,255,255,0.8);
  border-radius: var(--r-xl); padding: 30px 52px 26px;
  box-shadow: 0 20px 60px rgba(15,23,42,0.18);
}
.prompt-row {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: nowrap;
}
.prompt-word {
  font-family: 'Syne', sans-serif; font-size: 0.95rem; font-weight: 800; color: var(--text); flex-shrink: 0;
}
.s2-input {
  flex: 1; min-width: 0; background: transparent; border: none;
  border-bottom: 2.5px solid rgba(15,23,42,0.15);
  padding: 6px 4px; font-size: 0.9rem; font-weight: 600; color: var(--text);
  outline: none; transition: border-color 0.2s;
}
.s2-input:focus { border-bottom-color: var(--primary); }
.s2-input::placeholder { color: rgba(15,23,42,0.3); }
.s2-input-sm {
  width: 90px; flex: none; background: transparent; border: none;
  border-bottom: 2.5px solid rgba(15,23,42,0.15);
  padding: 6px 6px; font-size: 0.95rem; font-weight: 700; color: var(--text); text-align: center;
  outline: none; transition: border-color 0.2s;
}
.s2-input-sm:focus { border-bottom-color: var(--primary); }
.s2-select {
  background: var(--bg); border: 1.5px solid var(--border);
  border-radius: var(--r-sm); padding: 6px 12px;
  font-size: 0.85rem; font-weight: 700; color: var(--text); outline: none; cursor: pointer;
}
.quick-row { margin-bottom: 14px; }
.quick-lbl { font-size: 0.72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; display: block; margin-bottom: 8px; }
.quick-chips-wrap { display: flex; gap: 8px; flex-wrap: wrap; }
.q-chip {
  background: var(--bg); border: 1.5px solid var(--border);
  border-radius: 999px; padding: 6px 14px;
  font-size: 0.78rem; font-weight: 700; color: var(--text-2);
  cursor: pointer; transition: all 0.15s;
}
.q-chip:hover { border-color: var(--primary); color: var(--primary); }
.q-chip.selected { background: var(--teal-dim); border-color: var(--primary); color: var(--primary); }
.filter-toggle {
  display: flex; align-items: center; gap: 4px;
  font-size: 0.78rem; font-weight: 800; color: var(--primary);
  margin-bottom: 10px; cursor: pointer; padding: 4px 0;
}
.query-preview {
  background: rgba(22,193,157,0.06); border: 1px solid rgba(22,193,157,0.18);
  border-radius: var(--r-sm); padding: 10px 14px; margin-bottom: 16px;
}
.preview-label { font-size: 0.65rem; font-weight: 800; color: var(--primary); text-transform: uppercase; letter-spacing: 0.06em; display: block; margin-bottom: 4px; }
#previewText { font-size: 0.85rem; color: var(--text-2); font-weight: 500; font-style: italic; }
.search-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 14px 20px; background: var(--primary); color: #fff;
  border-radius: var(--r-md); font-family: 'Syne', sans-serif; font-weight: 800; font-size: 0.95rem;
  opacity: 0.5; transition: all 0.2s; box-shadow: 0 8px 24px rgba(22,193,157,0.2);
}
.search-btn.ready { opacity: 1; cursor: pointer; }
.search-btn.ready:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(22,193,157,0.3); }

@media (max-width: 640px) {
  #step-2 { padding: 70px 16px 24px; }
  .search-card { padding: 20px 18px 18px; }
  .prompt-word { font-size: 0.85rem; }
  .prompt-row { flex-wrap: wrap; }
  .s2-input { font-size: 0.85rem; }
}

/* =========================================
   STEP 3 — LOADING
========================================= */
.loading-header { text-align: center; margin-bottom: 20px; }
.thinking-logo { font-family: 'Syne', sans-serif; font-size: 2rem; font-weight: 800; color: var(--primary); margin-bottom: 8px; }
.thinking-text { font-size: 1rem; font-weight: 600; color: var(--text); transition: opacity 0.2s; }
.thinking-sub { font-size: 0.8rem; color: var(--muted); margin-top: 4px; }

.progress-feed {
  width: min(420px, 88vw); margin: 16px auto 20px;
  display: flex; flex-direction: column; gap: 5px;
}
.feed-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 14px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-sm);
  font-size: 0.76rem; font-weight: 600; color: var(--text-2);
  opacity: 0; transform: translateY(6px);
  animation: feedIn 0.3s ease forwards;
}
.feed-item.done { color: var(--primary); border-color: var(--teal-ring); background: var(--teal-dim); }
.feed-icon { width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.6rem; flex-shrink: 0; }
.feed-item.done .feed-icon { background: var(--primary); color: #fff; }
.feed-spinner { width: 14px; height: 14px; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; }

@keyframes feedIn { to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton-preview {
  width: min(660px, 94vw); display: flex; gap: 12px;
  overflow: hidden; padding: 0 16px;
}
.skeleton-card {
  flex-shrink: 0; width: 200px; height: 140px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 14px; position: relative; overflow: hidden;
}
.skeleton-card::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(22,193,157,0.06), transparent);
  animation: shimmer 1.8s ease-in-out infinite;
}
.skel-line { height: 10px; border-radius: 5px; background: var(--border); margin-bottom: 10px; }
.skel-line.w60 { width: 60%; } .skel-line.w80 { width: 80%; } .skel-line.w40 { width: 40%; }
.skel-line.thick { height: 14px; margin-bottom: 12px; }
@keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

.thinking-dots { display: none; }

/* =========================================
   STEP 4 — RESULTS
========================================= */
#step-4 { overflow: hidden; background: var(--bg); }
#map { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; }

/* Pins */
.mapboxgl-marker { z-index: 10 !important; }
.custom-pin-wrap { display: flex; flex-direction: column; align-items: center; cursor: pointer; }
.custom-pin-body {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Syne', sans-serif; font-size: 0.65rem; font-weight: 800; color: #fff;
  box-shadow: 0 3px 12px rgba(15,23,42,0.25), 0 0 0 3px rgba(255,255,255,0.9);
  transition: transform 0.25s cubic-bezier(.34,1.56,.64,1), box-shadow 0.25s;
  animation: pinDrop 0.5s cubic-bezier(.34,1.56,.64,1) both;
}
.custom-pin-body.tier-green { box-shadow: 0 3px 12px rgba(15,23,42,0.2), 0 0 0 3px rgba(22,193,157,0.35), 0 0 0 6px rgba(255,255,255,0.85); }
.custom-pin-body.tier-yellow { box-shadow: 0 3px 12px rgba(15,23,42,0.2), 0 0 0 3px rgba(234,179,8,0.35), 0 0 0 6px rgba(255,255,255,0.85); }
.custom-pin-body.tier-orange { box-shadow: 0 3px 12px rgba(15,23,42,0.2), 0 0 0 3px rgba(245,158,11,0.35), 0 0 0 6px rgba(255,255,255,0.85); }
.custom-pin-tail { width: 2px; height: 8px; background: linear-gradient(to bottom, rgba(15,23,42,0.18), transparent); border-radius: 1px; margin-top: 2px; }
.custom-pin-lbl {
  position: absolute; top: 48px; left: 50%; transform: translateX(-50%) translateY(4px);
  background: rgba(255,255,255,0.96); border: 1px solid var(--border-2);
  padding: 3px 8px; border-radius: 5px;
  font-size: 0.6rem; font-weight: 700; color: var(--text);
  white-space: nowrap; box-shadow: var(--shadow);
  opacity: 0; transition: opacity 0.18s, transform 0.18s; pointer-events: none;
}
.custom-pin-wrap:hover .custom-pin-body,
.custom-pin-wrap.active .custom-pin-body {
  transform: scale(1.25);
  box-shadow: 0 5px 20px rgba(15,23,42,0.3), 0 0 0 4px var(--teal-ring), 0 0 0 7px rgba(255,255,255,0.9);
}
.custom-pin-wrap:hover .custom-pin-lbl,
.custom-pin-wrap.active .custom-pin-lbl { opacity: 1; transform: translateX(-50%) translateY(0); }

/* User location pin */
.user-pin {
  width: 22px; height: 22px; border-radius: 50%;
  background: #3b82f6; border: 3px solid #fff;
  box-shadow: 0 0 0 4px rgba(59,130,246,0.3), 0 2px 8px rgba(15,23,42,0.25);
  animation: userPulse 2s ease-in-out infinite;
  z-index: 20 !important;
}
@keyframes userPulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(59,130,246,0.3), 0 2px 8px rgba(15,23,42,0.25); }
  50% { box-shadow: 0 0 0 10px rgba(59,130,246,0.12), 0 2px 8px rgba(15,23,42,0.25); }
}

.pin-pos { background: var(--pos); }
.pin-neu { background: #d09800; }
.pin-neg { background: var(--neg); }
.pin-ora { background: #f59e0b; }
@keyframes pinDrop { from { opacity: 0; transform: scale(0.4); } to { opacity: 1; transform: scale(1); } }

/* Top bar — centered pill, fixed so map can't cover it */
.r-topbar {
  position: fixed; top: 48px; left: 50%; transform: translateX(-50%);
  z-index: 110;
  display: none; align-items: center;
  background: rgba(255,255,255,0.95); border: 1px solid var(--border-2);
  border-radius: 999px; padding: 8px 18px;
  backdrop-filter: blur(24px); box-shadow: var(--shadow-lg); white-space: nowrap;
}
.r-topbar.show { display: inline-flex; }
.r-logo { font-family: 'Syne', sans-serif; font-size: 1rem; font-weight: 800; color: var(--primary); }
.r-sep { width: 1px; height: 16px; background: var(--border-2); margin: 0 10px; }
.r-city { font-family: 'Syne', sans-serif; font-size: 0.8rem; font-weight: 700; }
.r-query { font-size: 0.75rem; color: var(--muted); font-weight: 500; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r-count { background: var(--teal-dim); border: 1px solid var(--teal-ring); border-radius: 999px; padding: 3px 10px; font-size: 0.65rem; font-weight: 800; color: var(--pos); margin-left: 6px; }
.r-back { margin-left: 8px; background: var(--bg); border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px; font-size: 0.72rem; font-weight: 700; color: var(--text-2); cursor: pointer; transition: all 0.15s; font-family: inherit; }
.r-back:hover { border-color: var(--primary); color: var(--primary); }

/* Floating detail */
.map-detail {
  position: absolute; left: 20px; bottom: 220px; z-index: 30; width: 280px;
  background: rgba(255,255,255,0.97); border: 1.5px solid var(--border-2);
  border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-lg); display: none;
}
.map-detail.show { display: block; animation: detailIn 0.26s cubic-bezier(.22,1,.36,1) both; }
@keyframes detailIn { from { opacity: 0; transform: translateY(10px) scale(0.97); } }
.detail-stripe { height: 4px; }
.detail-body { padding: 12px 14px 10px; }
.detail-name { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 0.95rem; color: var(--text); margin-bottom: 2px; }
.detail-sub { font-size: 0.7rem; color: var(--muted); margin-bottom: 8px; }
.detail-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.detail-footer { display: flex; align-items: center; gap: 7px; padding: 9px 14px; border-top: 1px solid var(--border); background: rgba(15,23,42,0.02); }

/* Legend — tier-based */
.map-legend {
  position: absolute; right: 20px; bottom: 220px; z-index: 30;
  display: flex; gap: 10px; align-items: center;
  background: rgba(255,255,255,0.93); border: 1px solid var(--border-2);
  border-radius: 999px; padding: 7px 14px;
  box-shadow: var(--shadow); font-size: 0.66rem; font-weight: 800; color: var(--muted);
}
.leg-item { display: flex; align-items: center; gap: 4px; }
.leg-dot { width: 7px; height: 7px; border-radius: 50%; }

/* Bottom panel */
.bottom-panel {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 40;
  max-height: 280px;
  background: rgba(255,255,255,0.95);
  border-top: 1.5px solid var(--border-2);
  backdrop-filter: blur(28px);
  box-shadow: 0 -8px 40px rgba(15,23,42,0.1);
  border-radius: 22px 22px 0 0;
  transition: transform 0.35s cubic-bezier(.22,1,.36,1);
}
.bottom-panel.collapsed { transform: translateY(calc(100% - 64px)); }
.panel-handle { width: 100%; height: 28px; display: flex; align-items: center; justify-content: center; cursor: pointer; position: relative; }
.panel-handle::after { content: ''; width: 40px; height: 5px; background: var(--border-2); border-radius: 3px; transition: background 0.2s; }
.panel-handle:hover::after { background: var(--primary); }
.panel-toggle { position: absolute; right: 20px; top: 50%; transform: translateY(-50%); font-size: 0.7rem; font-weight: 800; color: var(--muted); pointer-events: none; }
.bottom-panel.collapsed .panel-toggle { transform: translateY(-50%) rotate(180deg); }
.panel-top { display: flex; align-items: center; gap: 8px; padding: 10px 20px 8px; border-bottom: 1px solid var(--border); }
.panel-logo { font-family: 'Syne', sans-serif; font-size: 0.72rem; font-weight: 800; color: var(--primary); }
.panel-title { font-family: 'Syne', sans-serif; font-size: 0.72rem; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.07em; }
.panel-count { background: var(--teal-dim); border: 1px solid var(--teal-ring); border-radius: 999px; padding: 2px 8px; font-size: 0.62rem; font-weight: 800; color: var(--pos); }

/* Tier sections — inline within single row */
.cards-container {
  display: flex; gap: 10px; align-items: stretch;
  padding: 10px 20px 16px;
  overflow-x: auto; scrollbar-width: none;
}
.cards-container::-webkit-scrollbar { display: none; }

.tier-divider {
  flex-shrink: 0; display: flex; align-items: center;
  writing-mode: vertical-lr; text-orientation: mixed;
  font-family: 'Syne', sans-serif; font-size: 0.55rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 8px 2px; border-left: 2px solid var(--border);
  margin: 0 2px;
}
.tier-divider.green { color: var(--pos); border-color: rgba(22,193,157,0.3); }
.tier-divider.yellow { color: #ca8a04; border-color: rgba(234,179,8,0.3); }
.tier-divider.orange { color: #d97706; border-color: rgba(245,158,11,0.3); }

/* Remove old tier section styles */
.tier-section { display: contents; }
.tier-label { display: none; }
.tier-cards { display: contents; }

/* Legacy compat */
.cards-row { display: flex; gap: 12px; padding: 14px 20px 20px; overflow-x: auto; scrollbar-width: none; align-items: stretch; }
.cards-row::-webkit-scrollbar { display: none; }

/* Cards — wider */
.card-feat {
  position: relative;
  flex-shrink: 0; width: 340px; min-width: 340px;
  background: var(--surface); border: 2px solid var(--primary);
  border-radius: 15px; overflow: hidden; cursor: pointer;
  display: flex; flex-direction: column;
  box-shadow: 0 4px 20px rgba(22,193,157,0.18);
  transition: transform 0.2s, box-shadow 0.2s; position: relative;
  animation: cardIn 0.4s ease both;
}
.card-feat::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--primary), rgba(22,193,157,0.4)); }
.card-feat:hover { transform: translateY(-4px); box-shadow: 0 8px 32px rgba(22,193,157,0.25); }
.card-feat.active { box-shadow: 0 6px 28px rgba(22,193,157,0.3), 0 0 0 3px rgba(22,193,157,0.2); transform: scale(1.02); }

.card-reg {
  flex-shrink: 0; width: 300px; min-width: 300px;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 13px; overflow: hidden; cursor: pointer;
  display: flex; flex-direction: column;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s; position: relative;
  animation: cardIn 0.4s ease both;
}
.card-reg::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--c-accent, var(--border)); }
.card-reg:hover { transform: translateY(-4px); border-color: var(--border-2); box-shadow: 0 6px 24px rgba(15,23,42,0.1); }
.card-reg.active { border-color: var(--primary); box-shadow: 0 4px 20px rgba(22,193,157,0.18), 0 0 0 2px rgba(22,193,157,0.12); transform: scale(1.02); }
.card-reg.active::before { background: var(--primary); }
@keyframes cardIn { from { opacity: 0; transform: translateY(14px); } }

/* Card internals */
.c-top { padding: 14px 16px 10px; flex: 1; display: flex; flex-direction: column; }
.c-rank { font-family: 'Syne', sans-serif; font-weight: 800; color: rgba(15,23,42,0.05); line-height: 1; user-select: none; margin-bottom: -10px; }
.card-feat .c-rank { font-size: 3rem; margin-bottom: -14px; }
.card-reg .c-rank { font-size: 2.4rem; margin-bottom: -8px; }
.c-name { font-family: 'Syne', sans-serif; font-weight: 700; color: var(--text); letter-spacing: -0.01em; }
.card-feat .c-name { font-size: 1rem; margin-bottom: 3px; }
.card-reg .c-name { font-size: 0.88rem; margin-bottom: 2px; }
.c-sub { font-size: 0.68rem; color: var(--muted); font-weight: 500; margin-bottom: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; }
.c-summary { font-size: 0.74rem; color: var(--text-2); line-height: 1.55; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 6px; }
.card-feat .c-summary { -webkit-line-clamp: 3; }
.card-reg .c-summary { -webkit-line-clamp: 2; }
.c-mentions { display: flex; gap: 4px; flex-wrap: wrap; }
.c-mention-chip { background: rgba(22,193,157,0.08); border: 1px solid rgba(22,193,157,0.2); border-radius: 999px; padding: 2px 8px; font-size: 0.6rem; font-weight: 700; color: #047857; }
.c-footer { display: flex; align-items: center; gap: 6px; border-top: 1px solid var(--border); background: rgba(15,23,42,0.02); white-space: nowrap; }
.card-feat .c-footer { padding: 10px 16px; }
.card-reg .c-footer { padding: 8px 14px; }
.c-reviews-count { font-size: 0.62rem; font-weight: 700; color: var(--muted); margin-left: auto; }

/* Tags */
.tag { padding: 2px 8px; border-radius: 4px; font-size: 0.62rem; font-weight: 800; }
.t-teal { background: rgba(22,193,157,0.1); border: 1px solid rgba(22,193,157,0.24); color: #047857; }
.t-pos { background: rgba(22,193,157,0.1); border: 1px solid rgba(22,193,157,0.2); color: var(--pos); }
.t-neu { background: rgba(255,209,102,0.18); border: 1px solid rgba(255,209,102,0.4); color: #92600a; }
.t-neg { background: rgba(239,71,111,0.1); border: 1px solid rgba(239,71,111,0.2); color: var(--neg); }

.r-badge { font-size: 0.7rem; font-weight: 900; padding: 2px 7px; border-radius: 5px; flex-shrink: 0; }
.rb-pos { background: rgba(22,193,157,0.1); color: var(--pos); border: 1px solid rgba(22,193,157,0.2); }
.rb-neu { background: rgba(255,209,102,0.18); color: #92600a; border: 1px solid rgba(255,209,102,0.4); }
.rb-neg { background: rgba(239,71,111,0.1); color: var(--neg); border: 1px solid rgba(239,71,111,0.2); }
.dist-lbl { font-size: 0.65rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
.sent-bar { flex: 1; height: 3px; background: var(--border); border-radius: 2px; overflow: hidden; margin-left: 2px; }
.sent-fill { height: 100%; border-radius: 2px; transition: width 0.6s ease; }

/* =========================================
   NOTIFICATION
========================================= */
.overlay { position: fixed; inset: 0; background: rgba(15,23,42,0.5); z-index: 200; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.overlay.show { opacity: 1; pointer-events: all; }
.notif {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%) translateY(20px) scale(0.96);
  z-index: 201; width: min(540px, 92vw);
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--r-xl); padding: 36px 44px;
  box-shadow: 0 24px 60px rgba(15,23,42,0.2);
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s, transform 0.3s; text-align: center;
}
.notif.show { opacity: 1; pointer-events: all; transform: translate(-50%, -50%) translateY(0) scale(1); }
.notif-icon { font-size: 2.2rem; margin-bottom: 12px; }
.notif-title { font-family: 'Syne', sans-serif; font-size: 1.1rem; font-weight: 800; margin-bottom: 10px; }
.notif-text { font-size: 0.85rem; color: var(--text-2); line-height: 1.65; margin-bottom: 20px; }
.notif-btn { background: var(--primary); color: #fff; border-radius: var(--r-md); padding: 12px 28px; font-family: 'Syne', sans-serif; font-weight: 800; font-size: 0.95rem; cursor: pointer; transition: all 0.2s; }
.notif-btn:hover { filter: brightness(1.05); transform: translateY(-1px); }

/* =========================================
   PLACE DETAIL MODAL
========================================= */
.place-overlay { position: fixed; inset: 0; background: rgba(15,23,42,0.5); z-index: 300; opacity: 0; pointer-events: none; transition: opacity 0.25s; }
.place-overlay.show { opacity: 1; pointer-events: all; }
.place-modal {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%) translateY(20px) scale(0.96);
  z-index: 301; width: min(620px, 92vw); max-height: 85vh;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--r-xl); box-shadow: 0 24px 60px rgba(15,23,42,0.22);
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  display: flex; flex-direction: column; overflow: hidden;
}
.place-modal.show { opacity: 1; pointer-events: all; transform: translate(-50%, -50%) translateY(0) scale(1); }
.pm-close { position: absolute; top: 12px; right: 14px; z-index: 10; width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,0.9); border: 1px solid var(--border); font-size: 0.9rem; color: var(--muted); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.15s; }
.pm-close:hover { background: var(--bg); color: var(--text); }
.pm-header { padding: 0; }
.pm-stripe { height: 5px; border-radius: 24px 24px 0 0; }
.pm-top { display: flex; align-items: flex-start; gap: 14px; padding: 20px 24px 12px; }
.pm-rank { font-family: 'Syne', sans-serif; font-size: 2.2rem; font-weight: 800; color: rgba(15,23,42,0.08); line-height: 1; flex-shrink: 0; }
.pm-name { font-family: 'Syne', sans-serif; font-size: 1.2rem; font-weight: 800; color: var(--text); letter-spacing: -0.02em; }
.pm-sub { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }
.pm-rating { margin-left: auto; flex-shrink: 0; font-size: 0.8rem; }
.pm-tags { display: flex; gap: 5px; flex-wrap: wrap; padding: 0 24px 10px; }

/* Action buttons */
.pm-actions { display: flex; gap: 8px; padding: 0 24px 14px; }
.pm-action-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 999px; padding: 6px 14px;
  font-size: 0.72rem; font-weight: 700; color: var(--text-2);
  cursor: pointer; transition: all 0.15s; text-decoration: none;
}
.pm-action-btn:hover { border-color: var(--primary); color: var(--primary); }

/* Heart / Favorites */
.c-heart {
  position: absolute; top: 10px; right: 12px; z-index: 2;
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(255,255,255,0.85); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 0.85rem; color: var(--muted);
  transition: all 0.2s; line-height: 1;
}
.c-heart:hover { background: #fff; color: #e11d48; border-color: #fda4af; transform: scale(1.1); }
.c-heart.hearted { color: #e11d48; background: #fff1f2; border-color: #fda4af; }

.pm-heart-btn.hearted { background: #fff1f2; border-color: #fda4af; color: #e11d48; }

.r-fav-btn {
  margin-left: 6px; background: var(--bg); border: 1px solid var(--border);
  border-radius: 999px; padding: 4px 12px; font-size: 0.72rem; font-weight: 700;
  color: var(--text-2); cursor: pointer; transition: all 0.15s; font-family: inherit;
  display: inline-flex; align-items: center; gap: 4px;
}
.r-fav-btn:hover { border-color: #e11d48; color: #e11d48; }
.r-fav-btn.has-favs { color: #e11d48; border-color: #fda4af; background: #fff1f2; }
.r-fav-btn.active { background: #e11d48; color: #fff; border-color: #e11d48; }

.card-fav-glow { box-shadow: 0 0 0 2px rgba(225,29,72,0.15) !important; }

.pm-body { overflow-y: auto; padding: 0 24px 24px; flex: 1; scrollbar-width: thin; }
.pm-section { margin-bottom: 14px; }
.pm-section-title {
  font-family: 'Syne', sans-serif; font-size: 0.75rem; font-weight: 800;
  color: var(--text); text-transform: uppercase; letter-spacing: 0.04em;
  margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--border);
  cursor: pointer; display: flex; align-items: center; justify-content: space-between;
}
.pm-section-title .collapse-arrow { font-size: 0.6rem; color: var(--muted); transition: transform 0.2s; }
.pm-section.collapsed .pm-section-content { display: none; }
.pm-section.collapsed .collapse-arrow { transform: rotate(-90deg); }

.pm-summary { font-size: 0.88rem; color: var(--text-2); line-height: 1.65; }
.pm-pricing { font-size: 0.85rem; color: var(--text-2); line-height: 1.6; }
.pm-items { display: flex; gap: 6px; flex-wrap: wrap; }
.pm-item-chip { background: var(--teal-dim); border: 1px solid var(--teal-ring); border-radius: 999px; padding: 4px 12px; font-size: 0.75rem; font-weight: 700; color: #047857; }
.pm-reviews { display: flex; flex-direction: column; gap: 10px; }
.pm-review { background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 12px 14px; font-size: 0.82rem; color: var(--text-2); line-height: 1.55; }
.pm-review-author { font-weight: 800; color: var(--text); font-size: 0.75rem; margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.pm-review-stars { color: #f59e0b; font-size: 0.7rem; }
.pm-youtube { display: flex; gap: 8px; flex-wrap: wrap; }
.pm-yt-link { display: inline-flex; align-items: center; gap: 6px; background: #fee2e2; border: 1px solid #fca5a5; border-radius: var(--r-sm); padding: 8px 14px; font-size: 0.78rem; font-weight: 700; color: #dc2626; text-decoration: none; transition: all 0.15s; }
.pm-yt-link:hover { background: #fecaca; transform: translateY(-1px); }
.pm-distance { font-size: 0.85rem; color: var(--text-2); line-height: 1.6; }

/* =========================================
   MOBILE
========================================= */
@media (max-width: 768px) {
  .r-topbar { left: 12px; right: 12px; transform: none; top: 12px; border-radius: var(--r-md); padding: 8px 12px; flex-wrap: wrap; justify-content: center; }
  .r-query { max-width: 120px; }
  .r-back { padding: 4px 10px; font-size: 0.68rem; }
  .map-detail { left: 12px; right: 12px; width: auto; bottom: auto; top: 140px; }
  .map-legend { right: 12px; bottom: auto; top: 180px; padding: 5px 10px; font-size: 0.6rem; }
  .bottom-panel { border-radius: 18px 18px 0 0; }
  .panel-top { padding: 8px 14px 6px; flex-wrap: wrap; }
  .card-feat { width: 280px; }
  .card-reg { width: 240px; }
  .place-modal { width: 95vw; max-height: 90vh; }
  .pm-top { padding: 16px 18px 10px; }
  .pm-body { padding: 0 18px 18px; }
  .pm-actions { padding: 0 18px 12px; flex-wrap: wrap; }
}
@media (max-width: 480px) {
  .r-topbar { top: 44px; }
  .r-sep { display: none; }
  .r-count { display: none; }
  .card-feat { width: 260px; }
  .card-reg { width: 220px; }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
  20%, 40%, 60%, 80% { transform: translateX(10px); }
}