/* Look: the "Field notebook" of jasperhaynes.com. Tokens: /notebook/tokens.css (a vendored copy of
   the main site's tokens, never edited here). Frame (paper, bar, buttons, panels, labels, footer):
   /notebook/notebook.css. This file holds the tracker's own parts and loads after both.
   Colours only through var() tokens. Light is the default; html[data-theme="dark"] is dark (/theme.js).

   Colour meaning: the pen is the accent (links, step numbers, the live dot) and, inside figures,
   only "airline flights". The status colours (--error stop, --done lifted or flying, --doing delay)
   appear only on the status plate, the board tiles and the result words, and every state is also
   written as a word and drawn as a shape (octagon, tick, ring), so colour is never the only cue.

   Old flights colour names, kept as aliases onto the notebook tokens so every rule, chart, embed and
   canvas drawing that still uses them keeps a colour (map.js reads --map-* and --sign-yellow).
   Declared on [data-theme] as well, so an element with its own data-theme resolves them against
   that theme. New rules use the notebook names. */
:root, [data-theme] {
  --sign-red: var(--error);
  --sign-red-ink: var(--card);
  --sign-black: var(--ink);
  --sign-yellow: var(--pen);
  --link: var(--ink);
  --ok: var(--done);
  --warn-bg: var(--doing-bg);
  --warn-ink: var(--doing);
  --focus: var(--accent);
  --map-sea: var(--card);
  --map-land: var(--tint);
  --map-edge: var(--muted);
  --map-other: var(--muted);
}

/* State marks, drawn in currentColor through a mask (data: URIs pass the img-src CSP).
   Stop: an octagon with a bar. Lifted or in the air: a tick. Anything else: an open ring. */
:root {
  --mark-stop: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' fill-rule='evenodd' d='M7.4 1h9.2L23 7.4v9.2L16.6 23H7.4L1 16.6V7.4zM5.2 10.1v3.8h13.6v-3.8z'/%3E%3C/svg%3E");
  --mark-tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3.2 12.8l5.6 5.6L20.8 5.6' fill='none' stroke='black' stroke-width='3.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --mark-ring: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='8.2' fill='none' stroke='black' stroke-width='3'/%3E%3C/svg%3E");
  /* The pen underline of the big count: the same hand-drawn stroke as the page-head h1. */
  --pen-stroke: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12' preserveAspectRatio='none'%3E%3Cpath d='M3 7C30 2 58 11 98 6s70-4 99 1' fill='none' stroke='black' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }

html {
  background: var(--ground);
  color: var(--ink);
  font-family: var(--body);
  font-size: 100%;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

body { margin: 0; }

/* Links in text: ink with a pen underline, so the underline (not the colour) marks them. */
a { color: var(--link); text-decoration-color: var(--link-line); text-decoration-thickness: 1.5px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.page {
  max-width: 46rem;
  margin: 0 auto;
  padding: 1.75rem 20px 3rem;
}

/* A section's mono label, as on the main site's home page: "§ 01 Label". The word is ink here, not
   pen: pen text on the bare paper drops under 4.5:1 once the paper grain is painted over it. */
.section-label { margin: 0 0 10px; }
.section-label b { color: var(--ink); }

h2 {
  margin: 0 0 0.6rem;
  font: var(--h-weight) clamp(26px, 3.2vw, 34px)/1.12 var(--display);
  letter-spacing: var(--h-track);
}

.small { color: var(--muted); font-size: 0.875rem; }

/* ---------- Status plate (homepage h1) ---------- */
/* A square plate with an ink edge, filled with the state's colour. The state class is in the
   static HTML (scripts/head.mjs writes it from status.json) and app.js keeps it in step, so the
   first paint is already right. The mark before the words (octagon or tick) is the non-colour cue. */
.stop { margin: 0 0 2.5rem; }
.stop-label { margin: 0 0 10px; }
.stop-sign {
  display: flex;
  align-items: center;
  gap: 0.36em;
  width: fit-content;
  max-width: 100%;
  margin: 0;
  padding: 0.3em 0.5em 0.26em 0.42em;
  background: var(--error);
  color: var(--card);
  border: 1.5px solid var(--ink);
  border-radius: 0;
  font: 700 clamp(24px, 7vw, 44px)/1.04 var(--display);
  letter-spacing: 0.005em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}
.stop-sign::before {
  content: "";
  flex: none;
  width: 0.86em;
  height: 0.86em;
  background: currentColor;
  -webkit-mask: var(--mark-stop) center / contain no-repeat;
  mask: var(--mark-stop) center / contain no-repeat;
}
.stop.is-lifted .stop-sign { background: var(--done); }
.stop.is-lifted .stop-sign::before { -webkit-mask-image: var(--mark-tick); mask-image: var(--mark-tick); }

.stop-text { margin-top: 14px; }
.stop-text p { margin: 0 0 0.6rem; max-width: 40rem; }
/* The times under the plate: one mono line, like the main site's dates. */
.stop-since {
  font: 400 13px/1.6 var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
}
.stop-live { font-weight: 400; }
.stop-text .warning { margin: 0.25rem 0 0.75rem; }
.stop-sources { color: var(--muted); font-size: 0.9375rem; }
.stop-sources a { display: inline-flex; align-items: center; min-height: 44px; margin-right: 0.6rem; }
.stop-more summary { padding: 10px 0; cursor: pointer; color: var(--muted); font-size: 0.9375rem; }
.stop-more summary::marker { color: var(--pen); }
.stop-more[open] summary { margin-bottom: 0.25rem; }

/* Our own signal that departures may be restarting: a pen rule in the margin, like a lab takeaway. */
.stop-restart { padding: 2px 0 2px 16px; border-left: 3px solid var(--pen); }
.stop-restart[hidden] { display: none; }

/* Warnings and stale data: --doing on --doing-bg, with a mono label above the words. */
.warning {
  margin: 1rem 0 0;
  padding: 11px 16px 13px;
  background: var(--doing-bg);
  color: var(--doing);
  border: 1.5px solid var(--doing);
  border-radius: 8px;
  font-size: 0.9375rem;
  line-height: 1.5;
}
.warning::before {
  content: "Note";
  display: block;
  margin-bottom: 3px;
  font: 500 12px/1.5 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
#stop-stale::before { content: "May be out of date"; }
#count-warning::before { content: "About this number"; }

/* Unofficial and terms notes: a quiet tint panel with a dashed rule (the main site's .panel.tint). */
.unofficial, .use-terms {
  padding: 12px 16px 13px;
  background: var(--tint);
  border: 1.5px dashed var(--rule);
  border-radius: 8px;
  font-size: 0.9375rem;
}
.unofficial { margin: 0 0 2rem; }
.use-terms { margin: 0 0 1rem; }

/* ---------- Live count ---------- */
/* Base: also used by the count embed (/embed/count.html), so the page-only parts below are scoped
   to the homepage's section.count. */
.count-panel { display: inline-block; padding: 0; background: none; color: var(--ink); }
.count-number {
  margin: 0;
  font-weight: 600;
  font-size: clamp(3.5rem, 15vw, 6.5rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.count-label { margin: 0.2rem 0 0; font-weight: 600; font-size: 1.0625rem; }

/* Homepage: a mono label, the number in ink with a pen underline, then a live line. */
.count { margin-bottom: 2.75rem; }
.count .count-panel { display: block; }
.count .count-label {
  margin: 0 0 6px;
  font: 400 12.5px/1.5 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.count .count-number {
  font: 600 clamp(64px, 20vw, 128px)/0.92 var(--display);
  letter-spacing: -0.04em;
  color: var(--ink);
}
/* Drawn once: it is a pseudo-element, so a new count (textContent) never redraws it. */
.count .count-number::after {
  content: "";
  display: block;
  width: min(100%, 1.7em);
  height: 0.085em;
  min-height: 7px;
  margin-top: 0.1em;
  background: var(--pen);
  -webkit-mask: var(--pen-stroke) center / 100% 100% no-repeat;
  mask: var(--pen-stroke) center / 100% 100% no-repeat;
}
.count-live {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 8px;
  margin: 16px 0 0;
  font: 400 12.5px/1.5 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.count-live::before {
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--pen);
}
.count-live div { display: contents; }
.count-live dt { color: var(--muted); }
.count-live dd { margin: 0; color: var(--ink); font-variant-numeric: tabular-nums; }
.count-why { margin: 1.1rem 0 0; color: var(--muted); max-width: 40rem; }

/* Fact tiles: the main site's .metrics, a dashed rule and mono labels. Numbers stay ink. */
.count-facts, .day-facts {
  display: grid;
  gap: 12px;
  margin: 0;
}
.count-facts { grid-template-columns: repeat(auto-fit, minmax(min(100%, 8rem), 1fr)); }
.count .count-facts { margin-top: 1.4rem; }
.count-facts > div, .day-facts > div {
  min-width: 0;
  padding: 14px 16px 15px;
  border: 1.5px dashed var(--rule);
  border-radius: 8px;
}
.count-facts dt, .day-facts dt {
  margin: 0 0 6px;
  font: 400 12px/1.45 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.count-facts dd {
  margin: 0;
  font: 600 clamp(20px, 5vw, 26px)/1.2 var(--display);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  overflow-wrap: anywhere;
}
/* The recap page has five sentence-long values: wider tiles, smaller numbers. */
.recap-facts { margin-bottom: 2.5rem; }
.recap-facts .count-facts { grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); margin-bottom: 0.9rem; }
.recap-facts .count-facts dd { font-size: 1.25rem; line-height: 1.3; }

/* ---------- Figures: the lab's figure sheet ---------- */
/* A card sheet with an ink edge, then the caption: "fig. N" in mono, then the words. The chart
   and map size themselves from their own box, so the padding sits on the sheet, never on them. */
.fig { margin: 0; }
.fig-sheet {
  position: relative;
  padding: 20px;
  background: var(--card);
  border: 1.5px solid var(--ink);
  box-shadow: var(--shadow-sm);
}
.fig figcaption { margin: 12px 0 0; font: 15px/1.5 var(--body); color: var(--muted); max-width: 40rem; }
.fig figcaption p { margin: 0 0 4px; }
.fignum { margin-right: 6px; font: 500 15px/1.5 var(--mono); color: var(--ink); }
.fignum + p { display: inline; }
/* Links in the small print under a chart (recap downloads, the take-offs day link): 44px targets. */
.fig figcaption .small a, .history > .small a { display: inline-flex; align-items: center; min-height: 44px; }

/* Map and replay */
.map, .history { margin-bottom: 2.75rem; }
/* The map mode switch: the lab's .pick buttons, pressed is an ink fill. */
.map-modes { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.map-modes button {
  min-height: 44px;
  padding: 8px 14px;
  border: 1.5px solid var(--ink);
  border-radius: 3px;
  background: var(--card);
  color: var(--ink);
  box-shadow: none;
  font: 500 15px/1.25 var(--body);
}
.map-modes button:hover { background: var(--pen-wash); transform: none; box-shadow: none; }
.map-modes button[aria-pressed="true"] { background: var(--ink); color: var(--card); }
.map-canvas {
  display: block;
  width: 100%;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--map-sea);
}
.replay { display: flex; align-items: center; gap: 0.75rem; margin-top: 14px; }
.replay[hidden], .warning[hidden], .stop-live[hidden] { display: none; }
.replay input[type="range"] { flex: 1; min-height: 2.9rem; padding: 0; border: 0; background: transparent; accent-color: var(--pen); }
.map-caption { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }

/* Chart. Base also used by the chart embed. Series colours are set in the next step. */
.chart { width: 100%; min-height: 240px; background: var(--card); border: 1px solid var(--rule); border-radius: 4px; }
.fig-sheet .chart { border: 0; border-radius: 0; background: none; }
.chart svg { display: block; }
.chart-grid { stroke: var(--rule); stroke-width: 1; }
.chart-axis { fill: var(--muted); font-size: 11px; font-family: var(--mono); }
.chart-total { stroke: var(--ink); stroke-width: 2.5; }
.chart-airline { stroke: var(--sign-red); stroke-width: 2; }
.chart-stop { stroke: var(--sign-red); stroke-width: 1.5; stroke-dasharray: 4 3; }
.chart-stop-label { fill: var(--sign-red); font-size: 11px; font-weight: 600; font-family: inherit; }
.chart-archive { stroke-dasharray: 5 4; }
.chart-normal { fill: var(--muted); }
.route { color: var(--ink); }

/* ---------- Checks: fields, buttons, results ---------- */
.check { margin-bottom: 2.25rem; }

.check-form label, .filter {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--muted);
  font-size: 0.9375rem;
}

.check-row { display: flex; gap: 0.6rem; flex-wrap: wrap; }

/* Fields as on the main site (.field input): ink edge, 6px corners. 18px text avoids the iOS zoom
   and the 2.9rem height keeps a large tap target. */
input {
  font: inherit;
  font-size: 1.125rem;
  color: var(--ink);
  background: var(--field-bg);
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  min-height: 2.9rem;
}
input::placeholder { color: var(--faint); }
.check-row input { flex: 1 1 10rem; max-width: 16rem; text-transform: uppercase; }

/* Buttons: the main site's pen-filled pill (.btn.primary) with a hard shadow that presses in.
   :where() keeps this at zero specificity, so every variant below wins, and it leaves out the
   notebook's own buttons (the theme switch .icon-btn and the pens of the picker). */
:where(button:not(.icon-btn, .pen)) {
  font: 500 1.0625rem/1.2 var(--body);
  min-height: 2.9rem;
  padding: 0.55rem 1.35rem;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  box-shadow: var(--btn-primary-shadow);
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
}
:where(button:not(.icon-btn, .pen)):hover { background: var(--btn-primary-hover); transform: translate(1px, 1px); box-shadow: 1px 2px 0 var(--ink); }
:where([data-theme="dark"]) :where(button:not(.icon-btn, .pen)) { border-color: transparent; }
:where([data-theme="dark"]) :where(button:not(.icon-btn, .pen)):hover { box-shadow: var(--shadow-sm); }
/* Outlined buttons (.btn.soft): the secondary actions. */
.plain-button, .more, .copy-button {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
  box-shadow: none;
}
.plain-button:hover, .more:hover, .copy-button:hover { background: var(--pen-wash); transform: none; box-shadow: none; }
@media (prefers-reduced-motion: reduce) {
  :where(button:not(.icon-btn, .pen)) { transition: none; }
  :where(button:not(.icon-btn, .pen)):hover { transform: none; }
}
/* Keyboard focus keeps the control's own shape: the ring of notebook.css (:focus-visible) rounds
   to 4px, which would square off the pills and the fields while they have focus. */
:where(button:not(.icon-btn, .pen)):focus-visible { border-radius: 999px; }
input:focus-visible { border-radius: 6px; }

/* Result boxes: a card (the main site's .panel). The head says the state in words, coloured only
   for a stop (--error) or a flight in the air (--done), with the matching mark before it. */
.result:empty { display: none; }
.result {
  margin-top: 14px;
  padding: 16px 20px 17px;
  background: var(--card);
  border: 1.5px solid var(--rule);
  border-radius: 8px;
}
.result p { margin: 0 0 0.5rem; }
.result p:last-child { margin-bottom: 0; }
.result ul { margin: 0 0 0.5rem; padding-left: 1.2rem; }
/* List markers in pen (the main site's --bullet), also in the lists the scripts build. */
main li::marker { color: var(--bullet); }
.result-head { font: 600 1.125rem/1.35 var(--display); letter-spacing: -0.01em; color: var(--ink); }
.result-head.is-stop { color: var(--error); }
.result-head.is-flying { color: var(--done); }
.result-head.is-other { color: var(--muted); }
/* A plain fact that is no state of the stop ("not in the air right now"): ink, with the ring. */
.result-head.is-neutral { color: var(--ink); }
.result-head.is-stop::before, .result-head.is-flying::before, .result-head.is-other::before, .result-head.is-neutral::before {
  content: "";
  display: inline-block;
  width: 0.95em;
  height: 0.95em;
  margin-right: 0.4em;
  vertical-align: -0.14em;
  background: currentColor;
  -webkit-mask: var(--mark-ring) center / contain no-repeat;
  mask: var(--mark-ring) center / contain no-repeat;
}
.result-head.is-stop::before { -webkit-mask-image: var(--mark-stop); mask-image: var(--mark-stop); }
.result-head.is-flying::before { -webkit-mask-image: var(--mark-tick); mask-image: var(--mark-tick); }
/* Link rows under a result: each link is a 44px tap target. */
.result .links a { display: inline-flex; align-items: center; min-height: 44px; margin-right: 1.1rem; }
.result .links { margin-bottom: 0.25rem; }

/* ---------- Planes list and tables ---------- */
.list-intro { margin: 0 0 1rem; color: var(--muted); }
.filter-input { width: 100%; max-width: 24rem; }
.list-count { margin: 0.6rem 0; color: var(--muted); font-size: 0.9375rem; }

/* Tables: a card with mono column heads on an ink rule (the main site's .prose table). The head
   stays sticky and every figure is tabular. Only thead cells get the mono look: the take-offs
   table has row heads (tbody th) that are ordinary text. */
.table-wrap { overflow-x: auto; border: 1.5px solid var(--rule); border-radius: 8px; background: var(--card); }
table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; font-variant-numeric: tabular-nums; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--rule); white-space: nowrap; }
th { font-weight: 600; }
thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--card);
  color: var(--ink);
  border-bottom: 1.5px solid var(--ink);
  font: 500 12px/1.4 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
td.num, th.num { text-align: right; }
/* Phones: the column heads wrap and the cells may wrap, so the number columns stay inside the card
   (only the five-column planes table may still scroll sideways). */
@media (max-width: 860px) {
  th, td { padding: 8px; }
  thead th { white-space: normal; vertical-align: bottom; }
}
/* The narrowest phones: the time in the day table may wrap before its time zone too. */
@media (max-width: 359px) {
  .day-table td { white-space: normal; }
}
td.airline { white-space: normal; min-width: 9rem; }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }

.more { margin-top: 0.9rem; }

/* ---------- Questions ---------- */
/* Ruled lines between the questions, the question at 600, the answer muted (the main site's .faq). */
.faq { margin-top: 3rem; }
.faq details { border-top: 1px solid var(--rule); }
.faq details:last-of-type { border-bottom: 1px solid var(--rule); }
.faq summary { padding: 12px 0; cursor: pointer; font-weight: 600; font-size: 1.0625rem; line-height: 1.4; }
.faq summary::marker { color: var(--pen); }
.faq details p { margin: 0 0 16px; max-width: 40rem; color: var(--muted); }

/* Footer: the main site's footer look (.footer in notebook.css: ruled ink line, mono 12.5px, pen
   underlines). The page's own lines (sources and credits) first, then the shared jasperhaynes.com
   line from scripts/head.mjs (.foot-site). */
.foot { margin-top: 3rem; padding-bottom: 2rem; }
.foot p { margin: 0 0 0.6rem; max-width: 42rem; }
.foot strong { color: var(--ink); font-weight: 500; }
/* The page's own footer lines that are rows of links (the first and the last line): each link a
   44px tap target. The links inside the running sources sentence stay inline, as in any text. */
.foot > p:first-child a, .foot > p:last-of-type a { display: inline-flex; align-items: center; min-height: 44px; }
.foot-site { margin-top: 1.1rem; padding-top: 0.9rem; border-top: 1px dashed var(--rule); }
.foot-site p { margin-bottom: 0.25rem; }
.foot-site ul { gap: 0 20px; }
.foot-site li a { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; }

@media (max-width: 30rem) {
  .check-row input { max-width: none; }
  .check-row button { flex: 1 1 100%; }
  .fig-sheet { padding: 14px 12px; }
  .result { padding: 14px 16px 15px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}

/* ---------- Version 3: at the gate (gate.js, board.js, trip.js, share.js) ---------- */

/* Classes below that set display need an explicit [hidden] rule, or they stay visible. */
.share[hidden], .trip[hidden], .gate-all[hidden], .rights[hidden] { display: none; }

.gate summary, .board summary { cursor: pointer; }
.gate summary:focus-visible, .board summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Share */
.share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin: -0.75rem 0 1.75rem;
}
.share-note { color: var(--muted); font-size: 0.9375rem; overflow-wrap: anywhere; }

/* Stranded: numbered notebook step cards. The number is drawn from a counter in pen (the lab's
   step map); the list keeps its list role (role="list" in the markup, for Safari). */
.gate { margin-bottom: 3rem; }
.gate-lead { margin: 0 0 16px; font-weight: 500; max-width: 40rem; }
.gate-steps { display: grid; gap: 12px; margin: 0 0 14px; padding: 0; list-style: none; counter-reset: step; }
.gate-steps > li {
  position: relative;
  margin: 0;
  padding: 16px 18px 17px 66px;
  background: var(--card);
  border: 1.5px solid var(--rule);
  border-radius: 8px;
  counter-increment: step;
}
.gate-steps > li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 18px;
  top: 16px;
  font: 700 26px/1 var(--display);
  letter-spacing: -0.02em;
  color: var(--pen);
}
.gate-steps strong { font-weight: 600; }
.gate-detail { display: block; margin-top: 8px; }
.gate-airline-name { font-weight: 600; margin-right: 0.5rem; }
.gate-links { display: inline-flex; flex-wrap: wrap; gap: 0 1.1rem; }
.gate-links a { display: inline-flex; align-items: center; min-height: 44px; }
.gate-links span { padding: 0.3rem 0; }
.gate-detail > .gate-links { display: flex; }
.gate-all summary { padding: 10px 0; font-weight: 600; color: var(--ink); }
.gate-all summary::marker { color: var(--pen); }
.gate-all ul { margin: 0.25rem 0 0; padding-left: 1.2rem; }
.gate-all li { margin-bottom: 0.4rem; }

/* The link to /refunds/ under the page head (home, recap, Stranded, the airport and day pages).
   A paper slip: ink edge, a pen rule in the margin and the hard notebook shadow, lifting on hover
   like the main site's a.panel. The words are ink on the card in both themes; "Get your money
   back" carries the pen underline and an arrow. The whole slip is one tap target (over 44px). */
.refund-cta { margin: 0 0 2.5rem; }
.refund-cta-link {
  display: block;
  padding: 14px 18px 15px 16px;
  background: var(--card);
  color: var(--ink);
  border: 1.5px solid var(--ink);
  border-left: 6px solid var(--pen);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  font-size: 1.0625rem;
  line-height: 1.45;
  text-decoration: none;
  transition: transform 0.14s, box-shadow 0.14s;
}
.refund-cta-link strong {
  font-weight: 600;
  white-space: nowrap;
  text-decoration: underline;
  text-decoration-color: var(--pen);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}
/* An inline-block, so the underline of the words does not run under the arrow; nowrap above keeps
   the arrow on the line of the words. */
.refund-cta-link strong::after { content: "\2192"; content: "\2192" / ""; display: inline-block; margin-left: 0.4em; transition: transform 0.14s; }
.refund-cta-link:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow-lg); }
.refund-cta-link:hover strong::after { transform: translateX(3px); }
/* The focus ring of notebook.css rounds to 4px; the slip keeps its own corners. */
.refund-cta-link:focus-visible { border-radius: 8px; }
@media (prefers-reduced-motion: reduce) {
  .refund-cta-link, .refund-cta-link strong::after { transition: none; }
  .refund-cta-link:hover, .refund-cta-link:hover strong::after { transform: none; }
}

/* Refund rights (approved by Jasper on 14 Nov 2026) */
.rights { margin-bottom: 3rem; }
.rights .small { margin: 0 0 0.6rem; }
.rights-list { margin: 0; padding-left: 1.2rem; }
.rights-list li { margin-bottom: 0.75rem; padding-left: 0.2rem; }
.rights-list li::marker { color: var(--pen); }
.rights-list li:last-child { margin-bottom: 0; }
/* Numbers are text, not bullets: ink, because pen on the paper grain drops to about 4.3:1. */
ol.rights-list > li::marker { color: var(--ink); }
.rights-list a { display: inline-block; padding: 0.15rem 0; }

/* My trip */
.trip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1rem;
  margin: 0 0 1.75rem;
  padding: 12px 16px;
  background: var(--card);
  border: 1.5px solid var(--rule);
  border-radius: 8px;
}
.trip p { margin: 0; flex: 1 1 14rem; }

/* Airport board: one row per airport, stacked so it never scrolls sideways. The code is a mono
   tile in an ink frame; under it a mono word for the state. A stop row gets an --error filled
   tile (filled, where the others are open: a cue that is not colour) and "Ground stop" in --error;
   a delay row says DELAY in --doing; a notice row says NOTICE; a quiet row has a dashed tile. */
.board { margin-bottom: 2.5rem; }
.board-intro { margin: 0 0 0.6rem; color: var(--muted); max-width: 40rem; }
.board-note { margin: 0 0 0.9rem; font-weight: 600; max-width: 40rem; }
.board-list {
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--card);
  border: 1.5px solid var(--rule);
  border-radius: 8px;
}
.board-list:empty { display: none; }
.board-row {
  display: grid;
  grid-template-columns: 4.75rem minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  gap: 6px 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--rule);
}
.board-row:last-child { border-bottom: 0; }
.board-code {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin: 0;
  padding: 0;
  text-align: center;
  font: 500 1.25rem/1.2 var(--mono);
  letter-spacing: 0.04em;
  background: var(--card);
  color: var(--ink);
  border: 1.5px solid var(--ink);
  border-radius: 2px;
}
.board-code a {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  min-height: 44px;
  width: 100%;
  color: inherit;
  text-decoration-color: var(--pen);
  text-underline-offset: 3px;
}
.board-row.is-stop .board-code { background: var(--error); color: var(--card); border-color: var(--ink); }
.board-row.is-stop .board-code a { text-decoration-color: currentColor; }
.board-row.is-quiet .board-code { border-style: dashed; border-color: var(--muted); }
.board-info { grid-column: 2; grid-row: 1 / span 2; min-width: 0; }
/* The state word under the tile. The row's own text already says it, so screen readers skip it. */
.board-row::before {
  grid-column: 1;
  grid-row: 2;
  align-self: start;
  justify-self: center;
  font: 500 12px/1.3 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.board-row.is-stop::before { content: "Stop"; content: "Stop" / ""; color: var(--error); }
.board-row.is-delay::before { content: "Delay"; content: "Delay" / ""; color: var(--doing); }
.board-row.is-notice::before { content: "Notice"; content: "Notice" / ""; color: var(--muted); }
.board-info p { margin: 0; }
.board-name { font-weight: 600; }
.board-event + .board-event { margin-top: 0.5rem; padding-top: 0.5rem; border-top: 1px dashed var(--rule); }
.board-kind { font-weight: 600; }
.is-stop .board-kind { color: var(--error); }
.is-quiet .board-kind { font-weight: 400; color: var(--muted); }
.board-facts {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: baseline;
  gap: 0.15rem 0.75rem;
  margin: 0.3rem 0 0;
  font-size: 0.9375rem;
}
.board-facts div { display: contents; }
.board-facts dt { font: 400 12px/1.5 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.board-facts dd { margin: 0; overflow-wrap: anywhere; }
.board-notice { margin-top: 0.25rem; font-size: 0.9375rem; }
.board-notice summary { padding: 10px 0; color: var(--ink); }
.board-notice summary::marker { color: var(--pen); }
.board-notice p { overflow-wrap: anywhere; color: var(--muted); }
.board-time { margin-top: 0.3rem; color: var(--muted); font: 400 12px/1.5 var(--mono); letter-spacing: 0.04em; }

@media (max-width: 30rem) {
  .board-row { grid-template-columns: 4rem minmax(0, 1fr); gap: 6px 10px; padding: 12px 12px; }
  .board-code { font-size: 1.0625rem; }
  .board-facts { grid-template-columns: minmax(0, 1fr); }
  .board-facts dd { margin-bottom: 0.2rem; }
  .gate-steps > li { padding: 14px 14px 15px 54px; }
  .gate-steps > li::before { left: 14px; top: 15px; font-size: 22px; }
}

/* Recap page */
/* Subpage heads: the main site's page head. A mono crumb, the h1 with the pen underline
   (notebook.css), then the lede. */
.recap-head { padding: 0.5rem 0 0; margin-bottom: 2.5rem; }
.recap-kicker { margin: 0 0 1rem; font: 400 12.5px/1.6 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.recap-kicker a { display: inline-block; padding: 12px 0; margin: -12px 0; color: inherit; text-underline-offset: 3px; }
.recap-title { margin: 0 0 0.5rem; font: var(--h-weight) clamp(2.125rem, 1.5rem + 2.6vw, 3.375rem)/1.06 var(--display); letter-spacing: var(--h-track); text-wrap: balance; }
/* Only a word longer than the line (Baltimore/Washington at 320px) breaks, instead of pushing the
   page sideways. */
.recap-title, h2 { overflow-wrap: break-word; }
.recap-lead { margin: 1rem 0 0; max-width: 40rem; font-size: 1.1875rem; line-height: 1.55; color: var(--muted); }
.recap-story { padding-left: 1.2rem; max-width: 40rem; }
.recap-story li { margin-bottom: 0.5rem; }
/* Numbers are text: ink (pen on the paper grain is about 4.3:1). */
.recap-story li::marker { color: var(--ink); }

/* Planes heading to an airport */
.result[hidden] { display: none; }
.inbound-list { margin: 0.25rem 0 0.5rem; padding-left: 1.2rem; font-variant-numeric: tabular-nums; }

/* Airport pages */
.airport-index { columns: 2 14rem; padding-left: 1.2rem; }
.airport-index li { margin-bottom: 0.15rem; }
.airport-index li::marker { color: var(--pen); }
.airport-index a { display: inline-flex; align-items: center; min-height: 44px; }

/* Calmer homepage: essentials first, the rest on their own pages */
.checks { display: grid; gap: 0 2rem; margin-bottom: 1rem; }
/* Side by side, both headings get room for two lines, so the fields and buttons under them stay
   level when only one heading wraps. */
@media (min-width: 860px) {
  .checks { grid-template-columns: 1fr 1fr; align-items: start; }
  .checks .check > h2 { min-height: 2.24em; }
}
.checks .check { margin-bottom: 1.5rem; }

/* Day pages and how-it-works */
@media (min-width: 860px) { .day-facts { grid-template-columns: 1fr 1fr; } }
.day-facts { margin-bottom: 1rem; }
.day-facts dd { margin: 0; font-weight: 500; font-size: 1.0625rem; line-height: 1.45; }
/* The day chart SVG still has fixed light-on-dark colours (scripts/build-static.mjs), so its sheet
   stays dark in both themes (--code-bg) until the chart is drawn from the tokens. */
.fig-sheet.day-chart-wrap { background: var(--code-bg); }
.day-chart { display: block; width: 100%; height: auto; }
main.page > section { margin-bottom: 2.5rem; }

/* ---------- Site bar and menu on every page (scripts/menu.mjs, menu.js) ---------- */

/* The main site's bar (.band and .nav in notebook.css): 64px on the paper, a ruled ink line under
   it. Left: the jasperhaynes.com logo with the pen dot, then this site's name in mono. Right: the
   theme switch and the Menu pill. --bar-h is the bar's height, so the menu panel fits under it.
   The name fits in three steps: in full from 500px, as "/ Tracker" from 390px (the full name
   stays for screen readers), and on its own row under the logo below that. */
/* Above the page's own positioned parts (figure sheets, cards), so the open menu panel is never
   covered by them. */
.site-bar { --bar-h: 64px; z-index: 45; }
.site-bar-inner { max-width: 46rem; margin: 0 auto; padding: 0 20px; }
.site-id { display: flex; align-items: center; gap: 0 12px; min-width: 0; margin-right: auto; }
.site-name {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--muted);
  font: 400 12.5px/1.2 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}
/* A thin slash between the two names, for the eye only. */
.site-name::before { content: "/"; content: "/" / ""; margin-right: 12px; color: var(--faint); }
.site-name-long { white-space: pre; }
.logo:hover, .site-name:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--pen); text-decoration-thickness: 2px; text-underline-offset: 6px; }

@media (max-width: 499px) {
  .site-id { gap: 0 10px; }
  .site-name::before { margin-right: 10px; }
  .site-name-long { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
/* Small phones: the full name moves under the logo, on its own row with its own 44px tap target. */
@media (max-width: 389px) {
  .site-bar { --bar-h: 98px; }
  .site-bar-inner.nav { height: auto; flex-wrap: wrap; gap: 0 10px; padding-top: 9px; padding-bottom: 1px; }
  .site-id { display: contents; }
  .site-bar .logo { order: 1; margin-right: auto; }
  .site-bar .nav-end { order: 2; }
  .site-name { order: 3; flex-basis: 100%; margin-top: -1px; }
  .site-name::before { display: none; }
  .site-name-long { position: static; width: auto; height: auto; overflow: visible; clip-path: none; white-space: pre; }
}

/* The menu is the main site's Menu pill (.menu summary) with a card panel under the bar, kept to
   the width of the text column. Groups stack on phones and sit in two columns from 600px. */
.megamenu-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: max(20px, calc((100% - 46rem) / 2 + 20px));
  right: max(20px, calc((100% - 46rem) / 2 + 20px));
  z-index: 50;
  display: grid;
  gap: 20px 28px;
  max-height: calc(100vh - var(--bar-h) - 24px);
  max-height: calc(100dvh - var(--bar-h) - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 16px 18px;
}
@media (min-width: 600px) {
  .megamenu-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 22px 22px 24px; }
}
.megamenu-heading { margin: 0 0 6px; padding: 0 10px 8px; border-bottom: 1px solid var(--rule); }
.megamenu-group ul { margin: 0; padding: 0; list-style: none; }
.megamenu-group li { position: relative; margin: 0; padding: 8px 10px; border-radius: 4px; }
.megamenu-group li:hover { background: var(--pen-wash); }
.megamenu-group li > .megamenu-link { font-weight: 600; color: var(--ink); text-decoration: none; }
.megamenu-desc { display: block; margin-top: 2px; color: var(--muted); font-size: 0.875rem; line-height: 1.4; }
/* Links inside a description (later day pages) sit above the item's own stretched link. */
.megamenu-desc .megamenu-link { position: relative; z-index: 1; display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; color: var(--ink); }
.megamenu-link[aria-current="page"] { color: var(--ink); }
.megamenu-group li > .megamenu-link[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--pen); text-decoration-thickness: 2px; text-underline-offset: 5px; }
.megamenu-note { margin: 12px 10px 0; padding: 8px 12px; background: var(--tint); border: 1.5px dashed var(--rule); border-radius: 8px; font-size: 0.875rem; }

/* ---------- Pages further on: cards ---------- */
/* Homepage: the sections that moved to their own pages, one card each (the main site's a.panel:
   a card with a fine edge that lifts on hover). The whole card is one tap target. */
.site-more { margin-bottom: 2.5rem; }
.site-more-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
@media (min-width: 860px) { .site-more-list { grid-template-columns: 1fr 1fr; } }
.site-more-list li, .site-next {
  position: relative;
  padding: 15px 18px 16px;
  background: var(--card);
  border: 1.5px solid var(--rule);
  border-radius: 8px;
  transition: transform 0.14s, box-shadow 0.14s, border-color 0.14s;
}
.site-more-list li:hover, .site-next:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow-lg); border-color: var(--ink); }
.site-more-list li:focus-within, .site-next:focus-within { border-color: var(--ink); }
.site-more-list a, .site-next a { font: 600 1.0625rem/1.3 var(--display); letter-spacing: -0.01em; color: var(--ink); }
.site-more-list span, .site-next span { display: block; margin-top: 4px; color: var(--muted); font-size: 0.9375rem; }
/* Homepage, under the two checks: the way to the stranded page, before the map. */
.site-next { margin: 0 0 2.5rem; }
@media (prefers-reduced-motion: reduce) {
  .site-more-list li, .site-next { transition: none; }
  .site-more-list li:hover, .site-next:hover { transform: none; }
}

/* A menu item or a card is one tap target as a whole: a layer stretched over it from its link
   takes the tap anywhere on it and carries the focus ring. */
.megamenu-group li > .megamenu-link::after, .site-more-list a::after, .site-next a::after {
  content: "";
  position: absolute;
  inset: 0;
}
.megamenu-group li > .megamenu-link:focus-visible, .site-more-list a:focus-visible, .site-next a:focus-visible { outline: none; }
.megamenu-group li > .megamenu-link:focus-visible::after, .site-more-list a:focus-visible::after, .site-next a:focus-visible::after {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
.site-more-list a:focus-visible::after, .site-next a:focus-visible::after { border-radius: 8px; }
.megamenu-group li:hover > .megamenu-link, .site-more-list li:hover a, .site-next:hover a { text-decoration-thickness: 2px; }

/* ---------- Without JavaScript ---------- */
/* /theme.js marks html with "js". Without it the theme switch would do nothing and the map would
   stay empty, so neither the switch nor the map key is shown. */
html:not(.js) .theme-switch, html:not(.js) .map .fig-key { display: none; }

/* ---------- Forced colours (Windows high contrast) ---------- */
/* The state marks are drawn as a background through a mask, which forced colours would blank out:
   they keep the system text colour. The pen picker has nothing to offer there. System colour
   keywords are the only colours this block may use. */
@media (forced-colors: active) {
  .stop-sign::before, .result-head::before { forced-color-adjust: none; background: CanvasText; }
  .pen-picker { display: none; }
}
