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

:root {
  --bg: #0a0a1a;
  --bg-card: #12122a;
  --bg-card-alt: #1a1a3a;
  --text: #ffffff;
  --text-dim: #8888aa;
  --accent: #4a9eff;
  --success: #2ecc71;
  --warning: #f1c40f;
  --danger: #e74c3c;
  --purple: #9b59b6;
  --cyan: #00d4ff;
  --border: #2a2a4a;
  --glow: rgba(74, 158, 255, 0.3);
}

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  background-image: radial-gradient(ellipse at top, #1a1a3a 0%, #0a0a1a 70%);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

.app { 
  max-width: 1600px; 
  margin: 0 auto; 
  padding: 1rem; 
  overflow-x: hidden; 
}

@media (min-width: 900px) {
  .app { padding: 1.5rem 2rem; }
}

@media (min-width: 1400px) {
  .app { padding: 2rem 3rem; }
}

/* ==================== Location Search Bar ==================== */
.location-bar {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-card-alt) 100%);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
}

.location-bar-content {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.location-current {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.location-icon {
  font-size: 1.2rem;
}

.location-name {
  font-weight: 600;
  font-size: 1rem;
}

.location-badge {
  background: var(--accent);
  color: #000;
  font-size: 0.65rem;
  padding: 0.2rem 0.5rem;
  border-radius: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.location-badge.custom {
  background: var(--purple);
  color: #fff;
}

.location-badge.hidden {
  display: none;
}

.location-search-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 350px;
}

.location-search-wrap input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.9rem;
}

.location-search-wrap input:focus {
  outline: none;
  border-color: var(--accent);
}

.location-search-wrap input::placeholder {
  color: var(--text-dim);
}

.location-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-top: 4px;
  max-height: 250px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
}

.location-results.visible {
  display: block;
}

.location-result-item {
  padding: 0.6rem 0.75rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.location-result-item:last-child {
  border-bottom: none;
}

.location-result-item:hover {
  background: var(--bg-card-alt);
}

.location-result-item .result-name {
  font-weight: 500;
}

.location-result-item .result-region {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.location-reset {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.location-reset.visible {
  display: flex;
}

.location-reset:hover {
  border-color: var(--danger);
  color: var(--danger);
}

@media (max-width: 600px) {
  .location-bar-content {
    flex-direction: column;
    align-items: stretch;
  }
  
  .location-current {
    justify-content: center;
  }
  
  .location-search-wrap {
    max-width: none;
  }
  
  .location-reset {
    align-self: center;
  }
}

/* Alerts */
.alerts-banner {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  padding: 0.75rem 1rem;
  border-radius: 12px;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: pulse 2s infinite;
}
.alerts-banner.hidden { display: none; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.8; } }

/* Day Forecast Banner */
.day-forecast-banner {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-card-alt) 100%);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
}
.forecast-main {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
}
.forecast-now {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.forecast-icon {
  font-size: 2.5rem;
}
.temp-current-big {
  font-size: 2.5rem;
  font-weight: 300;
}
.forecast-details {
  flex: 1;
}
.forecast-period {
  font-size: 0.7rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}
.forecast-text {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}
.forecast-meta {
  display: flex;
  gap: 1.25rem;
  font-size: 0.85rem;
  color: var(--text-dim);
  flex-wrap: wrap;
}
.forecast-meta span { display: flex; align-items: center; gap: 0.25rem; }
.temp-high { color: #FF6B6B; }
.temp-low { color: #4ECDC4; }

.precip-badge {
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 500;
}
.precip-badge.precip-expected {
  background: rgba(74, 158, 255, 0.2);
  color: var(--accent);
}
.precip-badge.no-precip {
  background: rgba(46, 204, 113, 0.2);
  color: var(--success);
}

.forecast-hours-wrapper {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.forecast-hours-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.forecast-hours {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.forecast-hour {
  flex: 0 0 55px;
  text-align: center;
  padding: 0.5rem 0.25rem;
  background: var(--bg);
  border-radius: 8px;
  transition: transform 0.15s, background 0.15s;
}

.forecast-hour:hover {
  background: var(--bg-card-alt);
  transform: translateY(-2px);
}

.forecast-hour-time {
  font-size: 0.6rem;
  color: var(--text-dim);
  margin-bottom: 0.2rem;
  white-space: nowrap;
}

.forecast-hour-icon {
  font-size: 1.1rem;
  margin-bottom: 0.2rem;
}

.forecast-hour-temp {
  font-size: 0.85rem;
  font-weight: 600;
}

.forecast-hour-rain {
  font-size: 0.6rem;
  color: var(--accent);
  background: rgba(74, 158, 255, 0.2);
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
  margin-top: 0.2rem;
}

.forecast-hour-rain::before {
  content: '💧';
  font-size: 0.55rem;
  margin-right: 0.1rem;
}

@media (max-width: 600px) {
  .forecast-main { flex-direction: column; text-align: center; gap: 1rem; }
  .forecast-meta { justify-content: center; flex-wrap: wrap; }
}

/* Header */
.header { margin-bottom: 1.5rem; }
.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.header-title h1 { font-size: 1.5rem; font-weight: 600; }
.header-subtitle { font-size: 0.8rem; color: var(--text-dim); }
.header-controls { display: flex; align-items: center; gap: 1rem; }
.update-badge {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(46, 204, 113, 0.2);
  color: var(--success);
  padding: 0.3rem 0.7rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
}
.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.5; transform: scale(0.8); } }
.update-time { font-size: 0.8rem; color: var(--text-dim); }
.btn-icon {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.5rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-icon:hover { background: var(--bg-card-alt); transform: translateY(-1px); }
.btn-small {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.75rem;
  text-decoration: none;
  transition: all 0.2s;
}
.btn-small:hover, .btn-small.active { background: var(--accent); border-color: var(--accent); }
.btn-primary {
  background: var(--accent);
  border: none;
  color: white;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
}
.btn-primary:hover { filter: brightness(1.1); transform: translateY(-1px); }

/* Dashboard */
.dashboard {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  width: 100%;
}

/* Mobile - force single column */
@media (max-width: 767px) {
  .dashboard {
    grid-template-columns: 1fr !important;
    gap: 1rem;
  }
  
  .dashboard > .card,
  .dashboard > section {
    grid-column: span 1 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }
}

/* Tablet */
@media (min-width: 768px) {
  .dashboard {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }
  .card-wide { grid-column: span 2; }
  .card-full { grid-column: span 2; }
}

/* Desktop */
@media (min-width: 1200px) {
  .dashboard {
    grid-template-columns: repeat(12, 1fr);
    gap: 1.25rem;
  }
  
  /* Default card = 4 cols (third width) */
  .card { grid-column: span 4; }
  
  /* Wide card = 6 cols (half width) */
  .card-wide { grid-column: span 6; }
  
  /* Full card = 12 cols (full width) */
  .card-full { grid-column: span 12; }
  
  /* ROW 1 - ACTUEEL: Hero, Stats, Wind, Pressure */
  .card-hero { grid-column: span 3; }
  .card-stats { grid-column: span 3; }
  .card-wind { grid-column: span 3; }
  .card-pressure { grid-column: span 3; }
  
  /* ROW 1B - SNEEUW (alleen zichtbaar bij temp < 5°C, full width) */
  .card-snow-indicator { grid-column: span 12; }
  
  /* ROW 2 - KORTE TERMIJN: Nowcast, Radar */
  .card-nowcast { grid-column: span 6; }
  .card-radar { grid-column: span 6; }
  
  /* ROW 3 - LANGERE TERMIJN: Forecast, Zambretti */
  .card-forecast { grid-column: span 10; }
  .card-zambretti { grid-column: span 2; }
  
  /* ROW 4 - ENSEMBLE (full - needs space for spaghetti plot) */
  .card-ensemble { grid-column: span 12; }
  
  /* ROW 5 - ANALYSE: Microclimate, Extremes, NL Map, Scorecard */
  .card-microclimate { grid-column: span 3; }
  .card-extremes { grid-column: span 3; }
  .card-nlmap { grid-column: span 3; }
  .card-scorecard { grid-column: span 3; }
  
  /* ROW 6 - FENOMENEN: Phenomena, Rain, Deep Sky */
  .card-phenomena { grid-column: span 4; }
  .card-rain { grid-column: span 4; }
  .card-deepsky { grid-column: span 4; }
  
  /* ROW 7 - ASTRONOMIE: Astro (full) */
  .card-astro { grid-column: span 12; }
  
  /* ROW 8 - HISTORISCH: Chart, Records, UV */
  .card-chart { grid-column: span 6; }
  .card-records { grid-column: span 3; }
  .card-uv { grid-column: span 3; }
  
  /* ROW 9 - EDUCATIEF: Wet Bulb Explainer */
  .card-wetbulb-explainer { grid-column: span 12; }
  
  /* ROW 10 - OVERIG: Guestbook */
  .card-guestbook { grid-column: span 12; }
}

/* Large Desktop */
@media (min-width: 1600px) {
  .dashboard {
    gap: 1.5rem;
  }
}

/* Cards */
.card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 1.5rem;
  border: 1px solid var(--border);
  transition: transform 0.2s, box-shadow 0.2s;
  min-width: 0;
  overflow: hidden;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(0,0,0,0.3); }
.card h2 { 
  font-size: 1rem; 
  font-weight: 500; 
  color: var(--text-dim); 
  margin-bottom: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Allow titles to wrap on smaller cards */
@media (max-width: 1400px) {
  .card h2 {
    white-space: normal;
    hyphens: auto;
  }
}

@media (max-width: 767px) {
  .card { padding: 1.25rem; }
}

/* Hero Card */
.card-hero {
  text-align: center;
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-card-alt) 100%);
}
.hero-temp { display: flex; justify-content: center; align-items: baseline; gap: 0.25rem; }
.temp-value { font-size: 4.5rem; font-weight: 200; line-height: 1; }
.temp-unit { font-size: 1.75rem; color: var(--text-dim); }
.hero-feels { color: var(--text-dim); margin-top: 0.5rem; font-size: 0.95rem; }
.hero-change { font-size: 0.9rem; margin-top: 0.25rem; }

@media (min-width: 900px) {
  .temp-value { font-size: 5.5rem; }
  .temp-unit { font-size: 2rem; }
}
.hero-change.up { color: var(--danger); }
.hero-change.down { color: var(--accent); }
.hero-range { margin: 1.5rem 0; }
.hero-minmax { display: flex; justify-content: center; gap: 2rem; margin-top: 1rem; }
.minmax-box { text-align: center; }
.minmax-icon { font-size: 1rem; }
.minmax-value { font-size: 1.5rem; font-weight: 500; display: block; }
.minmax-label { font-size: 0.7rem; color: var(--text-dim); }

/* Range bars */
.range-bar {
  height: 10px;
  border-radius: 5px;
  position: relative;
  margin-bottom: 0.5rem;
}
.temp-gradient { background: linear-gradient(90deg, #3498db, #2ecc71, #f1c40f, #e67e22, #e74c3c); }
.wind-gradient { background: linear-gradient(90deg, #2ecc71, #f1c40f, #e67e22, #e74c3c); }
.rain-gradient { background: linear-gradient(90deg, #3498db, #2980b9, #8e44ad); }
.range-marker {
  position: absolute;
  top: -5px;
  width: 20px;
  height: 20px;
  background: white;
  border: 3px solid var(--bg);
  border-radius: 50%;
  transform: translateX(-50%);
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  transition: left 0.5s ease;
}
.range-labels { display: flex; justify-content: space-between; font-size: 0.7rem; color: var(--text-dim); }
.range-labels.small { font-size: 0.65rem; }

/* Stats */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
.stat-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--bg);
  border-radius: 12px;
}
.stat-icon { font-size: 1.5rem; }
.stat-value { font-size: 1.2rem; font-weight: 600; display: block; }
.stat-label { font-size: 0.7rem; color: var(--text-dim); }
.stat-value small { font-size: 0.6em; opacity: 0.7; }
.solar-trend { margin-left: 0.25rem; font-size: 0.8rem; }

/* Zambretti */
.card-zambretti { text-align: center; }
.zambretti-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.zambretti-text { font-size: 1.25rem; font-weight: 500; }
.zambretti-note { font-size: 0.75rem; color: var(--text-dim); margin-top: 0.5rem; }

/* Wind */
.wind-layout { display: grid; grid-template-columns: 1fr 220px; gap: 1.5rem; align-items: center; }
.wind-speed { display: flex; align-items: baseline; gap: 0.5rem; margin-bottom: 1rem; }
.big-value { font-size: 3rem; font-weight: 200; }
.big-unit { font-size: 1rem; color: var(--text-dim); }
.wind-info { margin-top: 1rem; }
.info-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}
.info-row span:first-child { color: var(--text-dim); }
.wind-rose-wrap { display: flex; justify-content: center; }
#windRose { max-width: 100%; height: auto; }

@media (max-width: 600px) {
  .wind-layout { grid-template-columns: 1fr; }
  .wind-rose-wrap { margin-top: 1rem; }
}

/* Rain & Pressure */
.rain-main, .pressure-main { text-align: center; margin-bottom: 1rem; }
.rain-total { text-align: center; padding: 0.75rem; background: var(--bg); border-radius: 8px; margin-top: 1rem; }
.pressure-trend { text-align: center; display: flex; justify-content: center; gap: 0.5rem; align-items: center; }
.trend-arrow { font-size: 1.5rem; }
.trend-change { font-size: 0.8rem; color: var(--text-dim); }
.pressure-gauge, .gauge-bar {
  height: 8px;
  background: linear-gradient(90deg, #e74c3c, #f39c12, #2ecc71, #f39c12, #e74c3c);
  border-radius: 4px;
  position: relative;
  margin-top: 1rem;
}
.gauge-marker {
  position: absolute;
  top: -6px;
  width: 20px;
  height: 20px;
  background: white;
  border: 3px solid var(--bg);
  border-radius: 50%;
  transform: translateX(-50%);
  transition: left 0.5s ease;
}
.gauge-labels { display: flex; justify-content: space-between; font-size: 0.65rem; color: var(--text-dim); margin-top: 0.25rem; }

/* Forecast */
.forecast-days {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(85px, 1fr));
  gap: 0.5rem;
}

@media (min-width: 600px) {
  .forecast-days {
    grid-template-columns: repeat(7, 1fr);
  }
}

.forecast-day {
  text-align: center;
  padding: 0.75rem 0.4rem;
  background: var(--bg);
  border-radius: 12px;
}
.forecast-day-name { font-size: 0.75rem; color: var(--text-dim); margin-bottom: 0.5rem; }
.forecast-day-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.forecast-day-temps { font-size: 0.85rem; }
.forecast-day-temps .high { color: var(--danger); }
.forecast-day-temps .low { color: var(--accent); }
.forecast-day-rain { font-size: 0.7rem; color: var(--text-dim); margin-top: 0.25rem; }
.forecast-loading { text-align: center; color: var(--text-dim); padding: 2rem; }

/* ==================== Nowcast Widget ==================== */
.nowcast-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.nowcast-header h2 {
  font-size: 1rem;
  margin-bottom: 0;
}

.nowcast-precip-summary {
  font-size: 0.8rem;
  padding: 0.25rem 0.6rem;
  background: var(--bg);
  border-radius: 15px;
}

.nowcast-precip-summary .precip-expected {
  color: var(--accent);
}

.nowcast-precip-summary .no-precip {
  color: var(--success);
}

.nowcast-current {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.nowcast-now-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
}

.nowcast-now-temp {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--danger);
}

.nowcast-timeline {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  scrollbar-width: thin;
}

.nowcast-hour {
  flex: 1;
  min-width: 50px;
  text-align: center;
  padding: 0.4rem 0.25rem;
  background: var(--bg);
  border-radius: 8px;
}

.nowcast-hour-label {
  font-size: 0.6rem;
  color: var(--text-dim);
  margin-bottom: 0.15rem;
}

.nowcast-hour-temp {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.15rem;
}

.nowcast-hour-rain {
  font-size: 0.6rem;
  color: var(--accent);
  background: rgba(74, 158, 255, 0.15);
  padding: 0.1rem 0.25rem;
  border-radius: 4px;
  margin-bottom: 0.15rem;
}

.nowcast-hour-range {
  font-size: 0.55rem;
  color: var(--text-dim);
}

.nowcast-hour-confidence {
  margin-top: 0.3rem;
  height: 3px;
  background: var(--bg-card);
  border-radius: 2px;
  overflow: hidden;
}

.nowcast-hour-confidence-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--danger), var(--warning), var(--success));
  border-radius: 2px;
  transition: width 0.3s;
}

.nowcast-trend {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
  padding: 0.4rem 0.5rem;
  background: var(--bg);
  border-radius: 6px;
  font-size: 0.75rem;
}

.nowcast-trend .trend-icon {
  font-size: 1rem;
}

.nowcast-trend.rising { color: var(--danger); }
.nowcast-trend.falling { color: var(--accent); }
.nowcast-trend.stable { color: var(--text-dim); }

.nowcast-explanation {
  margin-top: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.65rem;
  color: var(--text-dim);
  line-height: 1.4;
}

/* ==================== Snow Indicator Widget ==================== */
.card-snow-indicator {
  background: linear-gradient(135deg, var(--bg-card) 0%, #1a2a3a 100%);
  border: 1px solid #4a9eff33;
}

.card-snow-indicator h2 {
  margin-bottom: 0.75rem;
}

.snow-indicator-content {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1.5rem;
  align-items: center;
}

.snow-main-stats {
  display: flex;
  gap: 1rem;
}

.snow-stat {
  background: var(--bg);
  border-radius: 12px;
  padding: 0.75rem 1.25rem;
  text-align: center;
  min-width: 120px;
}

.snow-stat-label {
  display: block;
  font-size: 0.65rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.15rem;
}

.snow-stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 600;
  color: #7dd3fc;
}

.snow-stat-hint {
  display: block;
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 0.15rem;
}

.snow-stat.positive .snow-stat-value { color: #f87171; }
.snow-stat.negative .snow-stat-value { color: #7dd3fc; }
.snow-stat.freezing .snow-stat-value { color: #a5f3fc; }

.snow-conditions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.snow-condition {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg);
  border-radius: 8px;
  text-align: center;
  min-width: 90px;
}

.snow-condition .condition-icon {
  font-size: 1.1rem;
}

.snow-condition .condition-label {
  font-size: 0.55rem;
  color: var(--text-dim);
}

.snow-condition .condition-status {
  font-size: 0.8rem;
  font-weight: 600;
}

.snow-condition.status-yes .condition-status { color: var(--success); }
.snow-condition.status-no .condition-status { color: var(--danger); }
.snow-condition.status-maybe .condition-status { color: var(--warning); }
.snow-condition.status-slow .condition-status { color: var(--success); }
.snow-condition.status-fast .condition-status { color: var(--danger); }

.snow-explanation {
  font-size: 0.65rem;
  color: var(--text-dim);
  line-height: 1.4;
  max-width: 280px;
  text-align: right;
}

@media (max-width: 1200px) {
  .snow-indicator-content {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .snow-main-stats {
    justify-content: center;
  }
  
  .snow-explanation {
    text-align: center;
    max-width: none;
  }
}

@media (max-width: 600px) {
  .snow-indicator-content {
    gap: 0.75rem;
  }
  
  .snow-main-stats {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }
  
  .snow-stat {
    width: 100%;
    max-width: 200px;
  }
  
  .snow-conditions {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .snow-condition {
    min-width: 80px;
    flex: 1;
  }
}

/* ==================== Model Scorecard Widget ==================== */
.card-scorecard h2 {
  font-size: 1.1rem;
}

.scorecard-subtitle {
  color: var(--text-dim);
  font-size: 0.8rem;
  margin: -0.25rem 0 0.75rem;
}

.scorecard-explanation {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: rgba(52, 152, 219, 0.1);
  border-left: 3px solid var(--accent);
  border-radius: 0 6px 6px 0;
  margin-bottom: 1rem;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.scorecard-explanation .explanation-icon {
  font-size: 1rem;
}

.scorecard-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.scorecard-stat {
  text-align: center;
  padding: 0.75rem 0.5rem;
  background: var(--bg);
  border-radius: 10px;
}

.scorecard-stat .stat-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-bottom: 0.25rem;
  text-transform: uppercase;
}

.scorecard-stat .stat-mae {
  display: block;
  font-size: 1.4rem;
  font-weight: 600;
}

.scorecard-stat .stat-mae::after {
  content: '°C';
  font-size: 0.9rem;
  font-weight: 400;
  opacity: 0.7;
}

.scorecard-stat .stat-unit {
  display: block;
  font-size: 0.6rem;
  color: var(--text-dim);
  margin-top: 0.1rem;
}

.scorecard-stat .stat-mae.good { color: var(--success); }
.scorecard-stat .stat-mae.medium { color: var(--warning); }
.scorecard-stat .stat-mae.poor { color: var(--danger); }

.scorecard-stat .stat-samples {
  display: block;
  font-size: 0.6rem;
  color: var(--text-dim);
  margin-top: 0.25rem;
}

.scorecard-bias-section {
  margin-bottom: 1rem;
}

.scorecard-bias-title {
  font-size: 0.85rem;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.scorecard-bias-explanation {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}

.scorecard-bias-chart {
  background: var(--bg);
  border-radius: 10px;
  padding: 0.5rem;
}

.scorecard-recent .recent-title {
  font-size: 0.85rem;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.scorecard-recent .recent-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-height: 120px;
  overflow-y: auto;
}

.recent-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0.6rem;
  background: var(--bg);
  border-radius: 6px;
  font-size: 0.75rem;
}

.recent-item .recent-time {
  color: var(--text-dim);
}

.recent-item .recent-error {
  font-weight: 500;
}

.recent-item .recent-error.positive { color: var(--danger); }
.recent-item .recent-error.negative { color: var(--accent); }

.scorecard-backfill {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.backfill-btn {
  padding: 0.5rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.backfill-btn:hover {
  background: var(--accent);
  color: white;
}

.backfill-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.backfill-status {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.backfill-status.success { color: var(--success); }
.backfill-status.error { color: var(--danger); }

/* Hourly */
/* Hourly Forecast */
.hourly-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.hourly-header h2 {
  margin-bottom: 0;
}

.hourly-rain-summary {
  font-size: 0.85rem;
  padding: 0.3rem 0.75rem;
  background: var(--bg);
  border-radius: 20px;
}

.hourly-rain-summary .rain-expected {
  color: var(--accent);
}

.hourly-rain-summary .no-rain {
  color: var(--success);
}

.hourly-scroll {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.hourly-item {
  flex: 0 0 65px;
  text-align: center;
  padding: 0.6rem 0.4rem;
  background: var(--bg);
  border-radius: 10px;
  transition: transform 0.15s, background 0.15s;
}

.hourly-item:hover {
  background: var(--bg-card-alt);
  transform: translateY(-2px);
}

.hourly-time { 
  font-size: 0.65rem; 
  color: var(--text-dim); 
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hourly-icon { 
  font-size: 1.25rem; 
  margin: 0.25rem 0; 
}

.hourly-temp { 
  font-size: 0.9rem; 
  font-weight: 600; 
}

.hourly-rain { 
  font-size: 0.65rem; 
  color: var(--accent);
  background: rgba(74, 158, 255, 0.15);
  padding: 0.15rem 0.3rem;
  border-radius: 4px;
  margin-top: 0.25rem;
}

/* Sky Controls */
.sky-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding: 0.5rem;
  background: var(--bg);
  border-radius: 8px;
}
.sky-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.6rem;
  background: var(--bg-card-alt);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.75rem;
  transition: all 0.2s;
  user-select: none;
}
.sky-toggle:hover { background: var(--border); }
.sky-toggle input { display: none; }
.sky-toggle .toggle-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  opacity: 0.3;
  transition: opacity 0.2s;
}
.sky-toggle input:checked + .toggle-dot { opacity: 1; box-shadow: 0 0 6px currentColor; }

/* Epic Sky Widget */
.sky-widget { 
  border-radius: 12px; 
  overflow: hidden; 
  margin-bottom: 1rem;
  background: linear-gradient(180deg, #0a0a2e 0%, #1a1a3e 100%);
}
#skyCanvas { width: 100%; height: auto; display: block; }

.astro-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
}
.astro-info-box {
  background: var(--bg);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.astro-icon { font-size: 2.5rem; }
.moon-phase-visual {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #E8E8E8;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.astro-times {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem 1rem;
  font-size: 0.8rem;
}
.astro-times div { display: flex; justify-content: space-between; gap: 0.5rem; }
.astro-times span { color: var(--text-dim); }
.astro-times strong { color: var(--text); }
.calendar-box { flex-direction: column; align-items: stretch; }
.moon-calendar-items { display: flex; gap: 1rem; justify-content: center; }
.cal-item { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; }
.cal-item span { font-size: 1.5rem; }
.cal-item div { display: flex; flex-direction: column; }
.cal-item strong { color: var(--text); }

@media (max-width: 800px) {
  .astro-info-grid { grid-template-columns: 1fr; }
}

/* Deep Sky - Epic Version */
.deepsky-layout {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2rem;
  margin-bottom: 1.5rem;
}
.ds-current { text-align: center; }
.ds-score-ring {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 1rem;
}
.ds-score-ring svg { width: 100%; height: 100%; }
.ds-score-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}
.ds-score-value { font-size: 2.5rem; font-weight: 200; display: block; }
.ds-score-label { font-size: 0.7rem; color: var(--text-dim); }
.ds-verdict {
  font-size: 0.85rem;
  padding: 0.75rem;
  background: var(--bg);
  border-radius: 8px;
  max-width: 200px;
  margin: 0 auto;
}
.ds-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
.ds-metric-card {
  background: var(--bg);
  border-radius: 10px;
  padding: 1rem;
  text-align: center;
}
.ds-metric-icon { font-size: 1.5rem; margin-bottom: 0.5rem; }
.ds-metric-data { display: flex; align-items: center; gap: 0.5rem; justify-content: center; }
.ds-metric-bar { flex: 1; height: 6px; background: #1a1a3a; border-radius: 3px; overflow: hidden; max-width: 80px; }
.ds-bar-fill { height: 100%; border-radius: 3px; transition: width 0.5s; }
.ds-bar-fill.seeing { background: linear-gradient(90deg, #e74c3c, #2ecc71); }
.ds-bar-fill.trans { background: linear-gradient(90deg, #e74c3c, #2ecc71); }
.ds-bar-fill.clouds { background: linear-gradient(90deg, #2ecc71, #e74c3c); }
.ds-bar-fill.moon { background: linear-gradient(90deg, #2ecc71, #f1c40f); }
.ds-metric-name { font-size: 0.75rem; color: var(--text-dim); margin-top: 0.5rem; }
.ds-forecast { margin-bottom: 1.5rem; }
.ds-forecast h3, .ds-tonight h3 { font-size: 0.85rem; color: var(--text-dim); margin-bottom: 0.75rem; }
.ds-nights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 0.5rem;
}
.ds-night {
  background: var(--bg);
  border-radius: 10px;
  padding: 0.75rem;
  text-align: center;
}
.ds-night-name { font-size: 0.7rem; color: var(--text-dim); margin-bottom: 0.25rem; }
.ds-night-score { font-size: 1.25rem; font-weight: 500; }
.ds-night-score.excellent { color: #2ecc71; }
.ds-night-score.good { color: #a3e635; }
.ds-night-score.fair { color: #f1c40f; }
.ds-night-score.poor { color: #e74c3c; }
.ds-night-clouds { font-size: 0.65rem; color: var(--text-dim); }
.ds-hours {
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}
.ds-hour {
  flex: 0 0 45px;
  text-align: center;
  padding: 0.5rem 0.25rem;
  background: var(--bg);
  border-radius: 6px;
}
.ds-hour.past {
  opacity: 0.4;
}
.ds-hour-time { font-size: 0.65rem; color: var(--text-dim); }
.ds-hour-icon { font-size: 1rem; margin: 0.25rem 0; }
.ds-hour.good .ds-hour-icon { color: #2ecc71; }
.ds-hour.ok .ds-hour-icon { color: #f1c40f; }
.ds-hour.bad .ds-hour-icon { color: #e74c3c; }
.ds-footer {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-dim);
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 0.5rem;
}
@media (max-width: 600px) {
  .deepsky-layout { grid-template-columns: 1fr; }
  .ds-metrics-grid { grid-template-columns: 1fr 1fr; }
}

/* Stargazing Widget */
.stargazing-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.stargazing-header h2 { margin: 0; }
.stargazing-time { color: var(--text-dim); font-size: 0.9rem; }
.stargazing-container {
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  min-height: 400px;
}
#celestial-map { width: 100%; height: 400px; }
#celestial-map svg { display: block; }
.stargazing-tips {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--text-dim);
  flex-wrap: wrap;
}
@media (max-width: 600px) {
  .stargazing-tips { flex-direction: column; align-items: center; gap: 0.5rem; }
  #celestial-map { height: 300px; }
}

/* Chart */
.chart-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; margin-bottom: 1rem; }
.chart-controls { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.chart-controls select {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  font-size: 0.8rem;
}
.chart-toggles { display: flex; gap: 0.75rem; font-size: 0.75rem; }
.chart-toggles label { display: flex; align-items: center; gap: 0.3rem; cursor: pointer; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-red { background: #e74c3c; }
.dot-blue { background: #3498db; }
.dot-purple { background: #9b59b6; }
.dot-green { background: #2ecc71; }
.dot-cyan { background: #00d4ff; }
.dot-yellow { background: #f1c40f; }
.chart-container { height: 300px; position: relative; }

/* Records */
.records-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.75rem; }
.record-item {
  text-align: center;
  padding: 1rem;
  background: var(--bg);
  border-radius: 10px;
}
.record-icon { font-size: 1.25rem; }
.record-label { display: block; font-size: 0.7rem; color: var(--text-dim); margin: 0.25rem 0; }
.record-value { display: block; font-size: 1.25rem; font-weight: 600; }
.record-date { display: block; font-size: 0.65rem; color: var(--text-dim); }

/* UV */
.uv-content { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.uv-display { text-align: center; }
.uv-big { font-size: 4rem; font-weight: 200; }
.uv-level { font-size: 0.9rem; color: var(--text-dim); margin-bottom: 1rem; }
.uv-bar-wrap { padding: 0 1rem; }
.uv-bar-bg {
  height: 10px;
  background: linear-gradient(90deg, #2ecc71, #2ecc71, #f1c40f, #e67e22, #e74c3c, #9b59b6);
  border-radius: 5px;
  position: relative;
}
.uv-bar-marker {
  position: absolute;
  top: -5px;
  width: 20px;
  height: 20px;
  background: white;
  border: 3px solid var(--bg);
  border-radius: 50%;
  transform: translateX(-50%);
  transition: left 0.5s ease;
}
.uv-calc { padding: 1rem; background: var(--bg); border-radius: 12px; }
.calc-field { margin-bottom: 0.75rem; }
.calc-field label { display: block; font-size: 0.75rem; color: var(--text-dim); margin-bottom: 0.25rem; }
.calc-field select {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.5rem;
  border-radius: 6px;
  font-size: 0.85rem;
}
.calc-results { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.calc-results div {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  padding: 0.25rem 0;
}
.calc-results span { color: var(--text-dim); }

/* Guestbook */
.guestbook-content { display: grid; grid-template-columns: 300px 1fr; gap: 1.5rem; }
.guest-form { display: flex; flex-direction: column; gap: 0.75rem; }
.guest-form input, .guest-form textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.75rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
}
.guest-form textarea { min-height: 100px; resize: vertical; }
.guest-entries {
  max-height: 300px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.guest-entry {
  padding: 1rem;
  background: var(--bg);
  border-radius: 10px;
}
.guest-name { font-weight: 500; margin-bottom: 0.25rem; }
.guest-message { font-size: 0.9rem; color: var(--text-dim); }
.guest-time { font-size: 0.7rem; color: var(--text-dim); margin-top: 0.5rem; }
.guest-loading { text-align: center; color: var(--text-dim); padding: 2rem; }

/* Radar */
.radar-container { background: var(--bg); border-radius: 12px; overflow: hidden; }
.radar-map { position: relative; }
.radar-map img { width: 100%; height: auto; display: block; max-height: 350px; object-fit: contain; }
.radar-legend {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem;
  font-size: 0.65rem;
  background: var(--bg-card);
  flex-wrap: wrap;
}
.legend-item { display: flex; align-items: center; gap: 0.2rem; }
.legend-item span:first-child { width: 10px; height: 10px; border-radius: 2px; }
.radar-links {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}
.radar-links a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.8rem;
  padding: 0.5rem 1rem;
  background: var(--bg);
  border-radius: 8px;
  transition: all 0.2s;
}
.radar-links a:hover { background: var(--accent); }

/* ==================== Precipitation Widget ==================== */
.precip-section {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.precip-section:last-of-type {
  border-bottom: none;
  margin-bottom: 0.5rem;
}

.precip-section h3 {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
}

/* Buienradar Graph */
.buienradar-graph {
  background: var(--bg);
  border-radius: 8px;
  padding: 0.5rem;
  margin-bottom: 0.5rem;
}

.buienradar-graph svg {
  display: block;
}

.buienradar-graph .graph-loading {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-dim);
  font-size: 0.85rem;
}

.buienradar-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  padding: 0.5rem;
}

.buienradar-summary .status-dry { color: var(--success); }
.buienradar-summary .status-raining { color: var(--accent); }
.buienradar-summary .status-upcoming { color: var(--warning); }
.buienradar-summary .total-precip { color: var(--text-dim); }

/* Hourly Precipitation */
.hourly-precip {
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scrollbar-width: thin;
}

.hourly-precip-item {
  flex: 0 0 50px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.4rem 0.25rem;
  background: var(--bg);
  border-radius: 6px;
  font-size: 0.65rem;
  transition: transform 0.15s;
}

.hourly-precip-item:hover {
  transform: translateY(-2px);
}

.hourly-precip-item.current {
  background: var(--accent);
  color: white;
}

.hourly-precip-item .hour {
  color: var(--text-dim);
  font-weight: 500;
}

.hourly-precip-item.current .hour {
  color: rgba(255,255,255,0.8);
}

.hourly-precip-item .icon {
  font-size: 1rem;
  line-height: 1;
}

.hourly-precip-item .amount {
  font-weight: 600;
  color: var(--accent);
}

.hourly-precip-item.current .amount {
  color: white;
}

.hourly-precip-item .prob {
  color: var(--text-dim);
}

.hourly-precip-item.intensity-light { border-left: 3px solid #9BF2FF; }
.hourly-precip-item.intensity-moderate { border-left: 3px solid #00D619; }
.hourly-precip-item.intensity-heavy { border-left: 3px solid #FFFF00; }
.hourly-precip-item.intensity-extreme { border-left: 3px solid #FF0000; }

/* Precipitation Types - Compact Row */
.precip-types-row {
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
}

.precip-types {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.precip-type {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.5rem 0.25rem;
  background: var(--bg);
  border-radius: 8px;
  opacity: 0.5;
  transition: all 0.2s;
}

.precip-type.active {
  opacity: 1;
  background: var(--bg-card-alt);
}

.precip-type.high {
  opacity: 1;
  background: linear-gradient(135deg, var(--accent), var(--bg-card-alt));
}

.precip-type .type-icon {
  font-size: 1.25rem;
}

.precip-type .type-name {
  font-size: 0.6rem;
  color: var(--text-dim);
}

.precip-type .type-chance {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
}

.precip-type.high .type-chance {
  color: white;
}

@media (max-width: 600px) {
  .precip-types {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.3rem;
  }
  
  .precip-type {
    padding: 0.4rem 0.2rem;
  }
  
  .precip-type .type-icon {
    font-size: 1rem;
  }
}

/* Snow Effect */
.snow-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}
.snowflake {
  position: absolute;
  top: -20px;
  color: #fff;
  font-size: 1rem;
  text-shadow: 0 0 5px rgba(255,255,255,0.8);
  animation: snowfall linear infinite;
  opacity: 0.8;
}
@keyframes snowfall {
  0% { transform: translateY(0) rotate(0deg); }
  100% { transform: translateY(100vh) rotate(360deg); }
}

/* Ensemble Models */
.card-ensemble { }
.ensemble-header { 
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.ensemble-header h2 { margin-bottom: 0.25rem; }
.ensemble-subtitle { color: var(--text-dim); font-size: 0.85rem; margin: 0; }
.ensemble-select {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
}
.ensemble-select:hover { border-color: var(--accent); }
.ensemble-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1rem;
}
.ensemble-chart {
  background: var(--bg);
  border-radius: 12px;
  padding: 1rem;
  overflow: hidden;
}
.ensemble-chart h3 {
  font-size: 0.9rem;
  margin: 0 0 0.75rem 0;
  color: var(--text-dim);
}
.ensemble-chart canvas {
  width: 100% !important;
  height: 280px !important;
}
.ensemble-legend {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  margin: 1rem 0;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--text-dim);
}
.legend-item { display: flex; align-items: center; gap: 0.5rem; }
.legend-swatch { width: 20px; height: 12px; border-radius: 3px; }
.legend-swatch.members { background: linear-gradient(90deg, rgba(100,150,255,0.3), rgba(100,150,255,0.5)); }
.legend-swatch.mean { background: #2ecc71; }
.legend-swatch.range { background: rgba(100,150,255,0.2); border: 1px dashed rgba(100,150,255,0.5); }
@media (max-width: 900px) {
  .ensemble-charts { grid-template-columns: 1fr; }
}

/* Weather Intro Animation */
.weather-intro {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  pointer-events: none;
  opacity: 1;
  transition: opacity 1s ease-out;
}
.weather-intro.hidden {
  opacity: 0;
}
.weather-intro.gone {
  display: none;
}
.intro-scene {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.intro-sky {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.85;
  transition: background 2s ease;
}
.intro-weather {
  position: relative;
  z-index: 2;
  font-size: 6rem;
  animation: introFloat 2s ease-in-out infinite;
  filter: drop-shadow(0 0 30px rgba(255,255,255,0.5));
}
.intro-text {
  position: relative;
  z-index: 2;
  margin-top: 1rem;
  font-size: 1.3rem;
  color: #fff;
  text-shadow: 0 2px 20px rgba(0,0,0,0.8);
  opacity: 0;
  animation: introFadeIn 0.5s ease-out 0.3s forwards;
}
@keyframes introFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-8px) scale(1.03); }
}
@keyframes introFadeIn {
  to { opacity: 1; }
}
.intro-rain {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
}
.intro-raindrop {
  position: absolute;
  width: 2px;
  height: 20px;
  background: linear-gradient(transparent, rgba(150,200,255,0.6));
  animation: introRainFall 0.5s linear infinite;
}
@keyframes introRainFall {
  to { transform: translateY(100vh); }
}
.intro-clouds {
  position: absolute;
  top: 20%;
  width: 100%;
  height: 60%;
  opacity: 0.6;
}
.intro-cloud {
  position: absolute;
  font-size: 4rem;
  opacity: 0.5;
  animation: introCloudDrift 8s ease-in-out infinite;
}
@keyframes introCloudDrift {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(20px); }
}
@keyframes twinkle {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* Footer */
.footer { margin-top: 2rem; padding: 2rem 1rem; text-align: center; color: var(--text-dim); }
.footer p { margin: 0.25rem 0; font-size: 0.85rem; }
.footer-links { margin-top: 1rem; display: flex; justify-content: center; gap: 1.5rem; }
.footer-links a { color: var(--accent); text-decoration: none; font-size: 0.85rem; }
.footer-links a:hover { text-decoration: underline; }

/* Phenomena Predictor */
.phenomena-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}
.phenomenon-card {
  background: var(--bg);
  border-radius: 10px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.phenomenon-card .phenomenon-icon {
  font-size: 1.5rem;
  position: absolute;
  right: 0.75rem;
  top: 0.75rem;
  opacity: 0.3;
}
.phenomenon-card {
  position: relative;
  overflow: hidden;
}
.phenomenon-info {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.phenomenon-name {
  font-size: 0.85rem;
  color: var(--text);
}
.phenomenon-chance {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent);
}
.phenomenon-bar {
  height: 4px;
  background: var(--bg-card-alt);
  border-radius: 2px;
  overflow: hidden;
}
.phenomenon-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.5s ease, background 0.5s ease;
  width: 0%;
}
.phenomenon-fill.low { background: var(--success); }
.phenomenon-fill.medium { background: var(--warning); }
.phenomenon-fill.high { background: var(--accent); }
.phenomenon-hint {
  font-size: 0.7rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Microclimate Comparison */
.microclimate-subtitle {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin: -0.5rem 0 1rem;
}
.microclimate-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: center;
}

.microclimate-station {
  flex: 1 1 120px;
  min-width: 100px;
  max-width: 160px;
}

.microclimate-comparison {
  flex: 0 0 auto;
}

@media (max-width: 1400px) {
  .microclimate-grid {
    flex-direction: column;
  }
  .microclimate-station {
    width: 100%;
    max-width: none;
  }
  .microclimate-comparison {
    order: -1;
  }
  .comparison-diff {
    width: 100%;
    height: auto;
    padding: 0.5rem;
    border-radius: 8px;
    flex-direction: row;
    gap: 0.5rem;
  }
}
.microclimate-station {
  background: var(--bg);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
}
.microclimate-station.local {
  border: 1px solid var(--accent);
}
.station-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}
.station-icon { font-size: 1.2rem; }
.station-name { font-size: 0.85rem; color: var(--text-dim); }
.station-temp {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}
.station-details {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-dim);
}
.microclimate-comparison {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.comparison-diff {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg);
  border-radius: 50%;
  width: 70px;
  height: 70px;
  justify-content: center;
}
.diff-value {
  font-size: 1.2rem;
  font-weight: 700;
}
.diff-value.warmer { color: #e74c3c; }
.diff-value.cooler { color: #3498db; }
.diff-value.same { color: var(--success); }
.diff-label {
  font-size: 0.65rem;
  color: var(--text-dim);
}
.microclimate-insight {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding: 0.75rem;
  background: var(--bg);
  border-radius: 8px;
  font-size: 0.8rem;
  color: var(--text-dim);
}
.insight-icon { font-size: 1rem; }

/* Responsive */
@media (max-width: 900px) {
  .card-wide { grid-column: span 1; }
  .wind-layout { grid-template-columns: 1fr; }
  .wind-rose-wrap { display: flex; justify-content: center; margin-top: 1rem; }
  .guestbook-content { grid-template-columns: 1fr; }
  .uv-content { grid-template-columns: 1fr; }
  .astro-details { grid-template-columns: 1fr; }
  .phenomena-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .dashboard { grid-template-columns: 1fr; }
  .temp-value { font-size: 4rem; }
  .stat-grid { grid-template-columns: 1fr; }
  .chart-controls { flex-direction: column; align-items: stretch; }
  .chart-toggles { flex-wrap: wrap; }
  .ds-metrics { grid-template-columns: 1fr; }
}

/* Santa hats */
.santa-hat { fill: #DC143C; }

/* Wind bar for Deep Sky */
.ds-bar-fill.wind {
  background: linear-gradient(90deg, #2ecc71 0%, #f1c40f 50%, #e74c3c 100%);
}

/* Regional Extremes Tracker */
.card-extremes { }
.extremes-subtitle {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 1rem;
}
.extremes-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

@media (max-width: 1400px) {
  .extremes-grid {
    grid-template-columns: 1fr;
  }
}

.extreme-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--bg);
  border-radius: 12px;
}
.extreme-icon { font-size: 1.5rem; }
.extreme-data {
  display: flex;
  flex-direction: column;
}
.extreme-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
}
.extreme-value {
  font-size: 1.1rem;
  font-weight: 600;
}
.extreme-value.warmer { color: #e74c3c; }
.extreme-value.cooler { color: #3498db; }
.extreme-value.higher { color: #e67e22; }
.extreme-value.lower { color: #2ecc71; }
.extreme-value.same { color: var(--text-dim); }
.extreme-context {
  font-size: 0.7rem;
  color: var(--text-dim);
}
.extremes-insight {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding: 0.75rem;
  background: var(--bg);
  border-radius: 8px;
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* Netherlands Temperature Map */
.card-nlmap { }

.nlmap-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.nlmap-status {
  display: flex;
  gap: 1rem;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.nlmap-source {
  color: var(--accent);
}

.nlmap-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.nlmap-play-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.15s;
  flex-shrink: 0;
}

.nlmap-play-btn:hover {
  border-color: var(--accent);
  background: var(--bg-card-alt);
}

/* noUiSlider wrapper */
.nlmap-slider-wrap {
  flex: 1;
  padding: 10px 8px;
}

#nlmapSlider {
  height: 8px;
}

/* noUiSlider custom styling */
#nlmapSlider .noUi-base {
  background: var(--bg);
  border-radius: 4px;
  border: none;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.3);
}

#nlmapSlider .noUi-connect {
  background: linear-gradient(90deg, var(--accent), var(--cyan));
  border-radius: 4px;
}

#nlmapSlider .noUi-handle {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg-card);
  box-shadow: 0 2px 8px rgba(74, 158, 255, 0.4);
  cursor: grab;
  top: -6px;
  right: -10px;
}

#nlmapSlider .noUi-handle:before,
#nlmapSlider .noUi-handle:after {
  display: none;
}

#nlmapSlider .noUi-handle:hover {
  transform: scale(1.1);
  box-shadow: 0 2px 12px rgba(74, 158, 255, 0.6);
}

#nlmapSlider .noUi-handle:active {
  cursor: grabbing;
  transform: scale(1.15);
}

#nlmapSlider .noUi-tooltip {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.75rem;
  padding: 4px 8px;
}

#nlmapSlider .noUi-pips {
  color: var(--text-dim);
  font-size: 0.65rem;
}

#nlmapSlider .noUi-marker {
  background: var(--border);
}

#nlmapSlider .noUi-value {
  color: var(--text-dim);
  padding-top: 2px;
}

.nlmap-time {
  min-width: 110px;
  text-align: right;
  font-weight: 600;
  color: var(--accent);
  font-size: 0.9rem;
  flex-shrink: 0;
}

.nlmap-view-controls {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.nlmap-view-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s;
}

.nlmap-view-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}

.nlmap-view-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
  font-weight: 600;
}

.nlmap-container {
  position: relative;
  display: flex;
  justify-content: center;
  gap: 1rem;
}
#nlmapCanvas {
  background: var(--bg);
  border-radius: 12px;
  max-width: 100%;
  height: auto;
}
.nlmap-legend {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-dim);
}
.nlmap-gradient {
  width: 20px;
  height: 200px;
  background: linear-gradient(to bottom, #e74c3c, #f39c12, #f1c40f, #2ecc71, #3498db, #9b59b6);
  border-radius: 4px;
}
.nlmap-stations-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem;
  margin-top: 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-dim);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s;
}

.nlmap-stations-toggle:hover {
  border-color: var(--accent);
  color: var(--text);
}

.nlmap-stations-toggle .toggle-icon {
  transition: transform 0.2s;
}

.nlmap-stations-toggle.expanded .toggle-icon {
  transform: rotate(180deg);
}

.nlmap-stations {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
  justify-content: center;
  max-height: 500px;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.2s;
}

.nlmap-stations.collapsed {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
}
.nlmap-station {
  padding: 0.4rem 0.8rem;
  background: var(--bg);
  border-radius: 20px;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.nlmap-station.bemmel {
  background: var(--accent);
  color: #000;
  font-weight: 600;
}
.nlmap-station-temp {
  font-weight: 600;
}

@media (max-width: 600px) {
  .extremes-grid { grid-template-columns: 1fr; }
  #nlmapCanvas { max-height: 350px; }
}

/* ==================== Ensemble Spaghetti Plot ==================== */
.card-ensemble {
  position: relative;
}

.ensemble-subtitle {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.ensemble-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
  align-items: flex-end;
}

.ensemble-controls .control-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.ensemble-controls label {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Compare Runs Toggle */
.compare-runs-toggle {
  display: flex !important;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  padding: 0.5rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: all 0.15s;
}

.compare-runs-toggle:hover {
  border-color: var(--accent);
}

.compare-runs-toggle input:checked + span {
  color: var(--accent);
}

.compare-runs-select {
  min-width: 120px !important;
  margin-top: 0.25rem;
}

.compare-runs-select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Compare Runs Panel */
.compare-runs-panel {
  background: var(--bg);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
}

.compare-runs-panel h4 {
  margin: 0 0 0.75rem 0;
  font-size: 0.95rem;
  color: var(--accent);
}

.compare-runs-chart-container {
  height: 200px;
  margin-bottom: 0.75rem;
}

.compare-runs-info {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.compare-stat {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.compare-stat .stat-label {
  font-size: 0.65rem;
  color: var(--text-dim);
  text-transform: uppercase;
}

.compare-stat .stat-value {
  font-size: 1rem;
  font-weight: 600;
}

.compare-runs-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.8rem;
}

.compare-legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.compare-legend-color {
  width: 20px;
  height: 3px;
  border-radius: 2px;
}

.ensemble-controls select {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  min-width: 180px;
}

.ensemble-controls select optgroup {
  font-weight: 600;
  color: var(--accent);
  background: var(--bg-card);
}

.ensemble-controls select option {
  padding: 0.25rem;
  color: var(--text);
  background: var(--bg);
}

.ensemble-controls .days-hint {
  font-size: 0.7rem;
  margin-left: 0.5rem;
  color: var(--text-dim);
}

.ensemble-controls select:hover {
  border-color: var(--accent);
}

.ensemble-variables {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.ensemble-variables label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  font-size: 0.85rem !important;
  text-transform: none !important;
  color: var(--text) !important;
}

.ensemble-variables input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

.ensemble-toggles {
  display: flex;
  flex-direction: row !important;
  gap: 1rem !important;
  align-items: center;
  flex-wrap: wrap;
}

.ensemble-toggles label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  font-size: 0.85rem !important;
  text-transform: none !important;
  color: var(--text) !important;
}

.ensemble-toggles input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

.ensemble-toggles .best-predictors-label {
  color: #ffd700 !important;
  border-left: 1px solid var(--border);
  padding-left: 1rem;
}

.ensemble-toggles .bemmel-history-label {
  color: #00ff88 !important;
}

.ensemble-chart-container {
  position: relative;
  height: 400px;
  margin-bottom: 1rem;
  background: var(--bg);
  border-radius: 12px;
  padding: 1rem;
}

.ensemble-chart-container canvas {
  width: 100% !important;
  height: 100% !important;
}

.ensemble-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.ensemble-loading.hidden {
  display: none;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.ensemble-info {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding: 1rem;
  background: var(--bg);
  border-radius: 12px;
}

.ensemble-stat {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.ensemble-stat .stat-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ensemble-stat .stat-value {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent);
}

.ensemble-stat .stat-value-small {
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.3;
  max-width: 400px;
}

.ensemble-models-included {
  grid-column: span 2;
}

.ensemble-tooltip {
  position: absolute;
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  pointer-events: none;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  min-width: 180px;
}

.ensemble-tooltip.visible {
  display: block;
}

.ensemble-tooltip .tooltip-time {
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--accent);
}

.ensemble-tooltip .tooltip-stats {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.ensemble-tooltip .tooltip-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.ensemble-tooltip .tooltip-label {
  color: var(--text-dim);
}

/* Member line colors */
.member-line {
  stroke-width: 1;
  fill: none;
  opacity: 0.3;
}

.mean-line {
  stroke-width: 3;
  fill: none;
}

.spread-area {
  opacity: 0.2;
}

@media (max-width: 768px) {
  .ensemble-controls {
    flex-direction: column;
    align-items: stretch;
  }
  
  .ensemble-controls select {
    width: 100%;
  }
  
  .ensemble-chart-container {
    height: 300px;
  }
  
  .ensemble-info {
    gap: 1rem;
  }
  
  .ensemble-toggles {
    flex-wrap: wrap;
  }
}

/* ==================== Widget Settings Panel ==================== */
.widget-settings {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.2s;
}

.widget-settings.hidden {
  opacity: 0;
  pointer-events: none;
}

.widget-settings-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.widget-settings-panel {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 90%;
  max-width: 420px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: settingsSlideIn 0.25s ease-out;
}

@keyframes settingsSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.widget-settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.widget-settings-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
}

.widget-settings-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
  transition: color 0.15s;
}

.widget-settings-close:hover {
  color: var(--text);
}

.widget-settings-hint {
  padding: 0.75rem 1.25rem;
  font-size: 0.75rem;
  color: var(--text-dim);
  background: var(--bg);
  margin: 0;
}

.widget-settings-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
}

.widget-settings-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: var(--bg);
  border-radius: 10px;
  margin-bottom: 0.5rem;
  cursor: grab;
  transition: all 0.15s;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.widget-settings-item:hover {
  background: var(--bg-card-alt);
}

.widget-settings-item.dragging {
  opacity: 0.5;
  cursor: grabbing;
}

.widget-settings-item.drag-over {
  border: 2px dashed var(--accent);
  background: rgba(74, 158, 255, 0.1);
}

.widget-settings-item.hidden-widget {
  opacity: 0.5;
}

.widget-settings-item.hidden-widget .widget-name {
  text-decoration: line-through;
  color: var(--text-dim);
}

.widget-drag-handle {
  color: var(--text-dim);
  font-size: 1rem;
  cursor: grab;
}

/* Hide drag handle on mobile - use buttons instead */
@media (max-width: 768px) {
  .widget-drag-handle {
    display: none;
  }
}

.widget-name {
  flex: 1;
  font-size: 0.9rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Move buttons for mobile-friendly reordering */
.widget-order-buttons {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.widget-move-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.65rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1;
}

.widget-move-btn:hover:not(:disabled) {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.widget-move-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* On desktop, hide move buttons (drag works) */
@media (min-width: 769px) {
  .widget-order-buttons {
    opacity: 0.5;
  }
  
  .widget-settings-item:hover .widget-order-buttons {
    opacity: 1;
  }
}

/* On mobile, make buttons more prominent */
@media (max-width: 768px) {
  .widget-move-btn {
    padding: 0.35rem 0.6rem;
    font-size: 0.75rem;
  }
  
  .widget-settings-item {
    padding: 0.6rem;
    gap: 0.4rem;
  }
  
  .widget-name {
    font-size: 0.8rem;
  }
}

.widget-visibility-btn {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.25rem;
  opacity: 0.7;
  transition: opacity 0.15s, transform 0.15s;
}

.widget-visibility-btn:hover {
  opacity: 1;
  transform: scale(1.1);
}

.widget-settings-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: center;
}

.btn-reset {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-reset:hover {
  border-color: var(--accent);
  color: var(--text);
}

/* Hidden widget styling */
[data-widget].widget-hidden {
  display: none !important;
}

/* Location-hidden widgets (when viewing custom location) */
[data-widget].location-hidden {
  display: none !important;
}

/* ==================== Location Weather Card ==================== */
.card-location-weather {
  grid-column: span 12 !important;
  background: linear-gradient(135deg, #1a365d 0%, #2d3748 100%);
  border: 1px solid #4299e1;
}

.location-weather-content {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2rem;
  align-items: center;
}

.location-main {
  text-align: center;
  padding: 1rem;
}

.location-icon-big {
  font-size: 4rem;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.location-temp-big {
  font-size: 3.5rem;
  font-weight: 300;
  line-height: 1;
}

.location-desc {
  color: var(--text-dim);
  font-size: 1rem;
  margin-top: 0.5rem;
}

.location-details {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.location-detail {
  background: rgba(0, 0, 0, 0.2);
  padding: 0.75rem;
  border-radius: 8px;
  text-align: center;
}

.location-detail .detail-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.location-detail .detail-value {
  display: block;
  font-size: 1.1rem;
  font-weight: 600;
  color: #63b3ed;
}

.location-note {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.75rem;
  color: var(--text-dim);
  text-align: center;
}

@media (max-width: 768px) {
  .location-weather-content {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .location-details {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .location-icon-big {
    font-size: 3rem;
  }
  
  .location-temp-big {
    font-size: 2.5rem;
  }
}

/* ==================== Weather Maps Widget ==================== */
.card-weather-maps {
  grid-column: span 12 !important;
}

.maps-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.maps-control-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.maps-control-group label {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.maps-type-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.map-type-btn {
  padding: 0.5rem 0.9rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-dim);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.map-type-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}

.map-type-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.maps-container-windy {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg);
  margin-bottom: 1rem;
}

.maps-container-windy iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.maps-windy-note {
  font-size: 0.8rem;
  color: var(--text-dim);
  padding: 0.75rem;
  background: var(--bg);
  border-radius: 8px;
  margin-bottom: 0.75rem;
  text-align: center;
}

.maps-quick-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
}

.maps-quick-links .quick-label {
  color: var(--text-dim);
}

.maps-quick-links a {
  color: var(--accent);
  text-decoration: none;
  padding: 0.4rem 0.75rem;
  background: var(--bg);
  border-radius: 6px;
  transition: all 0.15s;
}

.maps-quick-links a:hover {
  background: var(--accent);
  color: white;
}

@media (max-width: 600px) {
  .maps-type-buttons {
    width: 100%;
  }
  
  .map-type-btn {
    flex: 1;
    min-width: 70px;
    text-align: center;
    font-size: 0.75rem;
    padding: 0.4rem 0.5rem;
  }
  
  .maps-container-windy {
    padding-bottom: 75%; /* Taller on mobile */
  }
}

/* ==================== Wet Bulb Explainer Widget ==================== */
.card-wetbulb-explainer {
  grid-column: span 12 !important;
  background: linear-gradient(135deg, var(--bg-card) 0%, #1a1a2e 100%);
}

.card-wetbulb-explainer h2 {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}

.card-wetbulb-explainer h3 {
  font-size: 1.1rem;
  color: var(--accent);
  margin: 1.5rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.wetbulb-intro {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-dim);
  max-width: 800px;
}

.wetbulb-intro strong {
  color: var(--accent);
}

/* Simulator */
.wetbulb-simulator {
  background: var(--bg);
  border-radius: 16px;
  padding: 1.5rem;
  margin-top: 1rem;
}

.simulator-controls {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 1.5rem;
}

.sim-control {
  flex: 1;
  min-width: 200px;
}

.sim-control label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}

.sim-control input[type="range"] {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: var(--bg-card);
  appearance: none;
  cursor: pointer;
}

.sim-control input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  cursor: grab;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.sim-value {
  display: block;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 0.5rem;
}

.btn-use-current {
  padding: 0.75rem 1.5rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-use-current:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
}

.simulator-results {
  display: grid;
  gap: 1.5rem;
}

.sim-result-main {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 2rem;
  align-items: center;
}

/* Thermometer visualization */
.sim-thermometer {
  display: flex;
  gap: 0.5rem;
  height: 300px;
}

.thermo-scale {
  position: relative;
  width: 80px;
}

.thermo-marker {
  position: absolute;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  transform: translateY(50%);
  transition: bottom 0.3s ease;
}

.marker-label {
  font-size: 0.65rem;
  color: var(--text-dim);
}

.marker-value {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.thermo-dry .marker-value { background: #ef4444; color: white; }
.thermo-wet .marker-value { background: #3b82f6; color: white; }
.thermo-dew .marker-value { background: #8b5cf6; color: white; }

.thermo-tube {
  width: 40px;
  height: 100%;
  background: linear-gradient(to top, 
    #1e3a5f 0%, 
    #3b82f6 20%, 
    #22c55e 40%, 
    #eab308 60%, 
    #f97316 75%, 
    #ef4444 90%, 
    #991b1b 100%
  );
  border-radius: 20px;
  position: relative;
  overflow: hidden;
}

.thermo-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255,255,255,0.2);
  transition: height 0.3s ease;
}

.thermo-labels {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-dim);
  padding: 0.25rem 0;
}

.sim-bignum {
  text-align: center;
}

.bignum-label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}

.bignum-value {
  display: block;
  font-size: 4rem;
  font-weight: 700;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.bignum-diff {
  display: block;
  font-size: 1rem;
  color: var(--text-dim);
  margin-top: 0.5rem;
}

/* Result grid */
.sim-result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}

.sim-fact {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
  transition: all 0.2s;
}

.sim-fact:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.fact-icon {
  font-size: 1.5rem;
  display: block;
  margin-bottom: 0.25rem;
}

.fact-title {
  display: block;
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.fact-value {
  display: block;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--accent);
  margin: 0.25rem 0;
}

.fact-desc {
  display: block;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.sim-fact.status-safe .fact-value { color: #22c55e; }
.sim-fact.status-caution .fact-value { color: #eab308; }
.sim-fact.status-danger .fact-value { color: #f97316; }
.sim-fact.status-extreme .fact-value { color: #ef4444; }
.sim-fact.status-lethal .fact-value { color: #991b1b; }

/* Scenarios */
.scenario-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.scenario-btn {
  padding: 0.6rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.scenario-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

/* Deep dive tabs */
.deepdive-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 0.6rem 1.2rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}

.tab-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.info-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
}

.info-card {
  background: var(--bg);
  border-radius: 12px;
  padding: 1.25rem;
}

.info-card.warning {
  background: linear-gradient(135deg, #7f1d1d22, #1a1a2e);
  border: 1px solid #ef444433;
}

.info-card h4 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.info-card p {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
}

.info-card ul, .info-card ol {
  font-size: 0.85rem;
  color: var(--text-dim);
  padding-left: 1.25rem;
  margin-bottom: 0.75rem;
}

.info-card li {
  margin-bottom: 0.4rem;
}

.info-card .note {
  font-size: 0.8rem;
  color: var(--accent);
  font-style: italic;
}

/* Threshold chart */
.threshold-chart {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 1rem 0;
}

.threshold {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background: var(--color);
  border-radius: 6px;
  font-size: 0.85rem;
}

.thresh-value {
  font-weight: 600;
  color: #1a1a2e;
}

.thresh-label {
  color: #1a1a2e;
}

/* Temperature comparison */
.temp-comparison {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.temp-type {
  padding: 0.75rem;
  background: var(--bg-card);
  border-radius: 8px;
}

.temp-type strong {
  color: var(--accent);
  display: block;
  margin-bottom: 0.25rem;
}

.temp-type p {
  margin: 0;
  font-size: 0.8rem;
}

/* Danger scale */
.danger-scale {
  display: flex;
  gap: 0.25rem;
  margin: 1rem 0;
  border-radius: 8px;
  overflow: hidden;
}

.danger-level {
  flex: 1;
  padding: 0.5rem 0.25rem;
  text-align: center;
  font-size: 0.65rem;
}

.danger-level span:first-child {
  display: block;
  font-weight: 600;
}

.danger-level.safe { background: #22c55e; color: white; }
.danger-level.caution { background: #eab308; color: #1a1a2e; }
.danger-level.warning { background: #f97316; color: white; }
.danger-level.extreme { background: #ef4444; color: white; }
.danger-level.lethal { background: #991b1b; color: white; }

/* Psychrometer diagram */
.psychrometer-diagram {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 1rem 0;
  padding: 1rem;
  background: var(--bg-card);
  border-radius: 8px;
}

.psychro-bulb {
  text-align: center;
  padding: 1rem;
  border-radius: 8px;
}

.psychro-bulb.dry { background: #ef444433; }
.psychro-bulb.wet { background: #3b82f633; }

.psychro-bulb span:first-child {
  display: block;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.bulb-temp {
  font-size: 1.5rem;
  font-weight: 600;
}

.psychro-arrow {
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* Formula */
.formula {
  display: block;
  background: var(--bg-card);
  padding: 1rem;
  border-radius: 8px;
  font-family: monospace;
  font-size: 0.85rem;
  overflow-x: auto;
  margin: 0.75rem 0;
}

/* Examples */
.example-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}

.example-card {
  background: var(--bg);
  border-radius: 10px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.example-location {
  font-size: 0.9rem;
  font-weight: 500;
}

.example-conditions {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-family: monospace;
}

.example-note {
  font-size: 0.75rem;
  color: var(--accent);
  font-style: italic;
}

.wetbulb-footer {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-dim);
}

.wetbulb-footer strong {
  color: var(--accent);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .sim-result-main {
    grid-template-columns: 1fr;
  }
  
  .sim-thermometer {
    height: 200px;
    justify-content: center;
  }
  
  .bignum-value {
    font-size: 3rem;
  }
  
  .simulator-controls {
    flex-direction: column;
    gap: 1rem;
  }
  
  .sim-control {
    min-width: 100%;
  }
  
  .info-cards {
    grid-template-columns: 1fr;
  }
}
