/* =========================================================
   Atmosphere — Dark App UI (mockup-inspired)
   ========================================================= */

:root {
  --bg: #070708;
  --bg-elev: #121216;
  --bg-card: #17171c;
  --bg-card-2: #1c1c22;
  --stroke: rgba(255, 255, 255, 0.06);
  --stroke-strong: rgba(255, 255, 255, 0.12);

  --text: #f5f5f7;
  --text-dim: #9a9aa3;
  --text-mute: #6b6b75;

  --blue: #2d8cff;
  --blue-glow: rgba(45, 140, 255, 0.55);
  --yellow: #f5c518;
  --danger: #ff6b6b;
  --ok: #3dd68c;

  --accent: var(--blue);
  --accent-strong: #1a6fe0;
  --accent-soft: rgba(45, 140, 255, 0.16);

  --aqi-1: #3dd68c;
  --aqi-2: #a3e635;
  --aqi-3: #f5c518;
  --aqi-4: #fb923c;
  --aqi-5: #ff6b6b;

  --radius: 28px;
  --radius-md: 22px;
  --radius-sm: 16px;
  --radius-full: 999px;

  --shadow-neu:
    8px 8px 24px rgba(0, 0, 0, 0.55),
    -4px -4px 16px rgba(255, 255, 255, 0.03);
  --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  --glow-blue: 0 0 0 1px rgba(45, 140, 255, 0.45), 0 0 28px var(--blue-glow);

  --font: "DM Sans", system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 240ms;
  --max: 1440px;
  --phone: 420px;
}

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

html {
  scroll-behavior: smooth;
  height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  min-height: 100dvh;
  width: 100%;
  max-width: 100%;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
}

img { max-width: 100%; display: block; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
ul { list-style: none; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  top: -100px; left: 1rem; z-index: 1000;
  padding: 0.7rem 1rem;
  background: var(--blue);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 600;
}
.skip-link:focus { top: 1rem; }

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

/* FX backdrop — covers viewport without 100vw overflow seam */
.weather-fx {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.fx-layer { position: absolute; inset: 0; }
.fx-gradient {
  background:
    radial-gradient(ellipse 70% 45% at 50% 0%, rgba(45, 140, 255, 0.14), transparent 55%),
    radial-gradient(ellipse 50% 40% at 80% 80%, rgba(245, 197, 24, 0.05), transparent 50%),
    linear-gradient(180deg, #0a0a0e 0%, #070708 55%, #050506 100%);
  transition: background 0.8s var(--ease);
}

/* Shell — full viewport width */
.app-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: none;
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding:
    0
    max(clamp(1rem, 3vw, 2.5rem), env(safe-area-inset-left))
    calc(5.5rem + env(safe-area-inset-bottom))
    max(clamp(1rem, 3vw, 2.5rem), env(safe-area-inset-right));
}

/* Modern top navigation */
.navbar {
  position: sticky;
  top: 0;
  z-index: 80;
  width: 100%;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--bg) 88%, transparent), color-mix(in srgb, var(--bg) 72%, transparent)),
    radial-gradient(ellipse 60% 120% at 8% 0%, rgba(45, 140, 255, 0.16), transparent 55%);
  backdrop-filter: blur(22px) saturate(1.2);
  -webkit-backdrop-filter: blur(22px) saturate(1.2);
  border-bottom: 1px solid color-mix(in srgb, var(--stroke) 80%, transparent);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.18);
}
.navbar-inner {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  margin: 0 auto;
  padding: 0.8rem clamp(0.85rem, 3vw, 2.5rem);
}
.navbar-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
  flex: 1;
}
.navbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text) !important;
  text-decoration: none !important;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}
.navbar-brand:hover {
  text-decoration: none !important;
  color: var(--text) !important;
}
.brand-mark {
  position: relative;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}
.brand-orb {
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 30%, #fff7d1 0%, #ffd34d 42%, #f59e0b 78%, #ea580c 100%);
  box-shadow:
    0 0 16px rgba(251, 191, 36, 0.55),
    0 0 28px rgba(45, 140, 255, 0.25);
  animation: brandOrbPulse 4.5s ease-in-out infinite;
}
.brand-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid transparent;
  background:
    linear-gradient(var(--bg), var(--bg)) padding-box,
    conic-gradient(from 120deg, rgba(45, 140, 255, 0.95), rgba(251, 191, 36, 0.75), rgba(45, 140, 255, 0.2), rgba(45, 140, 255, 0.95)) border-box;
  animation: brandRingSpin 12s linear infinite;
  opacity: 0.9;
}
.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  min-width: 0;
}
.brand-text {
  white-space: nowrap;
  font-size: 1.05rem;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.brand-tag {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.85;
}

.navbar-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0.35rem 0.75rem;
  border-left: 1px solid var(--stroke);
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg-card) 55%, transparent);
}
.navbar-meta[hidden] { display: none !important; }
.navbar-meta .location-name {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 42vw;
}
@media (max-width: 959px) {
  .navbar-left:has(.navbar-meta:not([hidden])) .brand-copy {
    display: none;
  }
  .navbar-left:has(.navbar-meta:not([hidden])) .navbar-meta {
    border-left: 0;
    padding-left: 0.55rem;
  }
}
.navbar-meta .status-pill,
.navbar-meta .topbar-time {
  font-size: 0.72rem;
  margin-top: 0.1rem;
}

/* Desktop-only link row — hidden on mobile (bottom tabs handle that) */
.navbar-menu {
  display: none;
}
.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.48rem 0.9rem;
  border-radius: 999px;
  color: var(--text-dim);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--dur), background var(--dur), box-shadow var(--dur), transform var(--dur);
}
.nav-link:hover {
  color: var(--text);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.06);
}
.nav-link.is-active {
  color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent);
}

.navbar-actions {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}
.topbar-btn {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: var(--text);
  background: linear-gradient(160deg, var(--bg-card-2), var(--bg-card));
  border: 1px solid var(--stroke);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.16);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur), border-color var(--dur);
}
.topbar-btn:hover {
  background: var(--bg-card-2);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--stroke));
  box-shadow: var(--glow-blue);
  transform: translateY(-1px);
}
.topbar-btn:active { transform: scale(0.94); }

.topbar-center {
  text-align: center;
  min-width: 0;
}

.location-line {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 100%;
}
.pin-icon { color: var(--blue); flex-shrink: 0; }
.location-name {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.2rem;
  padding: 0.15rem 0.65rem;
  border-radius: var(--radius-full);
  background: rgba(245, 197, 24, 0.1);
  color: var(--yellow);
  font-size: 0.72rem;
  font-weight: 600;
}
.status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 8px var(--yellow);
  animation: statusPulse 1.2s ease-in-out infinite;
}
.status-pill[hidden], .topbar-time[hidden] { display: none !important; }
.topbar-time {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.72rem;
  color: var(--text-mute);
}

.mode-toggle .icon-sun[hidden],
.mode-toggle .icon-moon[hidden],
.mode-toggle .icon-system[hidden] {
  display: none !important;
}

.more-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 160px;
  padding: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--stroke-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-neu);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.more-menu[hidden] { display: none !important; }
.more-item {
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  color: var(--text);
  font-weight: 500;
  font-size: 0.9rem;
  transition: background var(--dur);
}
.more-item:hover { background: var(--accent-soft); }
.more-units {
  display: flex;
  gap: 0.25rem;
  padding: 0.35rem;
  margin-top: 0.25rem;
  background: var(--bg-elev);
  border-radius: 12px;
}
.unit-btn {
  flex: 1;
  padding: 0.45rem;
  border-radius: 10px;
  font-weight: 700;
  color: var(--text-dim);
  transition: background var(--dur), color var(--dur), box-shadow var(--dur);
}
.unit-btn.active {
  background: var(--accent-soft);
  color: var(--blue);
  box-shadow: 0 0 12px rgba(45, 140, 255, 0.25);
}

/* Search */
.search-strip {
  position: relative;
  z-index: 30;
  margin-bottom: 0.75rem;
}
.search-field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.3rem 0.3rem 0.95rem;
  background: var(--bg-card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-neu);
  transition: box-shadow var(--dur), border-color var(--dur);
}
.search-field:focus-within {
  border-color: rgba(45, 140, 255, 0.5);
  box-shadow: var(--glow-blue);
}
.search-icon { color: var(--text-mute); flex-shrink: 0; }
#searchInput {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  padding: 0.55rem 0.2rem;
}
#searchInput::placeholder { color: var(--text-mute); }

.search-suggestions {
  position: absolute;
  left: 0; right: 0;
  top: calc(100% + 6px);
  z-index: 60;
  background: var(--bg-card);
  border: 1px solid var(--stroke-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-neu);
  max-height: 260px;
  overflow-y: auto;
  padding: 0.4rem;
}
.search-suggestions[hidden] { display: none !important; }
.suggestion-item {
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  text-align: left;
  transition: background var(--dur), transform var(--dur);
}
.suggestion-item:hover,
.suggestion-item.is-active {
  background: var(--accent-soft);
  transform: translateX(2px);
}
.suggestion-item.is-active {
  outline: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
}
.suggestion-city { font-weight: 600; }
.suggestion-country { font-size: 0.85rem; color: var(--text-dim); }
.search-status {
  min-height: 1.1em;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: var(--text-dim);
  padding-left: 0.5rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.875rem;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur), background var(--dur);
}
.btn:active { transform: scale(0.96); }
.btn-glow {
  background: linear-gradient(135deg, #4da3ff, var(--blue));
  color: #fff;
  box-shadow: 0 8px 24px rgba(45, 140, 255, 0.35);
}
.btn-glow:hover { box-shadow: 0 10px 28px rgba(45, 140, 255, 0.5); }
.btn-soft {
  background: var(--bg-card-2);
  color: var(--text);
  border: 1px solid var(--stroke-strong);
}
.btn-soft:hover { border-color: var(--blue); color: var(--blue); }
.btn-text {
  color: var(--text-dim);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 0.4rem;
}
.btn-text:hover { color: var(--blue); }

/* Main — full available width (no phone frame) */
.main {
  flex: 1;
  width: 100%;
  max-width: none;
  margin: 0;
}

.alert-region {
  margin-bottom: 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 107, 107, 0.1);
  border: 1px solid rgba(255, 107, 107, 0.35);
  color: #ffc9c9;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  animation: slideDown 0.35s var(--ease);
}
.alert-region[hidden] { display: none !important; }

/* Empty */
.empty-state {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 0;
  padding: 0.5rem 0 1.25rem;
}
.empty-card {
  text-align: center;
  padding: 1.75rem 1.35rem;
  width: 100%;
  max-width: min(560px, 100%);
}
.empty-visual {
  position: relative;
  height: 90px;
  margin-bottom: 1.25rem;
}
.orb {
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.orb-a {
  width: 70px; height: 70px;
  background: radial-gradient(circle at 30% 30%, #6bb3ff, var(--blue));
  box-shadow: 0 0 40px var(--blue-glow);
  animation: orbPulse 3.5s ease-in-out infinite;
}
.orb-b {
  width: 110px; height: 110px;
  border: 1px solid rgba(45, 140, 255, 0.25);
  animation: orbRing 4s ease-in-out infinite;
}
.empty-card h2 {
  font-size: clamp(1.4rem, 5vw, 1.85rem);
  letter-spacing: -0.03em;
  margin-bottom: 0.6rem;
}
.empty-card p {
  color: var(--text-dim);
  margin-bottom: 1.4rem;
  font-size: 0.95rem;
}
.empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
  margin-top: 1rem;
}
.empty-actions[hidden] { display: none !important; }

.api-key-form {
  text-align: left;
  margin-top: 1.25rem;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
}
.api-key-form label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 0.45rem;
}
.api-key-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.api-key-row input {
  flex: 1;
  min-width: 140px;
  padding: 0.6rem 0.85rem;
  background: var(--bg-elev);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-full);
  outline: none;
  transition: border-color var(--dur), box-shadow var(--dur);
}
.api-key-row input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.api-key-hint {
  margin-top: 0.65rem;
  font-size: 0.75rem;
  color: var(--text-mute);
  line-height: 1.4;
}
.api-key-status {
  margin-top: 0.45rem;
  min-height: 1.2em;
  font-size: 0.8rem;
  color: var(--ok);
}
.api-key-status.is-error { color: var(--danger); }

/* Neu card */
.neu {
  background: linear-gradient(160deg, #1a1a20 0%, #131317 100%);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow-neu), var(--shadow-inset);
}

/* Skeleton */
.skeleton-state { padding: 0.5rem 0; }
.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--bg-card);
}
.pulse-skel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
  animation: shimmer 1.3s ease-in-out infinite;
}

.dashboard[hidden],
.skeleton-state[hidden],
.empty-state[hidden],
#refreshBtn[hidden],
.modal[hidden],
.compare-result[hidden],
.panel-empty[hidden],
.tooltip[hidden],
.screen[hidden] {
  display: none !important;
}

/* Multi-page views */
.page {
  animation: screenIn 0.35s var(--ease) both;
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
}
.page[hidden] { display: none !important; }
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.page-title {
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}
.page-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

/* Mobile bottom nav */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 70;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.1rem;
  padding: 0.35rem 0.35rem calc(0.35rem + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg-elev) 96%, transparent);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--stroke);
  border-radius: 0;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.12);
}
.bottom-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  min-height: 52px;
  padding: 0.3rem 0.1rem;
  border-radius: 12px;
  color: var(--text-mute);
  text-decoration: none;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.bottom-link svg {
  flex-shrink: 0;
}
.bottom-link:hover {
  text-decoration: none;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.04);
}
.bottom-link.is-active {
  color: var(--accent);
  background: var(--accent-soft);
}

.more-link {
  display: block;
  text-decoration: none;
  color: inherit;
}
.more-link:hover { text-decoration: none; }

/* Hero */
.hero {
  position: relative;
  text-align: center;
  padding: 0.5rem 0 1.25rem;
}
.hero-day-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.45rem;
  padding: 0.35rem 0.95rem;
  border-radius: var(--radius-full);
  background: var(--accent-soft);
  color: var(--blue);
  max-width: min(92vw, 420px);
  text-align: center;
  line-height: 1.3;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
  transition: background var(--dur), color var(--dur), transform var(--dur);
}
.hero-glow {
  position: absolute;
  left: 50%;
  top: 20%;
  width: 220px;
  height: 220px;
  transform: translate(-50%, -30%);
  background: radial-gradient(circle, rgba(45, 140, 255, 0.22), transparent 65%);
  filter: blur(8px);
  pointer-events: none;
  animation: glowBreathe 5s ease-in-out infinite;
}
.hero-burst {
  position: absolute;
  left: 50%;
  top: 28%;
  width: 200px;
  height: 200px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0;
  z-index: 2;
}
.hero-icon-wrap {
  position: relative;
  width: 150px;
  height: 150px;
  margin: 0 auto 0.25rem;
  z-index: 1;
  display: grid;
  place-items: center;
}
.hero-icon-plate {
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.14) 0%,
    rgba(255, 255, 255, 0.04) 50%,
    transparent 72%
  );
  pointer-events: none;
  z-index: 0;
}
body[data-mode="light"] .hero-icon-plate {
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.55) 0%,
    rgba(210, 225, 255, 0.2) 50%,
    transparent 74%
  );
}
/* Clear-night icon is already luminous — don't put a grey disc behind it */
.hero-icon-wrap.is-clear-night .hero-icon-plate {
  opacity: 0;
}
.hero-icon {
  position: relative;
  width: 150px;
  height: 150px;
  object-fit: contain;
  filter: drop-shadow(0 14px 24px rgba(0, 0, 0, 0.35)) drop-shadow(0 0 18px rgba(45, 140, 255, 0.2));
  z-index: 1;
}
.hero-icon-custom {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 2;
  pointer-events: none;
}
.hero-icon-custom[hidden] {
  display: none !important;
}
.hero-mark {
  width: 118px;
  height: 118px;
  display: none;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.28));
}
.hero-icon-wrap.is-clear-day .hero-mark--sun {
  display: block;
}
.hero-icon-wrap.is-clear-night .hero-mark--moon {
  display: block;
}
.hero-icon-wrap.is-clear-day .hero-mark-rays {
  transform-origin: 60px 60px;
  animation: heroSunSpin 28s linear infinite;
}
@keyframes heroSunSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.hero-icon-wrap.icon-out {
  opacity: 0;
  transform: scale(0.85) translateY(8px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}
.hero-icon-wrap.icon-pop {
  animation: iconPop 0.55s var(--ease);
}
.hero-temp {
  font-size: clamp(4rem, 18vw, 5.5rem);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 0.95;
  margin-top: -0.35rem;
}
.hero-temp .deg {
  font-size: 0.45em;
  font-weight: 500;
  vertical-align: super;
  color: var(--text-dim);
}
.hero-desc {
  margin-top: 0.35rem;
  font-size: 1.15rem;
  color: var(--text-dim);
  text-transform: capitalize;
  font-weight: 500;
}
.hero-feels {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--text-mute);
}
.hero-feels .sep { margin: 0 0.3rem; opacity: 0.5; }
.country-line {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--text-mute);
}

/* Metrics */
.metrics-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  padding: 1rem 0.5rem;
  margin-bottom: 1.25rem;
  transition: transform var(--dur), box-shadow var(--dur);
  overflow: hidden;
}
.metrics-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-neu), 0 0 30px rgba(45, 140, 255, 0.12);
}
.metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.25rem;
  cursor: help;
}
.metric-icon {
  color: var(--text-dim);
  margin-bottom: 0.15rem;
  transition: color var(--dur), transform var(--dur);
}
.metric:hover .metric-icon {
  color: var(--blue);
  transform: translateY(-2px);
}
.metric strong {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.metric span:last-child {
  font-size: 0.72rem;
  color: var(--text-mute);
}
.metric-divider {
  width: 1px;
  height: 36px;
  background: var(--stroke-strong);
}

.metrics-mini {
  grid-column: 1 / -1;
  margin: 0.85rem 0 0;
  padding: 0.75rem 0.35rem;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--stroke);
  box-shadow: none;
}
.metrics-mini:hover { transform: none; box-shadow: none; }
.metrics-mini .metric strong { font-size: 0.9rem; }

/* Today / hourly */
.today-block { margin-bottom: 1rem; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}
.section-head h2 {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.link-forecast {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  color: var(--text-dim);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.35rem 0.5rem;
  border-radius: 10px;
  transition: color var(--dur), background var(--dur);
}
.link-forecast:hover {
  color: var(--blue);
  background: var(--accent-soft);
  text-decoration: none;
}

.hourly-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.5rem 0.15rem 0.75rem;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}
.hourly-list {
  display: flex;
  gap: 0.75rem;
  min-width: min-content;
}
.hourly-item {
  flex: 0 0 auto;
  width: 72px;
  padding: 0.95rem 0.4rem;
  text-align: center;
  border-radius: 22px;
  background: var(--bg-card);
  border: 1px solid var(--stroke);
  scroll-snap-align: center;
  cursor: pointer;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur), background var(--dur), border-color var(--dur);
}
.hourly-item:hover {
  transform: translateY(-4px);
  border-color: rgba(45, 140, 255, 0.35);
}
.hourly-item.is-active {
  background: linear-gradient(180deg, #1a3a66 0%, #152a4a 100%);
  border-color: rgba(45, 140, 255, 0.65);
  box-shadow: var(--glow-blue);
  transform: translateY(-4px) scale(1.04);
}
.hourly-temp {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
}
.hourly-icon {
  width: 42px;
  height: 42px;
  margin: 0 auto 0.35rem;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,0.4));
  transition: transform 0.35s var(--ease);
}
.hourly-item:hover .hourly-icon,
.hourly-item.is-active .hourly-icon {
  transform: scale(1.08);
}
.hourly-time {
  font-size: 0.72rem;
  color: var(--text-mute);
  font-weight: 500;
}
.hourly-item.is-active .hourly-time { color: #b8d9ff; }
.hourly-pop {
  margin-top: 0.25rem;
  font-size: 0.65rem;
  color: var(--blue);
  font-weight: 600;
}

.trend-wrap {
  height: 40px;
  opacity: 0.55;
  margin-top: 0.15rem;
}
.temp-trend { width: 100%; height: 100%; }
.temp-trend path {
  fill: none;
  stroke: var(--blue);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.temp-trend .trend-area {
  fill: url(#trendFill);
  stroke: none;
  opacity: 0.35;
}

.quick-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0.5rem 0 1.5rem;
}
.quick-chip {
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--stroke);
  color: var(--text-dim);
  font-size: 0.8rem;
  font-weight: 600;
  transition: background var(--dur), color var(--dur), box-shadow var(--dur), transform var(--dur);
}
.quick-chip:hover {
  color: var(--blue);
  box-shadow: var(--glow-blue);
  transform: translateY(-2px);
}

/* Forecast screen */
.forecast-top {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  margin-bottom: 1rem;
}
.forecast-title {
  text-align: center;
  font-size: 1.15rem;
  font-weight: 700;
}
.cal-icon {
  display: grid;
  place-items: center;
  color: var(--text-dim);
}

.tomorrow-card {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "copy icon"
    "metrics metrics";
  gap: 0.5rem 1rem;
  padding: 1.25rem 1.15rem 1rem;
  margin-bottom: 1rem;
  position: relative;
  overflow: hidden;
  transition: transform var(--dur), box-shadow var(--dur), border-color var(--dur);
}
.tomorrow-card.forecast-hero {
  padding: 1.35rem 1.25rem 1.1rem;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--stroke));
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--accent-soft) 70%, transparent), transparent 55%),
    var(--bg-card);
}
.forecast-hero-glow {
  position: absolute;
  inset: auto -18% -45% auto;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(45, 140, 255, 0.28), transparent 68%);
  pointer-events: none;
  animation: forecastGlow 5s ease-in-out infinite;
}
.tomorrow-card.is-interactive {
  cursor: pointer;
}
.tomorrow-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-neu), 0 0 36px rgba(45, 140, 255, 0.15);
}
.tomorrow-card.is-selected,
.tomorrow-card:focus-visible {
  border-color: rgba(45, 140, 255, 0.55);
  box-shadow: var(--glow-blue);
}
.tomorrow-card.hero-pulse {
  animation: forecastHeroPulse 0.55s var(--ease);
}
.tomorrow-card::before {
  content: "";
  position: absolute;
  inset: auto -20% -40% auto;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(45, 140, 255, 0.2), transparent 70%);
  pointer-events: none;
}
.tomorrow-copy { grid-area: copy; position: relative; z-index: 1; }
.tomorrow-label {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}
.tomorrow-temps {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.tomorrow-temps .slash {
  color: var(--text-mute);
  margin: 0 0.15rem;
  font-weight: 500;
}
.tomorrow-desc {
  margin-top: 0.35rem;
  color: var(--text-dim);
  text-transform: capitalize;
  font-size: 0.95rem;
}
.forecast-hero-feels {
  margin-top: 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
}
.tomorrow-icon {
  grid-area: icon;
  width: 96px;
  height: 96px;
  filter: drop-shadow(0 12px 20px rgba(0,0,0,0.45));
  position: relative;
  z-index: 1;
}
.forecast-hero .tomorrow-icon {
  width: 112px;
  height: 112px;
}
#featuredMetrics { grid-area: metrics; }

/* Daily list */
.daily-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.daily-item {
  display: grid;
  grid-template-columns: 3.2rem 2.6rem 1fr auto;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--stroke);
  transition: transform var(--dur), box-shadow var(--dur), border-color var(--dur), background var(--dur);
  animation: listIn 0.4s var(--ease) both;
}
.daily-item:nth-child(1) { animation-delay: 0.05s; }
.daily-item:nth-child(2) { animation-delay: 0.1s; }
.daily-item:nth-child(3) { animation-delay: 0.15s; }
.daily-item:nth-child(4) { animation-delay: 0.2s; }
.daily-item:nth-child(5) { animation-delay: 0.25s; }
.daily-item {
  cursor: pointer;
}
.daily-item:hover {
  transform: translateX(4px);
  border-color: rgba(45, 140, 255, 0.35);
  box-shadow: 0 0 20px rgba(45, 140, 255, 0.12);
  background: var(--bg-card-2);
}
.daily-item.is-active {
  border-color: rgba(45, 140, 255, 0.65);
  background: linear-gradient(135deg, rgba(45, 140, 255, 0.16), rgba(45, 140, 255, 0.05));
  box-shadow: var(--glow-blue);
  transform: translateX(4px);
}
.daily-day {
  font-weight: 700;
  font-size: 0.95rem;
}
.daily-date {
  display: block;
  font-size: 0.7rem;
  color: var(--text-mute);
  font-weight: 500;
}
.daily-icon {
  width: 40px;
  height: 40px;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,0.35));
  transition: transform 0.35s var(--ease);
}
.daily-item:hover .daily-icon { transform: scale(1.12) rotate(-4deg); }
.daily-desc {
  font-size: 0.9rem;
  color: var(--text-dim);
  text-transform: capitalize;
}
.daily-pop {
  font-size: 0.7rem;
  color: var(--blue);
  font-weight: 600;
}
.daily-temps {
  text-align: right;
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
}
.daily-temps .lo {
  color: var(--text-mute);
  font-weight: 500;
  margin-left: 0.45rem;
}

/* Extras */
.extras {
  margin-top: 1.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--stroke);
}
.extras-grid {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.panel {
  padding: 1.15rem 1.1rem;
  transition: transform var(--dur), box-shadow var(--dur);
}
.panel:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-neu), 0 0 24px rgba(45, 140, 255, 0.08);
}
.panel-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.85rem;
  letter-spacing: -0.02em;
}
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.panel-header .panel-title { margin-bottom: 0; }
.panel-empty {
  font-size: 0.85rem;
  color: var(--text-mute);
}
.last-updated {
  margin-top: 1rem;
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-mute);
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}
.stat-item {
  padding: 0.7rem 0.75rem;
  background: rgba(255,255,255,0.03);
  border-radius: 14px;
  border: 1px solid transparent;
  cursor: help;
  transition: border-color var(--dur), background var(--dur), transform var(--dur);
}
.stat-item:hover {
  border-color: var(--stroke-strong);
  background: rgba(45, 140, 255, 0.08);
  transform: translateY(-2px);
}
.stat-item dt {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-mute);
  margin-bottom: 0.2rem;
}
.stat-item dd { font-weight: 700; font-size: 0.95rem; }

.sun-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}
.sun-item {
  padding: 0.7rem;
  background: rgba(255,255,255,0.03);
  border-radius: 14px;
}
.sun-duration { grid-column: 1 / -1; }
.sun-label {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-mute);
  margin-bottom: 0.2rem;
}
.sun-value { font-weight: 700; font-size: 1rem; }
.daylight-bar { margin-top: 0.85rem; }
.daylight-track {
  position: relative;
  height: 6px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.08);
}
.daylight-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--yellow), #fb923c, var(--yellow));
  width: 0%;
  transition: width 0.6s var(--ease);
}
.daylight-marker {
  position: absolute;
  top: 50%;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 10px rgba(245, 197, 24, 0.7);
  transform: translate(-50%, -50%);
  left: 0%;
  transition: left 0.6s var(--ease);
}

.aqi-meter {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}
.aqi-value {
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}
.aqi-badge {
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  background: var(--accent-soft);
  color: var(--blue);
}
.aqi-badge[data-level="1"] { background: rgba(61,214,140,0.15); color: var(--aqi-1); }
.aqi-badge[data-level="2"] { background: rgba(163,230,53,0.15); color: var(--aqi-2); }
.aqi-badge[data-level="3"] { background: rgba(245,197,24,0.15); color: var(--aqi-3); }
.aqi-badge[data-level="4"] { background: rgba(251,146,60,0.15); color: var(--aqi-4); }
.aqi-badge[data-level="5"] { background: rgba(255,107,107,0.15); color: var(--aqi-5); }
.aqi-explain { font-size: 0.85rem; color: var(--text-dim); }
.aqi-unavailable { color: var(--text-mute); font-size: 0.85rem; }

.insights-list { display: flex; flex-direction: column; gap: 0.55rem; }
.insight-item {
  display: flex;
  gap: 0.7rem;
  padding: 0.75rem;
  background: rgba(255,255,255,0.03);
  border-radius: 14px;
  border-left: 3px solid var(--blue);
  transition: background var(--dur), transform var(--dur);
}
.insight-item:hover {
  background: rgba(45, 140, 255, 0.08);
  transform: translateX(3px);
}
.insight-icon {
  flex-shrink: 0;
  width: 28px; height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--blue);
  font-size: 0.75rem;
  font-weight: 700;
}
.insight-text { font-size: 0.85rem; color: var(--text-dim); }
.insights-disclaimer {
  margin-top: 0.75rem;
  font-size: 0.7rem;
  color: var(--text-mute);
  font-style: italic;
}

.chip-list { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.chip, .chip-select {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-full);
  background: var(--accent-soft);
  border: 1px solid rgba(45, 140, 255, 0.25);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  transition: transform var(--dur), box-shadow var(--dur), background var(--dur);
}
.chip:hover, .chip:has(.chip-select:hover) {
  transform: translateY(-2px);
  box-shadow: 0 0 16px rgba(45, 140, 255, 0.25);
}
.chip {
  padding: 0;
  overflow: hidden;
}
.chip-select {
  border: none;
  background: transparent;
  padding: 0.45rem 0.35rem 0.45rem 0.75rem;
}
.chip-remove {
  width: 28px; height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--text-mute);
  margin-right: 0.25rem;
}
.chip-remove:hover { color: var(--danger); background: rgba(255,107,107,0.15); }

.compare-lead {
  margin: 0 0 0.85rem;
  color: var(--text-dim);
  font-size: 0.9rem;
  line-height: 1.4;
}
.compare-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}
.compare-field {
  position: relative;
  flex: 1;
  min-width: 140px;
}
.compare-fields input {
  width: 100%;
  padding: 0.55rem 0.85rem;
  background: var(--bg-elev);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-full);
  outline: none;
  transition: border-color var(--dur), box-shadow var(--dur);
}
.compare-fields input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.compare-suggestions {
  left: 0;
  right: 0;
  top: calc(100% + 4px);
}
.compare-vs {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-mute);
  text-transform: uppercase;
}
.compare-result {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.compare-result[hidden] { display: none !important; }
.compare-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.65rem;
  align-items: stretch;
}
.compare-card {
  padding: 1.1rem 1rem 1rem;
  text-align: center;
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius-md);
  border: 1px solid var(--stroke);
  transition: transform var(--dur), box-shadow var(--dur);
}
.compare-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--glow-blue);
}
.compare-place {
  font-size: 0.92rem;
  margin: 0 0 0.15rem;
  line-height: 1.25;
}
.compare-coords {
  margin: 0;
  font-size: 0.7rem;
  color: var(--text-mute);
}
.compare-icon {
  margin: 0.35rem auto 0.15rem;
  filter: drop-shadow(0 8px 14px rgba(0,0,0,0.35));
}
.compare-temp { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.02em; margin: 0; }
.compare-feels {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 600;
}
.compare-cond {
  font-size: 0.8rem;
  color: var(--text-dim);
  text-transform: capitalize;
  margin: 0.3rem 0 0.2rem;
}
.compare-range {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-mute);
  font-weight: 600;
}
.compare-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-mute);
}
.compare-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.12);
}
.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  min-width: 420px;
}
.compare-table th,
.compare-table td {
  padding: 0.55rem 0.7rem;
  text-align: left;
  border-bottom: 1px solid var(--stroke);
}
.compare-table thead th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-mute);
  background: rgba(255, 255, 255, 0.03);
}
.compare-table tbody th {
  font-weight: 600;
  color: var(--text-dim);
  white-space: nowrap;
}
.compare-table td.is-lead {
  color: var(--accent);
  font-weight: 700;
}
.compare-delta {
  color: var(--text-mute);
  white-space: nowrap;
}
.compare-insights {
  padding: 0.9rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--stroke);
  background: linear-gradient(145deg, var(--accent-soft), transparent 60%);
}
.compare-insights-title {
  margin: 0 0 0.45rem;
  font-size: 0.9rem;
}
.compare-insights-list {
  margin: 0;
  padding-left: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  color: var(--text-dim);
  font-size: 0.86rem;
  line-height: 1.4;
}
.compare-status {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-dim);
  min-height: 1.2em;
}

/* Drawer */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 200;
}
.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.25s ease;
}
.drawer-panel {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: min(300px, 86vw);
  padding: 1.25rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  animation: drawerIn 0.35s var(--ease);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.drawer-link {
  text-align: left;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  font-weight: 600;
  color: var(--text);
  background: rgba(255,255,255,0.03);
  border: 1px solid transparent;
  transition: background var(--dur), border-color var(--dur), transform var(--dur);
}
.drawer-link:hover {
  background: var(--accent-soft);
  border-color: rgba(45, 140, 255, 0.3);
  transform: translateX(4px);
}
.drawer-tag {
  margin-top: auto;
  font-size: 0.8rem;
  color: var(--text-mute);
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
}
.modal-card {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  padding: 1.4rem;
  max-height: 80vh;
  overflow-y: auto;
  animation: popIn 0.35s var(--ease);
}
.modal-card h2 { font-size: 1.25rem; margin-bottom: 0.3rem; }
.modal-sub { font-size: 0.85rem; color: var(--text-dim); margin-bottom: 1rem; }
.city-options { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1rem; }
.city-option {
  width: 100%;
  text-align: left;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--stroke);
  transition: background var(--dur), border-color var(--dur), transform var(--dur);
}
.city-option:hover {
  background: var(--accent-soft);
  border-color: rgba(45, 140, 255, 0.4);
  transform: translateX(3px);
}
.city-option-name { font-weight: 700; display: block; }
.city-option-meta { font-size: 0.85rem; color: var(--text-dim); }

.tooltip {
  position: fixed;
  z-index: 300;
  max-width: 220px;
  padding: 0.55rem 0.75rem;
  background: var(--bg-card-2);
  border: 1px solid var(--stroke-strong);
  border-radius: 12px;
  font-size: 0.75rem;
  color: var(--text-dim);
  box-shadow: var(--shadow-neu);
  pointer-events: none;
}

.site-footer {
  text-align: center;
  padding: 1.25rem 0 0.5rem;
  font-size: 0.72rem;
  color: var(--text-mute);
}

.spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.15);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
.loading-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* Keyframes used by style */
@keyframes statusPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.85); }
}
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
/* Floating AI assistant */
.ai-fab {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: calc(5.4rem + env(safe-area-inset-bottom));
  z-index: 95;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  border: 1px solid rgba(45, 140, 255, 0.45);
  color: #fff;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.28), transparent 45%),
    linear-gradient(145deg, #3b9bff, #1d6fe0 55%, #1557b8);
  box-shadow:
    0 12px 28px rgba(29, 111, 224, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.08) inset;
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), filter 0.2s;
}
.ai-fab:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow:
    0 16px 34px rgba(29, 111, 224, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.12) inset;
  filter: brightness(1.05);
}
.ai-fab:active { transform: scale(0.96); }
body.assistant-open .ai-fab {
  background: linear-gradient(145deg, #4b5563, #1f2937);
  border-color: rgba(255, 255, 255, 0.18);
}

.assistant-drawer {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: end;
  pointer-events: none;
}
.assistant-drawer[hidden] { display: none !important; }
.assistant-drawer:not([hidden]) { pointer-events: auto; }
.assistant-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 8, 16, 0.55);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}
.assistant-sheet {
  position: relative;
  z-index: 1;
  width: min(420px, calc(100vw - 1.25rem));
  max-width: 100%;
  max-height: min(82dvh, 720px);
  margin: 0 0.75rem max(0.75rem, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 22px;
  animation: assistantSheetIn 0.28s var(--ease);
}
.assistant-sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.1rem 0.65rem;
  border-bottom: 1px solid var(--stroke);
}
.assistant-sheet-head h2 {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}
.assistant-sheet-sub {
  margin: 0.2rem 0 0;
  font-size: 0.8rem;
  color: var(--text-dim);
}
.assistant-panel {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1rem 1.1rem 1.15rem;
  min-height: 0;
  flex: 1;
  overflow: auto;
}
.assistant-chat {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-height: 180px;
  max-height: min(36vh, 320px);
  overflow-y: auto;
  padding: 0.75rem;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid var(--stroke);
}
@keyframes brandOrbPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
@keyframes brandRingSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes forecastGlow {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.08); }
}
@keyframes forecastHeroPulse {
  0% { transform: scale(0.985); }
  55% { transform: scale(1.015); }
  100% { transform: scale(1); }
}
@keyframes assistantSheetIn {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.assistant-msg {
  max-width: 92%;
  padding: 0.7rem 0.85rem;
  border-radius: 14px;
  font-size: 0.9rem;
  line-height: 1.45;
  white-space: pre-wrap;
}
.assistant-msg--bot {
  align-self: flex-start;
  background: var(--bg-card-2);
  border: 1px solid var(--stroke);
  color: var(--text);
}
.assistant-msg--user {
  align-self: flex-end;
  background: var(--accent-soft);
  border: 1px solid rgba(45, 140, 255, 0.28);
  color: var(--text);
}
.assistant-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.ask-chip {
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--stroke-strong);
  background: var(--bg-elev);
  color: var(--text-dim);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--dur), color var(--dur), border-color var(--dur);
}
.ask-chip:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}
.assistant-form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.assistant-form input {
  flex: 1;
  min-width: 0;
  padding: 0.7rem 0.95rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--stroke);
  background: var(--bg-elev);
  outline: none;
}
.assistant-form input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.assistant-settings {
  border-top: 1px solid var(--stroke);
  padding-top: 0.65rem;
}
.assistant-settings summary {
  cursor: pointer;
  color: var(--text-dim);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.45rem;
}

body[data-mode="light"] .assistant-chat {
  background: #f3f6fb;
}
body[data-mode="light"] .assistant-msg--bot {
  background: #ffffff;
}
body[data-mode="light"] .ask-chip {
  background: #ffffff;
}
body[data-mode="light"] .assistant-backdrop {
  background: rgba(15, 30, 55, 0.35);
}
body[data-mode="light"] .ai-fab {
  box-shadow:
    0 12px 28px rgba(29, 111, 224, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.35) inset;
}
body[data-mode="light"] .brand-ring {
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    conic-gradient(from 120deg, rgba(45, 140, 255, 0.95), rgba(251, 191, 36, 0.8), rgba(45, 140, 255, 0.25), rgba(45, 140, 255, 0.95)) border-box;
}
body[data-mode="light"] .forecast-hero {
  background:
    linear-gradient(145deg, rgba(45, 140, 255, 0.1), transparent 55%),
    #ffffff;
}

@keyframes screenIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes listIn {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes drawerIn {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}
@keyframes popIn {
  from { opacity: 0; transform: scale(0.94) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes orbPulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.08); }
}
@keyframes orbRing {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
  50% { transform: translate(-50%, -50%) scale(1.12); opacity: 1; }
}
@keyframes glowBreathe {
  0%, 100% { opacity: 0.7; transform: translate(-50%, -30%) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -30%) scale(1.12); }
}
