/* Waypoint, on Mainframe (citadl-platform Docs/Architecture/Mainframe-Design-Language.md).
 * Every colour, face, size, space and radius is a --citadl-* token from the copied
 * tokens.css (web/SOURCES.md), never a literal here. Dark is the reference: near-black
 * ground, a panel one step lighter, one-pixel hairlines, square corners, no shadow, no
 * gradient. Amber is a marker only: the eyebrow, the focus ring, the primary button and
 * the selected route's edge. Geist for every word, label, button, time and date (labels and
 * buttons in spaced capitals); Geist Mono only for data: the large figures and stop numbers.
 *
 * The one exception is the route colours. They are data, not chrome: each van's line,
 * swatch and stop dots share a colour from the plan, so a person can tell vans apart. */
@font-face { font-family: Geist; src: url("fonts/Geist-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("fonts/GeistMono-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --bg: hsl(var(--citadl-background));
  --panel: hsl(var(--citadl-muted));
  --ink: hsl(var(--citadl-foreground));
  /* Secondary text, half way from Mainframe's muted grey to the foreground: the plain muted
   * grey was too faint to read on the panel at label size. */
  --muted: color-mix(in srgb, hsl(var(--citadl-muted-foreground)) 50%, hsl(var(--citadl-foreground)));
  --line: hsl(var(--citadl-border));
  --accent: hsl(var(--citadl-accent));
  --ok: hsl(var(--citadl-ok));
  --warn: hsl(var(--citadl-warn));
  --bad: hsl(var(--citadl-destructive));
  --r: var(--citadl-radius-control);
  --hair: var(--citadl-hairline) solid var(--line);
  --header: 40px;
  --aside: 400px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink);
       font: 400 var(--citadl-font-size-body)/1.5 var(--citadl-font-sans); -webkit-font-smoothing: antialiased; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
p { margin: 0; }

/* Labels in spaced capitals: field names, captions, eyebrows. */
.field, .stat > span, th, #input-tabs button { font: 500 var(--citadl-font-size-label)/1.5 var(--citadl-font-sans);
  letter-spacing: var(--citadl-letter-spacing-label); text-transform: uppercase; color: var(--muted); }
h2 { margin: 0 0 var(--citadl-space-stack); color: var(--accent); font: 600 var(--citadl-font-size-label)/1.5 var(--citadl-font-sans);
     letter-spacing: var(--citadl-letter-spacing-label); text-transform: uppercase; }

/* Header: one thin bar of controls on the ground colour. */
header { display: flex; flex-wrap: wrap; align-items: center; gap: var(--citadl-space-tight) var(--citadl-space-section);
         min-height: var(--header); padding: var(--citadl-space-tight) var(--citadl-space-panel); background: var(--bg); border-bottom: var(--hair); }
.field { display: flex; align-items: center; gap: var(--citadl-space-cell); }
#status { flex: 1 1 200px; min-width: 0; color: var(--muted); }
#status button { margin-left: var(--citadl-space-tight); }

input, select { font: 400 var(--citadl-font-size-body)/1.4 var(--citadl-font-sans); color: var(--ink); background: var(--panel);
                border: var(--hair); border-radius: var(--r); padding: 3px var(--citadl-space-cell); text-transform: none; letter-spacing: 0; }
button { font: 600 var(--citadl-font-size-label)/1.4 var(--citadl-font-sans); letter-spacing: var(--citadl-letter-spacing-button);
         text-transform: uppercase; color: var(--ink); background: none; border: var(--hair); border-radius: var(--r);
         padding: 6px var(--citadl-space-stack); cursor: pointer; }
button:hover:not(:disabled) { border-color: var(--muted); }
button:disabled { color: var(--muted); cursor: default; }
button.primary { background: var(--accent); border-color: var(--accent); color: hsl(var(--citadl-background)); }
button.primary:disabled { opacity: 0.6; color: hsl(var(--citadl-background)); }
button.wide { width: 100%; padding: 10px; }
/* One language for what can be pressed. A button has an edge (filled amber for the one
 * primary action); a text action is amber and underlines under the pointer; a card or bar
 * that opens something carries .tap: an edge, a chevron, a hover. Information has none. */
button.link { border: 0; padding: 0; color: var(--accent); }
button.link:hover:not(:disabled), .atlas:hover, #answer a:hover { text-decoration: underline; text-underline-offset: 3px; }
button.link:disabled { color: var(--muted); }
.tap { position: relative; cursor: pointer; }
.route.tap { padding-right: 36px; }
.route.tap::after { content: "›"; position: absolute; top: 50%; right: var(--citadl-space-stack); transform: translateY(-50%);
                    font: 400 var(--citadl-font-size-title)/1 var(--citadl-font-sans); color: var(--muted); }
.route.tap:hover { border-color: var(--accent); }
.route.tap:hover::after { color: var(--accent); }
.bar.tap:hover .band, .bar.tap:focus-visible .band { outline: var(--citadl-hairline) solid var(--ink); outline-offset: 2px; }
.atlas::after, #answer a::after { content: "\00a0↗"; }

/* Map on the left, the panel on the right; stacked on a narrow window. */
main { display: grid; grid-template-columns: minmax(0, 1fr) var(--aside); height: calc(100vh - var(--header)); }
#map-box { position: relative; min-height: 320px; }
#map { position: absolute; inset: 0; background: var(--bg); }
/* The product is Waypoint: its name leads the header. CITADL's lockup is artwork (Mainframe
 * rule 6) and secondary, small at the foot of the panel. The map is credited in text, "CITADL Atlas". */
.lockup, .atlas { display: inline-flex; align-items: center; color: var(--ink); text-decoration: none;
                  font: 600 var(--citadl-font-size-title)/1 var(--citadl-font-display);
                  letter-spacing: var(--citadl-letter-spacing-display); text-transform: uppercase; }
.lockup { margin-right: var(--citadl-space-panel); font-size: var(--citadl-font-size-title); text-transform: none; }
aside footer { padding-top: var(--citadl-space-section); opacity: 0.6; }
aside footer img { display: block; }
.atlas { position: absolute; left: var(--citadl-space-panel); bottom: var(--citadl-space-panel); gap: var(--citadl-space-tight);
         font-size: var(--citadl-font-size-body); color: var(--muted); }
.atlas:hover { color: var(--ink); }
/* Map | Day plan: a flat two-button switch in the map's top-left corner. */
#map-top { position: absolute; z-index: 4; top: var(--citadl-space-panel); left: var(--citadl-space-panel); display: flex;
           align-items: center; gap: var(--citadl-space-cell); }
#views { display: flex; background: var(--panel); border: var(--hair); border-radius: var(--r); }
#map-box.day #map-info { display: none; }
#views button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 6px var(--citadl-space-stack) 4px; color: var(--muted); }
#views button + button { border-left: var(--hair); }
#views button[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--accent); }
#map-box.day #map, #map-box.day .atlas { visibility: hidden; }
#map-box:not(.day) #day { display: none; }

/* Road closures: one button in the map's top-right corner; while drawing, the hint and
 * the two choices. A closure is the destructive red at low strength, hatched, on the map. */
#closing { position: absolute; z-index: 3; top: var(--citadl-space-panel); right: var(--citadl-space-panel);
           display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--citadl-space-cell);
           max-width: calc(100% - 2 * var(--citadl-space-panel)); }
#closing button:not(.primary) { background: var(--panel); }
#close-hint { flex-basis: 100%; padding: 6px var(--citadl-space-stack); background: var(--panel); border: var(--hair);
              border-left: 2px solid var(--bad); text-align: left; }
#map-box.day #closing { display: none; }
#map-box.drawing .maplibregl-canvas-container { cursor: crosshair; }
#map-box.drawing .stop-dot, #map-box.drawing .closure-x { pointer-events: none; }
.closure-x { width: 24px; height: 24px; padding: 0; border: var(--citadl-hairline) solid var(--bad); background: var(--panel);
             color: var(--bad); font: 600 var(--citadl-font-size-body-large)/1 var(--citadl-font-sans); }
#verdict .change { font-weight: 600; }
#verdict .change::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: var(--citadl-space-cell);
                           background: var(--bad); }

/* The day plan: a row per van on one clock, from the first van out to the last one back.
 * A bar is one run, commissary to commissary, in the van's colour; a notch on it is a
 * stop; the name over it is the driver; a diamond in the gap is a new driver taking the van. */
#day { position: relative; z-index: 2; height: 100%; overflow: auto; background: var(--bg);
       padding: calc(var(--citadl-space-panel) + 48px) var(--citadl-space-panel) var(--citadl-space-panel); }
#day-legend { margin-bottom: var(--citadl-space-stack); }
#day-legend .narrow { display: none; }
.legend-diamond { display: inline-block; width: 8px; height: 8px; margin: 0 2px; background: var(--ink); transform: rotate(45deg); }
#day-grid { min-width: 720px; }
.day-row { display: grid; grid-template-columns: 84px minmax(0, 1fr); border-bottom: var(--hair); }
.van-label { position: sticky; left: 0; z-index: 1; display: flex; align-items: flex-end; gap: var(--citadl-space-cell);
             padding: 0 var(--citadl-space-cell) 10px 0; background: var(--bg); font-weight: 600; }
.day-row .track { position: relative; height: 52px; }
.day-row.axis .track { height: 40px; }
.hour { position: absolute; top: 0; bottom: 0; width: var(--citadl-hairline); background: var(--line); }
.tick, .weekday { position: absolute; bottom: 4px; padding-left: 4px; white-space: nowrap; color: var(--muted);
                  font-size: var(--citadl-font-size-label); }
.weekday { bottom: auto; top: 0; color: var(--ink); font-weight: 600; }
.track .none { position: absolute; left: 0; bottom: 10px; color: var(--muted); }
.bar { position: absolute; top: 6px; bottom: 6px; padding: 0; border: 0; border-radius: 0; background: none;
       text-align: left; text-transform: none; letter-spacing: 0; font-weight: 500; }
/* A route card and a day-plan bar are buttons that carry names and sentences: Geist, not
 * the mono capitals of an action button. */
.route, .bar { font: 400 var(--citadl-font-size-body)/1.4 var(--citadl-font-sans); }
.bar .who { position: absolute; top: -2px; left: 0; white-space: nowrap; color: var(--ink); }
.bar:hover .who, .bar:focus-visible .who { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.band { position: absolute; left: 0; right: 0; bottom: 0; height: 14px; border-radius: var(--r); }
.bar.selected .band { outline: 2px solid var(--accent); outline-offset: 2px; }
.notch { position: absolute; top: 3px; bottom: 3px; width: 2px; margin-left: -1px; background: var(--bg); }
.wait { position: absolute; bottom: 12px; border-top: var(--citadl-hairline) dashed var(--muted); }
.handoff { position: absolute; bottom: 9px; width: 10px; height: 10px; margin-left: -5px; background: var(--ink); transform: rotate(45deg); }

aside { overflow-y: auto; padding: 0 var(--citadl-space-panel) var(--citadl-space-section); background: var(--panel); border-left: var(--hair); }
aside > section { padding: var(--citadl-space-section) 0; border-bottom: var(--hair); }
aside > section:last-child { border-bottom: 0; }

/* The verdict against current routes, first in the panel: one line in large type on the
 * ground colour, an amber edge as its marker. */
#verdict { display: grid; gap: var(--citadl-space-tight); margin: var(--citadl-space-section) 0 0;
           padding: var(--citadl-space-section) var(--citadl-space-panel); background: var(--bg);
           border: var(--hair); border-left: 2px solid var(--accent); border-radius: var(--r); }
#verdict .big { font: 500 calc(var(--citadl-font-size-display) * 2.2)/1 var(--citadl-font-mono);
                letter-spacing: var(--citadl-letter-spacing-display); color: var(--ok); }
#verdict.worse .big { color: var(--warn); }
#verdict .headline { font-size: var(--citadl-font-size-body-large); font-weight: 600; line-height: 1.3; }
#verdict .meta:empty { display: none; }

/* Conditions: the weather, typical traffic and planned road closures, a line each. On the
 * map a planned closure is amber with its name (dashed while offered), never the red of a
 * closure drawn by hand. */
#conditions ul { display: grid; gap: var(--citadl-space-tight); margin: 0; padding: 0; list-style: none; }
#conditions .strong { font-weight: 600; }
#conditions .planned { padding-left: var(--citadl-space-stack); font-size: var(--citadl-font-size-label); }
.planned-name { padding: 1px var(--citadl-space-tight); background: var(--bg); border: var(--citadl-hairline) solid var(--accent);
                color: var(--ink); font: 400 var(--citadl-font-size-label)/1.3 var(--citadl-font-sans); white-space: nowrap;
                pointer-events: none; }

/* Orders: the counts, the input to look at or keep, and Re-plan with whether it is needed. */
#input-line { margin-bottom: var(--citadl-space-stack); font-size: var(--citadl-font-size-body-large); }
.actions { display: flex; flex-wrap: wrap; gap: var(--citadl-space-cell); }
#input-line + .actions { margin-bottom: var(--citadl-space-panel); }
#input-line + .actions button { text-transform: none; letter-spacing: 0; font-weight: 500; }
.replan { display: flex; align-items: center; gap: var(--citadl-space-stack); margin-bottom: var(--citadl-space-cell); }
#plan-state { flex: 1 1 auto; }
#plan-state b { font-weight: 600; color: var(--ok); }
#plan-state.stale b { color: var(--warn); }
#plan { flex: none; }
#progress { min-height: 1.5em; margin-top: var(--citadl-space-cell); color: var(--muted); }

/* The run's figures: large display numerals, a label in spaced capitals beneath. */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--citadl-space-cell); }
.stat { padding: var(--citadl-space-cell) 0; border-top: var(--hair); }  /* a figure, not a card: no box */
.stat b { display: block; font: 500 var(--citadl-font-size-display)/1.05 var(--citadl-font-mono); letter-spacing: var(--citadl-letter-spacing-display); font-variant-numeric: tabular-nums; }
.stat b.saved { color: var(--ok); }
.versus { display: grid; gap: var(--citadl-space-tight); margin-top: var(--citadl-space-stack); }
.versus p { color: var(--muted); }
.stat > span { display: block; margin-top: var(--citadl-space-cell); line-height: 1.4; }

/* Routes: a card per van and cycle. The selected card keeps an amber edge. */
#vans { display: grid; gap: var(--citadl-space-cell); }
.route { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 6px var(--citadl-space-cell);
         width: 100%; padding: var(--citadl-space-stack); text-align: left; text-transform: none; letter-spacing: 0;
         font-weight: 400; background: var(--bg); }
.route.selected { border-left: 2px solid var(--accent); padding-left: 11px; }
.route b, #drawer-head b { grid-column: 2 / -1; font-size: var(--citadl-font-size-body-large); font-weight: 600; }
.route .meta, #drawer-head .meta { grid-column: 2 / -1; }
.meta { color: var(--muted); }
.load { grid-column: 2; height: 4px; background: var(--line); border-radius: var(--r); overflow: hidden; }
.load span { display: block; height: 100%; background: var(--ok); }
.load.warn span { background: var(--warn); }
.load.bad span { background: var(--bad); }
.full { color: var(--muted); }

/* A route's day as a timeline: one line in the driver's colour (--c) from top to bottom, a
 * place on it per waypoint (hollow until the van reaches it while the day plays), each drive
 * written on the line between two places, and the van's marker riding the line. */
#back { margin-bottom: var(--citadl-space-stack); }
#drawer .actions button { flex: 1 1 auto; padding-inline: var(--citadl-space-cell); }
#drawer-head { display: grid; grid-template-columns: 10px minmax(0, 1fr); align-items: center; gap: 2px var(--citadl-space-cell);
               margin-bottom: var(--citadl-space-stack); }
#timeline { position: relative; margin-top: var(--citadl-space-panel); padding-top: var(--citadl-space-stack); border-top: var(--hair);
            --rail: calc(72px + var(--citadl-space-cell) + 11px); }
#tl-rail, #tl-done { position: absolute; left: var(--rail); width: 2px; }
#tl-rail { background: color-mix(in srgb, var(--c) 30%, transparent); }
#tl-done { background: var(--c); }
#tl-van { position: absolute; z-index: 2; left: calc(var(--rail) - 11px); width: 24px; height: 24px; margin-top: -12px; pointer-events: none;
          border: 6px solid color-mix(in srgb, var(--c) 40%, transparent); border-radius: 50%; background: var(--c); background-clip: padding-box; }
#tl-van::after { content: ""; display: block; width: 100%; height: 100%; border: 2px solid var(--ink); border-radius: 50%; }
#stops { margin: 0; padding: 0; list-style: none; }
#stops li { display: grid; grid-template-columns: 72px 24px minmax(0, 1fr) auto; align-items: start; gap: 0 var(--citadl-space-cell); }
#stops .node { padding: var(--citadl-space-cell) 0; cursor: pointer; }
#stops .time { grid-row: 1; text-align: right; color: var(--ink); font-size: var(--citadl-font-size-body-large); font-weight: 600; white-space: nowrap; }
#stops .dot { position: relative; z-index: 1; grid-column: 2; grid-row: 1; justify-self: center; width: 20px; height: 20px;
              border: 2px solid var(--c); border-radius: 50%; background: var(--panel); color: var(--muted); text-align: center;
              font: 500 var(--citadl-font-size-label)/16px var(--citadl-font-mono); }
#stops .past .dot { background: var(--c); color: var(--ink); }
#stops .depot .dot { width: 14px; height: 14px; margin-top: 3px; border-radius: 0; }  /* the commissary: square */
#stops .who { grid-column: 3; grid-row: 1; font-size: var(--citadl-font-size-body-large); }
#stops .leg { min-height: 28px; align-items: center; color: var(--muted); }
#stops .leg span { grid-column: 3 / -1; }
#stops .check, #stops .detail { grid-column: 3 / -1; color: var(--muted); }
/* "Why here?" on each stop, and its answer opened under the stop. */
#stops .why-ask { grid-column: 4; grid-row: 1; align-self: start; padding-top: 2px; white-space: nowrap; }
#stops .why-ask[aria-expanded="true"] { color: var(--ink); }
#stops .why { grid-column: 3 / -1; margin-top: var(--citadl-space-cell); padding: var(--citadl-space-cell) var(--citadl-space-stack);
              background: var(--bg); border-left: 2px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; cursor: auto; }
#stops .why p + p { margin-top: var(--citadl-space-tight); }
#stops .why button { margin-top: var(--citadl-space-cell); }
#why-hint { margin-top: var(--citadl-space-stack); color: var(--muted); }
#why-hint b { font: 500 var(--citadl-font-size-label)/1 var(--citadl-font-sans); letter-spacing: var(--citadl-letter-spacing-button);
              text-transform: uppercase; color: var(--ink); }
#stops li.depot { cursor: default; }
#stops li.depot .who { font-weight: 600; }
#drawer-head .head-facts { grid-column: 1 / -1; display: grid; gap: var(--citadl-space-tight); margin-top: var(--citadl-space-cell); }
#drawer-head .head-facts p { margin: 0; }
.difficulty { color: var(--muted); }
.difficulty .figure { font: 500 var(--citadl-font-size-title)/1 var(--citadl-font-mono); color: var(--ink); }
.route .driver, #drawer-head .driver { grid-column: 2 / -1; }
#stops .check.late { color: var(--warn); }
#stops .stop:hover .who, #stops .stop:focus .who { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
#answer { margin-top: var(--citadl-space-stack); padding: var(--citadl-space-stack); white-space: pre-wrap; overflow-wrap: anywhere;
          background: var(--bg); border: var(--hair); border-radius: var(--r); }
#answer button { margin-top: var(--citadl-space-stack); }
#answer a { color: var(--ink); }

/* The run's input in a dialog: tabs, then a table, words in Sans and figures in Mono. */
#input { width: min(960px, calc(100vw - 2 * var(--citadl-space-panel))); max-height: calc(100dvh - 2 * var(--citadl-space-panel)); }
#input[open] { display: flex; flex-direction: column; gap: var(--citadl-space-stack); }
#input h2 { margin: 0; }
#input-tabs { display: flex; flex-wrap: wrap; gap: var(--citadl-space-cell); border-bottom: var(--hair); }
#input-tabs button { border-color: transparent; border-radius: 0; padding: 6px var(--citadl-space-cell); }
#input-tabs button[aria-selected="true"] { color: var(--ink); border-bottom: 2px solid var(--accent); }
#input-table { flex: 1 1 auto; min-height: 0; overflow: auto; background: var(--bg); border: var(--hair); border-radius: var(--r); }
#input form { justify-items: end; }
table { width: 100%; border-collapse: collapse; }
caption { caption-side: bottom; padding: var(--citadl-space-cell); color: var(--muted); text-align: left; }
th, td { padding: var(--citadl-space-tight) var(--citadl-space-cell); border-bottom: var(--hair); text-align: left; white-space: nowrap; }
th { position: sticky; top: 0; background: var(--panel); font-weight: 600; }

#unassigned { margin: 0; padding: 0; list-style: none; }
#unassigned li { padding: var(--citadl-space-cell) 0; border-top: var(--hair); color: var(--warn); font-size: var(--citadl-font-size-body); }
#unassigned li:first-child { border-top: 0; }
/* One line on top in the colour of the worst thing: an order left off, a warning, or none. */
#unassigned li.head { padding-top: 0; font-weight: 600; }
#unassigned .head.ok { color: var(--ok); }
#unassigned .head.bad { color: var(--bad); }
/* A van's warnings under its name once: the sentences in ink, what to do beneath in muted. */
#unassigned li.group b { display: block; margin-bottom: var(--citadl-space-tight); font-weight: 600; }
#unassigned li.group ul { margin: 0; padding-left: var(--citadl-space-stack); color: var(--ink); }
#unassigned li.group li { padding: var(--citadl-space-tight) 0; border: 0; color: var(--ink); }
#unassigned .advice { margin: var(--citadl-space-tight) 0 0; color: var(--muted); }
/* Fixes the solver checked: a row each, the change and its measured effect, Apply on the right. */
#fixes > p { margin-top: var(--citadl-space-cell); }
.fix-card { margin-top: var(--citadl-space-stack); border-top: var(--hair); }
.fix-card h3 { margin: var(--citadl-space-stack) 0 var(--citadl-space-cell); font: 500 var(--citadl-font-size-label)/1.5 var(--citadl-font-sans);
               letter-spacing: var(--citadl-letter-spacing-label); text-transform: uppercase; color: var(--muted); }
.fix { display: flex; flex-wrap: wrap; align-items: center; gap: var(--citadl-space-tight) var(--citadl-space-stack);
       padding: var(--citadl-space-cell) var(--citadl-space-cell) var(--citadl-space-cell) var(--citadl-space-stack);
       margin-top: var(--citadl-space-cell); border-top: var(--hair); }
.fix b { font-weight: 600; }
.fix .effect { flex: 1 1 auto; color: var(--muted); }
.fix button { margin-left: auto; }
.fix .effect.ok { color: var(--ok); }
/* Other ways to run the day: Compare, then this plan and each option in a column, a figure
 * per row in mono, the best in each row in the ok colour, Use this under each option. */
#ways > p + button { margin-top: var(--citadl-space-stack); }
#ways > p:not(:first-child) { margin-top: var(--citadl-space-stack); }
.ways { display: grid; grid-template-columns: minmax(0, 1.1fr) repeat(var(--ways), minmax(0, 1fr)); align-items: end;
        gap: var(--citadl-space-cell) var(--citadl-space-stack); }
.way-head { display: grid; align-content: start; gap: var(--citadl-space-tight); align-self: stretch; padding-bottom: var(--citadl-space-cell); }
.way-head b { font-weight: 600; line-height: 1.3; }
.way-head .meta { font-size: var(--citadl-font-size-label); line-height: 1.35; }
.way-name { padding-top: var(--citadl-space-cell); border-top: var(--hair); color: var(--muted); line-height: 1.3; }
.way-fig { padding-top: var(--citadl-space-cell); border-top: var(--hair); font: 500 var(--citadl-font-size-body-large)/1.3 var(--citadl-font-mono);
           font-variant-numeric: tabular-nums; }
.way-fig.best { color: var(--ok); }
.ways button { margin-top: var(--citadl-space-cell); padding: 6px var(--citadl-space-cell); }
/* Figures inside words, times and dates stay in Geist, in even-width digits so columns line
 * up; Geist Mono is kept for data itself: the large figures and the stop numbers on the map. */
.num { font-variant-numeric: tabular-nums; }

/* Stop dots on the map: the van's colour, the stop number in mono. */
.stop-dot { width: 20px; height: 20px; border-radius: 50%; border: var(--citadl-hairline) solid var(--ink); color: var(--ink); background: var(--c);
            font: var(--citadl-font-size-label)/18px var(--citadl-font-mono); text-align: center; cursor: pointer; }
.stop-dot.depot { width: 24px; height: 24px; line-height: 22px; background: var(--ink); color: var(--bg); border-color: var(--accent); }

dialog { background: var(--panel); color: var(--ink); border: var(--hair); border-radius: var(--r); padding: var(--citadl-space-section); }
dialog::backdrop { background: hsl(var(--citadl-background) / 0.7); }
dialog form { display: grid; gap: var(--citadl-space-stack); }
dialog p { margin: 0; }

/* Map controls and credit: flat groups with a hairline, Sans in muted. */
.maplibregl-ctrl-group { background: var(--panel); border: var(--hair); border-radius: var(--r); box-shadow: none !important; }
.maplibregl-ctrl-group button { width: 40px; height: 40px; border: 0; border-radius: 0; padding: 0; }
.maplibregl-ctrl-group button + button { border-top: var(--hair); }
.maplibregl-ctrl-group button .maplibregl-ctrl-icon { filter: invert(0.9); }
.maplibregl-ctrl button.three-d { font: 500 var(--citadl-font-size-label)/1 var(--citadl-font-sans);
                                  letter-spacing: var(--citadl-letter-spacing-label); color: var(--muted); }
.maplibregl-ctrl button.three-d[aria-pressed="true"] { color: var(--accent); }
.maplibregl-ctrl.maplibregl-ctrl-attrib { background: color-mix(in srgb, var(--panel) 82%, transparent); color: var(--muted);
                                         font: var(--citadl-font-size-label)/1.5 var(--citadl-font-sans); }
.maplibregl-ctrl-attrib a { color: var(--muted); }

@media (prefers-reduced-motion: no-preference) {
  button, #stops li { transition: color var(--citadl-duration-fast), border-color var(--citadl-duration-fast); }
}
@media (max-width: 800px) {
  main { grid-template-columns: minmax(0, 1fr); height: auto; }
  #map-box { height: 55vh; }
  #map-box.day { height: auto; }
  #closing { top: calc(var(--citadl-space-panel) + 40px); left: var(--citadl-space-panel); justify-content: flex-start; }
  #day-legend .narrow { display: inline; }
  #day { height: auto; overflow-y: visible; }
  header { column-gap: var(--citadl-space-panel); }
  aside { border-left: 0; border-top: var(--hair); }
  #stops .why { grid-column: 1 / -1; }
}

/* Pictures: each van is our drawing in its route colour, each driver a circle with their
 * initials, until the workspace gives a photo of its own (which then fills the same box). */
.pic { display: inline-grid; place-items: center; flex: none; overflow: hidden; color: var(--ink); }
.pic svg, .pic img { display: block; width: 100%; height: 100%; }
.pic img { object-fit: cover; }
.van-pic { width: 40px; aspect-ratio: 5 / 3; }
.van-pic.big { width: 128px; }
.van-pic svg * { vector-effect: non-scaling-stroke; stroke-width: 1.25px; }
.van-pic.big svg * { stroke-width: 1.75px; }
.avatar { width: 22px; height: 22px; border-radius: 50%; font: 600 var(--citadl-font-size-label)/1 var(--citadl-font-sans);
          letter-spacing: 0; }
.avatar.small { width: 16px; height: 16px; font-size: 8px; }
.avatar.big { width: 40px; height: 40px; font-size: var(--citadl-font-size-body); }
.route { grid-template-columns: 40px minmax(0, 1fr) auto; }
.route .van-pic { grid-row: 1 / span 3; align-self: start; }
.driver, .head-driver, .bar .who { display: inline-flex; align-items: center; gap: 6px; }
.day-row { grid-template-columns: 112px minmax(0, 1fr); }
.van-label { align-items: center; padding-bottom: 0; }
#drawer-head { grid-template-columns: 128px minmax(0, 1fr); gap: 4px var(--citadl-space-stack); }
#drawer-head .head-van { grid-row: 1 / span 3; display: grid; gap: var(--citadl-space-tight); justify-items: start; }
#drawer-head .head-driver { display: flex; grid-column: 2; gap: var(--citadl-space-cell); font-weight: 500; }
#drawer-head .head-driver div { display: grid; justify-items: start; gap: 2px; }
#photo { width: min(360px, calc(100vw - 32px)); }
#photo-preview .van-pic.big { width: 100%; }
#photo-preview .avatar.big { width: 96px; height: 96px; font-size: var(--citadl-font-size-title); }
#photo .field { display: grid; gap: var(--citadl-space-cell); }
#photo input[type="file"] { width: 100%; }

/* Play the day. The map and the vans moving on it are the show; the chrome is a slim
 * transport bar along the bottom and four figures in the top-left corner. Amber marks only
 * the play button and the scrubber's thumb. A van is a dot in its route colour inside a
 * translucent ring of the same colour (a ring, not a shadow). A stop not yet reached is an
 * outline, dim; delivered, it fills with its van's colour. */
#play { position: absolute; z-index: 3; left: var(--citadl-space-panel); right: 72px; bottom: var(--citadl-space-panel);
        display: flex; align-items: center; gap: var(--citadl-space-stack); padding: var(--citadl-space-cell);
        background: color-mix(in srgb, var(--panel) 90%, transparent); border: var(--hair); border-radius: var(--r); }
#play-go { flex: none; width: 32px; height: 32px; padding: 0; background: var(--accent); border-color: var(--accent); }
#play-go::before { content: ""; display: block; width: 10px; height: 12px; margin: auto; background: var(--bg);
                   clip-path: polygon(0 0, 100% 50%, 0 100%); }
#play-go[aria-pressed="true"]::before { clip-path: polygon(0 0, 35% 0, 35% 100%, 65% 100%, 65% 0, 100% 0, 100% 100%, 0 100%); }
#play-time { flex: none; min-width: 10ch; white-space: nowrap; font-weight: 500; font-variant-numeric: tabular-nums; }
#play-at { flex: 1 1 auto; min-width: 0; height: 24px; margin: 0; padding: 0; background: none; border: 0;
           appearance: none; -webkit-appearance: none; cursor: pointer; }
#play-at::-webkit-slider-runnable-track { height: 2px; background: var(--line); }
#play-at::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; margin-top: -5px; border: 0; border-radius: 0; background: var(--accent); }
#play-at::-moz-range-track { height: 2px; background: var(--line); }
#play-at::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 0; background: var(--accent); }
#play-speed { flex: none; }
#live { position: absolute; z-index: 2; top: calc(var(--citadl-space-panel) + 56px); left: var(--citadl-space-panel);
        display: grid; gap: var(--citadl-space-panel); pointer-events: none;
        /* A quiet panel, so street names under the figures never collide with them when zoomed in. */
        padding: var(--citadl-space-stack) var(--citadl-space-panel); background: color-mix(in srgb, var(--panel) 88%, transparent); border: var(--hair); }
#live b { display: block; font: 500 var(--citadl-font-size-display)/1 var(--citadl-font-mono);
          letter-spacing: var(--citadl-letter-spacing-display); font-variant-numeric: tabular-nums; }
#live > div > span { display: block; margin-top: 2px; color: var(--muted); font-size: var(--citadl-font-size-body);
             font-variant-caps: all-small-caps; letter-spacing: var(--citadl-letter-spacing-label); }
#map-box.day #play, #map-box.day #live, #map-box.drawing #play { display: none; }
.atlas { bottom: calc(var(--citadl-space-panel) + 60px); }
.van-dot { z-index: 1; width: 34px; height: 34px; padding: 0; border: 9px solid color-mix(in srgb, var(--c) 35%, transparent);
           border-radius: 50%; background: var(--c); background-clip: padding-box; }
.van-dot::after { content: ""; display: block; width: 100%; height: 100%; border: 2px solid var(--ink); border-radius: 50%; }
.van-dot:hover:not(:disabled) { border-color: color-mix(in srgb, var(--c) 55%, transparent); }
.stop-dot.ahead { background: none; border-color: var(--c); color: var(--muted); opacity: 0.4; }
/* Following one driver: the others' stops all but gone, and a chip saying whose day it is. */
.stop-dot.away { filter: opacity(0.12); pointer-events: none; }  /* a filter: the map sets the marker's own opacity inline */
#following { position: absolute; z-index: 3; left: var(--citadl-space-panel); bottom: calc(var(--citadl-space-panel) + 60px);
             display: flex; align-items: center; gap: var(--citadl-space-stack); padding: var(--citadl-space-cell) var(--citadl-space-stack);
             background: var(--panel); border: var(--hair); border-left: 3px solid var(--c); font-weight: 500; }
#following[hidden], #map-box.day #following { display: none; }
#map-box:has(#following:not([hidden])) .atlas { display: none; }
.handoff-tag { padding: 2px var(--citadl-space-cell); background: var(--panel); border: var(--hair); border-left: 2px solid var(--ink);
               white-space: pre; font-weight: 500; pointer-events: none; }
#now-at { margin-bottom: var(--citadl-space-stack); padding: var(--citadl-space-cell) var(--citadl-space-stack);
          background: var(--bg); border-left: 2px solid var(--accent); font-weight: 500; }
@media (prefers-reduced-motion: no-preference) {
  .stop-dot { transition: background-color var(--citadl-duration-slow), opacity var(--citadl-duration-slow); }
}
@media (max-width: 800px) {
  #play { right: 56px; gap: var(--citadl-space-cell); }
  #play-time { min-width: 0; font-size: var(--citadl-font-size-label); }
  #live { top: calc(var(--citadl-space-panel) + 84px); right: var(--citadl-space-panel); grid-template-columns: repeat(4, auto);
          justify-content: space-between; gap: var(--citadl-space-cell) var(--citadl-space-panel); }
  #live b { font-size: var(--citadl-font-size-title); }
  #live > div > span { font-size: var(--citadl-font-size-label); }
  #live { padding: var(--citadl-space-cell); background: color-mix(in srgb, var(--panel) 88%, transparent); border: var(--hair); }
}

/* Waiting: a full-screen card while the first plan loads, then a thin amber bar under the
 * header whenever the server is working. Motion stops under reduced motion. */
#boot { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: var(--bg);
        transition: opacity var(--citadl-duration-slow); }
#boot.done { opacity: 0; pointer-events: none; }
.boot-card { width: min(320px, 80vw); text-align: center; }
.boot-name { margin-bottom: var(--citadl-space-section); font: 600 var(--citadl-font-size-display)/1 var(--citadl-font-sans);
             letter-spacing: var(--citadl-letter-spacing-display); }
.boot-track { position: relative; height: 2px; overflow: hidden; background: var(--line); }
.boot-fill { height: 100%; width: 10%; background: var(--accent); transition: width 600ms ease-out; }
.boot-track::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 30%;
                     background: hsl(var(--citadl-foreground) / 0.25);  /* a flat sweep: Mainframe has no gradients */
                     animation: sweep 1.4s linear infinite; }
.boot-step { margin-top: var(--citadl-space-stack); color: var(--muted); }
#busybar { position: fixed; top: var(--header); left: 0; right: 0; z-index: 40; height: 2px; overflow: hidden; pointer-events: none; }
body.working #busybar::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 25%; background: var(--accent);
                               animation: sweep 1.2s ease-in-out infinite; }
.comparing { color: var(--muted); animation: breathe 1.6s ease-in-out infinite; }
@keyframes sweep { from { transform: translateX(-100%); } to { transform: translateX(400%); } }
@keyframes breathe { 50% { opacity: 0.45; } }
@media (prefers-reduced-motion: reduce) {
  .boot-track::after, body.working #busybar::after, .comparing { animation: none; }
  body.working #busybar::after { width: 100%; opacity: 0.6; }
}

/* Why each part is there: a small (?) beside a heading opens one or two sentences beneath
 * it, on the ground colour with an amber edge. Shut until asked. */
.tip { position: relative; display: inline-block; vertical-align: middle; margin-left: var(--citadl-space-cell); }
.tip .info { width: 18px; height: 18px; padding: 0; letter-spacing: 0; color: var(--muted); background: var(--panel); }
.tip .info:hover, .tip .info[aria-expanded="true"] { color: var(--accent); border-color: var(--accent); }
.explain { position: absolute; z-index: 10; top: calc(100% + 6px); left: 0; width: min(300px, calc(100vw - 2 * var(--citadl-space-panel)));
           padding: var(--citadl-space-cell) var(--citadl-space-stack); background: var(--bg); border: var(--hair);
           border-left: 2px solid var(--accent); color: var(--ink); text-align: left; white-space: normal; pointer-events: auto;
           font: 400 var(--citadl-font-size-body)/1.5 var(--citadl-font-sans); letter-spacing: 0; text-transform: none; }
#verdict { position: relative; }
#verdict > .tip { position: absolute; top: var(--citadl-space-cell); right: var(--citadl-space-cell); }
#verdict > .tip .explain, #live .explain { left: auto; right: 0; }
.day-head { display: flex; align-items: flex-start; gap: var(--citadl-space-tight); }
.day-head .tip { margin: 0; }
#map-info .tip { margin: 0; }
#map-info .info { width: 28px; height: 28px; }
#live > [data-explain] { position: absolute; top: 0; left: 100%; pointer-events: auto; }
#live > [data-explain] .explain { left: 0; right: auto; }
#about-open { margin-left: auto; }

/* About: what Waypoint is, in a few short lines. */
#about { width: min(560px, calc(100vw - 2 * var(--citadl-space-panel))); max-height: calc(100dvh - 2 * var(--citadl-space-panel)); }
#about[open] { display: grid; gap: var(--citadl-space-stack); }
#about h2 { margin: 0; font-size: var(--citadl-font-size-title); letter-spacing: var(--citadl-letter-spacing-display);
            text-transform: none; color: var(--ink); }
#about h3 { margin: var(--citadl-space-cell) 0 0; color: var(--accent); font: 600 var(--citadl-font-size-label)/1.5 var(--citadl-font-sans);
            letter-spacing: var(--citadl-letter-spacing-label); text-transform: uppercase; }
#about .lead { font-size: var(--citadl-font-size-body-large); }
#about ol, #about ul { margin: 0; padding-left: var(--citadl-space-panel); display: grid; gap: var(--citadl-space-tight); }
#about .steps b { display: block; font-weight: 600; }
#about form { justify-items: end; }
@media (max-width: 800px) {
  #live { padding-right: 36px; }
  #live > [data-explain] { top: var(--citadl-space-cell); left: auto; right: var(--citadl-space-cell); }
  #live > [data-explain] .explain { left: auto; right: 0; }
}
@media (max-width: 800px) {  /* Waypoint and About share the first line; the date and run go beneath */
  .lockup { flex: 1 0 calc(100% - 120px); margin-right: 0; }
  #about-open { order: -1; }
  .lockup { order: -2; }
}

/* Settings: a full-height panel over the right-hand column, not a modal, so the map beside
 * it takes a click to move the commissary. Sections as in the panel: an amber label with
 * its (?), fields in spaced capitals, tables with words in Geist and figures in even digits. */
#settings-open { margin-left: auto; }
#settings-open + #about-open { margin-left: 0; }
#settings { position: fixed; inset: var(--header) 0 0 auto; z-index: 30; width: min(640px, 100vw); height: auto; max-height: none;
            margin: 0; padding: 0 var(--citadl-space-panel); overflow-y: auto; border-width: 0 0 0 var(--citadl-hairline); }
#settings > section { display: grid; gap: var(--citadl-space-cell); justify-items: start; padding: var(--citadl-space-panel) 0; border-bottom: var(--hair); }
#settings h3 { margin: 0; color: var(--accent); font: 600 var(--citadl-font-size-label)/1.5 var(--citadl-font-sans);
               letter-spacing: var(--citadl-letter-spacing-label); text-transform: uppercase; }
.settings-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between;
                 padding: var(--citadl-space-panel) 0 var(--citadl-space-cell); background: var(--panel); }
.settings-head h2 { margin: 0; color: var(--ink); font-size: var(--citadl-font-size-title); letter-spacing: var(--citadl-letter-spacing-display); text-transform: none; }
#settings .meta { color: var(--muted); }
#s-depot-name, #s-van-type { width: min(260px, 60vw); }
#s-unit { width: 96px; }
#s-meals, #s-margin { width: 72px; }
.s-pair, .s-grid { display: flex; flex-wrap: wrap; gap: var(--citadl-space-cell) var(--citadl-space-section); }
.s-grid input { width: 64px; }
.s-scroll { width: 100%; overflow-x: auto; background: var(--bg); border: var(--hair); }
#settings td { vertical-align: middle; }
#settings td input[type="text"] { width: 100%; min-width: 88px; }
#settings td input[type="number"] { width: 60px; }
#s-drivers td:first-child input { min-width: 136px; }
#settings td select { max-width: 132px; }
#settings td input[type="color"] { width: 32px; height: 24px; padding: 0; border: var(--hair); background: none; }
.s-pick { display: flex; flex-wrap: wrap; gap: var(--citadl-space-tight) var(--citadl-space-cell); white-space: normal; min-width: 160px; }
.s-pick label { display: inline-flex; align-items: center; gap: var(--citadl-space-tight); }
.settings-foot { position: sticky; bottom: 0; z-index: 2; display: flex; align-items: center; gap: var(--citadl-space-stack);
                 padding: var(--citadl-space-panel) 0; background: var(--panel); border-top: var(--hair); }
#settings-note { flex: 1 1 auto; color: var(--muted); }
#settings-note b { color: var(--ok); font-weight: 600; }
#settings-note.bad { color: var(--bad); }
.stop-dot.depot.picked { border: 2px solid var(--accent); }
@media (max-width: 800px) {
  #settings { inset: 0; z-index: 50; width: 100vw; border-left: 0; }  /* over the wrapped header too */
  #settings-open { order: -1; }
  .lockup { flex-basis: calc(100% - 200px); }
  .pick-hint { display: none; }
}

/* Editing by hand: Up, Down and Move… under each stop; an edit's preview above the route
 * cards, with what it breaks in warn and an overfull van in red; the map's stop selection. */
#stops .tools { grid-column: 3 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: var(--citadl-space-stack);
                margin-top: var(--citadl-space-tight); }
#stops .tools select { max-width: 60%; padding: 1px var(--citadl-space-cell); }
#stops li.drop { border-top: 2px solid var(--accent); }
#preview { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--citadl-space-cell); margin-bottom: var(--citadl-space-stack); padding: var(--citadl-space-stack);
           background: var(--bg); border: var(--hair); border-left: 2px solid var(--accent); }
#preview.warn { border-left-color: var(--warn); }
#preview .head { display: flex; align-items: start; gap: var(--citadl-space-cell); font-weight: 600; }
#preview .warn { color: var(--warn); }
#preview .bad { color: var(--bad); }
#preview .actions button { flex: 1 1 auto; }
#preview .load { grid-column: 1; }
#closing select { background: var(--panel); }
#lasso-hint { flex-basis: 100%; padding: 6px var(--citadl-space-stack); background: var(--panel); border: var(--hair);
              border-left: 2px solid var(--accent); text-align: left; }
.lasso-box { position: absolute; z-index: 2; border: var(--citadl-hairline) dashed var(--accent); pointer-events: none;
             background: color-mix(in srgb, var(--accent) 12%, transparent); }
#map-box.lassoing .maplibregl-canvas-container { cursor: crosshair; touch-action: none; }
#map-box.lassoing .stop-dot { pointer-events: none; }
.stop-dot.picked { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Upload orders: a drop area, then what the server found in the file, row by row. */
#upload { width: min(560px, calc(100vw - 32px)); }
#upload h2 { margin: 0; }
#upload-drop { display: grid; gap: var(--citadl-space-cell); padding: var(--citadl-space-section); background: var(--bg);
               border: var(--hair); color: var(--muted); cursor: pointer; }
#upload-drop.over { border-color: var(--accent); color: var(--ink); }
#upload-drop input { width: 100%; }
#upload-line { font-size: var(--citadl-font-size-body-large); }
#upload-line.meta { font-size: var(--citadl-font-size-body); }
#upload-line.bad { color: var(--bad); }
#upload-bar { height: 2px; background: var(--line); }
#upload-bar i { display: block; width: 0; height: 100%; background: var(--accent); transition: width .3s; }
#upload-issues { display: grid; gap: var(--citadl-space-tight); max-height: 40vh; margin: 0; padding: 0; overflow-y: auto; list-style: none; }
#upload-issues li { padding-top: var(--citadl-space-tight); border-top: var(--hair); color: var(--warn); }
#upload form { justify-items: stretch; }
/* Dispatch: the header says a dispatched run is locked (information: no edge). The board is a
 * row per route; its only pressables are the amber text actions. On the map of a dispatched
 * run a stop not yet done is hollow, a done one filled, the van's last stop ringed in amber;
 * on the day plan a tick under the band marks when a stop was done. */
#dispatched { padding-left: var(--citadl-space-cell); border-left: 2px solid var(--accent); color: var(--accent);
              font: 600 var(--citadl-font-size-label)/1.5 var(--citadl-font-sans); letter-spacing: var(--citadl-letter-spacing-label); text-transform: uppercase; }
#dispatch-line { margin-bottom: var(--citadl-space-stack); }
#board { display: grid; gap: 0; margin: var(--citadl-space-stack) 0 0; padding: 0; list-style: none; }
.board-row { display: grid; gap: var(--citadl-space-tight); padding: var(--citadl-space-cell) 0; border-top: var(--hair); }
.board-who { display: flex; flex-wrap: wrap; align-items: center; gap: var(--citadl-space-cell); }
.board-live .late { color: var(--warn); }
#map-box.live .stop-dot:not(.depot):not(.delivered) { background: var(--bg); border: 2px solid var(--c); }
.stop-dot.here { outline: 2px solid var(--accent); outline-offset: 2px; }
/* The QR sheet exists only on paper: printing shows it alone, a card per van's run kept whole
 * across pages, light because the page lifts .dark while printing. The link under the code is
 * data, so Mono, small. */
/* Off screen, not display: none: a browser never loads an image inside a hidden section,
 * so the codes would not be there to print. */
#qr-sheet { position: absolute; left: -10000px; top: 0; width: 180mm; visibility: hidden; }
@media print {
  body.printing > :not(#qr-sheet) { display: none !important; }
  body.printing #qr-sheet { position: static; width: auto; visibility: visible; }
  #qr-note { margin-bottom: var(--citadl-space-section); color: var(--muted); }
  #qr-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--citadl-space-section); }
  .qr-card { break-inside: avoid; padding: var(--citadl-space-panel); border: var(--hair); text-align: center; }
  .qr-card h3 { margin: 0; font: 600 var(--citadl-font-size-title)/1.3 var(--citadl-font-sans); }
  .qr-card img { display: block; width: 55mm; height: 55mm; margin: var(--citadl-space-stack) auto; }
  .qr-url { font: 400 8px/1.3 var(--citadl-font-mono); word-break: break-all; }
}
.band .actual { position: absolute; bottom: -6px; width: 2px; height: 5px; margin-left: -1px; background: var(--ink); }

/* Conditions on the map: the switch beside Map | Day plan, and its key under it. */
#cond-toggle { background: var(--panel); }
#cond-toggle[aria-pressed="true"] { color: var(--ink); border-bottom: 2px solid var(--accent); }
#map-box.day #cond-toggle, #map-box.day #cond-key { display: none; }
#cond-key { position: absolute; z-index: 3; bottom: 112px; left: var(--citadl-space-panel); max-width: min(360px, calc(100% - 2 * var(--citadl-space-panel)));
            padding: var(--citadl-space-cell) var(--citadl-space-stack); background: var(--panel); border: var(--hair); }
#cond-key ul { display: grid; gap: var(--citadl-space-tight); margin: var(--citadl-space-tight) 0 0; padding: 0; list-style: none; }
#cond-key .swatch { display: inline-block; width: 14px; height: 4px; margin-right: var(--citadl-space-cell); vertical-align: middle; }
#cond-key .meta { font-size: var(--citadl-font-size-label); }
@media (max-width: 600px) {
  #cond-key { bottom: 96px; padding: var(--citadl-space-tight) var(--citadl-space-cell); font-size: var(--citadl-font-size-label); }
  #cond-key .wx { display: none; }  /* a phone keeps the colours and counts; the weather is under the verdict */
}
