:root {
  --bg-deep: #0a0e17;
  --bg-mid: #121a2b;
  --glass: rgba(255, 255, 255, 0.04);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-hover: rgba(255, 255, 255, 0.07);
  --text: #e8edf5;
  --text-dim: rgba(232, 237, 245, 0.55);
  --accent: #4da6ff;
  --accent-glow: rgba(77, 166, 255, 0.35);
  --warn: #ff6b4a;
  --severe: #ff3355;
  --success: #3dd68c;
  --mono: 'JetBrains Mono', monospace;
  --sans: 'Instrument Sans', system-ui, sans-serif;
  --radius: 16px;
  --radius-sm: 10px;
  --transition: 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  --header-clock-w: 5.5rem;
  --header-rail-h: 52px;
}

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

html { font-size: 16px; }

@media (min-width: 769px) and (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  font-family: var(--sans);
  background: var(--bg-deep);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}

body.theme-clear-day {
  --accent: #ffb347;
  --accent-glow: rgba(255, 179, 71, 0.3);
  background: linear-gradient(160deg, #1a2840 0%, #0d1520 40%, #0a0e17 100%);
}

body.theme-clear-night {
  --accent: #7b9cff;
  --accent-glow: rgba(123, 156, 255, 0.25);
  background: linear-gradient(160deg, #0f1225 0%, #0a0e17 60%, #060810 100%);
}

body.theme-cloudy {
  --accent: #8ba4c4;
  background: linear-gradient(160deg, #1a2233 0%, #0e1420 100%);
}

body.theme-rain {
  --accent: #4da6ff;
  --accent-glow: rgba(77, 166, 255, 0.4);
  background: linear-gradient(160deg, #0f1a2e 0%, #0a1220 50%, #060a12 100%);
}

body.theme-storm {
  --accent: #a78bfa;
  --accent-glow: rgba(167, 139, 250, 0.35);
  background: linear-gradient(160deg, #1a1030 0%, #0d0a18 50%, #050508 100%);
}

body.theme-snow {
  --accent: #b8d4f0;
  background: linear-gradient(160deg, #1a2438 0%, #0e1525 100%);
}

#atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.scanlines {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
  opacity: 0.4;
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, 0.55) 100%);
}

.app {
  position: relative;
  z-index: 2;
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 3rem;
}

/* ── Header rail (shared top + sticky) ── */
.header-rail {
  display: grid;
  align-items: center;
  column-gap: 1.25rem;
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.header-end {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
  justify-self: end;
}

.header-clock {
  text-align: right;
  min-width: var(--header-clock-w);
  padding-left: 0.85rem;
  border-left: 1px solid var(--glass-border);
  line-height: 1.2;
  flex-shrink: 0;
}

.header-clock .mono {
  display: block;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.header-clock .date-label {
  display: block;
  margin-top: 0.12rem;
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.header-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  flex-shrink: 0;
}

/* Sticky header */
.sticky-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  background: rgba(10, 14, 23, 0.92);
  border-bottom: 1px solid var(--glass-border);
  backdrop-filter: blur(16px) saturate(1.2);
  transform: translate3d(0, -110%, 0);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.28s ease, visibility 0.28s;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  will-change: transform, opacity;
  contain: layout style;
}

.sticky-bar.visible {
  transform: translate3d(0, 0, 0);
  opacity: 1;
  visibility: visible;
}

.sticky-rail {
  max-width: 1400px;
  margin: 0 auto;
  min-height: var(--header-rail-h);
  padding: 0.5rem 1.5rem;
  padding-top: calc(0.5rem + env(safe-area-inset-top));
}

.sticky-weather {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.sticky-weather-tappable {
  cursor: pointer;
  border-radius: 10px;
  padding: 0.15rem 0.35rem 0.15rem 0;
  margin: -0.15rem 0;
  transition: background 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.sticky-weather-tappable:active {
  background: rgba(255, 255, 255, 0.06);
}

/* Pull-to-refresh */
.ptr-indicator {
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 70;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  width: max-content;
  max-width: calc(100vw - 2rem);
  padding: 0.55rem 1rem 0.35rem;
  padding-top: calc(0.55rem + env(safe-area-inset-top));
  transform: translate(-50%, -120%);
  color: var(--text-dim);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  pointer-events: none;
  transition: color 0.2s ease;
  text-align: center;
}

.ptr-label {
  display: block;
  width: 100%;
  text-align: center;
}

.ptr-indicator.ptr-visible {
  opacity: 1;
}

.ptr-arrow {
  width: 18px;
  height: 18px;
  opacity: 0.55;
  transition: transform 0.2s ease, opacity 0.2s ease, color 0.2s ease;
}

.ptr-indicator.ptr-ready .ptr-arrow {
  opacity: 1;
  color: var(--accent);
  transform: rotate(180deg);
}

.ptr-indicator.ptr-ready {
  color: var(--accent);
}

.ptr-indicator.ptr-loading .ptr-arrow {
  animation: ptrSpin 0.8s linear infinite;
  opacity: 1;
  color: var(--accent);
}

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

/* Offline / error status pill */
.status-pill {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 0.45rem);
  left: 50%;
  z-index: 65;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  max-width: calc(100vw - 1.5rem);
  padding: 0.38rem 0.55rem 0.38rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 107, 74, 0.35);
  background: rgba(20, 12, 14, 0.92);
  backdrop-filter: blur(10px);
  color: #ffb8a8;
  font-size: 0.72rem;
  font-weight: 500;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
  transform: translate(-50%, -140%);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s ease, visibility 0.25s, top 0.25s ease;
}

body.chrome-sticky .status-pill.visible {
  top: calc(var(--sticky-chrome-h, 52px) + 0.35rem);
}

.status-pill.visible {
  transform: translate(-50%, 0);
  opacity: 1;
  visibility: visible;
}

.status-pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ff6b4a;
  box-shadow: 0 0 8px rgba(255, 107, 74, 0.7);
  flex-shrink: 0;
}

#status-pill-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.status-pill-retry {
  flex-shrink: 0;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 107, 74, 0.45);
  background: rgba(255, 107, 74, 0.12);
  color: #ffd4ca;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.status-pill-retry:active {
  background: rgba(255, 107, 74, 0.22);
}

.sticky-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 10px var(--accent-glow));
}

.sticky-temp {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.sticky-loc {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  min-width: 0;
}

.sticky-loc strong {
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.sticky-loc span {
  font-size: 0.68rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.sticky-stats {
  display: flex;
  gap: 0.85rem;
  margin-left: 0.5rem;
  padding-left: 0.85rem;
  border-left: 1px solid var(--glass-border);
  flex-shrink: 0;
}

.sticky-stats span {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  color: var(--text-dim);
}

.sticky-stats svg {
  width: 13px;
  height: 13px;
  color: var(--accent);
  flex-shrink: 0;
}

.sticky-stats em {
  font-style: normal;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.sticky-search {
  min-width: 0;
  max-width: 360px;
  justify-self: center;
  width: min(360px, 100%);
}

@media (max-width: 1024px) {
  .sticky-stats { display: none; }
}

@media (max-width: 900px) {
  .sticky-rail {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .sticky-search { display: none; }
}

.app.hidden { display: none; }

.mono { font-family: var(--mono); }

.loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  background: var(--bg-deep);
  transition: opacity 0.6s, visibility 0.6s;
}

.loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-ring {
  width: 48px;
  height: 48px;
  border: 2px solid var(--glass-border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loader p { color: var(--text-dim); font-size: 0.9rem; letter-spacing: 0.05em; }

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

.top-bar {
  min-height: var(--header-rail-h);
  margin-bottom: 1.25rem;
}

.header-search {
  min-width: 0;
  width: min(420px, 100%);
  max-width: 420px;
  justify-self: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  gap: 0.08rem;
}

.brand-mark {
  color: var(--accent);
  font-size: 1.25rem;
  filter: drop-shadow(0 0 8px var(--accent-glow));
  flex-shrink: 0;
}

.brand-logo {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 12px rgba(77, 166, 255, 0.55)) drop-shadow(0 0 4px rgba(255, 179, 71, 0.25));
}

/* Location welcome (first visit) */
.location-welcome {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  padding-top: calc(1.25rem + env(safe-area-inset-top));
  padding-bottom: calc(1.25rem + env(safe-area-inset-bottom));
  background: rgba(6, 9, 16, 0.82);
  backdrop-filter: blur(14px);
}

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

.location-welcome-card {
  width: min(100%, 420px);
  text-align: center;
  padding: 1.75rem 1.5rem 1.5rem;
}

.welcome-logo {
  margin: 0 auto 1rem;
  filter: drop-shadow(0 0 18px rgba(77, 166, 255, 0.5));
}

.location-welcome-card h2 {
  font-size: 1.35rem;
  margin-bottom: 0.55rem;
}

.welcome-copy {
  color: var(--text-dim);
  font-size: 0.88rem;
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

.welcome-actions {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.welcome-btn {
  width: 100%;
  padding: 0.72rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.welcome-btn.primary {
  border-color: rgba(77, 166, 255, 0.55);
  background: rgba(77, 166, 255, 0.18);
}

.welcome-btn.ghost {
  color: var(--text-dim);
  background: transparent;
  border-color: transparent;
  font-weight: 500;
}

.welcome-btn:active { transform: scale(0.98); }

body.location-pending .dashboard {
  filter: blur(3px);
  pointer-events: none;
  user-select: none;
}

.brand-name {
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  white-space: nowrap;
}

.brand-tag {
  font-size: 0.58rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  display: none;
}

@media (min-width: 768px) { .brand-tag { display: block; } }

.search-wrap {
  position: relative;
  min-width: 0;
}

.search-wrap input {
  width: 100%;
  padding: 0.65rem 2.65rem 0.65rem 4.15rem;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
  backdrop-filter: blur(12px);
}

.search-wrap:not(:has(.chips-toggle-btn)) input {
  padding-right: 1rem;
}

.search-wrap input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-icon {
  position: absolute;
  left: 2.65rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-dim);
  pointer-events: none;
  z-index: 2;
}

.search-adjunct-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  z-index: 3;
  transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.geo-btn {
  left: 0.45rem;
}

.chips-toggle-btn {
  right: 0.45rem;
}

.chips-toggle-btn svg {
  width: 16px;
  height: 16px;
}

.geo-btn .geo-icon {
  width: 16px;
  height: 16px;
  color: rgba(232, 237, 245, 0.85);
  transition: color 0.2s ease, filter 0.2s ease;
}

.search-adjunct-btn:hover,
.search-adjunct-btn:focus-visible {
  color: var(--accent);
  background: rgba(77, 166, 255, 0.12);
  outline: none;
}

.geo-btn:hover .geo-icon,
.geo-btn:focus-visible .geo-icon {
  color: var(--accent);
  filter: drop-shadow(0 0 6px rgba(77, 166, 255, 0.55));
}

.geo-btn:active .geo-icon {
  color: #7ec8ff;
}

.chips-toggle-btn.active {
  color: var(--accent);
  box-shadow: 0 0 0 1px rgba(77, 166, 255, 0.35);
}

.chips-toggle-btn:not(.active) {
  opacity: 0.55;
}

.loc-chips.chips-collapsed { display: none !important; }

.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: rgba(15, 20, 35, 0.95);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  backdrop-filter: blur(20px);
  overflow: hidden;
  z-index: 50;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}

.search-results.hidden { display: none; }

.search-results button {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  background: none;
  border: none;
  color: var(--text);
  text-align: left;
  font-family: var(--sans);
  font-size: 0.82rem;
  line-height: 1.35;
  white-space: normal;
  cursor: pointer;
  transition: background 0.15s;
}

.search-results button:hover { background: var(--glass-hover); }

.header-actions,
.header-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  flex-shrink: 0;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  backdrop-filter: blur(8px);
}

.icon-btn svg { width: 18px; height: 18px; }

.icon-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 16px var(--accent-glow);
}

.live-clock { text-align: right; }

.live-clock .mono {
  display: block;
  font-size: 1.05rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.date-label {
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Alert badge button */
.alert-btn {
  position: relative;
  overflow: visible;
}

.alert-btn.hidden { display: none; }

.alert-btn.severe { color: var(--severe); border-color: rgba(255, 51, 85, 0.45); }
.alert-btn.moderate { color: var(--warn); border-color: rgba(255, 107, 74, 0.4); }
.alert-btn.minor { color: #ffb347; border-color: rgba(255, 179, 71, 0.35); }

.alert-btn.severe:hover { color: var(--severe); box-shadow: 0 0 16px rgba(255, 51, 85, 0.35); }
.alert-btn.moderate:hover { color: var(--warn); box-shadow: 0 0 16px rgba(255, 107, 74, 0.3); }

.alert-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--severe);
  color: #fff;
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 2px var(--bg-deep);
}

.alert-btn.moderate .alert-badge { background: var(--warn); }
.alert-btn.minor .alert-badge { background: #ffb347; color: #201400; }

.alert-btn::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  border: 1px solid currentColor;
  opacity: 0;
  animation: alertRing 2.4s ease-out infinite;
  pointer-events: none;
}

.alert-mark {
  font-size: 1.05rem;
  line-height: 1;
  filter: drop-shadow(0 0 6px currentColor);
}

.alert-btn.small .alert-mark { font-size: 0.9rem; }

@keyframes alertRing {
  0% { transform: scale(1); opacity: 0.6; }
  70% { transform: scale(1.55); opacity: 0; }
  100% { transform: scale(1.55); opacity: 0; }
}

.alert-btn.small { width: 34px; height: 34px; }
.alert-btn.small svg { width: 15px; height: 15px; }

/* Alert drawer */
.alert-drawer {
  position: fixed;
  top: calc(var(--header-rail-h) + 0.85rem + env(safe-area-inset-top));
  right: max(1.5rem, calc((100vw - 1400px) / 2 + 1.5rem));
  z-index: 70;
  width: min(440px, calc(100vw - 2rem));
  max-height: min(560px, calc(100vh - 100px));
  overflow-y: auto;
  background: rgba(12, 16, 28, 0.95);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  backdrop-filter: blur(24px);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  transform-origin: top right;
  animation: drawerIn 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.alert-drawer.hidden { display: none; }

@keyframes drawerIn {
  from { opacity: 0; transform: scale(0.94) translateY(-8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.25rem 0.4rem 0.4rem;
}

.drawer-head h3 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.drawer-attr {
  font-size: 0.65rem;
  color: var(--text-dim);
  text-align: center;
  padding: 0.35rem 0 0.1rem;
}

.drawer-attr a { color: var(--accent); text-decoration: none; }

.alert-card {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid;
  cursor: pointer;
}

.alert-card p {
  transition: none;
}

.alert-card.open p {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}

.alert-hint {
  font-size: 0.68rem;
  color: var(--accent);
  margin-top: 0.35rem;
}

.alert-card.severe {
  background: rgba(255, 51, 85, 0.12);
  border-color: rgba(255, 51, 85, 0.4);
}

.alert-card.moderate {
  background: rgba(255, 107, 74, 0.1);
  border-color: rgba(255, 107, 74, 0.35);
}

.alert-card.minor {
  background: rgba(255, 179, 71, 0.08);
  border-color: rgba(255, 179, 71, 0.3);
}

.alert-sev-rail {
  flex-shrink: 0;
  width: 3px;
  align-self: stretch;
  border-radius: 2px;
  background: currentColor;
  opacity: 0.7;
}

.alert-card.severe .alert-sev-rail { background: var(--severe); }
.alert-card.moderate .alert-sev-rail { background: var(--warn); }
.alert-card.minor .alert-sev-rail { background: #ffb347; }

.alert-body h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.alert-meta {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 0.2rem;
}

.alert-timing {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: rgba(232, 237, 245, 0.72);
  margin-bottom: 0.35rem;
}

.alert-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.4rem;
}

.alert-chip {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.18rem 0.45rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(232, 237, 245, 0.78);
  background: rgba(255, 255, 255, 0.04);
}

.alert-body p {
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.alert-expand {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.75rem;
  cursor: pointer;
  margin-top: 0.35rem;
  padding: 0;
}

/* Saved location chips */
.loc-chips {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.loc-chips.hidden { display: none; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.55rem 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--text-dim);
  font-family: var(--sans);
  font-size: 0.78rem;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: var(--transition);
  animation: riseIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

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

.chip.active {
  border-color: var(--accent);
  color: var(--text);
  background: var(--glass-hover);
  box-shadow: 0 0 14px var(--accent-glow);
}

.chip .chip-x {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  line-height: 1;
  color: var(--text-dim);
  opacity: 0;
  transition: opacity 0.2s, background 0.2s, color 0.2s;
}

.chip:hover .chip-x { opacity: 1; }

.chip .chip-x:hover {
  background: rgba(255, 51, 85, 0.25);
  color: #ff8fa3;
}

/* Glance strip — live temps on saved locations */
.glance-strip {
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  padding-bottom: 0.25rem;
  mask-image: linear-gradient(90deg, transparent, #000 8px, #000 calc(100% - 24px), transparent);
  animation: fadeSlideIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.glance-strip::-webkit-scrollbar { display: none; }

.chip.glance-chip {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  padding: 0.55rem 0.85rem 0.55rem 0.95rem;
  min-width: 108px;
  scroll-snap-align: start;
  flex-shrink: 0;
  position: relative;
}

.chip.glance-chip .chip-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}

.chip.glance-chip .chip-name { font-weight: 600; color: var(--text); }

.chip.glance-chip .chip-temp {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
}

.chip.glance-chip .chip-cond {
  font-size: 0.65rem;
  color: var(--text-dim);
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chip.glance-chip .chip-x {
  position: absolute;
  top: 6px;
  right: 6px;
  opacity: 0;
}

.chip.glance-chip:hover .chip-x { opacity: 1; }

.chip.glance-chip.loading .chip-temp { opacity: 0.4; }

.chip.here-chip {
  border-color: rgba(77, 166, 255, 0.4);
  background: rgba(77, 166, 255, 0.06);
  box-shadow: 0 0 20px rgba(77, 166, 255, 0.12);
}

.chip.here-chip .chip-label {
  font-size: 0.55rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  animation: softPulse 3s ease-in-out infinite;
}

@keyframes softPulse {
  0%, 100% { opacity: 0.65; }
  50% { opacity: 1; }
}

/* Weather briefing v2 */
.weather-briefing {
  margin: 0.35rem 0 0.85rem;
  max-width: 520px;
}

.weather-briefing:empty,
.weather-briefing:not(:has(.briefing-headline:not(:empty))) {
  display: none;
}

.briefing-headline {
  margin: 0 0 0.28rem;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
  letter-spacing: -0.01em;
}

.briefing-action {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--text-dim);
}

.weather-briefing.briefing-warn .briefing-action {
  color: #ffb347;
}

.weather-briefing.briefing-accent .briefing-action {
  color: #7ec8ff;
}

.briefing-action.hidden {
  display: none;
}

/* Units toggle */
.units-btn {
  min-width: 44px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Golden hour strip */
.golden-hour-strip {
  position: relative;
  padding: 0.5rem 0 0.25rem;
}

.golden-track {
  position: relative;
  height: 32px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
  margin-bottom: 0.65rem;
}

.golden-seg {
  position: absolute;
  top: 0;
  bottom: 0;
  opacity: 0.85;
}

.golden-seg.blue { background: linear-gradient(180deg, rgba(100, 130, 255, 0.35), rgba(100, 130, 255, 0.15)); }
.golden-seg.golden { background: linear-gradient(180deg, rgba(255, 179, 71, 0.45), rgba(255, 179, 71, 0.2)); }
.golden-seg.day { background: rgba(255, 255, 255, 0.06); }

.golden-now {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 2px;
  background: #ff6b4a;
  box-shadow: 0 0 8px rgba(255, 107, 74, 0.6);
  z-index: 2;
}

.golden-labels {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.68rem;
  color: var(--text-dim);
}

.golden-slot-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-top: 0.75rem;
}

.golden-slot {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.golden-slot strong {
  color: var(--text);
  font-family: var(--mono);
  font-weight: 500;
}

.golden-slot.active strong { color: var(--accent); }

/* Radar alert badges */
.radar-alert-badges {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-width: 220px;
  pointer-events: none;
}

.radar-alert-badges.hidden { display: none; }

.radar-alert-badge {
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  background: rgba(10, 14, 23, 0.88);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(8px);
  font-size: 0.68rem;
  line-height: 1.35;
  pointer-events: auto;
}

.radar-alert-badge.severe { border-color: rgba(255, 51, 85, 0.5); }
.radar-alert-badge.moderate { border-color: rgba(255, 107, 74, 0.45); }

.radar-alert-badge strong {
  display: block;
  font-size: 0.72rem;
  margin-bottom: 0.15rem;
}

.radar-alert-badge .badge-meta {
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 0.62rem;
}

/* Comfort legend */
.comfort-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.9rem;
  font-size: 0.72rem;
  color: var(--text-dim);
}

.comfort-legend-wrap {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.75rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
}

.comfort-legend-copy {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 170px;
}

.comfort-legend-copy span {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
}

.comfort-legend-copy small,
.legend-item small {
  color: var(--text-dim);
  opacity: 0.72;
}

.comfort-legend-copy small {
  font-size: 0.68rem;
  line-height: 1.35;
}

.comfort-dry { background: rgba(100, 180, 255, 0.7); }
.comfort-pleasant { background: rgba(100, 220, 160, 0.7); }
.comfort-muggy { background: rgba(255, 179, 71, 0.7); }
.comfort-oppressive { background: rgba(255, 80, 100, 0.7); }

#pressure-mood.stormy { color: var(--warn); }
#pressure-mood.unsettled { color: #ffb347; }
#pressure-mood.clearing { color: #64dcaa; }

/* Save location star */
.save-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--text-dim);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}

.save-btn svg { width: 16px; height: 16px; }

.save-btn:hover {
  border-color: #ffb347;
  color: #ffb347;
  box-shadow: 0 0 14px rgba(255, 179, 71, 0.3);
}

.save-btn.saved {
  color: #ffb347;
  border-color: rgba(255, 179, 71, 0.5);
}

.save-btn.saved svg { fill: #ffb347; }

.save-btn.pop { animation: starPop 0.35s cubic-bezier(0.22, 1.6, 0.36, 1); }

@keyframes starPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.panel {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  backdrop-filter: blur(20px);
  padding: 1.5rem;
  transition: var(--transition);
}

.panel:hover { border-color: rgba(255, 255, 255, 0.12); }

.dashboard {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.25rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.panel-head h2 {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.panel-sub {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.15rem;
}

.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: center;
  min-height: 220px;
  position: relative;
  overflow: hidden;
  padding-bottom: 1.25rem;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
}

.location-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.hero h1 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.condition-text {
  font-size: 1.1rem;
  color: var(--text-dim);
  margin: 0.35rem 0 0.75rem;
}

.temp-display {
  display: flex;
  align-items: flex-start;
  line-height: 1;
}

.temp-main {
  font-size: clamp(4rem, 10vw, 6.5rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  background: linear-gradient(180deg, var(--text) 30%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.temp-unit {
  font-size: 1.5rem;
  color: var(--text-dim);
  margin-top: 1rem;
  margin-left: 0.25rem;
}

.feels-like {
  font-size: 0.95rem;
  color: var(--text-dim);
  margin-top: 0.35rem;
}

.since-last-check {
  display: none;
  align-items: center;
  font-size: 0.62rem;
  color: var(--text-dim);
  font-family: var(--mono);
  padding: 0.24rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.035);
  letter-spacing: 0.03em;
  animation: fadeSlideIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
  pointer-events: none;
  text-align: right;
  justify-content: flex-end;
}

.hero-meta-row {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.35rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  min-width: 0;
}

.hero-meta-row .location-swipe-indicator,
.hero-meta-row .since-last-check {
  position: static;
  left: auto;
  right: auto;
  bottom: auto;
  z-index: auto;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 50%;
}

.hero-meta-row .since-last-check {
  margin-left: auto;
}

.since-last-check.visible { display: inline-flex; }

.since-last-check.refreshing {
  opacity: 0.65;
}

.since-last-check .refresh-label {
  color: var(--text);
}

.since-last-check .delta-down { color: #6eb5ff; }
.since-last-check .delta-up { color: #ffb347; }

.location-swipe-indicator {
  padding: 0.24rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.03em;
  pointer-events: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.location-swipe-indicator.hidden { display: none; }

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.temp-change {
  margin-left: 0.5rem;
  font-family: var(--mono);
  font-size: 0.8rem;
}

.temp-change.down { color: #4da6ff; }
.temp-change.up { color: #ff6b4a; }

body.location-swipe-enabled .dashboard {
  touch-action: pan-y;
}

body[class*="location-swipe-out-"] .dashboard,
body[class*="location-swipe-in-"] .dashboard {
  will-change: transform, opacity;
}

body.location-swipe-out-left .dashboard {
  animation: locationSwipeOutLeft 0.12s cubic-bezier(0.4, 0, 1, 1) forwards;
}

body.location-swipe-out-right .dashboard {
  animation: locationSwipeOutRight 0.12s cubic-bezier(0.4, 0, 1, 1) forwards;
}

body.location-swipe-in-left .dashboard {
  animation: locationSwipeInRight 0.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}

body.location-swipe-in-right .dashboard {
  animation: locationSwipeInLeft 0.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes locationSwipeOutLeft {
  to { opacity: 0; transform: translate3d(-12px, 0, 0); }
}

@keyframes locationSwipeOutRight {
  to { opacity: 0; transform: translate3d(12px, 0, 0); }
}

@keyframes locationSwipeInRight {
  from { opacity: 0; transform: translate3d(18px, 0, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes locationSwipeInLeft {
  from { opacity: 0; transform: translate3d(-18px, 0, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 2rem;
  margin-top: 1.25rem;
  max-width: 440px;
}

.hero-stat .value.storm-high { color: var(--warn); }

.hero-stat .label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.2rem;
}

.hero-stat .value { font-size: 1rem; font-weight: 500; }

.hero-uv-note {
  margin: 0.15rem 0 0.35rem;
  font-size: 0.82rem;
  color: rgba(232, 237, 245, 0.72);
}

.hero-uv-note.uv-mod { color: #ffc56b; }
.hero-uv-note.uv-high { color: #ff9b71; font-weight: 500; }

.hero-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Daylight metric widget */
.daylight-widget {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  max-width: 150px;
}

.daylight-status {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  line-height: 1.2;
}

.daylight-track {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(78, 100, 190, 0.32), rgba(255, 179, 71, 0.2), rgba(255, 179, 71, 0.48), rgba(78, 100, 190, 0.32));
  overflow: visible;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.daylight-fill {
  position: absolute;
  inset: 0 auto 0 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 179, 71, 0.24), rgba(255, 211, 128, 0.78));
  transition: width 0.4s ease;
}

.daylight-marker {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  border-radius: 50%;
  transform: translateY(-50%);
  background: #b8c4e0;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 8px rgba(123, 156, 255, 0.45);
  transition: left 0.4s ease, background 0.3s, box-shadow 0.3s;
}

.daylight-marker.day {
  background: #ffb347;
  box-shadow: 0 0 8px rgba(255, 179, 71, 0.5);
}

.daylight-marker.pre-dawn {
  background: #7b9cff;
}

.daylight-times {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

.daylight-times span {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.sun-token {
  display: inline-flex;
  width: 1rem;
  height: 1rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 0.62rem;
  line-height: 1;
}

.sun-token.sunrise {
  background: rgba(255, 179, 71, 0.14);
  color: #ffcf87;
}

.sun-token.sunset {
  background: rgba(123, 156, 255, 0.14);
  color: #aebfff;
}

/* Nowcast */
.nowcast-insight {
  font-size: 0.88rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
  letter-spacing: 0.01em;
}

#nowcast-chart {
  display: block;
  width: 100%;
  border-radius: var(--radius-sm);
}

/* Radar map panel */
.radar-map-wrap {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background: #0a0e17;
}

.radar-legend {
  position: absolute;
  left: 0.65rem;
  bottom: 0.65rem;
  z-index: 450;
  width: min(220px, calc(100% - 1.3rem));
  padding: 0.45rem 0.55rem 0.4rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 12, 20, 0.88);
  backdrop-filter: blur(8px);
  pointer-events: none;
}

.radar-legend-title {
  display: block;
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(232, 237, 245, 0.55);
  margin-bottom: 0.35rem;
}

.radar-legend-gradient {
  height: 10px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(
    90deg,
    rgba(10, 14, 23, 0.15) 0%,
    #9AE66E 10%,
    #5CB85C 22%,
    #2E7D32 36%,
    #F4E04D 50%,
    #E8A317 64%,
    #D35400 78%,
    #9B59B6 92%,
    #7D3C98 100%
  );
}

.radar-legend-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 0.28rem;
  font-size: 0.52rem;
  font-family: var(--mono);
  color: rgba(232, 237, 245, 0.5);
  letter-spacing: 0.01em;
}

.radar-map-wrap.hidden { display: none; }

.radar-map {
  height: 380px;
  border-radius: 0;
  overflow: hidden;
  border: none;
  background: #0a0e17;
  z-index: 1;
}

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

.radar-map .leaflet-container {
  background: #0a0e17;
  font-family: var(--sans);
}

.radar-map .leaflet-control-zoom a {
  background: rgba(15, 20, 35, 0.9);
  color: var(--text);
  border-color: var(--glass-border);
}

.radar-map .leaflet-control-zoom a:hover {
  background: var(--glass-hover);
  color: var(--accent);
}

.radar-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.radar-controls .forecast-control-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.radar-opacity {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  color: var(--text-dim);
}

.radar-opacity input[type="range"] {
  width: 80px;
  accent-color: var(--accent);
}

.radar-unavailable {
  font-size: 0.85rem;
  color: var(--text-dim);
  text-align: center;
  padding: 2rem 1rem;
  border: 1px dashed var(--glass-border);
  border-radius: var(--radius-sm);
}

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

.radar-attribution {
  font-size: 0.62rem;
  color: var(--text-dim);
  text-align: right;
  margin-top: 0.5rem;
}

.condition-icon {
  filter: drop-shadow(0 8px 32px var(--accent-glow));
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.sun-arc {
  display: none;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  grid-auto-rows: 1fr;
  gap: 0.75rem;
  align-items: stretch;
}

.metric {
  display: flex;
  flex-direction: column;
  padding: 0.9rem 1rem;
  min-height: 148px;
}

.metric-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
  flex-shrink: 0;
}

.metric-content {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 72px;
  max-height: 72px;
  width: 100%;
}

.metric-footer {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.5rem;
  display: flex;
  justify-content: space-between;
  flex-shrink: 0;
  min-height: 1.15rem;
  align-items: center;
}

.metric-icon { color: var(--accent); }

.wind-compass-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  flex-shrink: 0;
}

.wind-compass-wrap canvas {
  display: block;
  width: 72px;
  height: 72px;
}

.wind-compass-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.wind-compass-center .mono {
  font-size: 1.1rem;
  font-weight: 600;
}

.wind-compass-center .unit {
  font-size: 0.6rem;
  color: var(--text-dim);
}

.gauge-wrap {
  position: relative;
  width: 88px;
  height: 48px;
  flex-shrink: 0;
}

.gauge-wrap canvas {
  display: block;
  width: 88px;
  height: 48px;
}

.gauge-val {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.pressure-display {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.2rem;
  text-align: center;
}

.pressure-num {
  font-size: 1.65rem;
  font-weight: 600;
  color: var(--accent);
  line-height: 1;
}

.big-val {
  font-size: 1.65rem;
  font-weight: 600;
  text-align: center;
  line-height: 1;
}

.big-val.storm { color: var(--warn); }

.big-val .unit {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.uv-content {
  flex-direction: column;
  gap: 0.42rem;
  align-items: stretch;
}

.uv-bar-wrap {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #3dd68c, #ffb347, #ff6b4a, #ff3355, #a855f7);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.uv-readout {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.38rem;
  color: var(--text);
  text-align: center;
  line-height: 1.2;
}

.uv-readout strong {
  font-size: 1.55rem;
  color: var(--accent);
  line-height: 1;
}

.uv-readout span {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.uv-scale {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.55rem;
  color: rgba(232, 237, 245, 0.42);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.uv-fill {
  position: absolute;
  top: -3px;
  left: 0;
  height: calc(100% + 6px);
  width: 3px;
  background: white;
  border-radius: 999px;
  box-shadow: 0 0 10px white, 0 0 18px rgba(255, 255, 255, 0.45);
  transition: left 0.6s ease;
}

canvas {
  width: 100%;
  display: block;
  cursor: crosshair;
}

.chart-toggles {
  display: flex;
  gap: 0.35rem;
}

.forecast-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.forecast-control-toggle {
  display: none;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.28s ease, background 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
}

.forecast-control-toggle svg {
  width: 18px;
  height: 18px;
  transition: transform 0.36s cubic-bezier(0.22, 1, 0.36, 1);
}

.forecast-control-toggle:hover,
.forecast-control-toggle:focus-visible {
  border-color: rgba(77, 166, 255, 0.5);
  background: rgba(77, 166, 255, 0.1);
  box-shadow: 0 0 18px rgba(77, 166, 255, 0.14);
  outline: none;
}

.forecast-control-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.forecast-control-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.forecast-range-tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0.2rem;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.03);
}

.forecast-range-btn {
  min-height: 30px;
  padding: 0.28rem 0.58rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 0.66rem;
  cursor: pointer;
  transition: var(--transition);
}

.forecast-range-btn.active {
  background: rgba(77, 166, 255, 0.16);
  color: var(--accent);
  box-shadow: 0 0 14px rgba(77, 166, 255, 0.14);
}

.forecast-range-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.toggle {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: transparent;
  color: var(--text-dim);
  font-family: var(--sans);
  font-size: 0.72rem;
  cursor: pointer;
  transition: var(--transition);
}

.toggle.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #0a0e17;
  font-weight: 600;
}

.toggle:not(.active) { opacity: 0.5; }

.chart-tooltip {
  position: fixed;
  z-index: 50;
  padding: 0.65rem 0.85rem 0.7rem;
  background: rgba(10, 14, 23, 0.95);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  pointer-events: none;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  min-width: 11.5rem;
}

.chart-tip-head {
  display: block;
  margin-bottom: 0.12rem;
  font-size: 0.82rem;
  color: var(--text);
}

.chart-tip-cond {
  color: var(--text-dim);
  font-size: 0.72rem;
  margin-bottom: 0.45rem;
  padding-bottom: 0.38rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.chart-tip-rows {
  display: flex;
  flex-direction: column;
  gap: 0.34rem;
}

.chart-tip-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 1rem;
}

.chart-tip-text {
  font-size: 0.74rem;
  line-height: 1.25;
  color: rgba(232, 237, 245, 0.92);
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.chart-tip-swatch {
  flex-shrink: 0;
  display: block;
  width: 14px;
  height: 0;
  border-top: 2px solid transparent;
}

.chart-tip-swatch--temp {
  border-top-color: #ffb347;
}

.chart-tip-swatch--feels {
  border-top-color: rgba(255, 179, 71, 0.55);
  border-top-style: dashed;
}

.chart-tip-swatch--precip {
  width: 8px;
  height: 9px;
  border: none;
  border-radius: 1px;
  background: rgba(77, 166, 255, 0.88);
  align-self: center;
}

.chart-tip-swatch--wind {
  border-top-color: rgba(167, 139, 250, 0.9);
  border-top-style: dashed;
}

.chart-tip-swatch--uv {
  border-top-color: rgba(255, 179, 71, 0.68);
  border-top-style: dotted;
}

.chart-tip-swatch--comfort {
  width: 8px;
  height: 8px;
  border: none;
  border-radius: 2px;
  align-self: center;
  opacity: 0.95;
}

.chart-tooltip.hidden { display: none; }

.chart-tooltip.chart-tooltip-mobile {
  left: 50% !important;
  right: auto;
  top: auto !important;
  bottom: calc(1rem + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  max-width: min(92vw, 340px);
  text-align: center;
  pointer-events: none;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.55);
}

body.chrome-sticky .chart-tooltip.chart-tooltip-mobile {
  bottom: calc(var(--bottom-nav-h, 56px) + 0.65rem + env(safe-area-inset-bottom));
}

/* Horizontal strips — edge fade on mobile */
.strip-scroll {
  margin: 0 -0.15rem;
  padding: 0 0.15rem;
}

@media (max-width: 768px) {
  .strip-scroll {
    margin: 0 -1.1rem;
    padding: 0 1.1rem;
    mask-image: linear-gradient(90deg, transparent, #000 10px, #000 calc(100% - 28px), transparent);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 10px, #000 calc(100% - 28px), transparent);
  }

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

/* Mobile bottom section nav — thumb-zone, synced with sticky header */
.section-rail {
  display: none;
}

@media (max-width: 768px) {
  body.chrome-sticky .app {
    padding-bottom: calc(2rem + var(--bottom-nav-h, 56px) + env(safe-area-inset-bottom));
  }

  body.chrome-sticky [id^="section-"] {
    scroll-margin-top: calc(var(--sticky-chrome-h, 52px) + env(safe-area-inset-top) + 10px);
    scroll-margin-bottom: calc(var(--bottom-nav-h, 56px) + env(safe-area-inset-bottom) + 10px);
  }

  .section-rail {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 58;
    align-items: stretch;
    justify-content: space-between;
    gap: 0.2rem;
    padding: 0.35rem 0.45rem calc(0.4rem + env(safe-area-inset-bottom));
    margin: 0;
    border-top: 1px solid var(--glass-border);
    background: rgba(10, 14, 23, 0.96);
    backdrop-filter: blur(16px) saturate(1.15);
    box-shadow: 0 -10px 36px rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate3d(0, 110%, 0);
    transition: transform 0.22s ease-out, opacity 0.18s ease-out, visibility 0.18s;
    will-change: transform, opacity;
  }

  .section-rail.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate3d(0, 0, 0);
  }
}

.section-pill {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.12rem;
  padding: 0.32rem 0.1rem 0.28rem;
  border-radius: 10px;
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-align: center;
  text-decoration: none;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s, background 0.2s, transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.section-pill-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: rgba(232, 237, 245, 0.45);
  transition: color 0.2s ease;
  position: relative;
}

.section-pill.has-precip-badge .section-pill-icon::after {
  content: '';
  position: absolute;
  top: -1px;
  right: -3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4da6ff;
  box-shadow: 0 0 6px rgba(77, 166, 255, 0.85);
  border: 1px solid rgba(10, 14, 23, 0.9);
}

.section-pill-icon svg {
  width: 100%;
  height: 100%;
}

.section-pill-label {
  line-height: 1.1;
  white-space: nowrap;
}

.section-pill:hover,
.section-pill.active {
  color: var(--text);
}

.section-pill:hover .section-pill-icon,
.section-pill.active .section-pill-icon {
  color: var(--accent);
}

.section-pill.active .section-pill-label {
  color: var(--text);
}

@media (max-width: 768px) {
  .section-pill:hover,
  .section-pill.active {
    background: transparent;
    border-color: transparent;
  }
}

.section-pill:active {
  transform: scale(0.97);
}

@media (min-width: 769px) {
  .section-rail { display: none !important; }
}

@media (hover: none) and (pointer: coarse) {
  .sticky-bar {
    background: rgba(10, 14, 23, 0.97);
    backdrop-filter: blur(8px);
    transition: transform 0.2s ease-out, opacity 0.16s ease-out, visibility 0.16s;
  }
}

.chart-legend {
  display: flex;
  gap: 1.5rem;
  margin-top: 0.75rem;
  font-size: 0.72rem;
  color: var(--text-dim);
}

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

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

.legend-swatch {
  display: inline-block;
  flex-shrink: 0;
}

.legend-swatch-line {
  width: 18px;
  height: 0;
  border-top: 2px solid var(--swatch-color, #e8edf5);
}

.legend-swatch-line.faint {
  border-top-width: 1.5px;
  opacity: 0.75;
}

.legend-swatch-bar {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: rgba(77, 166, 255, 0.35);
}

.history-chart-legend {
  flex-wrap: wrap;
  gap: 0.85rem 1.25rem;
  margin-top: 0.65rem;
  padding-top: 0.15rem;
}

.history-chart-wrap {
  margin-top: 1rem;
}

#history-chart {
  margin-top: 0;
}

.nowcast-summary {
  font-size: 0.82rem;
  color: var(--text-dim);
  text-align: right;
}

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

/* Hourly strip */
.hourly-strip,
.daily-cards {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  padding-bottom: 0.6rem;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.hourly-strip::-webkit-scrollbar,
.daily-cards::-webkit-scrollbar { height: 6px; }
.hourly-strip::-webkit-scrollbar-track,
.daily-cards::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.03); border-radius: 3px; }
.hourly-strip::-webkit-scrollbar-thumb,
.daily-cards::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.14); border-radius: 3px; }
.hourly-strip::-webkit-scrollbar-thumb:hover,
.daily-cards::-webkit-scrollbar-thumb:hover { background: var(--accent); }

.hour-card {
  flex: 0 0 auto;
  width: 84px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.28rem;
  padding: 0.75rem 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  scroll-snap-align: start;
  transition: transform 0.22s ease, background 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
  animation: riseIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
  outline: none;
}

.hour-card:hover,
.hour-card:focus-visible {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(77, 166, 255, 0.32);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.hour-card.now {
  border-color: rgba(77, 166, 255, 0.45);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 0 12px rgba(77, 166, 255, 0.15);
}

.hour-card.selected {
  border-color: rgba(77, 166, 255, 0.55);
  background: rgba(77, 166, 255, 0.08);
  box-shadow: 0 0 14px rgba(77, 166, 255, 0.2);
  transform: translateY(-1px);
}

.hour-card.chart-sync {
  border-color: rgba(255, 179, 71, 0.55);
  background: rgba(255, 179, 71, 0.06);
  box-shadow: 0 0 10px rgba(255, 179, 71, 0.15);
}

.chart-scroll-hint {
  display: none;
  margin: 0 0 0.5rem;
  font-size: 0.68rem;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}

.chart-scroll-wrap {
  width: 100%;
  overflow-x: hidden;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.chart-scroll-wrap.is-wide {
  overflow-x: auto;
  cursor: grab;
}

.chart-scroll-wrap.is-wide canvas {
  touch-action: pan-x;
}

.chart-scroll-wrap::-webkit-scrollbar {
  height: 4px;
}

.chart-scroll-wrap::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
}

.chart-scroll-wrap.is-wide:active {
  cursor: grabbing;
}

.chart-canvas-wrap {
  position: relative;
  width: 100%;
  min-width: 100%;
}

.chart-canvas-wrap canvas {
  display: block;
  width: 100%;
}

.chart-scroll-wrap.is-wide .chart-canvas-wrap canvas {
  width: auto;
}

.chart-cursor-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Air quality row */
.aqi-panel.hidden { display: none; }

.aqi-updated {
  font-size: 0.65rem;
  color: var(--text-dim);
  white-space: nowrap;
}

.aqi-row {
  display: grid;
  grid-template-columns: minmax(140px, 0.9fr) minmax(160px, 1fr) minmax(0, 2fr);
  gap: 0.75rem;
  align-items: stretch;
}

@media (max-width: 900px) {
  .aqi-row { grid-template-columns: 1fr; }
}

.aqi-score {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.1rem;
}

.aqi-gauge {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.03);
  transition: border-color 0.3s, box-shadow 0.3s;
}

.aqi-value {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
}

.aqi-scale {
  font-size: 0.55rem;
  color: var(--text-dim);
  margin-top: 0.1rem;
}

.aqi-score-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.aqi-score-meta strong {
  font-size: 0.95rem;
  line-height: 1.25;
}

.aqi-index-name {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}

.aqi-pollutants,
.aqi-health {
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.aqi-block-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.aqi-dominant {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.15rem;
}

.aqi-dominant-card {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  background: rgba(255, 179, 71, 0.08);
  border: 1px solid rgba(255, 179, 71, 0.22);
}

.aqi-dominant-card strong {
  font-size: 0.92rem;
  color: var(--text);
}

.aqi-dominant-card .mono {
  font-size: 0.82rem;
  color: rgba(232, 237, 245, 0.86);
}

.aqi-pollutant-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.aqi-pollutant {
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 0.35rem 0.55rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
}

.aqi-pollutant strong { color: var(--text); }

.aqi-pollutant.is-dominant {
  border-color: rgba(255, 179, 71, 0.28);
  background: rgba(255, 179, 71, 0.06);
}

.aqi-health-text {
  font-size: 0.82rem;
  line-height: 1.55;
  color: rgba(232, 237, 245, 0.82);
}

.history-strip {
  margin-bottom: 0.75rem;
}

#hour-detail,
#history-hour-detail {
  margin-top: 0.75rem;
}

.forecast-timeline-panel #hour-detail:not(.hidden) {
  margin-bottom: 0.9rem;
  border-color: rgba(77, 166, 255, 0.28);
  box-shadow: 0 12px 32px rgba(5, 8, 13, 0.28);
}

.forecast-timeline-panel #hour-detail:not(.hidden) + .forecast-chart-block {
  margin-top: 0;
}

.history-strip .hour-card.past {
  opacity: 0.92;
}

.history-strip .hour-card.latest {
  border-color: rgba(255, 107, 74, 0.55);
}

.hc-time {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
}

.hour-card.now .hc-time { color: var(--accent); }

.hour-card img { width: 34px; height: 34px; }

.hc-temp { font-size: 0.95rem; font-weight: 600; }

.hc-precip {
  font-size: 0.62rem;
  font-family: var(--mono);
  color: #4da6ff;
}

.hc-precip.dim { color: rgba(232, 237, 245, 0.25); }

.hc-wind {
  font-size: 0.6rem;
  font-family: var(--mono);
  color: var(--text-dim);
}

.hc-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.14rem;
  width: 100%;
  animation: fadeSlideIn 0.35s ease both;
}

.hc-tag {
  font-size: 0.52rem;
  font-family: var(--mono);
  letter-spacing: 0.02em;
  padding: 0.08rem 0.32rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  white-space: nowrap;
  line-height: 1.3;
  transition: background 0.2s, transform 0.2s;
}

.hour-card:hover .hc-tag { transform: scale(1.02); }

.hc-tag.precip-type { color: #7ec4ff; }
.hc-tag.qpf { color: #9ed4ff; }
.hc-tag.qpf.snow { color: #c8dcff; }
.hc-tag.qpf.mix { color: #b496ff; }
.hc-tag.storm {
  color: #ffc87a;
  background: rgba(255, 179, 71, 0.12);
}

.hc-tag.uv {
  color: #ffc56b;
  background: rgba(255, 179, 71, 0.08);
}

.hc-tag.uv.uv-high {
  color: #ff9b71;
  font-weight: 600;
}

.hc-alt {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  font-size: 0.55rem;
  color: var(--text-dim);
  transition: max-height 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.28s, margin 0.28s;
  margin-top: 0;
}

.hour-card:hover .hc-alt,
.hour-card:focus-visible .hc-alt {
  max-height: 1.2rem;
  opacity: 1;
  margin-top: 0.05rem;
}

.strip-toggles {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

.forecast-chart-block {
  margin-top: 0.95rem;
  padding-top: 0.95rem;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  max-width: 100%;
}

.strip-temp-toggle {
  font-size: 0.68rem;
  padding: 0.35rem 0.65rem;
  min-height: 32px;
}

.strip-day-sep {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  padding: 0 0.35rem;
}

.strip-day-sep span {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--accent);
  border-right: 1px dashed rgba(255, 255, 255, 0.2);
  padding-right: 0.3rem;
}

/* Microanimations */
@keyframes riseIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.dashboard > * { animation: riseIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) both; }
.dashboard > *:nth-child(1) { animation-delay: 0.02s; }
.dashboard > *:nth-child(2) { animation-delay: 0.08s; }
.dashboard > *:nth-child(3) { animation-delay: 0.14s; }
.dashboard > *:nth-child(4) { animation-delay: 0.2s; }
.dashboard > *:nth-child(5) { animation-delay: 0.26s; }
.dashboard > *:nth-child(6) { animation-delay: 0.32s; }
.dashboard > *:nth-child(7) { animation-delay: 0.38s; }
.dashboard > *:nth-child(8) { animation-delay: 0.44s; }
.dashboard > *:nth-child(9) { animation-delay: 0.5s; }

.metrics-grid .metric {
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.3s, box-shadow 0.3s, background 0.3s;
}

.metrics-grid .metric:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

.icon-btn:active, .toggle:active, .day-card:active, .hour-card:active {
  transform: scale(0.96);
}

.day-icon, .hour-card img {
  transition: transform 0.22s ease;
}

.day-card:hover .day-icon { transform: scale(1.05); }
.hour-card:hover img { transform: scale(1.04); }

/* ── Motion UX (AtmosMotion) ── */
.stat-flash {
  animation: statFlash 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes statFlash {
  0% { box-shadow: 0 0 0 0 rgba(255, 179, 71, 0); }
  35% { box-shadow: 0 0 0 3px rgba(255, 179, 71, 0.35); }
  100% { box-shadow: 0 0 0 0 rgba(255, 179, 71, 0); }
}

.hero-stat .value.stat-flash,
.hero-stat .value {
  border-radius: 6px;
  padding: 0.05rem 0.2rem;
  margin: -0.05rem -0.2rem;
}

.condition-icon {
  transition: opacity 0.28s ease, transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.condition-icon.icon-swap-out {
  opacity: 0;
  transform: scale(0.94) translateY(4px);
}

.condition-icon.icon-swap-in {
  animation: iconSwapIn 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes iconSwapIn {
  from { opacity: 0; transform: scale(1.04) translateY(-6px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.weather-briefing.briefing-out {
  animation: briefingOut 0.22s ease forwards;
}

.weather-briefing.briefing-in {
  animation: briefingIn 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

.briefing-headline.briefing-line-out,
.briefing-action.briefing-line-out {
  animation: briefingOut 0.2s ease forwards;
}

.briefing-headline.briefing-line-in,
.briefing-action.briefing-line-in {
  animation: briefingIn 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes briefingOut {
  to { opacity: 0; transform: translateY(4px); }
}

@keyframes briefingIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-uv-note.uv-note-in {
  animation: uvNoteIn 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes uvNoteIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.day-detail-panel.detail-fade-out,
#hour-detail.detail-fade-out,
#history-hour-detail.detail-fade-out {
  opacity: 0;
}

.day-detail-panel.detail-fade-in,
#hour-detail.detail-fade-in,
#history-hour-detail.detail-fade-in {
  opacity: 1;
}

.section-rail-indicator {
  position: absolute;
  top: 0.28rem;
  left: 0;
  height: calc(100% - 0.56rem);
  border-radius: 10px;
  background: rgba(77, 166, 255, 0.12);
  border: 1px solid rgba(77, 166, 255, 0.28);
  pointer-events: none;
  z-index: 0;
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1), width 0.32s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s;
  will-change: transform, width;
}

.section-pill {
  position: relative;
  z-index: 1;
}

.section-pill-icon.pill-icon-bounce {
  animation: pillIconBounce 0.38s cubic-bezier(0.22, 1.6, 0.36, 1);
}

@keyframes pillIconBounce {
  0% { transform: scale(1); }
  45% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

.nowcast-insight.insight-imminent {
  animation: insightWash 2.4s ease-in-out infinite;
  border-radius: 8px;
  padding: 0.35rem 0.5rem;
  margin: -0.35rem -0.5rem 0.5rem;
  background: rgba(255, 179, 71, 0.08);
}

@keyframes insightWash {
  0%, 100% { background: rgba(255, 179, 71, 0.06); }
  50% { background: rgba(255, 179, 71, 0.14); }
}

.chart-legend .legend-item.legend-pulse .legend-dot {
  animation: legendDotPulse 0.55s ease;
}

@keyframes legendDotPulse {
  0%, 100% { transform: scale(1); box-shadow: none; }
  50% { transform: scale(1.25); box-shadow: 0 0 10px currentColor; }
}

.golden-now {
  transition: left 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.golden-slot.active strong {
  animation: goldenSlotGlow 2s ease-in-out 1;
}

@keyframes goldenSlotGlow {
  0%, 100% { text-shadow: none; }
  50% { text-shadow: 0 0 12px rgba(255, 179, 71, 0.55); }
}

.aqi-gauge {
  position: relative;
  --aqi-fill: 0%;
}

.aqi-gauge::before {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: conic-gradient(
    var(--aqi-color, var(--accent)) 0deg,
    var(--aqi-color, var(--accent)) calc(var(--aqi-fill) * 3.6),
    transparent calc(var(--aqi-fill) * 3.6)
  );
  opacity: 0.32;
  pointer-events: none;
  transition: opacity 0.3s;
}

.aqi-gauge-anim::before {
  opacity: 0.45;
}

.aqi-dominant-card {
  animation: riseIn 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.search-results button.search-result-enter {
  animation: searchResultIn 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes searchResultIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.search-wrap input.search-shake {
  animation: searchShake 0.42s ease;
}

@keyframes searchShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}

.geo-btn.geo-locating .geo-icon {
  animation: geoRipple 1.1s ease-in-out infinite;
}

.geo-btn.geo-success .geo-icon {
  animation: geoSuccess 0.55s cubic-bezier(0.22, 1.6, 0.36, 1);
  color: #64dc9a;
}

@keyframes geoRipple {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.12); opacity: 0.75; }
}

@keyframes geoSuccess {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.chip.chip-exit {
  animation: chipExit 0.22s ease forwards;
}

.chip:not(.here-chip) {
  animation: chipEnter 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes chipEnter {
  from { opacity: 0; transform: translateX(12px) scale(0.96); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes chipExit {
  to { opacity: 0; transform: scale(0.88); max-width: 0; padding: 0; margin: 0; }
}

.save-btn.unsave-pop {
  animation: unsavePop 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes unsavePop {
  0% { transform: scale(1); }
  40% { transform: scale(0.82); }
  100% { transform: scale(1); }
}

.sticky-bar.sticky-chrome-enter {
  animation: stickyBarIn 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes stickyBarIn {
  from { opacity: 0.82; transform: translate3d(0, -6px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

.sticky-icon.sticky-handoff-in,
.sticky-temp.sticky-handoff-in {
  animation: stickyHandoff 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes stickyHandoff {
  from { opacity: 0.4; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.metrics-grid .metric {
  opacity: 0;
  transform: translateY(12px);
}

.metrics-grid .metric.metric-revealed {
  animation: metricReveal 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: var(--reveal-delay, 0ms);
}

@keyframes metricReveal {
  to { opacity: 1; transform: translateY(0); }
}

.wind-arrow {
  display: inline-block;
  transition: transform 0.05s linear;
}

.chart-tooltip.tooltip-swapping {
  animation: tooltipSwap 0.18s ease;
}

@keyframes tooltipSwap {
  0% { opacity: 0.55; transform: translateY(2px); }
  100% { opacity: 1; transform: translateY(0); }
}

.chart-tooltip.tooltip-visible {
  transition: opacity 0.16s ease, transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.units-btn.units-flip {
  animation: unitsFlip 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes unitsFlip {
  0% { transform: rotateY(0deg); }
  50% { transform: rotateY(90deg); }
  100% { transform: rotateY(0deg); }
}

.since-last-check.refresh-pulse {
  animation: refreshPulse 0.5s ease;
}

@keyframes refreshPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.status-pill-breathe .status-pill-dot {
  animation: statusDotBreathe 2s ease-in-out infinite;
}

@keyframes statusDotBreathe {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.35); opacity: 1; }
}

.storm-banner.storm-banner-in {
  animation: stormBannerIn 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.storm-banner.storm-banner-out {
  animation: stormBannerOut 0.28s ease forwards;
}

@keyframes stormBannerIn {
  from { opacity: 0; transform: translateY(-100%); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes stormBannerOut {
  to { opacity: 0; transform: translateY(-100%); }
}

.storm-banner-inner {
  position: relative;
}

.storm-banner.storm-banner-in .storm-banner-inner::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  animation: stormEdgeShimmer 1.2s ease 2;
  box-shadow: inset 0 0 0 1px rgba(255, 179, 71, 0.45);
}

@keyframes stormEdgeShimmer {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

body.storm-mode .hero-stat .value.storm-high {
  animation: stormStatPulse 0.65s ease 1;
}

@keyframes stormStatPulse {
  0%, 100% { color: var(--warn); }
  50% { color: #ff8a65; text-shadow: 0 0 12px rgba(255, 107, 74, 0.45); }
}

.radar-map-wrap {
  position: relative;
}

.radar-map-wrap:not(.radar-loaded) .radar-map {
  opacity: 0;
}

.radar-map-wrap.radar-loaded .radar-map {
  animation: radarFadeIn 0.55s ease forwards;
}

@keyframes radarFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

.day-card {
  flex: 0 0 auto;
  width: 92px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.75rem 0.45rem 0.65rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  text-align: center;
  scroll-snap-align: start;
  transition: transform 0.22s ease, background 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
  cursor: pointer;
  animation: riseIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.day-card:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(77, 166, 255, 0.35);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
}

.day-card.today {
  border-color: rgba(77, 166, 255, 0.45);
  box-shadow: 0 0 12px rgba(77, 166, 255, 0.15);
}

.day-date-block,
.day-weather-block,
.day-data-block,
.day-secondary {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.18rem;
  min-width: 0;
}

.day-name {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  margin-bottom: 0;
}

.day-card.today .day-name { color: var(--accent); }

.day-condition {
  display: none;
  min-width: 0;
  max-width: 100%;
  font-size: 0.68rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.day-icon {
  width: 36px;
  height: 36px;
  margin: 0;
  transition: transform 0.25s;
}

.day-temps {
  font-family: var(--mono);
  font-size: 0.82rem;
  margin: 0;
  line-height: 1.2;
}

.day-temps .hi { font-weight: 600; }
.day-temps .lo { color: var(--text-dim); }

.day-precip {
  font-size: 0.62rem;
  color: #4da6ff;
  font-family: var(--mono);
}

.day-precip.dim { color: rgba(232, 237, 245, 0.25); }

.day-date {
  font-size: 0.58rem;
  font-family: var(--mono);
  color: var(--text-dim);
  margin-top: -0.15rem;
}

.day-signal {
  font-size: 0.58rem;
  color: var(--text-dim);
  margin-top: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  font-family: var(--mono);
}

.day-signal.storm { color: #ffb8a8; }
.day-signal.rain { color: #7ec8ff; }
.day-signal.snow { color: #c8dcff; }
.day-signal.uv { color: #ffcf87; }
.day-signal.wind { color: #b9d8ff; }
.day-signal.dry { color: #a8ffd0; }

.day-metrics-mobile { display: none; }

.day-metrics-desktop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.18rem;
  min-width: 0;
}

.day-card.selected {
  background: rgba(77, 166, 255, 0.08);
  border-color: rgba(77, 166, 255, 0.55);
  box-shadow: 0 0 14px rgba(77, 166, 255, 0.2);
  transform: translateY(-1px);
}

/* Day detail panel */
.day-detail-panel {
  margin-top: 1rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  box-shadow: 0 0 32px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow: hidden;
  opacity: 1;
  transition: opacity 0.18s ease;
}

.day-detail-panel.hidden { display: none; }

.detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.15rem 1.35rem 0.85rem;
}

.detail-head h3 {
  font-size: 1.1rem;
  font-weight: 600;
}

.detail-temps {
  display: flex;
  gap: 1.5rem;
  margin-top: 0.4rem;
  flex-wrap: wrap;
}

.detail-temp-item {
  display: flex;
  flex-direction: column;
}

.detail-temp-item .label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.detail-temp-item .value {
  font-family: var(--mono);
  font-size: 1.05rem;
  font-weight: 600;
}

.detail-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.9rem;
  flex-shrink: 0;
  transition: var(--transition);
}

.detail-close:hover {
  border-color: var(--accent);
  color: var(--text);
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--glass-border);
  border-top: 1px solid var(--glass-border);
}

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

.detail-half {
  background: rgba(10, 14, 23, 0.55);
  padding: 1.15rem 1.35rem;
}

.detail-half.night { background: rgba(8, 10, 20, 0.75); }

.half-head {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.half-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  border: 1px solid var(--glass-border);
  color: var(--text-dim);
}

.half-badge.day {
  color: #ffb347;
  border-color: rgba(255, 179, 71, 0.35);
  background: rgba(255, 179, 71, 0.08);
}

.half-badge.night {
  color: #9eb4ff;
  border-color: rgba(123, 156, 255, 0.35);
  background: rgba(123, 156, 255, 0.08);
}

.half-label {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}

.half-head strong {
  font-size: 0.95rem;
  font-weight: 600;
}

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

.stat-grid .stat {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.stat-grid .stat span {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-dim);
}

.stat-grid .stat strong {
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 500;
}

.detail-astro {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 2.25rem;
  padding: 1rem 1.35rem;
  border-top: 1px solid var(--glass-border);
  background: rgba(10, 14, 23, 0.4);
}

.astro-item {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 72px;
}

.astro-item .label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-dim);
}

.astro-item .value {
  font-family: var(--mono);
  font-size: 0.82rem;
}

@media (max-width: 600px) {
  .hero { grid-template-columns: 1fr; }
  .hero-right { order: -1; }
  .condition-icon { width: 120px; height: 120px; }
}

/* ── Tablet (768–1024) ── */
@media (max-width: 1024px) {
  .app { padding: 1rem 1.15rem 2.5rem; }

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

  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── Mobile (<768) ── */
@media (max-width: 768px) {
  /*
   * Mobile type scale (Jul 2026 readability pass)
   * Root was 15px (smaller than desktop); now 16.5px for a gentle global lift.
   *
   * Tier guide (rem @ 16.5px root → px):
   *   micro   0.625rem → ~10.3px  (nav pills, meta, date chips)
   *   xs      0.66rem  → ~10.9px  (stat labels, precip/wind tags)
   *   sm      0.72rem  → ~11.9px  (panel subs, day names, legends)
   *   base    0.86rem  → ~14.2px  (body copy, insights)
   *   md      1rem     → ~16.5px  (panel titles, temps)
   *   lg      1.4rem   → ~23.1px  (hero title)
   *   display clamp    → hero temp (unchanged)
   */
  html { font-size: 16.5px; }

  .panel-sub { font-size: 0.72rem; }

  .section-pill { font-size: 0.625rem; }

  .footer { font-size: 0.76rem; }

  .hc-time { font-size: 0.7rem; }
  .hc-precip { font-size: 0.66rem; }
  .hc-wind { font-size: 0.64rem; }
  .hc-tag { font-size: 0.56rem; }
  .hc-alt { font-size: 0.58rem; }

  .metric .label { font-size: 0.66rem; }
  .metric-footer { font-size: 0.72rem; }

  .app {
    padding: 0.85rem 1rem calc(2rem + env(safe-area-inset-bottom));
    padding-top: calc(0.85rem + env(safe-area-inset-top));
  }

  /* Top bar: brand + actions row 1, search row 2 */
  .top-bar {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    row-gap: 0.65rem;
    column-gap: 0.85rem;
    margin-bottom: 0.85rem;
  }

  .top-bar .brand {
    grid-row: 1;
    grid-column: 1;
    justify-self: start;
    min-width: 0;
  }

  .top-bar .header-end {
    grid-row: 1;
    grid-column: 2;
  }

  .top-bar .header-search {
    grid-row: 2;
    grid-column: 1 / -1;
    max-width: none;
    width: 100%;
    justify-self: stretch;
  }

  .header-clock .mono { font-size: 1rem; }

  /* Sticky bar mobile */
  .sticky-rail {
    padding: 0.45rem 1rem;
    padding-top: calc(0.45rem + env(safe-area-inset-top));
    column-gap: 0.75rem;
  }

  .sticky-icon { width: 28px; height: 28px; }

  .sticky-temp { font-size: 1.15rem; }

  .sticky-loc strong {
    font-size: 0.8rem;
    max-width: 140px;
  }

  .sticky-loc span {
    font-size: 0.66rem;
    max-width: 140px;
  }

  .sticky-weather { gap: 0.55rem; }

  .header-clock .date-label,
  .sticky-rail .header-clock .date-label {
    font-size: 0.625rem;
  }

  /* Alert drawer: edge-to-edge */
  .alert-drawer {
    top: calc(var(--header-rail-h) + 0.5rem + env(safe-area-inset-top));
    left: 0.75rem;
    right: 0.75rem;
    width: auto;
    max-height: calc(100vh - 80px - env(safe-area-inset-bottom));
  }

  /* Location chips: horizontal scroll */
  .loc-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    padding-bottom: 0.35rem;
    margin-bottom: 0.75rem;
    mask-image: linear-gradient(90deg, transparent, #000 8px, #000 calc(100% - 24px), transparent);
  }

  .loc-chips::-webkit-scrollbar { display: none; }

  .chip { scroll-snap-align: start; flex-shrink: 0; }

  .chip .chip-x { opacity: 1; }

  /* Hero */
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    gap: 1rem;
    padding: 1.15rem;
    padding-bottom: 1.15rem;
  }

  .hero-right {
    order: -1;
    flex-direction: row;
    justify-content: center;
    width: 100%;
  }

  .radar-map { height: 280px; }

  .hero-meta-row {
    margin-top: 0.15rem;
    padding-top: 0.55rem;
    gap: 0.5rem;
  }

  .hero-meta-row .location-swipe-indicator,
  .hero-meta-row .since-last-check {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    font-size: 0.625rem;
    opacity: 0.68;
    line-height: 1.35;
    max-width: calc(50% - 0.25rem);
  }

  .location-row {
    flex-wrap: nowrap;
    gap: 0.5rem;
  }

  .hero h1 {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 1.4rem;
    word-break: normal;
  }

  .temp-main { font-size: clamp(3.25rem, 16vw, 5rem); }

  .hero-stats {
    gap: 0.48rem;
    max-width: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-top: 1rem;
    margin-bottom: 0.85rem;
    padding-bottom: 0.15rem;
  }

  .hero-stat {
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .hero-stat .label {
    font-size: 0.58rem;
    letter-spacing: 0.09em;
    margin-bottom: 0.16rem;
    color: rgba(232, 237, 245, 0.58);
  }

  .hero-stat .value {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.9rem;
  }

  .briefing-headline { font-size: 0.88rem; }
  .briefing-action { font-size: 0.82rem; line-height: 1.45; }

  .radar-panel-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }

  .radar-title {
    min-width: 0;
  }

  #radar-control-toggle {
    display: inline-flex;
    grid-column: 2;
    grid-row: 1;
    margin-top: -0.15rem;
  }

  #section-radar.controls-open #radar-control-toggle {
    border-color: rgba(77, 166, 255, 0.55);
    background: rgba(77, 166, 255, 0.12);
    box-shadow: 0 0 18px rgba(77, 166, 255, 0.16);
  }

  #section-radar.controls-open #radar-control-toggle svg {
    transform: rotate(90deg);
  }

  #section-radar .radar-controls {
    display: grid;
    grid-template-columns: 1fr;
    grid-column: 1 / -1;
    justify-content: stretch;
    width: 100%;
    gap: 0.45rem;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(-0.35rem);
    pointer-events: none;
    margin-top: 0;
    transition: max-height 0.34s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.24s ease, transform 0.34s cubic-bezier(0.22, 1, 0.36, 1), margin-top 0.34s ease;
  }

  #section-radar.controls-open .radar-controls {
    max-height: 72px;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    margin-top: 0.65rem;
  }

  #section-radar .radar-controls .forecast-control-group {
    width: 100%;
    display: grid;
    grid-template-columns: 3.5rem minmax(0, 1fr);
    align-items: center;
    gap: 0.45rem;
    padding: 0.38rem 0.45rem;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.025);
  }

  #section-radar .radar-opacity {
    width: 100%;
  }

  #section-radar .radar-opacity input[type="range"] {
    width: 100%;
    flex: 1;
  }

  .forecast-chart-block {
    overflow-x: hidden;
    max-width: 100%;
  }

  .forecast-chart-block .chart-scroll-wrap {
    overflow-x: hidden;
    touch-action: pan-y;
    max-width: 100%;
  }

  .forecast-chart-block .chart-scroll-wrap.is-wide {
    overflow-x: auto;
    touch-action: pan-x;
    overscroll-behavior-x: contain;
    cursor: grab;
    max-width: 100%;
  }

  .forecast-chart-block .chart-scroll-wrap.is-wide:active {
    cursor: grabbing;
  }

  .forecast-chart-block .chart-scroll-wrap .chart-canvas-wrap {
    min-width: 0;
  }

  .forecast-chart-block .chart-scroll-wrap:not(.is-wide) .chart-canvas-wrap {
    width: 100%;
    max-width: 100%;
  }

  .forecast-chart-block .chart-scroll-wrap:not(.is-wide) canvas {
    max-width: 100%;
  }

  .forecast-chart-block .chart-scroll-wrap.is-wide .chart-canvas-wrap {
    width: auto;
    max-width: none;
  }

  .forecast-chart-block .chart-scroll-wrap.is-wide canvas {
    max-width: none;
  }

  .chart-scrub-pill {
    display: none !important;
  }

  /* Metrics: 2-column grid */
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.55rem;
  }

  .metric { padding: 0.75rem 0.8rem; min-height: 124px; }

  .metric-content { min-height: 68px; max-height: 68px; }

  .wind-compass-wrap,
  .wind-compass-wrap canvas { width: 68px; height: 68px; }

  .pressure-num, .big-val { font-size: 1.5rem; }

  /* Panels */
  .panel { padding: 1.1rem; border-radius: 14px; }

  .panel-head {
    margin-bottom: 0.85rem;
    flex-direction: column;
    align-items: stretch;
  }

  .panel-head h2 { font-size: 1rem; }

  .forecast-panel-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }

  .forecast-title {
    min-width: 0;
  }

  .forecast-control-toggle {
    display: inline-flex;
    grid-column: 2;
    grid-row: 1;
    margin-top: -0.15rem;
  }

  .forecast-timeline-panel.controls-open .forecast-control-toggle {
    border-color: rgba(77, 166, 255, 0.55);
    background: rgba(77, 166, 255, 0.12);
    box-shadow: 0 0 18px rgba(77, 166, 255, 0.16);
  }

  .forecast-timeline-panel.controls-open .forecast-control-toggle svg {
    transform: rotate(90deg);
  }

  .forecast-controls {
    display: grid;
    grid-template-columns: 1fr;
    grid-column: 1 / -1;
    justify-content: stretch;
    width: 100%;
    gap: 0.45rem;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(-0.35rem);
    pointer-events: none;
    margin-top: 0;
    transition: max-height 0.34s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.24s ease, transform 0.34s cubic-bezier(0.22, 1, 0.36, 1), margin-top 0.34s ease;
  }

  .forecast-timeline-panel.controls-open .forecast-controls {
    max-height: 190px;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    margin-top: 0.65rem;
  }

  .forecast-control-group {
    width: 100%;
    display: grid;
    grid-template-columns: 3.5rem minmax(0, 1fr);
    align-items: center;
    gap: 0.45rem;
    padding: 0.38rem 0.45rem;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.025);
  }

  .forecast-control-label {
    font-size: 0.6rem;
  }

  .forecast-range-tabs,
  .chart-toggles,
  .strip-toggles {
    width: 100%;
  }

  .forecast-range-tabs {
    justify-content: stretch;
  }

  .forecast-range-btn {
    flex: 1;
    padding-inline: 0.35rem;
  }

  .chart-toggles,
  .strip-toggles {
    display: grid;
    gap: 0.3rem;
  }

  .strip-toggles { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .chart-toggles { grid-template-columns: repeat(3, minmax(0, 1fr)); }

  .forecast-controls .toggle {
    padding: 0.34rem 0.25rem;
    font-size: 0.7rem;
    text-align: center;
  }

  .chart-scroll-hint {
    display: block;
    font-size: 0.72rem;
  }

  .condition-text { font-size: 1.05rem; }

  .chip { font-size: 0.78rem; }

  .toast { font-size: 0.86rem; }

  .stat span { font-size: 0.66rem; }
  .stat strong { font-size: 0.86rem; }

  .forecast-timeline-panel .chart-canvas-wrap canvas {
    min-height: 268px;
  }

  .nowcast-panel .panel-head {
    margin-bottom: 0.55rem;
  }

  .nowcast-panel .panel-sub {
    font-size: 0.72rem;
  }

  .nowcast-summary {
    align-self: flex-start;
    width: auto;
    margin-top: 0;
    padding: 0.18rem 0;
    border: 0;
    background: transparent;
    font-size: 0.72rem;
    text-align: left;
    color: rgba(232, 237, 245, 0.58);
  }

  .nowcast-insight {
    margin: -0.15rem 0 0.55rem;
    padding: 0;
    border-radius: 0;
    background: transparent;
    border: 0;
    font-size: 0.86rem;
    color: var(--text);
  }

  .nowcast-chart-wrap {
    padding: 0.35rem 0.1rem 0.15rem;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012));
    border: 1px solid rgba(255, 255, 255, 0.055);
  }

  #nowcast-chart {
    min-height: 148px;
  }

  #nowcast-legend.chart-legend {
    gap: 0.45rem;
    flex-wrap: wrap;
    margin-top: 0.6rem;
  }

  #nowcast-legend .legend-item {
    padding: 0.28rem 0.45rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.68rem;
  }

  .comfort-legend-wrap {
    flex-direction: column;
    gap: 0.55rem;
  }

  .comfort-legend-copy {
    min-width: 0;
  }

  .comfort-legend {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem 0.75rem;
    width: 100%;
    font-size: 0.72rem;
  }

  .legend-item {
    align-items: flex-start;
    gap: 0.35rem;
  }

  .legend-item small {
    display: block;
    margin-left: 0.15rem;
    font-size: 0.625rem;
  }

  /* Hourly strip */
  .hour-card { width: 76px; padding: 0.6rem 0.28rem 0.55rem; }

  .hour-card img { width: 28px; height: 28px; }

  .hc-temp { font-size: 0.9rem; }

  .daily-panel .panel-sub {
    max-width: 18rem;
  }

  .daily-panel .strip-scroll {
    margin: 0;
    padding: 0;
    mask-image: none;
    -webkit-mask-image: none;
  }

  .daily-cards {
    flex-direction: column;
    gap: 0.5rem;
    overflow: visible;
    padding-bottom: 0;
    scroll-snap-type: none;
  }

  .day-card {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(3.8rem, 0.68fr) 2.2rem minmax(0, 1.2fr) minmax(7rem, 1.05fr);
    align-items: center;
    gap: 0.65rem;
    padding: 0.72rem 0.78rem;
    text-align: left;
    scroll-snap-align: none;
    border-radius: 14px;
  }

  .day-card:hover,
  .day-card.selected {
    transform: none;
  }

  .day-card.selected {
    border-radius: 14px 14px 0 0;
  }

  .day-card.today {
    box-shadow: 0 0 18px rgba(77, 166, 255, 0.18);
  }

  .daily-cards > .day-detail-inline {
    width: 100%;
    margin-top: -0.25rem;
    margin-bottom: 0.35rem;
    border-color: rgba(77, 166, 255, 0.62);
    border-radius: 0 0 14px 14px;
    box-shadow: 0 14px 34px rgba(5, 8, 13, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  }

  .day-card.selected + .day-detail-inline {
    transition: opacity 0.18s ease;
  }

  .day-date-block,
  .day-weather-block,
  .day-data-block,
  .day-secondary {
    align-items: flex-start;
  }

  .day-weather-block {
    display: contents;
  }

  .day-name {
    font-size: 0.72rem;
  }

  .day-date {
    margin-top: 0;
    font-size: 0.64rem;
  }

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

  .day-condition {
    display: block;
    font-size: 0.76rem;
    color: rgba(232, 237, 245, 0.82);
  }

  .day-data-block {
    align-items: flex-end;
    text-align: right;
  }

  .day-temps {
    font-size: 0.94rem;
  }

  .day-secondary {
    flex-direction: row;
    justify-content: flex-end;
    align-items: center;
    gap: 0.45rem;
    width: 100%;
  }

  .day-metrics-mobile {
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    align-items: center;
    gap: 0.45rem;
    width: 100%;
  }

  .day-metrics-desktop {
    display: none;
  }

  .day-precip,
  .day-signal {
    font-size: 0.66rem;
  }

  .day-metrics-mobile .day-signal {
    max-width: none;
  }

  /* Day detail */
  .detail-head { padding: 1rem; flex-direction: column; }

  .detail-temps { gap: 0.85rem; }

  .detail-half { padding: 1rem; }

  .stat-grid { grid-template-columns: repeat(2, 1fr); }

  .detail-astro { gap: 1rem 1.25rem; padding: 0.85rem 1rem; }

  /* Touch targets */
  .icon-btn {
    width: 44px;
    height: 44px;
  }

  .toggle {
    padding: 0.45rem 0.85rem;
    min-height: 36px;
  }

  .save-btn { width: 38px; height: 38px; }

  /* Toast above bottom nav + home indicator */
  .toast {
    bottom: calc(1.25rem + env(safe-area-inset-bottom));
    max-width: calc(100vw - 2rem);
    text-align: center;
  }

  body.chrome-sticky .toast {
    bottom: calc(var(--bottom-nav-h, 56px) + 0.85rem + env(safe-area-inset-bottom));
  }
}

/* ── Small phones (<480) ── */
@media (max-width: 480px) {
  :root { --header-clock-w: 4.25rem; }

  .brand-tag { display: none !important; }

  .sticky-loc strong,
  .sticky-loc span { max-width: 100px; }

  .header-end { gap: 0.5rem; }

  .header-clock {
    padding-left: 0.65rem;
    min-width: 3.75rem;
  }

  .metrics-grid {
    grid-template-columns: 1fr 1fr;
  }

  .hero-right { align-items: flex-start; }

  .condition-icon { width: 100px; height: 100px; }

  .header-clock .date-label,
  .sticky-rail .header-clock .date-label { display: none; }
}

@media (display-mode: standalone) {
  .app {
    padding-top: calc(1rem + env(safe-area-inset-top));
  }
}

/* ── Touch devices ── */
@media (hover: none) and (pointer: coarse) {
  .panel:hover { border-color: var(--glass-border); }

  .metrics-grid .metric:hover {
    transform: none;
    box-shadow: none;
  }

  .day-card:hover, .hour-card:hover {
    transform: none;
  }

  .chip .chip-x { opacity: 1; }
}


/* Toast */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 90;
  padding: 0.75rem 1.35rem;
  border-radius: 999px;
  background: rgba(15, 20, 35, 0.95);
  border: 1px solid rgba(255, 107, 74, 0.45);
  color: var(--text);
  font-size: 0.85rem;
  backdrop-filter: blur(16px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  animation: toastSpring 0.42s cubic-bezier(0.22, 1.45, 0.36, 1);
}

@keyframes toastSpring {
  0% { transform: translateX(-50%) translateY(20px); opacity: 0; }
  65% { transform: translateX(-50%) translateY(-3px); opacity: 1; }
  100% { transform: translateX(-50%) translateY(0); opacity: 1; }
}

.footer {
  margin-top: 2rem;
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-dim);
}

.footer a { color: var(--accent); text-decoration: none; }
.footer a:hover { text-decoration: underline; }

.alert-attribution { margin-top: 0.35rem; }

/* —— Premium UX: storm mode, skeleton, scrubber, offline —— */
.storm-banner {
  margin-bottom: 0.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 107, 74, 0.45);
  background: linear-gradient(135deg, rgba(255, 51, 85, 0.18), rgba(255, 107, 74, 0.1));
  box-shadow: 0 8px 32px rgba(255, 51, 85, 0.15);
  cursor: pointer;
}

.storm-banner.hidden { display: none; }

.storm-banner-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
}

.storm-banner-icon {
  font-size: 1.25rem;
  filter: drop-shadow(0 0 8px rgba(255, 179, 71, 0.6));
}

.storm-banner-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.78rem;
}

.storm-banner-text strong {
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #ffb8a8;
}

.storm-banner-btn {
  flex-shrink: 0;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
}

body.storm-mode .storm-collapsible { display: none !important; }

body.storm-mode .dashboard .hero { order: 1; }
body.storm-mode .dashboard #section-nowcast { order: 2; }
body.storm-mode .dashboard #section-radar { order: 3; }
body.storm-mode .dashboard #section-hourly { order: 4; }

body.storm-mode .section-pill[href="#section-daily"] {
  display: none;
}

body.storm-mode .hero {
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}

body.storm-mode .condition-icon {
  width: 120px !important;
  height: 120px !important;
}

/* Geo / my-location button (toolbar legacy + search adjunct) */

/* Skeleton loading */
.data-skeleton {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
  opacity: 1;
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.data-skeleton.hidden { display: none; }

.data-skeleton.skeleton-exit {
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
}

body.data-loading .dashboard {
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
}

.dashboard.dashboard-reveal {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.38s cubic-bezier(0.22, 1, 0.36, 1), transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

.skel-block {
  min-height: 120px;
  border-radius: var(--radius);
  border: 1px solid var(--glass-border);
  background: linear-gradient(
    110deg,
    rgba(255, 255, 255, 0.03) 25%,
    rgba(255, 255, 255, 0.08) 45%,
    rgba(255, 255, 255, 0.03) 65%
  );
  background-size: 220% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
}

.skel-hero { min-height: 200px; }
.skel-short { min-height: 80px; }

@keyframes shimmer {
  0% { background-position: 120% 0; }
  100% { background-position: -120% 0; }
}

body.refreshing-data .hero .temp-main,
body.refreshing-data .hero #condition-text {
  opacity: 0.45;
}

body.refreshing-data .hero::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,0.04) 50%, transparent 70%);
  background-size: 200% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
  pointer-events: none;
}

body.refreshing-data .hero { position: relative; overflow: hidden; }

/* Chart scrubber pill (mobile + drag) */
.chart-scrub-pill {
  position: fixed;
  left: 50%;
  bottom: calc(var(--bottom-nav-h, 56px) + env(safe-area-inset-bottom) + 0.65rem);
  z-index: 55;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.12rem;
  padding: 0.45rem 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 179, 71, 0.45);
  background: rgba(12, 14, 22, 0.94);
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  font-size: 0.72rem;
  pointer-events: none;
}

.chart-scrub-pill.hidden { display: none; }

.chart-scrub-pill #chart-scrub-time {
  font-weight: 700;
  font-size: 0.82rem;
  color: #ffb347;
}

.chart-scrub-pill #chart-scrub-detail {
  color: var(--text-dim);
  font-size: 0.68rem;
}

.nowcast-chart-wrap { margin-bottom: 0; }

@media (min-width: 769px) {
  .chart-scrub-pill { bottom: 1rem; }
}
