:root {
  --navy: #0c2d48;
  --navy-2: #143a58;
  --coast: #1e6f9a;
  --sky: #e7f0f6;
  --foam: #fbfdff;
  --sand: #f3ede2;
  --ink: #132333;
  --muted: #5b6b7a;
  --line: #d5e0e8;
  --card: #ffffff;
  --accent: #1e6f9a;
  --good: #2a8f7a;
  --warn-y: #a78400;
  --warn-y-bg: #fff6d6;
  --warn-y-bar: #e6b800;
  --warn-o: #c65a0c;
  --warn-o-bg: #ffe8d4;
  --warn-o-bar: #e87a12;
  --warn-r: #b51d1d;
  --warn-r-bg: #fdecec;
  --warn-r-bar: #d12424;
  --tab-h: 64px;
  --radius: 18px;
  --shadow: 0 10px 28px rgba(12, 45, 72, 0.09);
  --font: Inter, "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
}

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

html,
body {
  height: 100%;
}

body {
  font-family: var(--font);
  background: #c5d4e0;
  color: var(--ink);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

#app {
  min-height: 100%;
  max-width: 480px;
  margin: 0 auto;
  background: var(--sky);
  display: flex;
  flex-direction: column;
  position: relative;
  padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px));
}

button,
.tab {
  font-family: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

.topbar {
  background: linear-gradient(165deg, #0b2a44 0%, #164a6e 55%, #1a5a82 100%);
  color: #fff;
  padding: 12px 20px 18px;
  flex-shrink: 0;
}

.topbar-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.app-name {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.7;
  font-weight: 600;
}

#place-name,
.place-name {
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.02em;
  margin-top: 2px;
}

.meta,
#updated-at {
  font-size: 12px;
  opacity: 0.75;
  margin-top: 2px;
}

.location-note {
  display: none;
  font-size: 11px;
  opacity: 0.8;
  margin-top: 6px;
}

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

main {
  flex: 1;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.screen {
  display: none;
  padding: 16px 16px 24px;
}

.screen.active {
  display: block;
}

.hero {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 18px 16px;
  margin-bottom: 14px;
}

.hero-temp-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.temp-main {
  font-size: 76px;
  font-weight: 620;
  letter-spacing: -0.05em;
  line-height: 0.9;
  color: var(--navy);
}

.temp-unit {
  font-size: 28px;
  font-weight: 550;
  vertical-align: super;
  margin-left: 2px;
  letter-spacing: 0;
}

.condition {
  font-size: 16px;
  font-weight: 575;
  margin-top: 10px;
  color: var(--ink);
}

.minmax {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}

.minmax strong {
  color: var(--ink);
  font-weight: 600;
}

.hero-icon {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  margin-top: 4px;
}

.map-card {
  background: linear-gradient(180deg, #d7e8f4 0%, #c5dced 100%);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px 8px 8px;
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
}

.map-caption {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--navy);
  opacity: 0.7;
  padding: 0 8px 4px;
}

.map-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 500 / 350;
}

.map-wrap svg {
  width: 100%;
  height: 100%;
  display: block;
}

.land {
  fill: #f6f1e6;
  stroke: #5e849c;
  stroke-width: 1.6;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.island {
  fill: #f6f1e6;
  stroke: #5e849c;
  stroke-width: 1.2;
  stroke-linejoin: round;
}

.sea-label {
  fill: #3d6d8a;
  font-size: 11px;
  font-family: var(--font);
  font-weight: 600;
  opacity: 0.45;
}

.city-dot {
  fill: #0c2d48;
  opacity: 0.55;
}

.city-label {
  fill: #0c2d48;
  font-size: 11px;
  font-family: var(--font);
  font-weight: 600;
  opacity: 0.7;
}

.pin {
  position: absolute;
  transform: translate(-50%, -100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  z-index: 2;
}

.pin-bubble {
  background: var(--navy);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  line-height: 1;
  padding: 5px 8px;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(12, 45, 72, 0.25);
  white-space: nowrap;
}

.pin-needle {
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 8px solid var(--navy);
  margin-top: -1px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.metric {
  background: var(--card);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 12px 10px;
  text-align: center;
}

.metric-label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.metric-value {
  font-size: 16px;
  font-weight: 650;
  margin-top: 4px;
  color: var(--navy);
}

.section-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 2px 0 4px;
  color: var(--navy);
}

.section-sub {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 14px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 14px 12px;
  margin-bottom: 12px;
}

.card h3 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}

.hourly {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.hour {
  flex: 0 0 62px;
  text-align: center;
  padding: 8px 4px;
  border-radius: 14px;
  background: #f3f7fa;
}

.hour.is-now {
  background: var(--navy);
  color: #fff;
}

.hour.is-past {
  opacity: 0.5;
}

.hour-time {
  font-size: 11px;
  font-weight: 600;
}

.hour-icon {
  width: 28px;
  height: 28px;
  margin: 6px auto;
  display: block;
}

.hour-temp {
  font-size: 15px;
  font-weight: 700;
}

.precip-row,
.wind-row {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  overflow-x: auto;
  min-height: 84px;
  padding-bottom: 2px;
}

.precip-col,
.wind-col {
  flex: 0 0 28px;
  text-align: center;
  font-size: 10px;
  color: var(--muted);
}

.bar-track {
  height: 64px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  margin-bottom: 4px;
}

.bar {
  width: 10px;
  border-radius: 4px 4px 2px 2px;
  background: #8fc4d8;
  min-height: 2px;
}

.bar.has-rain {
  background: #2a8f7a;
}

.wind-col .bar {
  background: #5b8fb0;
}

.day-list {
  list-style: none;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.day-row {
  display: grid;
  grid-template-columns: 72px 36px 1fr 86px;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.day-row:last-child {
  border-bottom: 0;
}

.day-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--navy);
}

.day-name span {
  display: block;
  font-weight: 500;
  font-size: 11px;
  color: var(--muted);
}

.day-icon {
  width: 32px;
  height: 32px;
}

.temp-range {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 650;
}

.temp-range .min {
  color: var(--muted);
  width: 28px;
  text-align: right;
}

.temp-range .max {
  width: 28px;
}

.range-track {
  flex: 1;
  height: 6px;
  background: #e3ebf1;
  border-radius: 99px;
  position: relative;
  overflow: hidden;
}

.range-fill {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #7eb8d6, #e8a03c);
}

.day-pop {
  font-size: 12px;
  color: var(--good);
  font-weight: 650;
  text-align: right;
}

.source-note {
  font-size: 12px;
  color: var(--muted);
  background: #eef4f8;
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 12px;
}

.warning-card {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 12px;
  background: var(--card);
  border: 1px solid transparent;
}

.warning-card.yellow {
  background: var(--warn-y-bg);
  border-color: #f0d56a;
}

.warning-card.orange {
  background: var(--warn-o-bg);
  border-color: #f0b27a;
}

.warning-card.red {
  background: var(--warn-r-bg);
  border-color: #f0a0a0;
}

.warning-bar {
  height: 8px;
}

.warning-card.yellow .warning-bar { background: var(--warn-y-bar); }
.warning-card.orange .warning-bar { background: var(--warn-o-bar); }
.warning-card.red .warning-bar { background: var(--warn-r-bar); }

.warning-body {
  padding: 12px 14px 14px;
}

.warning-level {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.warning-card.yellow .warning-level { color: var(--warn-y); }
.warning-card.orange .warning-level { color: var(--warn-o); }
.warning-card.red .warning-level { color: var(--warn-r); }

.warning-title {
  font-size: 16px;
  font-weight: 750;
  margin: 4px 0 2px;
  color: var(--ink);
}

.warning-region {
  font-size: 13px;
  font-weight: 650;
  color: var(--navy);
}

.warning-when,
.warning-text {
  font-size: 13px;
  color: #3f4d5a;
  margin-top: 6px;
}

.demo-tag {
  display: inline-block;
  margin-top: 10px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(19, 35, 51, 0.08);
  color: var(--navy);
  padding: 3px 8px;
  border-radius: 999px;
}

.empty-state,
.error-state,
.loading {
  text-align: center;
  color: var(--muted);
  padding: 28px 12px;
  font-size: 14px;
}

.tabbar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 480px;
  height: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(251, 253, 255, 0.96);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  z-index: 20;
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 650;
  color: #6a7b8a;
  padding-top: 6px;
}

.tab svg {
  width: 22px;
  height: 22px;
}

.tab.active {
  color: var(--navy);
}

.tab.active svg {
  stroke-width: 2.2;
}

.hidden { display: none !important; }

@media (min-width: 481px) {
  body {
    padding: 24px 0;
    background: #9fb4c6;
  }

  #app {
    min-height: calc(100% - 48px);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(12, 45, 72, 0.2);
  }

  .tabbar {
    border-radius: 0 0 24px 24px;
  }
}


/* --- City chips, radar, hourly strip, dark theme --- */
.city-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin-top: 12px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.city-chips::-webkit-scrollbar { display: none; }
.city-chip {
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 650;
}
.city-chip.active {
  background: #fff;
  color: var(--navy);
  border-color: #fff;
}
.city-chip-location {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.hourly-home {
  margin: 0 0 14px;
  padding: 12px 8px 10px;
}

.radar-map {
  width: 100%;
  height: 236px;
  border-radius: 12px;
  background: #c5dced;
  z-index: 1;
}
.radar-map.hidden,
.map-fallback.hidden { display: none; }

.map-fallback {
  position: relative;
  width: 100%;
  aspect-ratio: 500 / 350;
}

.radar-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 6px 4px;
}
#radar-play,
.radar-play {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 13px;
  line-height: 1;
}
.radar-controls input[type="range"] {
  flex: 1;
  accent-color: var(--navy);
}
#radar-label,
.radar-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--navy);
  min-width: 48px;
  text-align: right;
}

.leaflet-container {
  font-family: var(--font);
  background: #c5dced;
  border-radius: 12px;
}

.temp-warm { color: #d27312; }
.temp-cool { color: #1e7a8a; }
.gust-flag {
  font-size: 12px;
  font-weight: 700;
  color: #b51d1d;
}

.max { color: #d27312; font-weight: 700; }
.min { color: #1e7a8a; font-weight: 700; }

@media (prefers-color-scheme: dark) {
  :root {
    --sky: #0e1620;
    --foam: #121c28;
    --card: #1a2633;
    --ink: #e8eef4;
    --muted: #9aa8b5;
    --line: #2a3948;
    --shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
    --navy: #d5e6f3;
    --navy-2: #0f2233;
    --coast: #5aa3c8;
  }
  body { background: #070c12; }
  .topbar {
    background: linear-gradient(165deg, #07131e 0%, #0c2233 55%, #123044 100%);
  }
  .hero,
  .metric,
  .card,
  .day-list,
  .hourly-home {
    background: var(--card);
  }
  .temp-main,
  .metric-value,
  .day-name,
  .warning-region,
  #radar-label,
  .radar-label { color: var(--ink); }
  .hour { background: #223040; }
  .hour.is-now { background: #d5e6f3; color: #0c2d48; }
  .map-card { background: linear-gradient(180deg, #1a2c3a 0%, #152430 100%); }
  .map-caption { color: #d5e6f3; }
  .land, .island { fill: #2a3d4c; stroke: #7fa3b8; }
  .city-label, .city-dot { fill: #e8eef4; }
  .sea-label { fill: #8eb4c8; }
  .range-track { background: #2a3948; }
  .source-note { background: #223040; color: var(--muted); }
  .tabbar {
    background: rgba(14, 22, 32, 0.96);
    border-top-color: #2a3948;
  }
  .tab { color: #8a9aa8; }
  .tab.active { color: #e8eef4; }
  .city-chip.active { color: #0c2d48; }
  #radar-play, .radar-play { background: #d5e6f3; color: #0c2d48; }
  .radar-controls input[type="range"] { accent-color: #d5e6f3; }
  .warning-title { color: #1a1a1a; }
  .warning-card.yellow .warning-title,
  .warning-card.orange .warning-title,
  .warning-card.red .warning-title,
  .warning-region,
  .warning-when,
  .warning-text { color: #1c2430; }
  .demo-tag { background: rgba(0, 0, 0, 0.12); color: #1c2430; }
}

@media (min-width: 481px) {
  @media (prefers-color-scheme: dark) {
    body { background: #05080c; }
  }
}

/* --- Radar preview (static) and fullscreen --- */
.radar-preview-wrap {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  touch-action: pan-y;
}

.radar-map {
  touch-action: pan-y;
  pointer-events: none;
}

.radar-map .leaflet-container,
.radar-preview-wrap .leaflet-container {
  pointer-events: none;
  touch-action: pan-y;
  background: #9aa0a6;
}

.radar-expand {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 10px;
  background: transparent;
  color: #fff;
  text-align: right;
  cursor: pointer;
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
}

.radar-expand-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(12, 45, 72, 0.72);
  font-size: 18px;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.radar-expand-hint {
  position: absolute;
  left: 50%;
  bottom: 42%;
  transform: translateX(-50%);
  background: rgba(12, 45, 72, 0.78);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.01em;
  white-space: nowrap;
  pointer-events: none;
}

.leaflet-div-icon.city-label-icon {
  background: none;
  border: 0;
  width: auto !important;
  height: auto !important;
}

.city-map-label {
  color: #fff;
  font: 650 11px/1.1 Inter, "IBM Plex Sans", sans-serif;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85), 0 0 4px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
  transform: translate(6px, -7px);
}

.radar-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  background: #111;
  color: #fff;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.radar-fullscreen.hidden {
  display: none;
}

.radar-fs-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: #0c2d48;
}

.radar-fs-bar h2 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.radar-close {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 20px;
  line-height: 1;
}

.radar-map-full {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  background: #3a3d42;
}

.radar-map-full .leaflet-container {
  width: 100%;
  height: 100%;
  pointer-events: auto;
  touch-action: manipulation;
  background: #3a3d42;
}

.radar-controls-full {
  flex: 0 0 auto;
  background: #0c2d48;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
}

.radar-controls-full .radar-label,
.radar-controls-full #radar-label {
  color: #fff;
}

.radar-controls-full input[type="range"] {
  accent-color: #f5c518;
}

.radar-controls-full .radar-play {
  background: #fff;
  color: #0c2d48;
}

body.radar-open {
  overflow: hidden;
}

@media (prefers-color-scheme: dark) {
  .radar-expand-icon,
  .radar-expand-hint {
    background: rgba(8, 14, 20, 0.78);
  }
  .radar-fs-bar,
  .radar-controls-full {
    background: #07131e;
  }
  .radar-preview-wrap .leaflet-container {
    background: #3a3d42;
  }
}

/* Radar player: play/pause box at the bottom of the fullscreen radar */
.radar-controls-full { flex-direction: column; align-items: stretch; gap: 10px; }
.radar-player { display: flex; align-items: center; gap: 12px; }
.radar-controls-full .radar-play { width: 46px; height: 46px; font-size: 16px; }
.radar-player-info { display: flex; flex-direction: column; min-width: 0; }
.radar-controls-full #radar-label { font-size: 17px; text-align: left; min-width: 0; }
.radar-sub { font-size: 12px; opacity: 0.8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.radar-strip { display: flex; align-items: flex-end; gap: 3px; height: 28px; }
.strip-cell { flex: 1; height: 100%; border-radius: 4px; background: rgba(255,255,255,0.12);
  position: relative; overflow: hidden; cursor: pointer; }
.strip-past { background: rgba(245,197,24,0.35); }
.strip-fc i { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(255,255,255,0.25); }
.strip-fc.wet i { background: #4fc3f7; }
.strip-cell.on { outline: 2px solid #fff; outline-offset: 1px; }

/* Radar player raised: floating card well above Safari's bottom toolbar */
.radar-fullscreen { height: 100dvh; bottom: auto; padding-bottom: 0; }
.radar-fullscreen .radar-map-full { flex: 1 1 auto; }
.radar-controls-full {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 96px);
  z-index: 1000;
  border-radius: 18px;
  padding: 12px 14px;
  background: rgba(12, 45, 72, 0.92);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}
.radar-controls-full .radar-play { width: 52px; height: 52px; font-size: 18px; touch-action: manipulation; }
@media (prefers-color-scheme: dark) {
  .radar-controls-full { background: rgba(7, 19, 30, 0.92); }
}
.radar-controls-full #radar-play { width: 52px; height: 52px; font-size: 18px; }
/* Hide the bottom tab bar while the fullscreen radar is open, so it can't cover the player */
body.radar-open .tabbar { display: none !important; }
.radar-fullscreen { z-index: 2000; }


/* --- Forecast 7 days: parts, day strip, bottom sheet --- */
.temp-mild { color: #1f9a45; }
.temp-hot { color: #c43c12; }

.forecast-parts-card {
  padding: 10px 6px 8px;
}

.forecast-parts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
}

.forecast-part {
  text-align: center;
  padding: 4px 2px 6px;
  min-width: 0;
}

.forecast-part-label {
  font-size: 11px;
  font-weight: 650;
  color: var(--muted);
}

.forecast-part-temp {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 2px 0 0;
  line-height: 1.15;
}

.forecast-part-icon {
  width: 36px;
  height: 36px;
  margin: 2px auto 4px;
}

.forecast-part-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 650;
  color: var(--muted);
}

.forecast-part-empty {
  font-size: 11px;
  color: var(--muted);
  padding: 10px 2px;
}

.wind-arrow {
  display: inline-flex;
  transform-origin: center center;
  color: var(--ink);
  line-height: 0;
}

.pop-drop {
  display: inline-block;
  width: 7px;
  height: 10px;
  margin-right: 3px;
  vertical-align: -1px;
  border-radius: 0 8px 8px 8px;
  transform: rotate(45deg);
  background: #3a9ad9;
}

.forecast-pop {
  white-space: nowrap;
}

.forecast-days {
  display: flex;
  gap: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 12px;
  scrollbar-width: thin;
}

.forecast-day {
  flex: 0 0 86px;
  scroll-snap-align: start;
  text-align: left;
  padding: 10px 10px 12px;
  border-right: 1px solid var(--line);
  color: inherit;
  min-height: 100%;
}

.forecast-day:last-child {
  border-right: 0;
}

.forecast-day-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  text-transform: lowercase;
  line-height: 1.2;
}

.forecast-day-date {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 6px;
}

.forecast-day-temps {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 2px;
}

.forecast-day-max {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.forecast-day-min {
  font-size: 14px;
  font-weight: 650;
  color: var(--muted);
}

.forecast-day-icon {
  width: 32px;
  height: 32px;
  margin: 4px 0;
}

.forecast-day-sun,
.forecast-day-pop {
  font-size: 11px;
  font-weight: 650;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}

.sun-mark {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #f0c020;
  box-shadow: 0 0 0 2px rgba(240, 192, 32, 0.28);
  flex-shrink: 0;
}

.forecast-day.is-selected {
  background: #0c2d48;
  color: #fff;
}

.forecast-day.is-selected .forecast-day-name,
.forecast-day.is-selected .forecast-day-date,
.forecast-day.is-selected .forecast-day-min,
.forecast-day.is-selected .forecast-day-sun,
.forecast-day.is-selected .forecast-day-pop {
  color: rgba(255, 255, 255, 0.86);
}

.forecast-day.is-selected .wind-arrow {
  color: #fff;
}

.day-sheet[hidden],
.day-sheet-backdrop[hidden] {
  display: none !important;
}

.day-sheet-backdrop {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  top: 0;
  width: 100%;
  max-width: 480px;
  bottom: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px));
  background: rgba(8, 16, 24, 0.46);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
  z-index: 40;
}

.day-sheet-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.day-sheet {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px));
  width: 100%;
  max-width: 480px;
  max-height: 70vh;
  max-height: 70dvh;
  display: flex;
  flex-direction: column;
  background: var(--card);
  color: var(--ink);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -10px 32px rgba(12, 45, 72, 0.18);
  transform: translateX(-50%) translateY(110%);
  transition: transform 0.28s ease;
  z-index: 41;
  overflow: hidden;
}

.day-sheet.is-open {
  transform: translateX(-50%) translateY(0);
}

.day-sheet.is-dragging {
  transition: none;
}

.day-sheet-grab {
  flex: 0 0 auto;
  padding: 8px 0 2px;
  touch-action: none;
  cursor: grab;
}

.day-sheet-handle {
  width: 42px;
  height: 4px;
  border-radius: 99px;
  background: #c5d0d8;
  margin: 0 auto;
}

.day-sheet-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 14px 6px 16px;
  flex: 0 0 auto;
}

.day-sheet-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--navy);
  line-height: 1.3;
  min-width: 0;
}

.day-sheet-close {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eef4f8;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  touch-action: manipulation;
}

.day-sheet-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 2px 16px 14px;
}

.day-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 8px;
}

.day-fact {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.day-fact-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  color: var(--coast);
  margin-top: 1px;
}

.day-fact-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 650;
}

.day-fact-value {
  font-size: 13px;
  font-weight: 650;
  color: var(--ink);
  line-height: 1.35;
}

.day-summary {
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink);
}

body.day-sheet-open {
  overflow: hidden;
}

body.day-sheet-open main {
  overflow: hidden;
}

@media (prefers-color-scheme: dark) {
  .forecast-day.is-selected {
    background: #d5e6f3;
    color: #0c2d48;
  }
  .forecast-day.is-selected .forecast-day-name,
  .forecast-day.is-selected .forecast-day-date,
  .forecast-day.is-selected .forecast-day-min,
  .forecast-day.is-selected .forecast-day-sun,
  .forecast-day.is-selected .forecast-day-pop {
    color: #3a4d5c;
  }
  .forecast-day.is-selected .wind-arrow {
    color: #0c2d48;
  }
  .day-sheet-handle {
    background: #4a5b6a;
  }
  .day-sheet-close {
    background: #223040;
    color: var(--ink);
  }
  .temp-mild { color: #5dcc7a; }
  .temp-hot { color: #ff8a65; }
}

/* === Vedro vrijeme — Apple-inspired dark theme (v1950) === */
:root {
  --navy: #d8e4f0;
  --navy-2: #9db0c3;
  --ink: #f4f7fb;
  --muted: rgba(255, 255, 255, 0.62);
  --line: rgba(255, 255, 255, 0.16);
  --card: rgba(20, 28, 40, 0.42);
  --accent: #7ec8ff;
  --good: #7ad0a4;
  --rain: #4ea3ff;
  --wind: #5ce1d6;
  --font: -apple-system, "SF Pro Display", "SF Pro Text", system-ui, "Segoe UI", sans-serif;
  --shadow: none;
  --tab-h: 64px;
  --radius: 18px;
}

html, body {
  background: #1a2330;
  color: #f4f7fb;
}

body {
  font-family: var(--font);
  background: #121820;
}

#app {
  max-width: 480px;
  background: transparent;
  color: #f4f7fb;
}

.sky {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% -10%, #4a5d74 0%, #243044 42%, #151c26 100%);
}

.sky-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(48px);
  opacity: 0.45;
}
.sky-glow.g1 { width: 280px; height: 180px; left: -40px; top: 40px; background: #6b7c90; }
.sky-glow.g2 { width: 260px; height: 200px; right: -50px; top: 120px; background: #3d4d63; }
.sky-cloud {
  position: absolute;
  width: 220px;
  height: 90px;
  border-radius: 80px;
  background: rgba(210, 220, 230, 0.16);
  filter: blur(18px);
}
.sky-cloud.c1 { top: 90px; left: 10%; }
.sky-cloud.c2 { top: 200px; right: -10%; width: 280px; opacity: 0.7; }
.sky-cloud.c3 { top: 420px; left: 20%; width: 240px; opacity: 0.45; }

#app.wx-rain .sky { background: radial-gradient(120% 80% at 50% -10%, #3a4c62 0%, #1b2736 50%, #10161e 100%); }
#app.wx-storm .sky { background: radial-gradient(120% 80% at 50% -10%, #2c3340 0%, #161b24 60%, #0c0f14 100%); }
#app.wx-cloudy .sky { background: radial-gradient(120% 80% at 50% -10%, #5a6573 0%, #2a3340 48%, #161c24 100%); }
#app.wx-night .sky { background: radial-gradient(120% 80% at 50% -10%, #2a3550 0%, #121826 55%, #0a0d14 100%); }

.topbar { position: relative; z-index: 2; }
.tabbar { z-index: 30; }


.topbar {
  background: transparent;
  color: #fff;
  padding: 18px 20px 8px;
  text-align: center;
}

.app-name {
  font-size: 15px;
  letter-spacing: 0;
  text-transform: none;
  opacity: 0.72;
  font-weight: 500;
}

#place-name,
.place-name {
  font-size: 34px;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin-top: 2px;
}

.meta, #updated-at {
  font-size: 13px;
  opacity: 0.7;
  margin-top: 4px;
}

.location-note {
  font-size: 12px;
  opacity: 0.85;
  line-height: 1.35;
}

.city-chips {
  margin-top: 12px;
  justify-content: flex-start;
}

.city-chip {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.city-chip.active {
  background: #fff;
  color: #1a2330;
  border-color: #fff;
}

main { background: transparent; }

.screen {
  padding: 8px 16px 28px;
}

.hero {
  background: none;
  box-shadow: none;
  border-radius: 0;
  padding: 8px 8px 18px;
  margin-bottom: 4px;
  text-align: center;
}

.hero-temp-row { display: block; }

.temp-main {
  font-size: 108px;
  font-weight: 200;
  letter-spacing: -0.06em;
  line-height: 0.86;
  color: #fff;
}

.temp-unit {
  font-size: 64px;
  font-weight: 200;
  vertical-align: 0.12em;
  margin-left: 0;
}

.condition {
  font-size: 20px;
  font-weight: 500;
  margin-top: 6px;
  color: #fff;
}

.minmax {
  display: block;
  margin-top: 6px;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.82);
}
.minmax strong, .minmax .max, .minmax .min { color: #fff; font-weight: 600; }

.hero-icon { display: none; }

.card,
.card.glass,
.map-card,
.forecast-parts-card {
  background: rgba(16, 22, 32, 0.38);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  box-shadow: none;
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  padding: 14px 14px 12px;
  margin-bottom: 14px;
}

.card h3,
.card.glass h3,
.map-caption,
.section-title {
  color: rgba(255, 255, 255, 0.55);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 10px;
}

.section-sub, .source-note {
  color: rgba(255, 255, 255, 0.6);
}

.card-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 8px;
}

.mode-toggles {
  display: flex;
  gap: 6px;
}
.mode-btn {
  flex: 1;
  border-radius: 999px;
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.mode-btn.active {
  background: rgba(255, 255, 255, 0.92);
  color: #1a2330;
  border-color: transparent;
}

.hourly {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: 4px 2px 2px;
}
.hourly::-webkit-scrollbar { display: none; }

.hour {
  flex: 0 0 52px;
  text-align: center;
  color: #fff;
}
.hour.is-now {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 6px 0;
}
.hour-time { font-size: 11px; opacity: 0.7; font-weight: 600; }
.hour-icon { width: 28px; height: 28px; margin: 6px auto; }
.hour-icon svg { width: 28px; height: 28px; }
.hour-temp { font-size: 16px; font-weight: 650; }
.hour-pop { font-size: 10px; color: var(--rain); min-height: 14px; font-weight: 650; }
.hour-mm { font-size: 10px; opacity: 0.75; }
.hour-wind { font-size: 14px; font-weight: 700; color: var(--wind); }
.hour-gust { font-size: 10px; color: rgba(92, 225, 214, 0.75); }

.hour-precip-bar {
  height: 60px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  margin: 6px 0;
}
.hour-precip-bar span {
  display: block;
  width: 10px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, #8ec8ff, var(--rain));
}

.hour-wind-bars {
  height: 56px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  margin: 6px 0;
}
.gust-col, .wind-col-fill {
  display: block;
  width: 6px;
  border-radius: 4px 4px 1px 1px;
}
.gust-col { background: rgba(92, 225, 214, 0.35); }
.wind-col-fill { background: var(--wind); }

.home-daily { display: flex; flex-direction: column; }
.home-day {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  color: #fff;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 14px;
}
.home-day:last-child { border-bottom: 0; }
.day-name { width: 52px; font-weight: 650; flex: 0 0 52px; }
.day-icon { width: 26px; height: 26px; flex: 0 0 26px; }
.day-icon svg { width: 26px; height: 26px; }
.day-pop { width: 36px; font-size: 11px; color: var(--rain); font-weight: 650; flex: 0 0 36px; }
.day-range { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; }
.day-min { width: 28px; text-align: right; opacity: 0.65; font-weight: 650; }
.day-max { width: 28px; font-weight: 700; }
.range-track {
  position: relative;
  flex: 1;
  height: 5px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.16);
}
.range-fill {
  position: absolute;
  top: 0; height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #7ad0a4, #e8d56a, #f0b24a);
}
.range-now {
  position: absolute;
  top: 50%;
  width: 8px; height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(20, 28, 40, 0.5);
}
.day-precip, .day-wind {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  color: #fff;
}
.day-precip-bar {
  display: inline-block;
  height: 8px;
  border-radius: 8px;
  background: var(--rain);
  min-width: 4px;
}
.day-wind { color: var(--wind); }
.wind-spark { color: var(--wind); flex: 0 0 auto; }
.wind-spark.empty { width: 72px; height: 22px; display: inline-block; }

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 2px 0 12px;
}
.detail-card { margin: 0; min-height: 132px; }
.detail-card#card-wind,
.detail-card#card-sun { grid-column: 1 / -1; }

.detail-value { font-size: 28px; font-weight: 300; letter-spacing: -0.03em; line-height: 1.1; }
.detail-sub { font-size: 12px; color: rgba(255, 255, 255, 0.65); margin-top: 4px; }

.wind-main { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wind-speed { font-size: 40px; font-weight: 200; letter-spacing: -0.04em; color: var(--wind); }
.wind-speed span { font-size: 16px; font-weight: 500; margin-left: 4px; }
.wind-meta { font-size: 13px; color: rgba(255, 255, 255, 0.75); margin-top: 2px; }

.compass {
  position: relative;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.08), rgba(0,0,0,0.15));
  flex: 0 0 112px;
}
.compass-n, .compass-e, .compass-s, .compass-w {
  position: absolute;
  font-size: 11px;
  font-weight: 700;
  opacity: 0.8;
}
.compass-n { top: 6px; left: 50%; transform: translateX(-50%); }
.compass-s { bottom: 6px; left: 50%; transform: translateX(-50%); }
.compass-e { right: 8px; top: 50%; transform: translateY(-50%); }
.compass-w { left: 8px; top: 50%; transform: translateY(-50%); }
.compass-arrow {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 42px;
  margin: -42px 0 0 -5px;
  background: linear-gradient(#fff, var(--wind));
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  transform-origin: 50% 100%;
  border-radius: 2px;
}

.moon-row { display: flex; align-items: center; gap: 12px; }
.moon-disc {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background:
    linear-gradient(90deg, #d9d3c4 0 50%, #1a1f28 50% 100%);
  box-shadow: inset -6px -4px 10px rgba(0,0,0,0.35), 0 0 0 1px rgba(255,255,255,0.12);
  flex: 0 0 54px;
  position: relative;
  overflow: hidden;
}
.moon-disc span {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,0.4), transparent 50%);
}

.sun-arc { width: 100%; height: 80px; display: block; }
.sun-times { display: flex; justify-content: space-between; font-size: 13px; font-weight: 650; margin-top: -6px; }

.uv-bar {
  position: relative;
  height: 6px;
  border-radius: 99px;
  margin-top: 12px;
  background: linear-gradient(90deg, #4cd964, #ffd60a, #ff9f0a, #ff453a, #bf5af2);
}
.uv-mark {
  position: absolute;
  top: 50%;
  width: 10px; height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(0,0,0,0.25);
}

.precip-pair { display: flex; gap: 18px; }
.precip-pair .detail-value { color: var(--rain); }

.pressure-gauge {
  position: relative;
  height: 6px;
  border-radius: 99px;
  margin-top: 14px;
  background: linear-gradient(90deg, #6aa6ff, #d0d4da, #ff9f6a);
}
.pressure-gauge span {
  position: absolute;
  top: 50%;
  width: 10px; height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: #fff;
}

.map-card { padding: 14px; }
.map-caption { margin-bottom: 10px; }

.tabbar {
  background: rgba(16, 20, 28, 0.72);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: rgba(255, 255, 255, 0.55);
}
.tab { color: rgba(255, 255, 255, 0.55); }
.tab.active { color: #fff; }

.forecast-days, .forecast-day {
  background: transparent;
  color: #fff;
}
.forecast-day {
  border-color: rgba(255, 255, 255, 0.1);
}
.forecast-day-name, .forecast-day-max { color: #fff; }
.forecast-day-min, .forecast-day-date, .forecast-day-sun, .forecast-day-pop { color: rgba(255, 255, 255, 0.65); }
.forecast-day.is-selected {
  background: rgba(255, 255, 255, 0.12);
}
.forecast-day.is-selected .forecast-day-name,
.forecast-day.is-selected .forecast-day-date,
.forecast-day.is-selected .forecast-day-min,
.forecast-day.is-selected .forecast-day-sun,
.forecast-day.is-selected .forecast-day-pop { color: #fff; }

.day-sheet {
  background: #1c2430;
  color: #fff;
}
.day-sheet-title, .day-sheet-close { color: #fff; }
.day-sheet-backdrop { background: rgba(0, 0, 0, 0.55); }

.warning-card {
  background: rgba(255, 255, 255, 0.92);
}
.radar-fs-bar, .radar-controls-full {
  background: rgba(12, 16, 22, 0.88);
  color: #fff;
}
.radar-expand {
  color: #fff;
}
.loading { color: rgba(255, 255, 255, 0.7); }

@media (prefers-color-scheme: dark) {
  body, #app { background: #121820; color: #f4f7fb; }
}

/* v1950 stacking and contrast fixes */
.hour,
.hour.is-past {
  background: transparent;
  color: #fff;
  padding: 6px 0;
}
.hour.is-now {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}
.hour-temp, .hour-time { color: #fff; }

.tabbar {
  background: rgba(14, 18, 26, 0.94);
}

.topbar-row,
.topbar-row > div {
  display: block;
  width: 100%;
  text-align: center;
}

#app { isolation: isolate; }
.hero { position: relative; z-index: 1; }
