/* Spacing scale used by both sites for page padding, section gaps, rows, and footers.
   --pad-x is 28px on desktop and 18px under 800px (same values as before). The type
   scale zooms #main at 1100px and 1600px, including chart blocks, so charts
   enlarge with the text. In browsers with the older zoom model (html.zoom-legacy, set by nav.js) #main's used width is divided by the zoom so the
   column still fits. data-load.js corrects Chart.js pointer math so hover stays
   aligned under CSS zoom. Header and sidebar stay unzoomed. */
:root {
  --space-tight: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 22px;
  --space-6: 28px;
  --space-7: 36px;
  --space-8: 48px;
  --pad-x: var(--space-6);
  --text-scale: 1;
  --row-pad: 5px;
  --row-pad-mobile: 10px;
  --row-min-mobile: 44px;
  --cell-pad-y: var(--space-2);
  /* Hover borders are a step lighter than --line (#2a2b30). Focus-visible
     outlines use --focus so the ring meets WCAG 2.2's ~3:1 against #000
     (--line-hover on black does not). */
  --line-hover: #3a3c42;
  --focus: #8b8e95;
}

@media (max-width: 800px) {
  :root { --pad-x: 18px; }
}

/* Shared nav, menu button, and mobile drawer. Colors and link lists stay on each site. */
.site-nav {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-left: auto;
  padding-right: 10px;
  color: var(--muted);
  font: 11px var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.site-nav a + a::before { content: "\00b7"; color: #3a3b40; margin-right: 14px; }
.site-nav a {
  display: inline-block;
  padding: 17px 10px;
  margin: -17px -10px;
}
.site-nav a[aria-current="page"],
.site-nav a[aria-current="page"]:hover { color: var(--accent); }
.ext { font-size: 10px; letter-spacing: 0; text-transform: none; margin-left: 3px; color: #8b8e95; }
/* Temporary New tag. nav.js sets hidden once data-new-until is reached. */
.nav-new {
  display: inline-block;
  flex: 0 0 auto;
  margin-left: 6px;
  color: var(--accent);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  vertical-align: 0.15em;
}
.nav-new[hidden] { display: none !important; }
.menu-btn {
  display: none;
  position: relative;
  z-index: 60;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  margin-top: -14px;
  margin-bottom: -14px;
  margin-left: auto;
  padding: 14px 0 14px 22px;
  border: 0;
  background: none;
  color: var(--muted);
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
}
.menu-btn i { display: block; width: 22px; height: 1px; background: currentColor; transform-origin: center; }
.menu-btn:hover,
.menu-btn[aria-expanded="true"] { color: var(--accent); }
.menu-btn[aria-expanded="true"] i {
  position: absolute;
  left: 22px;
  top: 21.5px;
  width: 22px;
  height: 1px;
  margin: 0;
}
.menu-btn[aria-expanded="true"] i:nth-child(1) { transform: rotate(45deg); }
.menu-btn[aria-expanded="true"] i:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] i:nth-child(3) { transform: rotate(-45deg); }
.scrim { position: fixed; inset: 0; background: transparent; pointer-events: none; z-index: 40; }
.drawer {
  position: fixed;
  top: var(--nav-drawer-top, 56px);
  right: max(var(--pad-x), calc((100vw - var(--wrap)) / 2 + var(--pad-x)));
  width: 200px;
  padding: 0 16px 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  z-index: 50;
  display: flex;
  flex-direction: column;
}
.drawer[hidden],
.scrim[hidden] { display: none !important; }
body.nav-open .scrim { pointer-events: auto; }
.drawer a {
  display: flex;
  align-items: center;
  min-height: 44px;
  margin: -7px 0;
  padding: 15px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font: 11px/1.3 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.drawer a:first-child,
.drawer a:first-of-type { border-top: 0; margin-top: 0; }
.drawer a:hover { color: #fff; }
.drawer a[aria-current="page"],
.drawer a[aria-current="page"]:hover { color: var(--accent); cursor: default; }
html.nav-compact .site-nav { display: none; }
html.nav-compact .menu-btn { display: inline-flex; }
html.nav-compact .top { justify-content: space-between; align-items: center; }
html.nav-compact .top-right { margin-left: auto; }
@media (max-width: 800px) {
  .site-nav { display: none; }
  .menu-btn { display: inline-flex; }
  .top { justify-content: space-between; align-items: center; }
  .top-right { margin-left: auto; }
}

/* Grouped nav. Group labels show only in the sidebar and the drawer. */
.site-nav .nav-group { display: none; }
/* Group lists are for screen readers ("Stock, list, 3 items"); layout sees the links. */
.nav-list, .nav-list > li { display: contents; }
.nav-list { list-style: none; margin: 0; padding: 0; }
.site-nav a::before { content: none; }
.site-nav li + li > a::before,
.site-nav .nav-list ~ .nav-list > li:first-child > a::before { content: "\00b7"; color: #3a3b40; margin-right: 14px; }
.drawer .nav-group {
  display: block;
  padding: 16px 0 2px;
  color: var(--muted);
  font: 500 10px/1.3 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.drawer .nav-group + a { border-top: 0; }

/* Header search. The drawer copy is a plain form to the archive. */
.site-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 1 240px;
  min-width: 150px;
  height: 34px;
  margin: -8px 0 -8px 18px;
  padding: 0 10px;
  border: 1px solid var(--line);
  box-sizing: border-box;
  color: var(--muted);
  font: 12px var(--mono);
  text-transform: none;
  letter-spacing: 0;
}
.site-search:focus-within { border-color: var(--line); color: var(--text); }
.site-search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: none;
  background: none;
  color: var(--text);
  font: inherit;
  -webkit-appearance: none;
  appearance: none;
}
.site-search input::placeholder { color: var(--muted); opacity: 1; }
.site-search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search-icon { flex: 0 0 auto; }
.search-key {
  flex: 0 0 auto;
  padding: 0 5px;
  border: 1px solid var(--line);
  color: var(--muted);
  font: 10px/16px var(--mono);
}
.site-search:focus-within .search-key { display: none; }
.drawer .site-search { flex: 0 0 auto; width: 100%; min-width: 0; height: 40px; margin: 12px 0 2px; }
/* Folded links (tablet widths): the search box stays in the header,
   right-aligned just left of the menu button. */
html.nav-compact .top .site-search { flex: 0 1 340px; margin-left: auto; margin-right: 0; }
@media (min-width: 801px) {
  /* A second margin-left: auto on .top-right would split the free space
     and leave the box floating in the middle. Space has no header search,
     so this does not apply there and .top-right keeps its auto margin.
     The header's 18px flex gap would be larger than the 12px menu gap,
     so shrink it only on this bar (the auto margin already fills the
     space after the logo). */
  html.nav-compact .top:has(.site-search) { gap: 12px; }
  html.nav-compact .top:has(.site-search) .top-right { margin-left: 0; }
}

/* Phones: a search button opens a full-screen search sheet. */
.search-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: -10px 0 -10px 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  cursor: pointer;
}
.search-close { display: none; }
@media (max-width: 800px) {
  .top .site-search { display: none; }
  .search-btn { display: inline-flex; }
  html.search-open, html.search-open body { overflow: hidden; }
  html.search-open .top .site-search {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 90;
    height: 56px;
    margin: 0;
    padding: 0 6px 0 16px;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: var(--bg);
    font-size: 16px;
  }
  html.search-open .top .site-search input { font: 16px var(--font); }
  html.search-open .search-key { display: none; }
  html.search-open .search-close {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 10px;
    border: 0;
    background: none;
    color: var(--muted);
    font: 12px var(--mono);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
  }
}

.lrow:target { background: #15161a; }

/* Sidebar layout on wide screens: fixed header, grouped menu on the left. */
@media (min-width: 1100px) {
  body:has(.top .site-nav[data-side]) { padding-top: 56px; padding-left: 220px; }
  html body .top:has(.site-nav[data-side]) {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 18px;
    height: 56px;
    margin: 0;
    /* 64px right: with the search box's 4px margin, the box ends 68px from
       the window edge, on the content's right edge (40px gutter + --pad-x). */
    padding: 0 64px 0 24px;
    box-sizing: border-box;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
  }
  html body .top:has(.site-nav[data-side]) .site-nav {
    position: fixed;
    top: 56px;
    left: 0;
    bottom: 0;
    z-index: 30;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 220px;
    margin: 0;
    padding: 10px 0 24px;
    box-sizing: border-box;
    overflow-y: auto;
    background: var(--bg);
    border-right: 1px solid var(--line);
    font: 14px var(--font);
    letter-spacing: 0;
    text-transform: none;
    white-space: normal;
  }
  html body .top:has(.site-nav[data-side]) .site-nav .nav-group {
    display: block;
    padding: 18px 24px 6px;
    color: var(--muted);
    font: 500 11px var(--mono);
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }
  html body .top:has(.site-nav[data-side]) .site-nav .nav-group:first-child { padding-top: 8px; }
  html body .top:has(.site-nav[data-side]) .site-nav a {
    display: flex;
    align-items: center;
    min-height: 36px;
    margin: 0;
    padding: 0 24px;
  }
  html body .top:has(.site-nav[data-side]) .site-nav a:not(:has(.ext)) { color: #b9bbc1; }
  html body .top:has(.site-nav[data-side]) .site-nav a::before { content: none; }
  html body .top:has(.site-nav[data-side]) .site-nav a:hover { background: #0e0f11; }
  html body .top:has(.site-nav[data-side]) .site-nav a:not(:has(.ext)):hover { color: #fff; }
  html body .top:has(.site-nav[data-side]) .site-nav a[aria-current="page"],
  html body .top:has(.site-nav[data-side]) .site-nav a[aria-current="page"]:hover {
    color: var(--accent);
    background: #111214;
    box-shadow: inset 2px 0 0 var(--accent);
  }
  html body .top:has(.site-nav[data-side]) .site-nav .ext { margin-left: 6px; }
  /* Divider above the external links. 52px = 1px rule + 15px pad + the same 36px row as the other links, so the three are evenly spaced. */
  html body .top:has(.site-nav[data-side]) .site-nav .nav-other > li:first-child > a { margin-top: 16px; padding-top: 15px; border-top: 1px solid var(--line); min-height: 52px; }
  /* Brand fills the sidebar's column. */
  html body .top:has(.site-nav[data-side]) { gap: 0; }
  html body .top:has(.site-nav[data-side]) .brand { flex: 0 0 196px; min-width: 0; }
  /* Content is centred in the space right of the sidebar, at least 40px
     from it and at least 40px from the window's right edge, so the gap
     sidebar-to-text and text-to-edge match (68px with --pad-x). The search
     box sits on the right and ends on the content's right edge (header
     padding-right 64px + this 4px margin = 68px). The same holds once the
     1541px+ divider line shows (see below). */
  html body .top:has(.site-nav[data-side]) .site-search {
    flex: 0 1 480px;
    margin: 0 calc(var(--pad-x, 28px) - 24px) 0 auto;
    font-size: 13px;
  }
  body:has(.top .site-nav[data-side]) .wrap { max-width: 1240px; margin-left: max(40px, calc((100% - 1240px) / 2)); margin-right: max(40px, calc((100% - 1240px) / 2)); }
  html body .top:has(.site-nav[data-side]) .menu-btn,
  html body .top:has(.site-nav[data-side]) .top-right:empty { display: none; }
  body:has(.top .site-nav[data-side]) [id] { scroll-margin-top: var(--sticky-offset, 72px); }
}

/* Drawer with groups: no row rules, tighter rows under each label. */
.drawer:has(.nav-group) { width: 240px; max-height: calc(100vh - var(--nav-drawer-top, 56px) - 16px); overflow-y: auto; box-sizing: border-box; }
.drawer:has(.nav-group) a {
  min-height: 44px;
  margin: 0;
  padding: 0;
  border-top: 0;
  font: 16px/1.3 var(--font);
  letter-spacing: 0;
  text-transform: none;
}
.drawer:has(.nav-group) a:not(:has(.ext)):not([aria-current]) { color: #d4d6da; }
.drawer:has(.nav-group) a[aria-current="page"] { color: var(--accent); }
body.nav-open .scrim { background: rgba(0, 0, 0, 0.66); }
.drawer:has(.nav-group) .nav-group { padding: 14px 0 4px; }

/* Desktop type scale. Page styles are set in px for phones; on wide screens
   the content column scales up a step (headlines ~15px, meta ~12px), and a
   second step on large monitors. The header and sidebar keep their size.
   #main is zoomed (including chart blocks) so charts scale with the text.
   Current browsers (standard CSS zoom) already fit a zoomed block to its
   container; dividing its width by the zoom there left a wide empty strip on
   the right (~70px at 1280, ~160px at 1600+). Only browsers with the older
   zoom model, which nav.js marks html.zoom-legacy, get the divided width.
   data-load.js corrects Chart.js hover under CSS zoom. */
@media (min-width: 1100px) {
  body:has(.top .site-nav) { --text-scale: 1.08; }
  body:has(.top .site-nav) #main { zoom: var(--text-scale); }
  html.zoom-legacy body:has(.top .site-nav) #main { max-width: calc(100% / var(--text-scale)); }
}
@media (min-width: 1600px) {
  body:has(.top .site-nav) { --text-scale: 1.16; }
  body:has(.top .site-nav) #main { zoom: var(--text-scale); }
  html.zoom-legacy body:has(.top .site-nav) #main { max-width: calc(100% / var(--text-scale)); }
}

/* Page head: one opening for every list page.
   <header class="page-head"><h2 class="page-title">…</h2><p class="page-stamp" data-stamp="/data/x.json|key"></p><p class="page-lede">…</p></header> */
.page-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 6px 18px;
  padding: 18px 0 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}
.page-head .page-title {
  margin: 0;
  color: var(--accent);
  font: 500 12px var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.page-head .page-stamp { margin: 0; color: var(--muted); font: 11px var(--mono); white-space: nowrap; }
.page-head .page-stamp:empty { display: none; }
.page-head .page-lede { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.45; }

/* Filter bar: search, then selects, then the result count on the right. */
.filters { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; padding: var(--space-3) 0 var(--space-2); }
.filters input[type="search"],
.filters select {
  height: 34px;
  box-sizing: border-box;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--bg);
  color: var(--text);
  font: 12px var(--mono);
}
.filters input[type="search"] { flex: 1 1 240px; min-width: 0; }
/* In-page boxes filter the list in place; a funnel and "Filter …" keep
   them apart from the site-wide search in the header. */
.filters .filter-box {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 240px;
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  box-sizing: border-box;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--muted);
}
.filters .filter-box:focus-within { border-color: var(--accent); }
.filters .filter-box input[type="search"] { flex: 1 1 auto; height: 100%; padding: 0; border: 0; outline: none; background: none; }
.filters .filter-box input:focus { outline: none; }
.filter-icon { flex: 0 0 auto; }
.filters input[type="search"]::placeholder { color: var(--muted); opacity: 1; }
.filters input:focus, .filters select:focus { outline: 1px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
.filters .count { margin-left: auto; color: var(--muted); font: 11px var(--mono); white-space: nowrap; }
@media (max-width: 800px) {
  .filters input[type="search"], .filters .filter-box { flex: 1 1 100%; }
  .filters select { flex: 1 1 0; min-width: 0; }
  .filters .count { flex: 1 1 100%; margin-left: 0; }
}

/* Year links above long lists. */
.year-jump { display: flex; flex-wrap: wrap; gap: var(--space-tight) var(--space-4); padding: var(--space-3) 0 var(--space-3); border-bottom: 1px solid var(--line); font: 12px var(--mono); }
.year-jump:empty { display: none; }
.year-jump a { color: var(--muted); }
.year-jump a:hover { color: #fff; }

/* Long lists: the filter bar and year links stay under the header. */
@media (min-width: 801px) {
  .list-tools { position: sticky; top: 0; z-index: 20; background: var(--bg); }
}
@media (min-width: 1100px) {
  /* The content zoom (1.08 / 1.16 below) also scales "top", so divide it back
     out. A 10px page-colour edge under the fixed header covers any rounding
     gap at other browser zooms; it only ever lies over the page's top padding. */
  body:has(.top .site-nav[data-side]) .list-tools { top: calc(56px / 1.08); }
  html body .top:has(.site-nav[data-side]) { box-shadow: 0 10px 0 0 var(--bg); }
}
@media (min-width: 1600px) {
  body:has(.top .site-nav[data-side]) .list-tools { top: calc(56px / 1.16); }
}
[id] { scroll-margin-top: var(--sticky-offset, 16px); }

/* Back to top, shown after two screens of scrolling. */
.to-top {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 35;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--muted);
  font: 11px var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.to-top:hover { color: #fff; border-color: var(--line-hover); }
.to-top[hidden] { display: none; }
/* #main is a focus target (tabindex=-1) for the skip link and Top; keep the ring for keyboard focus only. */
#main:focus:not(:focus-visible) { outline: none; }

/* Large monitors: menu and header a step larger, like the content. */
@media (min-width: 1600px) {
  html body .top:has(.site-nav[data-side]) .site-nav { font-size: 15px; }
  html body .top:has(.site-nav[data-side]) .site-nav .nav-group { font-size: 12px; }
  html body .top:has(.site-nav[data-side]) .site-nav a { min-height: 38px; }
  html body .top:has(.site-nav[data-side]) .site-search { font-size: 14px; height: 38px; }
}

/* Very wide screens: menu and content centred together as one 1500px
   block (logo, search, sidebar and content line up), like X. */
@media (min-width: 1500px) {
  /* max(0px, ...): the media query reads the viewport, but 100% is the box
     inside a reserved scrollbar gutter, which can be under 1500px; a
     negative offset pushed the sidebar off the left edge. */
  body:has(.top .site-nav[data-side]) { padding-left: calc(max(0px, (100% - 1500px) / 2) + 220px); }
  html body .top:has(.site-nav[data-side]) {
    padding-left: calc(max(0px, (100% - 1500px) / 2) + 24px);
    padding-right: 64px; /* no divider yet: search ends on the content's right edge */
  }
  html body .top:has(.site-nav[data-side]) .site-nav {
    left: max(0px, (100% - 1500px) / 2);
    border-left: 1px solid var(--line);
  }
  body:has(.top .site-nav[data-side]) .wrap { margin-left: 40px; }
}

/* Right divider, and recentre the frame once it is on so the outer
   margin left of the sidebar equals the outer margin right of the
   line. The 1500px sidebar+content block plus the 40px right gutter
   and 1px line is 1541px. --wide-frame-shift is written out in each
   rule (a custom property would resolve 100% against the wrong box)
   and is 0 until the content box is at least 1541px: media queries
   use the viewport, but 100% is the content box, which may be
   narrower by a reserved scrollbar-gutter. At or below 1500px, and
   while the frame does not fit, the original 1500px centering is
   unchanged (offsets never go below 0). The line still starts at top: 56px and sits 40px past
   .wrap, so both content-to-divider gaps stay 68px. While the line shows,
   the search box still ends on the content's right edge (68px inside the
   right line); the logo sits 24px inside the left one. */
@media (min-width: 1501px) {
  body:has(.top .site-nav[data-side]) {
    padding-left: calc(max(0px, (100% - 1500px) / 2) + 220px - clamp(0px, calc((100% - 1541px) * 10000), calc((1541px - 1500px) / 2)));
  }
  html body .top:has(.site-nav[data-side]) {
    padding-left: calc(max(0px, (100% - 1500px) / 2) + 24px - clamp(0px, calc((100% - 1541px) * 10000), calc((1541px - 1500px) / 2)));
    /* Search box ends on the content's right edge at every width. Divider
       off (content box under 1541px): 64px (+ the box's 4px margin = 68px,
       the 40px gutter + --pad-x). Divider on: 44px further in than 24px
       inside the line, i.e. 68px inside it, where the content ends. The
       clamp is 0 until the line shows. */
    padding-right: calc(64px + clamp(0px, calc((100% - 1541px) * 10000), calc((max(0px, (100% - 1500px) / 2) + 24px + clamp(0px, calc((100% - 1541px) * 10000), calc((1541px - 1500px) / 2)) - clamp(0px, calc((100% - 1541px) * 10000), 44px)) + 44px - 64px)));
  }
  html body .top:has(.site-nav[data-side]) .site-nav {
    left: calc(max(0px, (100% - 1500px) / 2) - clamp(0px, calc((100% - 1541px) * 10000), calc((1541px - 1500px) / 2)));
  }
  body:has(.top .site-nav[data-side])::after {
    content: "";
    position: fixed;
    top: 56px; /* same top as the sidebar's border-right, below the header */
    bottom: 0;
    left: calc((100% - 1500px) / 2 + 1500px + 40px - clamp(0px, calc((100% - 1541px) * 10000), calc((1541px - 1500px) / 2)));
    width: clamp(0px, calc(100% - 1541px), 1px);
    background: var(--line);
    pointer-events: none;
    z-index: 30;
  }
}

/* The other site's link sits under a rule at the end of the drawer. */
.drawer .nav-other > li:first-child > a { margin-top: 12px; padding-top: 8px; border-top: 1px solid var(--line); }

/* Hover: slightly lighter grey borders. Keyboard focus: a passing outline. */
a:hover, button:hover, .row:hover, [role="button"]:hover {
  border-color: var(--line-hover);
}
a:focus-visible,
button:focus-visible,
.row:focus-visible,
[role="button"]:focus-visible,
.site-nav a:focus-visible,
.drawer a:focus-visible,
.menu-btn:focus-visible,
.search-btn:focus-visible,
.search-close:focus-visible,
.year-jump a:focus-visible,
.to-top:focus-visible,
#main:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* Mobile sticky header under 768px only. Desktop is unchanged. */
@media (max-width: 767px) {
  body {
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
  }
  .top {
    position: sticky;
    top: 0;
    z-index: 55;
    box-sizing: border-box;
    background: var(--bg);
    margin-left: calc(-1 * var(--pad-x));
    margin-right: calc(-1 * var(--pad-x));
    padding-top: env(safe-area-inset-top, 0px);
    padding-left: var(--pad-x);
    padding-right: var(--pad-x);
  }
  html.nav-open .top,
  html.search-open .top {
    /* overflow:hidden on html/body makes sticky un-stick; pin the bar while the menu or search is open. */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: auto;
    margin-left: 0;
    margin-right: 0;
    padding-left: max(var(--pad-x), env(safe-area-inset-left, 0px));
    padding-right: max(var(--pad-x), env(safe-area-inset-right, 0px));
  }
  html.nav-open,
  html.nav-open body { overflow: hidden; }
  .drawer { top: calc(var(--nav-drawer-top, 56px) + env(safe-area-inset-top, 0px)); }
  .drawer:has(.nav-group) {
    max-height: calc(100vh - var(--nav-drawer-top, 56px) - env(safe-area-inset-top, 0px) - 16px);
  }
  h2, h3, [id] {
    scroll-margin-top: calc(var(--nav-drawer-top, 56px) + env(safe-area-inset-top, 0px) + 8px);
  }
}
