body {
  background: #f4f6f9;
}

#map {
  min-height: 360px;
  height: calc(100vh - 360px);
  background: #e9ecef;
  border-radius: 0.5rem;
}

.status-badge {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.75rem;
}

.compound-btn.active {
  font-weight: 600;
}

.chart-wrap {
  position: relative;
  min-height: 320px;
}

.chart-empty {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  color: #6c757d;
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.65);
  border-radius: 0.5rem;
}

.map-fallback {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6c757d;
  text-align: center;
  padding: 1rem;
}

.chart-controls {
  margin-bottom: 0.75rem;
}

.compound-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.compound-selector .compound-btn {
  flex: 1 1 110px;
}

.station-dropdown .dropdown-toggle {
  text-align: left;
  position: relative;
  padding-right: 2rem;
  font-size: 1rem;
  font-weight: 700;
  border-color: #495057;
  color: #212529;
}

.station-dropdown .dropdown-toggle::after {
  display: none;
}

.station-dropdown .dropdown-toggle::before {
  content: "";
  position: absolute;
  right: 0.75rem;
  top: 50%;
  margin-top: -0.15rem;
  border-left: 0.3rem solid transparent;
  border-right: 0.3rem solid transparent;
  border-top: 0.35rem solid currentColor;
  opacity: 0.8;
}

.station-dropdown .dropdown-toggle .selected-content {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 0.5rem;
}

.station-dropdown .dropdown-toggle .selected-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.station-dropdown .dropdown-toggle .selected-status {
  flex: 0 0 auto;
}

.station-dropdown .dropdown-toggle .selected-updated-inline {
  flex: 0 0 auto;
  font-size: 0.72rem;
  color: #6c757d;
  white-space: nowrap;
}

.station-dropdown .dropdown-menu {
  width: 100%;
}

.hourly-info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  margin-left: 0.25rem;
  border: 1px solid #6c757d;
  border-radius: 999px;
  background: transparent;
  color: #6c757d;
  font-size: 0.65rem;
  line-height: 1;
  vertical-align: middle;
}

.aqhi-widget-inner { display: flex; align-items: center; gap: 1rem; padding: 0.75rem 1rem; border-radius: 0.5rem; background: #dde3ed; border: 1px solid #b0bcce; }
.aqhi-widget-text { flex: 1; }
.aqhi-badge { display: inline-flex; align-items: center; justify-content: center; width: 3.5rem; height: 3.5rem; border-radius: 50%; font-size: 1.5rem; font-weight: 700; flex-shrink: 0; color: #fff; }
.aqhi-widget-label { font-size: 0.75rem; color: #6c757d; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.1rem; }
.aqhi-widget-risk { font-size: 1rem; font-weight: 600; }
.aqhi-widget-link { font-size: 0.7rem; color: #6c757d; text-decoration: underline; }

/* AQHI details popover */
.aqhi-details-anchor { position: relative; margin-left: auto; align-self: center; }
.aqhi-details-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.25rem; height: 1.25rem;
  border: 1px solid #6c757d; border-radius: 50%;
  background: transparent; color: #6c757d;
  font-size: 0.7rem; cursor: pointer; line-height: 1;
  padding: 0;
}
.aqhi-details-btn:hover { background: #e9ecef; color: #495057; border-color: #495057; }
.aqhi-popover {
  display: none;
  position: absolute; right: 0; top: calc(100% + 8px);
  z-index: 200;
  background: #fff; border: 1px solid #dee2e6; border-radius: 0.5rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  padding: 0.75rem 1rem; min-width: 280px;
  white-space: nowrap;
}
.aqhi-popover::after {
  content: ""; position: absolute; right: 0.4rem; bottom: 100%;
  border: 6px solid transparent; border-bottom-color: #dee2e6;
}
.aqhi-popover::before {
  content: ""; position: absolute; right: 0.45rem; bottom: calc(100% - 1px);
  border: 6px solid transparent; border-bottom-color: #fff; z-index: 1;
}
.aqhi-details-anchor:hover .aqhi-popover,
.aqhi-details-anchor:focus-within .aqhi-popover { display: block; }
.aqhi-popover-title { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: #6c757d; margin-bottom: 0.5rem; }
.aqhi-popover-table { width: 100%; border-collapse: collapse; font-size: 0.75rem; }
.aqhi-popover-table th { color: #6c757d; font-weight: 600; padding: 2px 8px 4px 0; border-bottom: 1px solid #dee2e6; }
.aqhi-popover-table td { padding: 3px 8px 3px 0; border-bottom: 1px solid #f1f3f5; }
.aqhi-popover-table tr:last-child td { border-bottom: none; }
