:root {
  --page: #f2f5f4;
  --surface: #ffffff;
  --surface-soft: #f7faf9;
  --ink: #1a2a26;
  --muted: #5b6b66;
  --line: rgba(26, 42, 38, 0.12);
  --accent: #0f766e;
  --accent-soft: #e0efed;
  /* Risk scale. Darkened from the original so 0.72rem bold pill text
     clears 4.5:1 against its own soft background. */
  --low: #2e7d4f;
  --low-soft: #e2f1e8;
  --medium: #8a5c05;
  --medium-soft: #f9efd5;
  --high: #b23d26;
  --high-soft: #fae8e3;
  --veryhigh: #8c2a15;
  --veryhigh-soft: #f5e1da;
  --unknown: #52625d;
  --unknown-soft: #ebeeed;
  /* Plain weather facts (temp, humidity, rain, wind, UV) use this instead
     of the risk scale, so red stays reserved for things that actually
     affect breathing. A 92F day in Sarasota is not an alert. */
  --neutral: #3f5b55;
  --neutral-soft: #e8eeec;
  --aqi-good: #2e7d4f;
  --aqi-good-soft: #e2f1e8;
  --aqi-moderate: #8a5c05;
  --aqi-moderate-soft: #f9efd5;
  --aqi-sensitive: #a94e0c;
  --aqi-sensitive-soft: #faeadb;
  --aqi-unhealthy: #b23d26;
  --aqi-unhealthy-soft: #fae8e3;
  --aqi-very-unhealthy: #7b3fa1;
  --aqi-very-unhealthy-soft: #f0e6f7;
  --aqi-hazardous: #7a2638;
  --aqi-hazardous-soft: #f5e2e7;
  --track: #e5ebe9;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(26, 42, 38, 0.05), 0 10px 26px rgba(26, 42, 38, 0.06);
  --shadow-sm: 0 1px 3px rgba(26, 42, 38, 0.14);
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: "Public Sans", system-ui, sans-serif;
  line-height: 1.4;
  background: var(--page);
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-family: "Newsreader", Georgia, serif;
  font-optical-sizing: auto;
  font-size: clamp(2.1rem, 4.6vw, 3.5rem);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.015em;
}

h2 {
  font-family: "Newsreader", Georgia, serif;
  font-optical-sizing: auto;
  font-size: clamp(1.35rem, 2.1vw, 1.75rem);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 10;
  padding: 10px 12px;
  color: #fff;
  background: var(--ink);
  border-radius: var(--radius-sm);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.wrap {
  width: min(calc(100% - 36px), var(--max));
  margin: 0 auto;
}

/* ---------- Masthead + hero ---------- */

.hero {
  padding: 20px 0 26px;
  background: linear-gradient(180deg, #eaf1ef 0%, var(--page) 100%);
  border-bottom: 1px solid var(--line);
}

.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 18px;
  padding-bottom: 12px;
  margin-bottom: 22px;
  border-bottom: 2px solid var(--ink);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.masthead .masthead-right {
  color: var(--muted);
  font-weight: 700;
}

.masthead .masthead-left strong {
  color: var(--accent);
  font-weight: 800;
}

/* ---------- Data notices ---------- */

.notice-list {
  display: grid;
  gap: 8px;
  margin-bottom: 20px;
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 13px;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.35;
  border-radius: var(--radius-sm);
  border: 1px solid currentColor;
}

.notice[hidden] {
  display: none;
}

.notice::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  margin-top: 5px;
  border-radius: 999px;
  background: currentColor;
}

.notice span {
  color: var(--ink);
  font-weight: 600;
}

.notice-error {
  color: var(--high);
  background: var(--high-soft);
  border-color: color-mix(in srgb, var(--high) 24%, transparent);
}

.notice-warn {
  color: var(--medium);
  background: var(--medium-soft);
  border-color: color-mix(in srgb, var(--medium) 26%, transparent);
}

.hero-eyebrow {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.verdict {
  max-width: 62ch;
  margin-top: 12px;
  font-family: "Newsreader", Georgia, serif;
  font-optical-sizing: auto;
  font-style: italic;
  font-size: clamp(1.05rem, 1.7vw, 1.3rem);
  font-weight: 400;
  line-height: 1.4;
  color: var(--ink);
}

.quick-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  margin-top: 20px;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.quick-nav a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  padding-bottom: 2px;
}

.quick-nav a:hover,
.quick-nav a:focus-visible {
  border-bottom-color: var(--accent);
}


/* ---------- Verdict + advice ---------- */

.advice {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  max-width: 62ch;
  margin-top: 14px;
  padding: 12px 14px;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.4;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
}

.advice::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  margin-top: 6px;
  border-radius: 999px;
  background: var(--accent);
}

/* ---------- Shared bits ---------- */

.micro-label {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.eyebrow {
  display: block;
  margin-bottom: 6px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  padding: 5px 11px;
  color: var(--risk);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--risk-soft);
  border: 1px solid color-mix(in srgb, var(--risk) 26%, transparent);
  border-radius: 999px;
  white-space: nowrap;
}

.status::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: currentColor;
}

.low { color: var(--low); --risk: var(--low); --risk-soft: var(--low-soft); }
.medium { color: var(--medium); --risk: var(--medium); --risk-soft: var(--medium-soft); }
.high { color: var(--high); --risk: var(--high); --risk-soft: var(--high-soft); }
.veryhigh { color: var(--veryhigh); --risk: var(--veryhigh); --risk-soft: var(--veryhigh-soft); }
.unknown { color: var(--unknown); --risk: var(--unknown); --risk-soft: var(--unknown-soft); }
.neutral { color: var(--neutral); --risk: var(--neutral); --risk-soft: var(--neutral-soft); }
.aqi-good { color: var(--aqi-good); --risk: var(--aqi-good); --risk-soft: var(--aqi-good-soft); }
.aqi-moderate { color: var(--aqi-moderate); --risk: var(--aqi-moderate); --risk-soft: var(--aqi-moderate-soft); }
.aqi-sensitive { color: var(--aqi-sensitive); --risk: var(--aqi-sensitive); --risk-soft: var(--aqi-sensitive-soft); }
.aqi-unhealthy { color: var(--aqi-unhealthy); --risk: var(--aqi-unhealthy); --risk-soft: var(--aqi-unhealthy-soft); }
.aqi-very-unhealthy { color: var(--aqi-very-unhealthy); --risk: var(--aqi-very-unhealthy); --risk-soft: var(--aqi-very-unhealthy-soft); }
.aqi-hazardous { color: var(--aqi-hazardous); --risk: var(--aqi-hazardous); --risk-soft: var(--aqi-hazardous-soft); }

.meter {
  height: 6px;
  background: var(--track);
  border-radius: 999px;
  overflow: hidden;
}

.meter > span {
  display: block;
  height: 100%;
  width: var(--value, 0%);
  min-width: 5px;
  background: var(--risk);
  border-radius: inherit;
}

.mono {
  font-family: var(--mono);
}

.unavailable-block {
  padding: 16px 18px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  background: var(--surface);
  border: 1px dashed color-mix(in srgb, var(--muted) 34%, transparent);
  border-radius: var(--radius);
}

/* ---------- Sections ---------- */

main {
  padding: 4px 0 40px;
}

.section {
  padding: 34px 0;
  border-bottom: 1px solid var(--line);
}

.section:last-child {
  border-bottom: 0;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.section-head p {
  max-width: 60ch;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---------- Reading cards ---------- */

.reading-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.reading {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--risk);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.reading-value {
  display: flex;
  align-items: baseline;
  gap: 7px;
  color: var(--ink);
}

.reading-value strong {
  font-family: var(--mono);
  font-size: 2.15rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.03em;
}

.reading-value .unit {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.reading-src {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
}

/* ---------- Allergen strip + trend ---------- */

.allergen-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.allergen {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 52px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--risk);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

.allergen strong {
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}

.allergen span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.subsection-divider {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin: 22px 0 12px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.subsection-divider::after {
  content: "";
  height: 1px;
  background: var(--line);
}

.trend-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.trend-card {
  display: grid;
  gap: 9px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

.trend-card .reading-value strong {
  font-size: 1.55rem;
}

/* ---------- Air quality ---------- */

.air-card {
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.aqi-legend {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 18px;
}

.aqi-legend span {
  display: grid;
  gap: 6px;
  min-width: 0;
  font-size: 0.68rem;
  line-height: 1.2;
}

.aqi-legend span::before {
  content: "";
  height: 6px;
  border-radius: 999px;
  background: var(--risk);
}

.aqi-legend i {
  font-family: var(--mono);
  font-style: normal;
  font-weight: 500;
  color: var(--muted);
}

.aqi-legend b {
  font-weight: 700;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.bar-list {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.85fr) minmax(160px, 1.7fr) minmax(96px, auto);
  gap: 14px;
  align-items: center;
}

.bar-label strong {
  display: block;
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

.bar-label span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
}

.track {
  position: relative;
  min-width: 0;
  height: 8px;
  overflow: hidden;
  background: var(--track);
  border-radius: 999px;
}

.fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--value, 0%);
  min-width: 4px;
  background: var(--risk);
  border-radius: inherit;
}

.range-fill {
  left: var(--start, 0%);
  width: var(--span, 0%);
}

/* Marks the regulatory limit, so the bar reads as "how close to the
   threshold" rather than "fraction of an arbitrary number". */
.tick {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(26, 42, 38, 0.55);
}

/* Wind and dust have no health threshold to scale against, so they get a
   coloured dot and the number instead of a bar making a false claim. */
.bar-row.no-scale {
  grid-template-columns: minmax(150px, 0.85fr) minmax(0, 1fr);
}

.bar-row.no-scale .bar-value {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-align: left;
}

.bar-row.no-scale .bar-value::before {
  content: "";
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--risk);
}

.bar-legend {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 14px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
}

.bar-legend::before {
  content: "";
  width: 2px;
  height: 12px;
  background: rgba(26, 42, 38, 0.55);
}

.bar-value {
  font-family: var(--mono);
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--ink);
  text-align: right;
  white-space: nowrap;
}

/* ---------- Forecast ---------- */

.forecast-panels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.forecast-card {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.forecast-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.forecast-date strong {
  display: block;
  font-family: "Newsreader", Georgia, serif;
  font-optical-sizing: auto;
  font-size: 1.25rem;
  font-weight: 500;
}

.forecast-date span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.forecast-bars {
  display: grid;
  gap: 10px;
}

/* Days 2 and 3 collapse: 24 bars at once is the densest and least-read
   part of the page. Today stays open. */
details.forecast-card > summary {
  cursor: pointer;
  list-style: none;
}

details.forecast-card > summary::-webkit-details-marker {
  display: none;
}

details.forecast-card > summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

details.forecast-card > summary .forecast-top {
  padding-bottom: 0;
  border-bottom: 0;
}

details.forecast-card[open] > summary .forecast-top {
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.summary-hint {
  display: block;
  margin-top: 6px;
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

details.forecast-card[open] .summary-hint::after {
  content: " \2212";
}

details.forecast-card:not([open]) .summary-hint::after {
  content: " +";
}

.forecast-row {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) 118px;
  gap: 10px;
  align-items: center;
}

.forecast-row .label {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.risk-note {
  display: flex;
  align-items: start;
  gap: 8px;
  padding: 10px 12px;
  color: var(--risk);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.35;
  background: var(--risk-soft);
  border-radius: var(--radius-sm);
}

.risk-note::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  margin-top: 4px;
  border-radius: 999px;
  background: currentColor;
}

/* ---------- Regional counts ---------- */

.category-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.category-card {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--risk);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.category-card h3 {
  overflow-wrap: anywhere;
}

.category-total {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.category-total strong {
  font-family: var(--mono);
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
}

.category-total .unit {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.category-total .status {
  margin-left: auto;
}

.component-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0 10px;
  margin: 0;
}

.component-list dt {
  grid-column: 1;
  align-self: center;
  padding-top: 8px;
  font-size: 0.84rem;
  font-weight: 600;
  overflow-wrap: anywhere;
  border-top: 1px solid var(--line);
}

.component-list dd {
  grid-column: 2;
  align-self: center;
  margin: 0;
  padding-top: 8px;
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
  border-top: 1px solid var(--line);
}


/* ---------- Glossary + footer ---------- */

.station-note {
  display: grid;
  gap: 7px;
  margin-top: 14px;
  padding: 15px 17px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
}

.station-note-body {
  max-width: 72ch;
  color: var(--ink);
  font-family: "Newsreader", Georgia, serif;
  font-optical-sizing: auto;
  font-size: 0.98rem;
  line-height: 1.45;
}

.glossary-details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.glossary-details summary {
  cursor: pointer;
  padding: 16px 18px;
  color: var(--ink);
  font-weight: 800;
}

.glossary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 0 18px 18px;
}

.glossary-item {
  display: grid;
  grid-template-columns: minmax(104px, 0.4fr) minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 11px 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.glossary-term {
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1.2;
}

.glossary-copy {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.meta span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.footer {
  display: grid;
  gap: 14px;
  width: min(calc(100% - 36px), var(--max));
  margin: 0 auto 36px;
  padding: 20px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-size: 0.88rem;
}

.footer-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.footer p {
  margin: 0;
}

.footer strong {
  color: var(--ink);
  font-weight: 800;
}

.footer-contact {
  font-size: 0.95rem;
}

.footer-phone,
.footer-link {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.footer-phone:hover,
.footer-phone:focus-visible,
.footer-link:hover,
.footer-link:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-copy {
  font-size: 0.8rem;
}

.footer-emergency {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  padding: 11px 12px;
  color: var(--high);
  font-size: 0.82rem;
  line-height: 1.35;
  background: var(--high-soft);
  border: 1px solid color-mix(in srgb, var(--high) 22%, transparent);
  border-radius: var(--radius-sm);
}

/* ---------- Responsive ---------- */

@media (max-width: 1040px) {
  .category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .forecast-panels {
    grid-template-columns: 1fr;
  }

  .aqi-legend {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .section-head {
    display: grid;
  }

  /* Three cards still fit across a tablet; below this they stack. */
  .reading-grid {
    grid-template-columns: 1fr;
  }

  .glossary-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .wrap,
  .footer {
    width: min(calc(100% - 24px), var(--max));
  }

  .reading-grid,
  .category-grid {
    grid-template-columns: 1fr;
  }


  .aqi-legend {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bar-row,
  .bar-row.no-scale {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .forecast-row {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .forecast-row .bar-value {
    grid-column: 2;
    text-align: left;
  }

  .bar-value {
    text-align: left;
  }

  .forecast-top {
    display: grid;
    gap: 8px;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #121a18;
    --surface: #1a2523;
    --surface-soft: #202c2a;
    --ink: #e6efec;
    --muted: #a3b3ae;
    --line: rgba(230, 239, 236, 0.16);
    --accent: #5eb8ac;
    --accent-soft: #1e3733;
    --low: #6cc98d;
    --low-soft: #1c3226;
    --medium: #e0b055;
    --medium-soft: #352c14;
    --high: #f08a72;
    --high-soft: #3a201a;
    --veryhigh: #f0705a;
    --veryhigh-soft: #3d1c14;
    --unknown: #9aaaa5;
    --unknown-soft: #26302e;
    --neutral: #9fb8b1;
    --neutral-soft: #23302d;
    --aqi-good: #6cc98d;
    --aqi-good-soft: #1c3226;
    --aqi-moderate: #e0b055;
    --aqi-moderate-soft: #352c14;
    --aqi-sensitive: #eb9a5c;
    --aqi-sensitive-soft: #38271a;
    --aqi-unhealthy: #f08a72;
    --aqi-unhealthy-soft: #3a201a;
    --aqi-very-unhealthy: #c39ce0;
    --aqi-very-unhealthy-soft: #2c2338;
    --aqi-hazardous: #e58ba0;
    --aqi-hazardous-soft: #3a2028;
    --track: #2b3835;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 26px rgba(0, 0, 0, 0.28);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  }

  .hero {
    background: linear-gradient(180deg, #17211f 0%, var(--page) 100%);
  }

  .tick,
  .bar-legend::before {
    background: rgba(230, 239, 236, 0.6);
  }
}

@media print {
  body {
    background: #fff;
  }

  .reading,
  .category-card,
  .forecast-card,
  .trend-card,
  .air-card,
  .footer,
  .glossary-details {
    box-shadow: none;
  }

  /* Collapsed days and the glossary should print expanded. */
  details.forecast-card > summary .forecast-top,
  .glossary-details summary {
    border-bottom: 1px solid var(--line);
  }

  .summary-hint,
  .skip-link,
  .quick-nav {
    display: none;
  }
}
