/*
  Farestage: parcel shipping API pricing page (Screenery template)
  A printed railway tariff booklet: cream paper, black letterpress ink, double rules, condensed table figures,
  a serif for the clauses, and one signal red that only ever means "your route" or "the ticket we recommend".

  Contents
   1. Tokens
   2. Base and browser surfaces
   3. Shared pieces: buttons, fields, segmented switches, section heads, ruled tables
   4. Running head
   5. Cover and Table 1 (the staircase fare table and the estimator)
   6. The fare worked out, verdict, API specimen
   7. Map of zones (strip map)
   8. Table 2 season tickets
   9. Table 3 supplements
  10. Table 4 comparison
  11. Conditions
  12. Booking office, ticket summary, issued card ticket
  13. Colophon
  14. Motion
  15. Narrow screens
*/

/* ---------- 1. Tokens ---------- */
:root {
  /* Palette: paper, ink, signal red, ticket green, buff (rules and stage shading come from ink mixed into paper) */
  --paper: #efe7d3;
  --ink: #1d1b17;
  --red: #a3311d;
  --green: #2f5d4a;
  --buff: #d9c9a3;

  --paper-hi: color-mix(in srgb, #fff 45%, var(--paper));      /* raised paper: form fields, ticket */
  --ink-soft: color-mix(in srgb, var(--ink) 80%, var(--paper));  /* secondary text, still > 7:1 */
  --rule: color-mix(in srgb, var(--ink) 55%, var(--paper));      /* hairlines */
  --rule-faint: color-mix(in srgb, var(--ink) 18%, var(--paper));
  --red-tint: color-mix(in srgb, var(--red) 14%, var(--paper));  /* cells on the lit route, recommended column */
  --red-deep: color-mix(in srgb, var(--red) 82%, var(--ink));
  --green-tint: color-mix(in srgb, var(--green) 14%, var(--paper));

  /* Stage shading in Table 1: ink pressed harder into the paper as the stage rises */
  --s1: color-mix(in srgb, var(--ink) 3%, var(--paper));
  --s2: color-mix(in srgb, var(--ink) 8%, var(--paper));
  --s3: color-mix(in srgb, var(--ink) 13%, var(--paper));
  --s4: color-mix(in srgb, var(--ink) 18%, var(--paper));
  --s5: color-mix(in srgb, var(--ink) 23%, var(--paper));
  --s6: color-mix(in srgb, var(--ink) 29%, var(--paper));

  /* Type: condensed for figures, tables and headings; serif for reading */
  --cond: "Roboto Condensed", "Arial Narrow", sans-serif;
  --serif: "Roboto Serif", Georgia, serif;

  --fs-xs: 0.75rem;     /* 12, fine print and stage figures */
  --fs-sm: 0.875rem;    /* 14 */
  --fs-md: 1.0625rem;   /* 17, body */
  --fs-lg: 1.375rem;    /* 22 */
  --fs-xl: 1.75rem;     /* 28, section titles */
  --fs-2xl: clamp(2.5rem, 2rem + 2.6vw, 4.5rem); /* cover title */

  /* Space */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 3rem;
  --sp-8: 4.5rem;
  --sp-9: 7rem;

  --radius: 2px;        /* printed things have square corners; this only softens the cut */
  --gutter: clamp(1rem, 0.4rem + 2.6vw, 3rem);
  --max: 82rem;
  --head-h: 3.75rem;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);   /* exponential ease-out */
  --double: 3px double var(--ink);
}

/* ---------- 2. Base and browser surfaces ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--head-h) + 1rem); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: var(--paper);
  /* paper grain: a faint fractal noise, tiled */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .11 0 0 0 0 .1 0 0 0 0 .08 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
  color: var(--ink);
  font: 400 var(--fs-md)/1.6 var(--serif);
  font-optical-sizing: auto;
  caret-color: var(--red);
  accent-color: var(--red);
  scrollbar-color: var(--rule) var(--paper);
}
::selection { background: var(--ink); color: var(--paper); }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--red); }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
table { border-collapse: collapse; font-variant-numeric: tabular-nums lining-nums; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.defs { position: absolute; width: 0; height: 0; }
.ico { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.skip { position: absolute; left: var(--sp-4); top: -4rem; z-index: 50; background: var(--ink); color: var(--paper); padding: var(--sp-2) var(--sp-4); font: 600 var(--fs-sm) var(--cond); }
.skip:focus { top: var(--sp-2); }
.skip:hover { color: var(--paper); }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--paper); }
::-webkit-scrollbar-thumb { background: var(--rule); border: 3px solid var(--paper); }

main > section { max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- 3. Shared pieces ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: 2.75rem; padding: 0 var(--sp-5);
  border: 1.5px solid var(--ink); border-radius: var(--radius);
  font: 700 var(--fs-sm)/1 var(--cond); letter-spacing: 0.06em; text-transform: uppercase; text-decoration: none;
  background: transparent; color: var(--ink);
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn--ink { background: var(--ink); color: var(--paper); }
.btn--ink:hover { background: var(--red); border-color: var(--red); color: #fff; }
.btn--red { background: var(--red); border-color: var(--red); color: #fff; }
.btn--red:hover { background: var(--red-deep); border-color: var(--red-deep); color: #fff; }
.btn--line { background: transparent; }
.btn--wide { width: 100%; }
.btn[disabled] { cursor: progress; }

.field { display: grid; gap: var(--sp-1); align-content: start; }
.field__label { font: 700 var(--fs-xs)/1.3 var(--cond); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); padding: 0; }
.field__label small { font-weight: 400; letter-spacing: 0.04em; text-transform: none; font-size: var(--fs-xs); }
.field input[type="text"], .field input[type="email"], .field input[type="number"], .select select, .vol input[type="number"] {
  width: 100%; min-height: 2.75rem; padding: 0 var(--sp-3);
  background: var(--paper-hi); border: 1.5px solid var(--ink); border-radius: var(--radius);
  font: 500 var(--fs-md) var(--cond); font-variant-numeric: tabular-nums;
}
.field input::placeholder { color: color-mix(in srgb, var(--ink) 62%, var(--paper-hi)); }
.field input[aria-invalid="true"], .vol input[aria-invalid="true"] { border-color: var(--red); box-shadow: 0 0 0 1px var(--red); }
.field__err { font: 500 var(--fs-sm)/1.35 var(--cond); color: var(--red); }
.select { position: relative; display: block; }
.select select { appearance: none; padding-right: 2.25rem; cursor: pointer; }
.select .ico { position: absolute; right: var(--sp-3); top: 50%; translate: 0 -50%; pointer-events: none; }

/* Segmented switches (currency, period, compare): a strip of printed boxes, the chosen one inked */
.cur, .period, .cmp-switch { display: inline-flex; border: 1.5px solid var(--ink); border-radius: var(--radius); }
.cur button, .period button, .cmp-switch button {
  min-height: 2.25rem; padding: 0 var(--sp-3); border: 0; background: transparent;
  font: 700 var(--fs-xs)/1 var(--cond); letter-spacing: 0.08em; text-transform: uppercase;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}
.cur button + button, .period button + button, .cmp-switch button + button { border-left: 1.5px solid var(--ink); }
.cur [aria-checked="true"], .period [aria-checked="true"], .cmp-switch [aria-selected="true"] { background: var(--ink); color: var(--paper); }
.period button { min-height: 2.75rem; padding: 0 var(--sp-4); font-size: var(--fs-sm); }
.period small { font-weight: 400; letter-spacing: 0.02em; text-transform: none; margin-left: var(--sp-1); }

.sec-head { display: grid; gap: var(--sp-3); padding-top: var(--sp-6); border-top: var(--double); margin-bottom: var(--sp-6); }
.sec-head h2 { font: 700 var(--fs-xl)/1.1 var(--cond); letter-spacing: 0.02em; text-transform: uppercase; }
.sec-head p { max-width: 66ch; color: var(--ink-soft); }
.sec-head--row { grid-template-columns: 1fr auto; align-items: end; gap: var(--sp-5); }

.ruled { width: 100%; font: 400 var(--fs-md)/1.4 var(--cond); }
.ruled th, .ruled td { text-align: left; padding: var(--sp-3) var(--sp-3) var(--sp-3) 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.ruled thead th { font: 700 var(--fs-xs)/1.3 var(--cond); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); border-bottom: 1.5px solid var(--ink); }
.ruled tbody th { font-weight: 500; }
.fine { font-size: var(--fs-sm); color: var(--ink-soft); }

/* ---------- 4. Running head ---------- */
.runhead { position: sticky; top: 0; z-index: 20; background: var(--paper); border-bottom: var(--double); }
.runhead__in { max-width: var(--max); margin-inline: auto; padding: 0 var(--gutter); height: var(--head-h); display: flex; align-items: center; gap: var(--sp-5); }
.mark { display: inline-flex; align-items: center; gap: var(--sp-2); text-decoration: none; }
.mark__step { width: 1.5rem; height: 1.5rem; fill: var(--ink); }
.mark__step rect { fill: var(--red); }
.mark__word { font: 800 1.375rem/1 var(--cond); letter-spacing: 0.04em; text-transform: uppercase; }
.runhead__issue { font: 400 var(--fs-sm)/1.2 var(--cond); color: var(--ink-soft); }
.runhead__sep { font-style: italic; }
.runhead__nav { margin-left: auto; display: flex; gap: var(--sp-4); }
.runhead__nav a { font: 600 var(--fs-sm)/1 var(--cond); letter-spacing: 0.04em; text-transform: uppercase; text-decoration: none; padding: var(--sp-2) 0; }
.runhead__nav a:hover { text-decoration: underline; color: var(--ink); }
.runhead__book { min-height: 2.25rem; padding: 0 var(--sp-4); }

/* ---------- 5. Cover and Table 1 ---------- */
.cover { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--sp-7); padding-top: var(--sp-7); padding-bottom: var(--sp-7); align-items: start; }
.cover h1 { font: 800 var(--fs-2xl)/0.98 var(--cond); letter-spacing: -0.01em; max-width: 13ch; }
.lede { margin-top: var(--sp-5); max-width: 46ch; color: var(--ink-soft); }

.est { margin-top: var(--sp-6); display: grid; gap: var(--sp-5); padding-top: var(--sp-5); border-top: 1.5px solid var(--ink); }
.est fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.est__pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: var(--sp-4); }
.est__weight .field__label { display: block; margin-bottom: var(--sp-2); }
.bands { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1.5px solid var(--ink); border-radius: var(--radius); }
.bands label { position: relative; display: block; }
.bands label + label { border-left: 1px solid var(--ink); }
.bands input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.bands span { display: grid; place-items: center; min-height: 2.75rem; padding: 0 2px; font: 600 var(--fs-sm)/1.1 var(--cond); text-align: center; transition: background-color 0.2s var(--ease), color 0.2s var(--ease); }
.bands input:checked + span { background: var(--ink); color: var(--paper); }
.bands input:focus-visible + span { outline: 2px solid var(--red); outline-offset: -4px; }
.bands label:last-child input:checked + span { background: var(--red); }
.est__vol .field__label { display: block; margin-bottom: var(--sp-2); }
.vol { display: grid; grid-template-columns: 1fr 7rem; gap: var(--sp-4); align-items: center; }
.vol input[type="range"] { width: 100%; height: 2.75rem; margin: 0; background: transparent; cursor: pointer; }
.vol input[type="range"]::-webkit-slider-runnable-track { height: 3px; background: var(--ink); }
.vol input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 14px; height: 26px; margin-top: -11.5px; background: var(--red); border: 2px solid var(--ink); border-radius: 1px; }
.vol input[type="range"]::-moz-range-track { height: 3px; background: var(--ink); }
.vol input[type="range"]::-moz-range-thumb { width: 12px; height: 24px; background: var(--red); border: 2px solid var(--ink); border-radius: 1px; }
.vol input[type="range"] { -webkit-appearance: none; appearance: none; }
.vol input[type="number"] { text-align: right; font-size: var(--fs-lg); font-weight: 700; }
.est__note { font: 400 var(--fs-sm)/1.4 var(--cond); color: var(--ink-soft); }

/* Table 1 */
.t1 { margin: 0; border: var(--double); padding: var(--sp-5) var(--sp-5) var(--sp-4); background: color-mix(in srgb, #fff 18%, var(--paper)); }
.t1__cap { display: grid; gap: var(--sp-1); padding-bottom: var(--sp-4); margin-bottom: var(--sp-4); border-bottom: 1px solid var(--ink); }
.t1__no { font: 800 var(--fs-lg)/1 var(--cond); letter-spacing: 0.06em; text-transform: uppercase; }
.t1__title { font: 400 var(--fs-md)/1.3 var(--cond); }
.t1__title b { font-weight: 700; }
.t1__fine { font: 400 var(--fs-xs)/1.4 var(--cond); color: var(--ink-soft); }

.stair {
  --cell: minmax(0, 1fr);
  display: grid;
  grid-template-columns: repeat(6, var(--cell)) minmax(7.5rem, 1.35fr);
  grid-template-rows: repeat(6, auto) auto;
  gap: 3px;
}
.cell {
  grid-row: var(--r); grid-column: var(--c);
  position: relative; display: grid; place-items: center;
  aspect-ratio: 1.15; min-height: 2.75rem; padding: 0;
  border: 1px solid var(--rule-faint); border-radius: 1px;
  font: 600 clamp(0.875rem, 0.6rem + 0.7vw, 1.25rem)/1 var(--cond); font-variant-numeric: tabular-nums;
  color: var(--ink);
  transition: background-color 0.35s var(--ease) var(--d, 0s), color 0.35s var(--ease) var(--d, 0s), border-color 0.35s var(--ease) var(--d, 0s);
}
.cell.s1 { background: var(--s1); } .cell.s2 { background: var(--s2); } .cell.s3 { background: var(--s3); }
.cell.s4 { background: var(--s4); } .cell.s5 { background: var(--s5); } .cell.s6 { background: var(--s6); }
.cell__stage { position: absolute; top: 3px; right: 4px; font: 500 var(--fs-xs)/1 var(--cond); color: var(--ink); }
.cell:hover { border-color: var(--ink); }
.cell.on-route { background: var(--red-tint); border-color: color-mix(in srgb, var(--red) 45%, var(--paper)); }
.cell.is-sel { background: var(--red); border-color: var(--red-deep); color: #fff; }
.cell.is-sel .cell__stage { color: #fff; }
.stair.is-goods .cell__fare { font-style: italic; font-weight: 500; }
.step {
  grid-row: var(--r); grid-column: var(--c) / -1;
  display: flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-2) 0 var(--sp-2) var(--sp-3); border-bottom: 1.5px solid var(--ink); border-left: 1.5px solid var(--ink);
  font: 500 var(--fs-sm)/1.15 var(--cond);
  transition: color 0.3s var(--ease);
}
.step b { font: 800 var(--fs-lg)/1 var(--cond); min-width: 1ch; }
.step.is-lit b { color: var(--red); }
.foot { grid-row: 7; grid-column: var(--c); text-align: center; font: 800 var(--fs-sm)/1 var(--cond); padding-top: var(--sp-2); color: var(--ink-soft); }
.foot.is-lit { color: var(--red); }
.t1__how { margin-top: var(--sp-4); font: 400 var(--fs-sm)/1.4 var(--cond); color: var(--ink-soft); }

/* ---------- 6. The fare worked out ---------- */
.fare { padding-bottom: var(--sp-8); }
.fare__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--sp-2) var(--sp-6); padding: var(--sp-5) 0; border-top: var(--double); border-bottom: 1px solid var(--ink); }
.fare__route { font: 700 var(--fs-xl)/1.15 var(--cond); max-width: 32ch; }
.fare__unit { font: 400 var(--fs-md)/1.3 var(--cond); }
.fare__unit strong { font: 800 var(--fs-xl)/1 var(--cond); color: var(--red); margin: 0 var(--sp-1); }

.work { display: grid; grid-template-columns: minmax(0, 1fr) 22rem; gap: var(--sp-6); margin-top: var(--sp-5); align-items: start; }
.work__t { width: 100%; font: 400 var(--fs-sm)/1.3 var(--cond); }
.work__t th, .work__t td { padding: var(--sp-3) var(--sp-3); border-bottom: 1px solid var(--rule); text-align: right; vertical-align: top; }
.work__t thead th { font: 800 var(--fs-md)/1 var(--cond); letter-spacing: 0.06em; text-transform: uppercase; border-bottom: 1.5px solid var(--ink); }
.work__t tbody th { text-align: left; font-weight: 600; padding-left: 0; }
.work__t tbody th small { display: block; font-weight: 400; color: var(--ink-soft); font-size: var(--fs-xs); }
.work__t td .f { display: block; color: var(--ink-soft); font-size: var(--fs-xs); white-space: nowrap; }
.work__t td b { font-weight: 600; font-size: var(--fs-md); }
.work__t td.na { color: var(--ink-soft); font-style: italic; }
.work__tot th, .work__tot td { border-top: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); }
.work__tot td b { font-size: var(--fs-lg); font-weight: 800; }
.work__per td, .work__per th { border-bottom: 0; color: var(--ink-soft); }
.work__t .rec { background: var(--red-tint); }
.work__t thead .rec { color: var(--red); }

.verdict { border: 1.5px solid var(--ink); padding: var(--sp-5); display: grid; gap: var(--sp-3); background: var(--paper-hi); }
.verdict.is-rec { border-color: var(--red); box-shadow: 0 0 0 1px var(--red); }
.verdict.is-goods { border-color: var(--ink); background: var(--paper); }
.verdict__lamp { font: 800 var(--fs-lg)/1.15 var(--cond); }
.verdict.is-rec .verdict__lamp { color: var(--red); }
.verdict__why { font-size: var(--fs-sm); line-height: 1.5; }
.warns { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-2); }
.warns:empty { display: none; }
.warns li { display: flex; gap: var(--sp-2); font: 500 var(--fs-sm)/1.35 var(--cond); padding: var(--sp-2) var(--sp-3); background: color-mix(in srgb, var(--buff) 55%, var(--paper)); border: 1px solid color-mix(in srgb, var(--ink) 30%, var(--buff)); }
.warns li .ico { margin-top: 2px; color: var(--red); }
.verdict .btn { justify-self: start; margin-top: var(--sp-2); }

.specimen { margin-top: var(--sp-6); border-top: 1px solid var(--ink); }
.specimen summary { display: flex; align-items: center; gap: var(--sp-2); min-height: 2.75rem; cursor: pointer; font: 700 var(--fs-sm)/1 var(--cond); letter-spacing: 0.06em; text-transform: uppercase; list-style: none; }
.specimen summary::-webkit-details-marker { display: none; }
.specimen summary::before { content: ""; width: 0.55rem; height: 0.55rem; border-right: 1.5px solid; border-bottom: 1.5px solid; rotate: -45deg; transition: rotate 0.3s var(--ease); }
.specimen[open] summary::before { rotate: 45deg; }
.specimen__code { margin: 0 0 var(--sp-4); padding: var(--sp-4) var(--sp-5); background: var(--ink); color: var(--paper); font: 400 var(--fs-sm)/1.6 var(--cond); overflow-x: auto; white-space: pre; }
.specimen__code ::selection { background: var(--paper); color: var(--ink); }

/* ---------- 7. Map of zones ---------- */
.zones { padding-bottom: var(--sp-8); }
.strip { --R: 3.25rem; --gap: var(--sp-5); list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--gap); }
.strip__z { position: relative; }
/* the line to the next zone, drawn from this roundel's right edge to the next roundel's left edge */
.strip__z:not(:last-child)::after { content: ""; position: absolute; top: calc(var(--R) / 2 - 2px); left: var(--R); right: calc(-1 * var(--gap)); border-top: 4px solid var(--ink); }
.strip__z[data-z="0"]::after { border-top-style: dashed; border-top-width: 3px; }   /* A to D is a sea crossing */
.strip__z button { position: relative; z-index: 1; display: grid; grid-template-columns: var(--R) 1fr; align-items: center; gap: var(--sp-2); width: 100%; padding: 0; border: 0; background: none; text-align: left; }
.strip__z button b { display: grid; place-items: center; width: var(--R); height: var(--R); border-radius: 50%; border: 4px solid var(--ink); background: var(--paper); font: 800 var(--fs-lg)/1 var(--cond); transition: background-color 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease); }
.strip__name { grid-column: 1 / -1; margin-top: var(--sp-2); font: 700 var(--fs-md)/1.15 var(--cond); }
.strip__z button:hover b { background: var(--buff); }
.strip__z button[aria-pressed="true"] b { background: var(--ink); color: var(--paper); }
.strip__z.is-dest button b { border-color: var(--red); color: var(--red); }
.strip__z.is-dest button[aria-pressed="true"] b { background: var(--red); color: #fff; }
.strip__z p { margin-top: var(--sp-2); font-size: var(--fs-sm); line-height: 1.5; color: var(--ink-soft); }
.zones__note { margin-top: var(--sp-6); padding-top: var(--sp-4); border-top: 1px solid var(--rule); font: 400 var(--fs-md)/1.45 var(--cond); }

/* ---------- 8. Table 2 season tickets ---------- */
.tickets { padding-bottom: var(--sp-8); }
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: var(--double); }
.plan { display: grid; grid-row: span 7; grid-template-rows: subgrid; row-gap: var(--sp-3); padding: var(--sp-6) var(--sp-5); }
.plan + .plan { border-left: 1px solid var(--ink); }
.plan--rec { background: var(--red-tint); box-shadow: inset 0 0 0 2px var(--red); }
.plan__when { display: flex; gap: var(--sp-2); align-items: flex-start; font: 500 var(--fs-sm)/1.35 var(--cond); color: var(--ink-soft); padding-bottom: var(--sp-3); border-bottom: 1px solid var(--rule); }
.plan__rec { display: flex; gap: var(--sp-2); align-items: flex-start; font: 600 var(--fs-sm)/1.35 var(--cond); color: var(--red-deep); padding-bottom: var(--sp-3); border-bottom: 1px solid color-mix(in srgb, var(--red) 50%, var(--paper)); }
.plan__rec .ico { margin-top: 1px; }
.plan__name { font: 800 var(--fs-xl)/1 var(--cond); letter-spacing: 0.04em; text-transform: uppercase; }
.plan__for { font-size: var(--fs-sm); color: var(--ink-soft); }
.plan__price { display: flex; align-items: baseline; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-2); }
.plan__amt { font: 800 clamp(2.75rem, 2rem + 2vw, 3.75rem)/0.95 var(--cond); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.plan__per { font: 500 var(--fs-md)/1 var(--cond); }
.plan__sub { font: 400 var(--fs-sm)/1.3 var(--cond); color: var(--ink-soft); min-height: 1.3em; }
.plan__terms { margin: var(--sp-3) 0 var(--sp-4); border-top: 1.5px solid var(--ink); }
.plan__terms div { display: flex; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-2) 0; border-bottom: 1px solid var(--rule); font: 400 var(--fs-sm)/1.3 var(--cond); }
.plan__terms dt { color: var(--ink-soft); }
.plan__terms dd { margin: 0; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.plan .btn { align-self: end; }
.tickets__goods { margin-top: var(--sp-5); max-width: 72ch; font-size: var(--fs-sm); color: var(--ink-soft); }

/* ---------- 9. Table 3 supplements ---------- */
.supp { padding-bottom: var(--sp-8); }
.supp__grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--sp-7); }
.supp .ruled td { text-align: right; padding-right: 0; }
.supp .ruled thead th:last-child { text-align: right; padding-right: 0; }
.supp__notes { display: grid; gap: var(--sp-3); align-content: start; }
.supp__notes h3 { font: 700 var(--fs-md)/1.2 var(--cond); letter-spacing: 0.08em; text-transform: uppercase; }
.supp__notes h3 + p { margin-bottom: var(--sp-3); }
.supp__notes p { font-size: var(--fs-sm); line-height: 1.6; }

/* ---------- 10. Table 4 comparison ---------- */
.compare { padding-bottom: var(--sp-8); }
.cmp-switch { display: none; }
.cmp { width: 100%; font: 400 var(--fs-sm)/1.35 var(--cond); }
.cmp th, .cmp td { padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
.cmp thead th { font: 800 var(--fs-md)/1 var(--cond); letter-spacing: 0.06em; text-transform: uppercase; border-bottom: 1.5px solid var(--ink); padding-top: 0; }
.cmp thead th:first-child { font-size: var(--fs-xs); color: var(--ink-soft); padding-left: 0; }
.cmp tbody th { font-weight: 500; width: 34%; padding-left: 0; }
.cmp td { width: 22%; font-weight: 600; }
.cmp .c1 { background: var(--red-tint); }
.cmp thead .c1 { color: var(--red-deep); }
.cmp__grp th { padding-top: var(--sp-5); font: 700 var(--fs-xs)/1 var(--cond) !important; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft); border-bottom: 1.5px solid var(--ink); background: transparent; }
.cmp .no { color: var(--ink-soft); font-weight: 400; font-style: italic; }

/* ---------- 11. Conditions ---------- */
.conditions { padding-bottom: var(--sp-8); }
.clauses { columns: 2 24rem; column-gap: var(--sp-7); column-rule: 1px solid var(--rule); }
.clause { break-inside: avoid; border-top: 1px solid var(--ink); padding: 0 0 var(--sp-2); }
.clause summary { display: grid; grid-template-columns: 2.5rem 1fr auto; align-items: baseline; gap: var(--sp-2); min-height: 2.75rem; padding: var(--sp-3) 0; cursor: pointer; list-style: none; }
.clause summary::-webkit-details-marker { display: none; }
.clause summary::after { content: ""; width: 0.5rem; height: 0.5rem; border-right: 1.5px solid; border-bottom: 1.5px solid; rotate: 45deg; translate: 0 -0.2rem; transition: rotate 0.3s var(--ease); }
.clause[open] summary::after { rotate: 225deg; translate: 0 0.1rem; }
.clause__no { font: 800 var(--fs-lg)/1 var(--cond); color: var(--red); }
.clause__q { font: 700 var(--fs-md)/1.3 var(--cond); }
.clause p { padding-left: calc(2.5rem + var(--sp-2)); padding-bottom: var(--sp-3); font-size: var(--fs-sm); line-height: 1.65; max-width: 62ch; }
.clause:target { background: var(--red-tint); }

/* ---------- 12. Booking office ---------- */
.booking { padding-bottom: var(--sp-9); }
.office { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--sp-7); align-items: start; }
.bform { display: grid; gap: var(--sp-5); }
.bform fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.bform__plan .field__label { display: block; margin-bottom: var(--sp-2); }
.pick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1.5px solid var(--ink); border-radius: var(--radius); }
.pick label { position: relative; }
.pick label + label { border-left: 1px solid var(--ink); }
.pick input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.pick span { display: grid; gap: 2px; padding: var(--sp-3); min-height: 3.5rem; align-content: center; transition: background-color 0.2s var(--ease), color 0.2s var(--ease); }
.pick b { font: 800 var(--fs-md)/1 var(--cond); letter-spacing: 0.04em; text-transform: uppercase; }
.pick small { font: 400 var(--fs-xs)/1.2 var(--cond); }
.pick input:checked + span { background: var(--ink); color: var(--paper); }
.pick input:focus-visible + span { outline: 2px solid var(--red); outline-offset: -4px; }
.bform__row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
.check { display: grid; grid-template-columns: 1.5rem 1fr; gap: var(--sp-3); align-items: start; font-size: var(--fs-sm); cursor: pointer; }
.check input { width: 1.25rem; height: 1.25rem; margin: 2px 0 0; }
.bform__alert { display: flex; gap: var(--sp-3); padding: var(--sp-4); border: 1.5px solid var(--red); background: var(--red-tint); font-size: var(--fs-sm); line-height: 1.5; }
.bform__alert .ico { color: var(--red); margin-top: 3px; }
.bform.is-goods #vat-field { opacity: 1; }
.btn__busy { display: none; }
.bform.is-busy .btn__txt { opacity: 0.0; }
.bform.is-busy .btn { position: relative; }
.bform.is-busy .btn__busy { display: block; position: absolute; inset: 0; display: grid; place-items: center; }
/* the busy state is a ticket punch walking along a perforation */
.bform.is-busy .btn__busy::before { content: ""; width: 7rem; height: 6px; background: radial-gradient(circle, #fff 2.4px, transparent 3px) 0 50% / 12px 6px repeat-x; mask: linear-gradient(90deg, #000 var(--punch, 30%), transparent 0); animation: punch 1.1s steps(9) infinite; }
@keyframes punch { from { --punch: 0%; } to { --punch: 100%; } }
@property --punch { syntax: "<percentage>"; inherits: false; initial-value: 0%; }

/* the summary ticket: a paper ticket with a perforated stub */
.ticket { position: sticky; top: calc(var(--head-h) + var(--sp-5)); display: grid; grid-template-columns: 1fr 3.25rem; background: var(--paper-hi); border: 1.5px solid var(--ink); box-shadow: 0 10px 24px -14px color-mix(in srgb, var(--ink) 55%, transparent); }
.ticket__body { padding: var(--sp-5); display: grid; gap: var(--sp-4); }
.ticket__head { font: 800 var(--fs-lg)/1 var(--cond); letter-spacing: 0.06em; text-transform: uppercase; padding-bottom: var(--sp-3); border-bottom: var(--double); }
.ticket__lines { margin: 0; display: grid; }
.ticket__lines div { display: flex; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-2) 0; border-bottom: 1px solid var(--rule); font: 400 var(--fs-md)/1.3 var(--cond); font-variant-numeric: tabular-nums; }
.ticket__lines dd { margin: 0; font-weight: 600; }
.ticket__total { border-bottom: 0 !important; padding-top: var(--sp-3) !important; }
.ticket__total dt, .ticket__total dd { font-weight: 800; font-size: var(--fs-lg); }
.ticket__then { font-size: var(--fs-sm); color: var(--ink-soft); line-height: 1.55; }
.ticket__stub { border-left: 2px dashed var(--ink); display: flex; flex-direction: row; justify-content: space-between; align-items: center; padding: var(--sp-4) 0; writing-mode: vertical-rl; font: 700 var(--fs-xs)/1 var(--cond); letter-spacing: 0.14em; text-transform: uppercase; }
.ticket__stub span:last-child { color: var(--red); }

/* issued: an Edmondson card ticket, 57 x 30 mm proportions, printed on green card */
.issued { grid-column: 1 / -1; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--sp-6); align-items: center; padding: var(--sp-6); border: var(--double); background: var(--green-tint); }
.issued:focus { outline: none; }
.issued[hidden] { display: none; }
.card-ticket {
  width: min(22rem, 80vw); aspect-ratio: 57 / 30; padding: var(--sp-4) var(--sp-5);
  display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto 1fr auto; gap: var(--sp-1) var(--sp-4);
  background: var(--green); color: var(--paper); border-radius: 3px;
  box-shadow: 0 14px 28px -16px color-mix(in srgb, var(--ink) 70%, transparent);
  rotate: -2deg;
}
.card-ticket__co { font: 800 var(--fs-sm)/1 var(--cond); letter-spacing: 0.16em; text-transform: uppercase; }
.card-ticket__no { grid-column: 2; grid-row: 1; font: 700 var(--fs-sm)/1 var(--cond); font-variant-numeric: tabular-nums; }
.card-ticket__plan { grid-column: 1 / -1; align-self: center; font: 800 2.25rem/1 var(--cond); letter-spacing: 0.04em; text-transform: uppercase; }
.card-ticket__route, .card-ticket__fare { font: 500 var(--fs-sm)/1.2 var(--cond); }
.card-ticket__fare { text-align: right; font-weight: 700; }
.issued__text { display: grid; gap: var(--sp-3); max-width: 60ch; font-size: var(--fs-sm); line-height: 1.6; }
.issued__lead { font: 700 var(--fs-lg)/1.25 var(--cond); }
.issued .btn { justify-self: start; }
.office.is-done .bform, .office.is-done .ticket { display: none; }

/* ---------- 13. Colophon ---------- */
.colophon { border-top: var(--double); background: var(--ink); color: var(--paper); }
.colophon__in { max-width: var(--max); margin-inline: auto; padding: var(--sp-7) var(--gutter); display: grid; grid-template-columns: 2fr 1.3fr 1fr; gap: var(--sp-6); font: 400 var(--fs-sm)/1.6 var(--cond); }
.colophon__mark p { margin-top: var(--sp-3); max-width: 40ch; color: color-mix(in srgb, var(--paper) 80%, var(--ink)); }
.colophon__h { font: 700 var(--fs-xs)/1 var(--cond); letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: var(--sp-3); color: color-mix(in srgb, var(--paper) 80%, var(--ink)); }
.colophon a:hover { color: var(--buff); }
.colophon__links { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-1); }
.colophon__links a { display: inline-block; padding: 2px 0; }
.colophon__fine { grid-column: 1 / -1; padding-top: var(--sp-4); border-top: 1px solid color-mix(in srgb, var(--paper) 30%, var(--ink)); font-size: var(--fs-xs); color: color-mix(in srgb, var(--paper) 78%, var(--ink)); }
.colophon ::selection { background: var(--paper); color: var(--ink); }

/* ---------- 14. Motion ---------- */
/* Signature: when the route changes, the lit row and column fill in cell by cell from the zone names toward the
   crossing (JS sets --d per cell). Everything else is a quiet colour transition. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; transition-delay: 0s !important; animation: none !important; }
  .bform.is-busy .btn__busy::before { mask: none; }
}

/* ---------- 15. Narrow screens ---------- */
@media (max-width: 1180px) {
  .runhead__issue { display: none; }
  .cover { gap: var(--sp-5); }
  .work { grid-template-columns: 1fr; }
  .strip { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: var(--sp-6); }
  .strip__z[data-z="0"]::after { display: none; }
  .supp__grid, .office { grid-template-columns: 1fr; gap: var(--sp-6); }
  .ticket { position: static; order: -1; }
}
@media (max-width: 980px) {
  .cover { grid-template-columns: 1fr; gap: var(--sp-6); }
  .cover h1 { max-width: 18ch; }
}
@media (max-width: 860px) {
  .runhead__nav { display: none; }
  .cur { margin-left: auto; }
  .plans { grid-template-columns: 1fr; }
  .plan + .plan { border-left: 0; border-top: 1px solid var(--ink); }
  .plan { grid-row: auto; grid-template-rows: none; }
  .colophon__in { grid-template-columns: 1fr 1fr; }
  .colophon__mark { grid-column: 1 / -1; }
  .issued { grid-template-columns: 1fr; justify-items: start; }
}
@media (max-width: 700px) {
  .sec-head--row { grid-template-columns: 1fr; align-items: start; }
  .est__pair, .bform__row { grid-template-columns: 1fr; }
  .bands { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .bands label + label { border-left: 0; }
  .bands label { border-right: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
  .bands label:nth-child(4n) { border-right: 0; }
  .bands label:nth-child(n+5) { border-bottom: 0; }
  .bands label:last-child { grid-column: span 2; }
  .t1 { padding: var(--sp-4) var(--sp-3) var(--sp-3); }
  .stair { grid-template-columns: repeat(6, minmax(0, 1fr)) minmax(4.75rem, 1.2fr); gap: 2px; }
  .cell { aspect-ratio: auto; min-height: 2.75rem; font-size: 0.8125rem; padding-top: 0.6rem; }
  .cell__stage { top: 2px; right: 3px; font-size: 0.6875rem; }
  .step { font-size: 0.6875rem; gap: 4px; padding-left: 4px; }
  .step b { font-size: var(--fs-md); }
  .step span { display: none; }
  .step--last span, .step.is-lit span { display: inline; }
  .fare__route { font-size: var(--fs-lg); }
  /* worked fare: each line becomes a heading and three plan figures */
  .work__t thead { display: none; }
  .work__t, .work__t tbody, .work__t tr { display: block; }
  .work__t tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 1px solid var(--rule); padding-bottom: var(--sp-2); }
  .work__t tbody th { grid-column: 1 / -1; border: 0; padding: var(--sp-3) 0 var(--sp-1); }
  .work__t td { border: 0; text-align: left; padding: var(--sp-2) var(--sp-2) var(--sp-1); }
  .work__t td::before { content: attr(data-name); display: block; font: 800 var(--fs-xs)/1.2 var(--cond); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); }
  .work__t td.rec::before { color: var(--red-deep); }
  .work__t td .f { white-space: normal; }
  .work__tot { border-top: 1.5px solid var(--ink); }
  .work__tot th, .work__tot td { border-top: 0; border-bottom: 0; }
  .strip { --R: 2.75rem; grid-template-columns: 1fr; row-gap: var(--sp-5); }
  .strip__z { padding-left: calc(var(--R) + var(--sp-4)); }
  .strip__z button { position: static; display: block; }
  .strip__z button b { position: absolute; left: 0; top: 0; }
  .strip__name { display: block; margin: 0; padding-top: 0.6rem; }
  .strip__z:not(:last-child)::after, .strip__z[data-z="0"]::after { display: block; top: var(--R); bottom: calc(-1 * var(--sp-5)); left: calc(var(--R) / 2 - 2px); right: auto; border-top: 0; border-left: 4px solid var(--ink); }
  .strip__z[data-z="0"]::after { border-left-style: dashed; border-left-width: 3px; }
  /* comparison: one ticket at a time */
  .cmp-switch { display: inline-flex; justify-self: start; }
  .cmp-switch button { min-height: 2.75rem; padding: 0 var(--sp-4); }
  .cmp thead { display: none; }
  .cmp tbody th { width: 55%; }
  .cmp td { width: 45%; background: transparent !important; }
  .cmp[data-view="0"] .c1, .cmp[data-view="0"] .c2,
  .cmp[data-view="1"] .c0, .cmp[data-view="1"] .c2,
  .cmp[data-view="2"] .c0, .cmp[data-view="2"] .c1 { display: none; }
  .cmp__grp th { padding-top: var(--sp-4); }
  .clauses { columns: 1; }
  .pick { grid-template-columns: 1fr 1fr; }
  .pick label + label { border-left: 0; }
  .pick label { border-bottom: 1px solid var(--ink); }
  .pick label:nth-child(odd) { border-right: 1px solid var(--ink); }
  .pick label:nth-child(n+3) { border-bottom: 0; }
  .ticket { grid-template-columns: 1fr 2.5rem; }
  .colophon__in { grid-template-columns: 1fr; }
  .runhead__book { display: none; }
  .issued { padding: var(--sp-5) var(--sp-4); }
  .card-ticket__plan { font-size: 1.75rem; }
}
@media (max-width: 400px) {
  .mark__word { font-size: 1.125rem; }
  .cur button { padding: 0 var(--sp-2); }
}
