/*
 * Quorum Weather — iPhone-first styling.
 *
 * Three rules govern everything here:
 *
 * 1. Animate only `transform` and `opacity`. Anything else forces layout or
 *    paint on the main thread, which on an iPhone shows up as a dropped frame
 *    the instant a finger is on the glass.
 * 2. Keep `backdrop-filter` scarce. It is gorgeous and it is expensive; used on
 *    a scrolling list it turns a 120 Hz ProMotion scroll into a 40 Hz one. It
 *    appears exactly twice: the top bar and the search sheet, both fixed.
 * 3. Respect the hardware. Safe-area insets, dynamic viewport units, momentum
 *    scrolling, 44 px targets, and no 300 ms tap delay.
 *
 * The palette is a single committed dark treatment — glass chrome over a
 * weather-reactive sky — rather than a light/dark pair. A forecast app whose
 * background is the sky cannot honestly invert.
 */

:root {
  --ink: #f7f9ff;
  --ink-2: rgba(247, 249, 255, 0.72);
  --ink-3: rgba(247, 249, 255, 0.46);
  --ink-4: rgba(247, 249, 255, 0.26);

  --card: rgba(255, 255, 255, 0.075);
  --card-strong: rgba(255, 255, 255, 0.115);
  --hairline: rgba(255, 255, 255, 0.11);
  --hairline-soft: rgba(255, 255, 255, 0.06);

  --good: #5ee2a0;
  --mid: #ffd166;
  --poor: #ff8b7b;
  --wet: #6cc6ff;
  --alert: #ff6b6b;

  --r-lg: 26px;
  --r-md: 18px;
  --r-sm: 12px;

  --pad: 18px;
  --gap: 14px;

  --top: env(safe-area-inset-top, 0px);
  --bottom: env(safe-area-inset-bottom, 0px);
  --left: env(safe-area-inset-left, 0px);
  --right: env(safe-area-inset-right, 0px);

  --ease: cubic-bezier(0.32, 0.72, 0, 1);

  color-scheme: dark;
}

/* Aggregate 1's calm, readable light palette over Aggregate 3's tested shell. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --ink: #16202f;
    --ink-2: #46566b;
    --ink-3: #6b788a;
    --ink-4: #8793a4;
    --card: #ffffff;
    --card-strong: #e9eef5;
    --hairline: #dbe3ec;
    --hairline-soft: #e8edf3;
    --good: #1d7a49;
    --mid: #a35e02;
    --poor: #b23c2e;
    --wet: #2257c4;
    --alert: #b23c2e;
    color-scheme: light;
  }
  body { background: #f2f5f9; }
  .sky { background: linear-gradient(180deg, #dcecff 0%, #f2f5f9 42%); }
  .sky-layer, .sky-glow, .sky-grain { display: none; }
  .topbar { background: rgba(242, 245, 249, 0.88); }
  .card { box-shadow: 0 1px 2px rgba(22, 32, 47, 0.05), 0 4px 16px rgba(22, 32, 47, 0.06); }
  .sheet { background: rgba(255, 255, 255, 0.94); }
  .cell { background: #f7f9fc; }
  .ring .track { stroke: rgba(22, 32, 47, 0.14); }
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overscroll-behavior-y: none;
}

body {
  background: #070a14;
  color: var(--ink);
  font: 400 16px/1.45 -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', system-ui, sans-serif;
  /* Kills the grey flash on tap and the double-tap-to-zoom delay without
     disabling pinch zoom, which users with low vision rely on. */
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* Chrome is not selectable; forecast text below opts back in. */
  -webkit-user-select: none;
  user-select: none;
}

button, input { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }

/* Keyboard focus stays visible; pointer focus does not draw a ring. Every
   interactive element here is a button or a role="button" row, so one rule
   covers the whole surface. */
:focus-visible {
  outline: 2px solid var(--wet);
  outline-offset: 2px;
  border-radius: 8px;
}
:focus:not(:focus-visible) { outline: none; }

/* ───────────────────────────────────────────────────────────── sky backdrop */

.sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  /* Promote once, up front, so the cross-fade never triggers a fresh
     rasterisation mid-animation. */
  transform: translateZ(0);
}

.sky-layer {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 900ms var(--ease);
  background: linear-gradient(180deg, #12203f 0%, #0a1226 55%, #070a14 100%);
}
.sky-layer.on { opacity: 1; }

/* A soft horizon glow, positioned by JS to follow the sun's azimuth. */
.sky-glow {
  position: absolute;
  left: 50%;
  bottom: 8%;
  width: 150vw;
  height: 60vh;
  transform: translate(-50%, 0) translateZ(0);
  background: radial-gradient(closest-side, var(--glow, rgba(120, 170, 255, 0.22)), transparent 72%);
  opacity: var(--glow-strength, 0.5);
  transition: opacity 900ms var(--ease), background 900ms var(--ease);
}

/* Dithering. Large smooth gradients band badly on OLED; a faint noise layer
   costs one small tiled image and removes it entirely. */
.sky-grain {
  position: absolute;
  inset: 0;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ─────────────────────────────────────────────────────────────────── shell */

.shell {
  position: relative;
  z-index: 1;
  /* Backstop. The layout is built not to need it, but a single bad string from
     an upstream feed must never be able to break the page sideways. */
  overflow-x: hidden;
  /* dvh, not vh: on iOS Safari `100vh` is the *largest* viewport, so a
     vh-sized shell sits permanently under the address bar. */
  height: 100dvh;
  display: flex;
  flex-direction: column;
}

.topbar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(var(--top) + 8px) calc(var(--right) + var(--pad)) 10px calc(var(--left) + var(--pad));
  background: linear-gradient(180deg, rgba(7, 10, 20, 0.55), rgba(7, 10, 20, 0));
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
}

.place {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  max-width: 74vw;
}
.place-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chev { width: 12px; height: 12px; flex: none; color: var(--ink-3); }

.units {
  min-width: 44px;
  min-height: 44px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  background: var(--card);
  border: 1px solid var(--hairline);
  padding: 0 13px;
  transition: transform 120ms var(--ease);
}
.units:active { transform: scale(0.93); }

.scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  /* Stops a rubber-band at the top of the list from dragging the whole page. */
  overscroll-behavior-y: contain;
  padding: 0 calc(var(--right) + var(--pad)) calc(var(--bottom) + 40px) calc(var(--left) + var(--pad));
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  .scroll { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ────────────────────────────────────────────────────── pull to refresh */

.refresh {
  height: 0;
  display: grid;
  place-items: center;
  color: var(--ink-3);
  overflow: hidden;
  transition: height 220ms var(--ease);
}
.refresh.armed { height: 46px; }
.refresh svg { width: 22px; height: 22px; }
.refresh.spinning svg { animation: spin 900ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ───────────────────────────────────────────────────────────────── hero */

.hero { padding: 14px 2px 20px; text-align: center; }

.hero-temp {
  font-size: clamp(78px, 27vw, 128px);
  font-weight: 250;
  line-height: 0.92;
  letter-spacing: -0.045em;
  /* The degree glyph is optically heavy; nudging it back centres the number. */
  margin-left: 0.06em;
  font-variant-numeric: tabular-nums;
}
.hero-cond { font-size: 19px; color: var(--ink-2); margin-top: 6px; letter-spacing: -0.01em; }
.hero-range { font-size: 16px; color: var(--ink-3); margin-top: 3px; font-variant-numeric: tabular-nums; }
.snapshot-bar {
  display: block;
  width: 100%;
  margin: 0 0 10px;
  padding: 9px 12px;
  border-radius: 14px;
  background: rgba(255, 209, 102, 0.11);
  border: 1px solid rgba(255, 209, 102, 0.22);
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ink-2);
  text-align: left;
}
.snapshot-bar b { color: var(--mid); font-weight: 650; }

.hero-note {
  font-size: 13.5px;
  color: var(--ink-3);
  margin-top: 12px;
  max-width: 34ch;
  margin-inline: auto;
  -webkit-user-select: text;
  user-select: text;
}

.hero-consensus {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 7px 13px 7px 9px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--hairline);
  font-size: 13px;
  color: var(--ink-2);
  transition: transform 120ms var(--ease);
}
.hero-consensus:active { transform: scale(0.97); }

/* Confidence ring. An SVG arc, not a bar: it reads at 18 px and does not
   pretend to a precision the number does not have. */
.ring { width: 20px; height: 20px; flex: none; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 3.5; }
.ring .track { stroke: rgba(255, 255, 255, 0.16); }
.ring .fill { stroke: var(--ring-color, var(--good)); stroke-linecap: round; transition: stroke-dashoffset 700ms var(--ease); }

/* skeletons */
.hero-skeleton { display: grid; gap: 12px; justify-items: center; padding: 22px 0; }
.sk { background: linear-gradient(90deg, rgba(255,255,255,.06), rgba(255,255,255,.13), rgba(255,255,255,.06)); background-size: 200% 100%; border-radius: 10px; animation: sheen 1.4s linear infinite; }
.sk-temp { width: 170px; height: 92px; border-radius: 18px; }
.sk-line { width: 190px; height: 15px; }
.sk-line.short { width: 120px; }
@keyframes sheen { to { background-position: -200% 0; } }

/* ───────────────────────────────────────────────────────────────── cards */

/*
 * `minmax(0, 1fr)` rather than the default `auto`, and `min-width: 0` on the
 * cards. Grid and flex items default to a min-size of *content*, so a single
 * horizontally-scrolling strip or one long unbroken word silently widens the
 * whole column and the page starts scrolling sideways. This is the single most
 * common way a mobile layout breaks, and it is invisible until you test on a
 * narrow viewport.
 */
.cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gap); }

.card {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: 16px;
  /* Skips paint work for cards below the fold. Worth ~2 frames on first
     render of the ten-day list on an older iPhone. */
  content-visibility: auto;
  contain-intrinsic-size: auto 200px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 14px;
  white-space: nowrap;
}
.card-head svg { width: 14px; height: 14px; flex: none; }
.card-head .spacer { margin-left: auto; }
/* The hint gives up its space first: a wrapped two-line heading pushes the
   whole card down and looks broken long before a truncated hint does. */
.card-head .hint {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  color: var(--ink-4);
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* ───────────────────────────────────────────────────────────────── radar */

.radar-card { padding-bottom: 12px; }
.radar-map {
  height: 260px;
  margin: 0 -16px;
  background: #dbe4ee;
  border-block: 1px solid var(--hairline-soft);
  color: #172033;
}
.radar-map .leaflet-control-attribution { font-size: 9px; }
.radar-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  font-size: 11px;
  color: var(--ink-3);
}
.radar-foot a { color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.radar-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 5px;
  border-radius: 50%;
  background: #35b9e8;
  box-shadow: 0 0 0 2px rgba(53,185,232,.2);
}

/* ──────────────────────────────────────────────────────────────── hourly */

.hours-wrap {
  max-width: calc(100% + 32px);
  margin: 0 -16px;
  padding: 0 16px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}
.hours-wrap::-webkit-scrollbar { display: none; }

.hours { position: relative; display: flex; align-items: flex-end; width: max-content; }

/* The temperature curve and its uncertainty ribbon sit behind the columns and
   scroll with them, so the ribbon always lines up with the hour it describes. */
.hours-chart { position: absolute; inset: 0 0 auto 0; height: 84px; pointer-events: none; }

.hour {
  scroll-snap-align: start;
  width: 58px;
  flex: none;
  display: grid;
  justify-items: center;
  gap: 5px;
  padding-top: 90px;
}
.hour-label { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.hour.now .hour-label { color: var(--ink); font-weight: 700; }
.hour-icon { width: 24px; height: 24px; color: var(--ink); }
.hour-temp { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.hour-pop {
  font-size: 11px;
  color: var(--wet);
  font-variant-numeric: tabular-nums;
  min-height: 14px;
}
.hour-bar { width: 22px; height: 3px; border-radius: 2px; background: rgba(255,255,255,.10); overflow: hidden; }
.hour-bar i { display: block; height: 100%; background: var(--wet); border-radius: 2px; }
.hours-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 13px;
  color: var(--ink-3);
  font-size: 11px;
}
.hours-legend span { display: inline-flex; align-items: center; gap: 5px; }
.hours-legend i { display: inline-block; width: 16px; flex: none; }
.legend-line { height: 2px; border-radius: 2px; background: rgba(255,255,255,.95); }
.legend-band { height: 7px; border-radius: 3px; background: rgba(158,205,255,.28); }
.legend-rain { height: 3px; border-radius: 2px; background: var(--wet); }

/* ─────────────────────────────────────────────────────── hourly pressure */

.pressure-wrap {
  max-width: calc(100% + 32px);
  margin: 0 -16px;
  padding: 0 16px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.pressure-wrap::-webkit-scrollbar { display: none; }
.pressure-hours { position: relative; display: flex; padding-top: 78px; }
.pressure-chart { position: absolute; inset: 0 0 auto 0; pointer-events: none; }
.pressure-line { fill: none; stroke: rgba(255,255,255,.95); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pressure-fill { fill: rgba(111,179,255,.13); }
.pressure-hour {
  width: 58px;
  flex: none;
  display: grid;
  justify-items: center;
  gap: 4px;
  color: var(--ink-3);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.pressure-hour strong { color: var(--ink); font-size: 12px; font-weight: 600; }

/* ─────────────────────────────────────────────────────────────── ten day */

.day {
  display: grid;
  grid-template-columns: 3.2rem 24px 2.5rem 2.3rem minmax(0, 1fr) 2.6rem;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  border-top: 1px solid var(--hairline-soft);
  padding: 2px 0;
  transition: background 160ms var(--ease);
  border-radius: 10px;
}
.day:first-of-type { border-top: 0; }
.day:active { background: rgba(255,255,255,.05); }
.day-name { font-size: 15px; font-weight: 500; }
.day-icon { width: 24px; height: 24px; color: var(--ink-2); justify-self: center; }
.day-pop { font-size: 12px; color: var(--wet); font-variant-numeric: tabular-nums; text-align: right; }
.day-lo, .day-hi { font-size: 15px; font-variant-numeric: tabular-nums; }
.day-lo { color: var(--ink-3); text-align: right; }
.day-hi { text-align: right; font-weight: 600; }

/*
 * The range bar. The solid segment is the consensus high-to-low; the softer
 * segment either side is the 10th-90th percentile across sources.
 *
 * This is the signature of the whole app: a ten-day panel that shows not just
 * what the forecast is but how much room it has to move. A day where every
 * model agrees and a day where they span eight degrees look different at a
 * glance, which is the honest thing for a ten-day forecast to communicate.
 */
.bar { position: relative; height: 5px; border-radius: 3px; background: rgba(255,255,255,.10); }
.bar-band {
  position: absolute;
  top: -2px;
  height: 9px;
  border-radius: 5px;
  background: rgba(255,255,255,.13);
}
.bar-fill {
  position: absolute;
  top: 0;
  height: 5px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--c-lo, #6cc6ff), var(--c-hi, #ffb26c));
}
.bar-dot {
  position: absolute;
  top: -1.5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.25);
}

.day-detail {
  grid-column: 1 / -1;
  overflow: hidden;
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 320ms var(--ease);
}
.day.open .day-detail { grid-template-rows: 1fr; }
.day-detail > div { min-height: 0; }
.day-detail-inner { padding: 4px 0 14px; }

/* ─────────────────────────────────────────────────────── source breakdown */

.src {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px 74px;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
  font-size: 13px;
}
.src-name { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.src-kind {
  display: inline-block;
  font-size: 9.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 1.5px 5px;
  border-radius: 5px;
  margin-left: 6px;
  vertical-align: 1px;
  background: rgba(255,255,255,.09);
  color: var(--ink-3);
}
.src-kind.human { background: rgba(94, 226, 160, .16); color: #8ff0c1; }
.src-kind.ensemble { background: rgba(108, 198, 255, .16); color: #a5daff; }
.src-val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.src.out .src-val { color: var(--ink-3); text-decoration: line-through; text-decoration-thickness: 1px; }

/* Deviation from consensus, drawn from a centre line. */
.src-dev { position: relative; height: 5px; border-radius: 3px; background: rgba(255,255,255,.08); }
.src-dev::before { content: ''; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: rgba(255,255,255,.22); }
.src-dev i { position: absolute; top: 0; height: 5px; border-radius: 3px; background: var(--wet); }
.src-dev i.warm { background: #ffb26c; }

/* ───────────────────────────────────────────────────────── flags & alerts */

.flag {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 11px 12px;
  border-radius: var(--r-md);
  background: rgba(255, 209, 102, 0.10);
  border: 1px solid rgba(255, 209, 102, 0.22);
  font-size: 13.5px;
  line-height: 1.4;
  -webkit-user-select: text;
  user-select: text;
}
.flag.info { background: rgba(255,255,255,.06); border-color: var(--hairline); }
.flag.alert { background: rgba(255, 107, 107, 0.12); border-color: rgba(255, 107, 107, 0.28); }
.flag svg { width: 16px; height: 16px; flex: none; margin-top: 1px; color: var(--mid); }
.flag.alert svg { color: var(--alert); }
.flag b { font-weight: 600; display: block; }
.flag span { color: var(--ink-2); }

.alert-card {
  background: rgba(255, 107, 107, 0.13);
  border-color: rgba(255, 107, 107, 0.3);
}
.alert-title { display: flex; align-items: center; gap: 8px; font-weight: 650; font-size: 15px; }
.alert-title svg { width: 17px; height: 17px; color: var(--alert); flex: none; }
.alert-meta { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; }
.alert-body {
  font-size: 13.5px;
  overflow-wrap: anywhere;
  color: var(--ink-2);
  margin-top: 10px;
  white-space: pre-wrap;
  -webkit-user-select: text;
  user-select: text;
}

/* ─────────────────────────────────────────────────────── details & prose */

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--hairline-soft); border-radius: var(--r-md); overflow: hidden; }
.cell { background: rgba(10, 14, 28, 0.25); padding: 13px 14px; }
.cell-k { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.cell-v { font-size: 19px; font-weight: 500; margin-top: 3px; font-variant-numeric: tabular-nums; }
.cell-sub { font-size: 12px; color: var(--ink-3); margin-top: 1px; }

.prose {
  font-size: 14.5px;
  overflow-wrap: anywhere;
  line-height: 1.58;
  color: var(--ink-2);
  -webkit-user-select: text;
  user-select: text;
}
.prose h4 { margin: 16px 0 5px; font-size: 12px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink-3); font-weight: 650; }
.prose h4:first-child { margin-top: 0; }
.prose p { margin: 0 0 9px; }

.collapse { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 340ms var(--ease); }
.collapse.open { grid-template-rows: 1fr; }
.collapse > div { min-height: 0; overflow: hidden; }

.more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  min-height: 44px;
  margin-top: 4px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
}
.more svg { width: 12px; height: 12px; transition: transform 300ms var(--ease); }
.more[aria-expanded="true"] svg { transform: rotate(180deg); }

/* ────────────────────────────────────────────────────── source spaghetti */

.spaghetti { width: 100%; max-width: 100%; height: 132px; display: block; margin: 2px 0 6px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 11.5px; color: var(--ink-3); }
.legend i { display: inline-block; width: 9px; height: 2.5px; border-radius: 2px; margin-right: 5px; vertical-align: 3px; }

/* ──────────────────────────────────────────────────────────────── footer */

.footer { margin-top: 22px; font-size: 11.5px; color: var(--ink-4); line-height: 1.55; text-align: center; -webkit-user-select: text; user-select: text; }
.footer b { color: var(--ink-3); font-weight: 600; }
.footer .coverage { margin-bottom: 8px; }
.dead { color: var(--poor); }

/* ────────────────────────────────────────────────────────── search sheet */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 8;
  background: rgba(4, 6, 14, 0.55);
  opacity: 0;
  transition: opacity 280ms var(--ease);
}
.sheet-backdrop.on { opacity: 1; }

.sheet {
  position: fixed;
  z-index: 9;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 88dvh;
  display: flex;
  flex-direction: column;
  padding: 8px calc(var(--right) + 16px) calc(var(--bottom) + 16px) calc(var(--left) + 16px);
  border-radius: 28px 28px 0 0;
  background: rgba(18, 22, 38, 0.86);
  backdrop-filter: blur(30px) saturate(160%);
  -webkit-backdrop-filter: blur(30px) saturate(160%);
  border-top: 1px solid var(--hairline);
  transform: translate3d(0, 100%, 0);
  transition: transform 380ms var(--ease);
}
.sheet.on { transform: translate3d(0, 0, 0); }

.sheet-grip { width: 38px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.22); margin: 4px auto 12px; }

.search-row { display: flex; align-items: center; gap: 10px; }
.search-icon { width: 18px; height: 18px; color: var(--ink-3); position: absolute; margin-left: 12px; pointer-events: none; }
#searchInput {
  flex: 1;
  min-height: 44px;
  border-radius: 13px;
  border: 1px solid var(--hairline);
  background: rgba(255,255,255,.07);
  padding: 0 12px 0 38px;
  /* 16px minimum, or iOS zooms the whole page on focus. */
  font-size: 16px;
  -webkit-user-select: text;
  user-select: text;
}
#searchInput::-webkit-search-cancel-button { -webkit-appearance: none; }
.sheet-close { min-height: 44px; padding: 0 4px; font-size: 15px; font-weight: 600; color: var(--wet); }

.locate {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 48px;
  margin-top: 10px;
  padding: 0 12px;
  border-radius: 13px;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--hairline);
  font-size: 15px;
  text-align: left;
}
.locate svg { width: 18px; height: 18px; color: var(--wet); flex: none; }

.results { list-style: none; margin: 10px 0 0; padding: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.results li button {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 8px 12px;
  border-radius: 12px;
  text-align: left;
}
.results li button:active { background: rgba(255,255,255,.07); }
.result-name { font-size: 16px; }
.result-sub { font-size: 12.5px; color: var(--ink-3); margin-top: 1px; }

.saved { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.07);
  border: 1px solid var(--hairline);
  font-size: 13.5px;
}
.chip .x { color: var(--ink-4); font-size: 16px; line-height: 1; padding: 4px; margin: -4px -6px -4px 0; }

/* ──────────────────────────────────────────────────────────────── states */

.error {
  text-align: center;
  padding: 28px 16px;
  color: var(--ink-2);
  font-size: 14.5px;
}
.error b { display: block; font-size: 16px; color: var(--ink); margin-bottom: 6px; }
.retry {
  margin-top: 14px;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  background: var(--card-strong);
  border: 1px solid var(--hairline);
  font-weight: 600;
  font-size: 14px;
}

.stale-pill {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  background: rgba(255, 209, 102, .13);
  color: var(--mid);
  border: 1px solid rgba(255, 209, 102, .22);
}

/* Larger phones get a slightly roomier hourly column; small ones stay dense. */
@media (min-width: 400px) { .hour, .pressure-hour { width: 62px; } }
@media (min-width: 700px) {
  .shell { max-width: 720px; margin: 0 auto; }
}
