/* ── Reset & Foundation ──────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #3b82f6;
  --primary-dark: #1d4ed8;
  --bg: #0f172a;
  --bg-card: rgba(30, 41, 59, 0.7);
  --bg-card-solid: #1e293b;
  --bg-surface: rgba(51, 65, 85, 0.5);
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --border: rgba(148, 163, 184, 0.12);
  --radius: 20px;
  --radius-sm: 12px;
  --glass: saturate(180%) blur(20px);
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── App Shell ───────────────────────────────────────── */
.app {
  max-width: 520px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* ── Header ──────────────────────────────────────────── */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 0.75rem 1rem;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: var(--glass);
  -webkit-backdrop-filter: var(--glass);
  border-bottom: 1px solid var(--border);
}

.search-wrap {
  position: relative;
}

.geo-btn {
  position: absolute;
  right: 2.25rem;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: color 0.15s, background 0.15s;
  padding: 0;
  z-index: 2;
}
.geo-btn:hover { color: var(--primary); background: rgba(59, 130, 246, 0.1); }
.geo-btn.loading { animation: spin 0.8s linear infinite; }

.search-input {
  width: 100%;
  padding: 0.75rem 3.75rem 0.75rem 2.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  font-size: 0.9375rem;
  color: var(--text);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  font-family: inherit;
}

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

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}

.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--bg-card-solid);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  box-shadow: 0 16px 48px rgba(0,0,0,0.4);
  z-index: 50;
  display: none;
  max-height: 320px;
  overflow-y: auto;
}

.search-results.open { display: block; }

.search-clear {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: color 0.15s, background 0.15s;
  padding: 0;
  z-index: 2;
}

.search-clear:hover { color: var(--text); background: rgba(148, 163, 184, 0.15); }
.search-clear.visible { display: flex; }

.search-section-label {
  padding: 0.5rem 1rem 0.25rem;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.search-result-item.recent {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.search-result-item.recent .recent-icon {
  color: var(--text-dim);
  flex-shrink: 0;
}

.search-result-item.recent .recent-info { flex: 1; min-width: 0; }

.recent-delete {
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
  transition: color 0.15s, background 0.15s;
  padding: 0;
}

.recent-delete:hover { color: #ef4444; background: rgba(239,68,68,0.1); }

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

.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover, .search-result-item:active { background: rgba(59, 130, 246, 0.15); }

.search-result-name { font-weight: 600; font-size: 0.9375rem; }
.search-result-region { font-size: 0.8125rem; color: var(--text-muted); margin-top: 0.125rem; }

/* ── Tab Bar ──────────────────────────────────────────── */
.tab-bar {
  display: flex;
  gap: 2px;
  padding: 0 1rem;
  margin-top: 0.5rem;
}

.tab-btn {
  flex: 1;
  padding: 0.625rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: color var(--transition), background var(--transition);
  position: relative;
}

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

.tab-btn.active {
  color: var(--primary);
  background: rgba(59, 130, 246, 0.08);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 20%;
  right: 20%;
  height: 2px;
  background: var(--primary);
  border-radius: 1px;
}

/* ── Content ─────────────────────────────────────────── */
.content {
  flex: 1;
  padding: 0.75rem 1rem 6rem;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Loading / Placeholder ────────────────────────────── */
.loading, .placeholder {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-muted);
}
.loading { display: none; }
.loading.visible { display: block; }

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin: 0 auto 0.75rem;
}

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

.placeholder-icon { font-size: 3rem; margin-bottom: 0.5rem; opacity: 0.6; }

/* ── Current Weather Card ─────────────────────────────── */
.current-card {
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
  position: relative;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(135deg, #1e40af 0%, #3b82f6 50%, #60a5fa 100%);
  box-shadow: 0 8px 32px rgba(59, 130, 246, 0.25);
  min-height: 480px;
  display: flex;
  flex-direction: column;
}

.current-card-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 0.8s ease;
  z-index: 0;
}

.current-card-bg.loaded { opacity: 0.85; }

/* Top fade for icon legibility, light bottom dim so the text
   glass-pill reads against any photo. */
.current-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.25) 0%,
    rgba(0,0,0,0) 25%,
    rgba(0,0,0,0) 55%,
    rgba(0,0,0,0.35) 100%
  );
  z-index: 0;
}

/* Dynamic gradients based on condition */
.current-card.clear { background: linear-gradient(135deg, #ea580c, #f59e0b, #fbbf24); }
.current-card.cloudy { background: linear-gradient(135deg, #334155, #475569, #64748b); }
.current-card.rain { background: linear-gradient(135deg, #1e3a5f, #2563eb, #3b82f6); }
.current-card.snow { background: linear-gradient(135deg, #475569, #94a3b8, #cbd5e1); color: #1e293b; }
.current-card.thunder { background: linear-gradient(135deg, #312e81, #4c1d95, #6d28d9); }
.current-card.fog { background: linear-gradient(135deg, #374151, #6b7280, #9ca3af); }
.current-card.night { background: linear-gradient(135deg, #0f172a, #1e293b, #334155); }
.current-card.night-clear { background: linear-gradient(135deg, #0c1445, #1e1b4b, #312e81); }

.current-card::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -40px;
  width: 200px;
  height: 200px;
  background: rgba(255,255,255,0.06);
  border-radius: 50%;
}

.current-card::after {
  content: '';
  position: absolute;
  bottom: -80px;
  left: -40px;
  width: 180px;
  height: 180px;
  background: rgba(255,255,255,0.04);
  border-radius: 50%;
}

/* Hero pinned to the bottom of the card — image breathes above.
   Flex column so each glass pill sizes to its own content width
   instead of stretching full-card. */
.current-hero {
  margin-top: auto;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* Glass pill for the location/date/source block. */
.current-hero-pill {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  align-self: flex-start;
  padding: 0.75rem 1rem;
  border-radius: 14px;
  background: rgba(15,23,42,0.3);
  backdrop-filter: blur(2px) saturate(120%);
  -webkit-backdrop-filter: blur(2px) saturate(120%);
}


.current-location {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.current-date {
  font-size: 0.8125rem;
  opacity: 0.9;
  margin-top: 0.125rem;
}

.current-source {
  font-size: 0.6875rem;
  opacity: 0.75;
  margin-top: 0.125rem;
}

.current-icon {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  font-size: 3.5rem;
  line-height: 1;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4));
  z-index: 2;
}

/* Bottom row: temp tile + 3 detail tiles, all the same height. */
.current-details {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-top: 1.25rem;
  align-self: stretch;
  align-items: stretch;
  position: relative;
  z-index: 1;
}

.current-detail {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 0.625rem 0.375rem;
  background: rgba(15,23,42,0.3);
  border-radius: 10px;
  backdrop-filter: blur(2px) saturate(120%);
  -webkit-backdrop-filter: blur(2px) saturate(120%);
}

.current-detail-icon { font-size: 1rem; margin-bottom: 0.125rem; }
.current-detail-val { font-size: 0.8125rem; font-weight: 600; }
.current-detail-label { font-size: 0.625rem; opacity: 0.7; text-transform: uppercase; letter-spacing: 0.5px; }

/* Temperature tile: number fills the pill height — no icon, no
   label, just the value as the visual anchor of the bottom row. */
.current-detail-temp {
  padding: 0.25rem 0.375rem;
}
.current-detail-temp-val {
  font-size: 2.5rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -2px;
  text-shadow: 0 1px 8px rgba(0,0,0,0.45);
}
.current-detail-temp-unit {
  font-size: 1.125rem;
  font-weight: 400;
  opacity: 0.75;
  margin-left: 1px;
  letter-spacing: 0;
}

.image-attribution {
  font-size: 0.5625rem;
  opacity: 0.5;
  text-align: right;
  margin-top: 0.5rem;
  position: relative;
  z-index: 1;
}
.image-attribution a { color: inherit; text-decoration: underline; }

/* ── Warnings ─────────────────────────────────────────── */
.warnings-wrap { margin-bottom: 0.75rem; }

.warning-banner {
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  font-size: 0.8125rem;
  line-height: 1.4;
  cursor: pointer;
  transition: opacity 0.15s;
}

.warning-banner:active { opacity: 0.8; }

.warning-banner.severity-minor { background: rgba(250,204,21,0.15); border-left: 3px solid #fbbf24; color: #fef3c7; }
.warning-banner.severity-moderate { background: rgba(245,158,11,0.2); border-left: 3px solid #f59e0b; color: #fef3c7; }
.warning-banner.severity-severe { background: rgba(239,68,68,0.2); border-left: 3px solid #ef4444; color: #fecaca; }
.warning-banner.severity-extreme { background: rgba(147,51,234,0.2); border-left: 3px solid #9333ea; color: #e9d5ff; }

.warning-headline { font-weight: 700; margin-bottom: 0.25rem; }
.warning-desc { display: none; font-size: 0.75rem; opacity: 0.85; margin-top: 0.375rem; }
.warning-banner.expanded .warning-desc { display: block; }
.warning-expires { font-size: 0.6875rem; opacity: 0.6; }

/* ── AQI Card ─────────────────────────────────────────── */
.aqi-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.aqi-gauge {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
}

.aqi-gauge.green { background: #22c55e; }
.aqi-gauge.yellow { background: #eab308; color: #1a1a2e; }
.aqi-gauge.orange { background: #f97316; }
.aqi-gauge.red { background: #ef4444; }
.aqi-gauge.purple { background: #9333ea; }
.aqi-gauge.maroon { background: #7f1d1d; }

.aqi-info { flex: 1; min-width: 0; }
.aqi-title { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700; }
.aqi-level { font-size: 1rem; font-weight: 700; margin-top: 0.125rem; }
.aqi-details { font-size: 0.6875rem; color: var(--text-muted); margin-top: 0.25rem; }

/* ── Pollen Card ──────────────────────────────────────── */
.pollen-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pollen-row {
  display: grid;
  grid-template-columns: 1.25rem 1fr auto auto;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.8125rem;
}

.pollen-emoji { font-size: 0.9375rem; line-height: 1; text-align: center; }
.pollen-name { font-weight: 600; }
.pollen-value { font-size: 0.6875rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }

.pollen-level {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  color: #fff;
  min-width: 4rem;
  text-align: center;
}

.pollen-level.gray   { background: #475569; color: #cbd5e1; }
.pollen-level.green  { background: #22c55e; }
.pollen-level.orange { background: #f97316; }
.pollen-level.red    { background: #ef4444; }

.pollen-empty {
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-align: center;
  padding: 0.25rem 0;
}

/* ── Section ──────────────────────────────────────────── */
.section-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 0.625rem;
  padding-left: 0.25rem;
}

/* ── Hourly ──────────────────────────────────────────── */
.hourly-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  overflow: hidden;
}

.hourly-outer {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.hourly-outer::-webkit-scrollbar { display: none; }

.hourly-chart-svg { display: block; }

.hourly-items {
  display: flex;
}

.hourly-item {
  flex-shrink: 0;
  width: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.25rem 0.5rem;
  border-radius: 0 0 10px 10px;
  transition: background var(--transition);
  cursor: pointer;
}

.hourly-item.selected {
  background: rgba(59, 130, 246, 0.15);
}

.hourly-time {
  font-size: 0.6875rem;
  color: var(--text-muted);
  font-weight: 500;
}

.hourly-icon { font-size: 1.125rem; }

.hourly-precip {
  font-size: 0.625rem;
  color: #60a5fa;
  font-weight: 600;
  min-height: 0.75rem;
}

/* ── Temp Chart ───────────────────────────────────────── */
.temp-chart-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  overflow: hidden;
}

.temp-chart-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.temp-chart-scroll::-webkit-scrollbar { display: none; }

.temp-chart-svg {
  display: block;
}

.temp-chart-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0.5rem 0.75rem 0.75rem;
  font-size: 0.6875rem;
  color: var(--text-muted);
}

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

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── 7-Day Forecast ──────────────────────────────────── */
.daily-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.daily-row {
  display: grid;
  grid-template-columns: 80px 28px 1fr 50px;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}

.daily-row:last-child { border-bottom: none; }
.daily-row:hover, .daily-row:active { background: rgba(255,255,255,0.03); }

.daily-day {
  font-size: 0.875rem;
  font-weight: 600;
}

.daily-day-sub {
  font-size: 0.6875rem;
  color: var(--text-muted);
  font-weight: 400;
  display: block;
}

.daily-icon { font-size: 1.25rem; text-align: center; }

.daily-bar-wrap {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  min-width: 0;
}

.daily-temp-low {
  font-size: 0.8125rem;
  color: var(--text-muted);
  width: 30px;
  text-align: right;
  flex-shrink: 0;
}

.daily-bar {
  flex: 1;
  height: 5px;
  background: rgba(148, 163, 184, 0.15);
  border-radius: 3px;
  position: relative;
  overflow: hidden;
  min-width: 50px;
}

.daily-bar-fill {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #60a5fa, #fbbf24);
  transition: left 0.3s, width 0.3s;
}

.daily-temp-high {
  font-size: 0.8125rem;
  font-weight: 700;
  width: 30px;
  flex-shrink: 0;
}

.daily-precip {
  font-size: 0.6875rem;
  color: #60a5fa;
  text-align: right;
  white-space: nowrap;
}

/* ── Daily Detail (expanded) ──────────────────────────── */
.daily-detail {
  display: none;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,0.15);
}

.daily-detail.open { display: block; }

.daily-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.daily-detail-item {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.daily-detail-item strong {
  color: var(--text);
  font-weight: 600;
}

.daily-hourly-scroll {
  display: flex;
  overflow-x: auto;
  gap: 0.125rem;
  padding: 0.625rem 0;
  margin-top: 0.5rem;
  scrollbar-width: none;
}

.daily-hourly-scroll::-webkit-scrollbar { display: none; }

.dh-item {
  flex-shrink: 0;
  width: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.6875rem;
}

.dh-time { color: var(--text-muted); font-weight: 500; }
.dh-icon { font-size: 1rem; }
.dh-temp { font-weight: 700; font-size: 0.8125rem; }
.dh-precip { color: #60a5fa; }

/* ════════════════════════════════════════════════════════
   RADAR TAB
   ════════════════════════════════════════════════════════ */
.radar-container {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #f0f4f0;
}

#radar-map {
  width: 100%;
  height: 65vh;
  min-height: 400px;
  background: #e8f0e8;
  z-index: 0;
  position: relative;
}

/* Override Leaflet tile gaps */
.leaflet-tile-pane { opacity: 1; }
.leaflet-container { background: #e8f0e8; }
.leaflet-radar-pane { pointer-events: none; }

/* ── Radar Controls ──────────────────────────────────── */
.radar-controls {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: var(--glass);
  padding: 0.875rem 1rem;
  border-top: 1px solid rgba(0,0,0,0.1);
}

.radar-time-display {
  text-align: center;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.625rem;
  color: #1a2e1a;
}

.radar-time-display .radar-label {
  font-size: 0.6875rem;
  color: #4a6a4a;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: color 0.2s;
}

.radar-time-display .radar-label.forecast { color: #fbbf24; }

.radar-slider-row {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.radar-play-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--transition), transform 0.1s;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.radar-play-btn:hover { background: var(--primary-dark); }
.radar-play-btn:active { transform: scale(0.94); }

.radar-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: rgba(0, 80, 0, 0.15);
  outline: none;
}

.radar-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.radar-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  border: none;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

/* Legend */
.radar-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  margin-top: 0.625rem;
  font-size: 0.625rem;
  color: #4a6a4a;
}

.radar-legend-bar {
  width: 120px;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, #00c8ff, #0096ff, #0064ff, #ff9600, #ff0000);
}

/* ── Footer ──────────────────────────────────────────── */
.footer {
  text-align: center;
  padding: 1rem;
  font-size: 0.6875rem;
  color: var(--text-dim);
}

.footer a { color: var(--primary); text-decoration: none; }

/* ── Events ──────────────────────────────────────────── */
.events-header {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  margin-bottom: 0.875rem;
}

.events-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.2px;
}

.events-filters {
  display: flex;
  gap: 0.375rem;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 -1rem;
  padding: 0 1rem;
}

.events-filters::-webkit-scrollbar { display: none; }
.events-filters-time { margin-top: 0.375rem; }

.events-chip {
  flex-shrink: 0;
  padding: 0.4375rem 0.875rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.events-chip-sm {
  font-size: 0.75rem;
  padding: 0.3125rem 0.6875rem;
  font-weight: 500;
}

.events-chip:hover { color: var(--text); }

.events-chip.active {
  background: rgba(59, 130, 246, 0.18);
  color: var(--primary);
  border-color: rgba(59, 130, 246, 0.4);
}

.events-day-header {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 0.875rem 0.25rem 0.5rem;
  position: sticky;
  top: 0;
  background: linear-gradient(to bottom, var(--bg) 70%, rgba(15, 23, 42, 0));
  z-index: 5;
}

.events-day-header:first-child { padding-top: 0.25rem; }
.events-day-header.today { color: var(--primary); }

.event-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.875rem;
  margin-bottom: 0.5rem;
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 0.75rem;
  align-items: center;
  cursor: default;
  transition: border-color 0.15s, background 0.15s;
}

.event-card:hover { border-color: rgba(148, 163, 184, 0.25); }

.event-time {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.event-time-main {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
}

.event-time-end {
  font-size: 0.6875rem;
  color: var(--text-dim);
  margin-top: 0.0625rem;
}

.event-time-allday {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  line-height: 1.2;
}

.event-body { min-width: 0; }

.event-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.event-cat-emoji {
  font-size: 0.875rem;
  margin-right: 0.3125rem;
  display: inline-block;
}

.event-meta {
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.event-venue {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  flex: 1;
  min-width: 0;
}

.event-badge {
  flex-shrink: 0;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.125rem 0.4375rem;
  border-radius: 999px;
}

.event-badge.free {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}

/* ── Movies view (when category=film) ───────────────── */
.movie-radius-banner {
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 0.375rem 0.625rem;
  margin-bottom: 0.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}


.movie-card {
  grid-template-columns: 154px 1fr;
  cursor: pointer;
  align-items: start;
  gap: 0.75rem;
}

.movie-card:not(:has(.movie-poster)) {
  grid-template-columns: 1fr;
}

.movie-poster {
  width: 154px;
  height: 205px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  align-self: start;
  display: block;
}

.cinema-overflow {
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 0.375rem 0.625rem;
  text-align: center;
}

.movie-cast {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.movie-card.movie-card-expanded {
  border-color: rgba(59, 130, 246, 0.35);
  background: rgba(59, 130, 246, 0.04);
}

.movie-trailer-btn {
  align-self: flex-start;
  margin-top: 0.5rem;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: var(--primary);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.4375rem 0.875rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.movie-trailer-btn:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.55);
}

/* Synopsis + cinemas span the full card width, sitting below the
   poster + body row, so long text reads on a wider line and the
   cinema list isn't pushed too far down. */
.movie-synopsis-block,
.movie-cinemas {
  grid-column: 1 / -1;
  display: none;
  flex-direction: column;
  margin-top: 0.625rem;
  padding-top: 0.625rem;
  border-top: 1px solid var(--border);
  gap: 0.25rem;
}

.movie-card.movie-card-expanded .movie-synopsis-block:not(:empty),
.movie-card.movie-card-expanded .movie-cinemas {
  display: flex;
}

.movie-synopsis {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text);
}

.movie-synopsis-clamped {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.movie-synopsis-toggle {
  align-self: center;
  background: transparent;
  border: 0;
  font: inherit;
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 0.375rem 0.625rem;
  text-align: center;
  cursor: pointer;
}

.movie-synopsis-toggle:hover { color: var(--text); }


/* ── Trailer overlay ─────────────────────────────────── */
.trailer-overlay {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.trailer-overlay:fullscreen {
  background: #000;
}

.trailer-frame {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.trailer-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  border: 0;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.trailer-close:hover { background: rgba(0, 0, 0, 0.85); }

.cinema-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.625rem;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  font-size: 0.8125rem;
  color: var(--text);
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}

a.cinema-item:hover {
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.3);
}

.cinema-name {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

.cinema-meta {
  flex-shrink: 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.events-more-btn {
  display: block;
  width: 100%;
  margin: 0.75rem 0;
  padding: 0.75rem;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
}

.events-more-btn:hover { background: rgba(59, 130, 246, 0.1); border-color: rgba(59, 130, 246, 0.3); }

.events-source {
  text-align: center;
  font-size: 0.6875rem;
  color: var(--text-dim);
  padding: 0.75rem 0 0.25rem;
}

.events-source a { color: var(--primary); text-decoration: none; }

/* ── Mobile ──────────────────────────────────────────── */
@media (max-width: 520px) {
  .app { max-width: 100%; }

  .current-detail-temp-val { font-size: 2.25rem; }
  .current-icon { font-size: 3rem; }

  .current-details {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.375rem;
  }
  .current-detail { padding: 0.5rem 0.25rem; }
  .current-detail-val { font-size: 0.75rem; }
  .current-detail-label { font-size: 0.5625rem; letter-spacing: 0.3px; }

  .daily-row {
    grid-template-columns: 70px 24px 1fr 42px;
    padding: 0.75rem;
    gap: 0.375rem;
  }

  .daily-day { font-size: 0.8125rem; }
  .daily-temp-low, .daily-temp-high { font-size: 0.75rem; width: 26px; }
}

@media (min-width: 521px) {
  .content { padding-bottom: 2rem; }
}

/* ── Animations ──────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.4s ease-out forwards;
}

.fade-in-delay-1 { animation-delay: 0.08s; opacity: 0; }
.fade-in-delay-2 { animation-delay: 0.16s; opacity: 0; }
.fade-in-delay-3 { animation-delay: 0.24s; opacity: 0; }
