/* Events: one dark band that is the whole page (events-dashboard.js, events-places.js, events-calendar.js, events-lib.js,
   events-globe.js). Four rows: the ticker of live readings, the calendar strip across the months ahead, the main row
   (the search by place with the selected event's readout under it on the left, the globe in the middle, Nearest to you
   above Month on the right) and the status row, with tick rulers down both edges. In a window at least 1280px wide and 640px tall the band
   and the nav fill the window's height exactly and nothing scrolls; in a smaller or zoomed window and on phones the same
   parts stack and the page scrolls, with the site's footer back. Panels sit on hairlines with a segmented rule under
   each title: no boxes, no corner marks, no shadows, no hue. Every value is a token; the literal numbers are the
   instruments' own geometry, shared with events-dashboard.js. */

/* ---------- The band: a dark instrument screen in both themes ----------
   The design system's dark aliases, pinned here so the band stays dark under the light theme; the values are the ones
   tokens/colors.css declares on :root. In light the band is satin black under the white nav; in dark it is the canvas. */
.dash {
  --bg-canvas: var(--q-gray-950);
  --bg-surface: var(--q-gray-900); --bg-raised: var(--q-gray-850);
  --text-primary: var(--q-gray-50); --text-body: var(--q-gray-200); --text-secondary: var(--q-gray-400);
  --text-tertiary: var(--q-gray-400); /* the dark tertiary grey is 3.07:1 on this ground; text never goes below secondary here */
  --text-disabled: var(--q-gray-600); --text-inverse: var(--q-gray-950); --text-on-accent: var(--q-satin);
  --text-link: var(--q-gray-50); --text-link-hover: var(--q-gray-300);
  --border-hairline: rgba(250,251,252,.08); --border-default: rgba(250,251,252,.12); --border-strong: rgba(250,251,252,.24);
  --border-focus: var(--q-gray-50); --accent: var(--q-gray-50); --accent-hover: var(--q-pure-white); --accent-active: var(--q-gray-200);
  --wire: rgba(250,251,252,.28); --grid-line: rgba(250,251,252,.04);
  --surface-accent-subtle: rgba(250,251,252,.06); --surface-accent-muted: rgba(250,251,252,.12);
  --shadow-focus: 0 0 0 2px var(--bg-canvas), 0 0 0 3.5px var(--border-focus);
  /* Instrument lines sit between the hairline and the default border. */
  --dash-tick: rgba(250,251,252,.16);
  /* A mark that carries information without words (Month's discs): the darkest grey that keeps 3:1 on the band in both
     themes (3.02:1 on satin, 3.07:1 on the canvas; WCAG 1.4.11), with primary ink on it at 5.76:1. */
  --dash-mark: var(--q-gray-500);
  --dash-ruler: 24px;
  --dash-edge: calc(var(--dash-ruler) + var(--space-6));
  --col-l: 384px; --col-r: 304px;
  color-scheme: dark;
  position: relative; overflow: clip;
  display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto;
  /* Exactly the window under the nav: the page is one screen and the panels scroll inside themselves if they must. */
  height: calc(100vh - var(--nav-height)); height: calc(100svh - var(--nav-height));
  padding: 0 var(--dash-edge);
  background: var(--bg-canvas); color: var(--text-body);
  border-bottom: var(--line-thin) solid var(--border-hairline);
}
[data-theme="light"] .dash { --bg-canvas: var(--q-satin); }
.dash ::selection { background: var(--surface-accent-muted); color: var(--text-primary); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Tick rulers down both edges: a short tick every 8px, a long one every 40px, a hairline on the inner side. */
.dash-ruler {
  position: absolute; top: 0; bottom: 0; width: var(--dash-ruler); pointer-events: none;
  background-image:
    linear-gradient(to bottom, var(--dash-tick) var(--line-thin), transparent var(--line-thin)),
    linear-gradient(to bottom, var(--dash-tick) var(--line-thin), transparent var(--line-thin));
  background-repeat: repeat-y;
  background-size: 5px 8px, 11px 40px;
}
.dash-ruler-l { left: 0; background-position: right top, right top; border-right: var(--line-thin) solid var(--border-hairline); }
.dash-ruler-r { right: 0; background-position: left top, left top; border-left: var(--line-thin) solid var(--border-hairline); }

/* The segmented rule under a panel title: a tick every 24px on a hairline, drawn once (svg.dash-defs). */
.dash-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.dash-defs .tick { fill: var(--dash-tick); }
.dash-defs .base { fill: var(--border-hairline); }
.panel-rule { display: block; width: 100%; height: 5px; }

/* ---------- The ticker ---------- */
.ticker {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-6);
  min-height: 40px; padding: var(--space-2) 0; border-bottom: var(--line-thin) solid var(--border-hairline);
}
.readings { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-5); margin: 0; }
.reading { display: flex; align-items: baseline; gap: var(--space-2); white-space: nowrap; }
.reading dt { font: var(--type-caption); color: var(--text-secondary); }
.reading dd { margin: 0; font: var(--type-mono-sm); color: var(--text-primary); font-variant-numeric: tabular-nums; }
/* The View reading changes many times a second while the globe turns: a fixed box, so the write never relays out the ticker. */
.reading dd.is-fixed { width: 14ch; height: calc(var(--text-xs) * var(--leading-normal)); overflow: clip; }
/* The kind chips close the calendar strip's head line (they would wrap the ticker onto a second row below 1450px). */
.chips { display: flex; flex-wrap: wrap; flex: none; gap: var(--space-1) var(--space-3); margin: 0 0 0 auto; padding: 0; list-style: none; }
.chip { display: inline-flex; align-items: center; gap: var(--space-2); font: var(--type-mono-sm); color: var(--text-body); white-space: nowrap; }
.chip::before { content: ""; width: 7px; height: 7px; background: var(--text-primary); }
.chip b { font-weight: var(--weight-regular); color: var(--text-primary); font-variant-numeric: tabular-nums; }
.chip.is-total::before { display: none; }
/* Your region: its name in mono like the other readings, and the plain text action that changes it, at the ticker's size.
   The action stands alone in the ticker, so its 24px box is the target (WCAG 2.5.8). */
.reading-region dd { display: inline-flex; align-items: baseline; gap: var(--space-3); }
.reading-region .text-action { display: inline-flex; align-items: center; min-height: 24px; padding: 0; border-bottom: 0; font-size: var(--text-xs); text-decoration: underline; text-decoration-thickness: var(--line-thin); text-underline-offset: 3px; }
.reading-region .text-action[hidden] { display: none; }
/* The review marker: the system's status badge in primary ink, so a sample is never mistaken for the live page. */
.dash .dash-sample { margin: 0; color: var(--text-primary); border-color: var(--border-strong); justify-self: auto; align-self: auto; }
.dash-sample[hidden] { display: none; }

/* ---------- The calendar strip ----------
   A head line, then the wire: today's dot at its left on the wire, the events' bars in up to three lanes under it, and the
   ruler with a tick at each month and the month's name below. The wire and its labels are SVG (events-dashboard.js
   draws them at the stage's width); the bars are buttons laid over it. The geometry is STRIP in events-dashboard.js. */
.strip { min-width: 0; padding: var(--space-2) 0 var(--space-1); border-bottom: var(--line-thin) solid var(--border-hairline); }
/* One line whatever it says, so the text that follows the pointer never changes the strip's height; the kind chips at its
   right end. Stacked, the chips take a line of their own; on phones the line wraps too (below). */
.strip-head { display: flex; align-items: baseline; gap: var(--space-4); height: 20px; min-width: 0; }
.strip-head h2 { margin: 0; font: var(--type-label); line-height: 20px; color: var(--text-primary); white-space: nowrap; }
.strip-line { min-width: 0; margin: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font: var(--type-body-sm); line-height: 20px; color: var(--text-secondary); }
.strip-line .sl-days { margin-right: var(--space-2); font: var(--type-mono-sm); line-height: 20px; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.strip-line .sl-title { color: var(--text-primary); }
.strip-line .sl-sum { font: var(--type-mono-sm); line-height: 20px; }
.strip-stage { position: relative; height: 68px; }
.wire-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.wire-label { font: var(--type-mono-sm); fill: var(--text-secondary); }
.wire-line { stroke: var(--wire); stroke-width: 1; }
.wire-ruler, .wire-month { stroke: var(--dash-tick); stroke-width: 1; }
.wire-month-major { stroke: var(--border-strong); stroke-width: 1; }
.wire-grid { stroke: var(--border-hairline); stroke-width: 1; }
.wire-month-text, .wire-now-text, .wire-sel-text { font: var(--weight-regular) var(--text-2xs)/1 var(--font-mono); fill: var(--text-secondary); }
.wire-now { fill: var(--text-primary); }
.wire-now-tick, .wire-sel { stroke: var(--text-primary); stroke-width: 1; }
.wire-now-text, .wire-sel-text { fill: var(--text-primary); }
/* A bar per event: the button is its lane's height, the ink inside it the bar. The current choice's bars are full ink;
   the rest are thinner and quieter but can still be pressed. A canvas-coloured edge keeps bars that share days apart.
   The selected bar fills its lane, over the tick that runs from it to its dates on the ruler; only a focused bar carries
   the focus ring, so the ring always says where the keyboard is. */
.strip-bars { position: absolute; inset: 0; }
.strip-bars[hidden] { display: none; }
.bar { position: absolute; left: 0; top: 0; width: 3px; height: 11px; padding: 0; border: 0; border-radius: 0; background: transparent; cursor: pointer; }
.bar::before { content: ""; position: absolute; left: 0; right: 0; top: 2px; height: 7px; background: var(--text-primary); box-shadow: 0 0 0 1px var(--bg-canvas); }
.bar.is-out::before { top: 4px; height: 3px; background: var(--text-secondary); }
.bar.is-out:hover::before { background: var(--text-body); }
.bar:focus-visible { box-shadow: none; }
.bar[aria-pressed="true"], .bar:focus-visible { z-index: 1; }
/* An event that fits the chosen event's trip: a hollow bar, whichever place it is in. */
.bar.is-trip::before, .bar.is-trip.is-out::before { top: 1px; height: 9px; background: transparent; box-shadow: inset 0 0 0 1.5px var(--text-primary); }
.bar[aria-pressed="true"]::before { top: 0; height: 11px; }
.bar:focus-visible::before { box-shadow: 0 0 0 2px var(--bg-canvas), 0 0 0 3.5px var(--border-focus); }

/* ---------- The main row: the globe behind, the search by place over its left side, Month over its right ---------- */
.dash-main {
  display: grid; grid-template-columns: var(--col-l) minmax(0, 1fr) var(--col-r); grid-template-rows: minmax(0, 1fr);
  column-gap: var(--space-8); padding: var(--space-4) 0 var(--space-3); min-height: 0;
}
.dash-stage { grid-column: 1 / -1; grid-row: 1; position: relative; min-height: 0; min-width: 0; }
/* The canvas is positioned, not flowed, so its pixel size never feeds back into the band's height. */
/* The canvas fades out over 24px toward each panel column (--room-l and --room-r, set by events-dashboard.js as the
   columns are measured) and toward the rows above and below, so a globe magnified for a continent or a country never
   draws under a panel and never ends on a hard edge. */
.dash-stage .globe-canvas {
  position: absolute; inset: 0; display: block; width: 100%; height: 100%; touch-action: pan-y; cursor: grab;
  --fade-x: linear-gradient(to right, transparent var(--room-l, 0px), #000 calc(var(--room-l, 0px) + 24px), #000 calc(100% - var(--room-r, 0px) - 24px), transparent calc(100% - var(--room-r, 0px)));
  --fade-y: linear-gradient(to bottom, transparent, #000 24px, #000 calc(100% - 24px), transparent);
  -webkit-mask-image: var(--fade-x), var(--fade-y); -webkit-mask-composite: source-in;
          mask-image: var(--fade-x), var(--fade-y);         mask-composite: intersect;
}
.dash-stage .globe-canvas:active { cursor: grabbing; }
.dash-col { grid-row: 1; position: relative; z-index: 1; display: grid; align-content: start; row-gap: var(--space-5); min-width: 0; min-height: 0; pointer-events: none; }
/* The places panel takes the room the readout leaves; a long list scrolls inside it. With an event open the panel is
   only as tall as its list, so the readout sits directly under the row that opened it. When the two do not fit with the
   list keeping at least the open row (events-dashboard.js measures it and sets is-tight), the event takes the list's
   place, the breadcrumb is the way back, and the readout scrolls inside itself with a fade at its foot if it must. */
.dash-col-l { grid-column: 1; grid-template-rows: minmax(0, 1fr) auto; align-content: stretch; }
.dash-col-l.has-event { grid-template-rows: minmax(0, auto) auto; align-content: start; }
.dash-col-l.is-tight { grid-template-rows: auto minmax(0, 1fr); align-content: stretch; }
.dash-col-l.is-tight .panel-places > :not(.places-head):not(.crumbs), .dash-col-l.is-tight .places-lede { display: none; }
.dash-col-l.is-tight .panel-readout { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
.dash-col-l.is-tight .panel-readout::-webkit-scrollbar { display: none; }
/* Shorter than the list's fade, so it dims the line under the actions and not the actions themselves. */
.panel-readout.has-more::after {
  content: ""; position: sticky; bottom: 0; display: block; height: 24px; margin-top: -24px; pointer-events: none;
  background: linear-gradient(to bottom, transparent, var(--bg-canvas));
}
/* The right column: a panel above Month gives way (shrinks and clips) when the window is short; Month keeps its height. */
.dash-col-r { grid-column: 3; display: flex; flex-direction: column; gap: var(--space-5); }
.dash-col-r > .panel { flex: 0 1 auto; min-height: 0; overflow: hidden; }
.dash-col-r > .panel-month { flex: none; overflow: visible; }
.panel { pointer-events: auto; min-width: 0; }

/* Labels projected onto the globe (events-dashboard.js positions them each frame with a transform). Each name sits on a
   plate of the band's own colour, so land dots, graticule lines and spikes never show through its letters. The lead dash
   is drawn in a transparent 10px border beside the plate (LABEL_LEAD in events-lib.js), so the box that is measured and
   kept clear of markers and other labels includes it. The layer stacks over the canvas, which the engine appends after
   it, or the dots would draw over the plates; it lets every pointer through to the canvas. */
.globe-labels { position: absolute; inset: 0; z-index: 1; overflow: hidden; pointer-events: none; }
.g-label {
  position: absolute; left: 0; top: 0; padding: 1px 5px;
  border: 0 solid transparent; border-left-width: 10px; background: var(--bg-canvas); background-clip: padding-box;
  font: var(--weight-regular) var(--text-xs)/1.4 var(--font-mono); color: var(--text-primary); white-space: nowrap; will-change: transform;
}
.g-label::before { content: ""; position: absolute; top: 50%; left: -10px; width: 7px; height: var(--line-thin); background: var(--text-body); }
/* On the left of its anchor the lead moves to the plate's right; off a corner, or centred over or under it, there is none. */
.g-label.is-left { border-left-width: 0; border-right-width: 10px; }
.g-label.is-left::before { left: auto; right: -10px; }
.g-label.is-centre { border-width: 0; }
.g-label.is-centre::before { display: none; }
/* The city that holds the selected event: an inverse plate. */
.g-label.is-on { background-color: var(--text-primary); color: var(--text-inverse); }
.g-label.is-on::before { background: var(--text-primary); }
/* Your region: one step quieter than a city name, on the same plate. */
.g-label.is-home { color: var(--text-body); }
.g-label.is-home::before { background: var(--text-secondary); }
.g-pole { position: absolute; left: 0; top: 0; padding: 0 4px; background: var(--bg-canvas); font: var(--type-mono-sm); color: var(--text-secondary); white-space: nowrap; will-change: transform; }
.g-label[hidden], .g-pole[hidden] { display: none; }
/* A ket: a bar, the mono state, a stroke-drawn closing chevron (the font subset carries no U+27E9). */
.qket { display: inline-block; padding-left: 5px; border-left: var(--line-thin) solid currentColor; line-height: 1.15; white-space: nowrap; }
.qket::after {
  content: ""; display: inline-block; width: 6px; height: 1.1em; margin-left: 3px; vertical-align: -0.18em; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 24' preserveAspectRatio='none'%3E%3Cpath d='M.6.3 7.4 12 .6 23.7' fill='none' stroke='%23000' stroke-width='1.2'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 24' preserveAspectRatio='none'%3E%3Cpath d='M.6.3 7.4 12 .6 23.7' fill='none' stroke='%23000' stroke-width='1.2'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}

/* ---------- Panels: a title in Sora, a mono subtitle, the segmented rule; no boxes ---------- */
.panel-head { display: flex; align-items: center; gap: var(--space-3); min-height: var(--control-h-sm); }
.panel-head h2 { margin: 0; font: var(--type-label); line-height: var(--leading-snug); color: var(--text-primary); white-space: nowrap; }
.panel-tag { min-width: 0; font: var(--type-mono-sm); color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.panel-steps { margin-left: auto; display: inline-flex; gap: var(--space-1); }
.panel-note { margin: var(--space-3) 0 0; font: var(--type-caption); color: var(--text-secondary); text-wrap: pretty; }
.panel-empty { margin: var(--space-3) 0 0; font: var(--type-body-sm); color: var(--text-secondary); text-wrap: pretty; }
.panel-note:empty, .panel-empty[hidden] { display: none; }

/* The index: numbered rows, each a button; the list scrolls inside its panel only when the band is at its cap, with a
   fade and a mono count as the affordance. The panel's parts are placed by name, so a hidden breadcrumb never moves the
   list out of the row that gives it the room; the list itself is only as tall as its rows, so its closing hairline
   always sits under the last one. The empty or error message, shown only when the list is not, takes the list's place. */
.panel-places {
  display: grid; min-height: 0;
  grid-template-areas: "head" "crumbs" "level" "list" "more";
  grid-template-rows: auto auto auto minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr);
}
.places-head { grid-area: head; }
.crumbs { grid-area: crumbs; }
.places-level { grid-area: level; }
.places-level[hidden] { display: none; }
.panel-places > .index-scroll { grid-area: list; }
.panel-places > .index-more { grid-area: more; }
.panel-places > .panel-empty { grid-area: list; align-self: start; }
.index-scroll { position: relative; display: grid; min-height: 0; }
.index-scroll[hidden] { display: none; }
.index-scroll::before, .index-scroll::after {
  content: ""; position: absolute; left: 0; right: 0; height: 36px; pointer-events: none; opacity: 0; z-index: 1;
  transition: opacity var(--dur-fast) var(--ease-out);
}
.index-scroll::before { top: 0; background: linear-gradient(to top, transparent, var(--bg-canvas)); }
.index-scroll::after { bottom: 0; background: linear-gradient(to bottom, transparent, var(--bg-canvas)); }
.index-scroll.has-above::before, .index-scroll.has-more::after { opacity: 1; }
.index-list {
  position: relative; list-style: none; margin: 0; padding: 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: none; border-bottom: var(--line-thin) solid var(--border-hairline); align-self: start; max-height: 100%;
}
.index-list::-webkit-scrollbar { display: none; }
.index-more { margin: 0; padding: var(--space-2) 0 0; font: var(--type-mono-sm); color: var(--text-secondary); text-align: right; }
.index-more[hidden] { display: none; }
.ix-row {
  display: grid; grid-template-columns: 20px 48px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: var(--space-3); row-gap: 2px; align-items: start;
  width: 100%; padding: 6px var(--space-2); border: 0; border-top: var(--line-thin) solid var(--border-hairline); border-radius: 0;
  background: transparent; color: var(--text-body); font: inherit; text-align: left; cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out);
}
.index-list li:first-child .ix-row { border-top-color: transparent; }
.ix-row:hover { background: var(--surface-accent-subtle); }
/* On the 6% highlight the secondary grey falls under 4.5:1, so a hovered or pressed row lifts its quieter text to body ink. */
.ix-row:hover .ix-n, .ix-row:hover .ix-place, .ix-row:hover .ix-kind, .ix-row:hover .ix-date small { color: var(--text-body); }
.ix-row[aria-pressed="true"] { background: var(--surface-accent-subtle); box-shadow: inset var(--line-thin) 0 0 var(--accent); }
/* Focus is the system's ring at its own weights, drawn inside the row because the list clips at its edges to scroll. */
.ix-row:focus-visible, .ix-row[aria-pressed="true"]:focus-visible { box-shadow: inset 0 0 0 2px var(--bg-canvas), inset 0 0 0 3.5px var(--border-focus); }
.ix-n { grid-row: 1 / 3; font: var(--type-mono-sm); line-height: 1.35; color: var(--text-secondary); }
.ix-date { grid-row: 1 / 3; display: grid; align-content: start; font: var(--type-mono-sm); line-height: 1.35; color: var(--text-primary); white-space: nowrap; }
.ix-date small { font-size: var(--text-2xs); color: var(--text-secondary); }
.ix-title { grid-column: 3; font: var(--type-body-sm); line-height: 1.35; color: var(--text-primary); overflow-wrap: anywhere; text-wrap: pretty; }
.ix-meta { grid-column: 3; display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); min-width: 0; }
.ix-place { font: var(--type-caption); line-height: 1.35; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ix-kind { font: var(--weight-regular) var(--text-2xs)/1.35 var(--font-mono); color: var(--text-secondary); white-space: nowrap; }
.ix-row[aria-pressed="true"] .ix-n, .ix-row[aria-pressed="true"] .ix-place, .ix-row[aria-pressed="true"] .ix-kind, .ix-row[aria-pressed="true"] .ix-date small { color: var(--text-body); }

/* The readout: one light title, the kind in words, facts in a label / value grid, then two measures on a hairline. */
.readout { display: grid; gap: var(--space-2); padding-top: var(--space-3); }
.ro-title { margin: 0; font: var(--weight-light) var(--text-2xl)/var(--leading-snug) var(--font-display); letter-spacing: var(--tracking-tight); color: var(--text-primary); text-wrap: balance; }
.ro-kind { margin: calc(-1 * var(--space-1)) 0 0; font: var(--type-body-sm); color: var(--text-secondary); }
.ro-facts { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 6px var(--space-4); margin: var(--space-1) 0 0; }
.ro-facts dt { padding-top: 1px; font: var(--type-caption); color: var(--text-secondary); }
.ro-facts dd { margin: 0; font: var(--type-mono-sm); color: var(--text-primary); overflow-wrap: anywhere; }
.ro-facts dd.is-text { font: var(--type-body-sm); color: var(--text-body); }
.ro-sub { display: block; color: var(--text-secondary); }
.ro-measure { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-6); margin-top: var(--space-1); padding-top: var(--space-3); border-top: var(--line-thin) solid var(--border-hairline); }
.measure-value { margin: 0; font: var(--weight-light) var(--text-2xl)/1 var(--font-mono); letter-spacing: var(--tracking-tight); color: var(--text-primary); white-space: nowrap; }
.measure-label { margin: var(--space-2) 0 0; font: var(--type-caption); color: var(--text-secondary); text-wrap: pretty; }
.measure-note { grid-column: 1 / -1; margin: 0; font: var(--type-caption); color: var(--text-secondary); text-wrap: pretty; }
.ro-summary { margin: 0; max-width: 36em; font: var(--type-body-sm); color: var(--text-secondary); text-wrap: pretty; }
.ro-actions { margin: 0; }
.ro-link { font: var(--type-label); color: var(--text-primary); text-decoration: underline; text-decoration-thickness: var(--line-thin); text-underline-offset: 3px; }
.ro-link:hover { color: var(--text-link-hover); }

/* ---------- Month: seven columns, a dot per day sized by its events, today ringed, the selected event's days filled ----------
   A day with events in the current choice gets the disc; a day whose events are all elsewhere gets a small dot under its
   number. Either is a button that opens the day's event; a day without events is a plain cell. The disc, its size and
   today's ring are information, so each keeps 3:1 against what is next to it (WCAG 1.4.11): the disc in --dash-mark on
   the band, the ring in body ink on the band and on a disc. */
.cal { width: 100%; margin-top: var(--space-1); table-layout: fixed; border-collapse: collapse; }
.cal th { padding: 0 0 var(--space-1); font: var(--type-caption); color: var(--text-secondary); text-align: center; border-bottom: var(--line-thin) solid var(--border-hairline); }
.cal td { padding: 0; }
.cal tbody tr:first-child td { padding-top: 2px; }
.cal-day {
  position: relative; display: grid; place-items: center; width: 100%; height: 24px; padding: 0; border: 0; border-radius: var(--radius-xs);
  background: transparent; font: var(--weight-regular) var(--text-2xs)/1 var(--font-mono); color: var(--text-secondary); font-variant-numeric: tabular-nums;
}
button.cal-day { cursor: pointer; }
.cal-n { position: relative; z-index: 1; }
.cal-dot { position: absolute; top: 50%; left: 50%; width: 0; height: 0; transform: translate(-50%, -50%); border-radius: var(--radius-full); background: var(--dash-mark); }
.cal-day.has-ev { color: var(--text-primary); }
.cal-day.has-ev.n1 .cal-dot { width: 16px; height: 16px; }
.cal-day.has-ev.n2 .cal-dot { width: 20px; height: 20px; }
.cal-day.has-ev.n3 .cal-dot { width: 24px; height: 24px; }
button.cal-day.has-ev:hover .cal-dot { box-shadow: 0 0 0 var(--line-thin) var(--text-body); }
.cal-day.has-other { color: var(--text-body); }
.cal-day.has-other .cal-dot { top: auto; bottom: 2px; width: 3px; height: 3px; transform: translateX(-50%); background: var(--text-secondary); }
button.cal-day.has-other:hover .cal-dot { background: var(--text-primary); }
.cal-day.is-today .cal-n { color: var(--text-primary); }
.cal-day.is-today::after { content: ""; position: absolute; top: 50%; left: 50%; width: 20px; height: 20px; transform: translate(-50%, -50%); border: var(--line-thin) solid var(--text-body); border-radius: var(--radius-full); }
.cal-day.is-on .cal-dot, button.cal-day.is-on:hover .cal-dot { background: var(--text-primary); }
.cal-day.is-on .cal-n { color: var(--text-inverse); }
.panel-month .panel-tag { font-variant-numeric: tabular-nums; }

/* ---------- The status row ---------- */
.status {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-6);
  padding: var(--space-2) 0 var(--space-2); border-top: var(--line-thin) solid var(--border-hairline);
  font: var(--type-caption); color: var(--text-secondary);
}
.status .mono { color: inherit; }
.status-pause { margin-left: auto; font: var(--type-caption); line-height: 1; color: var(--text-body); }
.status-pause[hidden] { display: none; }
.status-legal { display: flex; gap: var(--space-5); }
.status-legal a { color: var(--text-secondary); text-decoration: none; }
.status-legal a:hover { color: var(--text-primary); }

/* ---------- The search by place ---------- */
.places-head { display: grid; gap: var(--space-2); padding-bottom: var(--space-4); }
.places-head h1 { margin: 0; font: 400 clamp(20px, 2.1vw, 30px)/1.15 var(--font-hero); letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-primary); }
.places-lede { margin: 0; font: var(--type-body-sm); color: var(--text-body); text-wrap: pretty; }
/* The way back: every level above this one is a button, the level itself plain ink. Each slash closes the name before it,
   so a wrapped trail starts with a name. A long trail wraps to a second line with every name whole. */
.crumbs { padding-bottom: var(--space-3); }
.crumbs[hidden] { display: none; }
.crumbs ol { display: flex; flex-wrap: wrap; gap: var(--space-1) 0; margin: 0; padding: 0; list-style: none; font: var(--type-mono-sm); }
.crumbs li { display: inline-flex; align-items: center; flex: none; min-width: 0; max-width: 100%; }
.crumbs li:not(:last-child)::after { content: "/"; padding: 0 var(--space-2); color: var(--text-secondary); }
.crumb { min-width: 0; padding: 2px 0; border: 0; border-bottom: var(--line-thin) solid transparent; border-radius: 0; background: transparent; font: inherit; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
button.crumb:hover { color: var(--text-primary); border-bottom-color: var(--text-primary); }
button.crumb:focus-visible { box-shadow: var(--shadow-focus); border-radius: var(--radius-xs); }
.crumb.is-here { color: var(--text-primary); cursor: default; }
.panel-head h2:focus { outline: none; }
.panel-head h2:focus-visible { box-shadow: var(--shadow-focus); border-radius: var(--radius-xs); }
/* A place: its name and how many events it holds. */
.pl-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-4);
  width: 100%; padding: 10px var(--space-2); border: 0; border-top: var(--line-thin) solid var(--border-hairline); border-radius: 0;
  background: transparent; color: var(--text-body); font: inherit; text-align: left; cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out);
}
.index-list li:first-child .pl-row { border-top-color: transparent; }
.pl-row:hover { background: var(--surface-accent-subtle); }
.pl-row:hover .pl-count { color: var(--text-body); }
.pl-row:focus-visible { box-shadow: inset 0 0 0 2px var(--bg-canvas), inset 0 0 0 3.5px var(--border-focus); }
.pl-name { font: var(--weight-regular) var(--text-md)/1.3 var(--font-body); color: var(--text-primary); }
.pl-count { font: var(--type-mono-sm); color: var(--text-secondary); white-space: nowrap; font-variant-numeric: tabular-nums; }
.panel-empty a { color: var(--text-primary); text-underline-offset: 3px; }

/* The readout's later lines: what is unsettled, how far it is, and when it was checked. */
.ro-caveat { margin: 0; padding: var(--space-2) var(--space-3); border-left: var(--line-thin) solid var(--text-primary); font: var(--type-caption); color: var(--text-body); text-wrap: pretty; }
.ro-caveat b { font-weight: var(--weight-medium); color: var(--text-primary); }
.ro-reach { margin: 0; font: var(--type-mono-sm); color: var(--text-secondary); }
.ro-actions { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2) var(--space-5); }
.ro-checked { font: var(--type-mono-sm); color: var(--text-secondary); }
/* Add to calendar and Copy link: quiet text actions beside the organiser's link, in body ink with an underline; each box
   is 24px tall, so it is a fair target (WCAG 2.5.8). When the browser refuses the clipboard, a read-only field holding
   the address takes Copy link's place. */
.ro-act {
  display: inline-flex; align-items: center; min-height: 24px; padding: 0; border: 0; border-radius: 0; background: transparent;
  font: var(--type-caption); color: var(--text-body); text-decoration: underline; text-decoration-thickness: var(--line-thin); text-underline-offset: 3px;
  cursor: pointer; transition: color var(--dur-fast) var(--ease-out);
}
.ro-act:hover { color: var(--text-primary); }
.ro-field {
  flex: 1 1 14em; min-width: 0; max-width: 100%; height: 24px; margin: 0; padding: 0 var(--space-2);
  border: var(--line-thin) solid var(--border-strong); border-radius: var(--radius-xs); background: var(--bg-canvas);
  font: var(--type-mono-sm); color: var(--text-primary);
}

/* ---------- Nearest to you: a button per event, the city over its title, then the distance over the flight, then the date
   over its year. The selected event's row is marked as in the places list, with the same inset focus ring, because the
   list scrolls when the window is short (events-dashboard.js cuts it to whole rows and counts the rest under it). ---------- */
.panel-near { display: flex; flex-direction: column; }
.panel-near > :not(.near-list) { flex: none; }
.near-list {
  position: relative; flex: 0 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none;
  list-style: none; margin: 0; padding: 0; border-bottom: var(--line-thin) solid var(--border-hairline);
}
.near-list::-webkit-scrollbar { display: none; }
.near-list[hidden] { display: none; }
.nr-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; grid-template-rows: auto auto; column-gap: var(--space-3); row-gap: 1px; align-items: baseline;
  width: 100%; padding: 6px var(--space-2); border: 0; border-top: var(--line-thin) solid var(--border-hairline); border-radius: 0;
  background: transparent; color: var(--text-body); font: inherit; text-align: left; cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out);
}
.near-list li:first-child .nr-row { border-top-color: transparent; }
.nr-row:hover { background: var(--surface-accent-subtle); }
.nr-row[aria-pressed="true"] { background: var(--surface-accent-subtle); box-shadow: inset var(--line-thin) 0 0 var(--accent); }
.nr-row:focus-visible, .nr-row[aria-pressed="true"]:focus-visible { box-shadow: inset 0 0 0 2px var(--bg-canvas), inset 0 0 0 3.5px var(--border-focus); }
.nr-city { grid-column: 1; grid-row: 1; min-width: 0; font: var(--type-body-sm); line-height: 1.35; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nr-title { grid-column: 1; grid-row: 2; min-width: 0; font: var(--type-caption); line-height: 1.35; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nr-km, .nr-date { grid-row: 1; font: var(--type-mono-sm); line-height: 1.35; color: var(--text-primary); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.nr-flight, .nr-year { grid-row: 2; font: var(--weight-regular) var(--text-2xs)/1.35 var(--font-mono); color: var(--text-secondary); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.nr-km, .nr-flight { grid-column: 2; }
.nr-date, .nr-year { grid-column: 3; }
.nr-row[aria-pressed="true"] .nr-title, .nr-row[aria-pressed="true"] .nr-flight, .nr-row[aria-pressed="true"] .nr-year,
.nr-row:hover .nr-title, .nr-row:hover .nr-flight, .nr-row:hover .nr-year { color: var(--text-body); }
/* Same trip: an event on the same days in another city cannot be attended in full, so its relation is in primary ink. */
.nr-row.is-clash .nr-flight { color: var(--text-primary); }
/* The button in the panel's head that switches it between Nearest to you and Same trip. */
.panel-switch { margin-left: auto; flex: none; font: var(--type-caption); line-height: 1; color: var(--text-body); white-space: nowrap; }
.panel-switch[hidden] { display: none; }

.panel-readout[hidden] { display: none; }
.panel-readout { padding-bottom: var(--space-2); }

/* ---------- The region dialog: a modal in the top layer, inside the band so its dark tokens apply ----------
   Anchored near the top rather than centred, so the field stays put while the matches below it come and go and a phone's
   keyboard leaves it in view. The band's surface on a strong hairline, no shadow; the backdrop dims the page. */
.region-dialog {
  --region-top: min(12vh, 96px);
  width: min(440px, calc(100vw - 2 * var(--space-4))); max-width: none; max-height: calc(100dvh - var(--region-top) - var(--space-4));
  margin: var(--region-top) auto auto; padding: var(--space-4) var(--space-6) var(--space-6); overflow: auto; overscroll-behavior: contain;
  background: var(--bg-surface); color: var(--text-body);
  border: var(--line-thin) solid var(--border-strong); border-radius: var(--radius-lg);
}
.region-dialog::backdrop { background: color-mix(in srgb, var(--bg-canvas) 72%, transparent); }
.region-dialog .panel-head h2 { line-height: var(--leading-snug); }
.region-close { margin-left: auto; }
.region-lede { margin: var(--space-3) 0 0; font: var(--type-body-sm); color: var(--text-body); text-wrap: pretty; }
.region-field { display: grid; gap: var(--space-2); margin-top: var(--space-5); }
.region-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); }
.region-label { font: var(--type-label); color: var(--text-primary); }
.region-count { font: var(--type-mono-sm); color: var(--text-secondary); white-space: nowrap; }
.region-input {
  width: 100%; height: var(--control-h-md); margin: 0; padding: 0 var(--space-3);
  border: var(--line-thin) solid var(--border-strong); border-radius: var(--radius-xs); background: var(--bg-canvas);
  font: var(--weight-regular) var(--text-md)/1 var(--font-body); color: var(--text-primary); caret-color: var(--text-primary);
}
.region-input:focus-visible { border-color: var(--border-focus); }
/* The matches: a city on a hairline, its state and country quieter beside it or, when narrow, under it. The option the
   arrow keys are on (aria-selected; focus stays in the field) carries the inset ring the list rows use. */
.region-options { list-style: none; margin: 0; padding: 0; }
.region-options[hidden] { display: none; }
.region-opt {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px var(--space-3); padding: var(--space-2);
  border-top: var(--line-thin) solid var(--border-hairline); cursor: pointer; transition: background var(--dur-fast) var(--ease-out);
}
.region-opt:first-child { border-top-color: transparent; }
.region-opt:hover { background: var(--surface-accent-subtle); }
.region-opt[aria-selected="true"] { background: var(--surface-accent-subtle); box-shadow: inset 0 0 0 2px var(--bg-surface), inset 0 0 0 3.5px var(--border-focus); }
.region-city { font: var(--weight-regular) var(--text-md)/1.3 var(--font-body); color: var(--text-primary); }
.region-where { font: var(--type-caption); color: var(--text-secondary); }
/* The highlight takes the secondary grey under 4.5:1; the state and country line, which tells two Portlands apart, lifts. */
.region-opt:hover .region-where, .region-opt[aria-selected="true"] .region-where { color: var(--text-body); }
.region-note { margin: 0; font: var(--type-caption); color: var(--text-secondary); text-wrap: pretty; }
.region-note:empty { display: none; }
.region-actions {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-3) var(--space-5);
  margin-top: var(--space-5); padding-top: var(--space-4); border-top: var(--line-thin) solid var(--border-hairline);
}
.region-actions .text-action[hidden], .region-credit[hidden] { display: none; }
.region-credit { margin: 0 0 0 auto; font: var(--type-caption); color: var(--text-secondary); }
.region-credit a { color: var(--text-secondary); text-decoration: underline; text-decoration-thickness: var(--line-thin); text-underline-offset: 2px; }
.region-credit a:hover { color: var(--text-primary); }

/* ---------- One screen: the nav and the band are the window; the site footer's legal line moves into the status row ---------- */
.events-page .footer { display: none; }

/* ---------- Narrow, short or zoomed windows: the same parts stacked, and the page scrolls (WCAG 1.4.10) ---------- */
/* Under the globe the two columns sit side by side, the search by place and its readout first, then the right column, so
   the reading order is the one-screen order; on phones they are one column (below). */
@media (max-width: 1279px), (max-height: 639px) {
  .dash { --dash-ruler: 0px; --dash-edge: var(--space-8); height: auto; }
  .dash-ruler { display: none; }
  .dash-main { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto auto; gap: var(--space-8) var(--space-10); }
  .dash-stage { grid-column: 1 / -1; grid-row: 1; height: min(56svh, 520px); min-height: 280px; }
  .dash-col { grid-row: 2; pointer-events: auto; }
  .dash-col-l, .dash-col-l.has-event, .dash-col-l.is-tight { grid-column: 1; grid-template-rows: auto auto; }
  .dash-col-r { grid-column: 2; }
  .dash-col-r > .panel { overflow: visible; }
  .panel-places { display: block; }
  .index-scroll::before, .index-scroll::after { display: none; }
  .index-list, .near-list { overflow: visible; }
  .index-more { display: none; }
  .strip-head { flex-wrap: wrap; height: auto; min-height: 20px; row-gap: var(--space-1); }
  .strip-head .chips { flex-basis: 100%; margin-left: 0; }
  .status-legal, .status-copy { display: none; }
  .events-page .footer { display: grid; margin-top: 0; }
}

/* ---------- Phones ---------- */
@media (max-width: 719px) {
  .dash { --dash-edge: var(--space-5); }
  .ticker { gap: var(--space-1) var(--space-4); }
  .readings { gap: var(--space-1) var(--space-4); }
  /* The strip's line is the only visible name of a bar, so here it wraps under the heading instead of being cut; two
     lines are kept for it, so moving along the bars rarely changes the strip's height (WCAG 1.4.10). */
  .strip-line { flex-basis: 100%; min-height: 40px; white-space: normal; overflow: visible; }
  .dash-main { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto; }
  .dash-col-r { grid-column: 1; grid-row: 3; }
  .dash-stage { height: min(44svh, 400px); min-height: 240px; }
  .status-pause { margin-left: 0; }
  .region-dialog { padding: var(--space-4) var(--space-5) var(--space-5); }
  .region-input { font-size: 16px; } /* 16px stops iOS zooming into the field, as on the list sign-up */
}
@media (max-width: 359px) {
  .ix-row { grid-template-columns: 20px 44px minmax(0, 1fr); column-gap: var(--space-2); }
  .panel-tag, .ix-place { white-space: normal; overflow: visible; }
}
