/* Faro Alergia: the allergy app for doctors (docs/allergy-plan.md). Its own clinical look, light and calm, by the operator's
   request (2026-10-16): Faro's typeface (IBM Plex Sans, served by Faro), one teal accent, and level colours that always
   come with their word (Bajo, Moderado, Alto, Muy alto), never colour alone. Every colour is a token below. */
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-display: swap; src: url(/fonts/ibm-plex-sans-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-display: swap; src: url(/fonts/ibm-plex-sans-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-display: swap; src: url(/fonts/ibm-plex-sans-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 700; font-display: swap; src: url(/fonts/ibm-plex-sans-latin-700-normal.woff2) format("woff2"); }

:root {
  --bg: #f4f6f8; --surface: #ffffff; --surface-2: #f8fafb; --line: #dfe5eb; --line-2: #c9d2db;
  --ink: #1b2631; --ink-2: #3b4a59; --muted: #66758a; --faint: #95a2b3;
  --accent: #0b6e86; --accent-ink: #ffffff; --accent-soft: #e4f1f5; --accent-line: #9cc9d6;
  --l0: #2f8a57; --l1: #b8860b; --l2: #d4651e; --l3: #b8332a; --lnone: #c5cdd6;
  --l0-fill: #b9dfc8; --l1-fill: #f5dc8f; --l2-fill: #f4b27c; --l3-fill: #e48a80;
  --s0: #e3f2e8; --s4: #b8433a;      /* the score ramp's two ends: below Bajo's middle, past Muy alto's */
  --l0-soft: #e8f5ed; --l1-soft: #fbf3dc; --l2-soft: #fdeadb; --l3-soft: #f9e2df;
  --fire: #d9480f; --place: #0b6e86;
  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --fs-xs: 12px; --fs-sm: 13px; --fs-base: 15px; --fs-md: 17px; --fs-lg: 20px; --fs-xl: 26px;
  --r: 10px; --r-sm: 6px; --shadow: 0 1px 2px rgba(20, 35, 50, .06), 0 4px 16px rgba(20, 35, 50, .06);
  --map-bg: #e9eef2; --map-stroke: #ffffff; --halo: rgba(255, 255, 255, .85); --mark: #24323f; --wind-line: rgba(16, 34, 48, 0.66);
  color-scheme: light;
}
/* dark (2026-10-19): the same tokens at night; the data's colours (the level fills and ramps) stay, so a level reads the
   same in both themes */
:root[data-theme="dark"] {
  --bg: #0f1419; --surface: #161d24; --surface-2: #1b232c; --line: #2a3541; --line-2: #3a4754;
  --ink: #e6ebf0; --ink-2: #c3ccd6; --muted: #8e9bab; --faint: #6a7787;
  --accent: #3fa7c2; --accent-ink: #061418; --accent-soft: #14303a; --accent-line: #2c6b7c;
  --l0-soft: #15291e; --l1-soft: #2d2512; --l2-soft: #301f13; --l3-soft: #331816; --lnone: #3b4652;
  --l0: #5cc28a; --l1: #e0b44a; --l2: #f08a4b; --l3: #f07a6e;
  --place: #3fa7c2; --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .35);
  /* the wind lines and the marks are drawn over the data's colours, which stay light in both themes: they stay dark
     (2026-10-19: light lines over the pale fills made the wind vanish in dark mode) */
  --map-bg: #0c1116; --map-stroke: #0f1419; --halo: rgba(12, 17, 22, .85); --mark: #1d2a36; --wind-line: rgba(16, 34, 48, 0.7);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 400 var(--fs-base)/1.5 var(--font); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
[hidden] { display: none !important; }
.muted { color: var(--muted); } .small { font-size: var(--fs-sm); } .xs { font-size: var(--fs-xs); }

/* ---- sign-in ---- */
.signin { min-height: 100%; display: grid; place-items: center; padding: 24px; background: linear-gradient(180deg, #eef4f6, var(--bg)); }
.signin-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 32px 28px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: var(--fs-md); color: var(--ink); }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; }
.brand-mark svg { width: 18px; height: 18px; }
.brand small { font-weight: 400; color: var(--muted); font-size: var(--fs-sm); }
.signin h1 { font-size: var(--fs-lg); margin: 22px 0 4px; font-weight: 600; }
.signin p { margin: 0 0 20px; color: var(--muted); font-size: var(--fs-sm); }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: var(--fs-sm); font-weight: 500; color: var(--ink-2); }
.input { width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface); }
.input:focus { outline: 2px solid var(--accent-line); outline-offset: 1px; border-color: var(--accent); }
.btn { height: 38px; padding: 0 14px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--surface); font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { border-color: var(--accent-line); background: var(--surface-2); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { background: #095d71; }
.btn.block { width: 100%; justify-content: center; height: 44px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.danger { color: var(--l3); }
.btn.sm { height: 30px; padding: 0 10px; font-size: var(--fs-sm); }
.error { color: var(--l3); font-size: var(--fs-sm); min-height: 20px; margin: 4px 0 8px; }
.signin-note { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); font-size: var(--fs-xs); color: var(--muted); }

/* ---- the app ---- */
.app { height: 100%; display: grid; grid-template-rows: 56px 1fr; }
.top { display: flex; align-items: center; gap: 16px; padding: 0 18px; background: var(--surface); border-bottom: 1px solid var(--line); }
.top .date { color: var(--muted); font-size: var(--fs-sm); }
.search { position: relative; margin-left: auto; width: min(360px, 40vw); }
.search .input { height: 36px; padding-left: 34px; background: var(--surface-2); }
.search svg { position: absolute; left: 10px; top: 9px; width: 18px; height: 18px; color: var(--faint); }
.results { position: absolute; top: 40px; left: 0; right: 0; z-index: 30; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: var(--shadow); max-height: 340px; overflow: auto; }
.results button { display: block; width: 100%; text-align: left; padding: 8px 12px; border: 0; background: none; }
.results button:hover, .results button.on { background: var(--accent-soft); }
.results .sub { color: var(--muted); font-size: var(--fs-xs); }
.user { position: relative; }
.menu { position: absolute; right: 0; top: 44px; z-index: 30; min-width: 220px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: var(--shadow); padding: 6px; }
.menu button { display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; background: none; border-radius: 4px; }
.menu button:hover { background: var(--surface-2); }
.menu .who { padding: 8px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; font-size: var(--fs-sm); }

.main { display: grid; grid-template-columns: 300px minmax(0, 1fr) 400px; min-height: 0; }
.side, .panel { background: var(--surface); overflow: auto; min-height: 0; }
.side { border-right: 1px solid var(--line); padding: 16px; }
.panel { border-left: 1px solid var(--line); padding: 18px 20px 28px; }
.h { font-size: var(--fs-xs); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 18px 0 8px; }
.h:first-child { margin-top: 0; }

.layers { display: grid; gap: 2px; }
.layer { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border: 0; border-radius: var(--r-sm); background: none; text-align: left; }
.layer:hover { background: var(--surface-2); }
.layer.on { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.layer .sw { width: 12px; height: 12px; border-radius: 3px; flex: 0 0 auto; }
.layer .est { margin-left: auto; font-size: var(--fs-xs); color: var(--faint); }
.group { font-size: var(--fs-xs); color: var(--faint); margin: 10px 10px 2px; }

.places { display: grid; gap: 6px; }
.place { display: grid; grid-template-columns: 28px 1fr auto; gap: 8px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); text-align: left; width: 100%; }
.place:hover { border-color: var(--accent-line); }
.place .ic { width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.place .ic svg { width: 16px; height: 16px; }
.place .nm { font-weight: 500; line-height: 1.25; }
.place .ds { font-size: var(--fs-xs); color: var(--muted); }
.empty { color: var(--muted); font-size: var(--fs-sm); padding: 6px 2px; }
.locked { padding: 12px; border: 1px dashed var(--line-2); border-radius: var(--r-sm); font-size: var(--fs-sm); color: var(--ink-2); }

/* map */
.mapwrap { position: relative; min-height: 0; display: grid; grid-template-rows: auto 1fr; }
.daybar { display: flex; gap: 6px; padding: 10px 14px; background: var(--surface); border-bottom: 1px solid var(--line); overflow-x: auto; align-items: center; }
.daybar .lbl { font-size: var(--fs-sm); color: var(--muted); margin-right: 6px; white-space: nowrap; }
.day { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 4px 12px; font-size: var(--fs-sm); white-space: nowrap; }
.day.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.map { position: relative; overflow: hidden; background: var(--map-bg); touch-action: none; cursor: grab; }
.map.picking { cursor: crosshair; }
.map svg { width: 100%; height: 100%; display: block; }
.map path.d { stroke: var(--map-stroke); stroke-width: .5; vector-effect: non-scaling-stroke; }
.map path.d:hover, .map path.d.sel { stroke: var(--ink); stroke-width: 1.6; }
.map .city { font-size: 11px; fill: var(--ink-2); paint-order: stroke; stroke: var(--halo); stroke-width: 3px; font-weight: 500; pointer-events: none; }
.map .tip { position: absolute; z-index: 5; pointer-events: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: var(--shadow); padding: 6px 10px; font-size: var(--fs-sm); white-space: nowrap; }
.zoom { position: absolute; right: 12px; top: 12px; display: grid; gap: 4px; z-index: 4; }
.zoom button { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); box-shadow: var(--shadow); font-size: 18px; line-height: 1; }
.legend { position: absolute; left: 12px; bottom: 12px; z-index: 4; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 10px 12px; font-size: var(--fs-xs); max-width: 280px; }
.legend svg { width: auto; height: auto; display: inline-block; flex: 0 0 auto; }
.legend .t { font-weight: 600; font-size: var(--fs-sm); margin-bottom: 6px; }
.legend .row { display: flex; align-items: center; gap: 8px; margin: 3px 0; }
.legend .sw { width: 14px; height: 14px; border-radius: 3px; }
.legend .ramp { height: 10px; border-radius: 3px; margin: 4px 0 2px; }
.legend .ends { display: flex; justify-content: space-between; color: var(--muted); }
.legend .lvticks { display: grid; grid-template-columns: repeat(4, 1fr); color: var(--ink-2); text-align: center; }
.legend .rng { margin-top: 4px; }
.map canvas.anim { position: absolute; inset: 0; pointer-events: none; }
.map path.d { transition: fill .5s ease; } .map.playing path.d { transition: none; }
.timeline { position: absolute; right: 12px; bottom: 12px; z-index: 4; display: flex; align-items: center; gap: 10px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow); padding: 5px 8px 5px 5px; }
.timeline .tlbtn { width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; }
.timeline .tlbtn:hover { background: #095d71; }
.timeline .clock { font-weight: 600; min-width: 44px; font-variant-numeric: tabular-nums; }
.timeline input[type=range] { width: 220px; accent-color: var(--accent); }
/* the bar keeps clear of the legend at the map's left foot (they met at 1400 px, the visual sweep 2026-10-19) */
.timeline { max-width: calc(100% - 310px); } .timeline input[type=range] { min-width: 80px; flex: 1 1 220px; width: auto; }
.timeline .tlday { border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 4px 10px; font-size: var(--fs-sm); white-space: nowrap; }
.timeline .tlday.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }
.daych { margin: 2px 0 6px; }
.daych .dr { display: grid; grid-template-columns: 88px minmax(0, 1fr) 64px; align-items: center; gap: 8px; height: 32px; }
.daych .dn { font-size: var(--fs-sm); color: var(--ink-2); }
.daych .dv { font-size: var(--fs-sm); font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.daych svg { width: 100%; height: 30px; display: block; overflow: hidden; background: linear-gradient(90deg, transparent 24.8%, var(--line) 25%, transparent 25.2%, transparent 49.8%, var(--line) 50%, transparent 50.2%, transparent 74.8%, var(--line) 75%, transparent 75.2%); }
.daych .ph { stroke: var(--ink); stroke-width: 1.5; vector-effect: non-scaling-stroke; opacity: .7; }
.daych .dt { display: grid; grid-template-columns: 88px minmax(0, 1fr) 64px; gap: 8px; margin-top: 2px; }
.daych .dt > div { display: flex; justify-content: space-between; }
/* motion: the panel's parts rise in, bars grow, lines draw, levels pop (none with reduced motion) */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes grow { from { transform: scaleX(0); } }
@keyframes growy { from { transform: scaleY(0); } }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
.panel > * { animation: rise .45s cubic-bezier(.2, .7, .2, 1) both; }
.panel > *:nth-child(2) { animation-delay: .05s; } .panel > *:nth-child(3) { animation-delay: .1s; } .panel > *:nth-child(4) { animation-delay: .15s; }
.panel > *:nth-child(5) { animation-delay: .2s; } .panel > *:nth-child(6) { animation-delay: .25s; } .panel > *:nth-child(n+7) { animation-delay: .3s; }
.nat .bar span { transform-origin: left center; animation: grow 1s cubic-bezier(.2, .7, .2, 1) both .2s; }
path.ln { stroke-dasharray: 1; animation: draw 1.4s ease-out both .2s; }
rect.bar { transform-box: fill-box; transform-origin: bottom; animation: growy .6s ease-out both; animation-delay: calc(var(--i, 0) * 18ms + .2s); }
.r .strip .cell .sq { animation: pop .35s ease-out both; animation-delay: calc(var(--i, 0) * 45ms + .15s); }
.pill { animation: pop .3s ease-out both .1s; }
.signin-card { animation: rise .5s cubic-bezier(.2, .7, .2, 1) both; }
.layer.on .sw { animation: pop .3s ease-out both; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
/* the five features (features.js) */
.alerts { display: grid; gap: 6px; }
.alert { display: grid; gap: 2px; text-align: left; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); padding: 7px 9px; }
.alert:hover, .alert.on { border-color: var(--accent-line); background: var(--surface-2); }
.banner { display: flex; align-items: center; gap: 6px; width: 100%; text-align: left; border-radius: var(--r); padding: 10px 14px; margin: 14px 0 0; border: 1px solid transparent; font-size: var(--fs-sm); }
.banner .sp, .eph .sp { flex: 1; }
.banner .bt { flex: 1 1 auto; min-width: 0; } .banner .go { flex: 0 0 auto; font-weight: 600; }
.map path.d.alerted { stroke: #8a2b22; stroke-width: 1.4; stroke-dasharray: 3 2; }
.day.alerted { position: relative; } .day.alerted::after { content: ""; position: absolute; top: 3px; right: 5px; width: 6px; height: 6px; border-radius: 50%; background: var(--l3); }
.badge { background: var(--l3); color: #fff; border-radius: 999px; font-size: var(--fs-xs); padding: 0 7px; font-weight: 600; letter-spacing: 0; }
.pt { margin-top: 10px; } .ptrow { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chip { background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 2px 10px; font-size: var(--fs-sm); }
.ptday { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.pt .strip { display: flex; gap: 3px; } .pt .strip .cell { width: 40px; display: grid; justify-items: center; gap: 2px; } .pt .strip .d { font-size: 10px; color: var(--faint); white-space: nowrap; }
.eps { display: grid; gap: 8px; } .ep { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 10px; }
.eph { display: flex; align-items: center; gap: 6px; } .epr:not(:empty) { margin-top: 8px; }
.epadd { display: grid; grid-template-columns: 150px 1fr auto; gap: 6px; margin-top: 8px; }
.epf tr.hi td { background: var(--l2-soft); }
.zb { display: inline-block; width: 60px; height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; vertical-align: 0; }
.zb i { display: block; height: 100%; background: var(--l2); }
.clinic { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; margin-top: 14px; background: var(--surface-2); }
.clinic > div { flex: 1 1 200px; min-width: 0; }
.clinic .btn { flex: none; white-space: nowrap; }   /* 2026-10-19: the button squeezed to three lines in its 30 px */
table.wk th, table.wk td { text-align: center; padding: 5px 3px; line-height: 1.2; } table.wk th:first-child { text-align: left; }
.epf { font-size: var(--fs-xs); } .epf td, .epf th { white-space: normal; padding: 5px 4px; } .epr .note { white-space: normal; }
table.wk td { text-align: center; } table.wk td:first-child { text-align: left; } table.wk tbody tr { cursor: pointer; } table.wk tbody tr:hover { background: var(--surface-2); }
table.wk .sq { width: 12px; height: 12px; animation: pop .35s ease-out both; animation-delay: calc(var(--i, 0) * 40ms + .1s); }
/* the waiting-room screen: the map alone, a card with the clinic's forecast */
body.kiosk .top, body.kiosk .side, body.kiosk .panel, body.kiosk .tabs, body.kiosk .zoom, body.kiosk .daybar, body.kiosk .legend .rng { display: none !important; }
body.kiosk .app { grid-template-rows: 1fr; } body.kiosk .main { grid-template-columns: 1fr; grid-template-rows: 1fr; } body.kiosk .mapwrap { grid-template-rows: 1fr; }
.kcard { position: absolute; right: 24px; top: 24px; z-index: 6; width: min(420px, 40vw); background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); padding: 22px 24px; animation: rise .6s both; }
.kcard .kt { font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .08em; color: var(--accent); font-weight: 600; }
.kcard .kz { font-size: var(--fs-xl); font-weight: 600; margin: 4px 0 12px; }
.kcard .kl { display: flex; align-items: center; gap: 10px; font-size: var(--fs-md); } .kcard .kl .pill { font-size: var(--fs-md); padding: 4px 14px; }
.kcard .kd { display: flex; gap: 16px; margin: 14px 0; } .kcard .kd div { display: flex; align-items: center; gap: 6px; }
.kcard .ka { font-size: var(--fs-md); line-height: 1.4; color: var(--ink-2); } .kcard .kf { margin-top: 14px; font-size: var(--fs-xs); color: var(--faint); }
.kexit { position: absolute; left: 16px; top: 16px; z-index: 7; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); font-size: 20px; opacity: .5; }
.kexit:hover { opacity: 1; }
.pickhint { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); z-index: 4; background: var(--ink); color: var(--surface); border-radius: 999px; padding: 6px 14px; font-size: var(--fs-sm); }

/* levels */
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 2px 10px; font-size: var(--fs-sm); font-weight: 500; white-space: nowrap; border: 1px solid transparent; }
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.lv0 { color: var(--l0); background: var(--l0-soft); } .lv1 { color: #8a6508; background: var(--l1-soft); }
.lv2 { color: #b4520f; background: var(--l2-soft); } .lv3 { color: var(--l3); background: var(--l3-soft); }
.lvn { color: var(--muted); background: var(--surface-2); }
.sq { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }
.sq.lv0 { background: var(--l0-fill); } .sq.lv1 { background: var(--l1-fill); } .sq.lv2 { background: var(--l2-fill); } .sq.lv3 { background: var(--l3-fill); } .sq.lvn { background: var(--lnone); }

/* the report */
.panel .back { margin: -4px 0 8px -8px; }
.rep-h { display: flex; align-items: flex-start; gap: 10px; }
.rep-h h2 { font-size: var(--fs-lg); line-height: 1.25; margin: 0; font-weight: 600; }
.rep-h .sub { color: var(--muted); font-size: var(--fs-sm); margin-top: 2px; }
.today { margin: 16px 0 6px; padding: 14px 16px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface-2); }
.today .big { font-size: var(--fs-md); font-weight: 600; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.today .why { color: var(--ink-2); font-size: var(--fs-sm); margin-top: 4px; }
.today .pending { font-weight: 400; font-size: var(--fs-sm); color: var(--muted); }
.rows { display: grid; }
.r { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.r:last-child { border-bottom: 0; }
.r .nm { font-weight: 500; }
.r .val { color: var(--muted); font-size: var(--fs-sm); }
.r .strip { grid-column: 1 / -1; display: flex; gap: 3px; align-items: center; }
.r .strip .d { font-size: 10px; color: var(--faint); text-align: center; white-space: nowrap; }
.r .strip .cell { width: 40px; display: grid; justify-items: center; gap: 2px; }
.est-tag { font-size: var(--fs-xs); color: var(--faint); font-weight: 400; margin-left: 4px; }
.wx { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 6px 0; }
.wx .c { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 10px; }
.wx .k { font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; }
.wx .v { font-size: var(--fs-base); font-weight: 600; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.wx svg { width: 16px; height: 16px; color: var(--accent); }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); margin-top: 4px; }
.table th { text-align: left; font-weight: 500; color: var(--muted); font-size: var(--fs-xs); padding: 6px 4px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 6px 4px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.chart { margin: 6px 0 14px; }
.chart .t { font-size: var(--fs-sm); font-weight: 500; display: flex; justify-content: space-between; }
.chart svg { width: 100%; height: 64px; display: block; }
details.how { margin-top: 14px; font-size: var(--fs-sm); color: var(--ink-2); }
details.how summary { cursor: pointer; color: var(--accent); font-weight: 500; }
details.how dl { margin: 8px 0 0; } details.how dt { font-weight: 600; margin-top: 8px; } details.how dd { margin: 2px 0 0; color: var(--muted); }
.fires { font-size: var(--fs-sm); color: var(--ink-2); background: var(--l2-soft); border-radius: var(--r-sm); padding: 8px 10px; margin-top: 8px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

/* the national picture */
.nat .row { display: grid; grid-template-columns: 130px 1fr; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.nat .row:hover .nm { color: var(--accent); }
.nat .bar { display: flex; height: 12px; border-radius: 3px; overflow: hidden; background: var(--lnone); }
.nat .bar span { display: block; height: 100%; }
.nat .ppl { grid-column: 2; font-size: var(--fs-xs); color: var(--muted); }
.foot { margin-top: 18px; font-size: var(--fs-xs); color: var(--faint); line-height: 1.6; }

/* dialogs */
.dlg { position: fixed; inset: 0; z-index: 50; background: rgba(20, 30, 40, .35); display: grid; place-items: center; padding: 16px; }
.dlg .box { width: 100%; max-width: 520px; max-height: 90vh; overflow: auto; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); padding: 22px 24px; }
.dlg.wide .box { max-width: 820px; }
.dlg h3 { margin: 0 0 4px; font-size: var(--fs-md); font-weight: 600; }
.dlg .lead { color: var(--muted); font-size: var(--fs-sm); margin: 0 0 16px; }
.kinds { display: flex; gap: 6px; flex-wrap: wrap; }
.kinds button { border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 5px 12px; font-size: var(--fs-sm); }
.kinds button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.note { background: var(--accent-soft); border-radius: var(--r-sm); padding: 8px 10px; font-size: var(--fs-xs); color: var(--ink-2); margin: 4px 0 14px; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 60; background: var(--ink); color: var(--surface); padding: 9px 16px; border-radius: 999px; font-size: var(--fs-sm); box-shadow: var(--shadow); }

/* a phone: the map on top, the rest in a sheet */
.tabs { display: none; }
@media (max-width: 900px) {
  .app { grid-template-rows: 52px 1fr; }
  .top { gap: 10px; padding: 0 12px; } .top .date { display: none; } .search { width: auto; flex: 1; }
  .brand small, .top .brand > span:last-child, #userName { display: none; }
  .daybar .lbl { display: none; }
  .legend { font-size: 11px; padding: 6px 8px; left: 8px; bottom: 8px; } .legend .t { font-size: var(--fs-xs); margin-bottom: 2px; } .legend .rng, .legend .tier { display: none; }
  .legend .row { display: inline-flex; margin: 1px 8px 1px 0; gap: 4px; } .legend .sw { width: 10px; height: 10px; }
  .main { grid-template-columns: 1fr; grid-template-rows: 46vh auto 1fr; }
  .mapwrap { grid-row: 1; }
  .tabs { grid-row: 2; display: grid; grid-template-columns: repeat(2, 1fr); background: var(--surface); border-bottom: 1px solid var(--line); }
  .tabs button { border: 0; background: none; padding: 10px; font-weight: 500; color: var(--muted); border-bottom: 2px solid transparent; }
  .tabs button.on { color: var(--accent); border-bottom-color: var(--accent); }
  .side, .panel { grid-row: 3; border: 0; }
  .main[data-tab="panel"] .side, .main[data-tab="side"] .panel { display: none; }
  .legend { max-width: 52vw; }
  .legend .rng, .legend .hournote, .legend .row, .legend .tier { display: none; } .legend { max-width: 46vw; }
  .timeline { left: 8px; right: 52px; bottom: auto; top: 8px; } .timeline input[type=range] { flex: 1; width: auto; min-width: 0; } .timeline .tlday { padding: 4px 8px; }
  .wx { grid-template-columns: repeat(2, 1fr); }
}
/* A phone scrolls the whole page: the map on top at a fixed height, the report below it at its full length, the header
   and the two tabs pinned (2026-10-19: the report sat in a 358 px strip that scrolled inside itself, measured on a
   390 x 844 phone by the regression tool's phone scenario). The map keeps its own pan and pinch. */
@media (max-width: 900px) {
  html, body { height: auto; }
  .app { height: auto; min-height: 100%; grid-template-rows: 52px auto; }
  .top { position: sticky; top: 0; z-index: 30; }
  .main { grid-template-rows: auto auto auto; }
  .mapwrap { height: 56vh; height: 56svh; }
  .tabs { position: sticky; top: 52px; z-index: 20; }
  .side, .panel { overflow: visible; min-height: 50vh; }
}
@media print {
  .top, .side, .mapwrap, .tabs, .actions, .back { display: none !important; }
  .app, .main { display: block; height: auto; } .panel { border: 0; overflow: visible; }
  body { background: #fff; }
}

/* the account around the app (account.js, 2026-10-19) */
.signin-ask { margin-top: 14px; font-size: var(--fs-sm); color: var(--ink-2); text-align: center; }
/* the "data late" strip: its own class (it was .banner, which the alerts button in the panel already used, and pinned that
   button over the day bar; seen 2026-10-19). At the foot of the map, away from the days, with a close button. */
.stale-strip { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 25; max-width: min(720px, calc(100vw - 32px));
               display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px 8px 14px; background: var(--l2-soft); color: var(--ink);
               border: 1px solid var(--line); border-radius: var(--r); font-size: var(--fs-sm); box-shadow: var(--shadow); }
.stale-strip .x { border: 0; background: none; font-size: var(--fs-md); line-height: 1; padding: 0 4px; color: var(--muted); cursor: pointer; }
.stale-strip .x:hover { color: var(--ink); }
.check { display: flex; gap: 8px; align-items: flex-start; margin: 4px 0 10px; color: var(--ink-2); }
.check input { margin-top: 3px; }
.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.tbl th { text-align: left; font-weight: 500; color: var(--muted); padding: 6px 4px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 6px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }

/* the year of a district (season.js, 2026-10-19) */
.cal-row { margin: 10px 0 4px; }
.cal-l { font-size: var(--fs-sm); color: var(--ink-2); margin-bottom: 2px; }
.cal-m { display: grid; grid-template-columns: repeat(12, 1fr); font-size: var(--fs-xs); color: var(--muted); text-align: center; }

/* past days: the calendar (2026-10-19); the air days after CAMS (GEOS-FP) dashed */
.daybar .day.cal { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.daybar .day.ext { border-style: dashed; }
.today.past { border-left: 3px solid var(--muted); }
.why.ext { color: var(--muted); font-size: var(--fs-sm); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 12px 0 8px; text-align: center; }
.cal-grid > span:not(.cal-d) { font-size: var(--fs-xs); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.cal-d { position: relative; min-height: 44px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font: inherit; cursor: pointer; display: grid; place-items: center; padding: 4px 0 8px; }
.cal-d.on { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(17, 113, 136, .25); }
.cal-d.today { color: var(--accent); font-weight: 600; }
.cal-d.off { color: var(--line); cursor: default; border-style: dashed; }
.cal-d i { position: absolute; left: 22%; right: 22%; bottom: 6px; height: 5px; border-radius: 3px; }

/* a layer with nothing to paint says why, on the map (the Red clínica before its first week, 2026-10-19) */
.mapnote { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); max-width: min(420px, 80%); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 16px; color: var(--ink-2); font-size: var(--fs-sm); box-shadow: 0 6px 18px rgba(0, 0, 0, .08); z-index: 5; }

/* the language and theme switches on the sign-in page */
.signin-prefs { margin-top: 10px; text-align: center; font-size: var(--fs-sm); color: var(--muted); }
.signin-prefs a { color: var(--muted); }

/* PM2.5 measured on the ground (OpenAQ, 2026-10-19) */
.measured { margin: 10px 0; padding: 10px 12px; border: 1px solid var(--accent-line); background: var(--accent-soft); border-radius: var(--r-sm); font-size: var(--fs-sm); color: var(--ink-2); }
@media (max-width: 900px) { .timeline { max-width: none; } }   /* on a phone the bar sits at the top of the map, away from the legend */
