/*
 * The site strip: one bar, the same on every page, and the menu behind it.
 *
 * ── One file, two deliveries ────────────────────────────────────────────────
 *
 * This is the only copy. The planner bundles it (`main.tsx` imports it, so it
 * works under `npm run dev` as well as in the build), and `docker/Dockerfile`
 * copies this same path to /var/www/spickme/sitenav.css, which the static pages
 * link. It lives here rather than beside those pages because the planner's build
 * context is `web/plan` alone and could not reach it there — whereas the image
 * build sees the whole repository and can reach it here. Two copies would drift,
 * and "identical on every page" is the entire point.
 *
 * ── What it is, since 2026-10-23 ─────────────────────────────────────────────
 *
 * The strip used to be a locator: 40px, muted ink, three shortcuts and a
 * burger that dropped a narrow list of nineteen rows. It receded, which was
 * the design — and a site with a timetable, a day out, two map tools, two
 * games, a departure board, a page per station and eight apps had its whole
 * map behind one grey glyph. The owner asked for a navigation that is easy
 * despite all of that, and works from a 4K screen down to a phone.
 *
 * So the strip is a bar now, 56px on a desk, in full ink: the wordmark, the
 * path, then the five places people actually go — the timetable, the
 * downloads, the stations, ideas, about — then language, theme, and a button
 * that says «Menu». The menu is the same four groups as the phone app's
 * (docs/app-menu.md), and it is drawn two ways from one markup:
 *
 *   - from 880px up, a panel across the whole width of the strip, the four
 *     groups side by side as columns, Settings above them and About below;
 *   - under 880px, a sheet that rises from the bottom of the screen, the
 *     groups as a two-column grid of thumb-sized cells, Settings first.
 *
 * One markup because `web/plan/tests/sitenav.test.mjs` holds the panel to be
 * byte-identical on sixteen pages and the same list in the planner: the
 * columns are CSS multi-column with a forced break before each group's
 * heading, and the sheet is a grid whose headings span both columns. Nothing
 * is nested, so the list that a screen reader hears is the same list at every
 * size, and a page that forbids script (the legal pages, the connection
 * viewer) gets exactly the same menu, because it is all a <details>.
 *
 * The path is still drawn as a miniature line diagram — an origin node, a
 * hairline, a terminus — because that is the app's own language.
 *
 * ── Why there is no JavaScript ───────────────────────────────────────────────
 *
 * The legal pages and the connection viewer are served under a CSP whose
 * `script-src` admits nothing beyond the shared /theme.js snippet (and the
 * viewer's own modules) — they deliberately run no page script. A strip that
 * needed script would silently lose its menu exactly there, so the disclosure
 * is a plain <details>. Even the dimmed page behind an open menu, and the
 * fact that a press on it closes the menu, are CSS: the open summary grows a
 * fixed pseudo-element over the whole screen, and a press on a pseudo-element
 * is a press on its element, which toggles the <details> shut. Pages that do
 * run script also shut a menu on Escape and on a press anywhere (lang.js,
 * lib/menus-shut.ts); the pseudo-element is what the rest get.
 *
 * ── Tokens ───────────────────────────────────────────────────────────────────
 *
 * Only the tokens every page defines are used — --paper, --paper-low,
 * --paper-high, --ink, --muted, --outline, --coral, --coral-ink — each with a
 * fallback, so a page that has not declared one still renders. Theme
 * switching is left entirely to the host page.
 */

.sitenav {
  position: sticky;
  top: 0;
  z-index: 60;
  /* The bar's height, in one place: the inner row is this tall, and the
     dimmed page behind an open menu starts under it. */
  --sitenav-h: 50px;
  /* Nearly opaque. It used to be translucent with a backdrop blur, and the
     blur is gone for a reason that is not taste: `backdrop-filter` makes an
     element the containing block of everything `position: fixed` inside it,
     so the menu sheet that should rise from the bottom of a phone's screen
     rose from the bottom of the 50px strip instead, clipped to its last
     row (2026-10-23). The sheet matters more than the blur. */
  background: color-mix(in srgb, var(--paper, #f1efea) 94%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--outline, #c8c3b8) 70%, transparent);
  color: var(--ink, #111418);
}

/* Aligns the strip's contents with the page body below it: same measure, same
   gutter, so the origin node sits directly over the content's left edge. */
.sitenav-inner {
  /* Each page declares the column it reads in. The default is the widest
     page's measure; the planner sets its own. */
  width: min(var(--sitenav-measure, 1320px), 100%);
  margin: 0 auto;
  /* The planner asks for `viewport-fit=cover` so its bottom sheets can clear
     the home indicator, which also lets this bar run under the notch. Turned
     sideways an iPhone reserves ~47px on the leading edge and the ordinary
     padding is 34px, so the wordmark ended up behind the camera housing. */
  padding-left: max(clamp(16px, 4vw, 48px), env(safe-area-inset-left, 0px));
  padding-right: max(clamp(16px, 4vw, 48px), env(safe-area-inset-right, 0px));
  height: var(--sitenav-h);
  display: flex;
  align-items: center;
  gap: 6px;
}

.sitenav a {
  color: inherit;
  text-decoration: none;
}

/* The planner reads in a much narrower column, and pads its strip tighter to
   match — but only where the strip is narrow anyway. From laptop width up,
   where the quick links appear, the planner's strip takes the same wide
   measure as the front page and lays out like it. */
@media (max-width: 879px) {
  .sitenav--narrow {
    --sitenav-measure: 680px;
  }

  .sitenav--narrow .sitenav-inner {
    padding: 0 clamp(14px, 4vw, 28px);
  }
}

/* ── Origin: the mark, and the way home ──────────────────────────────────────
 *
 * Deliberately the first thing in the tab order and the leftmost thing on
 * screen. Every page that includes this strip is one click from the front page.
 */
.sitenav-home {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex: none;
  padding: 6px 4px 6px 2px;
  border-radius: 8px;
}

/* The origin node of the thread. Solid, coral, and slightly larger than the
   nodes after it — a line has one start. */
.sitenav-dot {
  position: relative;
  width: 11px;
  height: 11px;
  flex: none;
  border-radius: 999px;
  background: var(--coral, #f26a4b);
}

.sitenav-home:hover .sitenav-dot::after,
.sitenav-home:focus-visible .sitenav-dot::after {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: inherit;
  background: color-mix(in srgb, var(--coral, #f26a4b) 22%, transparent);
}

/* The little count beside the wordmark: how many more quick clicks would open
   what lives behind the logo (see src/lib/knock.mjs). Deliberately small,
   deliberately grey, and the same grey at three as at one — a badge that
   brightened as it filled would be an invitation, and nothing on this strip
   invites anybody to that. Created by script; absent on a page that has never
   been knocked on. */
.sitenav-knock {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex: none;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted, #6b6b6b) 22%, transparent);
  color: var(--muted, #6b6b6b);
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1;
  opacity: 0;
  transform: scale(0.55);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

.sitenav-knock[data-on] {
  opacity: 1;
  transform: none;
}

.sitenav-wordmark {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

/* ── The path ────────────────────────────────────────────────────────────────
 *
 * One <li> per level. Each draws its own connector and node, so the markup
 * stays a plain ordered list and the diagram is entirely presentational.
 */
.sitenav-path {
  display: flex;
  align-items: center;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted, #6b6b6b);
  font-size: 0.84rem;
  font-weight: 600;
}

.sitenav-path li {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  /* Room for the connector and the node that precede the label. */
  padding-left: 26px;
  white-space: nowrap;
  /* When the strip is short of room the path is what gives way — and it gives
     way by clipping, never by painting its label under the tools beside it. */
  overflow: hidden;
  text-overflow: ellipsis;
}

.sitenav-path li a {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* The connector: a hairline running back toward the previous stop. */
.sitenav-path li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 50%;
  width: 12px;
  height: 1.5px;
  background: color-mix(in srgb, var(--outline, #c8c3b8) 95%, transparent);
}

/* The node: hollow for a stop you can travel back to, solid coral for the one
   you are standing at. */
.sitenav-path li::after {
  content: '';
  position: absolute;
  left: 15px;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-top: -4px;
  box-sizing: border-box;
  border: 1.5px solid color-mix(in srgb, var(--muted, #6b6b6b) 70%, transparent);
  border-radius: 999px;
  background: var(--paper, #f1efea);
}

.sitenav-path li[aria-current='page'] {
  color: var(--ink, #111418);
  font-weight: 700;
}

.sitenav-path li[aria-current='page']::after {
  border-color: var(--coral, #f26a4b);
  background: var(--coral, #f26a4b);
}

.sitenav-path a:hover,
.sitenav-path a:focus-visible {
  color: var(--ink, #111418);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.sitenav-spacer {
  flex: 1 1 auto;
  min-width: 8px;
}

/* ── Page-specific controls ──────────────────────────────────────────────────
 *
 * The language and the theme, in the same place on every page that has them.
 * The planner folds both into its Settings on a phone (base.css).
 */
.sitenav-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}

/* ── Quick links ─────────────────────────────────────────────────────────────
 *
 * The five places people go, visible from a laptop up; the menu beside them
 * holds everything, so nothing is reachable only at one size. The page you
 * are on carries a coral bar under its word, the strip's one use of the
 * accent as a mark.
 */
.sitenav-links {
  display: none;
  align-items: center;
  gap: 2px;
  flex: none;
  margin-left: 6px;
  font-size: 0.9rem;
  font-weight: 600;
}

.sitenav-links a {
  position: relative;
  padding: 8px 11px;
  border-radius: 8px;
  color: var(--ink-soft, var(--ink, #111418));
  white-space: nowrap;
}

.sitenav-links a:hover,
.sitenav-links a:focus-visible {
  color: var(--ink, #111418);
  background: color-mix(in srgb, var(--outline, #c8c3b8) 32%, transparent);
}

.sitenav-links a[aria-current='page'] {
  color: var(--ink, #111418);
  font-weight: 700;
}

.sitenav-links a[aria-current='page']::after {
  content: '';
  position: absolute;
  left: 11px;
  right: 11px;
  bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: var(--coral, #f26a4b);
}

/* ── The menu button ─────────────────────────────────────────────────────────*/

.sitenav-more {
  position: relative;
  flex: none;
}

.sitenav-more > summary {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 38px;
  min-width: 38px;
  padding: 0 10px;
  border: 1.5px solid color-mix(in srgb, var(--outline, #c8c3b8) 90%, transparent);
  border-radius: 999px;
  color: var(--ink, #111418);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  white-space: nowrap;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

/* Safari draws its own triangle unless both of these are said. */
.sitenav-more > summary::-webkit-details-marker {
  display: none;
}

.sitenav-more > summary:hover,
.sitenav-more > summary:focus-visible,
.sitenav-more[open] > summary {
  border-color: color-mix(in srgb, var(--ink, #111418) 45%, transparent);
  background: color-mix(in srgb, var(--outline, #c8c3b8) 28%, transparent);
}

/* Three rules stacked — a timetable, at 16px. Drawn in CSS rather than fetched
   as an icon, because half of these pages forbid img-src from anywhere but
   this origin and none of them should pay a request for a hamburger. */
.sitenav-burger {
  position: relative;
  display: block;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.18s ease;
}

.sitenav-burger::before,
.sitenav-burger::after {
  content: '';
  position: absolute;
  left: 0;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.18s ease, top 0.18s ease;
}

.sitenav-burger::before {
  top: -5px;
}

.sitenav-burger::after {
  top: 5px;
}

/* Open, the three rules fold to a cross: the button now closes. */
.sitenav-more[open] .sitenav-burger {
  background: transparent;
}

.sitenav-more[open] .sitenav-burger::before {
  top: 0;
  transform: rotate(45deg);
}

.sitenav-more[open] .sitenav-burger::after {
  top: 0;
  transform: rotate(-45deg);
}

/* The word beside the rules, from a laptop up. A phone keeps the glyph alone;
   it is the one control on the right of its bar and needs no caption. */
.sitenav-menu-word {
  display: none;
}

/* ── The dimmed page behind an open menu ────────────────────────────────────
 *
 * Every open menu in the strip — the pages, the language — dims the page and
 * closes on a press anywhere on it. The dimming is a fixed pseudo-element of
 * the open summary, under the panel and over the page; the press reaches the
 * summary, which is how a <details> is told to shut. No script, so it holds
 * on the pages that run none. The summary keeps `z-index: 1` so the dimming
 * sits in its own stacking context and never covers the panel beside it. */
.sitenav details[open] > summary::before {
  content: '';
  position: fixed;
  inset: var(--sitenav-h) 0 0 0;
  z-index: -1;
  background: rgb(17 20 24 / 0.32);
  animation: sitenav-dim 0.18s ease both;
}

@keyframes sitenav-dim {
  from {
    opacity: 0;
  }
}

/* ── The panel: four groups, Settings above, About below ──────────────────── */

.sitenav-panel {
  position: absolute;
  z-index: 10;
  color: var(--ink, #111418);
  font-size: 0.92rem;
  font-weight: 600;
  background: var(--paper-low, var(--paper, #f1efea));
  /* Never taller than the screen under the strip, at any size: twenty rows
     on a phone held sideways is more than the whole screen, and a panel that
     cannot scroll runs off the bottom with nothing to reach it. */
  max-height: calc(100vh - var(--sitenav-h));
  max-height: calc(100dvh - var(--sitenav-h));
  overflow-y: auto;
  overscroll-behavior: contain;
}

.sitenav-panel a {
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 10px;
}

/* «On the way» is in every menu and shown only while a journey is followed
   (docs/app-menu.md); `display: flex` above would otherwise draw it anyway. */
.sitenav-panel a[hidden] {
  display: none;
}

/* While it is shown it is the thing the rider is in the middle of, so it
   wears the coral the journey's tab wears rather than Travel's blue. */
.sitenav-panel .sitenav-panel-now {
  color: var(--coral-ink, #b8431e);
}

.sitenav-panel-label[data-nav-group='navGroupTravel'] ~ a.sitenav-panel-now .sitenav-icon {
  background: var(--coral-ink, #b8431e);
  color: var(--coral-on, #fff);
}

/* ── The pictures: the phone's, on a ground in the group's colour ──────────
 *
 * Every entry opens with the icon the phone's ⋮ menu draws for it
 * (lib/menu-icons.mjs), on a round ground the colour of its group: Travel the
 * rail blue, Play the coral, the apps the bus green, Join in the coral's ink
 * on paper, Settings and About grey. The same grounds as the phone's tiles, so
 * the two menus are one picture as well as one list (docs/app-menu.md). The
 * groups are told apart by colour before a heading is read.
 *
 * The group is found from the heading before the entry: each `~` rule below
 * reaches every entry after its heading, and the next group's, being later,
 * wins from there on.
 */
.sitenav-icon {
  flex: none;
  box-sizing: border-box;
  width: 30px;
  height: 30px;
  padding: 6px;
  border-radius: 50%;
  background: var(--paper-high, #e7e1d2);
  color: var(--ink, #111418);
}

.sitenav-panel-label[data-nav-group='navGroupTravel'] ~ a .sitenav-icon {
  background: var(--blue-soft, #d9e2f4);
  color: var(--blue-on, #0a1f44);
}

.sitenav-panel-label[data-nav-group='navGroupPlay'] ~ a .sitenav-icon {
  background: var(--coral-soft, #fcddd3);
  color: var(--coral-ink, #b8431e);
}

.sitenav-panel-label[data-nav-group='navGroupApp'] ~ a .sitenav-icon {
  background: var(--green-soft, #cfe6d9);
  color: var(--green-ink, #217549);
}

.sitenav-panel-label[data-nav-group='navGroupJoin'] ~ a .sitenav-icon {
  background: var(--paper-high, #e7e1d2);
  color: var(--coral-ink, #b8431e);
}

.sitenav-panel > a:last-child .sitenav-icon {
  background: var(--paper-high, #e7e1d2);
  color: var(--ink, #111418);
}

.sitenav-panel a:hover,
.sitenav-panel a:focus-visible {
  background: color-mix(in srgb, var(--outline, #c8c3b8) 34%, transparent);
}

/* The page you are already on, listed but not offered. */
.sitenav-panel a[aria-current='page'] {
  /* The accent as words, which needs to be darker than the accent as a shape;
     pages that have not declared the distinction fall back to the mark. */
  color: var(--coral-ink, var(--coral, #f26a4b));
}

/* The one row in this panel that is a button rather than a link: Settings,
   with the gear in front of it. On every other page it is a link to the
   planner's Settings, two classes deep so that it wins over `.sitenav-panel a`
   above. */
.sitenav-panel .sitenav-panel-action {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.sitenav-panel-action:hover,
.sitenav-panel-action:focus-visible {
  background: color-mix(in srgb, var(--outline, #c8c3b8) 34%, transparent);
}

.sitenav-panel-label {
  margin: 0;
  color: var(--muted, #6b6b6b);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sitenav-panel hr {
  border: 0;
  border-top: 1px solid color-mix(in srgb, var(--outline, #c8c3b8) 65%, transparent);
}

/* Keyboard focus must stay visible against both grounds. */
.sitenav :focus-visible {
  outline: 2px solid var(--coral, #f26a4b);
  outline-offset: 2px;
}

/* ── The panel on a phone or a tablet: a sheet from the bottom ─────────────
 *
 * The thumb lives at the bottom of the screen, so the menu rises to meet it:
 * Settings as the first row, the four groups as cells two to a row, About at
 * the foot, and the page dimmed behind. It scrolls inside itself on a phone
 * held sideways rather than running off the screen.
 */
@media (max-width: 879px) {
  .sitenav-panel {
    position: fixed;
    inset: auto 0 0 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    max-height: min(86vh, 86dvh);
    overflow-y: auto;
    padding: 14px 14px max(16px, env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--outline, #c8c3b8);
    border-radius: 22px 22px 0 0;
    box-shadow: 0 -18px 50px rgb(17 20 24 / 0.22);
    animation: sitenav-rise 0.22s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  }

  /* The handle a sheet is known by. */
  .sitenav-panel::before {
    content: '';
    grid-column: 1 / -1;
    justify-self: center;
    width: 40px;
    height: 4px;
    margin: 0 0 4px;
    border-radius: 2px;
    background: color-mix(in srgb, var(--muted, #6b6b6b) 40%, transparent);
  }

  .sitenav-panel a,
  .sitenav-panel .sitenav-panel-action {
    min-height: 54px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    background: color-mix(in srgb, var(--outline, #c8c3b8) 22%, transparent);
    line-height: 1.25;
  }

  .sitenav-panel .sitenav-panel-action,
  .sitenav-panel-label,
  .sitenav-panel hr,
  .sitenav-panel > a:last-child {
    grid-column: 1 / -1;
  }

  .sitenav-panel-label {
    padding: 8px 4px 0;
  }

  .sitenav-panel hr {
    margin: 4px 0 0;
  }
}

@keyframes sitenav-rise {
  from {
    transform: translateY(24px);
    opacity: 0;
  }
}

/* ── The panel from a laptop up: the whole map at once ─────────────────────
 *
 * A panel across the strip's whole width, under it, with the four groups as
 * columns side by side so the eye reads the map in one look. Multi-column
 * layout over the same flat list: each group's heading forces a new column,
 * Settings spans the top and About the bottom. The hairlines between groups
 * are the column gaps here, so the rules are not drawn. The gutter follows
 * the strip's own, so the columns stand over the page's column.
 */
@media (min-width: 880px) {
  .sitenav {
    --sitenav-h: 56px;
  }

  .sitenav-inner {
    gap: 8px;
  }

  .sitenav-links {
    display: flex;
  }

  .sitenav-menu-word {
    display: inline;
  }

  .sitenav-more {
    position: static;
  }

  .sitenav-panel {
    left: 0;
    right: 0;
    top: 100%;
    columns: 4;
    column-gap: 28px;
    column-rule: 1px solid color-mix(in srgb, var(--outline, #c8c3b8) 60%, transparent);
    padding-top: 18px;
    padding-bottom: 22px;
    padding-left: max(clamp(16px, 4vw, 48px), calc((100% - var(--sitenav-measure, 1320px)) / 2));
    padding-right: max(clamp(16px, 4vw, 48px), calc((100% - var(--sitenav-measure, 1320px)) / 2));
    border-bottom: 1px solid var(--outline, #c8c3b8);
    box-shadow: 0 24px 60px rgb(17 20 24 / 0.18);
    animation: sitenav-drop 0.18s ease both;
  }

  .sitenav-panel a {
    padding: 6px 12px;
    margin: 0 -12px;
  }

  /* A step smaller in a column read with a mouse than in a cell pressed
     with a thumb. */
  .sitenav-icon {
    width: 28px;
    height: 28px;
    padding: 5px;
  }

  .sitenav-panel .sitenav-panel-action {
    column-span: all;
    width: auto;
    margin: 0 -12px 10px;
    padding: 6px 12px;
  }

  .sitenav-panel-label {
    break-before: column;
    padding: 2px 0 8px;
  }

  .sitenav-panel hr {
    display: none;
  }

  /* About, under all four groups, on a rule of its own. */
  .sitenav-panel > a:last-child {
    column-span: all;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid color-mix(in srgb, var(--outline, #c8c3b8) 65%, transparent);
    border-radius: 0;
  }
}

@keyframes sitenav-drop {
  from {
    transform: translateY(-8px);
    opacity: 0;
  }
}

/* ── Sizes ───────────────────────────────────────────────────────────────────
 *
 * The strip never changes shape, only how much of the path it can afford to
 * show. Nothing is reachable at one width and missing at another: what the
 * quick links drop, the menu still carries.
 */

/* Large mobile: the middle of the path folds away, origin and destination stay
   — which is the part that answers "where am I?". */
@media (max-width: 620px) {
  .sitenav-path li:not([aria-current='page']) {
    /* Kept in the accessibility tree; only the label is dropped. */
    padding-left: 26px;
    font-size: 0;
  }

  .sitenav-path li:not([aria-current='page']) a {
    display: none;
  }
}

/* A phone, and on a page deep enough to have a path the wordmark yields its
   room to it: a Pixel is 412, the large iPhones 430 and 440, and with the
   language and theme buttons beside it the page's own name was the one that
   gave way — «How far can», «Where shoul» (2026-10-23). The dot still goes
   home. */
@media (max-width: 440px) {
  /* And the page's name may take a second line before it loses a word. */
  .sitenav-path li[aria-current='page'] {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    white-space: normal;
    line-height: 1.15;
  }

  .sitenav-inner:has(.sitenav-path) .sitenav-wordmark {
    /* Not display:none — screen readers still announce the link's name. */
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

/* Small mobile: the line tightens. On the front page there is no path, so the
   wordmark stays. Browsers without :has() simply keep the wordmark and let
   the current crumb ellipsise, which is the safe way to be wrong. */
@media (max-width: 400px) {
  .sitenav-inner {
    gap: 2px;
  }

  /* A crumb whose label was dropped two breakpoints ago is a dot and a dash
     and nothing else: it names no page, and it was costing 22px of a bar
     that has thumb-sized controls to fit. */
  .sitenav-path li:not([aria-current='page']) {
    display: none;
  }

  .sitenav-path {
    font-size: 0.8rem;
  }

  .sitenav-path li {
    padding-left: 22px;
  }

  .sitenav-path li::before {
    left: 2px;
    width: 10px;
  }

  .sitenav-path li::after {
    left: 12px;
  }
}

/* Narrower still, and the crumb runs out of room for its own word.
 *
 * Measured at 320px: «Day out» had 38px of the 63 it needs and arrived as
 * "Day…", «Excursion» as "Exc…", «Usflug» as "Us…". A page name in fragments
 * is worth less than the site's name whole — and this is the one thing on the
 * strip that is said again, in full, forty pixels below it, by the tab that is
 * selected.
 *
 * So the crumb steps aside. Visually, and not out of the page — it still says
 * which page this is to anybody listening, which is what it was carrying that
 * the tabs do not. */
@media (max-width: 360px) {
  .sitenav-path {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sitenav-panel,
  .sitenav-lang-panel,
  .sitenav details[open] > summary::before,
  .sitenav-burger,
  .sitenav-burger::before,
  .sitenav-burger::after {
    animation: none;
    transition: none;
  }
}

/* ── The tools, on the right of the strip ───────────────────────────────────
 *
 * Two controls, in the same place on every page that has them: the language,
 * then the colour theme. Same markup, same styles, same handler
 * (docker/theme.js) everywhere.
 */

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1.5px solid color-mix(in srgb, var(--outline, #c8c3b8) 90%, transparent);
  border-radius: 999px;
  background: transparent;
}

.theme-toggle button {
  display: grid;
  place-items: center;
  /* 30 square: the smallest control on the strip is the one with three
     states to tell apart, and 24px is the WCAG floor for a pointer target. */
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted, #6b6b6b);
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
}

.theme-toggle button:hover {
  color: var(--ink, #111418);
}

.theme-toggle button[aria-pressed="true"] {
  background: var(--paper-high, #e2ded4);
  color: var(--ink, #111418);
}

.theme-toggle button:focus-visible {
  outline: 2px solid var(--coral, #f26a4b);
  outline-offset: 1px;
}

/* The language, as its own control rather than three levels down in Settings:
   the current language on the button, the rest in a panel under it. */
.sitenav-lang {
  position: relative;
}

.sitenav-lang > summary {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 10px;
  border: 1.5px solid color-mix(in srgb, var(--outline, #c8c3b8) 90%, transparent);
  border-radius: 999px;
  color: var(--ink-soft, var(--ink, #111418));
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  list-style: none;
  white-space: nowrap;
}

.sitenav-lang > summary::-webkit-details-marker {
  display: none;
}

.sitenav-lang > summary:hover,
.sitenav-lang[open] > summary {
  color: var(--ink, #111418);
  border-color: color-mix(in srgb, var(--ink, #111418) 45%, transparent);
}

.sitenav-lang > summary:focus-visible {
  outline: 2px solid var(--coral, #f26a4b);
  outline-offset: 1px;
}

/* The button's label comes in two widths and the strip picks one: the bare
   tag ("DE") where space is tight, the language's own name where it is not.
   For the dialects the short form is the name cut to four letters — "Bärn",
   "Solo" — which a reader on a wide screen took for a bug, so the name is
   shown from a laptop up, capped and ellipsised so "Solothurner Dütsch"
   cannot push the theme toggle off the strip. */
.sitenav-lang-full {
  display: none;
}

@media (min-width: 1100px) {
  .sitenav-lang-short {
    display: none;
  }

  .sitenav-lang-full {
    display: inline-block;
    max-width: 16ch;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .sitenav-lang > summary {
    height: 36px;
    padding: 0 12px;
    font-size: 0.84rem;
  }
}

.sitenav-lang-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 70;
  display: grid;
  min-width: 200px;
  max-height: min(60vh, 440px);
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--outline, #c8c3b8);
  border-radius: 14px;
  background: var(--paper-low, var(--paper, #f1efea));
  box-shadow: 0 18px 40px rgb(0 0 0 / 0.18);
  animation: sitenav-drop 0.18s ease both;
}

.sitenav-lang-panel button {
  padding: 8px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink, #111418);
  cursor: pointer;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  text-align: left;
}

.sitenav-lang-panel button:hover {
  background: color-mix(in srgb, var(--outline, #c8c3b8) 34%, transparent);
}

.sitenav-lang-panel button[aria-current="true"] {
  color: var(--coral-ink, var(--coral, #f26a4b));
  font-weight: 700;
}

.sitenav-lang-panel hr {
  height: 1px;
  margin: 5px 4px;
  border: 0;
  background: color-mix(in srgb, var(--outline, #c8c3b8) 65%, transparent);
}

.sitenav-lang-group {
  padding: 6px 12px 2px;
  color: var(--muted, #6b6b6b);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* The languages too rise as a sheet on a phone: fourteen rows in a dropdown
   hanging off a 34px button ran under the thumb and off the screen sideways. */
@media (max-width: 879px) {
  .sitenav-lang-panel {
    position: fixed;
    inset: auto 0 0 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    max-height: min(86vh, 86dvh);
    padding: 14px 14px max(16px, env(safe-area-inset-bottom, 0px));
    border-radius: 22px 22px 0 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    animation: sitenav-rise 0.22s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  }

  .sitenav-lang-panel::before {
    content: '';
    grid-column: 1 / -1;
    justify-self: center;
    width: 40px;
    height: 4px;
    margin-bottom: 4px;
    border-radius: 2px;
    background: color-mix(in srgb, var(--muted, #6b6b6b) 40%, transparent);
  }

  .sitenav-lang-panel button {
    min-height: 48px;
    background: color-mix(in srgb, var(--outline, #c8c3b8) 22%, transparent);
  }

  .sitenav-lang-panel hr,
  .sitenav-lang-group,
  .sitenav-lang-panel button[data-role="auto"],
  .sitenav-lang-panel > button:first-child {
    grid-column: 1 / -1;
  }

  .sitenav-lang-panel hr {
    margin: 4px 0;
  }
}

/* ── The foot: one small block, the same on every page ───────────────────────
 *
 * The strip's counterpart at the other end. The foot says the same things in
 * the same order everywhere: the destinations the menu offers, then the pages
 * only it lists, where the data comes from, and where it was made. A page may
 * put one paragraph of its own above those (the front page its no-guarantee
 * note, the planner what happens to a search), but nothing below or between.
 *
 * Same delivery as the strip: this file, linked by every static page and
 * bundled by the planner. It sits inside each page's own reading column, so it
 * measures whatever the content above it measures.
 */

.sitefoot {
  display: grid;
  gap: 14px;
  margin-top: clamp(48px, 8vw, 84px);
  padding: 22px 0 30px;
  border-top: 1px solid color-mix(in srgb, var(--outline, #c8c3b8) 60%, transparent);
  color: var(--muted, #6b6b6b);
  font-size: 0.84rem;
  line-height: 1.6;
  text-align: left;
}

.sitefoot p {
  margin: 0;
}

.sitefoot a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);
  text-underline-offset: 3px;
}

.sitefoot a:hover,
.sitefoot a:focus-visible {
  color: var(--ink, #111418);
  text-decoration-color: currentColor;
}

.sitefoot :focus-visible {
  outline: 2px solid var(--coral, #f26a4b);
  outline-offset: 2px;
  border-radius: 4px;
}

/* The destinations, in the menu's order. Plain words with room between them;
   no dots, so a wrapped row does not begin with one. */
.sitefoot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-weight: 600;
}

.sitefoot-links a {
  text-decoration: none;
  white-space: nowrap;
}

.sitefoot-links a:hover,
.sitefoot-links a:focus-visible {
  text-decoration: underline;
}

.sitefoot-made {
  display: flex;
  align-items: center;
  gap: 7px;
}

/* The flag, drawn rather than fetched: half of these pages allow no image
   from anywhere but this origin, and none should pay a request for it. */
.sitefoot-flag {
  position: relative;
  display: inline-block;
  flex: none;
  width: 11px;
  height: 11px;
  border-radius: 2px;
  background: #da291c;
}

.sitefoot-flag::before,
.sitefoot-flag::after {
  content: '';
  position: absolute;
  background: #fff;
}

.sitefoot-flag::before {
  left: 50%;
  top: 19%;
  width: 19%;
  height: 62%;
  transform: translateX(-50%);
}

.sitefoot-flag::after {
  top: 50%;
  left: 19%;
  height: 19%;
  width: 62%;
  transform: translateY(-50%);
}

/* ── Thumbs ──────────────────────────────────────────────────────────────────
 *
 * Wherever a finger is the pointer the bar is a little taller and every
 * control in it clears the 24px WCAG floor with room: the menu 42, the theme
 * buttons 34, the language 36. A capability query rather than a width one,
 * deliberately: a narrow window on a desktop is still a mouse. Last in the
 * file so it wins over the width blocks above without needing !important. */
@media (pointer: coarse) {
  .sitenav {
    --sitenav-h: 52px;
  }

  /* On a page with a path, a phone hides the wordmark and the home link is
     the dot alone: the link keeps a thumb's room. */
  .sitenav-home {
    min-width: 34px;
    min-height: 34px;
    justify-content: center;
  }

  .sitenav-more > summary {
    height: 42px;
    min-width: 42px;
  }

  .theme-toggle button {
    width: 34px;
    height: 34px;
  }

  .sitenav-lang > summary {
    height: 36px;
    padding: 0 10px;
  }
}
