/* The Air Quality page (src/quality/air-twin.js). It shares the Water Quality page's frame (.wqx-*: cards, tabs, law
   cards, the pop-up, print rules) so the two read as one design; only what is particular to air is here.
   Colour comes from tokens only. The six air quality categories are status colours and never appear without their name.
   No rule below sets a font size under 12px. */

.aqx-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* category chip: a dot of colour and always the name */
.aqx-chip { display: inline-flex; align-items: center; gap: 7px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--guide-color-border-strong); background: var(--guide-color-paper); font-size: var(--guide-fs-sm); font-weight: 600; white-space: nowrap; vertical-align: middle; }
.aqx-chip i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.aqx-chip.is-none { font-weight: 400; color: var(--guide-color-ink-soft); border-style: dashed; }

/* headline */
.aqx-worst { margin: 8px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.aqx-counts { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 16px; }
.aqx-counts li { display: inline-flex; align-items: center; gap: 8px; }
.aqx-counts b { font-variant-numeric: tabular-nums; }

/* burning */
.aqx-burn-lead { margin: 0 0 12px; line-height: 1.5; }
.aqx-burn-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.aqx-burn-pick label { font-size: var(--guide-fs-sm); color: var(--guide-color-ink-soft); }
.aqx-burn-pick select { min-height: 40px; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--guide-color-border-strong); background: var(--guide-color-paper); color: var(--guide-color-ink); font: inherit; max-width: 100%; }
.aqx-burn-row { padding: 12px 14px; border-radius: 12px; background: var(--guide-color-bg-1); margin-bottom: 10px; }
.aqx-burn-row p { margin: 0 0 6px; line-height: 1.5; }
.aqx-burn-row p:last-child { margin-bottom: 0; }
#aqx-burn-answer > p { margin: 0 0 10px; padding: 12px 14px; border-radius: 12px; background: var(--guide-color-bg-1); line-height: 1.5; }
.aqx-steps { margin: 4px 0 12px; padding-left: 20px; line-height: 1.6; }

/* one monitor */
.aqx-now { margin: 14px 0 6px; font-size: var(--guide-fs-lg); line-height: 1.45; }
.aqx-do { margin: 0 0 12px; padding: 12px 14px; border-radius: 12px; background: var(--guide-color-bg-1); line-height: 1.5; }
.aqx-do span { color: var(--guide-color-ink-soft); }
.aqx-limits { margin: 12px 0 0; font-size: var(--guide-fs-sm); color: var(--guide-color-ink-soft); line-height: 1.5; }
.aqx h4 { margin: 14px 0 6px; font-size: var(--guide-fs-sm); color: var(--guide-color-ink-muted); font-weight: 600; }
.aqx-off { padding: 12px 0; border-top: 1px solid var(--guide-color-border-subtle); }
.aqx-off-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.aqx-off-fig { margin: 6px 0 8px; line-height: 1.5; }
.aqx-off-fig b { font-size: var(--guide-fs-lg); }
.aqx-off-fig span { color: var(--guide-color-ink-soft); font-size: var(--guide-fs-sm); }
.aqx-areas { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.aqx-areas li { display: grid; gap: 2px; }
.aqx-areas span { font-size: var(--guide-fs-sm); color: var(--guide-color-ink-soft); }

/* map */
.aqx-map { display: block; width: 100%; height: auto; }
.aqx-county { fill: transparent; stroke: var(--guide-color-border-default); stroke-width: 0.7; vector-effect: non-scaling-stroke; }
.aqx-county.has-monitor { fill: color-mix(in srgb, var(--guide-color-lake) 9%, transparent); }
.aqx-site { cursor: pointer; }
.aqx-site-hit { fill: transparent; }
.aqx-site-dot { fill: var(--guide-color-ink-soft); stroke: var(--guide-color-paper); stroke-width: 2; }
.aqx-site.is-hollow .aqx-site-dot { fill: var(--guide-color-paper); stroke: var(--guide-color-ink-soft); stroke-width: 1.5; stroke-dasharray: 3 2; }
.aqx-site:hover .aqx-site-dot, .aqx-site:focus-visible .aqx-site-dot, .aqx-site.is-selected .aqx-site-dot { stroke: var(--guide-color-ink); stroke-width: 3; stroke-dasharray: none; }
.aqx-site:focus { outline: none; }
.aqx-hollow { background: var(--guide-color-paper) !important; outline: 1.5px dashed var(--guide-color-ink-soft); outline-offset: -1.5px; }

/* limit dots: one row a monitor, a shared scale, the limit as a line */
.aqx-ld { list-style: none; margin: 0; padding: 0; }
.aqx-ld-row { display: grid; grid-template-columns: minmax(96px, 30%) minmax(0, 1fr) 52px; align-items: center; gap: 10px; min-height: 30px; }
.aqx-ld-name { text-align: left; border: 0; background: transparent; padding: 4px 0; color: var(--guide-color-link); font: inherit; font-size: var(--guide-fs-sm); cursor: pointer; overflow-wrap: anywhere; }
.aqx-ld-name:hover, .aqx-ld-name:focus-visible { text-decoration: underline; }
.aqx-ld-track { position: relative; height: 30px; border-bottom: 1px solid var(--guide-color-border-subtle); }
.aqx-ld-limit { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--guide-color-ink); }
.aqx-ld-dot { position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--guide-color-lake); box-shadow: 0 0 0 2px var(--guide-color-paper); }
.aqx-ld-row.is-over .aqx-ld-dot { background: var(--guide-color-brick); }
.aqx-ld-row.is-not-enough .aqx-ld-dot { background: var(--guide-color-paper); box-shadow: none; border: 1.5px dashed var(--guide-color-ink-soft); }
.aqx-ld-row.is-over .aqx-ld-fig { font-weight: 700; }
.aqx-ld-row.is-not-enough .aqx-ld-fig { color: var(--guide-color-ink-soft); }
.aqx-ld-fig { text-align: right; font-variant-numeric: tabular-nums; font-size: var(--guide-fs-sm); }
.aqx-ld-axis { min-height: 22px; font-size: var(--guide-fs-xs); color: var(--guide-color-ink-muted); }
.aqx-ld-axis .aqx-ld-track { height: 22px; border: 0; }
.aqx-ld-axis b { position: absolute; bottom: 2px; transform: translateX(-50%); white-space: nowrap; font-weight: 600; color: var(--guide-color-ink); }
.aqx-key-dot { border-radius: 50% !important; background: var(--guide-color-lake) !important; }
.aqx-key-dot.is-hollow { background: var(--guide-color-paper) !important; outline: 1.5px dashed var(--guide-color-ink-soft); outline-offset: -1.5px; }
.aqx-key-limit { width: 2px !important; background: var(--guide-color-ink) !important; border-radius: 0 !important; }

/* monitor by year */
.aqx-grid { border-collapse: separate; border-spacing: 2px; width: 100%; font-size: var(--guide-fs-sm); font-variant-numeric: tabular-nums; }
.aqx-grid th { font-weight: 600; font-size: var(--guide-fs-xs); color: var(--guide-color-ink-muted); padding: 2px 4px; text-align: center; white-space: nowrap; }
.aqx-grid th[scope="row"] { text-align: left; position: sticky; left: 0; background: var(--guide-color-paper); z-index: 1; }
.aqx-grid td { min-width: 30px; height: 30px; text-align: center; border-radius: 4px; color: var(--guide-color-ink); }
.aqx-grid td.is-dark { color: var(--guide-color-white); }
.aqx-grid td.is-none { outline: 1px dotted var(--guide-color-border-default); outline-offset: -3px; }
.aqx-grid td.is-partial { outline: 1px dashed var(--guide-color-ink-soft); outline-offset: -1px; }
.aqx-grid sup { font-size: var(--guide-fs-xs); line-height: 0; margin-left: 1px; }
.aqx-grid tr.is-selected th[scope="row"] { box-shadow: inset 0 -2px 0 var(--guide-color-ink); }
.aqx-rowbtn { border: 0; background: transparent; padding: 4px 2px; color: var(--guide-color-link); font: inherit; font-size: var(--guide-fs-sm); cursor: pointer; text-align: left; white-space: nowrap; }
.aqx-rowbtn:hover, .aqx-rowbtn:focus-visible { text-decoration: underline; }

/* columns by month or year */
.aqx-cols { list-style: none; margin: 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; height: 170px; align-items: end; }
.aqx-cols li { display: grid; grid-template-rows: 16px minmax(0, 1fr) 22px; height: 100%; justify-items: stretch; text-align: center; min-width: 0; }
.aqx-cols b { font-size: var(--guide-fs-xs); font-weight: 600; font-variant-numeric: tabular-nums; overflow: hidden; }
.aqx-col-bar { align-self: end; background: var(--guide-color-brick); border-radius: 4px 4px 0 0; min-width: 0; }
.aqx-cols em { font-style: normal; font-size: var(--guide-fs-xs); color: var(--guide-color-ink-muted); border-top: 1px solid var(--guide-color-border-default); padding-top: 3px; line-height: 1.3; overflow: hidden; white-space: nowrap; }
.aqx-cols li.is-partial .aqx-col-bar { background: color-mix(in srgb, var(--guide-color-brick) 28%, transparent); outline: 1px dashed var(--guide-color-brick); outline-offset: -1px; }
.aqx-cols--years b { font-weight: 400; }

/* a day a cell */
.aqx-strip { display: grid; gap: 4px; }
.aqx-strip-row { display: grid; grid-template-columns: 40px minmax(0, 1fr); align-items: center; gap: 8px; font-size: var(--guide-fs-xs); color: var(--guide-color-ink-muted); }
.aqx-strip-row svg { display: block; width: 100%; height: 26px; background: var(--guide-color-bg-1); border-radius: 4px; }
.aqx-strip-axis div { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.aqx-strip-axis i { font-style: normal; overflow: hidden; white-space: nowrap; }

/* lines: marks in the SVG, words beside it */
.aqx-line { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 2px 6px; }
.aqx-line svg { display: block; width: 100%; height: 120px; overflow: visible; }
.aqx-line--dv svg { height: auto; }
.aqx-line-y { display: flex; flex-direction: column; justify-content: space-between; text-align: right; font-size: var(--guide-fs-xs); color: var(--guide-color-ink-muted); font-variant-numeric: tabular-nums; }
.aqx-line-x { grid-column: 2; display: flex; justify-content: space-between; font-size: var(--guide-fs-xs); color: var(--guide-color-ink-muted); }
.aqx-line-grid { stroke: var(--guide-color-border-subtle); stroke-width: 1; fill: none; vector-effect: non-scaling-stroke; }
.aqx-line-path { stroke: var(--guide-color-lake); stroke-width: 2; fill: none; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.aqx-line-limit { stroke: var(--guide-color-ink); stroke-width: 1.5; stroke-dasharray: 5 4; fill: none; vector-effect: non-scaling-stroke; }
.aqx-hit { fill: transparent; }
.aqx-hit:hover { fill: color-mix(in srgb, var(--guide-color-ink) 7%, transparent); }
.aqx-dv-dot { fill: var(--guide-color-lake); stroke: var(--guide-color-paper); stroke-width: 2; }
.aqx-dv-dot.is-hollow { fill: var(--guide-color-paper); stroke: var(--guide-color-ink-soft); stroke-dasharray: 3 2; }

@media (max-width: 560px) {
  .aqx-ld-row { grid-template-columns: minmax(84px, 34%) minmax(0, 1fr) 44px; gap: 6px; }
  .aqx-cols { height: 140px; }
}

@media print {
  .aqx-burn-pick, .aqx-rowbtn { color: inherit; }
  .aqx-burn, .aqx-off { break-inside: avoid; }
}
