﻿:root {
  --bg: #eef6f0;
  --bg-accent: #dceee2;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-strong: rgba(255, 255, 255, 0.92);
  --surface-dark: #12392d;
  --text: #18352d;
  --muted: #5f766d;
  --line: rgba(24, 53, 45, 0.12);
  --shadow: 0 24px 60px rgba(13, 46, 36, 0.12);
  --shadow-soft: 0 16px 30px rgba(13, 46, 36, 0.08);
  --primary: #1d7a5a;
  --primary-dark: #145a42;
  --primary-soft: rgba(29, 122, 90, 0.12);
  --warning: #ea3323;
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(77, 169, 123, 0.2), transparent 28%),
    radial-gradient(circle at top right, rgba(28, 122, 90, 0.18), transparent 24%),
    linear-gradient(180deg, #f7fbf8 0%, var(--bg) 45%, #e6f1eb 100%);
}

@media (min-width: 769px) {
  html {
    font-size: 14px;
  }
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--text);
  font-family: "Roboto Condensed", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  pointer-events: none;
  z-index: -1;
  border-radius: 999px;
  filter: blur(40px);
}

body::before {
  width: 280px;
  height: 280px;
  top: 90px;
  right: -40px;
  background: rgba(69, 148, 113, 0.18);
}

body::after {
  width: 320px;
  height: 320px;
  bottom: 80px;
  left: -80px;
  background: rgba(242, 169, 59, 0.12);
}

.page-shell {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 28px;
}

.mobile-topbar {
  display: none;
}

.mobile-map-intro {
  display: none;
}

.hero-panel,
.dashboard-frame,
.modal-content {
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
  gap: 24px;
  align-items: stretch;
  padding: 28px;
  border: 1px solid rgba(24, 53, 45, 0.18);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(236, 247, 240, 0.78)),
    linear-gradient(120deg, rgba(31, 119, 90, 0.08), transparent 55%);
  box-shadow: var(--shadow);
}


.hero-copy {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hero-topline {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.desktop-lang-switcher {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.desktop-lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px 5px 7px;
  border-radius: 8px;
  border: 1px solid rgba(24, 53, 45, 0.16);
  background: rgba(255, 255, 255, 0.6);
  color: var(--text);
  font-family: "Roboto Condensed", sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.desktop-lang-btn:hover {
  background: rgba(29, 122, 90, 0.08);
  border-color: rgba(24, 53, 45, 0.24);
}

.desktop-lang-btn.active {
  background: rgba(29, 122, 90, 0.1);
  border-color: rgba(29, 122, 90, 0.3);
  color: var(--green);
}

.flag-icon {
  display: block;
  width: 20px;
  height: 15px;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(24, 53, 45, 0.12);
  object-fit: cover;
  flex-shrink: 0;
}

.flag-romani {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #0b6cc4 0 50%, #2f8f2f 50% 100%);
  flex-shrink: 0;
}

.flag-romani::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  border: 2px solid #c61f1f;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.hero-brand {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.hero-brand img {
  width: clamp(78px, 8vw, 112px);
  height: auto;
  display: block;
}

.eyebrow,
.panel-kicker,
.meta-label {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(18, 57, 45, 0.07);
  color: var(--primary-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-copy h1,
.panel-heading h2,
.sidebar-header h2,
.modal-header h3,
.legend-box h3 {
  margin: 0;
  font-family: "Roboto Condensed", sans-serif;
}

.hero-copy h1 {
  max-width: 13ch;
  font-size: clamp(2.2rem, 3.5vw, 4.2rem);
  line-height: 0.97;
}

.hero-copy p,
.panel-heading p,
.sidebar-header p {
  margin: 0;
  max-width: 58ch;
  color: var(--muted);
  line-height: 1.65;
}

.hero-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.meta-card,
.brand-badge {
  min-height: 126px;
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(24, 53, 45, 0.16);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(238, 246, 240, 0.88));
  box-shadow: var(--shadow-soft);
}

.meta-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.meta-card strong {
  font-size: 1.1rem;
  line-height: 1.35;
}


.main-container {
  margin-top: 24px;
}

.info-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(24, 53, 45, 0.16);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(233, 245, 237, 0.82)),
    linear-gradient(135deg, rgba(29, 122, 90, 0.05), transparent 65%);
  box-shadow: var(--shadow-soft);
}

.info-strip-copy {
  display: grid;
  gap: 8px;
}

.info-strip-copy h2 {
  margin: 0;
  font-family: "Roboto Condensed", sans-serif;
  font-size: clamp(1.2rem, 1.8vw, 1.6rem);
  line-height: 1.1;
}

.info-strip-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.info-chip {
  border: 1px solid rgba(24, 53, 45, 0.18);
  border-radius: 999px;
  padding: 8px 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(236, 246, 240, 0.9));
  color: var(--text);
  font: inherit;
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 8px 14px rgba(13, 46, 36, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.info-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(29, 122, 90, 0.22);
  box-shadow: 0 10px 18px rgba(13, 46, 36, 0.1);
}

.info-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10020;
  padding: 20px;
  background: rgba(10, 26, 20, 0.34);
}

.info-modal.open {
  display: grid;
  place-items: center;
}

.info-modal-card {
  position: relative;
  width: min(760px, 100%);
  max-height: 88vh;
  overflow: auto;
  padding: 26px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(239, 247, 241, 0.94)),
    linear-gradient(135deg, rgba(29, 122, 90, 0.07), transparent 60%);
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.18);
}

.info-modal-card h3 {
  margin: 14px 0 16px;
  font-family: "Roboto Condensed", sans-serif;
  font-size: clamp(1.6rem, 2.3vw, 2.2rem);
  line-height: 1.02;
}

.info-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
}

.info-modal-body {
  display: grid;
  gap: 14px;
  color: var(--text);
  line-height: 1.7;
}

.info-modal-body p {
  margin: 0;
}

.info-modal-body strong {
  color: var(--primary-dark);
}

.ai-chat-toggle {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10020;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 999px;
  padding: 14px 18px;
  background: linear-gradient(135deg, #4caf7d, #6dcf9e);
  color: #fff;
  font: inherit;
  font-weight: 800;
  box-shadow: 0 14px 28px rgba(60, 150, 100, 0.28);
  animation: aiPulse 4.8s ease-in-out infinite;
}

.ai-chat-toggle-badge {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  font-size: 0.88rem;
  font-weight: 900;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

@keyframes aiPulse {
  0%,
  82%,
  100% {
    transform: translateY(0) scale(1);
    box-shadow: 0 14px 28px rgba(60, 150, 100, 0.28);
  }

  88% {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 18px 34px rgba(60, 150, 100, 0.38);
  }

  94% {
    transform: translateY(0) scale(1);
    box-shadow: 0 14px 28px rgba(60, 150, 100, 0.28);
  }
}

.ai-chat-panel {
  position: fixed;
  right: 18px;
  bottom: 82px;
  z-index: 10021;
  width: min(380px, calc(100vw - 24px));
  display: none;
}

.ai-chat-panel.open {
  display: block;
}

.ai-chat-card {
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(239, 247, 242, 0.97));
  border: 1px solid rgba(24, 53, 45, 0.08);
  box-shadow: 0 24px 48px rgba(13, 46, 36, 0.18);
  overflow: hidden;
}

.ai-chat-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 18px 10px;
}

.ai-chat-header h3 {
  margin: 8px 0 0;
  font-family: "Roboto Condensed", sans-serif;
  font-size: 1.3rem;
  line-height: 1.06;
}

.ai-chat-close {
  position: static;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  background: rgba(24, 53, 45, 0.08);
  border: 1px solid rgba(24, 53, 45, 0.08);
  box-shadow: 0 6px 14px rgba(13, 46, 36, 0.08);
}

.ai-chat-body {
  padding: 0 18px 18px;
}

.ai-chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(24, 53, 45, 0.08);
}

.ai-chat-input {
  min-width: 0;
  border: 1px solid rgba(24, 53, 45, 0.1);
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.ai-chat-input:focus {
  outline: none;
  border-color: rgba(29, 122, 90, 0.34);
  box-shadow: 0 0 0 4px rgba(29, 122, 90, 0.12);
}

.ai-chat-send {
  border: 0;
  border-radius: 16px;
  padding: 12px 16px;
  background: linear-gradient(135deg, var(--primary), #2e9b75);
  color: #fff;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 800;
  box-shadow: 0 10px 18px rgba(29, 122, 90, 0.18);
}

.ai-chat-messages {
  display: grid;
  gap: 10px;
  min-height: 220px;
  max-height: 360px;
  overflow: auto;
  padding-right: 4px;
}

.ai-message {
  max-width: 92%;
  border-radius: 18px;
  padding: 12px 14px;
  font-size: 0.92rem;
  line-height: 1.5;
}

.ai-message-user {
  justify-self: end;
  background: linear-gradient(135deg, var(--primary), #2e9b75);
  color: #fff;
  border-bottom-right-radius: 6px;
}

.ai-message-assistant {
  justify-self: start;
  background: rgba(24, 53, 45, 0.07);
  color: var(--text);
  border-bottom-left-radius: 6px;
}

.dashboard-frame {
  padding: 22px;
  border-radius: calc(var(--radius-xl) + 4px);
  border: 1px solid rgba(24, 53, 45, 0.16);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(240, 247, 242, 0.7));
  box-shadow: var(--shadow);
}

.dashboard-main {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(330px, 0.82fr);
  gap: 22px;
  align-items: start;
}

.map-panel,
.sensor-sidebar {
  min-width: 0;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(24, 53, 45, 0.18);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.map-panel {
  padding: 20px;
}

.panel-heading,
.sidebar-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.panel-heading h2,
.sidebar-header h2 {
  margin-top: 12px;
  font-size: clamp(1.5rem, 2vw, 2.1rem);
  line-height: 1.05;
}

.map-stage {
  position: relative;
  overflow: hidden;
  border-radius: calc(var(--radius-xl) - 4px);
  border: 1px solid rgba(24, 53, 45, 0.18);
  background: linear-gradient(180deg, rgba(205, 232, 216, 0.35), rgba(255, 255, 255, 0.5));
}

.mobile-map-controls,
.mobile-sidebar-tabs,
.mobile-param-modal,
.mobile-panel-modal {
  display: none;
}

#map {
  width: 100%;
  height: 74vh;
  min-height: 620px;
  position: relative;
}

/* Leaflet sensor markers */
.sl-circle {
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 800; color: #fff;
  border: 2px solid rgba(255,255,255,0.45);
  box-shadow: 0 1px 5px rgba(0,0,0,0.4);
  cursor: pointer;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
.sl-square {
  position: relative;
  width: 32px; height: 32px; border-radius: 6px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 1px;
  font-size: 10px; font-weight: 800; color: #fff;
  border: 2.5px solid rgba(255,255,255,0.85);
  box-shadow: 0 2px 8px rgba(0,0,0,0.45);
  cursor: pointer;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
.sl-square .sq-unit {
  font-size: 6.5px; font-weight: 700; opacity: 0.88;
  letter-spacing: 0.3px; line-height: 1;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
.sl-square::after {
  content: "★";
  position: absolute;
  top: -7px; right: -7px;
  font-size: 9px; line-height: 1;
  background: #fff;
  color: #555;
  border-radius: 50%;
  width: 13px; height: 13px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.35);
}
.sl-label {
  font-size: 10px; font-weight: 600; color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8), 0 0 6px rgba(0,0,0,0.6);
  white-space: nowrap; margin-top: 2px;
  pointer-events: none; text-align: center;
}
.low-zoom-labels-hidden .sl-label { display: none; }
/* Remove Leaflet default attribution clutter */
.leaflet-control-attribution { font-size: 9px; opacity: 0.5; }

.leaflet-control-attribution { font-size: 9px !important; }
.leaflet-control-zoom { border: none !important; box-shadow: 0 2px 8px rgba(0,0,0,0.2) !important; }
.leaflet-control-zoom a { border-radius: 6px !important; }

.mapbox-sensor-dot:hover {
  opacity: 1 !important;
  filter: brightness(1.1);
}

.sensor-sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px;
  max-height: calc(74vh + 98px);
  overflow: auto;
}

#lastUpdated {
  margin: 0;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(24, 53, 45, 0.05);
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
}

.pollutant-toggle,
.modal-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pollutant-toggle {
  padding: 6px;
  border-radius: 22px;
  border: 1px solid rgba(24, 53, 45, 0.18);
  background: linear-gradient(180deg, rgba(221, 238, 228, 0.9), rgba(236, 246, 240, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.toggle-btn,
.modal-toggle-btn,
.graph-btn,
.reset-map-btn,
.close {
  font: inherit;
}

.toggle-btn,
.modal-toggle-btn {
  padding: 10px 14px;
  border: 1px solid rgba(24, 53, 45, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.pollutant-toggle .toggle-btn {
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(243, 249, 245, 0.9));
  box-shadow: 0 6px 12px rgba(13, 46, 36, 0.06);
  font-weight: 800;
}

.toggle-btn:hover,
.modal-toggle-btn:hover,
.graph-btn:hover,
.reset-map-btn:hover,
.close:hover {
  transform: translateY(-1px);
}

.toggle-btn.active,
.modal-toggle-btn.active {
  border-color: transparent;
  background: linear-gradient(135deg, var(--primary), #2e9b75);
  color: #fff;
  box-shadow: 0 10px 18px rgba(29, 122, 90, 0.24);
}

.sensor-grid {
  display: grid;
  gap: 14px;
}

.sensor {
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(24, 53, 45, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(242, 248, 244, 0.86)),
    linear-gradient(140deg, rgba(29, 122, 90, 0.05), transparent 65%);
  box-shadow: 0 14px 26px rgba(13, 46, 36, 0.06);
}

.sensor-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.label {
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.45;
}

.sensor-tag {
  flex-shrink: 0;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(29, 122, 90, 0.1);
  color: var(--primary-dark);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sensor-tag-clarity {
  background: rgba(242, 169, 59, 0.18);
  color: #9b5d08;
}

.value {
  margin: 16px 0 12px;
  font-size: clamp(1.3rem, 2vw, 1.85rem);
  font-weight: 800;
  line-height: 1.1;
  color: var(--primary);
}

.value.inactive {
  color: var(--warning) !important;
}

.graph-btn {
  width: 100%;
  padding: 12px 14px;
  border: none;
  border-radius: 14px;
  background: #133c30;
  color: #fff;
  font-size: 0.94rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 12px 22px rgba(19, 60, 48, 0.22);
}

.graph-btn:hover {
  background: #0f3127;
}

.desktop-averages {
  margin: 0 0 8px;
}

.desktop-averages[hidden] {
  display: none !important;
}

.desktop-averages .mobile-averages-title {
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.desktop-averages .mobile-average-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.desktop-averages .mobile-average-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  min-height: 44px;
  padding: 8px 10px;
  border-radius: 11px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(238, 246, 240, 0.94));
  border: 1px solid rgba(24, 53, 45, 0.2);
  box-shadow: 0 3px 8px rgba(13, 46, 36, 0.06);
}

.desktop-averages .mobile-average-chip.is-empty {
  background: rgba(24, 53, 45, 0.03);
  border-color: rgba(24, 53, 45, 0.14);
  box-shadow: none;
}

.desktop-averages .mobile-average-label {
  color: var(--muted);
  font-size: 0.6rem;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.desktop-averages .mobile-average-value {
  margin-top: 4px;
  color: var(--primary-dark);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1;
}

.desktop-averages .mobile-average-chip.is-empty .mobile-average-value {
  color: rgba(24, 53, 45, 0.3);
  font-size: 0.76rem;
}

.sensor-grid > .sensor > .graph-btn {
  display: none;
}

.legend {
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(24, 53, 45, 0.18);
  background: linear-gradient(180deg, rgba(18, 57, 45, 0.06), rgba(255, 255, 255, 0.88));
}

.mobile-sidebar-panel {
  display: block;
}

.legend-box {
  display: block;
}

.legend-box h3 {
  margin-bottom: 14px;
  font-size: 1.15rem;
  line-height: 1.2;
}

.legend-box ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.legend-box li {
  position: relative;
  min-height: 28px;
  padding-left: 38px;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.45;
}

.legend-box li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.15rem;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(24, 53, 45, 0.08);
}

.box-good::before {
  background-color: #377e22;
}

.box-moderate::before {
  background-color: #ffff54;
}

.box-sensitive::before {
  background-color: #f2a93b;
}

.box-unhealthy::before {
  background-color: #ea3323;
}

.box-very-unhealthy::before {
  background-color: #75147c;
}

.box-hazardous::before {
  background-color: #75140c;
}

.pm-label div {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.26);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}

.pm-text-above div {
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(19, 60, 48, 0.72);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.14);
}

.leaflet-popup-content {
  font-size: 0.9rem;
}

.low-zoom-labels-hidden .pm-text-above {
  opacity: 0 !important;
  transition: opacity 0.3s ease;
}

.reset-map-btn {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 999;
  border: none;
  border-radius: 999px;
  padding: 12px 16px;
  background: linear-gradient(135deg, var(--primary), #2e9b75);
  color: #fff;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 14px 24px rgba(29, 122, 90, 0.24);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.reset-map-btn.show {
  opacity: 1;
  pointer-events: auto;
}

.sensor .value,
.pm-label {
  transition: opacity 0.3s ease;
  opacity: 1;
}

.sensor .value.fade-out,
.pm-label.fade-out {
  opacity: 0;
}

.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  overflow: auto;
  padding: 28px 16px;
  background: rgba(8, 22, 17, 0.58);
}

.modal-content {
  position: relative;
  width: min(960px, 100%);
  margin: 32px auto;
  padding: 28px;
  border-radius: 30px;
  border: 1px solid rgba(24, 53, 45, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(239, 247, 241, 0.9)),
    linear-gradient(135deg, rgba(29, 122, 90, 0.08), transparent 55%);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.22);
  text-align: center;
}

.modal-header {
  display: grid;
  gap: 10px;
  justify-items: center;
}

.modal-header h3 {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  line-height: 1;
}

.close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(24, 53, 45, 0.08);
  color: var(--text);
  font-size: 1.8rem;
  cursor: pointer;
}

#graphAverage {
  margin: 20px 0 16px;
  color: var(--text);
}

.image-scroll-wrapper {
  overflow: auto;
  border-radius: 24px;
  border: 1px solid rgba(24, 53, 45, 0.18);
  background: linear-gradient(180deg, rgba(220, 238, 226, 0.45), rgba(255, 255, 255, 0.92));
  padding: 16px;
}

#graphImage {
  display: block;
  max-width: 100%;
  max-height: 60vh;
  margin: 0 auto;
  border-radius: 18px;
  object-fit: contain;
  box-shadow: 0 12px 28px rgba(13, 46, 36, 0.14);
}

#copyright {
  margin-top: 20px;
  padding: 0 6px;
  color: var(--muted);
  text-align: center;
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.6;
}

@media (max-width: 1180px) {
  .hero-panel {
    grid-template-columns: 1fr;
  }

  .dashboard-main {
    grid-template-columns: 1fr;
  }

  .hero-copy h1 {
    max-width: 16ch;
  }

  .info-strip {
    flex-direction: column;
    align-items: stretch;
  }

  .info-strip-actions {
    justify-content: flex-start;
  }

  #map {
    min-height: 520px;
    height: 62vh;
  }

  .sensor-sidebar {
    max-height: none;
  }
}

@media (max-width: 768px) {
  .page-shell {
    width: min(100% - 20px, 1440px);
    padding-top: 10px;
  }

  .desktop-lang-switcher {
    display: none;
  }

  .mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    position: sticky;
    top: 8px;
    z-index: 10030;
    margin-bottom: 10px;
    padding: 10px 12px;
    border-radius: 18px;
    border: 1px solid rgba(24, 53, 45, 0.16);
    background:
      linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(237, 247, 241, 0.9)),
      linear-gradient(135deg, rgba(29, 122, 90, 0.06), transparent 65%);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  .mobile-topbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
  }

  .mobile-topbar-brand img {
    width: 44px;
    height: auto;
    flex-shrink: 0;
  }

  .mobile-topbar-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(18, 57, 45, 0.07);
    color: var(--primary-dark);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
  }

  .mobile-topbar-langs {
    position: relative;
  }

  .mobile-lang-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(24, 53, 45, 0.18);
    border-radius: 999px;
    min-height: 38px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.82);
    color: var(--text);
    font: inherit;
    font-size: 0.74rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 6px 12px rgba(13, 46, 36, 0.08);
  }

  .mobile-lang-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 170px;
    padding: 6px;
    border-radius: 16px;
    border: 1px solid rgba(24, 53, 45, 0.18);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 16px 28px rgba(13, 46, 36, 0.14);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  .mobile-lang-menu.open {
    display: grid;
    gap: 4px;
  }

  .mobile-lang-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    border: 1px solid transparent;
    border-radius: 12px;
    min-height: 38px;
    padding: 8px 10px;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 0.78rem;
    line-height: 1;
    font-weight: 700;
    cursor: pointer;
    text-align: left;
    text-decoration: none;
  }

  .mobile-lang-btn:disabled {
    opacity: 0.58;
    cursor: default;
  }

  .mobile-lang-btn.active,
  .mobile-lang-btn:hover {
    background: rgba(29, 122, 90, 0.08);
  }

  .hero-panel {
    display: none;
  }

  .mobile-map-intro {
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
    padding: 14px;
    border-radius: 20px;
    border: 1px solid rgba(24, 53, 45, 0.16);
    background:
      linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(237, 247, 241, 0.9)),
      linear-gradient(135deg, rgba(29, 122, 90, 0.06), transparent 65%);
    box-shadow: var(--shadow-soft);
  }

  .mobile-map-intro h2 {
    margin: 0;
    font-family: "Roboto Condensed", sans-serif;
    font-size: 1.02rem;
    line-height: 1.08;
  }

  .hero-panel,
  .info-strip,
  .dashboard-frame,
  .map-panel,
  .sensor-sidebar,
  .modal-content {
    padding: 14px;
    border-radius: 20px;
  }

  .panel-heading,
  .sidebar-header {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .hero-meta {
    display: none;
  }

  .hero-panel {
    gap: 6px;
    padding: 12px;
  }

  .info-strip {
    margin-bottom: 12px;
    padding: 14px;
    background:
      linear-gradient(135deg, rgba(255, 251, 244, 0.92), rgba(240, 248, 242, 0.9)),
      linear-gradient(135deg, rgba(242, 169, 59, 0.06), transparent 68%);
  }

  .info-strip-copy h2 {
    font-size: 0.96rem;
    line-height: 1.05;
    white-space: nowrap;
  }

  .info-strip-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .info-chip {
    width: 100%;
    text-align: center;
    min-height: 44px;
    padding: 8px 8px;
    font-size: 0.76rem;
    line-height: 1.15;
    white-space: normal;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(243, 249, 245, 0.92));
  }

  .eyebrow,
  .panel-kicker,
  .meta-label {
    padding: 6px 10px;
    font-size: 0.68rem;
  }

  #map {
    height: 62vh;
    min-height: 410px;
  }

  .hero-copy p {
    display: none;
  }

  .hero-copy {
    gap: 8px;
  }

  .hero-brand img {
    width: 46px;
  }

  .hero-topline {
    gap: 8px;
    align-items: center;
  }

  .hero-copy h1 {
    max-width: none;
    font-size: 1.04rem;
    line-height: 1.04;
  }

  .map-panel {
    padding: 8px;
  }

  .panel-heading {
    margin-bottom: 8px;
  }

  .panel-heading p {
    display: none;
  }

  .panel-heading h2 {
    margin-top: 6px;
    font-size: 1.18rem;
    line-height: 1.02;
  }

  .mobile-map-controls {
    display: flex;
    gap: 8px;
    padding: 4px;
    margin-bottom: 10px;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(221, 238, 228, 0.9), rgba(236, 246, 240, 0.92));
    border: 1px solid rgba(24, 53, 45, 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  }

  .mobile-action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: 1px solid rgba(24, 53, 45, 0.18);
    border-radius: 999px;
    padding: 10px 11px;
    background: linear-gradient(135deg, var(--primary), #2e9b75);
    color: #fff;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.18s, color 0.18s, box-shadow 0.18s;
    box-shadow:
      0 8px 16px rgba(29, 122, 90, 0.22),
      inset 0 1px 0 rgba(255, 255, 255, 0.18);
  }

  .mobile-action-btn-secondary {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(238, 246, 240, 0.88));
    color: var(--text);
    box-shadow:
      0 6px 12px rgba(13, 46, 36, 0.06),
      inset 0 1px 0 rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(24, 53, 45, 0.08);
  }

  .mobile-action-btn-secondary:hover {
    background: linear-gradient(180deg, rgba(210, 235, 222, 0.97), rgba(195, 228, 210, 0.95));
    border-color: rgba(24, 53, 45, 0.2);
  }

  .analysis-mobile-row {
    display: flex;
    margin-top: 8px;
  }

  .analysis-mobile-row .analysis-trigger-btn {
    flex: 1;
    justify-content: center;
    padding: 9px 16px;
    font-size: 0.82rem;
    border-radius: 999px;
    background: transparent;
    border: 1.5px solid var(--primary);
    color: var(--primary);
  }

  .sensor-sidebar {
    display: none;
  }

  .pollutant-toggle {
    display: none;
  }

  .sensor-grid {
    gap: 12px;
  }

  .sensor {
    padding: 14px;
  }

  .graph-btn {
    padding: 11px 12px;
  }

  .mobile-param-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(7, 18, 14, 0.56);
    padding: 8px 8px 0;
    align-items: flex-end;
  }

  .mobile-param-modal.open {
    display: flex;
  }

  .mobile-panel-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(10, 26, 20, 0.2);
    padding: 8px 8px 0;
    align-items: flex-end;
  }

  .mobile-panel-modal.open {
    display: flex;
  }

  .mobile-param-sheet {
    width: 100%;
    max-height: 86vh;
    min-height: 76vh;
    border-radius: 24px 24px 0 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(238, 246, 240, 0.96));
    padding: 18px;
    box-shadow: 0 -12px 30px rgba(0, 0, 0, 0.16);
  }

  .mobile-panel-sheet {
    width: 100%;
    max-height: 80vh;
    min-height: 70vh;
    overflow: auto;
    border-radius: 24px 24px 0 0;
    background: #f8fcf9;
    padding: 18px;
    box-shadow: 0 -12px 30px rgba(0, 0, 0, 0.14);
  }

  .mobile-panel-sheet::before {
    content: "";
    display: block;
    width: 54px;
    height: 5px;
    margin: 0 auto 14px;
    border-radius: 999px;
    background: rgba(24, 53, 45, 0.16);
  }

  .mobile-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
  }

  .mobile-panel-header h3 {
    margin: 10px 0 0;
    font-family: "Roboto Condensed", sans-serif;
    font-size: 1.35rem;
    line-height: 1.1;
  }

  .mobile-panel-close {
    position: static;
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    background: rgba(24, 53, 45, 0.08);
    border: 1px solid rgba(24, 53, 45, 0.18);
  }

  .mobile-panel-meta {
    margin: 0 0 14px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(24, 53, 45, 0.05);
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
  }

  .mobile-sensor-param-toggle {
    display: inline-flex;
    gap: 6px;
    margin: 0 0 14px;
    padding: 4px;
    border-radius: 16px;
    border: 1px solid rgba(24, 53, 45, 0.18);
    background: linear-gradient(180deg, rgba(221, 238, 228, 0.88), rgba(238, 246, 240, 0.92));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
  }

  .mobile-sensor-param-btn {
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid rgba(24, 53, 45, 0.18);
    border-radius: 12px;
    min-width: 72px;
    min-height: 36px;
    padding: 8px 12px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(243, 249, 245, 0.9));
    color: var(--text);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 6px 12px rgba(13, 46, 36, 0.06);
    transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease, color 0.18s ease;
  }

  .mobile-sensor-param-btn.active {
    border-color: transparent;
    background: linear-gradient(135deg, var(--primary), #2e9b75);
    color: #fff;
    box-shadow: 0 10px 18px rgba(29, 122, 90, 0.2);
  }


  .mobile-sensor-grid {
    display: grid;
    gap: 8px;
  }

  .mobile-sensor-grid .sensor {
    position: relative;
    padding: 9px 10px 9px 12px;
    border-radius: 16px;
    border: 1px solid rgba(24, 53, 45, 0.2);
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(242, 248, 244, 0.96)),
      linear-gradient(135deg, rgba(29, 122, 90, 0.04), transparent 60%);
    box-shadow: 0 10px 18px rgba(13, 46, 36, 0.05);
  }

  .mobile-sensor-grid .sensor::before {
    content: "";
    position: absolute;
    left: 0;
    top: 10px;
    bottom: 10px;
    width: 3px;
    border-radius: 999px;
    background: linear-gradient(180deg, #2e9b75, #133c30);
  }

  .mobile-sensor-grid .sensor-top {
    gap: 8px;
  }

  .mobile-sensor-grid .label {
    font-size: 0.88rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.01em;
  }

  .mobile-sensor-grid .sensor-tag {
    padding: 3px 7px;
    font-size: 0.6rem;
  }

  .mobile-sensor-grid .value {
    margin: 8px 0 7px;
    font-size: 0.94rem;
    line-height: 1.05;
  }

  .mobile-averages {
    margin: 0 0 2px;
  }

  .mobile-averages[hidden] {
    display: none !important;
  }

  .mobile-averages-title {
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .mobile-average-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }

  .mobile-average-chip {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    min-height: 60px;
    padding: 10px 12px;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(238, 246, 240, 0.94));
    border: 1px solid rgba(24, 53, 45, 0.2);
    box-shadow: 0 4px 10px rgba(13, 46, 36, 0.06);
  }

  .mobile-average-chip.is-empty {
    background: rgba(24, 53, 45, 0.03);
    border-color: rgba(24, 53, 45, 0.14);
    box-shadow: none;
  }

  .mobile-average-label {
    color: var(--muted);
    font-size: 0.65rem;
    font-weight: 800;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }

  .mobile-average-value {
    margin-top: 6px;
    color: var(--primary-dark);
    font-size: 1rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    line-height: 1;
  }

  .mobile-average-chip.is-empty .mobile-average-value {
    color: rgba(24, 53, 45, 0.3);
    font-size: 0.9rem;
  }

  .mobile-sensor-grid .graph-btn-mobile {
    display: none;
  }

  .mobile-legend-content {
    padding: 14px;
  }

  .mobile-param-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
  }

  .mobile-param-header h3 {
    margin: 10px 0 0;
    font-family: "Roboto Condensed", sans-serif;
    font-size: 1.35rem;
    line-height: 1.1;
  }

  .mobile-param-close {
    position: static;
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    background: rgba(24, 53, 45, 0.08);
    border: 1px solid rgba(24, 53, 45, 0.18);
  }

  .mobile-param-options {
    display: grid;
    gap: 10px;
  }

  .mobile-param-option {
    width: 100%;
    border: 1px solid rgba(24, 53, 45, 0.18);
    border-radius: 16px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.86);
    color: var(--text);
    font: inherit;
    font-weight: 800;
    text-align: left;
  }

  .mobile-param-option.active {
    background: linear-gradient(135deg, var(--primary), #2e9b75);
    color: #fff;
    border-color: transparent;
  }

  body.mobile-sheet-active {
    overflow: hidden;
    height: 100vh;
    touch-action: none;
    overscroll-behavior: none;
  }

  .modal {
    padding: 16px 10px;
  }

  .modal-content {
    margin: 18px auto;
    padding-top: 54px;
  }

  .info-modal {
    padding: 12px;
  }

  .info-modal-card {
    width: 100%;
    max-height: 86vh;
    padding: 20px;
    border-radius: 24px;
  }

  .reset-map-btn {
    right: 12px;
    bottom: 12px;
    padding: 9px 12px;
    font-size: 0.82rem;
  }

  .ai-chat-toggle {
    right: 12px;
    bottom: 12px;
    padding: 12px 15px;
  }

  .ai-chat-panel {
    inset: 0;
    width: auto;
    align-items: flex-end;
    padding:
      calc(env(safe-area-inset-top, 0px) + 92px)
      8px
      calc(env(safe-area-inset-bottom, 0px) + 8px);
    background: rgba(10, 26, 20, 0.18);
  }

  .ai-chat-panel.open {
    display: flex;
  }

  .ai-chat-card {
    border-radius: 24px 24px 0 0;
    max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 108px);
    min-height: min(64vh, 560px);
    overflow: auto;
  }

  .ai-chat-card::before {
    content: "";
    display: block;
    width: 54px;
    height: 5px;
    margin: 10px auto 0;
    border-radius: 999px;
    background: rgba(24, 53, 45, 0.16);
  }

  .ai-chat-header {
    position: sticky;
    top: 0;
    z-index: 2;
    padding-top: 14px;
    background: linear-gradient(180deg, rgba(248, 252, 249, 0.98), rgba(248, 252, 249, 0.92));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  .ai-chat-messages {
    min-height: 180px;
    max-height: 240px;
  }
}

@media (max-width: 520px) {
  .mobile-map-intro h2 {
    font-size: 0.94rem;
    line-height: 1.06;
  }

  .hero-copy h1 {
    max-width: none;
    font-size: 0.96rem;
    line-height: 1.06;
  }

  .modal-toggle-btn {
    width: calc(50% - 5px);
    justify-content: center;
  }

  .sensor-top {
    flex-direction: column;
  }

  .value {
    font-size: 1.55rem;
  }

  .legend-box li {
    font-size: 0.9rem;
  }

  #map {
    height: 58vh;
    min-height: 390px;
  }

  .sensor-sidebar {
    display: none;
  }

  .mobile-panel-sheet {
    max-height: 76vh;
    min-height: 66vh;
  }

  .hero-brand img {
    width: 42px;
  }

  .info-strip-copy h2 {
    font-size: 0.88rem;
  }

  .panel-heading h2 {
    font-size: 1.06rem;
  }

  .ai-chat-toggle {
    gap: 8px;
    padding: 11px 13px;
    font-size: 0.82rem;
  }

  .ai-chat-toggle-badge {
    width: 24px;
    height: 24px;
    font-size: 0.74rem;
  }

  .ai-chat-header h3 {
    font-size: 1.16rem;
  }

  .ai-chat-close {
    width: 48px;
    height: 48px;
    background: rgba(24, 53, 45, 0.1);
  }

  .ai-chat-panel {
    padding:
      calc(env(safe-area-inset-top, 0px) + 86px)
      6px
      calc(env(safe-area-inset-bottom, 0px) + 6px);
  }

  .ai-chat-card {
    max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 96px);
    min-height: 60vh;
  }

  .ai-chat-form {
    grid-template-columns: 1fr;
  }

  .ai-chat-send {
    width: 100%;
  }
}





@media (min-width: 1200px) {
  .page-shell {
    width: min(1660px, calc(100% - 54px));
  }

  .hero-panel {
    grid-template-columns: minmax(0, 1.62fr) minmax(280px, 0.62fr);
    gap: 18px;
    padding: 22px;
  }

  .hero-brand img {
    width: clamp(56px, 4vw, 78px);
  }

  .hero-topline {
    gap: 10px;
  }

  .hero-copy {
    gap: 10px;
  }

  .hero-copy h1 {
    max-width: 11ch;
    font-size: clamp(1.55rem, 2.1vw, 2.8rem);
    line-height: 0.98;
  }

  .hero-copy p {
    max-width: 42ch;
    font-size: 0.86rem;
  }

  .hero-meta {
    gap: 12px;
  }

  .meta-card,
  .brand-badge {
    min-height: 92px;
    padding: 14px;
  }

  .meta-card strong {
    font-size: 0.88rem;
    line-height: 1.2;
  }

}
@media (min-width: 1200px) {
  .main-container {
    margin-top: 18px;
  }

  .info-strip {
    gap: 14px;
    margin-bottom: 16px;
    padding: 14px 16px;
  }

  .info-strip-copy h2 {
    font-size: clamp(1rem, 1.35vw, 1.28rem);
  }

  .info-chip {
    padding: 10px 18px;
    font-size: 0.96rem;
  }

  .dashboard-frame {
    padding: 16px;
  }

  .dashboard-main {
    grid-template-columns: minmax(0, 1.52fr) minmax(300px, 0.74fr);
    gap: 16px;
  }

  .map-panel,
  .sensor-sidebar {
    border-radius: 20px;
  }

  .map-panel {
    padding: 14px;
  }

  .sensor-sidebar {
    gap: 14px;
    padding: 14px;
    max-height: calc(62vh + 64px);
  }

  .panel-heading,
  .sidebar-header {
    gap: 12px;
    margin-bottom: 14px;
  }

  .panel-heading h2,
  .sidebar-header h2 {
    font-size: clamp(1.16rem, 1.5vw, 1.6rem);
    line-height: 1;
  }

  .panel-heading p,
  .sidebar-header p {
    font-size: 0.86rem;
    line-height: 1.45;
  }

  #lastUpdated {
    padding: 8px 10px;
    font-size: 0.82rem;
  }

  .pollutant-toggle {
    gap: 8px;
    padding: 5px;
    border-radius: 18px;
  }

  .pollutant-toggle .toggle-btn {
    min-height: 36px;
    padding: 8px 12px;
    font-size: 0.82rem;
    border-radius: 13px;
  }

  #map {
    height: 60vh;
    min-height: 470px;
  }

  .sensor-grid {
    gap: 10px;
  }

  .sensor {
    padding: 12px;
    border-radius: 18px;
  }

  .label {
    font-size: 0.84rem;
    line-height: 1.25;
  }

  .sensor-tag {
    padding: 5px 8px;
    font-size: 0.64rem;
  }

  .value {
    margin: 10px 0 8px;
    font-size: clamp(1.06rem, 1.45vw, 1.36rem);
  }

  .desktop-averages {
    margin: 0 0 4px;
  }

  .desktop-averages .mobile-averages-title {
    margin-bottom: 7px;
    font-size: 0.64rem;
  }

  .desktop-averages .mobile-average-list {
    gap: 6px;
  }

  .desktop-averages .mobile-average-chip {
    min-height: 42px;
    padding: 7px 9px;
    border-radius: 10px;
    justify-content: space-between;
  }

  .desktop-averages .mobile-average-label {
    font-size: 0.56rem;
  }

  .desktop-averages .mobile-average-value {
    font-size: 0.72rem;
  }
}
@media (min-width: 1200px) {
  .page-shell {
    width: min(1760px, calc(100% - 72px));
    padding-top: 16px;
    padding-bottom: 18px;
  }

  .hero-panel {
    grid-template-columns: minmax(0, 1.3fr) minmax(300px, 0.7fr);
    gap: 24px;
    padding: 32px;
    border-radius: 22px;
    min-height: clamp(220px, 26vh, 340px);
    align-items: stretch;
  }

  .hero-brand img {
    width: clamp(52px, 3.5vw, 72px);
  }

  .eyebrow,
  .panel-kicker,
  .meta-label {
    padding: 6px 11px;
    font-size: 0.72rem;
  }

  .hero-copy {
    gap: 14px;
    justify-content: center;
  }

  .hero-copy h1 {
    max-width: 13ch;
    font-size: clamp(1.6rem, 2.2vw, 3rem);
    line-height: 0.96;
  }

  .hero-copy p {
    max-width: 42ch;
    font-size: 0.9rem;
    line-height: 1.5;
  }

  .hero-meta {
    gap: 12px;
    align-self: stretch;
    grid-template-rows: 1fr 1fr;
    align-content: stretch;
  }

  .meta-card {
    min-height: 0;
    padding: 16px 18px;
    border-radius: 18px;
    flex: 1;
  }

  .meta-card strong {
    font-size: 0.9rem;
    line-height: 1.2;
  }

  .main-container {
    margin-top: 12px;
  }

  .info-strip {
    gap: 10px;
    margin-bottom: 12px;
    padding: 12px 14px;
    border-radius: 20px;
  }

  .info-strip-copy {
    gap: 4px;
  }

  .info-strip-copy h2 {
    font-size: clamp(0.86rem, 1vw, 1.02rem);
    line-height: 1.02;
  }

  .info-chip {
    padding: 10px 18px;
    font-size: 0.96rem;
  }

  .dashboard-frame {
    padding: 12px;
    border-radius: 22px;
  }

  .dashboard-main {
    grid-template-columns: minmax(0, 1.62fr) minmax(260px, 0.6fr);
    gap: 12px;
  }

  .map-panel,
  .sensor-sidebar {
    border-radius: 18px;
  }

  .map-panel,
  .sensor-sidebar {
    padding: 12px;
  }

  .panel-heading,
  .sidebar-header {
    gap: 10px;
    margin-bottom: 10px;
  }

  .panel-heading h2,
  .sidebar-header h2 {
    font-size: clamp(0.98rem, 1.1vw, 1.28rem);
    line-height: 0.98;
  }

  .panel-heading p,
  .sidebar-header p {
    font-size: 0.74rem;
    line-height: 1.32;
  }

  #lastUpdated {
    padding: 6px 8px;
    border-radius: 10px;
    font-size: 0.72rem;
  }

  .pollutant-toggle {
    gap: 6px;
    padding: 4px;
    border-radius: 16px;
  }

  .pollutant-toggle .toggle-btn {
    min-height: 30px;
    padding: 6px 10px;
    font-size: 0.72rem;
    border-radius: 11px;
  }

  #map {
    height: 48vh;
    min-height: 340px;
  }

  .reset-map-btn {
    right: 12px;
    bottom: 12px;
    padding: 8px 10px;
    font-size: 0.74rem;
  }

  .sensor-sidebar {
    gap: 10px;
    max-height: calc(48vh + 48px);
  }

  .sensor-grid {
    gap: 8px;
  }

  .sensor {
    padding: 10px;
    border-radius: 14px;
  }

  .label {
    font-size: 0.74rem;
    line-height: 1.16;
  }

  .sensor-tag {
    padding: 4px 6px;
    font-size: 0.56rem;
  }

  .value {
    margin: 8px 0 6px;
    font-size: clamp(0.92rem, 1.05vw, 1.12rem);
    line-height: 1;
  }

  .desktop-averages .mobile-averages-title {
    margin-bottom: 5px;
    font-size: 0.56rem;
  }

  .desktop-averages .mobile-average-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .desktop-averages .mobile-average-chip {
    min-height: 40px;
    padding: 7px 8px;
    border-radius: 10px;
    justify-content: space-between;
  }

  .desktop-averages .mobile-average-label {
    font-size: 0.54rem;
    line-height: 1.05;
  }

  .desktop-averages .mobile-average-value {
    margin-top: 5px;
    font-size: 0.72rem;
    line-height: 1.1;
    word-break: break-word;
  }

  .ai-chat-toggle {
    transform: scale(0.9);
    transform-origin: bottom right;
  }
}
@media (min-width: 1200px) {
  .hero-panel {
    align-items: start;
  }

  .hero-copy {
    justify-content: flex-start;
    padding-top: 4px;
  }

  .hero-topline {
    align-items: center;
    gap: 14px;
    margin-bottom: 2px;
  }

  .hero-brand {
    width: 56px;
    justify-content: center;
  }

  .hero-brand img {
    display: block;
    margin: 0 auto;
  }

  .eyebrow {
    align-self: center;
  }

  .hero-copy h1 {
    margin-top: 2px;
  }

  .hero-copy p {
    max-width: 34ch;
  }

  .hero-meta {
    align-self: start;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }

  .meta-card {
    align-items: flex-start;
  }

  .meta-card .meta-label {
    margin-bottom: auto;
  }

}
@media (min-width: 1200px) {
  .hero-panel {
    grid-template-columns: minmax(0, 2.05fr) minmax(250px, 0.55fr);
  }

  .hero-copy {
    max-width: none;
  }

  .hero-copy h1 {
    max-width: 16ch;
    width: 100%;
  }

  .hero-copy p {
    max-width: 46ch;
  }
}
@media (min-width: 1200px) {
  .hero-panel {
    grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr);
    column-gap: 28px;
  }

  .hero-copy {
    display: grid;
    align-content: start;
    justify-items: start;
  }

  .hero-copy h1 {
    max-width: 13.5ch;
  }

  .hero-copy p {
    max-width: 36ch;
  }

  .hero-meta {
    width: 100%;
    max-width: 430px;
    justify-self: end;
  }
}

/* ── Analysis Button ─────────────────────────────────────── */
.analysis-trigger-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--primary);
  background: transparent;
  color: var(--primary);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
}

.analysis-trigger-btn:hover {
  background: var(--primary);
  color: #fff;
}

.analysis-mobile-row {
  display: none;
}

/* ── Analysis Modal ──────────────────────────────────────── */
.analysis-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(8, 22, 17, 0.58);
  padding: 24px 16px;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
}

.analysis-modal-overlay.open {
  display: flex;
}

.analysis-modal-card {
  position: relative;
  width: min(700px, 100%);
  margin: auto;
  padding: 28px;
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(255,255,255,0.97), rgba(239,247,241,0.94));
  box-shadow: 0 30px 70px rgba(0,0,0,0.22);
}

.analysis-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.da-period-tabs {
  display: flex; gap: 6px;
  margin-bottom: 16px;
}
.da-period-tab {
  flex: 1; padding: 7px 0;
  font-size: 12px; font-weight: 700;
  border: 1.5px solid var(--line); border-radius: 8px;
  background: transparent; color: #5f766d;
  cursor: pointer; transition: all .15s; font-family: inherit;
}
.da-period-tab.active {
  background: var(--primary); color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(46,125,50,0.3);
}

.analysis-modal-eyebrow {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
  margin-bottom: 4px;
}

.analysis-modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.analysis-modal-close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(24,53,45,0.08);
  color: var(--text);
  font-size: 1.4rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.15s;
}

.analysis-modal-close:hover {
  background: rgba(24,53,45,0.16);
}

.analysis-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 48px 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.analysis-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(29,122,90,0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.analysis-charts {
  display: grid;
  gap: 20px;
  margin-bottom: 24px;
}

.analysis-chart-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.analysis-chart-wrap {
  height: 160px;
  background: rgba(29,122,90,0.03);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 8px 4px 4px;
}

.analysis-score-row {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 20px;
  margin-bottom: 16px;
  border-radius: 14px;
  background: rgba(24, 53, 45, 0.04);
  border: 1px solid rgba(24, 53, 45, 0.08);
}

.analysis-score-badge {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #cccccc;
  color: #fff;
  font-size: 26px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.4s;
}

.analysis-score-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.analysis-score-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #5f766d;
}

.analysis-score-desc {
  font-size: 18px;
  font-weight: 700;
  color: #18352d;
}

.analysis-ai-section {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.analysis-ai-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
  margin-bottom: 12px;
}

.analysis-ai-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.analysis-ai-text {
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text);
}

.analysis-ai-text p {
  margin: 0 0 10px;
}

.analysis-ai-text p:last-child {
  margin-bottom: 0;
}

.analysis-section {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px 14px;
  background: rgba(24, 53, 45, 0.04);
  border-radius: 10px;
  line-height: 1.55;
}

.analysis-section:last-child {
  margin-bottom: 0;
}

.analysis-section-icon {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.analysis-section p {
  margin: 0;
  font-size: 14px;
  color: #1a3a2e;
}

/* ── Air Status Banner ───────────────────────────────────── */
.air-status-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 2px 14px rgba(0,0,0,0.07);
  margin-bottom: 20px;
  border-left: 5px solid #cccccc;
  transition: border-color 0.4s, background 0.4s;
}

.air-status-banner.as-good         { border-left-color: #377E22; background: #f2faf0; }
.air-status-banner.as-moderate     { border-left-color: #B2A434; background: #fdfbec; }
.air-status-banner.as-sensitive    { border-left-color: #F2A93B; background: #fef8ed; }
.air-status-banner.as-unhealthy    { border-left-color: #EA3323; background: #fef2f0; }
.air-status-banner.as-veryunhealthy{ border-left-color: #75147C; background: #f9eefa; }

.air-status-icon {
  font-size: 30px;
  flex-shrink: 0;
  line-height: 1;
}

.air-status-body {
  flex: 1;
  min-width: 0;
}

.air-status-question {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #5f766d;
  margin-bottom: 4px;
}

.air-status-answer {
  font-size: 15px;
  font-weight: 700;
  color: #18352d;
  line-height: 1.3;
}

.air-status-pm {
  font-size: 11px;
  color: #5f766d;
  text-align: right;
  white-space: nowrap;
  flex-shrink: 0;
}

.air-status-pm strong {
  font-size: 20px;
  font-weight: 700;
  color: #18352d;
  display: block;
}

.as-trend {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
  color: #fff;
}
.as-trend-up     { background: #EA3323; }
.as-trend-down   { background: #377E22; }
.as-trend-stable { background: #B2A434; }

@media (max-width: 520px) {
  .air-status-banner { gap: 10px; padding: 12px 14px; }
  .air-status-answer { font-size: 13px; }
  .air-status-pm strong { font-size: 16px; }
  .as-trend { font-size: 20px; }
}

/* ── Location Extremes Card ──────────────────────────────── */
.location-extremes-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.loc-extreme {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 2px 14px rgba(0,0,0,0.07);
  border-left: 5px solid #ccc;
  min-width: 0;
}

.loc-extreme.loc-clean   { border-left-color: #377E22; background: #f2faf0; }
.loc-extreme.loc-polluted { border-left-color: #EA3323; background: #fef2f0; }

.loc-extreme-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.loc-clean   .loc-extreme-dot { background: #377E22; color: #fff; }
.loc-polluted .loc-extreme-dot { background: #EA3323; color: #fff; }

.loc-extreme-body {
  min-width: 0;
  flex: 1;
}

.loc-extreme-label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #5f766d;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.loc-extreme-name {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #18352d;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.loc-extreme-value {
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-top: 3px;
}

.loc-clean    .loc-extreme-value { color: #377E22; }
.loc-polluted .loc-extreme-value { color: #EA3323; }

@media (max-width: 520px) {
  .location-extremes-card { grid-template-columns: 1fr; gap: 8px; }
  .loc-extreme { padding: 11px 13px; }
  .loc-extreme-name { font-size: 12px; }
}

/* ── Sensor Pulse Ring (alert markers) ───────────────────── */
.sensor-pulse-ring {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 3px solid var(--pulse-color, #EA3323);
  animation: sensor-pulse 1.8s ease-out infinite;
  pointer-events: none;
}

@keyframes sensor-pulse {
  0%   { transform: scale(0.5); opacity: 0.9; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* ── History Chart Modal ─────────────────────────────────── */
.history-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(8, 22, 17, 0.58);
  padding: 24px 16px;
  align-items: center;
  justify-content: center;
}

.history-modal-overlay.open {
  display: flex;
}

.history-modal-card {
  position: relative;
  width: min(620px, 100%);
  padding: 28px 28px 24px;
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.96), rgba(239,247,241,0.92));
  box-shadow: 0 30px 70px rgba(0,0,0,0.22);
}

.history-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.history-modal-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  line-height: 1.3;
}

.history-modal-close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(24,53,45,0.08);
  color: var(--text);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.15s;
}

.history-modal-close:hover {
  background: rgba(24,53,45,0.16);
}

.history-modal-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
}

.history-modal-params {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.history-modal-windows {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.history-window-btn,
.history-param-btn {
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
}

.history-window-btn {
  padding: 5px 12px;
  font-size: 0.78rem;
}

.history-window-btn.active,
.history-param-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.history-window-btn:not(.active):hover,
.history-param-btn:not(.active):hover {
  border-color: var(--primary);
  color: var(--primary);
}

.history-modal-chart-wrap {
  position: relative;
  height: 220px;
  background: rgba(29,122,90,0.03);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 8px 4px 4px;
}
}

/* ── Daily Analysis ─────────────────────────────────────────── */

.da-daily-trigger-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: linear-gradient(135deg, #1d7a5a 0%, #2c9e72 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.12s;
  white-space: nowrap;
}
.da-daily-trigger-btn:hover { opacity: 0.88; transform: translateY(-1px); }

/* City chart */
.da-city-chart-wrap {
  position: relative;
  height: 220px;
  margin-bottom: 20px;
  background: rgba(29,122,90,0.03);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 8px 4px 4px;
}

/* KPI cards */
.da-critical-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}
.da-kpi-card {
  background: #f4f8f5;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  text-align: center;
}
.da-kpi-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: #7a9b8a;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 5px;
}
.da-kpi-value {
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.25;
}

/* Rankings */
.da-rankings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 20px;
}
.da-rank-group {
  background: #f4f8f5;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
}
.da-rank-clean  { border-left: 3px solid #377E22; }
.da-rank-polluted { border-left: 3px solid #EA3323; }
.da-rank-title {
  font-size: 0.74rem;
  font-weight: 700;
  color: #486258;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}
.da-rank-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 5px;
  font-size: 0.8rem;
}
.da-rank-num {
  font-weight: 800;
  color: #9db8aa;
  min-width: 16px;
  text-align: right;
}
.da-rank-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #2f4f44;
}
.da-rank-val {
  font-weight: 700;
  font-size: 0.76rem;
  white-space: nowrap;
}

/* Sensor section title */
.da-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #486258;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 12px;
}

/* Sensor card grid */
.da-sensor-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.da-sensor-card {
  background: #f4f8f5;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px 8px;
  min-width: 0;
}
.da-sensor-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 4px;
  margin-bottom: 3px;
}
.da-sensor-name {
  font-size: 0.68rem;
  font-weight: 600;
  color: #486258;
  line-height: 1.3;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.da-sensor-type {
  font-size: 0.58rem;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}
.da-clarity   { background: #dbeafe; color: #1d4ed8; }
.da-purpleair { background: #f3e8ff; color: #7e22ce; }
.da-sensor-avg {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 2px;
}
.da-no2-badge {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  color: #1d4ed8;
  background: #dbeafe;
  padding: 1px 6px;
  border-radius: 4px;
  margin-bottom: 3px;
}
.da-mini-chart-wrap {
  position: relative;
  height: 58px;
  margin-top: 5px;
}

/* Day score badge */
.da-day-score-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #f4f8f5;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 18px;
  margin-bottom: 18px;
}
.da-day-score-badge {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 900;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: -1px;
}
.da-day-score-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.da-day-score-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: #7a9b8a;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.da-day-score-desc {
  font-size: 1.05rem;
  font-weight: 800;
}

/* Horizontal bar rankings */
.da-rankings-bars {
  background: #f4f8f5;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 20px;
}
.da-rank-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
  font-size: 0.78rem;
}
.da-rank-bar-row:last-child { margin-bottom: 0; }
.da-rank-bar-name {
  flex: 0 0 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #2f4f44;
  font-size: 0.74rem;
}
.da-rank-bar-track {
  flex: 1;
  height: 8px;
  background: rgba(24,53,45,0.07);
  border-radius: 4px;
  overflow: hidden;
}
.da-rank-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
  min-width: 4px;
}
.da-rank-bar-val {
  flex: 0 0 72px;
  text-align: right;
  font-weight: 700;
  font-size: 0.76rem;
  white-space: nowrap;
}

/* Sensor card extras */
.da-sensor-minmax {
  display: flex;
  gap: 6px;
  margin-bottom: 3px;
  flex-wrap: wrap;
}
.da-sensor-min,
.da-sensor-max {
  font-size: 0.62rem;
  color: #5f766d;
}
.da-sensor-min b { color: #377E22; }
.da-sensor-max b { color: #EA3323; }
.da-sensor-hour {
  color: #9db8aa;
}
.da-sensor-who {
  font-size: 0.62rem;
  font-weight: 700;
  color: #1d4ed8;
  margin-bottom: 3px;
}
.da-sensor-periods {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 3px;
}
.da-period-bad {
  font-size: 0.6rem;
  font-weight: 700;
  color: #EA3323;
}
.da-period-good {
  font-size: 0.6rem;
  font-weight: 700;
  color: #377E22;
}

/* Hourly table toggle */
.da-table-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: #f4f8f5;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #486258;
  cursor: pointer;
  transition: background 0.15s;
  margin-bottom: 14px;
}
.da-table-toggle-btn:hover { background: #e8f1ec; }

.da-hourly-table-wrap {
  margin-bottom: 20px;
}
.da-hourly-table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.da-hourly-table {
  border-collapse: collapse;
  width: 100%;
  min-width: 700px;
  font-size: 0.68rem;
}
.da-hourly-table th {
  background: #f4f8f5;
  color: #486258;
  font-weight: 700;
  font-size: 0.62rem;
  text-align: center;
  padding: 6px 5px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.da-th-hour {
  text-align: left !important;
  padding-left: 10px !important;
  min-width: 44px;
  position: sticky;
  left: 0;
  background: #f4f8f5;
  z-index: 1;
}
.da-hourly-table td {
  text-align: center;
  padding: 4px 5px;
  border-bottom: 1px solid rgba(24,53,45,0.04);
}
.da-td-hour {
  text-align: left !important;
  padding-left: 10px !important;
  font-weight: 700;
  color: #5f766d;
  position: sticky;
  left: 0;
  background: #fff;
  z-index: 1;
  white-space: nowrap;
}
.da-td-null {
  color: #ccc;
}

/* Recommendations */
.da-rec-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.da-rec-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #f4f8f5;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}
.da-rec-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  margin-top: 1px;
}
.da-rec-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.da-rec-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: #486258;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.da-rec-text {
  font-size: 0.78rem;
  color: #2f4f44;
  line-height: 1.4;
}

@media (max-width: 1100px) {
  .da-sensor-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 720px) {
  .da-sensor-grid { grid-template-columns: repeat(2, 1fr); }
  .da-rankings-grid { grid-template-columns: 1fr; }
  .da-critical-grid { grid-template-columns: repeat(2, 1fr); }
  .da-rec-grid { grid-template-columns: 1fr; }
  .da-rank-bar-name { flex: 0 0 120px; }
}
@media (max-width: 420px) {
  .da-sensor-grid { grid-template-columns: 1fr 1fr; }
}