/* ===========================
   AirAware – Responsive CSS
   Premium dark UI · Mobile-first
=========================== */

:root {
  --bg:         #070b14;
  --bg2:        #0d1322;
  --surface:    rgba(255,255,255,0.04);
  --surface2:   rgba(255,255,255,0.07);
  --border:     rgba(255,255,255,0.08);
  --border2:    rgba(255,255,255,0.13);
  --text:       #e2e8f4;
  --muted:      #5a6a85;
  --muted2:     #8899b4;
  --green:      #34d399;
  --green-bg:   rgba(52,211,153,0.12);
  --yellow:     #fbbf24;
  --yellow-bg:  rgba(251,191,36,0.12);
  --red:        #f87171;
  --red-bg:     rgba(248,113,113,0.12);
  --accent:     #818cf8;
  --accent2:    #a78bfa;
  --cyan:       #38bdf8;
  --pink:       #f472b6;
  --radius:     20px;
  --radius-sm:  12px;
  --max-w:      1200px;
  --gap:        16px;
}

/* ────────────── RESET ────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ────────────── UTILITIES ────────────── */
.hidden { display: none !important; }
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 20px;
}

/* ────────────── SPLASH ────────────── */
.splash {
  position: fixed; inset: 0; z-index: 999;
  background: radial-gradient(ellipse at 50% 0%, #1a1060 0%, #070b14 70%);
  display: flex; align-items: center; justify-content: center;
}
.splash-content { text-align: center; animation: fadeUp 0.7s ease both; }
.splash-icon {
  font-size: clamp(56px, 12vw, 80px);
  margin-bottom: 20px; display: block;
  animation: floatIcon 2.5s ease-in-out infinite;
}
.splash-title {
  font-size: clamp(2rem, 8vw, 3rem); font-weight: 800; letter-spacing: -0.03em;
  background: linear-gradient(135deg, #818cf8 0%, #c084fc 50%, #38bdf8 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.splash-tagline { font-size: 0.95rem; color: var(--muted2); margin-top: 10px; letter-spacing: 0.04em; }
.splash-loader {
  width: 180px; height: 2px; background: rgba(255,255,255,0.08);
  border-radius: 99px; margin: 36px auto 0; overflow: hidden;
}
.loader-bar {
  height: 100%; width: 0;
  background: linear-gradient(90deg, #818cf8, #c084fc, #38bdf8);
  border-radius: 99px;
  animation: loadProgress 2s cubic-bezier(.4,0,.2,1) forwards;
}

/* ────────────── APP SHELL ────────────── */
.app { background: linear-gradient(180deg, #0d1630 0%, var(--bg) 160px); }
.main-content { padding-bottom: 60px; }

/* ────────────── HEADER ────────────── */
.header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(7,11,20,0.88);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding-top: 14px; padding-bottom: 14px;
}
.logo {
  font-size: 1.1rem; font-weight: 700;
  display: flex; align-items: center; gap: 7px; white-space: nowrap;
  text-decoration: none; color: var(--text);
}
.logo span {
  background: linear-gradient(135deg, #818cf8, #c084fc);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

/* Desktop nav */
.nav-desktop {
  display: flex; align-items: center; gap: 4px;
  flex: 1; justify-content: center;
}
.nav-link {
  color: var(--muted2); text-decoration: none;
  font-size: 0.85rem; font-weight: 500;
  padding: 7px 14px; border-radius: 99px;
  transition: color 0.2s, background 0.2s;
}
.nav-link:hover {
  color: var(--text);
  background: rgba(255,255,255,0.06);
}

/* Header right */
.header-right { display: flex; align-items: center; gap: 10px; }
.location-badge {
  font-size: 0.68rem; color: var(--muted2);
  background: rgba(255,255,255,0.05); border: 1px solid var(--border);
  padding: 5px 10px; border-radius: 99px;
  max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column; justify-content: center; align-items: center;
  gap: 5px; width: 40px; height: 40px;
  background: rgba(255,255,255,0.05); border: 1px solid var(--border);
  border-radius: 10px; cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}
.hamburger:hover { background: rgba(255,255,255,0.1); }
.ham-line {
  width: 18px; height: 2px;
  background: var(--muted2); border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.hamburger.open .ham-line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open .ham-line:nth-child(2) { opacity: 0; }
.hamburger.open .ham-line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav drawer */
.nav-mobile {
  display: none;
  flex-direction: column;
  border-top: 1px solid var(--border);
  background: rgba(7,11,20,0.97);
  padding: 8px 0 12px;
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.35s ease, padding 0.35s ease;
}
.nav-mobile.open {
  max-height: 300px;
  padding: 8px 0 12px;
}
.nav-mobile-link {
  display: flex; align-items: center; gap: 10px;
  color: var(--muted2); text-decoration: none;
  font-size: 0.95rem; font-weight: 500;
  padding: 13px 24px;
  transition: color 0.2s, background 0.2s;
}
.nav-mobile-link:hover {
  color: var(--text);
  background: rgba(255,255,255,0.04);
}

/* ────────────── SECTIONS ────────────── */
.section { padding: 28px 20px 0; max-width: var(--max-w); margin: 0 auto; }
.section-title {
  font-size: 0.72rem; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}
.section-title::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ────────────── CARDS GRID ────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap);
}
.card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  position: relative; overflow: hidden;
}
.card::after {
  content: ''; position: absolute; inset: 0; border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(255,255,255,0.03) 0%, transparent 60%);
  pointer-events: none;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 16px 40px rgba(0,0,0,0.5); }

.card-header-row {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 10px; gap: 6px;
}
.card-header-row .card-label { margin-bottom: 0; }
.card-label {
  font-size: 0.65rem; color: var(--muted); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.09em;
  margin-bottom: 10px; display: block; line-height: 1.3;
}
.card-value {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 800; line-height: 1;
  margin-bottom: 5px; letter-spacing: -0.02em;
}
.card-sub { font-size: 0.68rem; color: var(--muted2); line-height: 1.4; }

.card-badge {
  display: inline-block;
  font-size: 0.6rem; font-weight: 700; padding: 3px 9px;
  border-radius: 99px; letter-spacing: 0.04em;
  white-space: nowrap; flex-shrink: 0;
  border: 1px solid transparent;
}

/* AQI progress bar inside card */
.card-aqi-bar {
  margin-top: 12px; height: 3px; border-radius: 99px;
  background: rgba(255,255,255,0.08); overflow: hidden;
}
.card-aqi-bar-fill {
  height: 100%; width: 0%; border-radius: 99px;
  background: var(--yellow);
  transition: width 1s ease, background 0.5s ease;
}

/* Risk states */
.risk-low .card-badge   { background: var(--green-bg);  color: var(--green);  border-color: rgba(52,211,153,0.3); }
.risk-moderate .card-badge { background: var(--yellow-bg); color: var(--yellow); border-color: rgba(251,191,36,0.3); }
.risk-high .card-badge  { background: var(--red-bg);    color: var(--red);    border-color: rgba(248,113,113,0.3); }
.risk-low .card-value      { color: var(--green) !important; }
.risk-moderate .card-value { color: var(--yellow) !important; }
.risk-high .card-value     { color: var(--red) !important; }
.risk-low .card-aqi-bar-fill    { background: var(--green); }
.risk-moderate .card-aqi-bar-fill { background: var(--yellow); }
.risk-high .card-aqi-bar-fill   { background: var(--red); }

/* Card accent stripes */
.card--aqi      { border-top: 2px solid var(--yellow); }
.card--exposure { border-top: 2px solid var(--cyan); }
.card--cig      { border-top: 2px solid var(--pink); }
.card--pm       { border-top: 2px solid var(--accent2); }
.risk-low  .card--aqi { border-top-color: var(--green); }
.risk-high .card--aqi { border-top-color: var(--red); }
.card--aqi      .card-value { color: var(--yellow); }
.card--exposure .card-value { color: var(--cyan); }
.card--cig      .card-value { color: var(--pink); }
.card--pm       .card-value { color: var(--accent2); }

/* ────────────── FORM ────────────── */
.form-card {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { margin-bottom: 18px; }
.form-label {
  display: flex; align-items: center; gap: 7px;
  font-size: 0.82rem; font-weight: 500; color: var(--muted2);
  margin-bottom: 9px;
}
.form-input, .form-select {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  color: var(--text); font-size: 0.95rem; font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  -webkit-appearance: none; appearance: none;
}
.form-input:focus, .form-select:focus {
  border-color: var(--accent);
  background: rgba(129,140,248,0.07);
  box-shadow: 0 0 0 3px rgba(129,140,248,0.15);
}
.form-select option { background: #0d1322; color: var(--text); }
.btn-calculate {
  width: 100%; padding: 16px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff; font-size: 1rem; font-weight: 600;
  border: none; border-radius: var(--radius-sm); cursor: pointer;
  font-family: 'Inter', sans-serif; letter-spacing: 0.02em;
  box-shadow: 0 4px 24px rgba(99,102,241,0.35);
  transition: transform 0.15s, box-shadow 0.15s, background 0.3s;
  position: relative; overflow: hidden; min-height: 52px;
}
.btn-calculate::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 60%);
}
.btn-calculate:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(99,102,241,0.5); }
.btn-calculate:active { transform: scale(0.99); }

/* ────────────── HEALTH INSIGHTS ────────────── */
.insights-card {
  display: flex; align-items: flex-start; gap: 16px;
  background: linear-gradient(135deg, rgba(129,140,248,0.08), rgba(56,189,248,0.06));
  border: 1px solid rgba(129,140,248,0.2);
  border-radius: var(--radius); padding: 20px;
  margin-bottom: 12px;
  transition: border-color 0.4s ease;
}
.insights-icon { font-size: 2rem; flex-shrink: 0; line-height: 1; }
.insights-body { flex: 1; min-width: 0; }
.insights-headline {
  font-size: 1rem; font-weight: 700; color: var(--text); margin-bottom: 6px;
}
.insights-detail { font-size: 0.82rem; color: var(--muted2); line-height: 1.6; }

.health-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.health-tag {
  font-size: 0.72rem; font-weight: 600; padding: 5px 12px;
  border-radius: 99px; border: 1px solid transparent;
  display: inline-flex; align-items: center; gap: 5px;
  animation: fadeUp 0.4s ease both;
}
.health-tag.green  { background: var(--green-bg);  color: var(--green);  border-color: rgba(52,211,153,0.3); }
.health-tag.yellow { background: var(--yellow-bg); color: var(--yellow); border-color: rgba(251,191,36,0.3); }
.health-tag.red    { background: var(--red-bg);    color: var(--red);    border-color: rgba(248,113,113,0.3); }
.health-tag.cyan   { background: rgba(56,189,248,0.1); color: var(--cyan); border-color: rgba(56,189,248,0.3); }

/* ────────────── CHART ────────────── */
.chart-card {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  position: relative;
}

/* ────────────── PREDICTIONS ────────────── */
.prediction-row {
  display: flex; gap: 10px;
  overflow-x: auto; padding-bottom: 8px;
  scrollbar-width: none; -ms-overflow-style: none;
}
.prediction-row::-webkit-scrollbar { display: none; }
.pred-card {
  flex: 0 0 90px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 16px; padding: 14px 8px; text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: default;
}
.pred-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.4); }
.pred-time  { font-size: 0.62rem; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
.pred-aqi   { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em; }
.pred-label { font-size: 0.58rem; color: var(--muted2); margin-top: 5px; font-weight: 500; }

/* ────────────── SMART GREEN SUGGESTIONS ────────────── */
.green-suggestions { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }

.suggestion-card {
  display: flex; align-items: flex-start; gap: 14px;
  border-radius: var(--radius); padding: 16px 18px;
  border: 1px solid transparent;
  animation: fadeUp 0.4s ease both;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.suggestion-card:hover { transform: translateX(4px); }

.suggestion-card.sg-green {
  background: rgba(52,211,153,0.06);
  border-color: rgba(52,211,153,0.22);
}
.suggestion-card.sg-yellow {
  background: rgba(251,191,36,0.06);
  border-color: rgba(251,191,36,0.22);
}
.suggestion-card.sg-red {
  background: rgba(248,113,113,0.06);
  border-color: rgba(248,113,113,0.22);
}
.sg-icon { font-size: 1.5rem; flex-shrink: 0; line-height: 1; margin-top: 2px; }
.sg-content { flex: 1; min-width: 0; }
.sg-title {
  font-size: 0.9rem; font-weight: 700; color: var(--text);
  margin-bottom: 4px; display: block;
}
.sg-desc { font-size: 0.78rem; color: var(--muted2); line-height: 1.55; }
.sg-pill {
  display: inline-block; margin-top: 8px;
  font-size: 0.65rem; font-weight: 700; padding: 3px 10px;
  border-radius: 99px;
}
.sg-green .sg-pill  { background: var(--green-bg);  color: var(--green); }
.sg-yellow .sg-pill { background: var(--yellow-bg); color: var(--yellow); }
.sg-red .sg-pill    { background: var(--red-bg);    color: var(--red); }

/* ────────────── TRANSPORT CARD ────────────── */
.transport-card {
  display: flex; align-items: flex-start; gap: 16px;
  background: linear-gradient(135deg, rgba(52,211,153,0.07), rgba(56,189,248,0.05));
  border: 1px solid rgba(52,211,153,0.2);
  border-radius: var(--radius); padding: 20px;
  margin-top: 4px;
}
.transport-icon { font-size: 2.2rem; flex-shrink: 0; }
.transport-body { flex: 1; min-width: 0; }
.transport-title {
  font-size: 0.78rem; font-weight: 700; color: var(--green);
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px;
}
.transport-text { font-size: 0.85rem; color: var(--muted2); line-height: 1.6; }

/* ────────────── RECOMMENDATIONS ────────────── */
.reco-list { display: flex; flex-direction: column; gap: 10px; }
.reco-item {
  display: flex; align-items: flex-start; gap: 13px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 16px; padding: 15px 16px;
  animation: fadeUp 0.4s ease both;
  transition: transform 0.2s;
}
.reco-item:hover { transform: translateX(3px); }
.reco-icon { font-size: 1.3rem; flex-shrink: 0; margin-top: 1px; }
.reco-text strong { display: block; font-size: 0.88rem; font-weight: 600; margin-bottom: 3px; color: var(--text); }
.reco-text span   { font-size: 0.78rem; color: var(--muted2); line-height: 1.5; }
.reco-item.reco-green  { border-color: rgba(52,211,153,0.2);  background: rgba(52,211,153,0.04); }
.reco-item.reco-yellow { border-color: rgba(251,191,36,0.2);  background: rgba(251,191,36,0.04); }
.reco-item.reco-red    { border-color: rgba(248,113,113,0.2); background: rgba(248,113,113,0.04); }

/* ────────────── FOOTER ────────────── */
.footer {
  text-align: center; padding: 30px 20px;
  font-size: 0.7rem; color: var(--muted);
  border-top: 1px solid var(--border); margin-top: 28px;
}
.footer-sub { margin-top: 4px; font-size: 0.65rem; color: var(--muted); opacity: 0.6; }

/* ────────────── ANIMATIONS ────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes floatIcon {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}
@keyframes loadProgress {
  0%   { width: 0%; }
  100% { width: 100%; }
}

/* ══════════════════════════════════════
   RESPONSIVE BREAKPOINTS
══════════════════════════════════════ */

/* ── TABLET: 769px – 1024px ── */
@media (max-width: 1024px) {
  :root { --gap: 14px; }

  .cards-grid { grid-template-columns: repeat(2, 1fr); }
  .nav-desktop { display: none; }
  .hamburger   { display: flex; }
  .nav-mobile  { display: flex; }

  .form-row { grid-template-columns: 1fr 1fr; }
  .section { padding: 22px 16px 0; }
}

/* ── MOBILE: max 768px ── */
@media (max-width: 768px) {
  :root { --gap: 12px; }

  /* Nav */
  .nav-desktop { display: none; }
  .hamburger   { display: flex; }
  .nav-mobile  { display: flex; }
  .location-badge { max-width: 110px; font-size: 0.62rem; }

  /* Cards: 2-column on mobile, then 1-col if very small */
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
  .card { padding: 14px; }
  .card-value { font-size: 1.65rem; }

  /* AQI card full width */
  .card--aqi { grid-column: 1 / -1; }

  /* Form: single column */
  .form-row { grid-template-columns: 1fr; }
  .form-card { padding: 18px; }
  .btn-calculate { font-size: 1rem; padding: 17px; }

  /* Sections */
  .section { padding: 20px 14px 0; }
  .section-title { font-size: 0.68rem; }

  /* Chart: ensure not cropped */
  .chart-card { padding: 14px 10px; }

  /* Insights */
  .insights-card { flex-direction: column; gap: 10px; }
  .insights-icon { font-size: 1.6rem; }
  .insights-headline { font-size: 0.95rem; }

  /* Transport card */
  .transport-card { flex-direction: column; gap: 10px; }

  /* Suggestion cards */
  .suggestion-card { padding: 14px 14px; }

  /* Prediction row cards */
  .pred-card { flex: 0 0 76px; padding: 11px 6px; }
  .pred-aqi  { font-size: 1.15rem; }

  /* Footer */
  .footer { padding: 22px 16px; }
}

/* ── VERY SMALL PHONES: max 420px ── */
@media (max-width: 420px) {
  .cards-grid { grid-template-columns: 1fr; }
  .card--aqi { grid-column: auto; }
  .splash-title { font-size: 1.8rem; }
  .health-tags { gap: 6px; }
}

/* ══════════════════════════════════════
   AI ASSISTANT CHAT WIDGET
══════════════════════════════════════ */

/* ── Floating Action Button ── */
.chat-fab {
  position: fixed;
  bottom: 28px; right: 28px;
  z-index: 500;
  display: flex; align-items: center; gap: 10px;
  padding: 14px 22px 14px 18px;
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: #fff; font-family: 'Inter', sans-serif;
  font-size: 0.88rem; font-weight: 700;
  border: none; border-radius: 99px; cursor: pointer;
  box-shadow: 0 6px 32px rgba(34,197,94,0.45), 0 2px 8px rgba(0,0,0,0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.3s;
  white-space: nowrap;
}
.chat-fab:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 10px 40px rgba(34,197,94,0.55), 0 2px 8px rgba(0,0,0,0.4);
}
.chat-fab:active { transform: scale(0.97); }
.chat-fab-icon { font-size: 1.2rem; line-height: 1; }
.chat-fab-label { letter-spacing: 0.01em; }
.chat-fab-badge {
  position: absolute; top: -4px; right: -4px;
  width: 14px; height: 14px;
  background: #f87171; border-radius: 50%;
  border: 2px solid var(--bg);
  display: none;
}
.chat-fab-badge.show { display: block; animation: pulseBadge 2s ease infinite; }
.chat-fab.open {
  background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
  box-shadow: 0 6px 24px rgba(0,0,0,0.5);
}

/* ── Chat Window ── */
.chat-window {
  position: fixed;
  bottom: 96px; right: 28px;
  z-index: 499;
  width: 370px;
  max-height: 580px;
  display: flex; flex-direction: column;
  background: rgba(13,19,34,0.97);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(34,197,94,0.22);
  border-radius: 24px;
  box-shadow:
    0 24px 80px rgba(0,0,0,0.7),
    0 0 0 1px rgba(255,255,255,0.04) inset;
  overflow: hidden;
  /* hidden state */
  opacity: 0;
  transform: translateY(24px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  transform-origin: bottom right;
}
.chat-window.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* ── Chat Header ── */
.chat-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px;
  background: linear-gradient(135deg, rgba(34,197,94,0.15) 0%, rgba(56,189,248,0.08) 100%);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}
.chat-header-left { display: flex; align-items: center; gap: 12px; }
.chat-avatar {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(34,197,94,0.2);
}
.chat-title { font-size: 0.92rem; font-weight: 700; color: var(--text); line-height: 1.2; }
.chat-status {
  font-size: 0.68rem; color: var(--green);
  display: flex; align-items: center; gap: 5px; margin-top: 2px;
}
.status-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green);
  display: inline-block;
  animation: pulseDot 2s ease infinite;
}
.chat-close {
  width: 32px; height: 32px;
  background: rgba(255,255,255,0.07); border: 1px solid var(--border);
  border-radius: 50%; cursor: pointer; color: var(--muted2);
  font-size: 0.85rem; font-family: 'Inter', sans-serif;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, color 0.2s; flex-shrink: 0;
}
.chat-close:hover { background: rgba(248,113,113,0.15); color: var(--red); border-color: rgba(248,113,113,0.3); }

/* ── Suggestion Pills ── */
.chat-pills {
  display: flex; gap: 6px;
  overflow-x: auto; padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  scrollbar-width: none; flex-shrink: 0;
}
.chat-pills::-webkit-scrollbar { display: none; }
.chat-pill {
  flex-shrink: 0;
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem; font-weight: 600;
  padding: 6px 12px; border-radius: 99px;
  background: rgba(34,197,94,0.08);
  border: 1px solid rgba(34,197,94,0.2);
  color: var(--green); cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, transform 0.15s, border-color 0.2s;
}
.chat-pill:hover {
  background: rgba(34,197,94,0.18);
  border-color: rgba(34,197,94,0.4);
  transform: translateY(-1px);
}
.chat-pill:active { transform: scale(0.96); }

/* ── Messages Area ── */
.chat-messages {
  flex: 1; overflow-y: auto;
  padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.08) transparent;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1); border-radius: 2px;
}

/* ── Individual Messages ── */
.chat-msg {
  display: flex; gap: 8px; align-items: flex-end;
  animation: msgIn 0.28s ease both;
  max-width: 100%;
}
.chat-msg.user { flex-direction: row-reverse; }

.chat-msg-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem; flex-shrink: 0;
}
.chat-msg.ai .chat-msg-avatar   { background: linear-gradient(135deg, #22c55e, #16a34a); }
.chat-msg.user .chat-msg-avatar { background: linear-gradient(135deg, #6366f1, #8b5cf6); }

.chat-msg-bubble {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 0.82rem; line-height: 1.55;
  word-wrap: break-word;
}
.chat-msg.ai .chat-msg-bubble {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text);
  border-bottom-left-radius: 4px;
}
.chat-msg.user .chat-msg-bubble {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: #fff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 12px rgba(34,197,94,0.3);
}

.chat-msg-time {
  font-size: 0.6rem; color: var(--muted); margin-top: 3px;
  display: block; padding: 0 4px;
}
.chat-msg.user .chat-msg-time { text-align: right; }

/* ── Typing Indicator ── */
.chat-typing {
  display: flex; align-items: center; gap: 8px;
  animation: msgIn 0.28s ease both;
}
.chat-typing-bubble {
  display: flex; align-items: center; gap: 5px;
  padding: 12px 16px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px; border-bottom-left-radius: 4px;
}
.typing-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green); opacity: 0.5;
  animation: typingBounce 1.2s ease infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

/* ── Input Row ── */
.chat-input-row {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,0.07);
  background: rgba(0,0,0,0.2);
  flex-shrink: 0;
}
.chat-input {
  flex: 1;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 99px;
  padding: 11px 18px;
  color: var(--text); font-size: 0.85rem;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  min-width: 0;
}
.chat-input:focus {
  border-color: rgba(34,197,94,0.4);
  box-shadow: 0 0 0 3px rgba(34,197,94,0.12);
}
.chat-input::placeholder { color: var(--muted); }
.chat-send {
  width: 40px; height: 40px; flex-shrink: 0;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  border: none; border-radius: 50%; cursor: pointer;
  color: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 14px rgba(34,197,94,0.4);
  transition: transform 0.15s, box-shadow 0.15s;
}
.chat-send:hover { transform: scale(1.1); box-shadow: 0 5px 18px rgba(34,197,94,0.55); }
.chat-send:active { transform: scale(0.94); }

/* ── Nav AI button ── */
.nav-ai-btn {
  background: rgba(34,197,94,0.1);
  border: 1px solid rgba(34,197,94,0.25) !important;
  color: var(--green) !important;
  border-radius: 99px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: background 0.2s, border-color 0.2s;
}
.nav-ai-btn:hover {
  background: rgba(34,197,94,0.2) !important;
  border-color: rgba(34,197,94,0.45) !important;
}

/* ── Animations ── */
@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes typingBounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40%           { transform: translateY(-5px); opacity: 1; }
}
@keyframes pulseDot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.4); }
  50%       { box-shadow: 0 0 0 4px rgba(34,197,94,0); }
}
@keyframes pulseBadge {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.25); }
}

/* ── Mobile overrides for chat ── */
@media (max-width: 768px) {
  .chat-fab { bottom: 20px; right: 16px; padding: 12px 18px 12px 14px; }
  .chat-fab-label { display: none; }
  .chat-fab { border-radius: 50%; width: 56px; height: 56px; justify-content: center; padding: 0; }
  .chat-fab-icon { font-size: 1.5rem; }

  .chat-window {
    right: 0; left: 0; bottom: 0;
    width: 100%; max-height: 75vh;
    border-radius: 24px 24px 0 0;
    border-bottom: none;
    transform: translateY(100%);
  }
  .chat-window.open { transform: translateY(0); }
}

/* ══════════════════════════════════════
   WHY THIS MATTERS SECTION
══════════════════════════════════════ */

/* Chat avatar override for guide persona */
.chat-avatar {
  background: linear-gradient(135deg, #34d399, #22c55e) !important;
}

/* Quote Banner */
.quote-banner {
  display: flex; align-items: center; gap: 16px;
  background: linear-gradient(135deg, rgba(129,140,248,0.08), rgba(52,211,153,0.06));
  border: 1px solid rgba(129,140,248,0.18);
  border-radius: var(--radius); padding: 22px 24px;
  margin-bottom: 20px;
  position: relative; overflow: hidden;
  min-height: 80px;
}
.quote-banner::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--green), var(--cyan));
}
.quote-icon { font-size: 1.6rem; flex-shrink: 0; opacity: 0.7; }
.quote-text {
  font-size: 1.05rem; font-weight: 500; color: var(--text);
  font-style: italic; line-height: 1.55; letter-spacing: 0.01em;
  transition: opacity 0.5s ease;
}
.quote-text.fading { opacity: 0; }

/* Impact Cards Grid */
.impact-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 12px; margin-bottom: 20px;
}
.impact-card {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  position: relative; overflow: hidden;
  animation: fadeUp 0.5s ease both;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.impact-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.45);
}
.impact-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
}
.impact-health::before  { background: linear-gradient(90deg, #f87171, #fb923c); }
.impact-urban::before   { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.impact-climate::before { background: linear-gradient(90deg, #38bdf8, #818cf8); }
.impact-society::before { background: linear-gradient(90deg, #34d399, #22c55e); }

.impact-card-icon { font-size: 1.8rem; margin-bottom: 12px; display: block; }
.impact-card-title {
  font-size: 0.82rem; font-weight: 700; color: var(--text);
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px;
}
.impact-card-body {
  font-size: 0.78rem; color: var(--muted2); line-height: 1.65;
  margin-bottom: 14px;
}
.impact-stat {
  font-size: 0.72rem; color: var(--muted);
  padding-top: 12px; border-top: 1px solid var(--border);
  line-height: 1.4;
}
.impact-stat-num {
  display: block; font-size: 1.6rem; font-weight: 800;
  letter-spacing: -0.03em; margin-bottom: 2px;
  background: linear-gradient(135deg, var(--accent), var(--green));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Facts Ticker */
.facts-ticker {
  overflow: hidden;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 20px;
}
.facts-ticker-inner {
  display: flex; gap: 60px; align-items: center;
  animation: tickerScroll 28s linear infinite;
  white-space: nowrap;
}
.facts-ticker-inner:hover { animation-play-state: paused; }
.fact-item {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.78rem; color: var(--muted2); flex-shrink: 0;
}
.fact-item-icon { font-size: 1rem; }

@keyframes tickerScroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ══════════════════════════════════════
   COMMUNITY AIR WATCH SECTION
══════════════════════════════════════ */

.community-tagline {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 0.83rem; color: var(--muted2); font-style: italic;
  margin-bottom: 18px; padding: 0 2px;
}
.tagline-dot { color: var(--muted); font-size: 1.2rem; }

/* Report Card */
.community-report-card {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px;
  margin-bottom: 20px;
}
.report-card-header {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 20px; padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.report-card-icon { font-size: 1.8rem; flex-shrink: 0; }
.report-card-title { font-size: 0.95rem; font-weight: 700; color: var(--text); }
.report-card-sub   { font-size: 0.75rem; color: var(--muted2); margin-top: 3px; }

.report-textarea {
  resize: none; min-height: 60px; font-family: 'Inter', sans-serif;
  line-height: 1.5;
}

.btn-report {
  width: 100%; padding: 15px;
  background: linear-gradient(135deg, #34d399, #22c55e);
  color: #fff; font-size: 0.95rem; font-weight: 700;
  border: none; border-radius: var(--radius-sm); cursor: pointer;
  font-family: 'Inter', sans-serif; letter-spacing: 0.02em;
  box-shadow: 0 4px 20px rgba(52,211,153,0.35);
  transition: transform 0.15s, box-shadow 0.15s;
  position: relative; overflow: hidden;
}
.btn-report::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent 60%);
}
.btn-report:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(52,211,153,0.5);
}
.btn-report:active { transform: scale(0.99); }

/* Community Feed */
.community-feed-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; padding: 0 2px;
}
.community-feed-title { font-size: 0.82rem; font-weight: 700; color: var(--text); }
.community-feed-count {
  font-size: 0.7rem; color: var(--green); font-weight: 600;
  background: var(--green-bg); border: 1px solid rgba(52,211,153,0.25);
  padding: 3px 10px; border-radius: 99px;
}

.community-feed {
  display: flex; flex-direction: column; gap: 10px;
  margin-bottom: 18px;
}
.feed-item {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 16px; padding: 14px 16px;
  animation: fadeUp 0.35s ease both;
  transition: transform 0.2s;
}
.feed-item:hover { transform: translateX(3px); }
.feed-item-icon {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
}
.feed-item-icon.sev-low    { background: rgba(52,211,153,0.12); }
.feed-item-icon.sev-medium { background: rgba(251,191,36,0.12); }
.feed-item-icon.sev-high   { background: rgba(248,113,113,0.12); }

.feed-item-body { flex: 1; min-width: 0; }
.feed-item-type {
  font-size: 0.82rem; font-weight: 700; color: var(--text);
  margin-bottom: 2px;
}
.feed-item-note { font-size: 0.75rem; color: var(--muted2); line-height: 1.45; }
.feed-item-meta {
  display: flex; gap: 10px; margin-top: 6px; flex-wrap: wrap;
}
.feed-meta-tag {
  font-size: 0.64rem; font-weight: 600; padding: 2px 8px;
  border-radius: 99px; border: 1px solid transparent;
}
.feed-meta-tag.sev-low    { background: var(--green-bg);  color: var(--green);  border-color: rgba(52,211,153,0.25); }
.feed-meta-tag.sev-medium { background: var(--yellow-bg); color: var(--yellow); border-color: rgba(251,191,36,0.25); }
.feed-meta-tag.sev-high   { background: var(--red-bg);    color: var(--red);    border-color: rgba(248,113,113,0.25); }
.feed-meta-time { font-size: 0.64rem; color: var(--muted); display: flex; align-items: center; gap: 3px; }

/* Awareness Banner */
.awareness-banner {
  display: flex; align-items: flex-start; gap: 16px;
  background: linear-gradient(135deg, rgba(52,211,153,0.07), rgba(56,189,248,0.05));
  border: 1px solid rgba(52,211,153,0.18);
  border-radius: var(--radius); padding: 20px;
}
.awareness-icon { font-size: 2rem; flex-shrink: 0; }
.awareness-body { flex: 1; min-width: 0; }
.awareness-title {
  font-size: 0.88rem; font-weight: 700; color: var(--green);
  margin-bottom: 6px;
}
.awareness-text { font-size: 0.8rem; color: var(--muted2); line-height: 1.65; }

/* ── Responsive new sections ── */
@media (max-width: 1024px) {
  .impact-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .impact-grid { grid-template-columns: 1fr; }
  .quote-text { font-size: 0.95rem; }
  .community-tagline { flex-direction: column; align-items: flex-start; gap: 4px; }
  .tagline-dot { display: none; }
  .awareness-banner { flex-direction: column; gap: 10px; }
  .impact-stat-num { font-size: 1.3rem; }
}


