/* Fonter lastes via /vendor/fonts.css (selvhostet, font-display: swap) */

:root {
  --wool: #FAF5E9;
  --wool-dark: #EDE4D0;
  --pasture: #2D5A27;
  --pasture-light: #3D7A35;
  --amber: #D4881C;
  --amber-light: #F0A830;
  --bark: #5C3A1E;
  --blush: #E8685A;
  --foam: #FEFEFA;
  --night: #1A1D17;
  --shadow: rgba(44, 30, 15, 0.12);
  --shadow-lg: rgba(44, 30, 15, 0.18);
  --radius: 12px;
  --radius-lg: 20px;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.25, 0.1, 0.25, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Nunito', sans-serif;
  background: var(--wool);
  color: var(--night);
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ---- Noise texture overlay ---- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  background-size: 256px;
  pointer-events: none;
  z-index: 9999;
}

/* ---- Header ---- */
header {
  background: linear-gradient(135deg, var(--pasture) 0%, var(--pasture-light) 100%);
  color: var(--foam);
  padding: 0;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  z-index: 100;
  box-shadow: 0 4px 20px var(--shadow);
  animation: headerReveal 0.6s var(--ease-out-expo) both;
}

@keyframes headerReveal {
  from {
    opacity: 0;
    transform: translateY(-100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg,
    var(--amber) 0%,
    var(--amber-light) 30%,
    #FFC940 50%,
    var(--amber-light) 70%,
    var(--amber) 100%);
  background-size: 300% 100%;
  animation: shimmerBar 2.5s ease-in-out infinite;
}

@keyframes shimmerBar {
  0%   { background-position: 100% 50%; }
  50%  { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

.header-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1.25rem;
  flex: 1;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.header-title-group {
  display: flex;
  align-items: baseline;
  gap: 1.1rem;
  flex-wrap: nowrap;
  min-width: 0;
}

.header-sheep {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  animation: sheepBob 3s ease-in-out infinite;
  transform-origin: center bottom;
}

@keyframes sheepBob {
  0%   { transform: translateY(0) rotate(0deg); }
  20%  { transform: translateY(-2px) rotate(-1.5deg); }
  40%  { transform: translateY(-3px) rotate(0deg); }
  50%  { transform: translateY(-4px) rotate(0deg); }
  60%  { transform: translateY(-3px) rotate(0deg); }
  80%  { transform: translateY(-2px) rotate(1.5deg); }
  100% { transform: translateY(0) rotate(0deg); }
}

@media (prefers-reduced-motion: reduce) {
  .header-sheep { animation: none; }
}

.header-title {
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: 1.6rem;
  letter-spacing: -0.5px;
  line-height: 1;
  flex-shrink: 0;
}

.header-subtitle {
  font-family: 'Nunito', sans-serif;
  font-weight: 600;
  font-size: 0.7rem;
  opacity: 0.72;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-stats {
  font-size: 0.75rem;
  opacity: 0.7;
  font-weight: 600;
  transition: opacity 0.4s ease;
}

.header-alias-btn {
  background: rgba(255, 255, 255, 0.18);
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  width: 38px;
  height: 38px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: auto;
  transition: background 0.2s ease, transform 0.2s var(--ease-spring);
  position: relative;
}

.profile-rank-icon {
  font-size: 20px;
  line-height: 1;
}

@media (hover: hover) {
  .header-alias-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.08);
  }
}

.header-alias-btn:active {
  transform: scale(0.94);
}

.header-alias-btn.active {
  border-color: var(--amber-light);
}

/* ---- App layout ---- */
#app {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ---- Map ---- */
#map {
  flex: 1;
  position: relative;
  animation: mapFadeIn 0.8s var(--ease-out-expo) 0.2s both;
}

@keyframes mapFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Kill default blue link color everywhere */
a { color: inherit; }

/* Leaflet attribution links */
.leaflet-control-attribution a {
  color: #888 !important;
}

/* Custom Leaflet controls */
.leaflet-control-zoom a {
  font-family: 'Fredoka', sans-serif !important;
  border-radius: var(--radius) !important;
  width: 36px !important;
  height: 36px !important;
  line-height: 36px !important;
  font-size: 1.1rem !important;
  border: none !important;
  box-shadow: 0 2px 8px var(--shadow) !important;
  background: var(--foam) !important;
  color: var(--pasture) !important;
  transition: transform 0.15s var(--ease-spring), box-shadow 0.15s ease !important;
}

.leaflet-control-zoom a:hover {
  transform: scale(1.08) !important;
  box-shadow: 0 4px 12px var(--shadow-lg) !important;
}

.leaflet-control-zoom {
  border: none !important;
  box-shadow: none !important;
  gap: 4px;
  display: flex;
  flex-direction: column;
}

/* ---- Price markers ---- */
.beer-dot-wrapper {
  background: transparent !important;
  border: none !important;
}

.beer-dot {
  position: relative;
  cursor: pointer;
  transition: transform 0.25s var(--ease-spring), filter 0.25s ease;
  /* No infinite idle animation here — 400 breathing pills cost real
     battery/jank on phones. Deals keep their pulse below. */
  animation: dotDrop 0.4s var(--ease-spring) backwards;
  transform-origin: center center;
  display: inline-flex;
}

.beer-dot.selected {
  transform: scale(1.3);
  filter: brightness(1.08);
  z-index: 1000 !important;
}

.beer-dot.selected .price-pill {
  box-shadow:
    0 3px 10px rgba(0, 0, 0, 0.3),
    0 0 0 2.5px var(--foam),
    0 0 0 4px var(--pasture);
}

/* The card already shows the price — don't leave a stuck hover tooltip */
.beer-dot.selected .beer-dot-tooltip {
  opacity: 0 !important;
}

.beer-dot:hover {
  transform: scale(1.35);
  z-index: 1000 !important;
  filter: brightness(1.08);
}

.beer-dot:hover .beer-dot-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* Price pill badge */
.price-pill {
  min-width: 30px;
  height: 22px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: 0.76rem;
  letter-spacing: -0.01em;
  box-shadow:
    0 2px 5px rgba(0,0,0,0.22),
    0 0 0 1.5px rgba(255,255,255,0.5);
  user-select: none;
  white-space: nowrap;
}

.beer-dot.fav .price-pill {
  box-shadow:
    0 2px 5px rgba(0,0,0,0.22),
    0 0 0 2px rgba(240, 168, 48, 0.8);
}

.beer-dot.deal {
  animation: dotDrop 0.4s var(--ease-spring) backwards, dealPulse 2.4s ease-in-out infinite 0.5s;
}

.price-pill-deal {
  box-shadow:
    0 2px 5px rgba(0,0,0,0.22),
    0 0 0 1.5px rgba(255,255,255,0.5),
    0 0 12px rgba(218, 165, 32, 0.6);
}

@keyframes dealPulse {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50%       { transform: scale(1.1); filter: brightness(1.12); }
}

.beer-dot-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--foam);
  color: var(--night);
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 8px;
  white-space: nowrap;
  box-shadow: 0 2px 10px var(--shadow-lg);
  border: 1px solid rgba(237, 228, 208, 0.95);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s var(--ease-spring);
  z-index: 1001;
}

.beer-dot-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: var(--foam);
}

@keyframes dotDrop {
  from {
    opacity: 0;
    transform: translateY(-12px) scale(0.5);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ---- Custom popups ---- */
.leaflet-popup-content-wrapper {
  border-radius: var(--radius-lg) !important;
  box-shadow: 0 12px 40px var(--shadow-lg) !important;
  padding: 0 !important;
  overflow: hidden;
  border: none !important;
  animation: popupReveal 0.35s var(--ease-spring);
}

@keyframes popupReveal {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.leaflet-popup-content {
  margin: 0 !important;
  min-width: 196px;
  max-height: min(52vh, 420px);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--wool-dark) transparent;
}

.leaflet-popup-tip {
  box-shadow: 0 4px 10px var(--shadow) !important;
}

.popup-inner {
  padding: 10px 12px 10px;
}

.popup-venue-name {
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: 0.94rem;
  line-height: 1.1;
  color: var(--night);
  margin-bottom: 0.1rem;
  /* Keep clear of the popup close button */
  padding-right: 22px;
}

.popup-address {
  font-size: 0.67rem;
  line-height: 1.3;
  color: #888;
  margin-bottom: 0.38rem;
}

.popup-price-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.08rem;
  margin-bottom: 0.5rem;
}

.popup-price-badge {
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: 2.2rem;
  line-height: 1;
  /* color set via inline style from spectrumColor() */
  animation: priceReveal 0.5s var(--ease-spring) 0.1s both;
}

@keyframes priceReveal {
  from { opacity: 0; transform: scale(0.7) translateY(4px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Shimmer sweep on the price badge */
.popup-price-badge {
  position: relative;
  overflow: hidden;
}

.popup-price-badge::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
  animation: badgeShimmer 3.5s ease-in-out infinite 1s;
  pointer-events: none;
}

@keyframes badgeShimmer {
  0%, 70%, 100% { left: -100%; }
  40%            { left: 150%; }
}

.popup-price-row {
  position: relative;
}

.popup-price-label {
  font-size: 0.63rem;
  color: #9b9b9b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.popup-normalized {
  font-size: 0.6rem;
  color: var(--amber);
  font-weight: 600;
  width: auto;
  margin-top: 0;
}

.popup-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 6px;
}

.popup-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.42rem 0.5rem;
  min-height: 38px;
  border-radius: 11px;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.69rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s var(--ease-spring), box-shadow 0.2s ease;
  border: none;
}

.popup-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 3px 10px var(--shadow);
}

.popup-btn:active {
  transform: translateY(0) scale(0.97);
}

.popup-btn-directions,
.popup-btn-directions:link,
.popup-btn-directions:visited,
.popup-btn-directions:hover,
.popup-btn-directions:active {
  background: var(--pasture);
  color: var(--foam) !important;
  text-decoration: none;
  flex: 0;
  min-width: 36px;
  padding: 0.42rem;
}

.popup-btn-report {
  background: var(--amber);
  color: var(--foam);
  font-size: 0.71rem;
}

.popup-btn-fav {
  background: var(--wool);
  color: var(--blush);
  font-size: 0.95rem;
  padding: 0.42rem;
  flex: 0;
  min-width: 36px;
  transition: transform 0.2s var(--ease-spring), background 0.2s ease, color 0.2s ease;
}

.popup-btn-fav:hover {
  transform: scale(1.15);
}

.popup-btn-fav.active {
  background: var(--blush);
  color: white;
  animation: popFav 0.4s var(--ease-spring);
}

.popup-btn-directions,
.popup-btn-fav {
  width: 36px;
  height: 36px;
  min-width: 36px;
  padding: 0;
}

@keyframes popFav {
  0% { transform: scale(1); }
  30% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* Reports in popup */
.popup-reports {
  margin-top: 0.48rem;
  padding-top: 0.48rem;
  border-top: 1px solid var(--wool-dark);
}

.popup-reports-title {
  font-size: 0.58rem;
  font-weight: 700;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.2rem;
}

.popup-report-item {
  font-size: 0.67rem;
  color: #666;
  padding: 0.08rem 0;
  display: flex;
  justify-content: space-between;
}

.popup-report-price {
  font-weight: 700;
  color: var(--pasture);
}

.popup-report-name {
  color: #999;
}

.popup-report-rank {
  font-size: 0.7rem;
  opacity: 0.7;
}

/* ---- Atmosphere in popup ---- */
.popup-atmo {
  margin-top: 0.48rem;
  padding-top: 0.48rem;
  border-top: 1px solid var(--wool-dark);
}

/* Gauges */
.atmo-gauges {
  display: flex;
  gap: 0.42rem;
  margin-bottom: 0.38rem;
}

.atmo-gauge {
  flex: 1;
}

.atmo-gauge-header {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 0.14rem;
}

.atmo-gauge-icon {
  font-size: 0.65rem;
}

.atmo-gauge-title {
  font-family: 'Fredoka', sans-serif;
  font-size: 0.58rem;
  font-weight: 600;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.atmo-gauge-track {
  height: 5px;
  background: var(--wool-dark);
  border-radius: 3px;
  overflow: hidden;
}

.atmo-gauge-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.atmo-gauge-status {
  font-family: 'Fredoka', sans-serif;
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--night);
  margin-top: 0.1rem;
}

.atmo-gauge-status.no-data {
  color: #bbb;
  font-weight: 400;
}

/* Traffic chart */
.traffic-chart-wrap {
  margin: 0.4rem 0 0.15rem;
  animation: chartSlideIn 0.35s var(--ease-out-expo) both;
}

@keyframes chartSlideIn {
  from { opacity: 0; max-height: 0; transform: translateY(-6px); }
  to { opacity: 1; max-height: 200px; transform: translateY(0); }
}

.traffic-chart-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.25rem;
}

.traffic-chart-title {
  font-family: 'Fredoka', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--pasture);
  text-transform: capitalize;
}

.traffic-chart-hint {
  font-size: 0.55rem;
  color: #bbb;
  font-style: italic;
}

.traffic-chart {
  background: var(--foam);
  border: 1px solid var(--wool-dark);
  border-radius: var(--radius);
  padding: 0.26rem;
  box-shadow: inset 0 1px 3px rgba(44, 30, 15, 0.06);
}

.traffic-chart-svg {
  width: 100%;
  height: auto;
  display: block;
}

.traffic-chart-loading {
  text-align: center;
  padding: 0.75rem;
  font-size: 0.7rem;
  color: #bbb;
  font-style: italic;
}

.atmo-gauge[style*="cursor"] .atmo-gauge-status::after {
  content: " ▾";
  font-size: 0.6rem;
  opacity: 0.4;
}

/* Expandable reporting */
.atmo-report-panel {
  margin-top: 0.38rem;
  border-top: 1px solid var(--wool-dark);
  padding-top: 0.38rem;
}

.atmo-report-toggle {
  width: 100%;
  border: 1px solid var(--wool-dark);
  background: var(--foam);
  border-radius: 12px;
  padding: 0.44rem 0.58rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s var(--ease-spring), box-shadow 0.2s ease;
}

.atmo-report-toggle:hover {
  border-color: var(--pasture);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(44, 30, 15, 0.08);
}

.atmo-report-toggle-copy {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.atmo-report-toggle-title {
  font-family: 'Fredoka', sans-serif;
  font-size: 0.67rem;
  color: var(--pasture);
  font-weight: 600;
}

.atmo-report-toggle-subtitle {
  font-size: 0.58rem;
  color: #888;
}

.atmo-report-toggle-chevron {
  font-size: 0.9rem;
  color: #999;
  transition: transform 0.2s var(--ease-spring);
}

.atmo-report-panel.expanded .atmo-report-toggle-chevron {
  transform: rotate(180deg);
}

.atmo-report-content {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(-4px);
  transition: max-height 0.28s var(--ease-out-expo), opacity 0.2s ease, transform 0.2s ease;
}

.atmo-report-panel.expanded .atmo-report-content {
  max-height: 400px;
  overflow-y: auto;
  opacity: 1;
  transform: translateY(0);
  margin-top: 0.3rem;
}

.atmo-report-section {
  margin-bottom: 0.35rem;
}

.atmo-question {
  font-size: 0.62rem;
  color: #888;
  margin-bottom: 0.18rem;
}

.atmo-btn-row {
  display: flex;
  gap: 0.35rem;
}

.atmo-btn {
  background: var(--wool);
  border: 1.5px solid var(--wool-dark);
  border-radius: 10px;
  flex: 1;
  min-height: 42px;
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  line-height: 1;
  padding: 0.24rem 0.18rem;
  transition: transform 0.15s var(--ease-spring), border-color 0.15s ease, background 0.15s ease;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.atmo-btn:hover {
  transform: scale(1.03);
  border-color: var(--pasture);
  background: var(--foam);
}

.atmo-btn:active {
  transform: scale(0.97);
}

.atmo-btn-label {
  font-size: 0.58rem;
  font-weight: 700;
  color: var(--bark);
}

.atmo-btn.selected {
  border-color: var(--pasture);
  background: var(--foam);
  animation: atmoSelect 0.4s var(--ease-spring);
  box-shadow: 0 0 8px rgba(45, 122, 39, 0.35);
}

.atmo-btn--report-price {
  width: 100%;
  margin-top: 6px;
  background: var(--amber);
  color: var(--foam);
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 10px;
  padding: 7px 12px;
  border: none;
  cursor: pointer;
  font-family: 'Nunito', sans-serif;
}

@keyframes atmoSelect {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.35); }
  65%  { transform: scale(0.95); }
  100% { transform: scale(1.05); }
}

/* Inline confirmation text */
.atmo-confirm {
  font-family: 'Fredoka', sans-serif;
  font-size: 0.62rem;
  color: var(--pasture);
  font-weight: 600;
  margin-top: 0.22rem;
  padding: 0.2rem 0;
}

.atmo-confirm.error {
  color: var(--blush);
}

/* ---- Offline / Error states ---- */
.offline-banner {
  background: var(--amber);
  color: white;
  font-family: 'Fredoka', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  text-align: center;
  padding: 0.4rem 1rem;
  z-index: 101;
  animation: slideDown 0.3s var(--ease-out-expo);
}

@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1rem;
  gap: 0.75rem;
  text-align: center;
}

.error-state-text {
  font-family: 'Fredoka', sans-serif;
  font-size: 0.85rem;
  color: #999;
}

.retry-btn {
  background: var(--pasture);
  color: white;
  border: none;
  border-radius: var(--radius);
  padding: 0.5rem 1.25rem;
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  transition: transform 0.2s var(--ease-spring);
}

.retry-btn:hover { transform: scale(1.05); }
.retry-btn:active { transform: scale(0.95); }

/* ---- Sidebar ---- */
#sidebar {
  width: 360px;
  overflow-y: auto;
  background: var(--wool);
  border-left: 1px solid var(--wool-dark);
  display: flex;
  flex-direction: column;
  animation: sidebarSlideIn 0.6s var(--ease-out-expo) 0.3s both;
}

@keyframes sidebarSlideIn {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Scrollbar styling */
#sidebar::-webkit-scrollbar { width: 6px; }
#sidebar::-webkit-scrollbar-track { background: transparent; }
#sidebar::-webkit-scrollbar-thumb { background: var(--wool-dark); border-radius: 3px; }

/* Sidebar header */
.sidebar-header-row {
  background: var(--foam);
  border-bottom: 1px solid var(--wool-dark);
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

/* Action row: search + filter button */
.sidebar-action-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem 0.4rem;
}

.sidebar-search-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.sidebar-search-icon {
  position: absolute;
  left: 0.55rem;
  width: 14px;
  height: 14px;
  color: #aaa;
  pointer-events: none;
  flex-shrink: 0;
}

.sidebar-search {
  width: 100%;
  padding: 0.42rem 2rem 0.42rem 2rem;
  border: 1.5px solid var(--wool-dark);
  border-radius: 999px;
  background: var(--wool);
  font-family: 'Nunito', sans-serif;
  font-size: 16px; /* ≥16px prevents iOS Safari auto-zoom on focus */
  color: var(--night);
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.sidebar-search:focus {
  outline: none;
  border-color: var(--pasture);
  background: var(--foam);
  box-shadow: 0 0 0 3px rgba(45, 90, 39, 0.1);
}

.sidebar-search::placeholder {
  color: #bbb;
  font-weight: 400;
}

/* Hide the native clear button in Chrome/Safari */
.sidebar-search::-webkit-search-cancel-button { display: none; }

.sidebar-search-clear {
  position: absolute;
  right: 0.5rem;
  background: none;
  border: none;
  color: #bbb;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  transition: color 0.15s ease;
}

.sidebar-search-clear:hover { color: var(--bark); }

.suggest-venue-btn {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.3rem 0.4rem;
  border-radius: var(--radius);
  line-height: 1;
  transition: transform 0.15s ease;
  flex-shrink: 0;
}
.suggest-venue-btn:hover { transform: scale(1.15); }

.modal-feedback {
  font-size: 0.78rem;
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  margin-bottom: 0.5rem;
}
.modal-feedback.success { background: var(--foam); color: var(--pasture); }
.modal-feedback.error   { background: #fff0f0; color: #c0392b; }

.filter-toggle-btn {
  display: none;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1.5px solid var(--wool-dark);
  border-radius: 50%;
  background: var(--foam);
  color: var(--pasture);
  cursor: pointer;
  transition: transform 0.2s var(--ease-spring), border-color 0.2s ease, box-shadow 0.2s ease;
}

.filter-toggle-btn svg {
  width: 15px;
  height: 15px;
}

.filter-toggle-btn:hover {
  transform: scale(1.08);
  border-color: var(--pasture);
  box-shadow: 0 3px 10px rgba(44, 30, 15, 0.1);
}

.filter-toggle-btn[aria-expanded="true"] {
  border-color: var(--pasture);
  background: var(--pasture);
  color: var(--foam);
}

.sidebar-filter-controls {
  display: flex;
  flex-direction: column;
}

.city-filter {
  width: calc(100% - 1.5rem);
  margin: 0 0.75rem 0.5rem;
  padding: 0.4rem 0.6rem;
  border: 1.5px solid var(--wool-dark);
  border-radius: 8px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--night);
  background: var(--wool);
  appearance: none;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.city-filter:focus {
  outline: none;
  border-color: var(--pasture);
}

/* Filter bar */
/* Sidebar tabs — segmented control */
.sidebar-tabs {
  display: flex;
  margin: 0.5rem 0.75rem;
  padding: 3px;
  background: var(--wool-dark);
  border-radius: var(--radius);
  gap: 2px;
}

.sidebar-tab {
  flex: 1;
  padding: 0.5rem 0.75rem;
  text-align: center;
  cursor: pointer;
  font-family: 'Fredoka', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: #888;
  border-radius: calc(var(--radius) - 4px);
  transition: all 0.22s var(--ease-smooth);
  border-bottom: none;
  position: relative;
  user-select: none;
}

.sidebar-tab:hover:not(.active) {
  color: var(--pasture);
  background: rgba(254, 254, 250, 0.55);
}

.sidebar-tab.active {
  color: var(--pasture);
  background: var(--foam);
  box-shadow: 0 1px 4px rgba(44, 30, 15, 0.14), 0 1px 8px rgba(44, 30, 15, 0.05);
}

.sidebar-count {
  font-size: 0.68rem;
  opacity: 0.55;
  margin-left: 0.2rem;
}

/* Venue list */
#venue-list {
  padding: 0.4rem 0.75rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* Venue cards */
.venue-card {
  background: var(--foam);
  border-radius: var(--radius);
  /* Use border-left for the spectrum stripe — avoids overflow:hidden which clips price badges */
  border-left: 3.5px solid var(--price-color, var(--pasture-light));
  padding: 0.85rem 1rem 0.85rem 0.85rem;
  cursor: pointer;
  transition: transform 0.3s var(--ease-spring), box-shadow 0.3s ease, border-color 0.4s ease;
  box-shadow: 0 1px 4px var(--shadow);
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  animation: cardSlideIn 0.5s var(--ease-out-expo) backwards;
}

.venue-card:hover {
  transform: translateY(-3px) scale(1.012);
  box-shadow: 0 8px 24px rgba(0,0,0,0.11), 0 2px 6px rgba(0,0,0,0.06);
}

/* Name color on hover */
.venue-card:hover .venue-name {
  color: var(--pasture);
  transition: color 0.2s ease;
}

.venue-card:active {
  transform: translateY(-1px) scale(0.99);
  transition-duration: 0.1s;
}

/* Highlight card when its marker is active */
.venue-card.highlighted {
  box-shadow: 0 0 0 2px var(--price-color, var(--pasture)), 0 8px 24px var(--shadow-lg);
  transform: translateY(-2px);
}

@keyframes cardSlideIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.venue-rank {
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: 0.7rem;
  color: #ccc;
  min-width: 22px;
  text-align: center;
  transition: transform 0.25s var(--ease-spring), color 0.2s ease;
}

.venue-card:hover .venue-rank {
  transform: scale(1.25) rotate(-4deg);
  color: var(--amber);
  animation: rankBounce 0.4s var(--ease-spring);
}

@keyframes rankBounce {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.4) rotate(-6deg); }
  60%  { transform: scale(1.1) rotate(2deg); }
  100% { transform: scale(1.25) rotate(-4deg); }
}

.venue-rank.top3 {
  color: var(--price-color, var(--amber));
  font-size: 0.85rem;
}

.venue-info {
  flex: 1;
  min-width: 0;
}

.venue-name {
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 0.96rem;
  color: var(--night);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.2s ease;
}

.venue-address {
  font-size: 0.74rem;
  color: #aaa;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.08rem;
}

.venue-price-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
  flex-shrink: 0;
}

.venue-price-badge {
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  /* background and color set via inline style from spectrumColor() */
  padding: 0.32rem 0.7rem;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: transform 0.2s var(--ease-spring), box-shadow 0.2s ease;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.venue-card:hover .venue-price-badge {
  transform: scale(1.06);
}

.venue-price-badge.deal {
  box-shadow: 0 0 10px rgba(0, 200, 83, 0.45), 0 1px 4px rgba(0,0,0,0.15);
  animation: dealBadgePulse 2.4s ease-in-out infinite 0.5s;
}

@keyframes dealBadgePulse {
  0%, 100% { box-shadow: 0 0 8px rgba(0, 200, 83, 0.3), 0 1px 4px rgba(0,0,0,0.15); }
  50%       { box-shadow: 0 0 16px rgba(0, 200, 83, 0.6), 0 1px 4px rgba(0,0,0,0.15); }
}

.venue-price-detail {
  font-size: 0.65rem;
  color: #aaa;
  white-space: nowrap;
}

.venue-fav-btn {
  font-size: 1rem;
  cursor: pointer;
  opacity: 0.2;
  transition: all 0.25s var(--ease-spring);
  user-select: none;
  flex-shrink: 0;
  padding: 0.25rem;
}

.venue-fav-btn:hover {
  opacity: 0.6;
  transform: scale(1.3);
}

.venue-fav-btn.active {
  opacity: 1;
  color: var(--blush);
  animation: heartPop 0.4s var(--ease-spring);
}

@keyframes heartPop {
  0% { transform: scale(1); }
  35% { transform: scale(1.5); }
  60% { transform: scale(0.9); }
  100% { transform: scale(1); }
}

/* ---- Loading state ---- */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  gap: 1rem;
}

.loading-sheep {
  font-size: 2.5rem;
  animation: sheepWalk 1.8s var(--ease-smooth) infinite;
}

@keyframes sheepWalk {
  0%   { transform: translateX(-14px) scaleX(1) translateY(0); }
  20%  { transform: translateX(-4px) scaleX(1) translateY(-2px); }
  40%  { transform: translateX(6px) scaleX(1) translateY(0); }
  48%  { transform: translateX(14px) scaleX(1) translateY(-1px); }
  50%  { transform: translateX(14px) scaleX(-1) translateY(0); }
  70%  { transform: translateX(4px) scaleX(-1) translateY(-2px); }
  90%  { transform: translateX(-10px) scaleX(-1) translateY(0); }
  99%  { transform: translateX(-14px) scaleX(-1) translateY(-1px); }
  100% { transform: translateX(-14px) scaleX(1) translateY(0); }
}

.loading-text {
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  color: #bbb;
  font-size: 0.9rem;
  animation: loadingPulse 1.5s ease-in-out infinite;
}

@keyframes loadingPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* ---- Empty states ---- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2.5rem 1.5rem;
  text-align: center;
  gap: 0.75rem;
  animation: fadeInUp 0.5s var(--ease-out-expo);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.empty-state-icon {
  font-size: 2.5rem;
  opacity: 0.6;
}

.empty-state-text {
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  color: #bbb;
  font-size: 0.9rem;
  line-height: 1.5;
}

.empty-state-link {
  color: var(--pasture);
  text-decoration: none;
  font-weight: 700;
  border-bottom: 2px solid var(--amber-light);
  padding-bottom: 1px;
  transition: border-color 0.2s ease;
}

.empty-state-link:hover {
  border-color: var(--pasture);
}

/* ---- Modal ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 29, 23, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: overlayIn 0.3s ease;
}

@keyframes overlayIn {
  from { opacity: 0; backdrop-filter: blur(0); }
  to { opacity: 1; }
}

.modal {
  background: var(--foam);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  max-width: 380px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  animation: modalSpring 0.5s var(--ease-spring);
}

@keyframes modalSpring {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.9);
  }
  50% {
    transform: translateY(-5px) scale(1.02);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal h2 {
  font-family: 'Fredoka', sans-serif;
  color: var(--pasture);
  margin-bottom: 1.25rem;
  font-size: 1.2rem;
}

.modal label:not(.modal-checkbox-label):not(.modal-time-label) {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: #999;
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.modal-venue-name {
  font-family: 'Fredoka', sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--bark);
  margin: -0.9rem 0 1rem;
}

.modal input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  margin-bottom: 1rem;
  border: 2px solid var(--wool-dark);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: 'Nunito', sans-serif;
  transition: border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
  background: var(--wool);
}

.modal input:focus,
.modal select:focus {
  outline: none;
  border-color: var(--pasture);
  background: var(--foam);
  box-shadow: 0 0 0 4px rgba(45, 90, 39, 0.1);
}

.modal select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  margin-bottom: 1rem;
  border: 2px solid var(--wool-dark);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: 'Nunito', sans-serif;
  transition: border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
  background: var(--wool);
  appearance: none;
  cursor: pointer;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.modal-actions button {
  flex: 1;
  padding: 0.7rem;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.9rem;
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  transition: transform 0.2s var(--ease-spring), box-shadow 0.2s ease;
}

.modal-actions button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow);
}

.modal-actions button:active {
  transform: translateY(0) scale(0.97);
}

.btn-primary {
  background: var(--pasture);
  color: var(--foam);
}

.btn-secondary {
  background: var(--wool);
  color: #888;
}

/* ---- User location marker ---- */
.user-marker-wrapper {
  background: transparent !important;
  border: none !important;
  /* Must never steal taps from venue pills underneath */
  pointer-events: none !important;
}

.user-marker-dot {
  width: 16px;
  height: 16px;
  background: #3478F6;
  border: 3px solid white;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(52, 120, 246, 0.4), 0 2px 6px rgba(0,0,0,0.2);
  animation: userPulse 2.5s ease-in-out infinite;
  position: relative;
}

.user-marker-dot::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: rgba(52, 120, 246, 0.12);
  animation: userRing 2.5s ease-in-out infinite;
}

@keyframes userPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(52, 120, 246, 0.4), 0 2px 6px rgba(0,0,0,0.2); }
  50% { box-shadow: 0 0 0 8px rgba(52, 120, 246, 0), 0 2px 6px rgba(0,0,0,0.2); }
}

@keyframes userRing {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.4); opacity: 0; }
}

/* ---- Locate me button ---- */
.locate-btn {
  position: absolute;
  bottom: 20px;
  left: 20px;
  z-index: 1000;
  width: 40px;
  height: 40px;
  background: var(--foam);
  border: none;
  border-radius: var(--radius);
  box-shadow: 0 2px 8px var(--shadow);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s var(--ease-spring), box-shadow 0.2s ease;
  animation: fadeInUp 0.5s var(--ease-out-expo) 0.6s both;
}

.locate-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 14px var(--shadow-lg);
}

.locate-btn:active {
  transform: scale(0.95);
}

.locate-btn svg {
  width: 20px;
  height: 20px;
  color: var(--pasture);
}

.locate-btn.locating svg {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---- Drag handle for mobile bottom sheet ---- */
.sidebar-drag-handle {
  display: none;
  width: 100%;
  height: 56px;
  cursor: grab;
  touch-action: none;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  flex-shrink: 0;
  background: var(--foam);
  border-bottom: 1px solid rgba(237, 228, 208, 0.8);
  padding: 0.4rem 0 calc(0.4rem + env(safe-area-inset-bottom, 0px));
}

.sidebar-drag-handle:active {
  cursor: grabbing;
}

.sidebar-drag-handle-bar {
  width: 40px;
  height: 4px;
  background: var(--wool-dark);
  border-radius: 2px;
  transition: background 0.2s ease, width 0.2s ease;
}

.sidebar-drag-handle-label {
  font-family: 'Fredoka', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  color: #999;
  letter-spacing: 0.01em;
}

.sidebar-drag-handle-chevron {
  font-size: 0.85rem;
  color: #bbb;
  transition: transform 0.2s var(--ease-spring);
}

.sidebar-drag-handle:hover .sidebar-drag-handle-bar {
  background: var(--pasture-light);
  width: 56px;
}

/* ---- Responsive mobile ---- */
@media (max-width: 640px) {
  #app {
    flex-direction: column;
    position: relative;
    overflow: hidden;
  }
  #map { flex: 1; min-height: 100%; }

  .sidebar-drag-handle {
    display: flex;
  }

  #sidebar {
    width: auto;
    border-left: none;
    border-top: 1px solid var(--wool-dark);
    height: 48dvh;
    max-height: calc(100% - 10px);
    min-height: 76px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    margin-top: 0;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    box-shadow: 0 -10px 30px var(--shadow-lg);
    animation: none;
    animation: sheetUp 0.5s var(--ease-out-expo) 0.4s both;
    transition: height 0.35s var(--ease-out-expo);
    overflow: hidden;
    will-change: height;
  }

  /* Sidebar drag states */
  #sidebar.sheet-collapsed {
    height: 76px !important;
    min-height: 76px !important;
    overflow: hidden !important;
    touch-action: none;
  }

  #sidebar.sheet-collapsed .sidebar-header-row,
  #sidebar.sheet-collapsed #venue-list,
  #sidebar.sheet-collapsed .sidebar-footer {
    display: none !important;
  }

  #sidebar.sheet-collapsed .sidebar-drag-handle {
    border-bottom: none;
  }

  #sidebar.sheet-half,
  #sidebar.sheet-full {
    min-height: 240px;
  }

  #sidebar.sheet-dragging {
    min-height: 76px !important;
    transition: none !important;
  }

  #sidebar.sheet-collapsed .sidebar-drag-handle-chevron {
    transform: rotate(0deg);
  }

  #sidebar.sheet-half .sidebar-drag-handle-chevron {
    transform: rotate(0deg);
  }

  #sidebar.sheet-full .sidebar-drag-handle-chevron {
    transform: rotate(180deg);
  }

  #sidebar.sheet-half .filter-toggle-btn {
    display: inline-flex;
    margin: 0;
  }

  #sidebar.sheet-half .sidebar-filter-controls {
    display: none;
  }

  #sidebar.sheet-half.filters-open .sidebar-filter-controls {
    display: flex;
  }

  #sidebar.sheet-full .sidebar-header-row {
    padding: 0.45rem 0.75rem 0.35rem;
    gap: 0.45rem;
  }

  #sidebar.sheet-full .filter-toggle-btn {
    display: inline-flex;
    margin: 0;
  }

  #sidebar.sheet-full .sidebar-filter-controls {
    display: none;
    gap: 0.5rem;
    padding: 0.65rem;
    border: 1px solid var(--wool-dark);
    border-radius: 16px;
    background: rgba(254, 254, 250, 0.98);
    box-shadow: 0 8px 20px rgba(44, 30, 15, 0.08);
  }

  #sidebar.sheet-full.filters-open .sidebar-filter-controls {
    display: flex;
  }

  #sidebar.sheet-full .sidebar-tabs {
    margin: 0.4rem 0.65rem;
  }

  #sidebar.sheet-full .sidebar-tab {
    border-radius: calc(var(--radius) - 4px);
    border-bottom-width: 0;
  }

  #sidebar.sheet-full .city-filter {
    width: 100%;
    margin: 0;
  }

  @keyframes sheetUp {
    from {
      opacity: 0;
      transform: translateY(100%);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  /* Allow scroll inside sidebar when not collapsed */
  #venue-list {
    overflow-y: auto;
    padding-bottom: calc(0.65rem + env(safe-area-inset-bottom, 0px));
  }

  .sidebar-footer {
    flex-shrink: 0;
    gap: 0.75rem;
    padding: 0.8rem 1rem calc(0.8rem + env(safe-area-inset-bottom, 0px));
  }

  .header-stats { display: none; }
  .header-content {
    padding-right: 0.9rem;
  }

  .header-title-group {
    gap: 0.75rem;
  }

  .header-subtitle {
    font-size: 0.6rem;
    opacity: 0.68;
    max-width: min(45vw, 180px);
  }
}

/* ---- Micro-interactions on all clickable elements ---- */
button, [role="button"], .sidebar-tab, .venue-card {
  -webkit-tap-highlight-color: transparent;
}

.sidebar-tab:active {
  transform: scale(0.97);
  transition-duration: 0.1s;
}

/* Stagger venue cards with a more dynamic entry */
.venue-card:nth-child(1)  { animation-delay: 0s; }
.venue-card:nth-child(2)  { animation-delay: 0.04s; }
.venue-card:nth-child(3)  { animation-delay: 0.08s; }
.venue-card:nth-child(4)  { animation-delay: 0.12s; }
.venue-card:nth-child(5)  { animation-delay: 0.16s; }
.venue-card:nth-child(6)  { animation-delay: 0.20s; }
.venue-card:nth-child(7)  { animation-delay: 0.23s; }
.venue-card:nth-child(8)  { animation-delay: 0.26s; }
.venue-card:nth-child(n+9) { animation-delay: 0.28s; }

/* Popup entrance polish */
.leaflet-popup-content-wrapper {
  transform-origin: bottom center;
}

/* Ensure popups render above the mobile bottom sheet (z-index: 60) */
.leaflet-popup-pane {
  z-index: 800 !important;
}

/* ---- Leaflet popup close button ---- */
.leaflet-popup-close-button {
  font-size: 20px !important;
  color: #ccc !important;
  padding: 8px 10px 0 0 !important;
  transition: color 0.15s ease !important;
}

.leaflet-popup-close-button:hover {
  color: var(--blush) !important;
}

/* ---- About link in sidebar ---- */
.sidebar-footer {
  padding: 1rem;
  text-align: center;
  border-top: 1px solid var(--wool-dark);
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.sidebar-footer a {
  font-family: 'Fredoka', sans-serif;
  font-size: 0.8rem;
  color: #bbb;
  text-decoration: none;
  transition: color 0.2s ease;
}

.sidebar-footer a:hover {
  color: var(--pasture);
}

/* ---- Gamification rank badge ---- */
.rank-badge {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-family: 'Fredoka', sans-serif;
  font-size: 0.75rem;
  color: var(--amber);
  font-weight: 600;
  animation: fadeInUp 0.4s var(--ease-out-expo);
}

.rank-icon {
  font-size: 0.85rem;
}

.rank-title {
  white-space: nowrap;
}

.push-toggle {
  background: none;
  border: 1.5px solid var(--wool-dark);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #bbb;
  transition: all 0.2s var(--ease-smooth);
}

@media (hover: hover) {
  .push-toggle:hover {
    color: var(--pasture);
    border-color: var(--pasture);
  }
}

.push-toggle.active {
  color: var(--amber);
  border-color: var(--amber);
  background: rgba(212, 136, 28, 0.1);
}

#alias-toggle-btn.active {
  color: var(--pasture-light);
  border-color: var(--pasture-light);
  background: rgba(45, 90, 39, 0.08);
}

/* --- Facility row --- */
.facility-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 6px 0 4px;
  border-top: 1px solid rgba(0,0,0,0.07);
  margin-top: 4px;
}
.facility-icon {
  position: relative;
  font-size: 18px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  transition: opacity 0.15s;
}
.facility-icon--present {
  opacity: 1;
  filter: none;
}
.facility-icon--absent {
  opacity: 0.22;
  filter: grayscale(1);
}
.facility-icon--locked {
  opacity: 0.25;
  filter: grayscale(1);
}
.facility-badge {
  position: absolute;
  bottom: -4px;
  right: -6px;
  font-size: 8px;
  font-weight: 700;
  background: #2D6A2D;
  color: #fff;
  border-radius: 4px;
  padding: 0 2px;
  line-height: 1.4;
  pointer-events: none;
}
.facility-teaser {
  font-size: 10px;
  color: #888;
  font-style: italic;
  flex-basis: 100%;
  margin-top: 2px;
}

/* Facility icon bar — header strip at top of popup */
.popup-facility-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--wool-dark, rgba(0,0,0,0.08));
}

.popup-facility-bar--loading,
.popup-facility-bar--hidden {
  display: none;
}

/* --- Happy hour badge --- */
.happy-hour-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  background: linear-gradient(90deg, #FF6B00, #FFD600);
  color: #fff;
  border-radius: 10px;
  padding: 2px 7px;
  margin-left: 6px;
  vertical-align: middle;
  letter-spacing: 0.02em;
  animation: pulse-deal 1.6s ease-in-out infinite;
}
.student-price-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  background: #1565C0;
  color: #fff;
  border-radius: 10px;
  padding: 2px 7px;
  margin-left: 6px;
  vertical-align: middle;
  letter-spacing: 0.02em;
}
.modal-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #444;
  margin: 4px 0 10px;
  cursor: pointer;
  user-select: none;
}

.modal-checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--pasture);
}

.promotion-time-row {
  display: flex;
  gap: 0.75rem;
  margin: 0 0 0.75rem;
}

.modal-time-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #666;
}

.modal-time-input {
  padding: 0.35rem 0.5rem;
  border: 2px solid var(--wool-dark);
  border-radius: var(--radius);
  font-size: 16px;
  font-family: 'Nunito', sans-serif;
  background: var(--wool);
}

/* --- Facility filters --- */
.facility-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px 0 2px;
}
.facility-filter-btn {
  font-size: 18px;
  background: none;
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 2px 5px;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.15s, border-color 0.15s;
}
.facility-filter-btn.active {
  opacity: 1;
  border-color: #2D6A2D;
  background: rgba(45,106,45,0.08);
}
.facility-filter-teaser {
  font-size: 11px;
  color: #888;
  font-style: italic;
  padding: 2px 0;
}

/* ---- Suggest / basseboys modal shared components ---- */

.modal-box {
  background: var(--foam);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.25rem 1.25rem;
  width: 90%;
  max-width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  position: relative;
  animation: modalSpring 0.5s var(--ease-spring);
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  color: var(--sand, #aaa);
  line-height: 1;
  padding: 0.2rem 0.4rem;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.modal-close:hover { color: var(--bark); background: var(--wool-dark); }

.modal-title {
  font-family: 'Fredoka', sans-serif;
  color: var(--pasture);
  font-size: 1.15rem;
  margin-bottom: 1rem;
  padding-right: 1.5rem;
}

.modal-subtitle {
  font-size: 0.82rem;
  color: var(--sand, #888);
  margin-bottom: 1rem;
  margin-top: -0.6rem;
}

.modal-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
}

.modal-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--sand, #999);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.modal-input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 2px solid var(--wool-dark);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: 'Nunito', sans-serif;
  background: var(--wool);
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.modal-input:focus {
  outline: none;
  border-color: var(--pasture);
  background: var(--foam);
  box-shadow: 0 0 0 4px rgba(45, 90, 39, 0.1);
}

.modal-submit-btn {
  width: 100%;
  padding: 0.7rem;
  border: none;
  border-radius: var(--radius);
  background: var(--pasture);
  color: var(--foam);
  font-size: 0.95rem;
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.25rem;
  transition: transform 0.2s var(--ease-spring), box-shadow 0.2s ease;
}
.modal-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow);
}
.modal-submit-btn:active { transform: translateY(0) scale(0.97); }

/* ---- Basseboys panel ---- */

.basseboys-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--amber);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  border-radius: 999px;
  min-width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  pointer-events: none;
}

.basseboys-modal-box {
  max-width: 420px;
  max-height: 80dvh;
  overflow-y: auto;
}

.basseboys-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--bark);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 1rem 0 0.5rem;
  border-top: 1px solid var(--wool-dark);
  padding-top: 0.75rem;
}
.basseboys-section-title:first-of-type { border-top: none; margin-top: 0; }

.basseboys-empty {
  font-size: 0.8rem;
  color: var(--sand, #888);
  text-align: center;
  padding: 0.5rem 0;
}

.suggestion-card {
  background: var(--wool);
  border: 1px solid var(--wool-dark);
  border-radius: var(--radius);
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.suggestion-info { font-size: 0.82rem; color: var(--bark); }
.suggestion-reporter { color: var(--sand, #888); font-size: 0.75rem; }

.suggestion-actions { display: flex; gap: 0.4rem; }

.suggestion-btn {
  font-size: 0.75rem;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  padding: 0.3rem 0.7rem;
  cursor: pointer;
  transition: opacity 0.15s;
}
.suggestion-btn:hover { opacity: 0.85; }
.suggestion-btn--approve { background: var(--pasture); color: #fff; }
.suggestion-btn--reject  { background: #e74c3c; color: #fff; }
.suggestion-btn--confirm { background: var(--amber); color: #fff; margin-top: 0.3rem; }

.approve-form {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding-top: 0.35rem;
}
.approve-form .modal-input { font-size: 0.82rem; padding: 0.35rem 0.6rem; }

/* ==== Mobile venue card (bottom sheet) ==== */

.venue-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 70;
  background: var(--foam);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: 0 -12px 40px var(--shadow-lg);
  max-height: 62dvh;
  display: flex;
  flex-direction: column;
  transform: translateY(110%);
  transition: transform 0.32s var(--ease-out-expo);
  will-change: transform;
}

.venue-sheet.venue-sheet-open {
  transform: translateY(0);
}

.venue-sheet-handle {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 0 6px;
  cursor: grab;
  touch-action: none;
}

.venue-sheet-handle-bar {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: var(--wool-dark);
}

.venue-sheet-close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: var(--wool);
  color: #999;
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}

.venue-sheet-close:active {
  background: var(--wool-dark);
  color: var(--bark);
}

.venue-sheet-content {
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
}

/* Roomier layout when venue detail renders inside the card */
.popup-inner--card {
  padding: 0 16px 8px;
}

.popup-inner--card .popup-venue-name {
  font-size: 1.15rem;
  padding-right: 40px;
}

.popup-inner--card .popup-address {
  font-size: 0.74rem;
}

.popup-inner--card .popup-price-badge {
  font-size: 2.6rem;
}

.popup-inner--card .popup-actions {
  gap: 0.5rem;
}

.popup-btn-report {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  border: none;
  border-radius: 12px;
  background: var(--amber, #D4881C);
  color: #fff;
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: transform 0.2s var(--ease-spring), box-shadow 0.2s ease;
}

.popup-btn-report:active {
  transform: scale(0.96);
}

/* Venue list sheet slides out of the way while the card is open */
@media (max-width: 640px) {
  #sidebar.sheet-hidden {
    transform: translateY(110%);
    transition: transform 0.28s var(--ease-out-expo);
    pointer-events: none;
  }
}

/* Desktop never shows the card */
@media (min-width: 641px) {
  .venue-sheet {
    display: none !important;
  }
}

/* ==== Toast ==== */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%) translateY(16px);
  z-index: 12000;
  background: var(--night, #1A1D17);
  color: var(--foam, #FEFEFA);
  font-family: 'Fredoka', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.3s var(--ease-spring);
  max-width: min(86vw, 420px);
  text-align: center;
}

.toast.toast-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ==== Modal ergonomics on small screens ==== */

.modal,
.modal-box {
  max-height: min(86dvh, 720px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 640px) {
  /* Top-aligned so the iOS keyboard doesn't cover the fields */
  .modal-overlay {
    align-items: flex-start;
    padding-top: max(7dvh, env(safe-area-inset-top, 0px));
  }

  .modal,
  .modal-box {
    max-height: 82dvh;
  }

  /* 16px inputs prevent iOS Safari focus zoom everywhere */
  .modal input,
  .modal select,
  .modal-input,
  .approve-form .modal-input {
    font-size: 16px;
  }
}


/* ==== Filter-chips på kartet ==== */

.filter-chips {
  position: absolute;
  top: 10px;
  left: 0;
  right: 0;
  z-index: 1002;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 12px 8px;
  pointer-events: none; /* kartet kan dras mellom chips */
}

.filter-fab {
  pointer-events: auto;
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--foam, #fff);
  color: var(--pasture);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  align-self: flex-start;
}

.filter-fab.open {
  background: var(--pasture);
  color: #fff;
}

.basse-fab {
  background: #1c1c1e url("/basse.png") center / cover no-repeat;
  border: 2px solid var(--foam, #fff);
}

.basse-fab.active {
  border-color: #f5b301;
  box-shadow: 0 0 0 3px rgba(245, 179, 1, 0.45), 0 2px 10px rgba(0, 0, 0, 0.25);
}

.filter-fab-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: #e67e22;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
}

.filter-fab-count[hidden] {
  display: none;
}

#filter-chip-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#filter-chip-rows[hidden] {
  display: none;
}

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

/* display:flex over slår [hidden] — gjenopprett semantikken eksplisitt */
.chip-row[hidden] {
  display: none;
}

.chip-subrow {
  animation: fadeInUp 0.25s var(--ease-out-expo);
  align-items: center;
}

.chip-row-hint {
  font-family: 'Fredoka', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--foam);
  background: rgba(26, 29, 23, 0.55);
  padding: 3px 9px;
  border-radius: 999px;
  pointer-events: none;
}

.chip {
  pointer-events: auto;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 34px;
  padding: 0 13px;
  border: 1.5px solid rgba(237, 228, 208, 0.9);
  border-radius: 999px;
  background: var(--foam);
  color: var(--night);
  font-family: 'Fredoka', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px var(--shadow);
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease,
    transform 0.18s var(--ease-spring);
  white-space: nowrap;
  touch-action: pan-x;
}

.chip:active {
  transform: scale(0.95);
}

.chip.active {
  background: var(--pasture);
  border-color: var(--pasture);
  color: var(--foam);
  box-shadow: 0 3px 10px rgba(45, 90, 39, 0.35);
}

/* Zoom-kontrollen må klarere chip-radene (to rader på smale skjermer) */
.leaflet-top.leaflet-right .leaflet-control-zoom {
  margin-top: 104px;
}

@media (min-width: 641px) {
  .leaflet-top.leaflet-right .leaflet-control-zoom {
    margin-top: 56px;
  }
}

.chip-group .chip-caret {
  font-size: 0.75rem;
  margin-left: 2px;
  transition: transform 0.2s var(--ease-spring);
  display: inline-block;
}

.chip-group.open .chip-caret {
  transform: rotate(180deg);
}

.chip-count[hidden] {
  display: none;
}

.chip-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  border-radius: 999px;
  background: var(--amber);
  color: #fff;
  font-size: 0.66rem;
  font-weight: 700;
  padding: 0 4px;
  margin-left: 4px;
}

/* Kompakt by-velger i søkeraden */
.city-filter--inline {
  width: auto;
  max-width: 118px;
  margin: 0;
  padding: 0.4rem 0.5rem;
  border-radius: 999px;
  font-size: 0.74rem;
}

/* ==== Kampanje-markører ==== */

.beer-dot.promo .price-pill {
  box-shadow:
    0 2px 5px rgba(0, 0, 0, 0.22),
    0 0 0 2px rgba(255, 255, 255, 0.75),
    0 0 0 3.5px var(--amber, #D4881C),
    0 0 14px rgba(240, 168, 48, 0.65);
}

.beer-dot.promo {
  animation: dotDrop 0.4s var(--ease-spring) backwards, dealPulse 2.4s ease-in-out infinite 0.5s;
}

.pill-flame {
  position: absolute;
  top: -9px;
  right: -7px;
  font-size: 11px;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
  pointer-events: none;
}

/* Inaktiv kampanje (vises med 🔥-filteret på): gråtonet + tidsvindu */
.beer-dot.promo-inactive .price-pill {
  filter: grayscale(0.85) brightness(1.05);
  opacity: 0.75;
}

.pill-flame--muted {
  filter: grayscale(0.4);
  font-size: 10px;
}

.pill-window {
  position: absolute;
  top: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(90, 88, 80, 0.92);
  color: #fff;
  font-family: 'Fredoka', sans-serif;
  font-size: 0.58rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 7px;
  white-space: nowrap;
  pointer-events: none;
}

.venue-promo-line--inactive {
  color: #9a968a;
}

.happy-hour-badge--inactive {
  background: #edeae0 !important;
  color: #8a8778 !important;
}

/* Sauekonge: liten krone over sauens hode */
.rank-crowned {
  position: relative;
  display: inline-block;
}

.rank-crown {
  position: absolute;
  top: -0.3em;
  left: 0;
  font-size: 0.46em;
  transform: rotate(-12deg);
  line-height: 1;
}

/* Studentpris-visning når 🎓-filteret er aktivt */
.beer-dot.student .price-pill {
  box-shadow:
    0 2px 5px rgba(0, 0, 0, 0.22),
    0 0 0 2px rgba(255, 255, 255, 0.75),
    0 0 0 3.5px #1565C0,
    0 0 12px rgba(21, 101, 192, 0.5);
}

.pill-grad {
  filter: none;
}

.venue-student-line {
  color: #1565C0;
}

/* Kampanjelinje i stedslisten */
.venue-promo-line {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--amber, #D4881C);
  margin-top: 2px;
  white-space: nowrap;
}


/* ==== «Hjelp andre brukere»-sheet (mobil) ==== */

.help-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9400;
  background: rgba(26, 29, 23, 0.45);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.help-sheet-backdrop.visible {
  opacity: 1;
}

.help-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9500;
  background: var(--foam);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: 0 -12px 40px var(--shadow-lg);
  max-height: 86dvh;
  display: flex;
  flex-direction: column;
  transform: translateY(110%);
  transition: transform 0.32s var(--ease-out-expo);
  will-change: transform;
}

.help-sheet.help-sheet-open {
  transform: translateY(0);
}

.help-sheet-content {
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 0 18px calc(1.25rem + env(safe-area-inset-bottom, 0px));
}

.help-sheet-title {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--night);
  padding-right: 40px;
}

.help-sheet-subtitle {
  font-size: 0.82rem;
  color: #8a8a80;
  margin: 2px 0 1.1rem;
}

/* Ett scrollnivå: aldri scroll-i-scroll her inne */
.help-sheet .atmo-report-content,
.help-sheet .facility-report-section.expanded .atmo-report-content {
  max-height: none;
  overflow: visible;
  opacity: 1;
  transform: none;
}

/* Romslige, tydelige valg */
.help-sheet .atmo-question {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--bark);
  margin: 1rem 0 0.5rem;
}

.help-sheet .atmo-btn-row {
  display: flex;
  gap: 0.6rem;
}

.help-sheet .atmo-btn {
  flex: 1;
  min-height: 56px;
  font-size: 0.9rem;
  border-radius: 14px;
}

.help-sheet .facility-report-section {
  margin-top: 1.25rem;
  border-top: 1px solid var(--wool-dark);
  padding-top: 0.75rem;
}

/* Inne i sheetet er «Fasiliteter» en overskrift, ikke en knapp */
.help-sheet .facility-report-section .atmo-report-toggle {
  pointer-events: none;
  border: none;
  background: none;
  box-shadow: none;
  padding: 0 0 0.25rem;
}

.help-sheet .facility-report-section .atmo-report-toggle-title {
  font-size: 0.95rem;
}

.help-sheet .facility-report-section .atmo-report-toggle-chevron {
  display: none;
}

.help-sheet .facility-report-row {
  margin-bottom: 0.4rem;
}

.help-sheet .facility-report-row .atmo-question {
  margin: 0.5rem 0 0.35rem;
}

.help-sheet .facility-report-row .atmo-btn {
  min-height: 44px;
}

.help-sheet .atmo-confirm {
  font-size: 0.85rem;
}

/* Sheet-varianten av «Hjelp andre brukere»-inngangen i kortet */
.help-open-btn .atmo-report-toggle-title {
  font-size: 0.85rem;
}

.help-open-btn .atmo-report-toggle-subtitle {
  font-size: 0.7rem;
}

.help-open-btn .atmo-report-toggle-chevron {
  font-size: 1.3rem;
  color: var(--pasture);
}

.help-open-btn {
  margin-top: 0.5rem;
  padding: 0.7rem 0.85rem;
}

@media (min-width: 641px) {
  .help-sheet,
  .help-sheet-backdrop {
    display: none !important;
  }
}


/* Notis når stedslisten er kappet (store datasett) */
.list-cap-note {
  text-align: center;
  font-size: 0.78rem;
  color: #9a968a;
  padding: 0.9rem 1rem 1.1rem;
}


/* ==== Profilmodal ==== */

.profile-head {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1.1rem;
}

.profile-modal-icon {
  font-size: 2.2rem;
  line-height: 1;
  background: var(--wool);
  border-radius: 50%;
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.profile-title {
  margin-bottom: 0.1rem !important;
}

.profile-rank-line {
  font-size: 0.8rem;
  color: #8a8a80;
}

.promo-code-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
  margin-bottom: 1rem;
}

.promo-code-row input {
  flex: 1;
  margin-bottom: 0 !important;
}

.promo-code-btn {
  flex-shrink: 0;
  padding: 0 1rem;
  border: none;
  border-radius: var(--radius);
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  cursor: pointer;
}

.panel-profile-btn {
  width: 100%;
  margin-top: 1.25rem;
  padding: 0.55rem;
  border: 1.5px solid var(--pasture);
  border-radius: var(--radius);
  background: none;
  color: var(--pasture);
  font-family: 'Fredoka', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.switch-user-btn {
  width: 100%;
  margin-top: 1rem;
  padding: 0.55rem;
  border: 1.5px solid var(--wool-dark);
  border-radius: var(--radius);
  background: none;
  color: #8a8a80;
  font-family: 'Fredoka', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

/* Større treffsone for sheet-handle (dra-ned funker nå også fra innholdet) */
.venue-sheet-handle {
  padding: 14px 0 10px;
}


/* ==== Flokken ==== */

.pill-flock-avatar {
  position: absolute;
  top: -12px;
  left: -9px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--foam);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  animation: flockHop 1.6s ease-in-out infinite;
}

@keyframes flockHop {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-3px); }
}

.flock-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  background: var(--wool);
  color: var(--bark);
  border: 1px solid var(--wool-dark);
  border-radius: 10px;
  padding: 2px 8px;
  margin-top: 4px;
}

.flock-line-avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.flock-line-photo {
  display: block;
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  border-radius: 12px;
  margin-top: 6px;
  border: 1px solid var(--wool-dark);
}

.flock-photo-ttl {
  font-size: 0.72rem;
  font-weight: 700;
  color: #b0483a;
  margin: 2px 0 4px;
}

.atmo-photo-btn {
  width: 100%;
  margin-top: 0.4rem;
  font-size: 0.85rem;
}

.atmo-estimated .atmo-gauge-fill {
  opacity: 0.55;
}

.atmo-estimated-note {
  font-size: 0.72rem;
  color: #9a968a;
  margin: 2px 0 6px;
}

.venue-photos-strip {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.3rem 0 0.5rem;
  -webkit-overflow-scrolling: touch;
}

.venue-photo-item {
  flex: 0 0 auto;
  margin: 0;
  width: 130px;
}

.venue-photo-item img {
  width: 130px;
  height: 130px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--wool-dark);
  display: block;
}

.venue-photo-item figcaption {
  font-size: 0.7rem;
  color: #9a968a;
  margin-top: 2px;
  text-align: center;
}

/* Long-press på kartet skal ikke starte tekstmarkering (iOS) */
#map,
.leaflet-container,
#filter-chips,
#filter-chips .chip {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

/* ==== Egne steder («Casa Torbjørn») ==== */

.private-place-wrapper {
  background: none;
  border: none;
}

.private-place-pill {
  position: relative;
  display: inline-block;
  white-space: nowrap;
  background: #6d5bd0;
  color: #fff;
  font-family: 'Fredoka', sans-serif;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 14px;
  border: 2px solid var(--foam);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transform: translate(-50%, 0);
}

.private-place-meta {
  font-size: 0.85rem;
  color: var(--bark);
  margin: -0.3rem 0 0.9rem;
}

.private-place-delete {
  width: 100%;
  margin-bottom: 0.5rem;
  color: #c0392b;
}

.add-place-scope {
  margin-top: 0.5rem;
}

.pill-flock-count {
  position: absolute;
  top: -16px;
  left: 7px;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  border-radius: 8px;
  background: var(--pasture);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 15px;
  text-align: center;
  border: 1.5px solid var(--foam);
  pointer-events: none;
}

.flock-btn {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.6rem 0.85rem;
  border: 1.5px dashed var(--pasture);
  border-radius: 12px;
  background: rgba(45, 90, 39, 0.06);
  color: var(--pasture);
  font-family: 'Fredoka', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.2s var(--ease-spring);
}

.flock-btn:active {
  transform: scale(0.97);
}

.flock-btn:disabled {
  opacity: 0.6;
}


/* ==== Statistikk-popup ==== */

.stats-logo-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin: 0.4rem 0 1.2rem;
}

.stats-cell {
  background: var(--wool);
  border-radius: 14px;
  padding: 0.7rem 0.4rem;
  text-align: center;
}

.stats-cell-num {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--pasture);
  line-height: 1.1;
}

.stats-cell-label {
  font-size: 0.66rem;
  color: #8a8a80;
  margin-top: 2px;
}

.stats-progress-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--bark);
  margin-bottom: 0.4rem;
}

.stats-progress-track {
  height: 12px;
  border-radius: 999px;
  background: var(--wool-dark);
  overflow: hidden;
  margin-bottom: 1.2rem;
}

.stats-progress-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--pasture), var(--amber-light));
}

/* ==== Flokke-medlemmer på kartet ==== */

.flock-member-wrapper {
  background: transparent !important;
  border: none !important;
}

.flock-member {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  animation: flockHop 1.8s ease-in-out infinite;
}

.flock-member img {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 3px solid var(--foam);
  box-shadow:
    0 0 0 2.5px var(--amber),
    0 5px 16px rgba(0, 0, 0, 0.45);
}

.flock-member-name {
  font-family: 'Fredoka', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--night);
  color: var(--foam);
  padding: 2px 10px;
  border-radius: 999px;
  white-space: nowrap;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.chip-flock.active {
  background: var(--amber);
  border-color: var(--amber);
}

.basse-fab,
.basse-fab.active {
  background: #1c1c1e url("/basse.png") center / cover no-repeat;
}


/* ==== Profilbilde ==== */

.profile-avatar-btn {
  position: relative;
  border: none;
  cursor: pointer;
  padding: 0;
  overflow: visible;
}

.profile-avatar-btn img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 2.5px solid var(--wool-dark);
}

.avatar-edit-badge {
  position: absolute;
  bottom: -3px;
  right: -3px;
  font-size: 0.8rem;
  background: var(--foam);
  border-radius: 50%;
  padding: 2px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  pointer-events: none;
}

/* ==== Flokke-klynger og liste ==== */

.flock-member {
  cursor: pointer;
}

.flock-count-badge {
  position: absolute;
  top: 12px;
  right: 2px;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--amber);
  color: #fff;
  font-family: 'Fredoka', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.flock-member--multi img {
  box-shadow:
    3px 3px 0 -1px var(--wool-dark),
    0 0 0 2.5px var(--amber),
    0 5px 16px rgba(0, 0, 0, 0.45);
}

.flock-list-box {
  max-width: 320px;
}

.flock-list-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--wool-dark);
}

.flock-list-row:last-of-type {
  border-bottom: none;
}

.flock-list-row img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--amber);
}

.flock-list-name {
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  color: var(--night);
}

.flock-list-venue {
  font-size: 0.88rem;
  color: var(--pasture);
  font-weight: 600;
  margin: -0.4rem 0 0.7rem;
}

.flock-list-close {
  width: 100%;
  margin-top: 1rem;
  padding: 0.7rem;
  border: none;
  border-radius: var(--radius);
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
}


/* ==== Medlemsbadge ==== */

.member-badge {
  display: inline-block;
  font-family: 'Fredoka', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(45, 90, 39, 0.1);
  color: var(--pasture);
  border: 1.5px solid var(--pasture);
  border-radius: 999px;
  padding: 3px 12px;
  margin-bottom: 0.9rem;
}

/* ==== Avatar-beskjæring ==== */

.crop-modal {
  max-width: 330px;
}

.crop-viewport {
  position: relative;
  width: 260px;
  height: 260px;
  margin: 0.6rem auto 0.8rem;
  overflow: hidden;
  border-radius: 16px;
  background: var(--night);
  touch-action: none;
  cursor: grab;
}

.crop-viewport:active {
  cursor: grabbing;
}

#crop-image {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  max-width: none;
  user-select: none;
  -webkit-user-drag: none;
}

.crop-circle {
  position: absolute;
  inset: 0;
  border-radius: 0;
  pointer-events: none;
  /* Mørklegg alt utenfor sirkelen */
  background: radial-gradient(
    circle at center,
    transparent 0,
    transparent 129px,
    rgba(26, 29, 23, 0.62) 130px
  );
}

.crop-circle::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 256px;
  height: 256px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 2.5px solid var(--foam);
  box-shadow: 0 0 14px rgba(0, 0, 0, 0.4);
}

.crop-zoom {
  width: 100%;
  margin-bottom: 0.6rem;
  accent-color: var(--pasture);
}


/* ==== Vennegrupper i profilen ==== */

.friend-groups-heading {
  font-size: 0.8rem;
  font-weight: 700;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0.4rem 0 0.5rem;
}

.friend-groups-hint {
  font-size: 0.8rem;
  color: #9a968a;
  margin-bottom: 0.8rem;
}

.friend-group-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--wool);
  border-radius: 12px;
  padding: 0.5rem 0.65rem;
  margin-bottom: 0.45rem;
}

.friend-group-info {
  flex: 1;
  min-width: 0;
}

.friend-group-name {
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--night);
}

.friend-group-members {
  font-size: 0.72rem;
  color: #9a968a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.friend-group-btn {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 8px;
  background: var(--foam);
  cursor: pointer;
  font-size: 0.85rem;
}

.friend-group-btn--leave {
  color: #c0392b;
}

.friend-group-create {
  display: flex;
  gap: 0.5rem;
  margin: 0.3rem 0 1rem;
}

.friend-group-add {
  display: flex;
  gap: 0.5rem;
  margin: 0.3rem 0 0.5rem;
}

.friend-group-add input {
  flex: 1;
  margin-bottom: 0 !important;
}

.friend-group-create input {
  flex: 1;
  margin-bottom: 0 !important;
}

/* ==== Del med-velger i panelet ==== */

.share-audience {
  margin: 0.2rem 0 0.8rem 1.6rem;
}

.share-audience-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 0.3rem;
}

.share-audience-row {
  margin: 2px 0 !important;
  font-size: 0.85rem !important;
}

.chip-friends.active {
  background: var(--pasture);
  border-color: var(--pasture);
}


/* Innsjekk-bilde i flokkelisten */
.flock-list-photo {
  width: 100%;
  border-radius: 14px;
  margin: 0.2rem 0 0.6rem;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.18);
}
