/* ============================================================
   Metevora — styles. Mobile-first, fluid, themable (light/dark).
   ============================================================ */

:root {
  --bg: #eef4fb;
  --bg-grad: linear-gradient(180deg, #e8f1fb 0%, #eef4fb 40%, #f4f7fb 100%);
  --card: #ffffff;
  --card-2: #f4f7fb;
  --text: #0f172a;
  --text-2: #55637a;
  --text-3: #8795ab;
  --border: rgba(15, 23, 42, 0.08);
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.12);
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 8px 24px rgba(15, 23, 42, 0.07);
  --shadow-lg: 0 4px 12px rgba(15, 23, 42, 0.08), 0 16px 40px rgba(15, 23, 42, 0.12);
  --radius: 18px;
  --radius-sm: 12px;
  --icon-sun: #f59e0b;
  --icon-moon: #94a3b8;
  --icon-cloud: #9db2cb;
  --icon-cloud-back: #c3d2e4;
  --icon-rain: #3b82f6;
  --icon-snow: #7dd3fc;
  --icon-bolt: #f59e0b;
  --skel: rgba(15, 23, 42, 0.08);
  --skel-shine: rgba(15, 23, 42, 0.14);
}

:root[data-theme="dark"] {
  --bg: #0b1220;
  --bg-grad: linear-gradient(180deg, #0d1526 0%, #0b1220 50%, #0a101c 100%);
  --card: #131c2e;
  --card-2: #1a2438;
  --text: #e8eef7;
  --text-2: #9fb0c7;
  --text-3: #64748b;
  --border: rgba(232, 238, 247, 0.08);
  --accent: #60a5fa;
  --accent-soft: rgba(96, 165, 250, 0.14);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.35), 0 16px 40px rgba(0, 0, 0, 0.45);
  --icon-sun: #fbbf24;
  --icon-moon: #cbd5e1;
  --icon-cloud: #64748b;
  --icon-cloud-back: #475569;
  --icon-rain: #60a5fa;
  --icon-snow: #bae6fd;
  --icon-bolt: #fbbf24;
  --skel: rgba(232, 238, 247, 0.08);
  --skel-shine: rgba(232, 238, 247, 0.16);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.45;
  min-height: 100dvh;
  padding-bottom: env(safe-area-inset-bottom);
}

a { color: var(--accent); }
button { font: inherit; color: inherit; cursor: pointer; }

/* ============ Header ============ */

.app-header {
  position: sticky;
  top: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px clamp(12px, 3vw, 28px);
  padding-top: calc(10px + env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
}
.brand-icon { width: 30px; height: 30px; color: var(--icon-cloud); }
.brand-icon svg { width: 100%; height: 100%; }
.brand-name { font-weight: 700; font-size: 1.15rem; letter-spacing: -0.02em; }

/* Search */
.search { position: relative; flex: 1; max-width: 460px; margin-inline: auto; }
.search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 17px; height: 17px; color: var(--text-3); pointer-events: none;
}
#search-input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  outline: none;
  box-shadow: var(--shadow);
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
}
#search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
#search-input::placeholder { color: var(--text-3); }

.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  margin: 0; padding: 6px; list-style: none;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  max-height: 320px; overflow-y: auto;
  z-index: 1300;
}
.search-results li {
  display: flex; flex-direction: column; gap: 1px;
  padding: 9px 12px; border-radius: 9px; cursor: pointer;
}
.search-results li:hover, .search-results li.is-active { background: var(--accent-soft); }
.search-results li small { color: var(--text-2); }
.search-results li.no-results { color: var(--text-2); cursor: default; }
.search-results li.no-results:hover { background: none; }

/* Header buttons */
.header-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  border: none; border-radius: 12px;
  background: transparent; color: var(--text-2);
  transition: background 0.15s, color 0.15s, transform 0.1s;
}
.icon-btn:hover { background: var(--accent-soft); color: var(--accent); }
.icon-btn:active { transform: scale(0.92); }
.icon-btn svg { width: 21px; height: 21px; }

.theme-moon { display: none; }
:root[data-theme="dark"] .theme-sun { display: none; }
:root[data-theme="dark"] .theme-moon { display: block; }

/* Settings popover */
.settings-wrap { position: relative; }
.settings-panel[hidden] { display: none; }
.settings-panel {
  position: absolute; right: 0; top: calc(100% + 8px);
  width: 250px; padding: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: 1300;
  display: flex; flex-direction: column; gap: 12px;
}
.setting { display: flex; flex-direction: column; gap: 6px; }
.setting-label { font-size: 0.78rem; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.04em; }
.segmented { display: flex; background: var(--card-2); border-radius: 10px; padding: 3px; gap: 2px; }
.seg-btn {
  flex: 1; padding: 7px 4px;
  border: none; border-radius: 8px; background: transparent;
  font-size: 0.85rem; font-weight: 500; color: var(--text-2);
  transition: background 0.15s, color 0.15s;
}
.seg-btn.is-active { background: var(--card); color: var(--text); font-weight: 650; box-shadow: var(--shadow); }
.lang-select {
  width: 100%; padding: 9px 10px;
  font: inherit; font-size: 0.9rem; color: var(--text);
  background: var(--card-2); border: 1px solid var(--border); border-radius: 10px;
}

/* ============ Location chips ============ */

.chips {
  display: flex; gap: 8px; align-items: center;
  padding: 12px clamp(12px, 3vw, 28px) 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 7px 12px;
  font-size: 0.87rem; font-weight: 500; white-space: nowrap;
  background: var(--card); color: var(--text);
  border: 1px solid var(--border); border-radius: 999px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s;
}
.chip:hover { border-color: var(--accent); }
.chip:active { transform: scale(0.96); }
.chip-locate { color: var(--accent); border-color: var(--accent-soft); }
.chip-x {
  border: none; background: none; padding: 0 0 0 4px;
  color: var(--text-3); font-size: 1.05rem; line-height: 1;
}
.chip-x:hover { color: #ef4444; }

/* ============ Layout ============ */
/* Mobile: one column in DOM order — hero, day strip, MAP (first screen),
   tabs, ad, details, ad. Desktop: two columns, map sticky on the right. */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  padding: 12px clamp(12px, 3vw, 28px) 8px;
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
}
.layout > * { min-width: 0; }

@media (min-width: 1080px) {
  .layout {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: 16px 20px;
    grid-template-areas:
      "hero    map"
      "strip   map"
      "tabs    map"
      "details map"
      "ad1     map"
      "ad1     ad2";
    align-items: start;
  }
  .a-hero    { grid-area: hero; }
  .a-strip   { grid-area: strip; }
  .a-map     { grid-area: map; position: sticky; top: 74px; }
  .a-tabs    { grid-area: tabs; }
  .a-details { grid-area: details; }
  .a-ad1     { grid-area: ad1; }
  .a-ad2     { grid-area: ad2; }
}

/* ============ Cards ============ */

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.section { padding: 16px clamp(14px, 2vw, 20px) 18px; }
.section-title {
  margin: 0 0 10px;
  font-size: 0.82rem; font-weight: 650; color: var(--text-2);
  text-transform: uppercase; letter-spacing: 0.05em;
}

/* ============ Hero ============ */

.hero {
  position: relative;
  padding: 12px 16px 14px;
  color: #fff;
  overflow: hidden;
  border: none;
  transition: background 0.6s ease;
}
.hero.cond-default     { background: linear-gradient(135deg, #3b6ecc 0%, #5a8bdb 100%); }
.hero.cond-clear-day   { background: linear-gradient(135deg, #2f7fd4 0%, #6db3ea 70%, #90c8ef 100%); }
.hero.cond-clear-night { background: linear-gradient(135deg, #101b38 0%, #23335c 65%, #35476e 100%); }
.hero.cond-partly-day  { background: linear-gradient(135deg, #3f7ec8 0%, #74a5d8 70%, #9dbfdd 100%); }
.hero.cond-cloudy      { background: linear-gradient(135deg, #5a7391 0%, #7b90a8 100%); }
.hero.cond-rain        { background: linear-gradient(135deg, #3a4d6b 0%, #55708f 100%); }
.hero.cond-snow        { background: linear-gradient(135deg, #6f8bab 0%, #9fb6cd 100%); }
.hero.cond-thunder     { background: linear-gradient(135deg, #2b2f4a 0%, #4d4a72 100%); }
.hero.cond-fog         { background: linear-gradient(135deg, #6b7a8d 0%, #93a2b3 100%); }

.hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.place-name { margin: 0; font-size: 1.15rem; font-weight: 700; letter-spacing: -0.02em; }
.place-meta { margin: 0; font-size: 0.76rem; opacity: 0.82; }

.star-btn { color: rgba(255, 255, 255, 0.85); width: 34px; height: 34px; }
.star-btn:hover { background: rgba(255, 255, 255, 0.15); color: #fff; }
.star-btn.is-saved .star-shape { fill: #fbbf24; stroke: #fbbf24; }

.hero-main {
  display: flex; align-items: center; gap: clamp(10px, 2.5vw, 20px);
  margin-top: 2px;
}
.hero-icon { width: clamp(54px, 10vw, 72px); height: clamp(54px, 10vw, 72px); flex-shrink: 0; }
.hero-icon svg { width: 100%; height: 100%; filter: drop-shadow(0 4px 10px rgba(0,0,0,0.18)); }

.hero-temp-wrap { display: flex; align-items: center; gap: clamp(10px, 2.5vw, 18px); flex-wrap: wrap; min-width: 0; }
.hero-temp { display: flex; align-items: flex-start; font-weight: 300; line-height: 1; }
.hero-temp #temp-now { font-size: clamp(2.7rem, 8vw, 3.4rem); letter-spacing: -0.03em; }
.hero-temp .deg { font-size: clamp(1.1rem, 3vw, 1.4rem); margin-top: 5px; opacity: 0.85; }
.cond-text { margin: 0; font-size: 0.95rem; font-weight: 600; }
.hero-sub { margin: 1px 0 0; font-size: 0.8rem; opacity: 0.9; }
.dot-sep { margin: 0 5px; opacity: 0.6; }

/* ============ Tiny 7-day strip ============ */

.day-strip {
  display: flex; gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.day-strip::-webkit-scrollbar { display: none; }
.day-pill {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  flex: 1 0 auto; min-width: 58px;
  padding: 6px 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s;
}
.day-pill:hover { border-color: var(--accent); }
.day-pill:active { transform: scale(0.96); }
.dp-name { font-size: 0.68rem; font-weight: 600; color: var(--text-2); text-transform: capitalize; }
.dp-date { font-size: 0.6rem; color: var(--text-3); }
.dp-icon { width: 24px; height: 24px; }
.dp-icon svg { width: 100%; height: 100%; }
.dp-temps { font-size: 0.74rem; color: var(--text-2); white-space: nowrap; }
.dp-temps b { color: var(--text); font-weight: 700; }

/* ============ Forecast tabs ============ */

.tabs {
  display: flex; gap: 2px;
  background: var(--card-2);
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 10px;
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab-btn {
  padding: 6px 13px;
  white-space: nowrap;
  border: none; border-radius: 8px;
  background: transparent;
  font-size: 0.85rem; font-weight: 600; color: var(--text-2);
  transition: background 0.15s, color 0.15s;
}
.tab-btn.is-active { background: var(--card); color: var(--text); box-shadow: var(--shadow); }

.hero-error {
  margin-top: 14px; padding: 14px;
  background: rgba(0, 0, 0, 0.22); border-radius: var(--radius-sm);
  text-align: center;
}
.hero-error p { margin: 0 0 10px; }
.btn-primary {
  padding: 9px 22px;
  border: none; border-radius: 999px;
  background: #fff; color: #1e3a8a; font-weight: 650;
}

/* Hero icon colors on colored background */
.hero .i-sun circle, .hero .i-sun .i-ray { stroke: #ffd76e; }
.hero .i-sun circle { fill: #ffd76e; }
.hero .i-moon { fill: #e7edf6; }
.hero .i-cloud { fill: #f2f6fb; }
.hero .i-cloud-back { fill: rgba(242, 246, 251, 0.55); }
.hero .i-rain line, .hero .i-rain circle { stroke: #a7d3ff; fill: #a7d3ff; }
.hero .i-snow circle { fill: #e3f4ff; }
.hero .i-bolt { fill: #ffd76e; }
.hero .i-fog line { stroke: #e3ecf6; }

/* ============ Details grid ============ */

.details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
@media (min-width: 480px) { .details { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.tile {
  display: flex; flex-direction: column; gap: 1px;
  padding: 8px 11px;
  border-radius: var(--radius-sm);
}
.tile-label { font-size: 0.64rem; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-value { font-size: 1.02rem; font-weight: 700; letter-spacing: -0.01em; }
.tile-sub { font-size: 0.68rem; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============ Hourly strip ============ */

.hourly-wrap { position: relative; }
.strip-arrow {
  position: absolute; top: 42%;
  transform: translateY(-50%);
  z-index: 5;
  width: 30px; height: 30px;
  display: none; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 50%;
  background: color-mix(in srgb, var(--card) 94%, transparent);
  box-shadow: var(--shadow);
  color: var(--text-2);
  font-size: 1.15rem; line-height: 1;
  padding: 0 0 2px;
}
.hourly-wrap.has-overflow .strip-arrow { display: flex; }
.strip-arrow:hover { color: var(--accent); border-color: var(--accent); }
.strip-left { left: -8px; }
.strip-right { right: -8px; }

.hourly-strip {
  display: flex; gap: 4px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding-bottom: 6px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--text-3) transparent;
}
.hour-cell {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  min-width: 62px; padding: 10px 6px;
  border-radius: var(--radius-sm);
  scroll-snap-align: start;
  flex-shrink: 0;
}
.hour-cell.is-now { background: var(--accent-soft); }
.hour-time { font-size: 0.74rem; color: var(--text-2); font-weight: 550; }
.hour-icon { width: 34px; height: 34px; }
.hour-icon svg { width: 100%; height: 100%; }
.hour-temp { font-size: 0.98rem; font-weight: 650; }
.hour-pop { font-size: 0.72rem; color: var(--accent); font-weight: 550; }
.hour-pop.is-faint { opacity: 0.35; }

/* ============ Daily list (expandable rows) ============ */

.daily-list { display: flex; flex-direction: column; }
.day-block { border-bottom: 1px solid var(--border); }
.day-block:last-child { border-bottom: none; }

.day-head {
  display: grid;
  grid-template-columns: 4.8rem 34px 5.6rem minmax(0, 1fr) auto 16px;
  align-items: center; gap: 10px;
  width: 100%;
  padding: 8px 2px;
  background: none; border: none;
  text-align: left; cursor: pointer;
  font: inherit; color: inherit;
  border-radius: 8px;
  transition: background 0.15s;
}
.day-head:hover { background: var(--accent-soft); }

.day-date { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.day-date b { font-size: 0.88rem; font-weight: 650; text-transform: capitalize; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day-date small { font-size: 0.72rem; color: var(--text-3); }

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

.day-temps { white-space: nowrap; }
.day-temps b { font-size: 0.95rem; font-weight: 700; color: #ef6c4d; }
:root[data-theme="dark"] .day-temps b { color: #fca5a5; }
.day-temps .t-min { margin-left: 7px; color: var(--accent); font-size: 0.9rem; }

.day-precip { font-size: 0.78rem; color: var(--accent); font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day-precip.is-faint { opacity: 0.4; }

.day-wind {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.78rem; color: var(--text-2);
  justify-self: end; white-space: nowrap;
}
.day-wind svg { width: 13px; height: 13px; flex-shrink: 0; }

.day-chevron { color: var(--text-3); font-size: 1.15rem; line-height: 1; transition: transform 0.2s; justify-self: end; }
.day-head[aria-expanded="true"] .day-chevron { transform: rotate(90deg); }

.day-detail[hidden] { display: none; }
.day-detail {
  display: flex; flex-wrap: wrap; gap: 5px 18px;
  margin: 0 2px 9px;
  padding: 9px 12px;
  background: var(--card-2);
  border-radius: 10px;
  font-size: 0.8rem; color: var(--text-2);
}
.day-detail .dd-cond { font-weight: 600; color: var(--text); }

@media (max-width: 560px) {
  .day-head { grid-template-columns: 4.4rem 30px 5.2rem minmax(0, 1fr) 14px; gap: 7px; }
  .day-wind { display: none; }
  .day-precip-mm { display: none; }
}

/* ============ Icon colors (on cards) ============ */

.wx-icon .i-sun circle { fill: var(--icon-sun); }
.wx-icon .i-sun .i-ray { stroke: var(--icon-sun); }
.wx-icon .i-moon { fill: var(--icon-moon); }
.wx-icon .i-cloud { fill: var(--icon-cloud); }
.wx-icon .i-cloud-back { fill: var(--icon-cloud-back); }
.wx-icon .i-rain line { stroke: var(--icon-rain); }
.wx-icon .i-rain circle { fill: var(--icon-rain); }
.wx-icon .i-snow circle { fill: var(--icon-snow); }
.wx-icon .i-bolt { fill: var(--icon-bolt); }
.wx-icon .i-fog line { stroke: var(--icon-cloud); }

/* ============ Map ============ */

.map-card { padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.map-wrap { position: relative; }
.layer-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.layer-chip {
  padding: 5px 10px;
  font-size: 0.78rem; font-weight: 600;
  background: color-mix(in srgb, var(--card) 88%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--text-2);
  border: 1px solid var(--border); border-radius: 999px;
  box-shadow: var(--shadow);
  transition: all 0.15s;
}
.layer-chip.is-active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* controls float over the map to save vertical space */
.map-overlay-top {
  position: absolute; top: 10px; left: 10px; right: 56px;
  z-index: 900;
}
.map-overlay-bottom {
  position: absolute; left: 10px; right: 10px; bottom: 10px;
  z-index: 900;
  background: color-mix(in srgb, var(--card) 88%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px 4px 4px;
  box-shadow: var(--shadow);
}

.map {
  height: clamp(300px, 48vh, 460px);
  border-radius: var(--radius-sm);
  z-index: 1; /* keep below header/dropdowns */
  background: var(--card-2);
}
@media (min-width: 1080px) {
  .map { height: clamp(420px, calc(100vh - 220px), 660px); }
}
:root[data-theme="dark"] .map .base-tiles {
  filter: brightness(0.7) invert(1) contrast(0.85) hue-rotate(190deg) saturate(0.4) brightness(0.8);
}

.map-recenter, .map-expand {
  width: 30px; height: 30px;
  background: #fff; color: #333;
  border: none; font-size: 1.05rem; line-height: 30px;
  cursor: pointer; display: block; text-align: center;
}
:root[data-theme="dark"] .map-recenter,
:root[data-theme="dark"] .map-expand { background: #1a2438; color: #e8eef7; }

/* Fullscreen map mode (toggled by the expand control) */
.a-map.is-expanded {
  position: fixed !important;
  inset: 0;
  z-index: 1400;
  border-radius: 0;
  display: flex; flex-direction: column;
  padding: 8px;
  padding-top: calc(8px + env(safe-area-inset-top));
  padding-bottom: calc(8px + env(safe-area-inset-bottom));
}
.a-map.is-expanded .map-wrap { flex: 1; min-height: 0; }
.a-map.is-expanded .map { height: 100%; }
.a-map.is-expanded .map-hint { display: none; }
body.map-expanded { overflow: hidden; }

/* grid overlay badges */
.grid-badge-wrap { background: none; border: none; }
.temp-badge {
  display: inline-block; padding: 2px 8px;
  font-size: 0.74rem; font-weight: 700; color: #fff;
  border-radius: 999px; white-space: nowrap;
  box-shadow: 0 1px 4px rgba(0,0,0,0.35);
}
.wind-badge {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 8px;
  font-size: 0.74rem; font-weight: 700;
  color: #fff; background: rgba(30, 41, 59, 0.82);
  border-radius: 999px; white-space: nowrap;
  box-shadow: 0 1px 4px rgba(0,0,0,0.35);
}
.wind-badge svg { width: 13px; height: 13px; }
.map-cursor-tip {
  position: absolute;
  z-index: 950;
  pointer-events: none;
  padding: 2px 8px;
  background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.78rem; font-weight: 700;
  color: var(--text);
  box-shadow: var(--shadow);
  white-space: nowrap;
}
.cloud-badge {
  display: inline-block; padding: 2px 8px;
  font-size: 0.74rem; font-weight: 700;
  color: #1e293b; background: rgba(241, 245, 249, 0.92);
  border-radius: 999px; white-space: nowrap;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

/* radar timeline */
.radar-timeline { display: flex; align-items: center; gap: 6px; }
.radar-timeline.is-disabled { display: none; }
.play-btn { width: 32px; height: 32px; background: var(--accent); color: #fff; border-radius: 50%; flex-shrink: 0; }
.step-btn { width: 26px; height: 26px; background: transparent; color: var(--text-2); border-radius: 50%; flex-shrink: 0; }
.step-btn svg { width: 15px; height: 15px; }
.step-btn:hover { color: var(--accent); background: var(--accent-soft); }
.speed-btn {
  flex-shrink: 0; min-width: 36px;
  padding: 3px 7px;
  border: 1px solid var(--border); border-radius: 999px;
  background: transparent;
  font-size: 0.72rem; font-weight: 700; color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.speed-btn:hover { color: var(--accent); border-color: var(--accent); }
@media (max-width: 440px) {
  .step-btn { display: none; }   /* keep the pill compact on small phones */
}
.play-btn .ic-pause { display: none; }
.play-btn.is-playing .ic-play { display: none; }
.play-btn.is-playing .ic-pause { display: block; }

#radar-slider {
  flex: 1; height: 5px;
  appearance: none; -webkit-appearance: none;
  background: var(--card-2); border-radius: 999px;
  outline: none; cursor: pointer;
}
#radar-slider::-webkit-slider-thumb {
  appearance: none; -webkit-appearance: none;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent); border: 3px solid var(--card);
  box-shadow: var(--shadow);
}
#radar-slider::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); border: 3px solid var(--card);
}
.radar-time-wrap { position: relative; display: flex; flex-shrink: 0; }
.radar-time { font-size: 0.76rem; font-weight: 650; color: var(--text); min-width: 66px; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.radar-time.is-forecast { color: #f59e0b; }
/* floating "forecast" tag above the time label — positioned out of the flex
   flow so showing/hiding it never resizes the slider */
.radar-forecast-tag {
  position: absolute; right: 0; bottom: calc(100% + 12px);
  font-size: 0.6rem; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase;
  color: #78350f; background: #f59e0b;
  padding: 2px 8px; border-radius: 999px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  white-space: nowrap; pointer-events: none;
  opacity: 0; transform: translateY(3px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.radar-time.is-forecast + .radar-forecast-tag { opacity: 1; transform: none; }
.map-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 0 6px 2px; }
.model-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.74rem; font-weight: 600; color: var(--text-2);
  cursor: pointer; white-space: nowrap;
}
.model-toggle input { accent-color: var(--accent); margin: 0; }
.map-hint { margin: 0; font-size: 0.72rem; color: var(--text-3); }

/* ============ Ad slots ============ */
/* Hidden until ads are actually live — see ADS_ENABLED in js/app.js.
   Reserved, clearly-bounded containers with fixed min-heights (prevents
   layout shift when the ad network fills them) once switched on. */
.ad-slot { display: none; }
body.ads-live .ad-slot {
  display: flex; align-items: center; justify-content: center;
  min-height: 100px;
  background: var(--card-2);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.ad-sidebar { min-height: 250px; }
.ad-hint { font-size: 0.75rem; color: var(--text-3); letter-spacing: 0.04em; text-transform: uppercase; }
@media (max-width: 1079px) { .ad-sidebar { min-height: 100px; } }

/* ============ SEO blurb & footer ============ */

.seo-blurb {
  max-width: 1440px; margin: 0 auto;
  padding: 10px clamp(12px, 3vw, 28px);
  color: var(--text-2); font-size: 0.87rem;
}
.seo-blurb h2 { font-size: 1rem; color: var(--text); margin: 0 0 4px; }
.seo-blurb p { margin: 0; max-width: 72ch; }

.app-footer {
  max-width: 1440px; margin: 0 auto;
  padding: 14px clamp(12px, 3vw, 28px) 26px;
  font-size: 0.78rem; color: var(--text-3);
}
.app-footer p { margin: 0; }

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

.toast {
  position: fixed;
  left: 50%; bottom: calc(22px + env(safe-area-inset-bottom));
  transform: translate(-50%, 12px);
  max-width: min(92vw, 420px);
  padding: 11px 18px;
  background: var(--text); color: var(--bg);
  font-size: 0.88rem; font-weight: 550;
  border-radius: 999px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 2000;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ============ Loading skeletons ============ */

.is-loading .sv {
  color: transparent !important;
  background: linear-gradient(90deg, var(--skel) 25%, var(--skel-shine) 50%, var(--skel) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
  border-radius: 8px;
  min-width: 3ch;
  user-select: none;
}
.is-loading .hero .sv { background: linear-gradient(90deg, rgba(255,255,255,0.18) 25%, rgba(255,255,255,0.32) 50%, rgba(255,255,255,0.18) 75%); background-size: 200% 100%; }
.is-loading .hero-icon svg { opacity: 0.25; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ============ Small screens ============ */

@media (max-width: 480px) {
  .brand-name { display: none; }
  .hero-main { gap: 8px; }
}

/* ============ Motion & a11y ============ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
