/* Good Air web: one stylesheet for the air quality, alerts, guide, tracker and blog pages.
   Rewritten 2 November 2026 from four stacked layers (v1, v2, Plain, Craft) into one, on a small
   set of tokens. The rules it keeps:
   - two text colours (--text, --muted); colour elsewhere only where it carries the AQI or a status
   - no letter-spacing except on display numerals, no uppercase, no italics, no dividers or bordered boxes
   - tappable things look tappable (filled pills and chips); labels read as plain text
   - words sit 12px or more inside a card; no unit or note alone on a line; no truncated copy
   - one type scale (whole pixels), three weights (400, 600, 700; 300 for big numerals), five radii */

/* ---------- tokens ---------- */
:root {
  --bg: #ffffff; --card: #f2f2f7; --card2: #e9e9ee; --elev: #ffffff;
  --text: #000000; --muted: #6e6e73;
  --accent: #007aff; --btn-bg: #000000; --btn-text: #ffffff; --seg-on: #ffffff;
  --ok: #24a148; --care: #b98900; --limit: #e26a00; --avoid: #d92d20;
  --float: 0 6px 24px rgba(0, 0, 0, .14);
  /* type: 11 tab labels, 12 captions, 13 meta, 14 secondary, 15 rows, 16 body, 17 prose */
  --fs-tab: 11px; --fs-cap: 12px; --fs-meta: 13px; --fs-sm: 14px; --fs-row: 15px; --fs-body: 16px; --fs-prose: 17px;
  --h1: clamp(28px, 4.2vw, 40px); --h2: clamp(20px, 2.3vw, 24px);
  /* radii: swatches, badges, inputs and thumbnails, panels, heroes, pills */
  --r-xs: 4px; --r-sm: 8px; --r-md: 12px; --r-lg: 18px; --r-xl: 24px; --r-pill: 999px;
  --wrap: 760px; --gut: 20px;
  /* older names still used by inline styles in posts and pages */
  --text2: var(--muted); --text3: var(--muted); --line: transparent; --sep: transparent; --glass-line: transparent;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000; --card: #1c1c1e; --card2: #2c2c2e; --elev: #1c1c1e;
    --text: #ffffff; --muted: #98989d;
    --accent: #0a84ff; --btn-bg: #ffffff; --btn-text: #000000; --seg-on: #3a3a3c;
    --ok: #32d74b; --care: #ffd60a; --limit: #ff9f0a; --avoid: #ff453a;
    --float: 0 6px 24px rgba(0, 0, 0, .6);
  }
}

/* AQI hues (AQIHue in the app): tint is the hero ground, badge/ink the number badges,
   deep (light) and fg (dark) the big numerals. */
.h-blue    { --fg: #73b8ff; --tint: #e0edff; --badge: #4da6fa; --ink: #fff; --deep: #1f5fae; }
.h-green   { --fg: #59ff8c; --tint: #e0f7e0; --badge: #2ecc59; --ink: #062110; --deep: #13843a; }
.h-yellow  { --fg: #ffd947; --tint: #fff7db; --badge: #f2bf1a; --ink: #241a00; --deep: #9a6f00; }
.h-orange  { --fg: #ffa652; --tint: #ffeddb; --badge: #fa801a; --ink: #fff; --deep: #b54e00; }
.h-red     { --fg: #ff8047; --tint: #ffe6e0; --badge: #eb402e; --ink: #fff; --deep: #b3261a; }
.h-crimson { --fg: #ff6b38; --tint: #ffe0d1; --badge: #d92614; --ink: #fff; --deep: #a31b0c; }
.h-purple  { --fg: #db9ef5; --tint: #f2e6f7; --badge: #9947a3; --ink: #fff; --deep: #7a3384; }
.h-maroon  { --fg: #ff7594; --tint: #f7e0e6; --badge: #8c0d29; --ink: #fff; --deep: #8c0d29; }
.h-none    { --fg: #c7c7cc; --tint: #f2f2f7; --badge: #8e8e93; --ink: #fff; --deep: #6e6e73; }
@media (prefers-color-scheme: dark) {
  .h-blue, .h-green, .h-yellow, .h-orange, .h-red, .h-crimson, .h-purple, .h-maroon, .h-none { --deep: var(--fg); --tint: var(--card); }
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 76px; }
body { margin: 0; background: var(--bg); color: var(--text); font: var(--fs-body)/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
/* emphasis stays visible, just not italic */
em, i, cite, dfn, address { font-style: normal; }
.prose em, .faq em, .lead em, .dek em { font-weight: 600; }
.small { font-size: var(--fs-meta); }
.muted { color: var(--muted); }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 40; background: var(--bg); }
.top-in { max-width: 1120px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 16px; }
.logo { display: inline-flex; align-items: center; gap: 9px; color: var(--text); font-weight: 700; font-size: var(--fs-prose); flex: none; }
.logo:hover { text-decoration: none; }
.logo img { border-radius: var(--r-sm); }
.nav { display: flex; gap: 2px; padding: 3px; margin: 0 auto; border-radius: var(--r-pill); background: var(--card); }
.nav a { color: var(--text); font-size: var(--fs-sm); font-weight: 600; padding: 7px 14px; border-radius: var(--r-pill); white-space: nowrap; }
.nav a:hover { text-decoration: none; background: var(--card2); }
.nav a[aria-current] { background: var(--seg-on); }
.get-app { flex: none; background: var(--btn-bg); color: var(--btn-text); font-size: var(--fs-sm); font-weight: 700; padding: 8px 16px; border-radius: var(--r-pill); }
.get-app:hover { text-decoration: none; opacity: .85; }
/* one app banner at a time: iPhone Safari already shows Apple's Smart App Banner */
.ios-safari .get-app { display: none; }
/* header search: an icon on every page that opens the city search under the bar */
.hs-btn { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: var(--r-pill); background: var(--card); color: var(--text); }
.hs-btn svg { width: 19px; height: 19px; fill: currentColor; }
.hs-btn:hover, .hs-btn[aria-expanded="true"] { text-decoration: none; background: var(--card2); }
.hsearch { max-width: 1120px; margin: 0 auto; padding: 2px 20px 12px; }
.hsearch .search { max-width: 640px; margin: 0 auto; }

/* phones: the nav moves to a floating tab bar, like the app; it keeps its shadow because it sits over content */
.tabbar { display: none; }
@media (max-width: 760px) {
  .top-in { padding: 9px 16px; }
  .nav { display: none; }
  .hs-btn { margin-left: auto; }
  .hsearch { padding: 2px 16px 10px; }
  .tabbar { display: flex; position: fixed; z-index: 45; left: 50%; bottom: calc(10px + env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(420px, calc(100% - 24px)); justify-content: space-between; padding: 6px; border-radius: var(--r-pill); background: var(--bg); box-shadow: var(--float); }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px 5px; border-radius: var(--r-pill); color: var(--text); font-size: var(--fs-tab); font-weight: 600; }
  .tabbar a:hover { text-decoration: none; }
  .tabbar a[aria-current] { color: var(--accent); }
  .tabbar svg { width: 22px; height: 22px; fill: currentColor; }
}
@media (max-width: 760px) and (prefers-color-scheme: dark) { .tabbar { background: var(--card); } }

/* ---------- layout and type ---------- */
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 12px var(--gut) 110px; }
.wrap.wide { max-width: 1000px; }
@media (max-width: 760px) { .wrap { padding: 8px var(--gut) 120px; } }
h1 { font-size: var(--h1); line-height: 1.12; font-weight: 700; margin: 4px 0 10px; }
h2 { font-size: var(--h2); line-height: 1.25; font-weight: 600; margin: 48px 0 12px; }
h3 { font-size: var(--fs-body); font-weight: 600; margin: 24px 0 8px; }
p { margin: 0 0 14px; }
ul, ol { padding-left: 22px; margin: 0 0 14px; }
li { margin-bottom: 6px; }
section { margin-top: 6px; }
.lead { font-size: var(--fs-body); line-height: 1.5; color: var(--muted); margin-bottom: 20px; }
@media (min-width: 761px) { .lead { font-size: 18px; } }
.lead a, .lead b { color: var(--text); font-weight: 600; }
/* labels read as plain text, not tags */
.eyebrow, .kicker { display: block; font-size: var(--fs-meta); font-weight: 400; color: var(--muted); margin: 0 0 8px; }
.card-cat, .cards .card-cat { font-size: var(--fs-meta); font-weight: 400; color: var(--muted); }
.kicker a { color: inherit; }
.more { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-sm); font-weight: 600; padding: 6px 0; margin: 0 18px 0 0; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; }
@media (max-width: 760px) { .two-col { grid-template-columns: 1fr; } }
.link-row { margin-top: 18px; }
h1.split span { display: block; font-size: var(--fs-row); font-weight: 400; color: var(--muted); margin-top: 4px; }

.crumbs ol { list-style: none; padding: 0; margin: 0 0 10px; display: flex; flex-wrap: nowrap; white-space: nowrap; overflow: hidden; font-size: var(--fs-meta); color: var(--muted); }
.crumbs li { margin: 0; flex: none; }
.crumbs li:last-child { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.crumbs li + li::before { content: "›"; margin: 0 7px; }
.crumbs a { color: var(--muted); }

/* section header: heading left, a quiet link right */
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 48px 0 12px; }
.sec-head h2 { margin: 0; }
.sec-head > a, .sec-head > span { flex: none; font-size: var(--fs-sm); color: var(--muted); }
/* a taller hit area for the quiet link without moving the heading */
.sec-head > a { padding: 10px 0; margin: -10px 0; }
.sec-head > span { font-size: var(--fs-meta); }
.sec-sub { margin: -6px 0 12px; font-size: var(--fs-meta); color: var(--muted); }
/* a section label that is still an H2 */
h2.h-eyebrow { margin: 48px 0 12px; }

/* ---------- city hero: one number, one line of meaning, one quiet caption ---------- */
.hero { position: relative; isolation: isolate; color: var(--text); }
.hero.v2 { border-radius: var(--r-xl); padding: 22px 20px 18px; margin: 6px 0 0; background: var(--tint); overflow: hidden; }
@media (max-width: 760px) { .hero.v2 { margin: 4px -8px 0; padding: 20px 18px 16px; } }
.hero.v2 h1 { font-size: clamp(26px, 3.4vw, 32px); line-height: 1.12; font-weight: 700; margin: 0; }
.hero.v2 h1 span { display: block; font-size: var(--fs-meta); font-weight: 400; color: var(--muted); margin-top: 4px; }
.hero.v2 .eyebrow { margin-bottom: 10px; }
.hero-read { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-top: 18px; }
/* display numerals keep tight tracking: at 80px+ the default gaps look loose */
.hero-num { font-size: clamp(84px, 13vw, 116px); line-height: .82; font-weight: 300; color: var(--deep); font-variant-numeric: tabular-nums; letter-spacing: -.05em; }
.hero-left { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.hero-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; padding-bottom: 4px; }
.hero-side small { font-size: var(--fs-meta); color: var(--muted); }
.hero-pill { padding: 4px 11px; border-radius: var(--r-pill); background: var(--badge); color: var(--ink); font-size: var(--fs-meta); font-weight: 700; white-space: nowrap; }
.hero-place { color: var(--text); }
.hero-place:hover { text-decoration: none; }
.hero-place b { font-size: 20px; font-weight: 600; }
.hero-place small { font-size: var(--fs-meta); color: var(--muted); margin-left: 4px; }
.hero-place:hover b { text-decoration: underline; text-underline-offset: 3px; }
.insight { font-size: var(--fs-body); line-height: 1.45; margin: 14px 0 0; max-width: 34em; color: var(--muted); }
.hero-cap { margin: 12px 0 0; font-size: var(--fs-meta); line-height: 1.5; color: var(--muted); }
.hero-cap b { font-weight: 600; }
/* the app offer on the first screen: one tappable row at the foot of the hero */
.hero-app { display: flex; align-items: center; gap: 10px; margin: 16px 0 0; padding: 8px 8px 8px 10px; border-radius: var(--r-lg); background: var(--bg); color: var(--text); font-size: var(--fs-sm); font-weight: 600; line-height: 1.3; }
.hero-app:hover { text-decoration: none; }
.hero-app img { flex: none; border-radius: 7px; }
.hero-app span { flex: 1; min-width: 0; }
.hero-app b { flex: none; height: 32px; padding: 0 14px; border-radius: var(--r-pill); background: var(--btn-bg); color: var(--btn-text); font-size: var(--fs-meta); font-weight: 700; display: inline-flex; align-items: center; white-space: nowrap; }
@media (prefers-color-scheme: dark) { .hero-app { background: var(--card2); } }

/* the AQI bar is a static gauge, not a slider: the marker sits inside the bar height */
.rainbow { position: relative; height: 8px; border-radius: var(--r-pill); margin: 16px 0 0; }
.rainbow.naqi { background: linear-gradient(90deg, #4da6fa 0 8%, #2ecc59 18%, #f2bf1a 36%, #fa801a 55%, #eb402e 72%, #d92614 92%); }
.rainbow.usAqi, .rainbow.mee { background: linear-gradient(90deg, #4da6fa 0, #2ecc59 8%, #f2bf1a 22%, #fa801a 34%, #eb402e 46%, #9947a3 64%, #8c0d29 92%); }
.rainbow i { position: absolute; top: 50%; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 2px #1d1d1f; }

/* ---------- home: flat hero with the near-you card ---------- */
/* two columns that share both edges: the card starts at the eyebrow and ends at the location row */
.hero.home { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 28px; align-items: stretch; padding: 40px 0 32px; margin: 10px 0 18px; }
@media (max-width: 860px) { .hero.home { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) { .hero.home { margin-top: -6px; } }
.home-copy { align-self: stretch; display: flex; flex-direction: column; justify-content: center; }
.hero .home-h1 { font-size: clamp(32px, 5.4vw, 60px); line-height: 1.02; font-weight: 600; margin: 14px 0 12px; max-width: 11em; }
.home-sub { font-size: var(--fs-body); line-height: 1.45; color: var(--muted); margin: 0 0 24px; max-width: 30em; }
@media (max-width: 760px) { .home-sub { font-size: var(--fs-row); } }
.hero.home .eyebrow { display: inline-flex; align-items: center; gap: 7px; margin: 0; }
.near-card { display: flex; flex-direction: column; color: inherit; padding: 18px 18px 16px; border-radius: var(--r-lg); background: var(--card); }
/* side by side, the card is stretched to the copy: the extra height goes above the reading and above
   the footer (padding keeps the usual gaps when there is none to spare) */
@media (min-width: 861px) {
  .hero.home .locate { margin-bottom: 0; }
  .hero.home .near-city { margin-top: auto; padding-top: 14px; }
  .hero.home .near-foot { margin-top: auto; padding-top: 28px; }
}
.near-card:hover { text-decoration: none; }
.near-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: var(--fs-meta); color: var(--muted); }
.near-label { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-meta); }
.near-label svg { width: 11px; height: 11px; fill: currentColor; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-meta); color: var(--muted); }
/* The place sits on its own line across the card, so a long state name never wraps beside the number. */
.near-city { display: block; margin: 14px 0 0; }
.near-read { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin: 6px 0 0; }
.near-left { display: flex; flex-direction: column; gap: 2px; flex: none; }
.near-city b { font-size: 20px; font-weight: 600; line-height: 1.15; }
.near-city small { font-size: var(--fs-meta); color: var(--muted); }
.near-card .hero-num { font-size: clamp(72px, 9vw, 96px); line-height: .86; margin: 0; }
.near-side { display: flex; flex-direction: column; align-items: flex-end; text-align: right; gap: 7px; padding-bottom: 4px; flex: 1 1 0; min-width: 0; }
.near-side small { font-size: var(--fs-meta); color: var(--muted); }
/* One line, as wide as its words (the card shortens the one long category name, html.js cardLabel). */
.near-pill { display: inline-block; max-width: 100%; padding: 5px 11px; border-radius: var(--r-pill); background: var(--badge); color: var(--ink); font-size: var(--fs-meta); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.near-advice { font-size: var(--fs-row); color: var(--muted); margin-top: 14px; }
.near-card .rainbow { margin-top: 14px; }
.near-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; padding-top: 12px; font-size: var(--fs-meta); color: var(--muted); }
.near-foot b { font-weight: 400; }
.near-go { color: var(--accent); font-size: var(--fs-sm); font-weight: 600; }
.near-card:hover .near-go { text-decoration: underline; }

/* ---------- badges, pills and dots ---------- */
.bdg { display: inline-grid; place-items: center; min-width: 48px; height: 48px; padding: 0 8px; border-radius: var(--r-md); background: var(--badge); color: var(--ink); font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums; flex: none; }
.bdg.sm { min-width: 38px; height: 34px; border-radius: var(--r-sm); font-size: var(--fs-row); padding: 0 6px; }
.bdg.xs { min-width: 40px; height: 26px; border-radius: var(--r-sm); font-size: var(--fs-sm); padding: 0 6px; }
.pill { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; font-weight: 600; font-size: var(--fs-sm); color: var(--text); }
.pill b { display: inline-grid; place-items: center; min-width: 40px; height: 30px; padding: 0 7px; border-radius: var(--r-sm); background: var(--badge); color: var(--ink); font-size: var(--fs-row); font-weight: 700; font-variant-numeric: tabular-nums; }
.pill em { color: var(--muted); font-weight: 400; font-size: var(--fs-meta); }
.pill.none b { background: var(--card2); color: var(--muted); }
.chip-n { display: inline-grid; place-items: center; min-width: 32px; height: 26px; padding: 0 6px; border-radius: var(--r-pill); background: var(--badge); color: var(--ink); font-size: var(--fs-meta); font-weight: 700; margin-left: 6px; }
.chip-n.plain { background: var(--card2); color: var(--text); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--b, var(--badge)); margin-right: 8px; vertical-align: 1px; }
.sw { display: inline-block; width: 13px; height: 13px; border-radius: var(--r-xs); background: var(--b); margin-right: 9px; vertical-align: -1px; }
/* status pills (Good to go, Limit, Avoid): the user's call to keep them */
.st { display: inline-block; font-size: var(--fs-cap); font-weight: 700; padding: 3px 9px; border-radius: var(--r-pill); white-space: nowrap; }
.st.ok { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.st.care { background: color-mix(in srgb, var(--care) 18%, transparent); color: color-mix(in srgb, var(--care) 75%, var(--text)); }
.st.limit { background: color-mix(in srgb, var(--limit) 16%, transparent); color: var(--limit); }
.st.avoid { background: color-mix(in srgb, var(--avoid) 14%, transparent); color: var(--avoid); }
.delta.up { color: var(--avoid); font-weight: 600; }
.delta.down { color: var(--ok); font-weight: 600; }

/* ---------- controls: chips, toggles and category links keep a filled pill so they read as buttons ---------- */
.chips { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { margin: 0; }
.chips a, .chips > li > span { display: inline-flex; align-items: center; min-height: 38px; background: var(--card); color: var(--text); padding: 6px 6px 6px 14px; border-radius: var(--r-pill); font-size: var(--fs-row); font-weight: 600; }
.chips a:hover { background: var(--card2); text-decoration: none; }
.chips small { color: var(--muted); font-size: var(--fs-meta); font-weight: 400; margin-left: 6px; }
.chips + details.show-all > .chips { margin-top: 8px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.cat-nav { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 20px; }
.seg a, .cat-nav a { padding: 8px 15px; border-radius: var(--r-pill); font-size: var(--fs-row); font-weight: 600; color: var(--text); background: var(--card); }
.seg a:hover, .cat-nav a:hover { text-decoration: none; background: var(--card2); }
.seg a.on { background: var(--btn-bg); color: var(--btn-text); }
.rail-nav { flex-wrap: nowrap; overflow-x: auto; margin: 0 calc(-1 * var(--gut)) 20px; padding: 0 var(--gut); scrollbar-width: none; }
.rail-nav::-webkit-scrollbar { display: none; }
.rail-nav a { flex: none; font-size: var(--fs-sm); }
@media (min-width: 761px) { .rail-nav { flex-wrap: wrap; overflow: visible; margin: 0 0 24px; padding: 0; } }

/* two parallel lists: a toggle on phones, side by side from tablet up */
.pair { margin-top: 28px; }
.sec-head + .pair { margin-top: 0; }
.pair > input { position: absolute; opacity: 0; pointer-events: none; }
/* nested radius: 8px labels + 3px padding = 11px */
.seg-ctl { display: grid; grid-template-columns: 1fr 1fr; padding: 3px; border-radius: 11px; background: var(--card); margin: 0 0 12px; }
.seg-ctl label { height: 32px; display: grid; place-items: center; border-radius: var(--r-sm); font-size: var(--fs-meta); font-weight: 600; color: var(--muted); cursor: pointer; }
.pair > input:nth-of-type(1):checked ~ .seg-ctl label:nth-child(1), .pair > input:nth-of-type(2):checked ~ .seg-ctl label:nth-child(2) { background: var(--seg-on); color: var(--text); }
.pair > input:focus-visible ~ .seg-ctl { outline: 2px solid var(--accent); outline-offset: 2px; }
.pair .pane h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: 0; }
.pair > input:nth-of-type(1):checked ~ .pane.b, .pair > input:nth-of-type(2):checked ~ .pane.a { display: none; }
@media (min-width: 761px) {
  .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; align-items: start; }
  .pair .seg-ctl { display: none; }
  .pair > input:nth-of-type(n) ~ .pane, .pair > input:nth-of-type(1):checked ~ .pane.b, .pair > input:nth-of-type(2):checked ~ .pane.a { display: block; }
  .pair .pane h2 { position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal; margin: 0 0 12px; font-size: 18px; }
}

/* ---------- rails: sideways on phones, grids from tablet up ---------- */
.rail { list-style: none; display: flex; gap: 12px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; margin: 0 calc(-1 * var(--gut)); padding: 0 var(--gut) 6px; scroll-padding: 0 var(--gut); scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.rail > li { flex: none; margin: 0; scroll-snap-align: start; }
.rail.chips { flex-wrap: nowrap; gap: 8px; }
.rail.chips a { white-space: nowrap; }
/* two rows of chips that scroll together on phones; each row packs tight */
.chip-rows { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; overflow-x: auto; overscroll-behavior-x: contain; margin: 0 calc(-1 * var(--gut)); padding: 0 0 6px var(--gut); scrollbar-width: none; }
.chip-rows::-webkit-scrollbar { display: none; }
.chip-rows > .chips { flex-wrap: nowrap; margin: 0; }
.chip-rows > .chips::after { content: ""; flex: none; order: 999; width: calc(var(--gut) - 8px); }
.chip-rows li { flex: none; }
.rail > li > .tile { width: 236px; }
.rail.narrow > li > .tile { width: 150px; }
.rail.mini > li > .tile { width: 112px; padding: 12px; }
.rail.stories > li { width: 262px; }
@media (min-width: 761px) {
  .rail { overflow: visible; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .rail > li { flex: initial; }
  .rail.chips { display: flex; flex-wrap: wrap; }
  .chip-rows { flex-direction: row; flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
  .chip-rows > .chips { display: contents; }
  .chip-rows > .chips::after { content: none; }
  .rail > li > .tile, .rail.narrow > li > .tile, .rail.mini > li > .tile, .rail.stories > li { width: auto; }
  .rail.narrow, .rail.mini { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .rail.stories { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}

/* tiles inside rails and grids: trackers, countries, nearby cities, guides */
.tile { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 16px; border-radius: var(--r-lg); background: var(--card); color: var(--text); }
.tile:hover { text-decoration: none; }
.tile:hover .t-name { text-decoration: underline; }
.tile .eyebrow { margin: 0 0 2px; }
.tile .t-num { font-size: 34px; line-height: 1; font-weight: 300; font-variant-numeric: tabular-nums; letter-spacing: -.04em; }
.tile .t-num small { font-size: var(--fs-cap); font-weight: 400; color: var(--muted); margin-left: 6px; letter-spacing: 0; }
.tile .t-top { margin-top: 8px; }
.tile .t-quiet { font-size: 22px; font-weight: 400; line-height: 1.15; }
.tile .t-name { font-size: var(--fs-row); font-weight: 600; line-height: 1.3; }
.tile .t-sub { font-size: var(--fs-meta); color: var(--muted); line-height: 1.35; }
.tile .t-bar { display: block; height: 4px; border-radius: var(--r-pill); background: var(--card2); margin-top: 12px; overflow: hidden; }
.tile .t-sub + .t-bar, .tile .t-num + .t-bar { margin-top: auto; }
.rail .tile .t-bar { margin-top: 12px; }
.tile .t-bar em { display: block; height: 100%; border-radius: var(--r-pill); background: var(--badge); }
.mini .tile .t-num { font-size: 24px; margin-top: 8px; color: var(--deep); }
.tile-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.tile-grid li { margin: 0; }

/* story cards in rails */
.story-card { display: flex; flex-direction: column; gap: 6px; color: var(--text); }
.story-card:hover { text-decoration: none; }
.story-card:hover b { text-decoration: underline; }
.story-card img { width: 100%; aspect-ratio: 1200 / 630; object-fit: cover; border-radius: var(--r-md); background: var(--card); margin-bottom: 4px; }
.story-card .eyebrow { margin: 0; }
.story-card b { font-size: var(--fs-row); line-height: 1.33; font-weight: 600; }

/* ---------- grouped lists: rows in one rounded panel, value on the right ---------- */
.list { list-style: none; background: var(--card); border-radius: var(--r-lg); padding: 4px 16px; margin: 0 0 12px; counter-reset: r; }
.list li { counter-increment: r; margin: 0; }
.list li a { display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 8px 0; color: var(--text); }
.list li a::before { content: counter(r); width: 20px; flex: none; font-size: var(--fs-meta); color: var(--muted); font-variant-numeric: tabular-nums; }
.list li a:hover { text-decoration: none; }
.list li a:hover .list-name b { text-decoration: underline; }
.list li a .bdg { order: 2; min-width: 42px; height: 28px; border-radius: var(--r-sm); font-size: var(--fs-sm); padding: 0 7px; }
.list-name { flex: 1; min-width: 0; }
/* long names (Kabupaten Kotawaringin Timur) wrap rather than end in an ellipsis */
.list-name b { display: block; font-size: var(--fs-body); font-weight: 600; line-height: 1.25; }
.list-name small { display: block; font-size: var(--fs-meta); color: var(--muted); line-height: 1.3; }
details.show-all > .list { margin-top: 8px; }
/* station list on city pages: the name first, the badge on the right */
.station-rows { list-style: none; background: var(--card); border-radius: var(--r-lg); padding: 0 16px; margin: 0 0 12px; }
.station-rows li { position: relative; display: flex; align-items: center; gap: 14px; min-height: 48px; padding: 6px 0; margin: 0; }
/* the whole row is the link, not just the station name */
.station-rows .list-name a::after { content: ""; position: absolute; inset: 0; }
.station-rows li .bdg { order: 2; }
.station-rows .bdg.sm { min-width: 44px; height: 36px; font-size: var(--fs-body); }
.station-rows .list-name b { font-size: var(--fs-row); font-weight: 400; white-space: normal; }
.station-rows .list-name small { display: none; }
/* India city pages ("Areas right now" under the hero): two-line rows, the category under the area name */
.station-rows.two-line li { min-height: 56px; }
.station-rows.two-line .list-name small { display: block; }
.stations { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0 32px; }
.stations li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; margin: 0; font-size: var(--fs-body); }
.stations li small { color: var(--muted); text-align: right; }
.cols { list-style: none; padding: 0; columns: 3 150px; column-gap: 28px; }
.cols li { break-inside: avoid; padding: 0; margin: 0; }
.cols a { display: inline-block; padding: 6px 0; }
.grid-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); column-gap: 32px; }
.list.grid-list { display: block; }

/* ---------- tables ---------- */
.tbl-wrap { overflow-x: auto; margin: 0 0 14px; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: var(--fs-body); }
th, td { text-align: left; padding: 10px; vertical-align: middle; }
thead th { font-size: var(--fs-meta); color: var(--muted); font-weight: 600; white-space: nowrap; }
caption { text-align: left; color: var(--muted); font-size: var(--fs-meta); padding-bottom: 6px; }
table small { font-size: var(--fs-meta); }
table.rank td:first-child { color: var(--muted); font-variant-numeric: tabular-nums; width: 1%; white-space: nowrap; }
table.rank td a { color: var(--text); font-weight: 600; }
table.data td:first-child { font-weight: 600; }
th[data-sort] { cursor: pointer; user-select: none; }
th[data-sort]::after { content: " ↕"; color: var(--muted); }
th[aria-sort="ascending"]::after { content: " ↑"; }
th[aria-sort="descending"]::after { content: " ↓"; }
@media (max-width: 560px) { table { font-size: var(--fs-row); } th, td { padding: 9px 6px; } }
/* ranking table: city with its area underneath, compact badges, filter */
table.rank.v2 td, table.rank.v2 th { padding: 10px 8px 10px 0; }
table.rank.v2 td:first-child { font-size: var(--fs-meta); width: 28px; }
table.rank.v2 td small { display: block; font-size: var(--fs-cap); color: var(--muted); font-weight: 400; line-height: 1.3; }
table.rank.v2 td a { font-size: var(--fs-body); }
table.rank.v2 th:nth-child(n+3), table.rank.v2 td:nth-child(n+3) { text-align: right; padding-right: 0; padding-left: 8px; width: 1%; white-space: nowrap; }
table.rank.v2 tr > *:nth-child(n+3) + * { color: var(--muted); }
table.rank.v2 thead th { font-size: var(--fs-cap); }
.filter { display: flex; align-items: center; gap: 8px; height: 42px; border-radius: var(--r-md); background: var(--card); padding: 0 12px; margin: 0 0 8px; color: var(--muted); }
.filter svg { width: 16px; height: 16px; fill: currentColor; flex: none; }
.filter input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: var(--fs-row); -webkit-appearance: none; appearance: none; }

/* ---------- number strips ---------- */
.kstrip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: var(--card); border-radius: var(--r-lg); margin: 16px 0; list-style: none; padding: 0; }
.kstrip li { margin: 0; padding: 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kstrip span { font-size: var(--fs-cap); color: var(--muted); }
.kstrip b { font-size: 22px; font-weight: 600; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kstrip b.lg { font-size: 30px; font-weight: 300; letter-spacing: -.04em; }
.kstrip small { font-size: var(--fs-cap); color: var(--muted); }
.kstrip.big { margin: 18px 0 20px; }
.kstrip.big b.lg { color: var(--deep); }
.kstrip.pols { margin: 0 0 8px; gap: 10px; }
.kstrip.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kstrip.two b { font-size: 26px; font-weight: 300; letter-spacing: -.03em; }
.kstrip.two span { order: 1; font-size: var(--fs-cap); line-height: 1.35; }
/* phones: two pollutants a row so units and notes never sit alone on a line; the long
   Japanese oxidant label (光化学オキシダント · ppm) gets the full row */
@media (max-width: 480px) {
  .kstrip.pols { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: dense; }
  .kstrip.pols .pol-ox { grid-column: 1 / -1; }
}
.pols-sec .small { font-size: var(--fs-cap); margin-top: 6px; }
.facts, .pols:not(.kstrip) { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 0 0 10px; }
.facts li, .pol { background: var(--card); border-radius: var(--r-lg); padding: 14px 16px; margin: 0; }
.facts b { display: block; font-size: 30px; line-height: 1.1; font-weight: 600; letter-spacing: -.03em; }
.facts span { font-size: var(--fs-meta); color: var(--muted); }
.pol b { display: block; font-size: var(--fs-sm); color: var(--muted); font-weight: 600; }
.pol span { display: block; font-size: 30px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.15; letter-spacing: -.03em; }
.pol small { color: var(--muted); font-size: var(--fs-cap); }

/* ---------- AQI scale and category spread ---------- */
.scale { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; margin: 14px 0 18px; }
.scale-seg { display: block; min-width: 0; color: var(--muted); padding: 0 2px 0 0; }
.scale-seg::before { content: ""; display: block; height: 5px; border-radius: var(--r-pill); background: var(--b); margin-bottom: 9px; }
.scale.has-on .scale-seg.on::before { height: 7px; margin: -1px 0 8px; }
.scale-seg b { display: block; font-size: var(--fs-cap); font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.scale-seg span { display: block; font-size: 11px; line-height: 1.3; margin-top: 1px; }
.scale.has-on .scale-seg:not(.on) b { color: var(--muted); }
.scale-seg.on span { color: var(--text); font-weight: 600; }
a.scale-seg:hover { text-decoration: none; }
a.scale-seg:hover b { color: var(--text); }
@media (max-width: 480px) { .scale { gap: 3px; } .scale-seg b { font-size: 11px; white-space: nowrap; } }
.dist { display: flex; height: 6px; border-radius: var(--r-pill); overflow: hidden; gap: 2px; margin: 4px 0 8px; }
.dist span { background: var(--b); }
.dist-legend { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: var(--fs-cap); color: var(--muted); }
.dist-legend li { margin: 0; }
.dist-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--b); margin-right: 6px; }
.dist-legend b { color: var(--text); }

/* AQI range pages */
.range-v2 { padding: 14px 0 4px; }
.range-v2 h1 { margin: 0 0 12px; font-size: 28px; }
.range-v2 h1 b { display: block; font-size: clamp(64px, 11vw, 88px); line-height: .9; font-weight: 300; color: var(--deep); margin-bottom: 4px; letter-spacing: -.05em; }
.range-v2 .lead { margin-bottom: 14px; }
.range-v2 .scale { margin: 14px 0 0; }

/* ---------- is it safe outside: activity rows with status pills ---------- */
.activities h2 { margin-bottom: 4px; }
.activities .sec-sub { margin: 0 0 12px; font-size: var(--fs-sm); line-height: 1.45; color: var(--muted); }
.activities .small { font-size: var(--fs-cap); }
.acts { list-style: none; margin: 0 0 14px; padding: 2px 16px; background: var(--card); border-radius: var(--r-lg); }
.acts li { margin: 0; padding: 13px 0 14px; }
.act-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.act-h h3 { font-size: var(--fs-row); font-weight: 600; margin: 0; line-height: 1.3; }
.acts p { margin: 4px 0 0; font-size: var(--fs-sm); line-height: 1.42; color: var(--muted); }
/* desktop: two columns so each pill sits beside its activity, not 500px away */
@media (min-width: 761px) { .acts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; } }
.health { background: var(--card); border-radius: var(--r-lg); padding: 16px 20px; font-size: var(--fs-body); line-height: 1.5; color: var(--muted); margin: 0 0 8px; }

/* ---------- charts: they keep their gridlines, which is how you read the values ---------- */
.chart { margin: 4px 0 14px; background: var(--card); border-radius: var(--r-lg); padding: 14px 14px 8px; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .gl { stroke: var(--muted); stroke-opacity: .25; stroke-width: 1; }
/* the trend chart's viewBox is 720 wide, so labels are set in viewBox units to land near 11px */
.chart .gt { fill: var(--muted); font-size: 11px; }
@media (max-width: 480px) { .chart .gt { font-size: 25px; } }
@media (min-width: 481px) and (max-width: 760px) { .chart .gt { font-size: 15px; } }

/* ---------- weather and alerts ---------- */
.wx-now { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; font-size: var(--fs-body); color: var(--muted); }
.wx-now b { font-size: 40px; line-height: 1.1; font-weight: 400; color: var(--text); letter-spacing: -.04em; }
.alert-box { background: var(--card); border-radius: var(--r-lg); padding: 12px 16px; margin: 8px 0 14px; }
.alert-box > b { font-size: var(--fs-row); }
.alert-box p { margin: 6px 0 0; font-size: var(--fs-row); }
details.alert { background: var(--card); border-radius: var(--r-lg); margin: 0 0 8px; }
details.alert summary { cursor: pointer; padding: 14px 18px; list-style: none; display: grid; grid-template-columns: auto 1fr; gap: 3px 4px; align-items: baseline; }
details.alert summary::-webkit-details-marker { display: none; }
details.alert summary b { font-size: var(--fs-body); font-weight: 600; line-height: 1.35; }
details.alert summary span, details.alert summary small { grid-column: 2; color: var(--muted); font-size: var(--fs-meta); }
details.alert > div { padding: 0 18px 12px; font-size: var(--fs-row); }
.alert-list + details.show-all { margin-top: 2px; }
.rf { font-size: var(--fs-cap); font-weight: 600; padding: 3px 9px; border-radius: var(--r-pill); background: var(--card2); white-space: nowrap; }
.rf.LE, .rf.E { background: color-mix(in srgb, #2e85ff 22%, transparent); }
.rf.D, .rf.LD, .rf.NR { background: color-mix(in srgb, #fa801a 22%, transparent); }
.warn-rows { list-style: none; padding: 0; margin: 0 0 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); column-gap: 32px; }
.warn-rows li { display: flex; gap: 12px; align-items: baseline; margin: 0; padding: 12px 0; }
.warn-rows .dot { flex: none; margin: 0; transform: translateY(-1px); }
.warn-rows div { min-width: 0; flex: 1; }
.warn-rows b { font-size: var(--fs-prose); font-weight: 600; }
.warn-rows b a { color: var(--text); }
.warn-rows small { font-size: var(--fs-meta); color: var(--muted); margin-left: 8px; }
.warn-rows small a { color: inherit; }
.warn-rows p { margin: 3px 0 0; font-size: var(--fs-row); line-height: 1.45; color: var(--muted); }
.tally { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: var(--fs-sm); font-weight: 600; color: var(--muted); margin: -4px 0 6px; }
details.day { margin-top: 8px; }
details.day + details.day { margin-top: 0; }
details.day > summary { cursor: pointer; list-style: none; position: relative; padding: 18px 36px 14px 0; }
details.day > summary::-webkit-details-marker { display: none; }
details.day > summary::after { content: "+"; position: absolute; right: 4px; top: 16px; font-size: 24px; color: var(--muted); }
details.day[open] > summary::after { content: "−"; }
details.day > summary h2 { margin: 0 0 8px; font-size: 20px; }
details.day > summary .tally { margin: 0; }
details.all { margin: 18px 0; }
details.all summary { cursor: pointer; font-weight: 600; padding: 8px 0; }
.now-box { background: var(--card); border-radius: var(--r-lg); padding: 16px 20px; margin: 6px 0 12px; }
.now-box > b { font-size: var(--fs-row); color: var(--muted); }
.now-box ul { margin: 8px 0 6px; padding-left: 20px; }
.now-box p { margin: 0; }

/* "show all": the rest of a list stays in the HTML, folded */
details.show-all { margin: -4px 0 14px; }
details.show-all > summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; list-style: none; font-size: var(--fs-row); font-weight: 600; color: var(--accent); padding: 8px 0; }
details.show-all > summary::-webkit-details-marker { display: none; }
details.show-all > summary::after { content: ""; width: 7px; height: 7px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg) translateY(-2px); }
details.show-all[open] > summary { display: none; }
details.show-all > ul, details.show-all > ol { margin-top: 0; }

/* cards (alerts and tracker hubs) */
.cards { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.cards li { margin: 0; }
.cards a { display: flex; flex-direction: column; gap: 4px; height: 100%; background: var(--card); color: var(--text); padding: 18px; border-radius: var(--r-xl); }
.cards a:hover { text-decoration: none; }
.cards a:hover b { text-decoration: underline; }
.cards b { font-size: 18px; line-height: 1.28; }
.cards span { font-size: var(--fs-row); color: var(--muted); }
.prev-next { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 48px 0 8px; }
.prev-next a { display: flex; flex-direction: column; gap: 2px; background: var(--card); color: var(--text); border-radius: var(--r-lg); padding: 14px 18px; font-size: var(--fs-prose); font-weight: 600; }
.prev-next a.next { text-align: right; }
.prev-next a:hover { text-decoration: none; background: var(--card2); }
.prev-next small { font-size: var(--fs-meta); font-weight: 600; color: var(--accent); }
.callout { background: var(--card); border-radius: var(--r-xl); padding: 4px 22px 6px; margin-top: 28px; }
.callout h2 { margin-top: 18px; font-size: 20px; }
.callout p { color: var(--muted); }
.tips { list-style: none; padding: 0; }
.tips li { position: relative; padding: 0 0 0 26px; margin-bottom: 12px; }
.tips li::before { content: ""; position: absolute; left: 4px; top: .55em; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
/* steps keep their <ol> for screen readers, without decorative numbers */
.steps { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.steps li { display: flex; gap: 14px; margin: 0; font-size: var(--fs-row); line-height: 1.47; }
.risk { margin-top: 32px; }
.risk h2 { font-size: var(--fs-body); font-weight: 600; margin: 0 0 6px; }
.risk p { font-size: var(--fs-prose); line-height: 1.45; margin: 0; }
.note-card { background: var(--card); border-radius: var(--r-lg); padding: 16px; margin: 28px 0 0; }
.note-card h2 { font-size: var(--fs-sm); font-weight: 600; margin: 0 0 6px; }
.note-card p { font-size: var(--fs-sm); line-height: 1.47; color: var(--muted); margin: 0; }
.answer { font-size: var(--fs-body); line-height: 1.5; color: var(--muted); margin: 18px 0 14px; }
.answer b { color: var(--text); font-weight: 600; }

/* ---------- app prompts ---------- */
/* slim app row (App Store "GET"); its copy is never clamped */
.cta-slim { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--r-lg); background: var(--card); margin: 36px 0; }
.cta-slim img { flex: none; border-radius: 11px; }
.cta-slim div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cta-slim b { font-size: var(--fs-row); font-weight: 600; line-height: 1.3; }
.cta-slim span { font-size: var(--fs-meta); line-height: 1.35; color: var(--muted); }
.cta-slim .get { flex: none; height: 30px; padding: 0 16px; border-radius: var(--r-pill); background: var(--card2); color: var(--accent); font-size: var(--fs-sm); font-weight: 700; display: inline-flex; align-items: center; }
.cta-slim .get:hover { text-decoration: none; filter: brightness(1.1); }
@media (prefers-color-scheme: dark) { .cta-slim .get { background: #3a3a3c; } }
.store-row { display: flex; flex-wrap: wrap; gap: 8px; }
.store-btn { display: inline-flex; align-items: center; gap: 9px; background: var(--btn-bg); color: var(--btn-text); border-radius: var(--r-pill); padding: 8px 18px 8px 14px; line-height: 1.05; font-size: var(--fs-body); font-weight: 700; min-height: 46px; }
.store-btn:hover { text-decoration: none; opacity: .86; }
.store-btn svg { width: 19px; height: 19px; fill: currentColor; flex: none; }
.store-btn small { display: block; font-size: 11px; font-weight: 400; }
.store-btn.hide { display: none; }

/* ---------- search, "use my location" ---------- */
.search { position: relative; display: flex; align-items: center; gap: 6px; max-width: 520px; padding: 6px 6px 6px 16px; border-radius: var(--r-pill); background: var(--card); color: var(--text); }
.search > svg { width: 20px; height: 20px; fill: var(--muted); flex: none; }
.search input { flex: 1; width: 0; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: var(--fs-prose); padding: 10px 4px; -webkit-appearance: none; appearance: none; }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search button { flex: none; border: 0; cursor: pointer; background: var(--btn-bg); color: var(--btn-text); font: inherit; font-size: var(--fs-row); font-weight: 700; padding: 10px 18px; border-radius: var(--r-pill); }
.search:focus-within { box-shadow: 0 0 0 2px var(--accent); }
.wrap > .search { margin: 8px 0 22px; }
.sugg { position: absolute; z-index: 30; top: calc(100% + 8px); left: 0; right: 0; list-style: none; margin: 0; padding: 6px; border-radius: var(--r-xl); background: var(--elev); box-shadow: 0 18px 50px rgba(0, 0, 0, .22); max-height: 420px; overflow-y: auto; }
.sugg li { margin: 0; }
/* nested radius: 18px rows + 6px padding = 24px */
.sugg a { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: var(--r-lg); color: var(--text); }
.sugg a:hover, .sugg li[aria-selected="true"] a { background: var(--card); text-decoration: none; }
.sugg b { display: block; font-size: var(--fs-body); font-weight: 600; }
.sugg small { display: block; font-size: var(--fs-meta); color: var(--muted); }
.sugg .bdg { min-width: 40px; height: 36px; border-radius: var(--r-md); font-size: var(--fs-row); }
.sugg .empty { padding: 12px 14px; color: var(--muted); font-size: var(--fs-row); }
.locate { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin: 14px 0; }
.locate[hidden] { display: none; }
.locate-btn { flex: none; height: 36px; padding: 0 16px 0 12px; border: 0; border-radius: var(--r-pill); background: var(--card); color: var(--accent); font: inherit; font-size: var(--fs-sm); font-weight: 600; line-height: 1; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.locate-btn::before { content: ""; width: 14px; height: 14px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M21 3 3 10.5l7.5 3L13.5 21z'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M21 3 3 10.5l7.5 3L13.5 21z'/%3E%3C/svg%3E") center/contain no-repeat; }
.locate-btn:hover { filter: brightness(1.1); }
.locate-btn:disabled { opacity: .6; cursor: progress; }

/* ---------- FAQ ---------- */
.faq summary { cursor: pointer; padding: 15px 30px 15px 0; font-size: var(--fs-row); font-weight: 600; position: relative; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 11px; font-size: 22px; font-weight: 400; color: var(--muted); }
.faq details[open] summary::after { content: "−"; }
.faq details > div { padding: 0 0 10px; font-size: var(--fs-row); color: var(--muted); }

/* ---------- blog listings: lead story, then compact rows ---------- */
.story-lead { display: flex; flex-direction: column; gap: 8px; color: var(--text); margin: 4px 0 8px; }
.story-lead:hover { text-decoration: none; }
.story-lead:hover b { text-decoration: underline; }
.story-lead img { width: 100%; aspect-ratio: 1200 / 630; object-fit: cover; border-radius: var(--r-lg); background: var(--card); margin-bottom: 4px; }
.story-lead .eyebrow { margin: 4px 0 0; }
.story-lead b { font-size: clamp(22px, 3vw, 28px); line-height: 1.2; font-weight: 700; }
.story-lead .sr-desc { font-size: var(--fs-sm); line-height: 1.45; color: var(--muted); }
.story-rows { list-style: none; padding: 0; margin: 18px 0 0; }
.story-rows li { margin: 0; }
.story-row { display: flex; gap: 14px; padding: 14px 0; color: var(--text); }
.story-row:hover { text-decoration: none; }
.story-row:hover b { text-decoration: underline; }
.sr-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.sr-text .eyebrow { margin: 0; }
.story-row b { font-size: var(--fs-body); line-height: 1.3; font-weight: 600; }
.story-row .sr-desc { display: none; font-size: var(--fs-sm); line-height: 1.45; color: var(--muted); }
.sr-meta { font-size: var(--fs-meta); color: var(--muted); }
.story-row img { flex: none; align-self: flex-start; width: 96px; height: 96px; object-fit: cover; object-position: left center; border-radius: var(--r-md); background: var(--card); }
@media (min-width: 761px) {
  .story-row { gap: 20px; padding: 18px 0; }
  /* two lines of description on desktop; the full text is on the article */
  .story-row .sr-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .story-row img { width: 200px; height: auto; aspect-ratio: 1200 / 630; object-position: center; }
  .story-row b { font-size: 18px; }
}

/* ---------- articles ---------- */
.post h1 { font-size: clamp(28px, 4.6vw, 44px); line-height: 1.12; margin: 0 0 12px; }
.post .eyebrow { margin: 12px 0 10px; }
.post .eyebrow a { color: inherit; }
.dek { font-size: var(--fs-prose); line-height: 1.47; color: var(--muted); margin: 0 0 16px; }
@media (min-width: 761px) { .dek { font-size: 20px; } }
.byline { display: flex; align-items: center; gap: 10px; font-size: var(--fs-sm); color: var(--text); margin: 0 0 20px; }
.byline img { border-radius: 50%; flex: none; }
.byline span { display: flex; flex-direction: column; }
.byline span span { display: inline; }
.byline a { color: var(--text); font-weight: 600; text-decoration: none; }
.byline small { font-size: var(--fs-meta); color: var(--muted); }
.post-hero { margin: 0 0 20px; }
.post-hero img, .post-fig img { display: block; width: 100%; height: auto; border-radius: var(--r-xl); background: var(--card); }
@media (max-width: 760px) { .post-hero { margin: 0 calc(-1 * var(--gut)) 20px; } .post-hero img { border-radius: 0; } }
.post-fig { margin: 26px 0; }
.post-fig figcaption { font-size: var(--fs-sm); color: var(--muted); margin-top: 10px; line-height: 1.45; }
details.toc { background: var(--card); border-radius: var(--r-md); padding: 0 16px; margin: 0 0 24px; font-size: var(--fs-row); }
details.toc summary { cursor: pointer; list-style: none; min-height: 50px; display: flex; align-items: center; gap: 6px; position: relative; padding-right: 24px; }
details.toc summary::-webkit-details-marker { display: none; }
details.toc summary b { font-weight: 600; }
details.toc summary span { color: var(--muted); }
details.toc summary::after { content: ""; position: absolute; right: 4px; top: 50%; width: 7px; height: 7px; margin-top: -6px; border: solid var(--muted); border-width: 0 2px 2px 0; transform: rotate(45deg); }
details.toc[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
details.toc ol { list-style: none; margin: 0 0 14px; padding-left: 0; }
details.toc li { margin: 0; }
details.toc a { display: block; padding: 4px 0; }
.prose { font-size: var(--fs-prose); line-height: 1.65; }
.prose h2 { font-size: clamp(21px, 2.6vw, 26px); margin-top: 40px; }
.prose li { margin-bottom: 8px; }
.prose a { color: var(--text); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 70%, transparent); text-underline-offset: 3px; }
.prose a:hover { color: var(--accent); }
.prose blockquote { margin: 20px 0; padding: 0 0 0 20px; color: var(--muted); }
.prose code { background: var(--card); padding: 1px 6px; border-radius: 6px; font-size: .9em; }
.prose hr { border: 0; margin: 36px 0; }
.prose table { font-size: var(--fs-row); }
.prose th { font-size: var(--fs-cap); color: var(--muted); }
.prose .chips a, .prose .live-aqi a { text-decoration: none; color: var(--text); }
.prose .chips a { white-space: nowrap; }
.prose .live-cities .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 calc(-1 * var(--gut)); padding: 0 var(--gut) 4px; scrollbar-width: none; }
@media (min-width: 761px) { .prose .live-cities .chips { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; } }
.cite { font-size: var(--fs-sm); color: var(--muted); }
.cite a { color: var(--muted); text-decoration-color: color-mix(in srgb, var(--muted) 60%, transparent); }
.note-box { background: var(--card); border-radius: var(--r-lg); padding: 14px 18px; font-size: var(--fs-body); }
.live-aqi, .live-cities { margin: 20px 0; }
.live-aqi a { display: flex; align-items: center; gap: 14px; background: var(--card); color: var(--text); border-radius: var(--r-lg); padding: 14px 18px; font-weight: 600; }
.live-aqi a:hover { text-decoration: none; background: var(--card2); }
.live-aqi .bdg { font-size: 20px; }
.related { margin-top: 32px; }
.source { margin-top: 28px; }
.hub-links { margin-top: 20px; }
pre.code { background: var(--card); border-radius: var(--r-md); padding: 14px 18px; overflow-x: auto; font-size: var(--fs-sm); line-height: 1.6; margin: 0 0 16px; }
pre.code code, .prose code, p code { font-family: ui-monospace, "SF Mono", Menlo, monospace; }

/* ---------- footer ---------- */
.foot { margin-top: 24px; }
.foot-in { max-width: 1120px; margin: 0 auto; padding: 32px 20px calc(110px + env(safe-area-inset-bottom)); }
@media (min-width: 761px) { .foot-in { padding-bottom: 40px; } }
.foot-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 20px; }
.foot h3 { font-size: var(--fs-meta); color: var(--muted); font-weight: 600; margin: 0 0 8px; }
.foot-cols a { display: block; color: var(--text); font-size: var(--fs-row); padding: 3px 0; }
.foot-legal { margin: 28px 0 6px; font-size: var(--fs-meta); color: var(--muted); }
.foot-legal a { color: inherit; }
.foot-legal span { margin: 0 6px; }
.foot-note { font-size: var(--fs-cap); color: var(--muted); max-width: 720px; }
