/* === badetemperaturer.no — UX-spec styles === */

:root {
  --brand: #0891B2;
  --brand-rgb: 8, 145, 178;
  --brand-hover: #0E7490;
  --brand-deep: #155E75;
  --brand-light: #ECFEFF;
  --brand-mid: #A5F3FC;
  --temp-cold: #3B82F6;
  --temp-cool: #22C55E;
  --temp-warm: #F97316;
  --temp-hot: #EF4444;
  --text-primary: #111827;
  --text-secondary: #374151;
  --text-muted: #6B7280;
  --border: #E5E7EB;
  --bg-main: #FAFAFA;
  --bg-secondary: #F3F4F6;
  --surface: #FFFFFF;
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.12);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.15);
  --fav-gold: #F59E0B;   /* favoritt-stjerne — finnes alt som rank-gull (#4330) */
}

@media (prefers-color-scheme: dark) {
  :root {
    --text-primary: #F9FAFB;
    --text-secondary: #D1D5DB;
    --text-muted: #9CA3AF;
    --border: #374151;
    --bg-main: #111827;
    --bg-secondary: #1F2937;
    --surface: #1F2937;
    --brand-light: #164E63;
  }
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-main);
}

h1 { font-size: 1.75rem; font-weight: 700; line-height: 1.2; margin-bottom: var(--space-md); }
h2 { font-size: 1.35rem; font-weight: 600; line-height: 1.3; margin-top: var(--space-xl); margin-bottom: var(--space-md); }
h3 { font-size: 1.1rem; font-weight: 600; }

/* === Header === */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-md);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

@media (prefers-color-scheme: dark) {
  .site-header {
    background: rgba(17, 24, 39, 0.92);
    border-bottom-color: rgba(255, 255, 255, 0.06);
  }
}

.site-logo {
  font-size: 1rem;
  font-weight: 700;
  color: var(--brand-deep);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.header-actions { display: flex; gap: var(--space-sm); }

.header-btn {
  font-size: 0.8rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: inherit;
}

.header-btn:hover {
  background: var(--bg-secondary);
  border-color: var(--brand);
  color: var(--brand);
}

/* === Breadcrumbs === */
.breadcrumbs {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: var(--space-sm) var(--space-md);
  position: fixed;
  top: 48px;
  left: 0;
  z-index: 900;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(6px);
  border-radius: 0 0 var(--radius-sm) 0;
}

.breadcrumbs a { color: var(--text-muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--brand); }

/* === Map === */
.map-container {
  position: relative;
  width: 100%;
  /* Landing hero (#4327): map fills the viewport below the 48px fixed header so
     the whole map is visible as the brand hero — no empty gap, first ad flows
     below. dvh excludes mobile browser chrome; vh is the fallback for older engines. */
  height: calc(100vh - 48px);
  height: calc(100dvh - 48px);
  min-height: 360px;
  margin-top: 48px;
}

#map {
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* Search */
.map-search {
  position: absolute;
  top: 12px;
  left: var(--space-md);
  right: var(--space-md);
  z-index: 500;
  max-width: 360px;
}

.map-search__input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  font-size: 0.9rem;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  outline: none;
  transition: border-color 0.15s;
}

.map-search__input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.15);
}

.map-search__icon {
  position: absolute;
  left: 12px;
  top: 11px;
  color: var(--text-muted);
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.map-search__results {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-top: 4px;
  box-shadow: var(--shadow-lg);
  max-height: 300px;
  overflow-y: auto;
}

.search-result {
  padding: 10px 14px;
  font-size: 0.85rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}

.search-result:last-child { border-bottom: none; }
.search-result:hover { background: var(--bg-secondary); }
.search-result--city { display: flex; flex-direction: column; gap: 1px; }
.search-result__detail { font-size: 0.75rem; color: var(--text-muted); }
.search-result__divider { padding: 4px 14px; font-size: 0.7rem; color: var(--text-muted); background: var(--bg-secondary); text-transform: uppercase; letter-spacing: 0.05em; }

/* Legend */
.map-legend {
  position: absolute;
  bottom: var(--space-lg);
  left: var(--space-md);
  z-index: 500;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  display: flex;
  gap: var(--space-md);
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.map-legend__item { display: flex; align-items: center; gap: 4px; }
.map-legend__dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* Filter button */
.map-filter-btn {
  position: absolute;
  bottom: var(--space-lg);
  right: var(--space-md);
  z-index: 500;
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  font-size: 0.85rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.map-filter-btn:hover { border-color: var(--brand); color: var(--brand); }

/* Locate button */
.map-locate-btn {
  position: absolute;
  bottom: calc(var(--space-lg) + 52px);
  right: var(--space-md);
  z-index: 500;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.map-locate-btn:hover { background: var(--brand-light); border-color: var(--brand); }
.map-locate-btn--active { background: var(--brand); border-color: var(--brand); color: white; }
.map-locate-btn--active svg { stroke: white; }

/* Scroll hint */
.scroll-hint {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--text-muted);
  font-size: 0.7rem;
  animation: bounce 2s infinite;
  pointer-events: none;
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-4px); }
}

/* Filter sheet */
.filter-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
  padding: var(--space-lg);
  transform: translateY(100%);
  transition: transform 0.3s ease;
  z-index: 1100;
}

.filter-sheet--open { transform: translateY(0); }

.filter-sheet__handle {
  width: 36px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 0 auto var(--space-md);
}

.filter-sheet__title {
  margin-bottom: var(--space-md);
}

.filter-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 1050;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.filter-overlay--open { opacity: 1; pointer-events: auto; }

.filter-group { margin-bottom: var(--space-md); }

.filter-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
}

.filter-select {
  width: 100%;
  padding: 8px 12px;
  font-size: 0.9rem;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.filter-apply {
  width: 100%;
  padding: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  background: var(--brand);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  margin-top: var(--space-sm);
}

.filter-apply:hover { background: var(--brand-hover); }

/* === Leaflet pin styling === */
.temp-pin { background: none !important; border: none !important; }

.temp-pin__value {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.9);
  padding: 2px 6px;
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}

.temp-pin__value[data-zone="hot"]  { color: #DC2626; border: 1.5px solid #FCA5A5; }
.temp-pin__value[data-zone="warm"] { color: #EA580C; border: 1.5px solid #FDBA74; }
.temp-pin__value[data-zone="cool"] { color: #16A34A; border: 1.5px solid #86EFAC; }
.temp-pin__value[data-zone="cold"] { color: #2563EB; border: 1.5px solid #93C5FD; }

/* Leaflet popup */
.leaflet-popup-content-wrapper {
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-lg) !important;
  padding: 0 !important;
  overflow: hidden;
}

.leaflet-popup-content { margin: 0 !important; }

.popup { padding: var(--space-md); min-width: 200px; }
.popup__name { font-size: 0.95rem; font-weight: 600; color: var(--text-primary); margin: 0 0 var(--space-xs); }
.popup__temp { font-size: 1.5rem; font-weight: 700; margin: 0 0 var(--space-xs); display: flex; align-items: center; gap: var(--space-sm); }

.popup__zone {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 999px;
  display: inline-block;
}

.popup__zone--hot  { background: #FEE2E2; color: #DC2626; }
.popup__zone--warm { background: #FFF7ED; color: #EA580C; }
.popup__zone--cool { background: #F0FDF4; color: #16A34A; }
.popup__zone--cold { background: #EFF6FF; color: #2563EB; }
.popup__meta { font-size: 0.8rem; color: var(--text-muted); margin: 0; }
.popup__stale { font-size: 0.75rem; color: #B45309; margin: 0.25rem 0 0; }
.temp-pin__value[data-zone="stale"] { color: #999; }

/* === Content section === */
.content-section {
  max-width: 720px;
  margin: 0 auto;
  padding: var(--space-xl) var(--space-md);
}

/* Top list */
.top-list { list-style: none; padding: 0; margin: var(--space-lg) 0; }

.top-list__item {
  display: flex;
  align-items: center;
  padding: var(--space-md);
  border-bottom: 1px solid var(--border);
  gap: var(--space-md);
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
  color: inherit;
}

.top-list__item:hover { background: var(--bg-secondary); }
.top-list__item:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }

.top-list__rank { font-size: 0.85rem; font-weight: 700; color: var(--text-muted); width: 28px; text-align: center; }
.top-list__rank--gold { color: #F59E0B; }
.top-list__rank--silver { color: #9CA3AF; }
.top-list__rank--bronze { color: #D97706; }

.top-list__info { flex: 1; }
.top-list__name { font-weight: 600; font-size: 0.95rem; }
.top-list__location { font-size: 0.8rem; color: var(--text-muted); }

.top-list__temp { font-size: 1.25rem; font-weight: 700; }
.top-list__temp--hot  { color: #EF4444; }
.top-list__temp--warm { color: #F97316; }
.top-list__temp--cool { color: #22C55E; }
.top-list__temp--cold { color: #3B82F6; }

/* Region grid */
.region-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-md);
  margin: var(--space-lg) 0;
}

.region-card {
  padding: var(--space-md);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
}

.region-card:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.region-card__name { font-size: 0.85rem; font-weight: 600; color: var(--text-secondary); margin-bottom: var(--space-xs); }
.region-card__temp { font-size: 1.5rem; font-weight: 700; }
.region-card__label { font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; }

/* City nav */
.city-nav { display: flex; flex-wrap: wrap; gap: var(--space-sm); margin: var(--space-lg) 0; }

.city-nav__link {
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s;
}

.city-nav__link:hover { background: var(--brand-light); color: var(--brand); }
.city-nav__link--active { background: var(--brand); color: white; }

/* FAQ */
.faq-list { margin: var(--space-lg) 0; }
.faq-item { border-bottom: 1px solid var(--border); }

.faq-item__question {
  width: 100%;
  text-align: left;
  padding: var(--space-md) 0;
  background: none;
  border: none;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
}

.faq-item__question:hover { color: var(--brand); }

.faq-item__icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  transition: transform 0.2s;
  color: var(--text-muted);
}

.faq-item--open .faq-item__icon { transform: rotate(45deg); }

.faq-item__answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.faq-item--open .faq-item__answer { max-height: 500px; }

.faq-item__answer-inner {
  padding: 0 0 var(--space-md);
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* === Footer === */
.site-footer {
  background: var(--brand-deep);
  color: rgba(255, 255, 255, 0.85);
  padding: var(--space-xl) var(--space-md);
  text-align: center;
}

.footer__ecosystem { margin-bottom: var(--space-lg); }

.footer__ecosystem-title {
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: var(--space-md);
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-md);
}

.footer__link {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.15s;
}

.footer__link:hover { color: white; }

.footer__beep {
  margin-top: var(--space-lg);
  padding: var(--space-md);
  background: rgba(254, 190, 16, 0.1);
  border-radius: var(--radius-md);
  border: 1px solid rgba(254, 190, 16, 0.2);
}

.footer__beep-text { font-size: 0.85rem; color: rgba(255, 255, 255, 0.9); }
.footer__beep-link { color: #FEBE10; font-weight: 600; text-decoration: none; }
.footer__copyright { margin-top: var(--space-lg); font-size: 0.75rem; color: rgba(255, 255, 255, 0.4); }

/* === Beach detail page === */
.beach-detail {
  max-width: 720px;
  margin: 0 auto;
  padding: 60px var(--space-md) var(--space-xl);
}

.beach-detail__header { margin-bottom: var(--space-lg); }

.beach-breadcrumbs {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

.beach-breadcrumbs a { color: var(--text-muted); text-decoration: none; }
.beach-breadcrumbs a:hover { color: var(--brand); }

.beach-detail__location { font-size: 1rem; color: var(--text-secondary); margin-top: -0.5rem; }
.beach-detail__stale-note { font-size: 0.85rem; color: #B45309; margin-top: var(--space-sm); }
.beach-detail__updated {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: var(--space-sm);
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.beach-detail__updated-label { font-weight: 600; color: var(--text-primary); }
.beach-detail__updated-source { color: var(--text-muted); }
.beach-detail__notice {
  margin-top: var(--space-sm);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  border-left: 4px solid;
}
.beach-detail__notice strong { display: block; margin-bottom: 0.4rem; }
.beach-detail__notice p { font-size: 0.9rem; margin: 0.25rem 0 0; }
.beach-detail__notice--warn { background: #FEF3C7; border-color: #B45309; color: #78350F; }
.beach-detail__notice--inactive { background: #E0F2FE; border-color: #0891B2; color: #0C4A6E; }
/* Calm, non-alarming freshness note for stale readings (#4252 §5) */
.beach-detail__freshness {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  margin-top: var(--space-sm);
  padding: 0.6rem 0.8rem;
  background: var(--bg-secondary);
  border-left: 3px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.85rem;
}
.beach-detail__freshness-icon { flex: 0 0 auto; line-height: 1.45; }
.beach-detail__freshness-body strong { display: block; margin-bottom: 0.15rem; color: var(--text-primary); }
.beach-detail__freshness-body p { margin: 0; font-size: 0.85rem; }
.beach-detail__source { font-size: 0.75rem; color: var(--text-muted); margin-top: var(--space-xl); text-align: center; }

/* Weather cards */
.weather-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
}

.weather-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.weather-card--hot  { border-color: var(--temp-hot); border-width: 2px; }
.weather-card--warm { border-color: var(--temp-warm); border-width: 2px; }
.weather-card--cool { border-color: var(--temp-cool); border-width: 2px; }
.weather-card--cold { border-color: var(--temp-cold); border-width: 2px; }

.weather-card__icon { font-size: 1.5rem; }
.weather-card__label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.weather-card__value { font-size: 1.4rem; font-weight: 700; }
.weather-card__zone { font-size: 0.7rem; font-weight: 500; color: var(--text-muted); }
/* §6 stale temp-kort: nøytral grå, ingen sonefarge — et gammelt tall skal ikke se «live»/varmt ut (#4252) */
.weather-card--stale { border-color: var(--border); opacity: 0.9; }
.weather-card--stale .weather-card__value { color: var(--text-secondary); }
.weather-card--stale .weather-card__zone { color: var(--text-muted); font-style: italic; }

/* Beach map */
.beach-map-section { margin-bottom: var(--space-xl); }

#map.beach-map {
  height: 300px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
}
#map.beach-map .leaflet-top.leaflet-right {
  top: 10px;
  right: 10px;
}

/* Beach sections */
.beach-section { margin-bottom: var(--space-xl); }

/* AdSense in-content slot — reserve space to avoid CLS (#3195) */
.ad-container {
  margin: var(--space-xl) 0;
  min-height: 280px;
  /* #4328: IKKE bruk aspect-ratio her. aspect-ratio:4/1 + min-height:280px lot
     bredden bli utledet fra høyden (280×4 = 1120px), som ga horisontal overflow
     og blåste opp layout-viewporten til ~1136px på mobil — fixed header og
     consent-banneren ble da strukket «off layout». min-height alene reserverer
     nok plass til å unngå CLS (#3195). max-width:100% er et sikkerhetsnett mot
     at en responsiv annonse-fill skriver en for bred inline-bredde. */
  max-width: 100%;
  overflow: hidden;
  contain: layout;
  text-align: center;
  /* match page bg so an unfilled slot reads as whitespace, not a blank stripe */
  background: var(--bg-main);
}
.ad-container .adsbygoogle { display: block; width: 100%; max-width: 100%; min-height: 280px; }

/* Nearby list */
.nearby-list { display: flex; flex-direction: column; }

.nearby-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
}

.nearby-item:hover { background: var(--bg-secondary); }
.nearby-item__info { flex: 1; }
.nearby-item__name { font-weight: 600; font-size: 0.95rem; }
.nearby-item__location { font-size: 0.8rem; color: var(--text-muted); }

.nearby-item__temp { font-size: 1.2rem; font-weight: 700; }
.nearby-item__temp--hot  { color: var(--temp-hot); }
.nearby-item__temp--warm { color: var(--temp-warm); }
.nearby-item__temp--cool { color: var(--temp-cool); }
.nearby-item__temp--cold { color: var(--temp-cold); }
/* §3 nærliggende: grønn fersk-prikk + dempet temp for stale alternativ (#4252) */
.nearby-item__temp--stale { color: var(--text-muted); font-weight: 600; }
.nearby-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #16A34A; margin-right: 6px; vertical-align: middle; }
.nearby-lead { font-size: 0.9rem; color: var(--text-secondary); margin: 0 0 var(--space-sm); }
.beach-404-actions { display: flex; flex-wrap: wrap; gap: var(--space-sm); justify-content: center; }

/* Beep.me CTA */
.beep-section { text-align: center; }
.beep-section__desc { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: var(--space-lg); }

.beep-buttons {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: var(--space-md);
}

.beep-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--space-md) var(--space-xl);
  border-radius: var(--radius-lg);
  border: 2px solid var(--border);
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 100px;
}

.beep-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.beep-btn--cool { border-color: var(--temp-cool); }
.beep-btn--cool:hover { background: #F0FDF4; }
.beep-btn--warm { border-color: var(--temp-warm); }
.beep-btn--warm:hover { background: #FFF7ED; }
.beep-btn--hot { border-color: var(--temp-hot); }
.beep-btn--hot:hover { background: #FEF2F2; }
.beep-btn--fire { border-color: #9333EA; }
.beep-btn--fire:hover { background: #FAF5FF; }

.beep-btn__temp { font-size: 1.5rem; font-weight: 700; }
.beep-btn--cool .beep-btn__temp { color: var(--temp-cool); }
.beep-btn--warm .beep-btn__temp { color: var(--temp-warm); }
.beep-btn--hot .beep-btn__temp { color: var(--temp-hot); }
.beep-btn--fire .beep-btn__temp { color: #9333EA; }

.beep-btn__label { font-size: 0.75rem; color: var(--text-muted); }

.beep-section__footer { font-size: 0.75rem; color: var(--text-muted); }
.beep-section__footer a { color: var(--brand); text-decoration: none; }

/* Chart */
.chart-container {
  position: relative;
  height: 250px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
}

.chart-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: var(--space-xl) 0;
}

.chart-legend {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: var(--space-sm);
  line-height: 1.4;
}

/* === Mobile === */
@media (max-width: 640px) {
  .map-search {
    top: 8px;
    left: var(--space-sm);
    right: var(--space-sm);
    max-width: none;
  }

  .map-legend {
    bottom: var(--space-md);
    left: var(--space-sm);
    font-size: 0.65rem;
    gap: var(--space-sm);
    padding: 6px 10px;
  }

  .content-section { padding: var(--space-lg) var(--space-sm); }
  .region-grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-sm); }

  .btn-label { display: none; }

  .leaflet-popup-content-wrapper { max-width: calc(100vw - 48px) !important; }
}

@media (min-width: 641px) {
  .filter-sheet {
    position: fixed;
    bottom: auto;
    top: auto;
    right: var(--space-md);
    left: auto;
    bottom: 80px;
    width: 300px;
    border-radius: var(--radius-lg);
  }
  /* Lukket sheet på desktop: translateY(100%) flytter kun ned med egen høyde, og
     med bottom:80px ble 80px hengende synlig i hjørnet (gjaldt også den eksisterende
     Filtrer-sheeten). Skjul helt når den ikke er åpen. (#4330) */
  .filter-sheet:not(.filter-sheet--open) { transform: translateY(calc(100% + 96px)); }
}

/* === Affiliate modules === */
.affiliate-module { margin: var(--space-xl) 0; }

.affiliate-disclosure-inline {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
  margin: -0.4rem 0 var(--space-md);
}

.booking-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-sm);
}

.booking-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.booking-card:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.booking-card__icon { font-size: 1.75rem; flex-shrink: 0; }
.booking-card__body { flex: 1; min-width: 0; }
.booking-card__title { font-weight: 600; font-size: 0.95rem; margin-bottom: 0.1rem; }
.booking-card__desc { font-size: 0.8rem; color: var(--text-muted); }
.booking-card__arrow { color: var(--text-muted); font-size: 1.4rem; flex-shrink: 0; }

.amazon-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-sm);
}

.amazon-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-md) var(--space-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, transform 0.15s;
}

.amazon-card:hover {
  border-color: var(--brand);
  transform: translateY(-1px);
}

.amazon-card__icon { font-size: 1.6rem; }
.amazon-card__label { font-size: 0.85rem; font-weight: 500; }

@media (max-width: 640px) {
  .amazon-strip { grid-template-columns: repeat(2, 1fr); }
}

.footer__legal {
  margin-top: var(--space-md);
  font-size: 0.78rem;
  text-align: center;
}

.footer__legal a { color: var(--text-muted); text-decoration: underline; }
.footer__legal a:hover { color: var(--brand); }

/* ICS calendar download CTA (task #2876) */
.ics-cta {
  margin: var(--space-md) 0 var(--space-lg);
  padding: var(--space-md) var(--space-lg);
  background: var(--brand-light);
  border: 1px solid var(--brand-mid);
  border-radius: var(--radius-lg);
}

.ics-cta__head {
  display: flex; align-items: center; gap: var(--space-sm);
  margin-bottom: var(--space-xs);
}

.ics-cta__icon { color: var(--brand-deep); flex-shrink: 0; }

.ics-cta__title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--brand-deep);
  margin: 0;
}

.ics-cta__lead {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin: 0 0 var(--space-md);
}

.ics-cta__buttons {
  display: flex; flex-wrap: wrap; gap: var(--space-sm);
}

.ics-cta__btn {
  display: inline-block;
  padding: 0.55rem 0.95rem;
  background: var(--surface);
  border: 1px solid var(--brand);
  border-radius: var(--radius-md);
  color: var(--brand-deep);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s, transform 0.15s;
}

.ics-cta__btn:hover { background: var(--brand); color: #fff; }

.ics-cta__btn--primary {
  background: var(--brand);
  color: #fff;
}

.ics-cta__btn--primary:hover { background: var(--brand-hover); }

.ics-cta__more {
  margin-top: var(--space-md);
  font-size: 0.9rem;
}

.ics-cta__more summary {
  cursor: pointer;
  color: var(--brand-deep);
  font-weight: 500;
  padding: var(--space-xs) 0;
}

.ics-cta__list {
  list-style: none;
  margin: var(--space-sm) 0;
  padding: 0;
  display: grid;
  gap: var(--space-xs);
}

.ics-cta__list a {
  display: block;
  padding: var(--space-xs) var(--space-sm);
  color: var(--text-secondary);
  text-decoration: none;
  border-left: 2px solid var(--brand-mid);
}

.ics-cta__list a:hover { color: var(--brand-deep); border-left-color: var(--brand); }

.ics-cta__hint {
  margin-top: var(--space-sm);
  font-size: 0.8rem;
  color: var(--text-muted);
}

@media (prefers-color-scheme: dark) {
  .ics-cta { background: rgba(8, 145, 178, 0.12); border-color: rgba(165, 243, 252, 0.25); }
  .ics-cta__btn { background: var(--bg-secondary); }
}

/* ICS calendar CTA (task #2876) */
.ics-cta {
  margin: var(--space-lg) 0;
  padding: var(--space-md) var(--space-lg);
  background: var(--brand-light);
  border: 1px solid var(--brand-mid);
  border-radius: var(--radius-lg);
}

.ics-cta__head {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-xs);
}

.ics-cta__icon { color: var(--brand-deep); flex-shrink: 0; }

.ics-cta__title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
  color: var(--brand-deep);
}

.ics-cta__lead {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

.ics-cta__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.ics-cta__btn {
  display: inline-block;
  padding: 0.5rem 0.9rem;
  background: var(--surface);
  color: var(--brand-deep);
  border: 1px solid var(--brand-mid);
  border-radius: var(--radius-md);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s;
}

.ics-cta__btn:hover { background: var(--brand-mid); border-color: var(--brand); }

.ics-cta__btn--primary {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.ics-cta__btn--primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }

.ics-cta__more { margin-top: var(--space-sm); }

.ics-cta__more summary {
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--brand-deep);
  padding: var(--space-xs) 0;
}

.ics-cta__list {
  list-style: none;
  padding-left: 0;
  margin-top: var(--space-sm);
  display: grid;
  gap: var(--space-xs);
}

.ics-cta__list a {
  display: block;
  padding: 0.45rem var(--space-sm);
  color: var(--text-primary);
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}

.ics-cta__list a:hover { border-color: var(--brand); color: var(--brand-deep); }

.ics-cta__hint {
  margin-top: var(--space-sm);
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ============================================================
   «Mine badeplasser» — favoritt-stjerner + panel (#4330)
   Alt klient-side; gull = var(--fav-gold), samme som rank-gull.
   ============================================================ */

/* Stjerne-knapp — to størrelser. Alltid <button aria-pressed>, aldri <a>. */
.fav-star {
  flex: 0 0 44px; width: 44px; height: 44px;      /* WCAG 2.5.5 treff-mål */
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0; background: none; border: none; cursor: pointer;
  color: var(--text-muted); border-radius: var(--radius-sm);
  -webkit-tap-highlight-color: transparent;
}
.fav-star__icon {
  width: 24px; height: 24px; fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linejoin: round; transition: fill .12s;
}
.fav-star:hover { color: var(--fav-gold); background: var(--bg-secondary); }
.fav-star:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.fav-star[aria-pressed="true"] { color: var(--fav-gold); }
.fav-star[aria-pressed="true"] .fav-star__icon { fill: var(--fav-gold); stroke: var(--fav-gold); }
.fav-star--pop .fav-star__icon { animation: favpop .28s ease; }
@keyframes favpop { 0% { transform: scale(1); } 45% { transform: scale(1.25); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .fav-star--pop .fav-star__icon { animation: none; } }

/* Detalj-variant: ikon + ord, så hovedhandlingen er utvetydig */
.fav-star--labeled {
  width: auto; gap: .4rem; padding: 0 .8rem; flex: 0 0 auto;
  border: 1px solid var(--border); height: 40px; font-size: .9rem; font-weight: 600;
  color: var(--text-secondary); background: var(--surface);
}
.fav-star--labeled::after { content: "Lagre"; }
.fav-star--labeled[aria-pressed="true"]::after { content: "Lagret"; }
.fav-star--labeled[aria-pressed="true"] { border-color: var(--fav-gold); color: var(--fav-gold); }
.popup__fav { margin-top: var(--space-xs); }   /* «Lagre»-knapp i kart-popup */

/* Liste-kort: stjernen er SØSKEN av <a> (egen kolonne), aldri inni lenken.
   Flytt skillelinja fra kortet til rad-wrapperen så den går helt ut. */
.top-list__row, .nearby-item-row { display: flex; align-items: stretch; border-bottom: 1px solid var(--border); }
.top-list__row .top-list__item, .nearby-item-row .nearby-item { flex: 1; border-bottom: none; }
.top-list__row .fav-star, .nearby-item-row .fav-star { align-self: center; }

/* Beach-detalj tittel-rad (H1 + Lagre-knapp) */
.beach-detail__title-row { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-md); }
.beach-detail__title-row h1 { margin-bottom: 0; }

/* Header «★ Mine»-knapp + teller */
.fav-count {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--fav-gold); color: #fff; font-size: .72rem; font-weight: 700;
  line-height: 1; display: inline-flex; align-items: center; justify-content: center;
}
.fav-count[hidden] { display: none; }   /* [hidden] må slå display-regelen over (skjult ved 0) */

/* «Mine badeplasser»-panel — gjenbruker .filter-sheet/.filter-overlay.
   z-index må slå epakvibes consent-banner (99999) så panelet brukeren nettopp
   åpnet faktisk er synlig på mobil (bunn-sheet kolliderer ellers med banneret).
   Scoped til .mine-* → rører ikke den delte .filter-sheet. */
.mine-overlay { z-index: 100000; }
.mine-sheet { z-index: 100001; max-height: 70vh; display: flex; flex-direction: column; }
.mine-sheet__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); margin-bottom: var(--space-xs); }
.mine-sheet__head .filter-sheet__title { margin-bottom: 0; }
.mine-sheet__close {
  flex: 0 0 auto; width: 36px; height: 36px; border: none; background: none;
  cursor: pointer; font-size: 1.05rem; color: var(--text-muted); border-radius: var(--radius-sm);
}
.mine-sheet__close:hover { background: var(--bg-secondary); color: var(--text-primary); }
.mine-mapfilter { display: flex; align-items: center; gap: var(--space-sm); font-size: .85rem; color: var(--text-secondary); padding: var(--space-xs) 0 var(--space-sm); cursor: pointer; }
.mine-mapfilter[hidden] { display: none; }   /* skjult når ingen favoritter */

.mine-list { flex: 1 1 auto; overflow-y: auto; margin: 0 calc(-1 * var(--space-lg)); }
.mine-item { display: flex; align-items: center; gap: var(--space-sm); padding: var(--space-sm) var(--space-lg); border-bottom: 1px solid var(--border); }
.mine-item:last-child { border-bottom: none; }
.mine-item__info { flex: 1; min-width: 0; }
.mine-item__name { display: block; font-weight: 600; font-size: .92rem; color: var(--text-primary); text-decoration: none; }
.mine-item__name:hover { color: var(--brand); }
.mine-item__sub { font-size: .78rem; color: var(--text-muted); }
.mine-item__map { background: none; border: none; padding: 0; font: inherit; font-size: .78rem; color: var(--brand); cursor: pointer; text-decoration: underline; }
.mine-item__temp { flex: 0 0 auto; font-size: 1.1rem; font-weight: 700; white-space: nowrap; }
.mine-item__temp--hot  { color: var(--temp-hot); }
.mine-item__temp--warm { color: var(--temp-warm); }
.mine-item__temp--cool { color: var(--temp-cool); }
.mine-item__temp--cold { color: var(--temp-cold); }
.mine-item__temp--stale { color: var(--text-muted); font-weight: 600; font-size: .95rem; }
.mine-item__temp--na { color: var(--text-muted); font-weight: 500; font-size: .8rem; }
.mine-item .fav-star { flex: 0 0 40px; width: 40px; height: 40px; }

/* Tom-tilstand inni panelet — «mulighet, ikke feil» */
.mine-empty { text-align: center; padding: var(--space-lg) var(--space-md); }
.mine-empty__star { display: block; width: 48px; height: 48px; margin: 0 auto var(--space-sm); fill: none; stroke: var(--fav-gold); stroke-width: 1.5; stroke-linejoin: round; }
.mine-empty__title { font-weight: 700; color: var(--text-primary); margin: 0 0 var(--space-xs); }
.mine-empty__hint { font-size: .88rem; color: var(--text-secondary); line-height: 1.5; margin: 0 auto var(--space-md); max-width: 34ch; }
.mine-empty__actions { display: flex; gap: var(--space-sm); justify-content: center; flex-wrap: wrap; }
.mine-empty__btn { padding: 8px 16px; border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--surface); color: var(--text-secondary); font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; }
.mine-empty__btn:hover { border-color: var(--brand); color: var(--brand); }
.mine-empty__btn--primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.mine-empty__btn--primary:hover { background: var(--brand-hover); color: #fff; }

/* Engangs-coachmark toast — auto-adapterer til lys/mørk via tokens */
.fav-toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 100002;  /* over consent-banner (99999) så engangs-coachmarken faktisk synes */
  transform: translateX(-50%) translateY(8px);
  max-width: calc(100vw - 32px);
  background: var(--text-primary); color: var(--bg-main);
  padding: 10px 16px; border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
  font-size: .85rem; font-weight: 500; text-align: center;
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
}
.fav-toast--show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .fav-toast { transform: translateX(-50%); transition: opacity .25s; }
  .fav-toast--show { transform: translateX(-50%); }
}

/* Kart-overlay når «Vis bare mine» er på, men ingen er lagret ennå */
.map-mine-empty {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 480;
  background: rgba(255,255,255,0.95); color: var(--text-secondary);
  padding: 10px 16px; border-radius: var(--radius-md); box-shadow: var(--shadow-md);
  font-size: .85rem; font-weight: 500; max-width: calc(100% - 32px); text-align: center;
}
@media (prefers-color-scheme: dark) { .map-mine-empty { background: rgba(31,41,55,0.95); } }
