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

:root {
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;

  /* Liquid Glass tokens */
  --glass-bg:        rgba(255, 255, 255, 0.10);
  --glass-bg-heavy:  rgba(255, 255, 255, 0.16);
  --glass-border:    rgba(255, 255, 255, 0.20);
  --glass-border-hi: rgba(255, 255, 255, 0.35);
  --glass-blur: 28px;
  --glass-radii: 28px;
  --glass-shadow: 0 8px 40px rgba(0,0,0,0.30), inset 0 1px 0 rgba(255,255,255,0.20);

  /* Refraction highlight */
  --glass-highlight: linear-gradient(135deg, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0) 60%);

  /* Typography */
  --text-primary:   rgba(255,255,255,0.96);
  --text-secondary: rgba(255,255,255,0.60);
  --text-tertiary:  rgba(255,255,255,0.38);

  /* Accent */
  --accent: #70c8ff;
  --accent-warm: #ffb347;
  --accent-rain: #6bacf8;
  --danger: #ff6b6b;
  --success: #5ee7a8;

  /* Safe areas for iPhone */
  --safe-top: env(safe-area-inset-top, 44px);
  --safe-bot: env(safe-area-inset-bottom, 34px);
}

html { height: 100%; }

body {
  font-family: var(--font);
  background: #07090f;
  color: var(--text-primary);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Animated Background ─────────────────────────────────── */
.bg-scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: linear-gradient(160deg, #0a0e1a 0%, #0f1628 50%, #080d1c 100%);
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  will-change: transform;
  animation: orbFloat 20s ease-in-out infinite alternate;
}

.orb-1 { width: 520px; height: 520px; top: -120px; left: -80px;
  background: radial-gradient(circle, #1a4a8a 0%, #0d2456 70%, transparent 100%);
  animation-duration: 22s; }
.orb-2 { width: 400px; height: 400px; top: 30%; right: -100px;
  background: radial-gradient(circle, #2a6abf 0%, #163c80 70%, transparent 100%);
  animation-duration: 18s; animation-delay: -5s; }
.orb-3 { width: 360px; height: 360px; bottom: 10%; left: 10%;
  background: radial-gradient(circle, #0e3a6e 0%, #09244a 70%, transparent 100%);
  animation-duration: 25s; animation-delay: -10s; }
.orb-4 { width: 280px; height: 280px; bottom: 20%; right: 20%;
  background: radial-gradient(circle, #4a9cc8 0%, #2061a0 60%, transparent 100%);
  animation-duration: 30s; animation-delay: -15s; opacity: 0.35; }

@keyframes orbFloat {
  0%   { transform: translate(0, 0) scale(1); }
  33%  { transform: translate(30px, -40px) scale(1.05); }
  66%  { transform: translate(-20px, 20px) scale(0.97); }
  100% { transform: translate(15px, -15px) scale(1.02); }
}

/* Weather-condition background variations */
body.weather-rain    .orb-1 { background: radial-gradient(circle, #1a3a6e 0%, #0d1f40 70%, transparent 100%); }
body.weather-rain    .orb-2 { background: radial-gradient(circle, #2450a0 0%, #133060 70%, transparent 100%); }
body.weather-sunny   .orb-1 { background: radial-gradient(circle, #4a3000 0%, #2a1900 70%, transparent 100%); }
body.weather-sunny   .orb-2 { background: radial-gradient(circle, #7a5000 0%, #4a3000 70%, transparent 100%); }
body.weather-cloudy  .orb-1 { background: radial-gradient(circle, #2a3040 0%, #161e28 70%, transparent 100%); }
body.weather-night   .orb-1 { background: radial-gradient(circle, #0d0f20 0%, #06080e 70%, transparent 100%); }

/* ── Liquid Glass base ───────────────────────────────────── */
.glass-card {
  position: relative;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--glass-radii);
  box-shadow: var(--glass-shadow);
  overflow: hidden;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.35s ease,
              filter 0.2s ease;
  /* Apply the SVG refraction displacement map rendered by liquid-glass.js */
  filter: url(#lgFilterCard);
  isolation: isolate;
}

/* ── Squircle specular rim (SDF-based continuous gradient) ── */
/* Top edge: primary highlight — brightest at centre, fades to corners */
.glass-card::before {
  content: '';
  position: absolute;
  inset: 0;
  /* Convex surface: brightest strip along top centre, tapering with squircle curve */
  background:
    /* top specular strip */
    linear-gradient(180deg,
      rgba(255,255,255,0.26)  0%,
      rgba(255,255,255,0.10)  18%,
      rgba(255,255,255,0)     50%
    ),
    /* left-edge micro-highlight */
    linear-gradient(90deg,
      rgba(255,255,255,0.10)  0%,
      rgba(255,255,255,0)     30%
    );
  pointer-events: none;
  z-index: 1;
  border-radius: inherit;
}

/* Bottom specular rim — secondary bounce light */
.glass-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg,
    rgba(255,255,255,0.08)  0%,
    rgba(255,255,255,0)     30%
  );
  pointer-events: none;
  z-index: 1;
  border-radius: inherit;
}

/* Active / pressed state:
   Directive from skill: force refraction level → 1.0, decrease blur,
   increase saturation to simulate physical proximity to background. */
.glass-card:active {
  transform: scale(0.985);
  backdrop-filter: blur(18px) saturate(240%);
  -webkit-backdrop-filter: blur(18px) saturate(240%);
  box-shadow: 0 4px 20px rgba(0,0,0,0.40), inset 0 1px 0 rgba(255,255,255,0.28);
}

.glass-bar {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(200%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(200%);
  border-bottom: 1px solid var(--glass-border);
  /* Thin convex lens — shallower displacement than glass-card */
  filter: url(#lgFilterBar);
  isolation: isolate;
  position: relative;
}

/* Specular strip on glass-bar top edge */
.glass-bar::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(255,255,255,0.20) 0%,
    rgba(255,255,255,0.06) 25%,
    rgba(255,255,255,0)    55%
  );
  pointer-events: none;
  z-index: 1;
}

/* ── App Layout ──────────────────────────────────────────── */
.app {
  position: relative;
  z-index: 10;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ── Header ──────────────────────────────────────────────── */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(var(--safe-top) + 12px) 20px 14px;
}

.header-location {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.93rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.location-dot {
  font-size: 0.5rem;
  color: var(--success);
  animation: pulse 2.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.35; }
}

.header-actions { display: flex; gap: 8px; }

.icon-btn {
  width: 38px; height: 38px;
  border: none;
  background: var(--glass-bg-heavy);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-primary);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, transform 0.15s, filter 0.15s;
  -webkit-tap-highlight-color: transparent;
  /* Circular convex lens — uses bar filter (small, thin lens) */
  filter: url(#lgFilterBar);
  isolation: isolate;
  position: relative;
}
.icon-btn:active {
  transform: scale(0.88);
  background: rgba(255,255,255,0.22);
  backdrop-filter: blur(8px) saturate(280%);
  -webkit-backdrop-filter: blur(8px) saturate(280%);
}

/* ── Main Scroll Area ────────────────────────────────────── */
.app-main {
  flex: 1;
  padding: 16px 16px calc(var(--safe-bot) + 20px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ── Section Labels ──────────────────────────────────────── */
.section-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  padding: 0 4px;
  margin-bottom: 8px;
}

.section-label-inner {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

/* ── Hero Card ───────────────────────────────────────────── */
.hero-card {
  padding: 28px 26px 24px;
  /* Override to use the LARGER hero displacement map (more lens depth) */
  filter: url(#lgFilterHero);
}

.hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 6px;
}

.hero-weather-icon {
  font-size: 4.5rem;
  line-height: 1;
  filter: drop-shadow(0 4px 20px rgba(255,200,100,0.4));
  animation: iconFloat 4s ease-in-out infinite;
}

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

.hero-temp-block { text-align: right; }

.hero-temp {
  font-size: 5.5rem;
  font-weight: 300;
  letter-spacing: -0.05em;
  line-height: 1;
  color: var(--text-primary);
}

.hero-feels {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 400;
  margin-top: 4px;
}

.hero-condition {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}
.hero-meta span { display: flex; align-items: center; gap: 4px; }

.hero-updated {
  margin-top: 14px;
  font-size: 0.72rem;
  color: var(--text-tertiary);
}

/* ── Tab Navigation ──────────────────────────────────────── */
.tab-nav {
  display: flex;
  border-radius: 18px;
  border: 1px solid var(--glass-border);
  padding: 4px;
  gap: 2px;
  /* Tab nav is a thin glass strip — bar filter */
  filter: url(#lgFilterBar);
  isolation: isolate;
  position: relative;
}

.tab-btn {
  flex: 1;
  padding: 10px 8px;
  border: none;
  background: transparent;
  border-radius: 14px;
  font-size: 0.83rem;
  font-weight: 600;
  font-family: var(--font);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
  -webkit-tap-highlight-color: transparent;
}

.tab-btn.active {
  background: var(--glass-bg-heavy);
  color: var(--text-primary);
  box-shadow: 0 2px 12px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.18);
}

/* ── Tab Content ─────────────────────────────────────────── */
.tab-content { display: none; animation: fadeUp 0.35s ease; }
.tab-content.active { display: block; }

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

/* ── Hourly Scroll ───────────────────────────────────────── */
.hourly-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 6px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin-bottom: 14px;
}
.hourly-scroll::-webkit-scrollbar { display: none; }

.hourly-card {
  flex: 0 0 auto;
  width: 80px;
  padding: 14px 10px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  text-align: center;
  scroll-snap-align: start;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.2s;
  position: relative;
  overflow: hidden;
  /* Small pill-shaped convex lens */
  filter: url(#lgFilterCard);
  isolation: isolate;
}

.hourly-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 45%;
  /* Squircle-aware specular: top-centre bright, fades toward edges */
  background: linear-gradient(180deg,
    rgba(255,255,255,0.22) 0%,
    rgba(255,255,255,0.08) 30%,
    rgba(255,255,255,0)    60%
  );
  border-radius: inherit;
  pointer-events: none;
  z-index: 1;
}

.hourly-card.now {
  border-color: var(--accent);
  background: rgba(112, 200, 255, 0.14);
  box-shadow: 0 0 20px rgba(112,200,255,0.2);
}

/* Pressed state: refraction → 1.0 analogue (scale boost + saturation jump) */
.hourly-card:active {
  transform: scale(0.92);
  backdrop-filter: blur(14px) saturate(260%);
  -webkit-backdrop-filter: blur(14px) saturate(260%);
}

.hourly-time {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}

.hourly-icon { font-size: 1.5rem; margin-bottom: 8px; }

.hourly-temp {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.hourly-precip {
  font-size: 0.68rem;
  color: var(--accent-rain);
  font-weight: 600;
}

/* ── Precipitation Bar ───────────────────────────────────── */
.precip-bar-card { padding: 18px 20px; }

.precip-bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 60px;
  overflow: hidden;
}

.precip-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  justify-content: flex-end;
}

.precip-bar-fill {
  width: 100%;
  border-radius: 4px 4px 2px 2px;
  transition: height 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  min-height: 3px;
}

.precip-bar-label {
  font-size: 0.56rem;
  font-weight: 600;
  color: var(--text-tertiary);
  white-space: nowrap;
}

/* ── Daily List ──────────────────────────────────────────── */
.daily-list { display: flex; flex-direction: column; gap: 10px; }

.daily-row {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  gap: 14px;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1);
}

.daily-row::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.06) 0%, transparent 100%);
}

.daily-row:active { transform: scale(0.98); }

.daily-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 40px;
}

.daily-icon { font-size: 1.5rem; }

.daily-desc {
  flex: 1;
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.daily-precip-badge {
  font-size: 0.72rem;
  color: var(--accent-rain);
  font-weight: 700;
  min-width: 30px;
  text-align: right;
}

.daily-temps {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.daily-high {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.daily-low {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* ── Temp Range Bar in daily ─────────────────────────────── */
.daily-range-bar {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}
.daily-range-fill {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent-rain), var(--accent-warm));
}

/* ── Metrics Grid ────────────────────────────────────────── */
.metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.metric-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  padding: 18px 16px;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1);
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 45%;
  background: var(--glass-highlight);
  border-radius: inherit;
}

.metric-card:active { transform: scale(0.95); }

.metric-icon {
  font-size: 1.4rem;
  margin-bottom: 8px;
  display: block;
}

.metric-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.metric-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.metric-unit {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-left: 2px;
}

.metric-detail {
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Colored accent glow per metric */
.metric-card.metric-temp  { box-shadow: inset 0 0 40px rgba(255,180,80,0.06);  }
.metric-card.metric-hum   { box-shadow: inset 0 0 40px rgba(100,180,255,0.06); }
.metric-card.metric-wind  { box-shadow: inset 0 0 40px rgba(200,255,220,0.05); }
.metric-card.metric-uv    { box-shadow: inset 0 0 40px rgba(255,230,60,0.06);  }
.metric-card.metric-press { box-shadow: inset 0 0 40px rgba(180,150,255,0.06); }
.metric-card.metric-vis   { box-shadow: inset 0 0 40px rgba(120,220,255,0.06); }
.metric-card.metric-dew   { box-shadow: inset 0 0 40px rgba(80,200,160,0.06);  }
.metric-card.metric-cloud { box-shadow: inset 0 0 40px rgba(200,200,220,0.05); }

/* ── Events List ─────────────────────────────────────────── */
.events-list { display: flex; flex-direction: column; gap: 10px; }

.event-card {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  position: relative;
  overflow: hidden;
}

.event-card.severity-high   { border-color: rgba(255,107,107,0.40); background: rgba(255,107,107,0.07); }
.event-card.severity-medium { border-color: rgba(112,200,255,0.35); background: rgba(112,200,255,0.06); }
.event-card.severity-low    { border-color: var(--glass-border); }

.event-icon {
  font-size: 2rem;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
}

.event-content h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.event-time {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

.event-advice {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.no-events {
  text-align: center;
  padding: 24px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ── Loading Screen ──────────────────────────────────────── */
.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  background: rgba(7, 9, 15, 0.5);
}

.loader-glass {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  background: var(--glass-bg-heavy);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid var(--glass-border-hi);
  border-radius: 28px;
  padding: 40px 48px;
  box-shadow: var(--glass-shadow);
  filter: url(#lgFilterCard);
  isolation: isolate;
}

.loader-ring {
  width: 52px;
  height: 52px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

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

.loader-glass p {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* ── API Modal ───────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
  align-items: flex-end;
  justify-content: center;
  backdrop-filter: blur(30px) brightness(0.6);
  -webkit-backdrop-filter: blur(30px) brightness(0.6);
  padding: 0 16px calc(var(--safe-bot) + 16px);
}

.modal-overlay.show { display: flex; animation: slideUp 0.45s cubic-bezier(0.34,1.56,0.64,1); }

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

.modal-glass {
  width: 100%;
  max-width: 480px;
  background: var(--glass-bg-heavy);
  backdrop-filter: blur(40px) saturate(200%);
  -webkit-backdrop-filter: blur(40px) saturate(200%);
  border: 1px solid var(--glass-border-hi);
  border-radius: 28px;
  padding: 32px 28px 28px;
  box-shadow: var(--glass-shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: center;
  /* Liquid Glass: large convex lens for the modal surface */
  filter: url(#lgFilterHero);
  isolation: isolate;
  position: relative;
}

/* Top specular rim on modal */
.modal-glass::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(255,255,255,0.22) 0%,
    rgba(255,255,255,0.08) 20%,
    rgba(255,255,255,0)    50%
  );
  pointer-events: none;
  z-index: 0;
  border-radius: inherit;
}

.modal-icon { font-size: 2.5rem; }
.modal-glass h2 { font-size: 1.3rem; font-weight: 700; }
.modal-glass p  { font-size: 0.87rem; color: var(--text-secondary); line-height: 1.5; }
.modal-glass a  { color: var(--accent); text-decoration: none; font-weight: 600; }

.modal-glass input {
  width: 100%;
  padding: 14px 18px;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--glass-border-hi);
  border-radius: 16px;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.modal-glass input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(112,200,255,0.15);
}
.modal-glass input::placeholder { color: var(--text-tertiary); }

.btn-primary {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, #3a8ad4, #1a5fa8);
  border: none;
  border-radius: 16px;
  color: white;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 20px rgba(30,100,200,0.4);
  -webkit-tap-highlight-color: transparent;
}
.btn-primary:active { transform: scale(0.97); box-shadow: 0 2px 10px rgba(30,100,200,0.3); }

.modal-hint {
  font-size: 0.72rem;
  color: var(--text-tertiary);
}

/* ── Toast ───────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: calc(var(--safe-bot) + 24px);
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  background: var(--glass-bg-heavy);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 100px;
  padding: 12px 24px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  z-index: 500;
  transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1), opacity 0.3s;
  opacity: 0;
  white-space: nowrap;
  max-width: 90vw;
  text-overflow: ellipsis;
  overflow: hidden;
}
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ── Skeleton shimmer (optional loading state) ───────────── */
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

/* ── Scrollbar hide ──────────────────────────────────────── */
.app-main::-webkit-scrollbar { display: none; }
.app-main { scrollbar-width: none; }

/* ── Media Queries ───────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  /* Already dark — no change needed */
}

@media (min-width: 480px) {
  .app-main { max-width: 520px; margin: 0 auto; }
  .app-header { padding-left: calc((100vw - 520px)/2 + 20px); padding-right: calc((100vw - 520px)/2 + 20px); }
}

@supports not (backdrop-filter: blur(1px)) {
  .glass-card, .glass-bar, .hourly-card, .daily-row, .metric-card, .event-card, .loader-glass, .modal-glass {
    background: rgba(15, 25, 45, 0.92) !important;
  }
}
