/* ── Grub Finder — Tailwind base + custom overrides ──────────────────
   Warm, organic palette. Not sterile. Not uniform.
   Tailwind handles: layout, spacing, colors, typography, dark mode.
   This file handles: animations, pseudo-elements, complex selectors.
────────────────────────────────────────────────────────────────────── */

/* Scrollbar hide utility */
.scrollbar-hide::-webkit-scrollbar { display: none; }
.scrollbar-hide { scrollbar-width: none; }

/* ── Header grain texture ────────────────────────────────────────────── */
.header-grain {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  border-radius: inherit;
}

/* ── Mode tabs active state ──────────────────────────────────────────── */
.mode-tab.active {
  background: #292524 !important;
  color: white !important;
  border-color: #292524 !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
body.dark .mode-tab.active {
  background: #fafaf9 !important;
  color: #1c1917 !important;
  border-color: #fafaf9 !important;
}

/* Mode gradient accents on header */
body.mode-breakfast header { background: linear-gradient(135deg, #44403c 0%, #292524 100%); }
body.mode-coffee header { background: linear-gradient(135deg, #3b2f2f 0%, #1c1917 100%); }
body.mode-lunch header { background: linear-gradient(135deg, #292524 0%, #1c1917 100%); }
body.mode-dinner header { background: linear-gradient(135deg, #2c1a2e 0%, #1c1917 100%); }
body.mode-drinks header { background: linear-gradient(135deg, #1a2332 0%, #1c1917 100%); }

/* ── Mode transition ─────────────────────────────────────────────────── */
.results { transition: opacity 0.2s ease, transform 0.2s ease; }
.results.mode-fade { opacity: 0; transform: translateY(4px); }

/* ── Cards ────────────────────────────────────────────────────────────── */
.card {
  background: white;
  border-radius: 10px;
  padding: 14px 16px;
  border: 1px solid #e7e5e4;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  opacity: 0;
  transform: translateY(8px);
  animation: cardIn 0.3s ease forwards;
  border-left: 3px solid transparent;
}
@keyframes cardIn { to { opacity: 1; transform: none; } }
.card:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
.card:active { transform: scale(0.99); }
.card.top-match { border-left-color: #b87333; }
.card-disliked { opacity: 0.5; }
.card-highlight { outline: 2px solid #b87333; outline-offset: 1px; }
body.dark .card { background: #1c1917; border-color: #292524; }
body.dark .card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.2); }
body.dark .card.top-match { border-left-color: #d4943a; }

.card-main { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; width: 100%; }
.card-info { flex: 1; min-width: 0; }
.card-name { font-size: 0.9rem; font-weight: 700; margin-bottom: 2px; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; line-height: 1.3; }
.card-num { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; min-width: 18px; background: #44403c; color: white; border-radius: 4px; font-size: 0.6rem; font-weight: 700; }
body.dark .card-num { background: #a8a29e; color: #1c1917; }
.card-meta { font-size: 0.75rem; color: #78716c; margin-bottom: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-desc { font-size: 0.75rem; color: #78716c; margin-bottom: 4px; font-style: italic; }
.card-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.card-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex-shrink: 0; }
.card-distance { font-size: 0.8rem; font-weight: 700; color: #b87333; white-space: nowrap; }
body.dark .card-distance { color: #e8b86d; }

/* ── Tags ─────────────────────────────────────────────────────────────── */
.tag { background: #f5f5f4; color: #57534e; padding: 2px 7px; border-radius: 4px; font-size: 0.68rem; font-weight: 500; }
.tag-hours { background: #fef3c7; color: #92400e; }
.tag-hours-future { background: #ffedd5; color: #9a3412; }
.tag-hours-closing { background: #fef3c7; color: #92400e; font-weight: 600; }
.tag-hours-unknown { background: #f5f5f4; color: #a8a29e; }
.tag-closed { background: #fecaca; color: #991b1b; }
.tag-price { background: #ecfdf5; color: #065f46; }
.tag-revisit { background: #ffedd5; color: #9a3412; }
.tag-new-place { background: #ecfdf5; color: #065f46; }
body.dark .tag { background: #292524; color: #a8a29e; }
body.dark .tag-hours { background: #422006; color: #fcd34d; }
body.dark .tag-hours-future { background: #431407; color: #fb923c; }
body.dark .tag-hours-closing { background: #422006; color: #fcd34d; }
body.dark .tag-closed { background: #450a0a; color: #fca5a5; }
body.dark .tag-price { background: #064e3b; color: #6ee7b7; }

/* ── Badges — each one distinct, not cookie-cutter ───────────────────── */
.match-badge { font-size: 0.63rem; background: #fef3c7; color: #92400e; padding: 1px 6px; border-radius: 3px; font-weight: 700; }
.new-badge { font-size: 0.63rem; background: #ede9fe; color: #5b21b6; padding: 1px 6px; border-radius: 3px; font-weight: 600; }
.popular-badge { font-size: 0.63rem; background: #fee2e2; color: #991b1b; padding: 1px 6px; border-radius: 3px; font-weight: 600; }
.locals-badge { font-size: 0.63rem; background: #dcfce7; color: #166534; padding: 1px 6px; border-radius: 3px; font-weight: 600; }
.checkin-badge { font-size: 0.63rem; background: #f5f5f4; color: #57534e; padding: 1px 6px; border-radius: 3px; font-weight: 600; }
.visited-week-badge { font-size: 0.63rem; background: #ffedd5; color: #9a3412; padding: 1px 6px; border-radius: 3px; font-weight: 600; }
.perfect-badge { font-size: 0.63rem; background: linear-gradient(135deg, #fef3c7, #fde68a); color: #78350f; padding: 1px 7px; border-radius: 3px; font-weight: 700; }
body.dark .match-badge { background: #422006; color: #fcd34d; }
body.dark .new-badge { background: #2e1065; color: #c4b5fd; }
body.dark .popular-badge { background: #450a0a; color: #fca5a5; }
body.dark .locals-badge { background: #052e16; color: #86efac; }
body.dark .checkin-badge { background: #292524; color: #a8a29e; }
body.dark .visited-week-badge { background: #431407; color: #fdba74; }
body.dark .perfect-badge { background: linear-gradient(135deg, #422006, #78350f); color: #fcd34d; }

/* ── Vote buttons ────────────────────────────────────────────────────── */
.vote-btns { display: flex; gap: 4px; }
.vote-btn { width: 36px; height: 36px; padding: 0; border-radius: 50%; background: #f5f5f4; border: 1.5px solid transparent; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.15s; color: #a8a29e; }
.vote-btn:hover { background: #e7e5e4; color: #44403c; transform: scale(1.1); }
.vote-btn:active { transform: scale(0.9); }
.vote-btn.active-like { background: #fef2f2; border-color: #dc2626; color: #dc2626; }
.vote-btn.active-dislike { background: #fef2f2; border-color: #dc2626; color: #dc2626; }
.remove-btn:hover { background: #fef2f2; color: #dc2626; }
body.dark .vote-btn { background: #292524; color: #78716c; }
body.dark .vote-btn:hover { background: #44403c; color: #fafaf9; }
.mode-active { background: #292524 !important; border-color: #292524 !important; color: white !important; }

/* Vote micro-interactions */
@keyframes heartPop { 0% { transform: scale(1); } 30% { transform: scale(1.4); } 60% { transform: scale(0.9); } 100% { transform: scale(1); } }
@keyframes headShake { 0%,100% { transform: translateX(0); } 15% { transform: translateX(-3px) rotate(-2deg); } 30% { transform: translateX(3px) rotate(2deg); } 45% { transform: translateX(-2px); } }
.vote-pop { animation: heartPop 0.35s ease; }
.vote-shake { animation: headShake 0.4s ease; }

/* ── Map ──────────────────────────────────────────────────────────────── */
#map { display: none; }
#map.visible { display: block; }
.pin-user { width: 14px; height: 14px; background: #b87333; border: 3px solid white; border-radius: 50%; box-shadow: 0 0 0 3px rgba(184,115,51,0.2), 0 2px 6px rgba(184,115,51,0.4); }
.pin-user-pulse { position: absolute; inset: -10px; border-radius: 50%; background: rgba(184,115,51,0.1); animation: pulse 2.5s ease-out infinite; }
@keyframes pulse { 0% { transform: scale(0.4); opacity: 1; } 100% { transform: scale(2.5); opacity: 0; } }
.pin-place { width: 28px; height: 28px; background: #292524; color: white; border-radius: 50%; border: 2.5px solid white; display: flex; align-items: center; justify-content: center; font-size: 0.65rem; font-weight: 800; box-shadow: 0 2px 6px rgba(0,0,0,0.3); cursor: pointer; transition: transform 0.2s; }
.pin-place:hover { transform: scale(1.2); }
body.dark .pin-place { background: #b87333; }
.pin-tooltip { background: #292524; color: white; border: none; border-radius: 6px; padding: 4px 8px; font-size: 0.72rem; font-weight: 600; box-shadow: 0 3px 8px rgba(0,0,0,0.2); }
.pin-tooltip::before { border-top-color: #292524 !important; }

/* Map popup */
.popup-custom .leaflet-popup-content-wrapper { background: white; border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,0.12); padding: 0; border: none; }
.popup-custom .leaflet-popup-content { margin: 0; line-height: 1.4; }
.popup-custom .leaflet-popup-tip { background: white; }
.map-popup { padding: 10px 14px; display: flex; flex-direction: column; gap: 3px; }
.map-popup strong { font-size: 0.83rem; font-weight: 700; }
.map-popup-meta { font-size: 0.72rem; color: #78716c; }
.map-popup-nav { margin-top: 5px; padding: 5px 12px; background: #292524; color: white; border: none; border-radius: 6px; font-size: 0.75rem; font-weight: 700; cursor: pointer; align-self: flex-start; text-decoration: none; display: inline-block; }
.map-popup-nav:hover { background: #44403c; color: white; }
body.dark .popup-custom .leaflet-popup-content-wrapper { background: #1c1917; border: 1px solid #292524; }
body.dark .popup-custom .leaflet-popup-tip { background: #1c1917; }
body.dark .map-popup strong { color: #fafaf9; }
body.dark .map-popup-meta { color: #78716c; }
body.dark .map-popup-nav { background: #d4943a; }

/* ── Status & spinner ────────────────────────────────────────────────── */
.status { padding: 24px 16px; margin-bottom: 14px; font-size: 0.85rem; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.status.loading { background: none; }
.status.error { background: #fef2f2; color: #dc2626; border-radius: 10px; }
.status.hidden { display: none; }
.status-emoji { font-size: 2rem; animation: bounce 1s ease infinite; }
@keyframes bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.status-text { font-weight: 600; font-size: 0.88rem; }
.status-sub { font-size: 0.78rem; opacity: 0.7; }
.spinner { width: 15px; height: 15px; border: 2px solid rgba(184,115,51,0.2); border-top-color: #b87333; border-radius: 50%; animation: spin 0.7s linear infinite; }
.btn-spinner { display: inline-block; width: 15px; height: 15px; border: 2px solid rgba(255,255,255,0.3); border-top-color: white; border-radius: 50%; animation: spin 0.7s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Navigation & links ──────────────────────────────────────────────── */
.map-link { font-size: 0.75rem; color: #b87333; text-decoration: none; font-weight: 500; }
.map-link:hover { text-decoration: underline; }
body.dark .map-link { color: #e8b86d; }
.nav-btn-main { margin-top: 5px; padding: 5px 12px; background: #292524; color: white; border: none; border-radius: 6px; font-size: 0.75rem; font-weight: 700; cursor: pointer; }
.nav-btn-main:hover { background: #44403c; }
body.dark .nav-btn-main { background: #d4943a; color: #1c1917; }
.results-count { color: #a8a29e; font-size: 0.76rem; margin-bottom: 2px; }

/* ── Panels (prefs, history, review) ─────────────────────────────────── */
.prefs-panel, .photo-panel { background: white; border-radius: 10px; padding: 14px; margin-bottom: 14px; border: 1px solid #e7e5e4; animation: panelIn 0.2s ease; }
body.dark .prefs-panel, body.dark .photo-panel { background: #1c1917; border-color: #292524; }
@keyframes panelIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.prefs-header { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 0.9rem; margin-bottom: 10px; }
.prefs-close { background: none; border: none; font-size: 1rem; cursor: pointer; color: #a8a29e; padding: 0; width: auto; height: auto; }
.prefs-close:hover { color: #44403c; }
.prefs-section { margin-bottom: 10px; }
.prefs-section-title { font-size: 0.67rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #a8a29e; margin-bottom: 5px; }
.prefs-item { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; border-bottom: 1px solid #f5f5f4; font-size: 0.82rem; }
body.dark .prefs-item { border-bottom-color: #292524; }
.prefs-liked { color: #dc2626; }
.prefs-disliked { color: #a8a29e; }
.prefs-cuisine { font-size: 0.7rem; background: #f5f5f4; color: #57534e; padding: 2px 7px; border-radius: 4px; }
.prefs-score { font-size: 0.75rem; font-weight: 700; padding: 2px 7px; border-radius: 4px; }
.score-pos { background: #fef3c7; color: #92400e; }
.score-neg { background: #fecaca; color: #991b1b; }
body.dark .score-pos { background: #422006; color: #fcd34d; }
body.dark .score-neg { background: #450a0a; color: #fca5a5; }
.prefs-empty { font-size: 0.82rem; color: #a8a29e; text-align: center; padding: 10px 0; }
.prefs-clear { width: 100%; margin-top: 5px; padding: 6px; background: none; border: 1px solid #e7e5e4; border-radius: 6px; font-size: 0.76rem; color: #a8a29e; cursor: pointer; }
.prefs-clear:hover { border-color: #b87333; color: #b87333; }

/* ── Banners ─────────────────────────────────────────────────────────── */
.weather-banner { background: #fef3c7; color: #92400e; padding: 8px 12px; border-radius: 8px; font-size: 0.8rem; font-weight: 600; margin-bottom: 8px; border-left: 3px solid #f59e0b; }
.rain-eta-banner { background: #e0f2fe; color: #0c4a6e; padding: 8px 12px; border-radius: 8px; font-size: 0.8rem; font-weight: 600; margin-bottom: 8px; border-left: 3px solid #0ea5e9; }
.streak-banner { background: #ecfdf5; color: #065f46; padding: 8px 12px; border-radius: 8px; font-size: 0.8rem; font-weight: 600; margin-bottom: 8px; border-left: 3px solid #10b981; }
.nudge-banner { background: #ede9fe; color: #5b21b6; padding: 8px 12px; border-radius: 8px; font-size: 0.8rem; font-weight: 600; margin-bottom: 8px; border-left: 3px solid #8b5cf6; }
.fatigue-banner { background: #ffedd5; color: #9a3412; padding: 8px 12px; border-radius: 8px; font-size: 0.8rem; font-weight: 600; margin-bottom: 8px; border-left: 3px solid #f97316; }
body.dark .weather-banner { background: #422006; color: #fcd34d; border-left-color: #f59e0b; }
body.dark .rain-eta-banner { background: #0c4a6e; color: #7dd3fc; border-left-color: #38bdf8; }
body.dark .streak-banner { background: #052e16; color: #86efac; border-left-color: #34d399; }
body.dark .nudge-banner { background: #2e1065; color: #c4b5fd; border-left-color: #a78bfa; }
body.dark .fatigue-banner { background: #431407; color: #fdba74; border-left-color: #fb923c; }
.weather-cozy { border-left-color: #f59e0b !important; }

/* ── Skeleton ────────────────────────────────────────────────────────── */
.skeleton-list { display: flex; flex-direction: column; gap: 8px; }
.skeleton-card { background: white; border-radius: 10px; padding: 14px; border: 1px solid #e7e5e4; display: flex; justify-content: space-between; gap: 12px; }
body.dark .skeleton-card { background: #1c1917; border-color: #292524; }
.skeleton-body { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.skeleton-line { height: 10px; border-radius: 4px; background: linear-gradient(90deg, #f5f5f4 25%, #e7e5e4 50%, #f5f5f4 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
.skeleton-line.short { width: 55%; }
.skeleton-line.xshort { width: 35%; }
.skeleton-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.skeleton-circle { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(90deg, #f5f5f4 25%, #e7e5e4 50%, #f5f5f4 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
body.dark .skeleton-line, body.dark .skeleton-circle { background: linear-gradient(90deg, #292524 25%, #44403c 50%, #292524 75%); background-size: 200% 100%; }

/* ── Slot machine overlay ────────────────────────────────────────────── */
.slot-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; z-index: 2000; opacity: 0; transition: opacity 0.2s; }
.slot-overlay.visible { opacity: 1; }
.slot-box { background: white; border-radius: 16px; padding: 32px 28px; text-align: center; min-width: 200px; }
body.dark .slot-box { background: #1c1917; }
.slot-emoji { font-size: 2.5rem; margin-bottom: 12px; }
.slot-name { font-size: 1rem; font-weight: 700; color: #292524; min-height: 1.4em; }
body.dark .slot-name { color: #fafaf9; }
.pick-pulse-ring { width: 60px; height: 60px; border-radius: 50%; border: 3px solid #b87333; background: rgba(184,115,51,0.12); animation: pickRing 1s ease-in-out infinite; }
@keyframes pickRing { 0%,100% { transform: scale(0.8); opacity: 1; } 50% { transform: scale(1.3); opacity: 0.4; } }

/* ── Photo & upload ──────────────────────────────────────────────────── */
.card-thumb { width: 48px; height: 48px; border-radius: 6px; object-fit: cover; flex-shrink: 0; background: #f5f5f4; }
body.dark .card-thumb { background: #292524; }
.upload-strip { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.upload-wrap { position: relative; }
.upload-thumb { width: 56px; height: 56px; border-radius: 6px; object-fit: cover; cursor: zoom-in; }
.upload-del { position: absolute; top: -4px; right: -4px; width: 18px; height: 18px; background: #dc2626; color: white; border: none; border-radius: 50%; font-size: 0.7rem; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.upload-btn { padding: 6px 12px; background: #f5f5f4; border: 1.5px dashed #d6d3d1; border-radius: 6px; font-size: 0.76rem; color: #78716c; cursor: pointer; }
.upload-btn:hover { border-color: #b87333; color: #b87333; }
body.dark .upload-btn { background: #292524; border-color: #44403c; color: #a8a29e; }

/* ── Review detail panel ─────────────────────────────────────────────── */
.review-section { font-size: 0.82rem; }
.review-detail { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px solid #f5f5f4; }
body.dark .review-detail { border-bottom-color: #292524; }
.review-label { color: #78716c; font-size: 0.75rem; }
.review-value { font-size: 0.75rem; }
.review-value a { color: #b87333; }
body.dark .review-value a { color: #e8b86d; }
.review-links { display: flex; gap: 6px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.review-links-label { font-size: 0.72rem; color: #a8a29e; }
.review-link { padding: 4px 10px; border-radius: 4px; font-size: 0.72rem; font-weight: 600; border: none; cursor: pointer; text-decoration: none; }
.google-link { background: #f5f5f4; color: #44403c; }
.ta-link { background: #ecfdf5; color: #065f46; }
.ig-link { background: #fce7f3; color: #9d174d; }
body.dark .google-link { background: #292524; color: #d6d3d1; }
body.dark .ta-link { background: #052e16; color: #86efac; }
body.dark .ig-link { background: #4a0728; color: #f9a8d4; }
.user-rating { font-size: 0.8rem; margin-bottom: 6px; }
.osm-rating { font-size: 0.82rem; color: #b87333; margin-bottom: 6px; }
.osm-rating span { font-size: 0.72rem; color: #78716c; margin-left: 4px; }

/* ── Check-in ────────────────────────────────────────────────────────── */
.checkin-section { margin-top: 10px; padding-top: 8px; border-top: 1px solid #f5f5f4; }
body.dark .checkin-section { border-top-color: #292524; }
.checkin-section-title { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: #a8a29e; margin-bottom: 6px; }
.checkin-actions { display: flex; gap: 6px; align-items: center; }
.checkin-btn { padding: 6px 14px; background: #292524; color: white; border: none; border-radius: 6px; font-size: 0.78rem; font-weight: 700; cursor: pointer; }
body.dark .checkin-btn { background: #d4943a; color: #1c1917; }
.checkin-photo-btn { padding: 6px 10px; background: #f5f5f4; border: 1.5px solid #e7e5e4; border-radius: 6px; font-size: 0.82rem; cursor: pointer; }
body.dark .checkin-photo-btn { background: #292524; border-color: #44403c; }
.checkin-history { margin-bottom: 8px; }
.checkin-entry { display: flex; align-items: center; gap: 6px; padding: 3px 0; font-size: 0.76rem; color: #57534e; }
body.dark .checkin-entry { color: #a8a29e; }
.checkin-icon { background: #fef3c7; color: #b87333; width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.6rem; font-weight: 700; }
body.dark .checkin-icon { background: #422006; color: #e8b86d; }
.checkin-thumb { width: 32px; height: 32px; border-radius: 4px; object-fit: cover; cursor: zoom-in; }
.checkin-more { font-size: 0.72rem; color: #a8a29e; padding-left: 24px; }
.history-place-name { font-size: 0.86rem; font-weight: 600; display: flex; align-items: center; gap: 5px; margin-bottom: 3px; }
.history-visit { display: flex; align-items: center; gap: 6px; padding: 2px 0 2px 20px; font-size: 0.76rem; color: #78716c; }
.history-thumb { width: 32px; height: 32px; border-radius: 4px; object-fit: cover; cursor: zoom-in; }

/* ── Map detail panel ────────────────────────────────────────────────── */
.map-detail { position: fixed; bottom: 0; left: 0; right: 0; max-height: 70vh; overflow-y: auto; background: white; border-radius: 16px 16px 0 0; padding: 16px 20px 24px; box-shadow: 0 -4px 24px rgba(0,0,0,0.12); z-index: 1500; transform: translateY(100%); transition: transform 0.25s ease; }
.map-detail.visible { transform: translateY(0); }
body.dark .map-detail { background: #1c1917; }
.map-detail-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.3); z-index: 1499; opacity: 0; transition: opacity 0.2s; }
.map-detail-backdrop.visible { opacity: 1; }
.map-detail-handle { width: 36px; height: 4px; background: #d6d3d1; border-radius: 2px; margin: 0 auto 12px; }
body.dark .map-detail-handle { background: #44403c; }
.map-detail-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.map-detail-name { font-size: 1rem; font-weight: 800; }
.map-detail-meta { font-size: 0.76rem; color: #78716c; margin-top: 2px; }
.map-detail-desc { font-size: 0.78rem; color: #78716c; font-style: italic; margin-bottom: 6px; }
.map-detail-close { width: 28px; height: 28px; border-radius: 50%; background: #f5f5f4; border: none; cursor: pointer; font-size: 0.8rem; display: flex; align-items: center; justify-content: center; color: #78716c; }
.map-detail-close:hover { background: #e7e5e4; }
body.dark .map-detail-close { background: #292524; color: #a8a29e; }
.map-detail-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; align-items: center; }
.busyness-tag { font-size: 0.72rem; color: #78716c; margin-top: 2px; }

/* ── Swipe feedback ──────────────────────────────────────────────────── */
.card-swipe-right { background: rgba(16,185,129,0.06) !important; }
.card-swipe-left { background: rgba(220,38,38,0.06) !important; }
.swipe-hint { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(184,115,51,0.06); border-radius: 10px; font-size: 0.8rem; font-weight: 600; color: #b87333; animation: swipeHintAnim 1.5s ease infinite; pointer-events: none; z-index: 5; }
@keyframes swipeHintAnim { 0%,100% { transform: translateX(0); } 25% { transform: translateX(6px); } 75% { transform: translateX(-6px); } }

/* ── Notes ────────────────────────────────────────────────────────────── */
.card-note-preview { font-size: 0.72rem; color: #78716c; font-style: italic; margin-bottom: 3px; }
.notes-section { margin-top: 8px; padding-top: 8px; border-top: 1px solid #f5f5f4; }
body.dark .notes-section { border-top-color: #292524; }
.note-input { width: 100%; padding: 6px 10px; border: 1.5px solid #e7e5e4; border-radius: 6px; font-size: 0.76rem; resize: none; height: 44px; font-family: inherit; }
body.dark .note-input { background: #292524; border-color: #44403c; color: #fafaf9; }

/* ── Toast ────────────────────────────────────────────────────────────── */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #292524; color: white; padding: 10px 18px; border-radius: 8px; font-size: 0.82rem; font-weight: 600; z-index: 3000; box-shadow: 0 4px 16px rgba(0,0,0,0.2); animation: toastIn 0.2s ease; }
body.dark .toast { background: #fafaf9; color: #1c1917; }
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(8px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* ── Weather-responsive background ───────────────────────────────────── */
body.weather-sunny { background: #fffbf5; }
body.weather-cloudy { background: #fafaf9; }
body.weather-rainy { background: #f8fafc; }
body.dark.weather-sunny, body.dark.weather-cloudy, body.dark.weather-rainy { background: #0c0a09; }

/* ── "Why this?" breakdown ───────────────────────────────────────────── */
.why-this { padding: 10px 12px; background: #fafaf9; border-radius: 8px; margin-bottom: 10px; border: 1px solid #e7e5e4; }
.why-title { font-size: 0.73rem; font-weight: 700; color: #57534e; margin-bottom: 5px; }
.why-factors { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 5px; }
.why-factor { font-size: 0.66rem; padding: 2px 6px; border-radius: 3px; font-weight: 600; white-space: nowrap; }
.why-pos { background: #ecfdf5; color: #065f46; }
.why-neg { background: #fef2f2; color: #991b1b; }
.why-total { font-size: 0.68rem; font-weight: 700; color: #78716c; }
body.dark .why-this { background: #292524; border-color: #44403c; }
body.dark .why-title { color: #a8a29e; }
body.dark .why-pos { background: #052e16; color: #86efac; }
body.dark .why-neg { background: #450a0a; color: #fca5a5; }
body.dark .why-total { color: #78716c; }

/* ── Explore button ──────────────────────────────────────────────────── */
.explore-btn { width: 100%; padding: 10px; background: white; border: 1.5px dashed #d6d3d1; border-radius: 8px; font-size: 0.8rem; font-weight: 600; color: #78716c; cursor: pointer; margin-top: 8px; }
.explore-btn:hover { border-color: #b87333; color: #b87333; }
body.dark .explore-btn { background: #1c1917; border-color: #44403c; color: #a8a29e; }
body.dark .explore-btn:hover { border-color: #d4943a; color: #d4943a; }
.explore-radius { background: #fef3c7; color: #92400e; padding: 1px 6px; border-radius: 3px; font-size: 0.72rem; margin-left: 4px; }
body.dark .explore-radius { background: #422006; color: #fcd34d; }

/* ── Empty state ─────────────────────────────────────────────────────── */
.empty { text-align: center; padding: 48px 20px; }
.empty-icon { font-size: 2rem; margin-bottom: 8px; }
.empty-icon.bounce { animation: emptyBounce 1.5s ease infinite; }
@keyframes emptyBounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.empty-title { font-size: 0.92rem; font-weight: 600; color: #78716c; margin-bottom: 3px; }
.empty-hint { font-size: 0.8rem; color: #a8a29e; line-height: 1.5; }

/* ── Onboarding ──────────────────────────────────────────────────────── */
.onboarding-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; z-index: 3000; }
.onboarding-card { background: white; border-radius: 14px; padding: 28px 24px; max-width: 280px; text-align: center; box-shadow: 0 16px 48px rgba(0,0,0,0.25); }
body.dark .onboarding-card { background: #1c1917; color: #fafaf9; }
.onboarding-card h2 { font-size: 1.05rem; margin-bottom: 10px; }
.onboarding-card p { font-size: 0.85rem; margin-bottom: 6px; color: #57534e; }
body.dark .onboarding-card p { color: #a8a29e; }
.onboarding-card button { margin-top: 10px; padding: 10px 22px; background: #292524; color: white; border: none; border-radius: 8px; font-size: 0.85rem; font-weight: 700; cursor: pointer; }
.onboarding-dots { font-size: 0.72rem; color: #a8a29e; margin-top: 6px; }

/* ── Vote confirm modal ──────────────────────────────────────────────── */
.vote-confirm { background: white; border-radius: 14px; padding: 28px 24px; text-align: center; max-width: 280px; width: 85%; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 1001; box-shadow: 0 16px 48px rgba(0,0,0,0.2); }
body.dark .vote-confirm { background: #1c1917; }
.vote-confirm-emoji { font-size: 2rem; margin-bottom: 12px; }
.vote-confirm-title { font-size: 0.95rem; font-weight: 800; margin-bottom: 5px; }
.vote-confirm-text { font-size: 0.78rem; color: #a8a29e; line-height: 1.5; margin-bottom: 20px; }
.vote-confirm-btns { display: flex; flex-direction: column; gap: 6px; }
.vote-confirm-go { width: 100%; padding: 11px; border: none; border-radius: 8px; background: #292524; color: white; font-size: 0.85rem; font-weight: 700; cursor: pointer; }
body.dark .vote-confirm-go { background: #d4943a; color: #1c1917; }
.vote-confirm-cancel { width: 100%; padding: 9px; border: none; border-radius: 8px; background: none; font-size: 0.8rem; font-weight: 600; cursor: pointer; color: #a8a29e; }

/* ── Lightbox ────────────────────────────────────────────────────────── */
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,0.9); display: flex; align-items: center; justify-content: center; z-index: 4000; cursor: zoom-out; }
.lightbox img { max-width: 90vw; max-height: 85vh; border-radius: 8px; object-fit: contain; }

/* ── Tooltip ─────────────────────────────────────────────────────────── */
[data-tooltip] { position: relative; }
[data-tooltip]::after { content: attr(data-tooltip); position: absolute; bottom: calc(100% + 5px); right: 0; background: #292524; color: white; font-size: 0.68rem; padding: 4px 8px; border-radius: 4px; white-space: nowrap; pointer-events: none; opacity: 0; transform: translateY(2px); transition: opacity 0.12s, transform 0.12s; z-index: 100; }
[data-tooltip]:hover::after { opacity: 1; transform: translateY(0); }

/* ── My location button (map) ────────────────────────────────────────── */
.my-location-btn a { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; font-size: 0.9rem; text-decoration: none; cursor: pointer; }

/* ── Missing utility classes ─────────────────────────────────────────── */
.auth-avatar { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,0.4); }
.checkin-date { flex: 1; }
.history-date { flex: 1; }
.upload-label { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: #a8a29e; margin-bottom: 6px; }
.upload-section { margin-top: 10px; }
.vote-count { color: #b87333; font-weight: 700; }
body.dark .vote-count { color: #e8b86d; }

/* ── Add hours link ──────────────────────────────────────────────────── */
.add-hours-link { font-size: 0.65rem; color: #b87333; text-decoration: none; font-weight: 600; margin-left: 4px; }
.add-hours-link:hover { text-decoration: underline; }
body.dark .add-hours-link { color: #e8b86d; }

/* ── Photo report button ─────────────────────────────────────────────── */
.upload-report { position: absolute; bottom: -4px; right: -4px; width: 18px; height: 18px; background: #f59e0b; color: white; border: none; border-radius: 50%; font-size: 0.6rem; cursor: pointer; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.15s; }
.upload-wrap:hover .upload-report { opacity: 1; }
