/* ─── Weather Background ────────────────────────────────────────────────── */
/* @keyframes used by JS inline styles */
@keyframes cloud-drift {
  0%   { transform: translateX(-300px); }
  100% { transform: translateX(calc(100vw + 300px)); }
}
@keyframes lightning-flash {
  0%, 100% { opacity: 0; }
  5%  { opacity: 0.9; }
  10% { opacity: 0; }
  15% { opacity: 0.5; }
  20% { opacity: 0; }
  25% { opacity: 0.3; }
  30% { opacity: 0; }
}

/* Layer 3: Canvas particle overlay — pointer-events: none so clicks pass through */
.weather-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  will-change: contents;
}

/* ─── Variables ──────────────────────────────────────────────────────────── */
:root {
  --bg: #0b0f1a;
  --bg-card: rgba(255, 255, 255, 0.055);
  --bg-card-hover: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.10);
  --border-focus: rgba(255, 255, 255, 0.25);
  --accent-amber: #f59e0b;
  --accent-cyan: #22d3ee;
  --accent-silver: #d1d5db;
  --accent-gold: #fde68a;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #94a3b8;
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-mono: 'DM Mono', 'Courier New', monospace;
  --radius: 14px;
  --radius-sm: 8px;
  --blur: blur(14px);
  --shadow-card: 0 1px 2px rgba(0,0,0,0.45), 0 8px 28px rgba(0,0,0,0.4);
  --shadow-card-hover: 0 0 0 1px rgba(255,255,255,0.08), 0 12px 40px rgba(0,0,0,0.5);
}

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

/* Hidden attribute must win against inline display:flex etc. */
[hidden] { display: none !important; }

/* Skeleton loading containers — flex row layout */
.weather-skeleton { display: flex; gap: 8px; padding: 4px 0; overflow-x: auto; }
#hourly-skeleton  { padding: 18px 0 8px; gap: 8px; }
#forecast-skeleton { padding: 8px 0; gap: 10px; }

html { font-size: 16px; }

body {
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(34, 211, 238, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 80% 100%, rgba(245, 158, 11, 0.04) 0%, transparent 50%);
  background-size: 100% 100%;
  color: var(--text-primary);
  font-family: var(--font-mono);
  min-height: 100dvh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-shadow: 0 1px 3px rgba(0,0,0,0.35); /* universal readability enhancement */
}

/* ─── Contrast policy: adapt to sky brightness ──────────────────────────── */
/* Bright sky (e.g. clear day) — boost card opacity for readability */
body[data-sky-brightness="bright"] {
  text-shadow: 0 1px 4px rgba(0,0,0,0.50);
}
body[data-sky-brightness="bright"] {
  --bg-card: rgba(0, 0, 0, 0.40);
  --bg-card-hover: rgba(0, 0, 0, 0.48);
  --border: rgba(255, 255, 255, 0.18);
}
/* Medium sky — slight enhancement */
body[data-sky-brightness="medium"] {
  text-shadow: 0 1px 3px rgba(0,0,0,0.40);
}
body[data-sky-brightness="medium"] {
  --bg-card: rgba(0, 0, 0, 0.30);
}
/* Dark sky (night, storms) — keep original semi-transparent cards */
body[data-sky-brightness="dark"] {
  text-shadow: 0 1px 2px rgba(0,0,0,0.25);
}

/* ─── Update Banner (SW update notification) ──────────────────────────── */
.update-banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: rgba(34, 211, 238, 0.10);
  border-bottom: 1px solid rgba(34, 211, 238, 0.25);
  font-size: 13px;
  gap: 12px;
}
.update-banner:not([hidden]) {
  display: flex;
}
.update-banner .btn-small {
  background: #22d3ee;
  color: #0b0f1a;
  border: none;
  padding: 6px 14px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-size: 12px;
}
.update-banner .btn-small:hover {
  background: #67e8f9;
}

/* ─── Install / Offline Banners ─────────────────────────────────────────── */
.install-banner,
.offline-banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: rgba(245, 158, 11, 0.12);
  border-bottom: 1px solid rgba(245, 158, 11, 0.25);
  font-size: 13px;
  gap: 12px;
}

.install-banner:not([hidden]),
.offline-banner:not([hidden]) {
  display: flex;
}

.offline-banner {
  background: rgba(239, 68, 68, 0.10);
  border-bottom: 1px solid rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  justify-content: center;
  font-size: 13px;
}

.install-banner > div { display: flex; gap: 8px; align-items: center; }

/* iOS install instructions text – inline with icon-style Share arrow */
.ios-text {
  font-size: 13px;
  line-height: 1.4;
}
.ios-text strong {
  font-weight: 500;
  color: var(--accent-amber);
}

/* Mobile-only: show install banner only on small screens */
@media (min-width: 601px) {
  .install-banner {
    display: none !important;
  }
}

/* ─── Layout ─────────────────────────────────────────────────────────────── */
.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 32px 20px 48px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ─── Header ─────────────────────────────────────────────────────────────── */
.header { text-align: center; padding: 8px 0 4px; }

.title {
  font-family: var(--font-serif);
  font-size: clamp(2.2rem, 8vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #f1f5f9 30%, var(--accent-gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}

.tagline {
  font-size: clamp(0.75rem, 2.5vw, 0.85rem);
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-top: 8px;
  font-weight: 400;
  text-align: center;
  text-transform: none;
}

/* ─── Search ─────────────────────────────────────────────────────────────── */
.search-section { display: flex; flex-direction: column; gap: 8px; align-items: center; }

.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 8px 8px 8px 18px;
  backdrop-filter: var(--blur);
  transition: border-color 0.2s;
}

.search-bar:focus-within { border-color: var(--border-focus); }

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 14px;
  min-width: 0;
}

.search-input::placeholder { color: var(--text-muted); }

.location-name {
  font-size: 13px;
  color: var(--text-secondary);
  height: 18px;
}

/* ─── Sticky Location Chip (t_4d994437) ─────────────────────────────────── */
.location-chip {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translate(-50%, -120%);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100vw - 32px);
  padding: 8px 16px;
  font-size: 12px;
  color: var(--text-primary, #e2e8f0);
  background: rgba(15, 19, 32, 0.82);
  border: 1px solid var(--border);
  border-radius: 0 0 50px 50px;
  backdrop-filter: blur(12px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
}

.location-chip.visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

.location-chip .chip-city { font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.location-chip .chip-time {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent-cyan, #22d3ee);
}
.location-chip .chip-sep { color: var(--text-muted); }

/* Reduced motion: kill all animated transitions/animations (t_4d994437) */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ─── City Suggestions ────────────────────────────────────────────────── */
.city-suggestions {
  width: 100%;
  max-width: 440px;
  background: rgba(20, 24, 38, 0.96);
  border: 1px solid var(--border-focus);
  border-radius: 14px;
  backdrop-filter: saturate(180%) blur(16px);
  box-shadow: 0 18px 44px rgba(0,0,0,0.55);
  overflow: hidden;
}
.city-suggestions[hidden] { display: none; }

.city-suggestion {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  background: transparent;
  border: none;
  border-top: 1px solid rgba(255,255,255,0.06);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: background .12s;
}
.city-suggestion:first-of-type { border-top: none; }
.city-suggestion:hover,
.city-suggestion.active { background: rgba(245, 158, 11, 0.10); }

.city-suggestion-name {
  display: flex;
  align-items: center;
  gap: 8px;
}
.city-suggestion-country {
  font-size: 11px;
  color: var(--text-secondary);
}

/* ─── Buttons ─────────────────────────────────────────────────────────────── */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--accent-amber);
  color: #0b0f1a;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s, opacity 0.15s;
}

.btn-primary:hover { opacity: 0.85; transform: scale(1.05); }
.btn-primary:active { transform: scale(0.96); }

.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
}

.btn-icon:hover { background: var(--bg-card-hover); color: var(--text-primary); border-color: var(--border-focus); }
.btn-icon:active { transform: scale(0.95); }

.btn-small {
  padding: 5px 14px;
  border-radius: 50px;
  border: 1px solid var(--accent-amber);
  background: transparent;
  color: var(--accent-amber);
  font-family: var(--font-mono);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-small:hover { background: rgba(245, 158, 11, 0.12); }

/* Refresh spin animation */
@keyframes spin { to { transform: rotate(360deg); } }
.spinning #refresh-icon { animation: spin 0.6s linear; }

/* ─── Cards ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  backdrop-filter: var(--blur);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.25s ease, transform .25s ease;
  animation: fadeUp 0.5s ease-out both;
}

.card:hover { box-shadow: var(--shadow-card-hover); }
.card:active { transform: scale(0.99); }

/* Staggered entrance for all primary cards (t_4d994437) */
.card:nth-child(1) { animation-delay: 0.06s; }
.card:nth-child(2) { animation-delay: 0.14s; }
.card:nth-child(3) { animation-delay: 0.22s; }
.card:nth-child(4) { animation-delay: 0.30s; }
.card:nth-child(5) { animation-delay: 0.38s; }
.card:nth-child(6) { animation-delay: 0.46s; }
.card:nth-child(7) { animation-delay: 0.54s; }
.card:nth-child(8) { animation-delay: 0.62s; }

/* Per-card accent edge (t_4d994437) — visual identity for otherwise uniform cards */
.card { --accent-edge: rgba(148, 163, 184, 0.55); }
.card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 3px;
  background: var(--accent-edge);
  opacity: 0.85;
  pointer-events: none;
}
.card-weather  { --accent-edge: rgba(56, 189, 248, 0.60); }
.card-moon     { --accent-edge: rgba(34, 211, 238, 0.60); }
.card-darkness { --accent-edge: rgba(129, 140, 248, 0.60); }
.card-sun      { --accent-edge: rgba(251, 191, 36, 0.60); }
.card-astro    { --accent-edge: rgba(232, 121, 249, 0.60); }
.card-air      { --accent-edge: rgba(52, 211, 153, 0.60); }

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

.card-label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
  mix-blend-mode: difference;
}

/* ─── Weather Card ────────────────────────────────────────────────────────── */
.card-weather { display: flex; flex-direction: column; gap: 20px; }

.weather-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

/* Subtle icon container */
.weather-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 18px;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 8px 20px rgba(0,0,0,0.35);
}
.weather-icon-wrap svg { width: 32px; height: 32px; }

.temp-display {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  line-height: 1;
  position: relative;
}

.temp-display::before {
  content: "";
  position: absolute;
  top: 10%;
  left: 10%;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(251,191,36,0.20), rgba(251,191,36,0.0) 70%);
  filter: blur(18px);
  z-index: -1;
  pointer-events: none;
}

#temp-value {
  font-family: var(--font-mono);
  font-size: clamp(4rem, 15vw, 5.5rem);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.temp-unit {
  font-family: var(--font-mono);
  font-size: 1.8rem;
  color: var(--text-secondary);
  margin-top: 8px;
}

.condition-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  padding-top: 10px;
}

.condition-text {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: right;
  transition: opacity 0.25s ease;
}

.weather-icon {
  width: 22px;
  height: 22px;
  opacity: 0.95;
}
.weather-icon svg {
  width: 32px;
  height: 32px;
  display: inline-block;
  vertical-align: middle;
}
.forecast-icon {
  font-size: 1.5rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
}

.forecast-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}
.hourly-icon svg {
  width: 28px;
  height: 28px;
  display: inline-block;
  vertical-align: middle;
}

.badge {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 50px;
  letter-spacing: 0.05em;
}

.badge-day  { background: rgba(245, 158, 11, 0.15); color: var(--accent-amber); }
.badge-night { background: rgba(100, 116, 139, 0.25); color: #94a3b8; }
.badge-fallback { background: rgba(99, 102, 241, 0.15); color: #818cf8; font-size: 10px; }

.weather-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 20px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.detail-item { display: flex; flex-direction: column; gap: 2px; }

.detail-label {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.detail-value {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
}

/* ─── Moon Card ───────────────────────────────────────────────────────────── */
.card-moon { display: flex; flex-direction: column; gap: 16px; }

.moon-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.moon-emoji { font-size: 1.6rem; }

.moon-phase-name {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--accent-gold);
  line-height: 1.2;
}

.moon-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px 0;
}
.moon-visual-wrapper {
  position: relative;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
/* Subtle star-dot background behind the moon */
.moon-visual-wrapper::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,0.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 60% 20%, rgba(255,255,255,0.2) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 80% 50%, rgba(255,255,255,0.25) 0%, transparent 100%),
    radial-gradient(1px 1px at 35% 65%, rgba(255,255,255,0.2) 0%, transparent 100%),
    radial-gradient(1px 1px at 70% 80%, rgba(255,255,255,0.15) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 15% 75%, rgba(255,255,255,0.2) 0%, transparent 100%),
    radial-gradient(1px 1px at 88% 22%, rgba(255,255,255,0.18) 0%, transparent 100%),
    radial-gradient(1px 1px at 45% 85%, rgba(255,255,255,0.15) 0%, transparent 100%);
  pointer-events: none;
}

.moon-svg {
  width: 160px;
  height: 160px;
  filter: drop-shadow(0 0 18px rgba(209, 213, 219, 0.15));
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  z-index: 1;
}

.card-moon:hover .moon-svg { transform: rotate(12deg) scale(1.04); }

.moon-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 12px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.moon-stat { display: flex; flex-direction: column; align-items: center; gap: 2px; }

.stat-value {
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--accent-silver);
}

.stat-label {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.moon-dates {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.moon-date-item { display: flex; flex-direction: column; gap: 2px; }

.moon-date-label {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.moon-date-value { font-size: 13px; color: var(--text-primary); }

/* ─── Sun Card (Solar Activity) ─────────────────────────────────────────── */
.card-sun {
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: fadeUp 0.5s 0.3s ease-out both;
  border-top: 2px solid rgba(245, 158, 11, 0.2);
}

.sun-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sun-emoji {
  font-size: 1.6rem;
  filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.4));
}

.sun-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

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

.sun-label {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.sun-value {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  text-align: right;
}

.sun-value-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Kp-index badge */
.sun-kp-badge {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 50px;
}

/* Kp-index color coding */
.sun-kp-badge.kp-quiet {
  background: rgba(52, 211, 153, 0.15);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.25);
}
.sun-kp-badge.kp-active {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.25);
}
.sun-kp-badge.kp-storm {
  background: rgba(251, 113, 133, 0.15);
  color: #fb7185;
  border: 1px solid rgba(251, 113, 133, 0.25);
}
.sun-kp-badge.kp-severe {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

/* Flare alert section */
.sun-flare-section {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 10px;
  margin-top: 4px;
  border-top: 1px solid var(--border);
}

.sun-flare-badge {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 50px;
}

.sun-flare-badge.flare-none,
.sun-flare-badge.flare-minor {
  background: rgba(52, 211, 153, 0.12);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.2);
}
.sun-flare-badge.flare-moderate {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.25);
}
.sun-flare-badge.flare-strong,
.sun-flare-badge.flare-severe {
  background: rgba(251, 113, 133, 0.15);
  color: #fb7185;
  border: 1px solid rgba(251, 113, 133, 0.25);
}

.sun-flare-detail {
  width: 100%;
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-top: 2px;
}

/* ─── Aurora Forecast ─────────────────────────────────────────────────────────── */
.sun-aurora-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.aurora-forecast {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.aurora-day {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(255,255,255,0.04);
}

.aurora-date {
  font-weight: 600;
  min-width: 32px;
  color: var(--text-primary);
}

.aurora-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 50px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  min-width: 70px;
  text-align: center;
}

.aurora-estimate {
  font-size: 0.7em;
  opacity: 0.6;
  margin-left: 2px;
}

.aurora-green { background: rgba(34,197,94,0.2); color: #4ade80; }
.aurora-yellow { background: rgba(234,179,8,0.2); color: #facc15; }
.aurora-orange { background: rgba(249,115,22,0.2); color: #fb923c; }
.aurora-red { background: rgba(239,68,68,0.2); color: #f87171; }
.aurora-purple { background: rgba(168,85,247,0.2); color: #c084fc; }

.aurora-desc {
  color: var(--text-secondary);
  font-size: 11px;
  flex: 1;
}

.aurora-none {
  color: var(--text-muted);
  font-size: 11px;
  font-style: italic;
}

/* ─── Darkness Card ─────────────────────────────────────────────────────────── */
.card-darkness {
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: fadeUp 0.5s 0.3s ease-out both;
  border-top: 2px solid rgba(30, 58, 95, 0.4);
}

.darkness-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.darkness-emoji {
  font-size: 1.4rem;
}

.darkness-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

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

.darkness-label {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.darkness-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.darkness-value.darkness-bortle-label {
  color: #2d5a87;
  font-size: 13px;
}

.darkness-divider {
  height: 1px;
  background: var(--border);
  margin: 2px 0;
}

/* ─── Darkness Timeline Bar ───────────────────────────────────────────────── */
.darkness-timeline {
  position: relative;
  width: 100%;
  height: 44px;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  margin-bottom: 6px;
  background: #0b0f1a;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.darkness-timeline-segment {
  height: 100%;
  position: relative;
  flex-shrink: 0;
}

.darkness-timeline-night {
  background: #0b0f1a;
}

.darkness-timeline-twilight-morn {
  background: linear-gradient(to right, #0b0f1a, #1a237e);
}

.darkness-timeline-twilight-eve {
  background: linear-gradient(to left, #0b0f1a, #1a237e);
}

.darkness-timeline-day {
  background: linear-gradient(to bottom, #1565c0, #42a5f5);
}

.darkness-timeline-label {
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 8px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  white-space: nowrap;
  pointer-events: none;
}

.darkness-timeline-marker {
  position: absolute;
  top: 0;
  width: 2px;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

.darkness-timeline-marker-sunrise,
.darkness-timeline-marker-sunset {
  background: #ffb74d;
  box-shadow: 0 0 4px rgba(255, 183, 77, 0.5);
}

.darkness-timeline-marker-twilight {
  background: rgba(200, 200, 255, 0.35);
}

.darkness-timeline-marker-moon {
  background: rgba(255, 255, 200, 0.5);
  box-shadow: 0 0 3px rgba(255, 255, 200, 0.3);
  width: 2px;
}

.darkness-timeline-marker-dot {
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  z-index: 3;
}

.darkness-timeline-marker-dot-sunrise,
.darkness-timeline-marker-dot-sunset {
  background: #ffb74d;
}

.darkness-timeline-marker-dot-twilight {
  background: rgba(180, 180, 255, 0.5);
}

.darkness-timeline-marker-dot-moon {
  background: #ffe082;
}

.darkness-timeline-now {
  position: absolute;
  top: -4px;
  width: 3px;
  height: calc(100% + 8px);
  background: #ff5252;
  z-index: 4;
  box-shadow: 0 0 8px #ff5252, 0 0 12px rgba(255, 82, 82, 0.4);
  pointer-events: none;
}

.darkness-timeline-now-label {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 8px;
  font-weight: 600;
  color: #ff5252;
  white-space: nowrap;
  pointer-events: none;
  text-shadow: 0 0 4px rgba(255, 82, 82, 0.5);
}

.darkness-timeline-hour-label {
  position: absolute;
  top: -1px;
  font-size: 7px;
  color: rgba(255, 255, 255, 0.25);
  pointer-events: none;
  white-space: nowrap;
  transform: translateX(-50%);
}

.darkness-timeline-hour-label-left {
  left: 2px;
  transform: none;
}

.darkness-timeline-hour-label-right {
  right: 2px;
  left: auto;
  transform: none;
}

/* ─── Astrophotography Card ───────────────────────────────────────────────── */
.card-astro {
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: fadeUp 0.5s 0.35s ease-out both;
}

.astro-header { display: flex; flex-direction: column; gap: 4px; }

.astro-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.astro-badge {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 50px;
  background: rgba(34, 211, 238, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(34, 211, 238, 0.2);
}

.astro-badge.excellent { background: rgba(34, 211, 238, 0.12); color: var(--accent-cyan); border-color: rgba(34, 211, 238, 0.2); }
.astro-badge.good      { background: rgba(52, 211, 153, 0.12); color: #34d399; border-color: rgba(52, 211, 153, 0.2); }
.astro-badge.fair      { background: rgba(251, 191, 36, 0.12); color: #fbbf24; border-color: rgba(251, 191, 36, 0.2); }
.astro-badge.poor      { background: rgba(251, 113, 133, 0.12); color: #fb7185; border-color: rgba(251, 113, 133, 0.2); }
.astro-badge.bad       { background: rgba(100, 116, 139, 0.2); color: #64748b; border-color: rgba(100, 116, 139, 0.3); }

.astro-score-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
  line-height: 1;
}

/* Radial score ring context behind the big number (t_4d994437) */
.astro-score-row,
.air-score-row {
  position: relative;
  padding-left: 10px;
}

.astro-score-row::before,
.air-score-row::before {
  content: '';
  position: absolute;
  left: 0;
  bottom: 4px;
  width: 10px;
  height: 34px;
  border-radius: 6px;
  background: linear-gradient(180deg,
    var(--accent-cyan, #22d3ee) 0%,
    var(--accent-edge, rgba(148,163,184,0.4)) 100%);
  opacity: 0.9;
}

.astro-score {
  font-family: var(--font-serif);
  font-size: 3.2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.astro-slash {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  color: var(--text-muted);
}

.astro-label {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-left: 4px;
}

.astro-best-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.3;
  letter-spacing: 0.02em;
}

.astro-description {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.3;
  letter-spacing: 0.02em;
  font-style: italic;
}

.astro-conditions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 20px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.astro-metric { display: flex; flex-direction: column; gap: 2px; }

.astro-metric-value {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
}

.astro-metric-label {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ─── Cloud Cover Altitude Badges (nested inside the Cloud metric) ───────── */
.astro-cloud-altitudes {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  margin-top: 8px;
}

.astro-metric.astro-metric-cloud {
  align-items: flex-start;
}

.astro-metric.astro-metric-cloud .astro-cloud-altitudes {
  justify-content: center;
}

.astro-cloud-altitude {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  padding: 2px 8px;
  border-radius: 50px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.astro-cloud-altitude-label {
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 500;
}

#astro-cloud-low,
#astro-cloud-mid,
#astro-cloud-high {
  font-weight: 600;
  font-size: 12px;
  color: var(--text-primary);
}

.astro-bar-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.astro-bar-label {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.astro-bar-track {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.astro-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #fb7185 0%, #fbbf24 40%, #34d399 70%, var(--accent-cyan) 100%);
  border-radius: 3px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.astro-hours {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.astro-hours-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.astro-hours-time-labels {
  display: flex;
  align-items: center;
  width: 100%;
}

.astro-time-label {
  font-size: 10px;
  color: var(--text-secondary);
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.astro-days-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.astro-days-label {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.astro-days {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.astro-day-card {
  min-width: 64px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.astro-day-name {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.astro-day-score {
  font-size: 16px;
  font-weight: 600;
}

.astro-time-label-end {
  margin-left: auto;
}

.astro-hours::-webkit-scrollbar { height: 3px; }
.astro-hours::-webkit-scrollbar-track { background: transparent; }
.astro-hours::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.astro-hour-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 500;
  border: 1px solid var(--border);
  cursor: default;
  transition: transform 0.15s;
  position: relative;
}

.astro-hour-dot:hover { transform: scale(1.3); }

.astro-hour-dot.now {
  border-color: rgba(245, 158, 11, 0.5);
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.3);
}

/* ─── Card Error State ────────────────────────────────────────────────────── */
.card-error {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #fca5a5;
  background: rgba(11, 15, 26, 0.7);
  border-radius: var(--radius);
  backdrop-filter: blur(4px);
  z-index: 2;
}

/* ─── Forecast ───────────────────────────────────────────────────────────── */
.forecast-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: fadeUp 0.5s 0.4s ease-out both;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 600;
  color: #fff;
  mix-blend-mode: difference;
  letter-spacing: 0.02em;
}

/* Footer breathing room (t_4d994437) */
.footer {
  margin-top: 40px;
}
.footer span {
  opacity: 0.5;
}

.forecast-scroll { overflow-x: auto; padding-bottom: 8px; }

.forecast-scroll::-webkit-scrollbar { height: 4px; }
.forecast-scroll::-webkit-scrollbar-track { background: transparent; }
.forecast-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.forecast-days {
  display: flex;
  gap: 10px;
  min-width: max-content;
}

.forecast-day {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 88px;
  flex-shrink: 0;
  backdrop-filter: var(--blur);
  transition: background .15s, transform .15s;
  cursor: pointer;
}

.forecast-day:hover { background: var(--bg-card-hover); transform: translateY(-1px); }
.forecast-day:active { transform: scale(0.97); }

.forecast-day-name {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.forecast-temps {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.forecast-high {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
}

.forecast-low {
  font-size: 12px;
  color: var(--text-muted);
}

/* ─── Tonight's Targets ─────────────────────────────────────────────────────── */
.targets-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: fadeUp 0.5s 0.45s ease-out both;
}

.targets-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.targets-count-badge {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 50px;
  background: rgba(34, 211, 238, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(34, 211, 238, 0.2);
}

.targets-preview {
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--accent-cyan, #22d3ee);
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.15);
  border-radius: var(--radius, 12px);
  padding: 6px 12px;
  text-align: center;
}

.targets-empty {
  font-size: 13px;
  color: var(--text-muted, #94a3b8);
  text-align: center;
  padding: 24px 12px;
  opacity: 0.7;
}

.targets-label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
  mix-blend-mode: difference;
  display: flex;
  align-items: center;
  gap: 8px;
}

.targets-label .targets-label-icon { font-size: 13px; }

/* Per-group count badge (t_99f554f1) */
.targets-label .targets-group-count {
  font-size: 10px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary, #94a3b8);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.targets-scroll {
  display: flex;
  flex-direction: row;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 6px;
  -webkit-overflow-scrolling: touch;
  /* Edge fade hinting more content (t_99f554f1) */
  mask-image: linear-gradient(to right, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
}

.targets-scroll::-webkit-scrollbar { height: 3px; }
.targets-scroll::-webkit-scrollbar-track { background: transparent; }
.targets-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ─── Cards / Card Base ──────────────────────────────────────────────────── */

.target-card {
  width: 160px;
  min-height: 175px;
  flex-shrink: 0;
  flex-grow: 0;
  scroll-snap-align: start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: var(--blur);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: background .15s, transform .15s, min-height .3s ease;
}

.target-card:hover { background: var(--bg-card-hover); transform: translateY(-1px); }

.target-img-wrap {
  width: 100%;
  height: 82px;
  min-height: 82px;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
  border-radius: var(--radius) var(--radius) 0 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: var(--bg-card);
}

.target-img-wrap[data-img-failed]::after {
  content: '🔭';
  font-size: 32px;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.4;
  pointer-events: none;
}

.target-img {
  width: 100%;
  height: 82px;
  object-fit: cover;
  display: block;
}

.target-info {
  padding: 8px 6px 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.target-name {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.target-fullname {
  font-size: 9px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.target-badges {
  display: flex;
  flex-direction: row;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.target-badge {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 50px;
}

.target-badge.cons {
  background: rgba(34, 211, 238, 0.10);
  color: var(--accent-cyan);
  border: 1px solid rgba(34, 211, 238, 0.18);
}

.target-badge.easy {
  background: rgba(52, 211, 153, 0.10);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.18);
}

.target-badge.medium {
  background: rgba(251, 191, 36, 0.10);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.18);
}

.target-badge.hard {
  background: rgba(251, 113, 133, 0.10);
  color: #fb7185;
  border: 1px solid rgba(251, 113, 133, 0.18);
}

.target-time {
  font-size: 10px;
  color: var(--text-secondary);
  margin-top: auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.target-altitude-ring {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 4px 0 6px;
}

.alt-label {
  position: absolute;
  font-size: 8px;
  font-weight: 500;
  color: var(--text-secondary);
}

/* ─── Target Card Expandable Details ────────────────────────────────────── */

.target-details {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.3s ease, opacity 0.25s ease;
  opacity: 0;
  padding: 0 8px;
  background: rgba(255,255,255,0.025);
  border-top: 1px solid transparent;
  border-radius: 0 0 var(--radius) var(--radius);
  pointer-events: none;
}

.target-card.expanded .target-details {
  max-height: 300px;
  opacity: 1;
  padding: 10px 8px 10px;
  border-top-color: var(--border);
  pointer-events: auto;
}

.target-details-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 0;
  font-size: 10px;
  line-height: 1.4;
}

.target-details-row + .target-details-row {
  border-top: 1px solid rgba(255,255,255,0.04);
}

.target-details-label {
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: 9px;
}

.target-details-value {
  color: var(--text-primary);
  font-weight: 500;
  text-align: right;
  font-family: var(--font-mono);
}

.target-details-desc {
  font-size: 10px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-style: italic;
}

/* Object-specific fact bullets + exposure row (t_83ae4310) */
.target-details-facts {
  margin: 6px 0 0;
  padding-left: 16px;
  font-size: 10px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.target-details-exposure .target-details-value {
  font-size: 10px;
  color: var(--accent-cyan, #22d3ee);
}

.lb-facts {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.lb-notes {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--accent-amber);
  line-height: 1.5;
}

.target-details-advice {
  font-size: 10px;
  color: var(--accent-amber);
  line-height: 1.5;
  margin-top: 6px;
  padding: 5px 8px;
  background: rgba(245, 158, 11, 0.08);
  border-radius: var(--radius-sm);
}

/* ─── Hourly Forecast ─────────────────────────────────────────────────────── */
.hourly-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: fadeUp 0.5s 0.3s ease-out both;
}

.hourly-scroll { overflow-x: auto; padding: 18px 0 8px; }

.hourly-scroll::-webkit-scrollbar { height: 3px; }
.hourly-scroll::-webkit-scrollbar-track { background: transparent; }
.hourly-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.hourly-cards {
  display: flex;
  gap: 8px;
  min-width: max-content;
}

.hourly-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 12px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 70px;
  flex-shrink: 0;
  backdrop-filter: var(--blur);
  transition: background .15s, transform .15s;
  position: relative;
}

.hourly-card:hover { background: var(--bg-card-hover); transform: translateY(-1px); }

.hourly-card.now {
  border-color: rgba(245, 158, 11, 0.3);
  background: rgba(245, 158, 11, 0.06);
}

.hourly-card.now::before {
  content: 'Now';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent-amber);
  color: #0b0f1a;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 50px;
}

.hourly-time {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.hourly-card.now .hourly-time { color: var(--accent-amber); }

.hourly-icon { font-size: 1.3rem; line-height: 1; }

.hourly-temp {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
}

.hourly-precip {
  font-size: 10px;
  color: var(--accent-cyan);
  min-height: 14px;
  opacity: 0.8;
}

/* ─── Footer ─────────────────────────────────────────────────────────────── */
.footer {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  padding-top: 8px;
  animation: fadeUp 0.5s 0.55s ease-out both;
}

.footer-coords {
  margin-left: 12px;
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.6;
  letter-spacing: 0.3px;
}

.footer-version {
  margin-left: 12px;
  font-size: 10px;
  color: var(--text-muted);
  opacity: 0.5;
  font-family: var(--font-mono, 'SF Mono', 'Monaco', monospace);
}

@media (max-width: 480px) {
  .footer-coords {
    display: block;
    margin-left: 0;
    margin-top: 2px;
  }
  .footer-version {
    display: block;
    margin-left: 0;
    margin-top: 2px;
  }
  /* Targets: swipe-friendly cards on phones (t_99f554f1) */
  .target-card { width: 150px; }
  .targets-scroll { gap: 8px; }
}

/* ─── Astro hour-grid interactivity (t_238d440c) ─────────────────────────── */
.astro-hours { position: relative; }

.best-bracket {
  position: absolute;
  top: -6px;
  height: calc(100% + 12px);
  border: 1.5px solid rgba(34, 211, 238, 0.55);
  border-radius: 6px;
  background: rgba(34, 211, 238, 0.06);
  pointer-events: none;
}

.astro-hour-dot.best-dot { outline: 1.5px solid rgba(34, 211, 238, 0.7); outline-offset: 1px; }

.astro-hour-dot.dot-flash {
  animation: dotFlash 1.5s ease-out;
}

@keyframes dotFlash {
  0%, 60% { box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.4); }
  100% { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0); }
}

.astro-legend {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 8px;
  font-size: 9px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.astro-legend-item { display: inline-flex; align-items: center; gap: 4px; }

.astro-legend-chip {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  display: inline-block;
}

.astro-dot-tooltip {
  position: fixed;
  z-index: 90;
  min-width: 120px;
  padding: 8px 10px;
  font-size: 11px;
  color: var(--text-primary, #e2e8f0);
  background: rgba(15, 19, 32, 0.95);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}

.astro-dot-tooltip.visible { opacity: 1; transform: translateY(0); }

.astro-dot-tooltip .tt-time { font-weight: 600; margin-bottom: 4px; }
.astro-dot-tooltip .tt-row { display: flex; justify-content: space-between; gap: 10px; line-height: 1.5; }
.astro-dot-tooltip .tt-row b { font-weight: 600; }

/* ─── Loading Spinner ────────────────────────────────────────────────────── */
.weather-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(11, 15, 26, 0.6);
  border-radius: var(--radius);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.weather-loading.visible {
  opacity: 1;
  pointer-events: all;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 2.5px solid var(--border);
  border-top-color: var(--accent-amber);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ─── Skeleton Loading ────────────────────────────────────────────────── */
.card-skeleton {
  position: relative;
  overflow: hidden;
}
.card-skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, rgba(255,255,255,0.04) 30%, rgba(255,255,255,0.09) 50%, rgba(255,255,255,0.04) 70%);
  background-size: 250% 100%;
  animation: shimmer 1.4s infinite linear;
  pointer-events: none;
  border-radius: inherit;
}

.skeleton-row {
  height: 16px;
  border-radius: 6px;
  background: rgba(255,255,255,0.06);
  margin: 8px 0;
}

.skeleton-circle {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  margin: 12px auto;
}

.skeleton-block {
  height: 40px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.06);
  margin: 8px 0;
}

.skeleton-card {
  min-width: 70px;
  height: 100px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.06);
  flex-shrink: 0;
}

.skeleton-grid {
  display: grid;
  gap: 10px;
}

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

/* ─── Shell Error / Empty State ─────────────────────────────────────── */
.shell-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 4px;
  font-size: 12px;
  color: var(--text-secondary);
  background: rgba(245, 158, 11, 0.10);
  border: 1px solid rgba(245, 158, 11, 0.18);
  border-radius: var(--radius-sm);
}

/* ─── Responsive ──────────────────────────────────────────────────────────── */
@media (min-width: 600px) {
  .cards-primary {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .card-weather .weather-main { flex-direction: column; align-items: center; text-align: center; }
  .condition-block { align-items: center; }
  .condition-text { text-align: center; }
}

@media (max-width: 380px) {
  .container { padding: 20px 14px 40px; }
  .card { padding: 18px 16px; }
  .weather-details { grid-template-columns: 1fr 1fr; gap: 10px 14px; }
}

/* ─── Air Quality Card ────────────────────────────────────────────────────── */
.card-air {
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: fadeUp 0.5s 0.45s ease-out both;
}

.air-header { display: flex; flex-direction: column; gap: 4px; }

.air-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.air-badge {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 50px;
  background: rgba(52, 211, 153, 0.12);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.2);
}

.air-badge.good                 { background: rgba(52, 211, 153, 0.12); color: #34d399; border-color: rgba(52, 211, 153, 0.2); }
.air-badge.moderate             { background: rgba(251, 191, 36, 0.12); color: #fbbf24; border-color: rgba(251, 191, 36, 0.2); }
.air-badge.unhealthy-sensitive  { background: rgba(251, 146, 60, 0.12); color: #fb923c; border-color: rgba(251, 146, 60, 0.2); }
.air-badge.unhealthy            { background: rgba(248, 113, 113, 0.12); color: #f87171; border-color: rgba(248, 113, 113, 0.2); }
.air-badge.very-unhealthy       { background: rgba(168, 85, 247, 0.12); color: #a855f7; border-color: rgba(168, 85, 247, 0.2); }
.air-badge.hazardous            { background: rgba(220, 38, 38, 0.15); color: #dc2626; border-color: rgba(220, 38, 38, 0.25); }
.air-badge.very-hazardous       { background: rgba(127, 29, 29, 0.4); color: #fca5a5; border-color: rgba(220, 38, 38, 0.35); }

.air-score-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
  line-height: 1;
}

.air-score {
  font-family: var(--font-serif);
  font-size: 3.2rem;
  font-weight: 700;
  line-height: 1;
}

.air-slash {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  color: var(--text-muted);
}

.air-label {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-left: 4px;
}

/* Score color scale — same as sky quality */
.air-score.s10,
.air-score.s9  { color: #22d3ee; }
.air-score.s8,
.air-score.s7  { color: #34d399; }
.air-score.s6,
.air-score.s5  { color: #fbbf24; }
.air-score.s4,
.air-score.s3  { color: #fb7185; }
.air-score.s2,
.air-score.s1,
.air-score.s0  { color: #64748b; }

.air-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 8px 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.air-metric {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.air-metric-value {
  font-size: 17px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.1;
}

.air-metric-label {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.air-metric-unit {
  font-size: 9px;
  color: var(--text-muted);
}

.air-pollutants {
  display: flex;
  gap: 20px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.air-pollutant {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.air-pollutant-label {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.air-pollutant-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

/* ─── Air Quality Pollen ───────────────────────────────────────────────────── */
.air-pollen {
  display: block;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border, rgba(255,255,255,0.1));
}

.air-pollen-title {
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 8px;
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.air-pollen-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
}

.air-pollen-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 4px;
  border-radius: 8px;
  background: var(--card-bg, rgba(255,255,255,0.05));
}

.air-pollen-name {
  font-size: 0.7rem;
  opacity: 0.6;
  margin-bottom: 2px;
}

.air-pollen-value {
  font-size: 0.85rem;
  font-weight: 600;
}

/* ─── Weather Alerts ───────────────────────────────────────────────────────── */
.alerts-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: fadeUp 0.5s 0.45s ease-out both;
}

.alerts-title {
  display: flex;
  align-items: center;
  gap: 6px;
}

.alerts-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.alert-card {
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.18);
  border-radius: var(--radius);
  padding: 14px 16px;
  backdrop-filter: var(--blur);
}

.alert-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.alert-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.alert-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.alert-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 4px 0 0;
}

.alert-meta {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 6px;
  letter-spacing: 0.04em;
}

/* ─── Lightbox ────────────────────────────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  cursor: zoom-out;
  animation: lbFadeIn 0.2s ease;
}
.lightbox[hidden] { display: none; }
@keyframes lbFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.lightbox-img {
  max-width: 92vw;
  max-height: 92vh;
  border-radius: 10px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
  object-fit: contain;
  cursor: default;
  animation: lbScaleIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes lbScaleIn {
  from { transform: scale(0.85); opacity: 0.5; }
  to   { transform: scale(1);   opacity: 1; }
}
.lightbox-close {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  z-index: 10001;
}
.lightbox-close:hover {
  background: rgba(255,255,255,0.15);
}

/* Lightbox content wrapper: column layout with image and info */
.lightbox-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  max-height: 94vh;
  overflow-y: auto;
}

/* Lightbox info panel: description below the image */
.lightbox-info {
  max-width: 560px;
  width: 88vw;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 18px 22px;
  color: #e2e8f0;
  animation: lbScaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.lightbox-info .lb-info-header {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: #f1f5f9;
}
.lightbox-info .lb-info-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-bottom: 10px;
  font-size: 0.85rem;
}
.lightbox-info .lb-meta-item {
  color: #94a3b8;
}
.lightbox-info .lb-meta-label {
  color: #64748b;
  margin-right: 5px;
}
.lightbox-info .lb-info-desc {
  font-size: 0.88rem;
  line-height: 1.6;
  color: #cbd5e1;
  margin: 0;
}

/* ─── Quote of the Day ─────────────────────────────────────────────────────── */
.quote-of-day {
  text-align: center;
  padding: 8px 16px;
  margin-bottom: 8px;
  font-style: italic;
  opacity: 0.85;
}
.quote-text {
  display: block;
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--text-muted);
}
.quote-author {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  opacity: 0.7;
  margin-top: 2px;
}

/* ─── Utilities ───────────────────────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* Window Controls Overlay (Desktop PWA title bar) */
@media (display-mode: window-controls-overlay) {
  body { padding-top: env(titlebar-area-height, 40px); }
}

/* ─── Settings Panel ──────────────────────────────────────────────────────── */
.settings-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 9000;
  animation: fadeIn 0.2s ease;
}

.settings-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 340px;
  max-width: 90vw;
  height: 100vh;
  background: var(--bg-card, #131826);
  z-index: 9001;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 24px rgba(0,0,0,0.4);
  animation: slideInRight 0.25s ease;
  overflow-y: auto;
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.settings-header h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.settings-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  line-height: 1;
}
.settings-close:hover { background: rgba(255,255,255,0.08); color: var(--text); }

.settings-body { padding: 16px 20px; }

.setting-group { margin-bottom: 22px; }

.setting-label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.setting-options {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.setting-opt {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.setting-opt:hover { background: rgba(255,255,255,0.09); }
.setting-opt.active {
  background: var(--accent, #8b5cf6);
  border-color: var(--accent, #8b5cf6);
  color: #fff;
}

.settings-reset {
  width: 100%;
  background: none;
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-muted);
  padding: 10px;
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  margin-top: 8px;
  font-family: inherit;
  transition: all 0.15s;
}
.settings-reset:hover { background: rgba(255,255,255,0.06); color: var(--text); }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideInRight { from { transform: translateX(100%); } to { transform: translateX(0); } }

