/* Calm layout for the country and city pages: one column, hairline rules, no boxes.
   Loaded after site.css, so it only overrides. Every colour comes from the
   site tokens (--ink, --ink-3, --rule, --link), so both themes follow. */

/* ---------- one column: country, city and home pages ---------- */
/* the same width for every chart, strip and bar on the three pages */
.calm-page,.home-page{max-width:820px;margin:0 auto;padding:0 var(--gut)}

/* ---------- page head ---------- */
.calm-page .page-head.calm{padding-bottom:0}
.calm-page .page-head.calm h1{font-size:2.5rem;line-height:1.12;margin:0}
@media (max-width:640px){.calm-page .page-head.calm h1{font-size:2.125rem}}
.calm-page .page-head.calm .meta{font-size:.875rem;color:var(--ink-3);margin:6px 0 0}

/* ---------- the type scale, the same on the three pages ---------- */
/* the body keeps 1.0625rem on a phone too, where site.css drops it to 1rem */
.calm-page,.home-page{font-size:1.0625rem}
.calm-page h2,.home-page h2{font-size:1.5rem;line-height:1.25}
.calm-page h3,.home-page h3{font-size:1.0625rem;line-height:1.35}

/* ---------- the one-line answer ---------- */
.calm-page .verdict{font-size:1.125rem;line-height:1.45;max-width:52ch;margin:12px 0 14px;color:var(--ink)}
@media (max-width:640px){.calm-page .verdict{font-size:1.125rem}}

/* ---------- the odds under the answer ---------- */
.calm-page .lead-odds{margin:0 0 12px}
.calm-page .lead-odds .lo-item{margin:0 0 14px}
.calm-page .lead-odds .lab{display:block;font-size:.8125rem;font-weight:600;color:var(--ink-3);margin-bottom:6px}
.calm-page .lead-odds .lo-temp{font-size:1.05rem;color:var(--ink);margin:0}
.calm-page .lead-odds .odds{margin-top:0}
/* one bar component for rain and temperature: label on top, three segments below */
.calm-page .varbar{margin:0 0 10px}
.calm-page .varbar .lab{display:block;font-size:.8125rem;font-weight:600;color:var(--ink-3);margin-bottom:6px}
.calm-page .varbar .lab span{display:block;font-weight:400;color:var(--ink-3);font-size:.8125rem;margin-top:2px}
.calm-page .prov{margin:2px 0 0;font-size:.8125rem}
/* "Later months" uses the same stacked bar, so the side-by-side variant goes */
.calm-page .metric{display:block;margin-bottom:20px}
.calm-page .metric .varbar{margin:0}
/* the key under the bar: a grid of swatch, label, value, with no wrapping cells */
.calm-page .odds-key,.outlook-page .odds-key{display:flex;flex-wrap:wrap;gap:4px 14px;list-style:none;margin:7px 0 0;padding:0;font-size:.8125rem;color:var(--ink-3)}
.calm-page .odds-key li,.outlook-page .odds-key li{display:flex;align-items:center;gap:6px}
.calm-page .odds-key span,.outlook-page .odds-key span{white-space:nowrap;min-width:0}
.calm-page .odds-key b,.outlook-page .odds-key b{margin-left:0;color:var(--ink);font-weight:600;font-variant-numeric:tabular-nums;white-space:nowrap}
.calm-page .odds-key .sw,.outlook-page .odds-key .sw{display:block;align-self:center;width:12px;height:12px;border-radius:2px;flex:none}
.calm-page .odds-key.rain .sw.lo,.outlook-page .odds-key.rain .sw.lo{background:var(--r-d2)}
.calm-page .odds-key.rain .sw.hi,.outlook-page .odds-key.rain .sw.hi{background:var(--r-w2)}
.calm-page .odds-key.temp .sw.lo,.outlook-page .odds-key.temp .sw.lo{background:var(--seg-temp-lo)}
.calm-page .odds-key.temp .sw.hi,.outlook-page .odds-key.temp .sw.hi{background:var(--seg-temp-hi)}
.calm-page .odds-key .sw.mid,.outlook-page .odds-key .sw.mid{background:var(--seg-mid)}

/* ---------- the strip of three facts ---------- */
.calm-page .strip{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0 22px;margin:0 0 14px;padding:12px 0;border-top:1px solid var(--rule);border-bottom:1px solid var(--rule);background:none}
.calm-page .strip>div{padding:2px 0 2px 16px;border-left:1px solid var(--rule)}
.calm-page .strip>div:first-child{padding-left:0;border-left:0}
/* on a phone the cells stack, each one separated by a horizontal rule, so no
   line stops half way down the strip */
@media (max-width:640px){
  .calm-page .strip{grid-template-columns:1fr;gap:0;align-items:start;border-top:0}
  .calm-page .strip>div,.calm-page .strip>div:first-child{border-left:0;border-top:1px solid var(--rule);padding:10px 0}
}

/* ---------- the odds bars: the "normal" band must read against the page ---------- */
/* the segment colours are tokens, so dark mode can set its own */
:root{--seg-mid:#A3ADB3;--seg-temp-lo:#6E8FA6;--seg-temp-hi:#C96B50}
@media (prefers-color-scheme:dark){
  :root:not([data-theme=light]){--seg-mid:#7E868C;--seg-temp-lo:#5C7E99;--seg-temp-hi:#A85C46}
}
:root[data-theme=dark]{--seg-mid:#7E868C;--seg-temp-lo:#5C7E99;--seg-temp-hi:#A85C46}
.calm-page .rain .mid,.calm-page .temp .mid,.outlook-page .rain .mid,.outlook-page .temp .mid{background:var(--seg-mid)}
/* temperature: a neutral band below normal, a warm one above; blue would read as "cold is good" */
.calm-page .temp .lo{background:var(--seg-temp-lo)}
.calm-page .temp .hi{background:var(--seg-temp-hi)}
.calm-page .strip dt{font-size:.8125rem;font-weight:500;color:var(--ink-3);margin:0}
.calm-page .strip dd{font-size:1rem;color:var(--ink);margin:3px 0 0}

/* ---------- the air-quality tints ----------
   A pastel surface with dark text in light mode. In dark mode the tile is a
   neutral surface with light text, and the severity is carried by the 3px bar
   in the severity colour on the left. */
:root{
  --aqt1:#e9f4dc;--aqt2:#fbf1d2;--aqt3:#fbe6d7;--aqt4:#f9dcd9;--aqt5:#e4daee;--aqt6:#ecd6dd;
  --aqi1:#16220e;--aqi2:#2b2300;--aqi3:#2e1500;--aqi4:#2a0606;--aqi5:#241331;--aqi6:#2a0d18;
  --aqb1:#6aa832;--aqb2:#a98207;--aqb3:#c2631a;--aqb4:#c03630;--aqb5:#6d4290;--aqb6:#7c2740;
}
@media (prefers-color-scheme:dark){:root:not([data-theme=light]){
  --aqt1:var(--paper-2);--aqt2:var(--paper-2);--aqt3:var(--paper-2);--aqt4:var(--paper-2);--aqt5:var(--paper-2);--aqt6:var(--paper-2);
  --aqi1:var(--ink);--aqi2:var(--ink);--aqi3:var(--ink);--aqi4:var(--ink);--aqi5:var(--ink);--aqi6:var(--ink);
  --aqb1:#7fbd44;--aqb2:#c9a520;--aqb3:#d0813f;--aqb4:#cf5a55;--aqb5:#9b6cc0;--aqb6:#ab5570;
}}
:root[data-theme=dark]{
  --aqt1:var(--paper-2);--aqt2:var(--paper-2);--aqt3:var(--paper-2);--aqt4:var(--paper-2);--aqt5:var(--paper-2);--aqt6:var(--paper-2);
  --aqi1:var(--ink);--aqi2:var(--ink);--aqi3:var(--ink);--aqi4:var(--ink);--aqi5:var(--ink);--aqi6:var(--ink);
  --aqb1:#7fbd44;--aqb2:#c9a520;--aqb3:#d0813f;--aqb4:#cf5a55;--aqb5:#9b6cc0;--aqb6:#ab5570;
}
.calm-page .haze td.aq1{background:var(--aqt1);color:var(--aqi1);border-left:3px solid var(--aqb1)}
.calm-page .haze td.aq2{background:var(--aqt2);color:var(--aqi2);border-left:3px solid var(--aqb2)}
.calm-page .haze td.aq3{background:var(--aqt3);color:var(--aqi3);border-left:3px solid var(--aqb3)}
.calm-page .haze td.aq4{background:var(--aqt4);color:var(--aqi4);border-left:3px solid var(--aqb4)}
.calm-page .haze td.aq5{background:var(--aqt5);color:var(--aqi5);border-left:3px solid var(--aqb5)}
.calm-page .haze td.aq6{background:var(--aqt6);color:var(--aqi6);border-left:3px solid var(--aqb6)}
.calm-page .haze td.aq{padding-left:8px}
/* the severity colour of every tile, kept beside it so the dark-mode edge can use it */
.calm-page .aq1{--aqedge:var(--aqb1)}
.calm-page .aq2{--aqedge:var(--aqb2)}
.calm-page .aq3{--aqedge:var(--aqb3)}
.calm-page .aq4{--aqedge:var(--aqb4)}
.calm-page .aq5{--aqedge:var(--aqb5)}
.calm-page .aq6{--aqedge:var(--aqb6)}
/* the strip badge is a solid colour fill in the light sheet; on the calm pages
   it takes the neutral surface and a semantic left edge, as the city tiles do */
.calm-page .strip span.aq{background:var(--aq-surface);color:var(--ink);border-left:3px solid var(--aqedge)}

/* ---------- the big number (city page and home page) ---------- */
.bignum{display:flex;align-items:baseline;gap:12px;margin:0 0 20px}
.bignum .num{font-size:3.6rem;line-height:1;font-variant-numeric:tabular-nums}
.bignum .num.aq{padding:2px 14px}
.bignum>span:last-child{font-size:.95rem;color:var(--ink-3)}
/* the city page leads with today, so the number is smaller than the El Niño one */
.calm-page .bignum .num{font-size:3rem}
.calm-page .bignum.today>span:last-child{font-size:1.05rem;color:var(--ink-2)}
.calm-page .bignum.today{margin:0 0 12px}
/* the scale legend inside "More about this" */
.calm-page .aqscale{list-style:none;margin:12px 0 0;padding:0;display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:4px 16px;font-size:.8125rem;color:var(--ink-3)}
.calm-page .aqscale b{color:var(--ink);font-weight:600;margin-right:5px}
/* the name of the big number, and the health advice under it */
.calm-page .bignum.today .aqi-lab{color:var(--ink);font-weight:600}
/* on a phone the name of the number sits under it, not beside it */
@media (max-width:640px){
  .calm-page .bignum.today{flex-direction:column;align-items:flex-start;gap:6px}
}
.calm-page .health{margin:0 0 10px}
.calm-page .health-advice{margin:0 0 3px;font-size:1.0625rem;line-height:1.45;color:var(--ink)}
.calm-page .health-risk{margin:0 0 18px;font-size:.9375rem;line-height:1.45;color:var(--ink-2)}
/* the one muted source line under a chart */
.note.chart-src{margin:6px 0 0}

/* ---------- the days as a row of tiles (city page) ---------- */
/* the number of tiles is set by the page: --days says how many days follow */
.calm-page .days{display:grid;grid-template-columns:repeat(var(--days,3),minmax(0,1fr));gap:8px;list-style:none;margin:0 0 18px;padding:0}
.calm-page .days li{display:flex;flex-direction:column;gap:2px;padding:9px 11px;border-radius:var(--rad);border-left:3px solid var(--rule-2);min-width:0}
.calm-page .days .d{display:flex;align-items:center;justify-content:space-between;gap:6px;font-size:.8125rem;font-weight:600;white-space:nowrap}
.calm-page .days .v{font-size:1.35rem;font-weight:600;line-height:1.15;align-self:flex-start}
.calm-page .days .c{font-size:.8125rem;opacity:.85}
.calm-page .days .worst-tag{font-size:.7rem;line-height:1.5;font-weight:500;border:1px solid currentColor;border-radius:2px;padding:0 5px;white-space:nowrap}

/* ---------- the two climate charts (city page) ---------- */
.clim-chart{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:4px;margin:22px 0 6px}
.clim-col{display:flex;flex-direction:column;align-items:center;gap:4px;min-width:0}
.clim-col .barwrap{position:relative;display:flex;align-items:flex-end;width:100%;height:150px}
.clim-col .peak{position:absolute;left:50%;transform:translateX(-50%);margin-bottom:2px;font-size:.75rem;line-height:1;color:var(--ink);white-space:nowrap}
.clim-col .mo{font-size:12px;color:var(--ink-3);line-height:1}
.mo1{display:none}
@media (max-width:480px){.mo3{display:none}.mo1{display:inline}}
/* the temperature row: one line over the same 360x100 box as the rainfall bars */
.clim-chart.temps{margin:10px 0 6px;position:relative}
.tover{position:absolute;inset:0;pointer-events:none}
.ttick{position:absolute;right:88.889%;transform:translateY(-50%);font-size:12px;line-height:1;color:var(--chart-muted,var(--ink-3));text-align:right;white-space:nowrap}
.tmo{position:absolute;top:92%;transform:translate(-50%,-100%);font-size:12px;line-height:1;color:var(--chart-muted,var(--ink-3));white-space:nowrap}
@media (max-width:640px){.clim-col .barwrap{height:120px}}

/* ---------- the city page is one column like the country page ---------- */
.city-col{min-width:0}

/* ---------- sections ---------- */
.calm-page section.block{margin-top:56px;border:0;background:none;padding:0}
.calm-page h2{margin:0 0 14px}
.calm-page p{max-width:68ch}
.calm-page .measure{max-width:68ch}
.calm-page .explore-links{color:var(--ink-3)}
.calm-page .haz,.calm-page .outlook-line{max-width:68ch}

/* ---------- every disclosure looks the same ---------- */
details.more{margin-top:10px}
details.more>summary,details.section-details>summary{cursor:pointer;list-style:none;font:400 1rem/1.5 var(--sans);letter-spacing:0;color:var(--link);margin:0;padding:6px 0}
details.more>summary::-webkit-details-marker,details.section-details>summary::-webkit-details-marker{display:none}
/* the plus needs its own gap: a space inside content is lost when the summary
   is a flex row, so the mark and the text run together */
details.more>summary::before,details.section-details>summary::before{content:"+";margin-right:.4em;color:var(--link)}
details.more[open]>summary::before,details.section-details[open]>summary::before{content:"−";margin-right:.4em}
details.more p,details.more ul,details.more ol,details.more dl{font-size:1rem;color:var(--ink-3);max-width:70ch}
details.more dt{color:var(--ink)}
details.more table{font-size:.9rem}
details.more summary~*{margin-top:10px}
details.more a{color:inherit}
.calm-page details.more{margin:14px 0 8px}
.calm-page details.section-details p,.calm-page details.section-details ul,.calm-page details.section-details ol,.calm-page details.section-details dl{font-size:1rem;color:var(--ink-3);max-width:70ch}
.calm-page details.section-details dt{color:var(--ink)}

/* ---------- the collapsible section headings ---------- */
details.section-details{margin-top:44px}
details.section-details>summary{margin:0;padding:6px 0}
@media (max-width:640px){details.more>summary,details.section-details>summary{min-height:44px;display:flex;align-items:center}}

/* ---------- small fixes on these two pages ---------- */
.calm-page .haze th .note{display:block;font-weight:400;font-size:.75rem}
.calm-page .country-events{margin-top:0}
.calm-page .newslist{margin-top:0}
.calm-page .advice h3{font-size:1.05rem}
.calm-page .advice ul{font-size:1rem;color:var(--ink-2)}

/* ---------- the home page ---------- */
.home-page .page-head.calm{padding-bottom:0}
.home-page .home-head{max-width:760px}
.home-page .home-verdict{font-size:1.125rem;line-height:1.5;margin:0 0 12px;color:var(--ink);max-width:52ch}
.home-page .home-head h1{font:600 2.5rem/1.12 var(--serif);letter-spacing:-.015em;margin:0 0 10px}
.home-page .home-sub{font-size:1.0625rem;line-height:1.5;color:var(--ink-3);margin:0 0 20px;max-width:46ch}
.home-page .meta{font-size:.8125rem;color:var(--ink-3);margin:4px 0 0}
.home-page .quick a{margin-right:0}
/* the popular links run sideways on a phone, so the map starts higher up */
.home-page .quick-links{display:inline-block;max-width:100%;overflow-x:auto;white-space:nowrap;vertical-align:bottom;scrollbar-width:none}
.home-page .quick-links::-webkit-scrollbar{display:none}
.home-page .now{border-top:1px solid var(--rule);padding-top:14px;margin-top:56px}
.home-page .now-title{grid-column:1/-1}
.home-page .now-title h2{margin:0}
/* one chip row above the map: All, then the event types that are in the feed */
.home-page .evchips{grid-column:1/-1;margin:0 0 12px;overflow-x:auto;scrollbar-width:none;flex-wrap:nowrap;border-bottom:0}
.home-page .evchips::-webkit-scrollbar{display:none}
.home-page .evchips .chipbtn{flex:none}
.home-page section.block{margin-top:40px}
/* the feed shows the 8 newest events; the rest waits behind "Show all" */
#feed.collapsed > li:nth-child(n+4){display:none}
@media (max-width:640px){
  .home-page .home-verdict{font-size:1.25rem}
  .home-page .home-head h1{font-size:2.125rem}
}
/* on a phone the hero gives up 40% of its vertical padding, so the map shows
   above the fold on a 375x812 screen */
@media (max-width:599px){
  .home-page .page-head:first-child{padding-top:22px}
  .home-page .home-head h1{margin-bottom:8px}
  .home-page .home-sub{margin-bottom:16px}
  .home-page .quick{margin-top:10px}
}

/* ---------- the masthead on a phone ----------
   Brand, theme button and search icon share one row, and the menu sits on a
   row of its own that scrolls sideways if it does not fit. */
@media (max-width:640px){
  .masthead .wrap{flex-direction:row;flex-wrap:wrap;align-items:center;justify-content:flex-start;gap:0;padding:8px 0 0}
  .masthead .brand{margin-right:auto;max-width:none}
  .brand svg{width:30px;height:30px}
  .brand-name{font-size:1.15rem}
  .theme-btn{position:static;right:auto;top:auto;width:44px;min-height:40px;margin:0 4px 0 0;padding:0;border-color:transparent;display:inline-flex;align-items:center;justify-content:center}
  .theme-btn svg{display:block}
  .theme-btn .tb-t,.hsearch .hs-t{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
  .js #theme-btn[hidden]{display:inline-flex!important}
  .hsearch{position:static;right:auto;top:auto;min-height:40px;padding:0 6px}
  .mainnav{flex-basis:100%;order:10;flex-wrap:nowrap;overflow-x:auto;white-space:nowrap;scrollbar-width:none;gap:18px;font-size:.95rem;padding:6px 0;width:auto;margin:0}
  .mainnav a{padding:7px 0;font-size:.95rem}
  .statusline{font-size:.9rem}
  .statusline .wrap{padding-top:8px;padding-bottom:8px}
}
/* the last menu item was clipped on a 375px screen: a smaller gap, a smaller
   label and room at the end of the scroll area */
@media (max-width:400px){
  .mainnav{gap:14px;font-size:.9rem;padding:6px 16px 6px 0;justify-content:flex-start}
  .mainnav a{font-size:.9rem}
}

/* ---------- the buttons, one look in both themes ---------- */
.search button,.mapfind button,#feed-all,.mapctl button,.chipbtn{
  background:#fff;border:1px solid #cfd6d9;color:#172731;
}
.search button:hover,.mapfind button:hover,#feed-all:hover,.mapctl button:hover,.chipbtn:hover{
  background:#f1f4f5;border-color:#a9b4b9;color:#172731;
}
/* "Show all" was a bare link, so it gets the padding a boxed button needs */
#feed-all{min-height:36px;padding:0 12px;border-radius:var(--rad);text-decoration:none}
.chipbtn{min-height:38px;padding:0 10px;border-radius:var(--rad);margin-right:8px;font-weight:500}
.chipbtn.on{background:#e9eef0;border-color:#172731;color:#172731;font-weight:600}
.chipbtn b{color:inherit;opacity:.7}
@media (prefers-color-scheme:dark){
  :root:not([data-theme=light]) .search button:not(.chipbtn):not(.linkbtn):not(.theme-btn),
  :root:not([data-theme=light]) .mapfind button:not(.chipbtn):not(.linkbtn):not(.theme-btn),
  :root:not([data-theme=light]) .mapctl button:not(.chipbtn):not(.linkbtn):not(.theme-btn),
  :root:not([data-theme=light]) #feed-all,
  :root:not([data-theme=light]) .chipbtn{background:#1E2633;border-color:#3B4758;color:#F1F5F9}
  :root:not([data-theme=light]) .search button:hover:not(.chipbtn):not(.linkbtn):not(.theme-btn),
  :root:not([data-theme=light]) .mapfind button:hover:not(.chipbtn):not(.linkbtn):not(.theme-btn),
  :root:not([data-theme=light]) .mapctl button:hover:not(.chipbtn):not(.linkbtn):not(.theme-btn),
  :root:not([data-theme=light]) #feed-all:hover,
  :root:not([data-theme=light]) .chipbtn:hover{background:#2A3444;border-color:#52606F;color:#F1F5F9}
  :root:not([data-theme=light]) .chipbtn.on{background:var(--ink);border-color:var(--ink);color:var(--paper)}
  :root:not([data-theme=light]) .search input,
  :root:not([data-theme=light]) .mapfind input{border-color:#3B4758}
}
:root[data-theme=dark] .search button:not(.chipbtn):not(.linkbtn):not(.theme-btn),
:root[data-theme=dark] .mapfind button:not(.chipbtn):not(.linkbtn):not(.theme-btn),
:root[data-theme=dark] .mapctl button:not(.chipbtn):not(.linkbtn):not(.theme-btn),
:root[data-theme=dark] #feed-all,
:root[data-theme=dark] .chipbtn{background:#1E2633;border-color:#3B4758;color:#F1F5F9}
:root[data-theme=dark] .search button:hover:not(.chipbtn):not(.linkbtn):not(.theme-btn),
:root[data-theme=dark] .mapfind button:hover:not(.chipbtn):not(.linkbtn):not(.theme-btn),
:root[data-theme=dark] .mapctl button:hover:not(.chipbtn):not(.linkbtn):not(.theme-btn),
:root[data-theme=dark] #feed-all:hover,
:root[data-theme=dark] .chipbtn:hover{background:#2A3444;border-color:#52606F;color:#F1F5F9}
:root[data-theme=dark] .chipbtn.on{background:var(--ink);border-color:var(--ink);color:var(--paper)}
:root[data-theme=dark] .search input,
:root[data-theme=dark] .mapfind input{border-color:#3B4758}

/* ---------- round 6: one column, a bigger map, a phone header ----------

   The home page is one column: the map takes the full width of the column and
   the five newest events sit under it as plain rows, not a scroll box. */
.home-page .now{grid-template-columns:minmax(0,1fr);gap:28px}
.home-page .feed{max-height:none;overflow:visible}
.home-page .evmap{width:100%}
.home-page .evmap .worldmap{height:360px}
@media (max-width:767px){
  .home-page .evmap{min-height:260px;display:flex;flex-direction:column;justify-content:center}
  .home-page .evmap .worldmap{height:auto}
  .home-page .evmap .mapctl{position:absolute;right:8px;top:8px;flex-direction:column;margin-top:0}
}
/* the land is a pale beige file, so dark mode paints it with a filter that
   turns it into the colour of the page but a little lighter */
@media (prefers-color-scheme:dark){
  :root:not([data-theme=light]) .evmap image{filter:url(#landDark)}
}
:root[data-theme=dark] .evmap image{filter:url(#landDark)}

/* the El Nino number sits beside its chart on a wide screen */
.eni-row{display:grid;gap:8px;align-items:center;margin:0 0 14px}
@media (min-width:700px){
  .eni-row{grid-template-columns:auto minmax(0,1fr);gap:28px}
  .eni-row .bignum{margin:0}
  .eni-row .eni-chart{min-width:0}
}
.eni-row .eni-chart .spark{width:100%;height:auto}

/* ---------- the phone header: one row, the links in a menu ---------- */
.menu-btn{display:none}
@media (max-width:767px){
  .masthead .wrap{min-height:56px;flex-direction:row;flex-wrap:nowrap;align-items:center;gap:6px;padding:6px 0}
  .masthead .brand{margin-right:auto;max-width:none;display:flex;align-items:center;gap:8px}
  .brand svg{width:28px;height:28px}
  .brand-name{font-size:1rem}
  .menu-btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-width:44px;min-height:44px;padding:0 10px;background:transparent;color:var(--ink-2);border:1px solid var(--rule-2);border-radius:var(--rad);cursor:pointer}
  .menu-btn .mb-t{font:500 .875rem var(--sans)}
  .mainnav{display:none;position:absolute;left:0;right:0;top:100%;flex-direction:column;align-items:stretch;gap:0;padding:6px 0;background:var(--paper);border-bottom:1px solid var(--rule);box-shadow:0 8px 18px rgba(0,0,0,.10);z-index:60}
  .mainnav.open{display:flex}
  .mainnav a{display:flex;align-items:center;min-height:44px;padding:0 var(--gut);font-size:1rem}
  .statusline{display:none}
  .theme-btn{min-height:44px;width:44px}
  .hsearch{min-height:44px}
  .masthead{position:relative;z-index:80}
}
/* site.css paints every button in dark mode, so the menu button asks for the
   header's own look with more weight than that rule carries */
@media (prefers-color-scheme:dark){
  :root:not([data-theme=light]) .masthead .wrap .menu-btn{background:transparent;color:var(--ink-2);border-color:var(--rule-2)}
}
:root[data-theme=dark] .masthead .wrap .menu-btn{background:transparent;color:var(--ink-2);border-color:var(--rule-2)}

/* ---------- the footer: the links in three columns, two on a phone ---------- */
.foot-links{columns:2;column-gap:28px}
.foot-links li{break-inside:avoid;padding:5px 0}
@media (min-width:860px){
  .foot .foot-grid{grid-template-columns:minmax(0,2fr) minmax(0,3fr)}
  .foot-links{columns:3;column-gap:36px}
}

/* ---------- the metadata type size ---------- */
.home-page .meta{font-size:.875rem}
.calm-page .strip dt{font-size:.875rem}
.calm-page .prov{font-size:.875rem}

/* ---------- the search row on the home page ---------- */
.home-page .winter{margin:20px 0 0;padding:0 0 12px}
.home-page .winter h2{font-size:18px;margin:0 0 6px}
.home-page .winter p{margin:0 0 10px;font-size:15px}
.home-page .winter-pick{display:none}
.js .home-page .winter-pick{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.home-page .winter-pick label{font-weight:600;font-size:15px}
.home-page .winter-pick select{font:inherit;font-size:15px;padding:6px 8px;min-width:0;max-width:100%}
.home-page .winter-links{display:flex;flex-wrap:wrap;gap:4px 16px;margin:0 0 10px;padding:0;list-style:none;font-size:15px}
.js .home-page .winter-links{display:none}
.home-page .winter-more{font-size:15px}
.home-page .search-row{display:flex;align-items:stretch;gap:10px;margin:20px 0 0}
.home-page .search-row .search{margin:0;flex:1 1 auto;min-width:0;max-width:none}
.home-page .search-row .nearme-row{display:flex!important;align-items:center;margin:0;flex:none}
.home-page .search-row .nearme-row .nearme{width:44px;min-width:44px;height:56px;min-height:56px;padding:0;background:transparent;color:var(--ink-2);border:1px solid var(--rule-2);border-radius:var(--rad)}
.home-page .search-row .nearme-row .nearme svg{width:20px;height:20px}
.home-page .search-row .nearme-row .nearme:hover{background:var(--paper-2);color:var(--ink)}
@media (prefers-color-scheme:dark){
  :root:not([data-theme=light]) .home-page .search-row .nearme-row .nearme{background:transparent;color:var(--ink-2);border-color:#3B4758}
}
:root[data-theme=dark] .home-page .search-row .nearme-row .nearme{background:transparent;color:var(--ink-2);border-color:#3B4758}

/* ---------- every disclosure opens the same way ---------- */
.calm-page details.more{margin:24px 0 8px}
.calm-page details.more.section-details{margin:24px 0 8px}

/* the footer links fill a grid row by row, so the columns come out even */
.foot-links{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:28px;row-gap:0}
.foot-links li{padding:0;break-inside:auto}
@media (min-width:860px){.foot-links{grid-template-columns:repeat(3,minmax(0,1fr));column-gap:36px}}

/* the stripes keep their own download link in the title row, so the year
   labels can sit 4px under the image */
#warming .chart-save{display:none}

/* ---------- round 7: the outlook page, the home payoff, the city strip ---------- */

/* the map controls stay inside the map frame on a phone, in one column,
   the same place and the same size as on the home map */
@media (max-width:640px){
  .mapbox .mapctl{position:absolute;right:8px;top:8px;flex-direction:column;justify-content:flex-start;margin-top:0}
  .mapbox .mapctl button{width:40px;height:40px}
}
/* the home map keeps its controls off the landmass where it can */
.home-page .evmap .mapctl{right:8px;top:8px}
.home-page .evmap .mapctl button{width:40px;height:40px}

/* the hazard key sits directly above the map as one compact row */
.home-page .dotkey{display:flex;flex-wrap:wrap;gap:4px 14px;list-style:none;margin:0 0 8px;padding:0;font-size:.8125rem;color:var(--ink-2)}
.home-page .dotkey li{display:flex;align-items:center;gap:5px;white-space:nowrap}
.home-page .dotkey .evdot{flex:none}

/* "Popular:" and the list need a space between them */
.home-page .quick-lab{margin-right:.45em}
.home-page .finding{margin:14px 0 0;font-size:1.0625rem;line-height:1.5;color:var(--ink)}
.home-page .finding a{color:var(--link)}

/* ---------- the city page: the forecast days, one row ---------- */
.calm-page .days{align-items:stretch}
.calm-page .days li{padding:11px 12px}
.calm-page .days .c{font-size:.8125rem;opacity:.85;hyphens:none;word-break:normal;overflow-wrap:normal}
/* the higher of the two values gets the thicker bar, not a badge */
.calm-page .days li.hi{border-left-width:5px}
/* up to three days fit on a phone; a longer forecast wraps into two columns */
@media (max-width:640px){
  .calm-page .days.d4,.calm-page .days.d5,.calm-page .days.d6,.calm-page .days.d7{grid-template-columns:repeat(2,minmax(0,1fr))}
}

/* ---------- the city page: the two climate charts ---------- */
/* the rain chart is twelve columns across the whole block */
.clim-chart.rain{position:relative}
/* the plot area and the gutter its scale sits in */
.clim-chart.rain{--plot-h:150px;--axis-gutter:40px;padding-left:var(--axis-gutter)}
.clim-chart.rain .clim-grid{grid-column:1/-1;display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:0;width:100%;position:relative;z-index:1}
/* the bars, in the same 360x100 box as the temperature line */
.rain-bars{position:absolute;left:var(--axis-gutter);top:0;width:calc(100% - var(--axis-gutter));height:var(--plot-h)}
.rbar{fill:var(--link);opacity:.7}
/* the faint line the bars stand on */
.clim-chart.rain .base{position:absolute;left:var(--axis-gutter);right:0;top:var(--plot-h);height:1px;background:var(--rule-2)}
.clim-chart.rain .unit{position:absolute;right:0;top:-20px;font-size:.75rem;color:var(--ink-3)}
@media (max-width:640px){.clim-chart.rain{--plot-h:120px}}
/* the temperature line is its own small SVG, not the timeline list */
.clim-chart.temps{margin:24px 0 6px}
.clim-chart.temps .tline{grid-column:1/-1;display:block;width:100%;height:auto;margin:0;padding:0;border:0;list-style:none}
.clim-chart.temps .tpath{fill:none;stroke:var(--link);stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.clim-chart.temps .tdot{fill:var(--paper);stroke:var(--link);stroke-width:1.6}
.clim-chart.temps .tdot.warm{fill:var(--link)}
.clim-chart.temps .tdot.cold{fill:var(--paper-3);stroke:var(--ink-2)}
.clim-chart.temps .tlab{font-size:11px;font-weight:600;fill:var(--ink)}

/* ---------- dark mode: the data colours ---------- */
/* the ramp keeps the light order: leaning is the quieter colour, likely the
   deeper one. The old wet "likely" was a bright mint, which read as neon.
   --t-n is the "near normal" bar segment, lifted so it shows against the
   dark paper. The air-quality tints sit above these, as --aqt, --aqi, --aqb. */
@media (prefers-color-scheme:dark){
  :root:not([data-theme=light]){
    --r-w1:#4C9A90;--r-w2:#20C2AE;--r-d1:#A98048;--r-n:#8A8268;
    --chart-label:#b5bcc5;--chart-grid:#36404c;--chart-muted:#8f98a3;--chart-line:#79b4ff;
  }
}
:root[data-theme=dark]{
  --r-w1:#4C9A90;--r-w2:#20C2AE;--r-d1:#A98048;--r-n:#8A8268;
  --chart-label:#b5bcc5;--chart-grid:#36404c;--chart-muted:#8f98a3;--chart-line:#79b4ff;
}
/* the charts read the dark tokens, so both themes draw the same way */
.clim-col .peak{color:var(--chart-label,var(--ink))}
.clim-col .mo{color:var(--chart-muted,var(--ink-3))}
.clim-chart.rain .base{background:var(--chart-grid,var(--rule-2))}
.clim-chart.rain .unit{color:var(--chart-muted,var(--ink-3))}
.clim-chart.temps .tpath{stroke:var(--chart-line,var(--link))}
.clim-chart.temps .tdot{stroke:var(--chart-line,var(--link))}
.clim-chart.temps .tdot.warm{fill:var(--chart-line,var(--link))}
.clim-chart.temps .tmo{fill:var(--chart-muted,var(--ink-3))}
.clim-chart.temps .tlab{fill:var(--chart-label,var(--ink))}

/* ---------- the outlook page ---------- */
/* a small gap before the search field, and a compact key right above the map */
.outlook-page .block{margin-top:22px}
.outlook-page .keyscale{flex-wrap:wrap;gap:2px 14px;max-width:100%;margin:0 0 8px}
.outlook-page .keyscale li{flex:0 0 auto;padding-right:0}

/* ---------- round 8: the map fold, the hazard key, the outlook list ---------- */

/* one button opens the map on a phone; from 768px up the map is simply there */
.mapfold > summary{cursor:pointer;list-style:none}
.mapfold > summary::-webkit-details-marker{display:none}
@media (min-width:768px){
  .mapfold > summary{display:none}
  .mapfold > .now-map{display:block!important}
  .mapfold::details-content{content-visibility:visible!important}
}
@media (max-width:767px){
  .mapfold > summary{
    display:block;width:100%;min-height:44px;margin:0 0 12px;padding:10px 14px;
    border:1px solid var(--rule-2);border-radius:var(--rad);background:var(--paper-2);
    color:var(--ink);font:500 1rem/1.4 var(--sans);text-align:center;cursor:pointer;
  }
  .mapfold:not([open]) > .now-map{display:none}
  /* open on a phone the map block reaches both screen edges and stands 70vh tall */
  .mapfold[open] > .now-map{
    position:relative;display:flex;flex-direction:column;min-height:0;height:70vh;
    margin-left:calc(-1 * var(--gut));margin-right:calc(-1 * var(--gut));
  }
  .mapfold[open] > .now-map > .mapbox{order:-1;flex:1 1 auto;min-height:0}
  /* the map runs edge to edge; the small print around it keeps the page gutter */
  .mapfold[open] > .now-map > *:not(.mapbox):not(.dotkey-fold){padding-left:var(--gut);padding-right:var(--gut)}
}

/* the hazard key: one row above the map on a desktop, a chip over the map on a phone */
@media (min-width:768px){
  .mapfold .dotkey-fold > summary{display:none}
}
@media (max-width:767px){
  .mapfold .dotkey-fold{position:absolute;top:8px;left:8px;z-index:6;margin:0;max-width:calc(100% - 16px)}
  .mapfold .dotkey-fold > summary{
    display:inline-block;min-height:32px;padding:5px 10px;
    border:1px solid var(--rule-2);border-radius:var(--rad);background:var(--paper);
    color:var(--ink);font:500 .8125rem/1.4 var(--sans);cursor:pointer;list-style:none;
  }
  .mapfold .dotkey-fold > .dotkey{
    flex-direction:column;gap:6px;align-items:flex-start;
    margin:4px 0 0;padding:8px 10px;max-width:220px;
    background:var(--paper);border:1px solid var(--rule);border-radius:var(--rad);
    box-shadow:0 6px 16px rgba(0,0,0,.14);
  }
}

/* the home page keeps every event in the page, but the list itself is folded
   away: the map and the country panel are the way in */
.js .home-page .now-feed{display:none}
@media print{.js .home-page .now-feed{display:block}}

/* the eight strongest countries: a short list on a phone, hidden on a desktop
   where the rank table further down carries the same eight */
.outlook-page .top8{display:none}
@media (max-width:767px){
  .outlook-page .top8{
    display:block;list-style:none;margin:0 0 16px;padding:0;border-top:1px solid var(--rule);
  }
  .outlook-page .top8 li{
    display:flex;justify-content:space-between;align-items:baseline;gap:12px;
    margin:0;padding:7px 0;border-bottom:1px solid var(--rule);font-size:.95rem;line-height:1.4;
  }
  .outlook-page .top8 li a{color:var(--link);text-decoration:none}
  .outlook-page .top8 li span{color:var(--ink-2);font-size:.875rem;text-align:right;white-space:nowrap}
}

/* ---------- round 9: the hazard cards, the chart scales, the map in the dark ---------- */

/* the three biggest running hazards: three across on a desktop, one under the
   other on a phone */
.home-page .hz-list{grid-column:1/-1;list-style:none;margin:0;padding:0;display:grid;gap:2px}
.home-page .hz-list li{min-width:0}
.home-page .hz-list a{display:flex;flex-wrap:wrap;align-items:baseline;gap:2px 10px;padding:7px 0;border-bottom:1px solid var(--rule);color:var(--ink);text-decoration:none}
.home-page .hz-list a:hover .hz-place{text-decoration:underline}
.home-page .hz-word{display:flex;align-items:center;gap:6px;font-size:.8125rem;color:var(--ink-3)}
.home-page .hz-place{font-size:1rem;font-weight:600;color:var(--ink)}
.home-page .hz-metric{font-size:.9375rem;color:var(--ink-2)}
.home-page .hz-upd{font-size:.8125rem;color:var(--ink-3);margin-left:auto}
.home-page .hz-more{grid-column:1/-1;margin:0;font-size:.95rem}
.home-page #feed-empty{grid-column:1/-1}
.home-page .section-break{grid-column:1/-1;width:100%;margin:0;border:0;border-top:1px solid var(--rule)}
@media (max-width:767px){
  .home-page .hz-cards{grid-template-columns:1fr}
}

/* the regional outlooks: a table that fits a phone without scrolling sideways */
.outlook-page .regtab{width:100%}
.outlook-page .regtab th[scope=row]{font-weight:500}
@media (max-width:640px){
  .outlook-page .regtab{table-layout:fixed}
  .outlook-page .regtab th[scope=row]{white-space:normal;overflow-wrap:anywhere;hyphens:auto}
  .outlook-page .regtab th,.outlook-page .regtab td{padding:9px 6px 9px 0}
}

/* the maps: a hairline on every country; the sea shows the page behind it in both themes */
.worldmap path{stroke:#C9D1D6;stroke-width:.5}
.hitlayer path{stroke:none}
@media (prefers-color-scheme:dark){
  :root:not([data-theme=light]) .worldmap path{stroke:#3A4757}
}
:root[data-theme=dark] .worldmap path{stroke:#3A4757}

/* the city card and the day tiles: no fill of their own, only the category colour on a 4px edge */
:root{--aq-surface:#fff}
@media (prefers-color-scheme:dark){:root:not([data-theme=light]){--aq-surface:transparent}}
:root[data-theme=dark]{--aq-surface:transparent}
.calm-page .bignum.today{background:var(--aq-surface)}
.calm-page .bignum .num.aq{background:var(--aq-surface);color:var(--ink);border-left:4px solid var(--aqedge)}
.calm-page .days li{background:var(--aq-surface);color:var(--ink);border-left:4px solid var(--aqedge,var(--rule-2))}

/* the scale beside the rain bars */
.clim-chart.rain .refline{position:absolute;left:var(--axis-gutter);right:0;top:calc(var(--plot-h) * var(--p) / 100);height:1px;background:var(--chart-grid,var(--rule-2))}
.clim-chart.rain .rain-axis{position:absolute;left:0;top:0;width:calc(var(--axis-gutter) - 8px);height:var(--plot-h)}
.clim-chart.rain .rain-axis span{position:absolute;left:0;right:0;top:calc(var(--plot-h) * var(--p) / 100);font-size:12px;line-height:1;color:var(--chart-muted,var(--ink-3));text-align:right}
/* the value of a bar, on hover or with the keyboard */
.clim-col .hov{position:absolute;left:50%;transform:translateX(-50%);margin-bottom:4px;font-size:.75rem;line-height:1;padding:2px 5px;border-radius:var(--rad);background:var(--paper);border:1px solid var(--rule);color:var(--ink);white-space:nowrap;opacity:0;pointer-events:none}
.clim-col:hover .hov,.clim-col:focus .hov{opacity:1}
.clim-col:hover .peak,.clim-col:focus .peak{opacity:0}
.clim-col:focus{outline:2px solid var(--focus,var(--link));outline-offset:1px}
/* the scale on the temperature line */
.clim-chart.temps .trefl{stroke:var(--chart-grid,var(--rule-2));stroke-width:.5}
.clim-chart.temps .treflab{font-size:11px;font-weight:400;fill:var(--chart-muted,var(--ink-3))}
.clim-chart.temps .thov{font-size:11px;font-weight:600;fill:var(--ink);paint-order:stroke;stroke:var(--paper);stroke-width:3px;stroke-linejoin:round;opacity:0;pointer-events:none}
.clim-chart.temps .tpoint:hover .thov,.clim-chart.temps .tpoint:focus .thov{opacity:1}
.clim-chart.temps .tpoint:focus{outline:2px solid var(--focus,var(--link));outline-offset:2px}
/* SVG text scales with the viewBox (360 units wide); at desktop widths 11 units rendered at about 28px. 4.9 units renders at about 12-13px. */
@media (min-width:900px){.clim-chart.temps .tlab,.clim-chart.temps .thov{font-size:4.9px}}

/* the warming stripes: the change, above the last stripe */
.stripes-wrap{position:relative;margin-top:26px}
.stripes-label{position:absolute;right:0;top:-22px;margin:0;font:600 .9375rem/1.2 var(--sans);color:var(--ink)}

/* the home page preview of the temperature outlook */
.preview-sec{margin:20px 0 4px}
.previewmap{max-width:740px;margin:0}
.previewmap .worldmap{display:block;width:100%;height:auto}
.preview-key{max-width:740px;margin:8px 0 0;flex-wrap:wrap;row-gap:6px}
.preview-key li{flex:0 0 auto;padding-right:20px}
.keyscale .tw2::before{background:var(--t-hi)}
.keyscale .td2::before{background:var(--t-lo)}
.preview-link{margin:10px 0 0;font-size:.95rem}
@media (max-width:640px){
  .home-page .page-head:first-child{padding-top:26px}
  .calm-page .page-head{padding-top:26px}
  .home-page .home-head h1{font-size:31px;line-height:1.12}
  .calm-page .page-head.calm h1{font-size:31px;line-height:1.12}
  .home-page .now,.home-page section.block{margin-top:24px}
  .calm-page section.block{margin-top:24px}
}

/* ---------- outlook: the map is on screen on a phone, with a layer toggle ---------- */
.outlook-page .mapfold > summary{display:none}
.outlook-page .mapfold > .now-map{display:block!important}
.outlook-page .mapfold::details-content{content-visibility:visible!important}
@media (max-width:767px){
  .outlook-page .mapfold > .now-map > .mapbox{height:340px;display:flex;flex-direction:column;justify-content:center}
  .outlook-page .keyscale{display:grid;grid-template-columns:repeat(3,1fr);gap:6px 10px;max-width:none;margin:0 0 10px}
}
.keyscale[hidden]{display:none!important}
.keyscale .tw1::before{background:color-mix(in srgb,var(--t-hi) 50%,var(--paper))}
.keyscale .tn0::before{background:var(--t-n)}
.keyscale .td1::before{background:color-mix(in srgb,var(--t-lo) 50%,var(--paper))}
.keyscale .tnd::before{background:var(--nd)}
/* the home preview map is a baked image, so its key hardcodes the colours inside it */
.preview-key .tw2::before{background:#c9482f}
.preview-key .tw1::before{background:#eab5a8}
.preview-key .tn0::before{background:#d9d6cf}
.preview-key .td1::before{background:#9dc0da}
.preview-key .td2::before{background:#3f7fb5}
.preview-key .tnd::before{background:#f1efea}
.mapbreak{margin:10px 0 0}
.layer-toggle{display:inline-flex;flex:none}
.layer-toggle .chipbtn{margin-right:0;min-height:44px;padding:0 14px;border-radius:0}
.layer-toggle .chipbtn+.chipbtn{border-left:0}
.layer-toggle .chipbtn:first-child{border-radius:var(--rad) 0 0 var(--rad)}
.layer-toggle .chipbtn:last-child{border-radius:0 var(--rad) var(--rad) 0}
.layer-toggle .chipbtn.on{box-shadow:inset 0 0 0 1px currentColor}
/* the temperature layer rides on the same paths, so one class swaps the fills */
.mapbox.mode-temp .td2{fill:var(--t-lo)}
.mapbox.mode-temp .td1{fill:color-mix(in srgb,var(--t-lo) 50%,var(--paper))}
.mapbox.mode-temp .tn0{fill:var(--t-n)}
.mapbox.mode-temp .tw1{fill:color-mix(in srgb,var(--t-hi) 50%,var(--paper))}
.mapbox.mode-temp .tw2{fill:var(--t-hi)}
.mapbox.mode-temp .tnd{fill:var(--nd)}

.usmap{margin:18px 0}
.usmap img{display:block;width:100%;height:auto}
.map-download{margin:6px 0 0;font-size:.95em}
