/*
  Somna Night Rail: rail travel booking website (Screenery template)
  Station signage as the ground of the page: navy sign plates, white enamel, one signal yellow, four line colours.
  Type is Overpass (the highway-sign face) for everything you read, Overpass Mono for times, fares and the split flaps.

  Contents
   1. Tokens
   2. Base and browser surfaces
   3. Sign kit: sign plates, badges, platform squares, buttons, pictograms
   4. Header
   5. Hero and the split-flap board
   6. Lines: map, timetables, night timeline
   7. Cabins: tabs and cutaways
   8. Booking: steps, choices, calendar, steppers, coach plan, fields, summary, ticket
   9. On board
  10. Stations
  11. Help
  12. Footer
  13. Motion
  14. Breakpoints
*/

/* ---------- 1. Tokens ---------- */
:root {
  /* Sign palette */
  --navy: #0f2147;          /* sign plates, ink on white */
  --navy-2: #1a3166;        /* raised navy, hover on navy */
  --navy-deep: #0a1733;     /* hero and footer ground */
  --white: #ffffff;         /* enamel plates */
  --enamel: #eef0ec;        /* page ground: the wall the signs hang on */
  --rule: #cfd5de;          /* hairlines on white */
  --ink: #0f2147;
  --ink-2: #3c4b6c;         /* secondary text on white and enamel (8:1) */
  --on-navy: #ffffff;
  --on-navy-2: #bdc8df;     /* secondary text on navy (9:1) */
  --signal: #ffc61a;        /* the one yellow */
  --signal-hi: #ffd54f;
  --error: #b3261e;
  --error-on-navy: #ffb4a8;

  /* Line colours, dark enough to carry white text */
  --n1: #b9370f;
  --n2: #1b7a43;
  --n3: #2563c9;
  --n4: #a3226f;

  /* The departures board */
  --board: #121417;
  --tile: #1f2226;
  --tile-edge: #0a0b0d;
  --flap-ink: #f3efe3;
  --flap-dim: #a2a8b0;
  --flap-signal: #ffc61a;
  --flap-warn: #ff9e7a;

  /* Type */
  --sans: "Overpass", "Helvetica Neue", Arial, sans-serif;
  --mono: "Overpass Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --fs-xs: 0.8125rem;
  --fs-sm: 0.9375rem;
  --fs-md: 1.0625rem;
  --fs-lg: 1.25rem;
  --fs-xl: 1.625rem;
  --fs-h2: clamp(1.75rem, 1.1rem + 2.2vw, 2.75rem);
  --fs-h1: clamp(2.6rem, 1rem + 5.2vw, 5.5rem);

  /* Space */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 72px;
  --s-9: 112px;
  --gutter: clamp(16px, 3.4vw, 48px);
  --wrap: 1320px;

  /* Shape: signs have soft corners, enamel plates a little more */
  --r-s: 4px;
  --r-m: 8px;
  --r-l: 14px;
  --stroke: 2px;

  /* Depth: a plate on a wall */
  --lift: 0 1px 2px rgba(10, 23, 51, 0.12), 0 12px 28px -16px rgba(10, 23, 51, 0.45);
  --lift-dark: 0 2px 4px rgba(0, 0, 0, 0.3), 0 24px 48px -20px rgba(0, 0, 0, 0.6);

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: 140ms;
  --t-mid: 320ms;

  /* Split flap geometry (redefined at breakpoints) */
  --cw: 24px;               /* character width */
  --chh: 36px;              /* character height */
  --cg: 2px;                /* gap between characters */
  --fs-flap: 24px;
  --cs: calc(var(--cw) + var(--cg));
}

/* ---------- 2. Base and browser surfaces ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; scrollbar-color: var(--navy) var(--enamel); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--enamel);
  color: var(--ink);
  font: 400 var(--fs-md)/1.55 var(--sans);
  overflow-x: clip;
  caret-color: var(--navy);
  accent-color: var(--navy);
}
::selection { background: var(--signal); color: var(--navy); }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--enamel); }
::-webkit-scrollbar-thumb { background: var(--navy); border: 3px solid var(--enamel); border-radius: 8px; }
h1, h2, h3 { margin: 0; line-height: 1.08; text-wrap: balance; font-weight: 800; letter-spacing: -0.015em; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; text-underline-offset: 0.22em; text-decoration-thickness: 2px; }
img, svg { display: block; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 3px; border-radius: var(--r-s); box-shadow: 0 0 0 6px var(--navy); }
time, .mono, td, dd { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.skip { position: absolute; left: var(--s-4); top: -80px; z-index: 100; background: var(--signal); color: var(--navy); padding: var(--s-3) var(--s-4); border-radius: var(--r-s); font-weight: 800; text-decoration: none; }
.skip:focus { top: var(--s-3); }

/* ---------- 3. Sign kit ---------- */
.ico { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: var(--stroke); stroke-linecap: round; stroke-linejoin: round; }

/* Section heading as a hanging sign: navy plate, white pictogram square, white lettering */
.sign-head { display: grid; gap: var(--s-4); margin-bottom: var(--s-7); max-width: 72ch; }
.sign {
  display: inline-flex; align-items: center; gap: var(--s-4); justify-self: start;
  background: var(--navy); color: var(--on-navy);
  font-size: var(--fs-h2); padding: 0.32em 0.7em 0.26em 0.32em;
  border-radius: var(--r-m); box-shadow: var(--lift);
}
.sign__pict { display: grid; place-items: center; width: 1.45em; height: 1.45em; border-radius: var(--r-s); background: var(--white); color: var(--navy); flex: none; }
.sign__pict .ico { width: 0.95em; height: 0.95em; stroke-width: 2.2; }
.sign--light { background: var(--white); color: var(--navy); }
.sign--light .sign__pict { background: var(--signal); }
.sign-head__lede { color: var(--ink-2); font-size: var(--fs-lg); max-width: 62ch; }
.sign-head--dark .sign-head__lede { color: var(--on-navy-2); }

/* Line badge: a coloured rounded square, white lettering */
.badge {
  display: inline-grid; place-items: center; min-width: 2.2em; height: 1.7em; padding: 0 0.4em;
  border-radius: var(--r-s); background: var(--line, var(--navy)); color: var(--white);
  font: 800 0.95rem/1 var(--sans); letter-spacing: 0.02em; padding-top: 0.12em; flex: none;
}
/* Platform number: yellow rounded square, navy numerals */
.plat {
  display: inline-grid; place-items: center; min-width: 1.9em; height: 1.9em; padding: 0.1em 0.3em 0;
  border-radius: var(--r-s); background: var(--signal); color: var(--navy);
  font: 900 0.95rem/1 var(--sans); flex: none;
}
.plat--lg { min-width: 2.4em; height: 2.4em; font-size: 1.35rem; border-radius: var(--r-m); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 52px; padding: 0.7em 1.3em 0.6em; border-radius: var(--r-m); border: 2px solid transparent;
  font-weight: 800; font-size: var(--fs-md); text-decoration: none; line-height: 1.1;
  transition: background var(--t-fast), transform var(--t-fast) var(--ease-out), border-color var(--t-fast);
}
.btn:active { transform: translateY(1px); }
.btn--signal { background: var(--signal); color: var(--navy); }
.btn--signal:hover { background: var(--signal-hi); }
.btn--ghost { border-color: var(--on-navy-2); color: var(--on-navy); }
.btn--ghost:hover { border-color: var(--white); background: var(--navy-2); }
.btn--block { width: 100%; }
.btn[aria-disabled="true"] { opacity: 0.6; cursor: not-allowed; }
.btn.is-busy { cursor: progress; }
.btn.is-busy::after { content: ""; width: 16px; height: 16px; border: 2.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.link { background: none; border: 0; padding: 0; color: inherit; font-weight: 800; text-decoration: underline; text-underline-offset: 0.22em; text-decoration-thickness: 2px; min-height: 44px; }

/* ---------- 4. Header ---------- */
.top { position: sticky; top: 0; z-index: 50; background: var(--navy); color: var(--on-navy); border-bottom: 4px solid var(--signal); }
.top__in { display: flex; align-items: center; gap: var(--s-5); min-height: 68px; }
.logo { display: inline-flex; align-items: center; gap: var(--s-3); text-decoration: none; color: inherit; }
.logo__mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-m); background: var(--signal); flex: none; }
.logo__mark svg { width: 26px; height: 26px; fill: var(--navy); }
.logo__word { font-weight: 900; font-size: 1.45rem; letter-spacing: -0.02em; line-height: 1; display: flex; flex-direction: column; }
.logo__word span { font-weight: 600; font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--on-navy-2); margin-top: 3px; }
.nav { margin-left: auto; display: flex; align-items: center; gap: var(--s-1); }
.nav a { display: inline-flex; align-items: center; gap: var(--s-2); min-height: 44px; padding: 0.55em 0.8em 0.45em; border-radius: var(--r-s); text-decoration: none; font-weight: 600; color: var(--on-navy); }
.nav a:hover { background: var(--navy-2); }
.nav .nav__book { background: var(--signal); color: var(--navy); font-weight: 800; margin-left: var(--s-2); }
.nav .nav__book:hover { background: var(--signal-hi); }
.top__menu { display: none; margin-left: auto; align-items: center; gap: var(--s-2); min-height: 44px; padding: 0 var(--s-4); border-radius: var(--r-s); border: 2px solid var(--on-navy-2); background: transparent; font-weight: 800; }

/* ---------- 5. Hero and the board ---------- */
.hero { background: var(--navy-deep); color: var(--on-navy); padding: var(--s-8) 0 var(--s-8); position: relative; }
.hero__in { display: grid; gap: var(--s-7); }
.hero__copy { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: var(--s-4) var(--s-7); align-items: end; }
.hero h1 { font-size: var(--fs-h1); font-weight: 900; letter-spacing: -0.03em; line-height: 0.98; grid-row: span 2; }
.hero__lede { color: var(--on-navy-2); font-size: var(--fs-lg); max-width: 46ch; }
.hero__cta { display: flex; flex-wrap: wrap; gap: var(--s-3); }

.board {
  margin: 0; background: var(--board); border-radius: var(--r-l); padding: var(--s-5);
  box-shadow: var(--lift-dark), inset 0 0 0 1px #2b2f35; position: relative;
}
.board__head { display: flex; justify-content: space-between; align-items: center; gap: var(--s-4); padding-bottom: var(--s-4); border-bottom: 2px solid #2b2f35; margin-bottom: var(--s-3); }
.board__title { display: flex; align-items: center; flex-wrap: wrap; gap: 0.2em 0.8em; font-weight: 800; font-size: var(--fs-xl); color: var(--white); }
.board__title .ico { width: 30px; height: 30px; color: var(--signal); }
.board__title span + span { color: var(--flap-dim); font-weight: 600; font-size: 0.7em; }
.board__clock { font: 700 var(--fs-flap)/1 var(--mono); color: var(--flap-signal); }

/* Column grid shared by the heading row and every board row: widths are counted in characters */
.board__cols, .board__row {
  display: grid; align-items: center; justify-content: space-between; column-gap: var(--s-3);
  grid-template-columns: calc(5 * var(--cs)) calc(2 * var(--cs)) calc(9 * var(--cs)) calc(9 * var(--cs)) calc(7 * var(--cs)) calc(2 * var(--cs)) calc(8 * var(--cs));
}
.board__cols { font: 700 var(--fs-xs)/1 var(--sans); text-transform: uppercase; letter-spacing: 0.12em; color: var(--flap-dim); padding: var(--s-2) 0; }
.board__rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.board__row { padding: 3px 0; }
/* No-JS cells: plain text on a dark tile strip with the flap seam drawn through it */
.board__row .c {
  font: 600 var(--fs-flap)/var(--chh) var(--mono); color: var(--flap-ink); white-space: nowrap; overflow: hidden;
  background: linear-gradient(to bottom, transparent calc(50% - 1px), var(--tile-edge) calc(50% - 1px), var(--tile-edge) calc(50% + 0.5px), transparent calc(50% + 0.5px)), var(--tile);
  border-radius: 3px; padding-inline: 4px; height: var(--chh); text-transform: uppercase;
}
.board__row .c--line { background-color: var(--line); color: var(--white); text-align: center; }
.board__row .c--status { color: var(--flap-signal); }
/* Split flaps (built by the script) */
.board.is-live .board__row .c { background: none; padding: 0; overflow: visible; }
.flaps { display: inline-flex; gap: var(--cg); }
.f { position: relative; width: var(--cw); height: var(--chh); perspective: 260px; color: var(--flap-ink); font: 600 var(--fs-flap)/1 var(--mono); }
.f > span { position: absolute; left: 0; right: 0; height: calc(50% - 0.5px); overflow: hidden; background: var(--tile-bg, var(--tile)); backface-visibility: hidden; }
.f > span:nth-child(1), .f > span:nth-child(3) { top: 0; border-radius: 3px 3px 1px 1px; transform-origin: 50% 100%; }
.f > span:nth-child(2), .f > span:nth-child(4) { bottom: 0; border-radius: 1px 1px 3px 3px; transform-origin: 50% 0; }
.f > span:nth-child(3), .f > span:nth-child(4) { visibility: hidden; z-index: 2; }
.f b { display: block; height: var(--chh); line-height: calc(var(--chh) + 0.12em); text-align: center; font-weight: inherit; }
.f > span:nth-child(2) b, .f > span:nth-child(4) b { margin-top: calc(var(--chh) / -2); }
.f > span:nth-child(1)::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(255,255,255,0.04), rgba(0,0,0,0.18)); }
.c--line .f { --tile-bg: var(--line); color: var(--white); }
.c--status .f { color: var(--st, var(--flap-ink)); }
.board__row[data-st="boarding"] { --st: var(--flap-signal); }
.board__row[data-st="delayed"] { --st: var(--flap-warn); }
.board__row[data-st="departed"] { --st: var(--flap-dim); }
.board__row[data-st="departed"] .c--time .f, .board__row[data-st="departed"] .c--to .f, .board__row[data-st="departed"] .c--from .f { color: var(--flap-dim); }
.board__clock .f { color: var(--flap-signal); font-weight: 700; }
.board__foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--s-2) var(--s-5); margin-top: var(--s-4); padding-top: var(--s-4); border-top: 2px solid #2b2f35; color: var(--on-navy-2); font-size: var(--fs-sm); }
.board__foot [data-board-sentence] { color: var(--white); font-weight: 600; }

/* ---------- 6. Lines ---------- */
.lines { padding: var(--s-9) 0; background: var(--enamel); }
.lines__grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: var(--s-6); align-items: start; }
.map { background: var(--white); border-radius: var(--r-l); box-shadow: var(--lift); padding: var(--s-4); }
.map__svg { width: 100%; height: auto; }
.map__grid path { stroke: #e4e8ee; stroke-width: 1; fill: none; }
.map__line polyline { fill: none; stroke-linejoin: round; stroke-linecap: round; }
.map__casing { stroke: var(--white); stroke-width: 14; }
.map__track { stroke: var(--line); stroke-width: 8; transition: stroke-width var(--t-mid) var(--ease-out); }
.map__line, .map__stop { transition: opacity var(--t-mid) var(--ease-out); }
.map.has-pick .map__line:not(.is-on), .map.has-pick .map__stop:not(.is-on) { opacity: 0.16; }
.map.has-pick .map__line.is-on .map__track { stroke-width: 11; }
.map__stop circle, .map__stop rect { fill: var(--white); stroke: var(--navy); stroke-width: 3; }
.map__stop.is-end circle { stroke-width: 4; }
.map__stop text { font: 600 15px var(--sans); fill: var(--navy); paint-order: stroke; stroke: var(--white); stroke-width: 5px; stroke-linejoin: round; }
.map__stop.is-end text, .map__stop.is-inter text { font-weight: 800; font-size: 17px; }
.map__here-halo { fill: var(--signal); opacity: 0.45; }
.map__here-dot { fill: var(--navy); stroke: var(--signal); stroke-width: 4; }

.lines__side { display: grid; gap: var(--s-4); }
.picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-2); }
.picker button {
  display: flex; align-items: center; gap: var(--s-3); min-height: 56px; text-align: left; padding: var(--s-2) var(--s-3);
  border-radius: var(--r-m); border: 2px solid var(--rule); background: var(--white); font-weight: 700; color: var(--ink);
  transition: border-color var(--t-fast), background var(--t-fast);
}
.picker button > span:last-child { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.picker button .ico { width: 16px; height: 16px; }
.picker button:hover { border-color: var(--navy); }
.picker button[aria-checked="true"] { border-color: var(--navy); background: var(--navy); color: var(--white); }
.tts { display: grid; gap: var(--s-4); }
.tt { background: var(--white); border-radius: var(--r-l); box-shadow: var(--lift); padding: var(--s-5); }
.tt__head { display: flex; align-items: center; gap: var(--s-3); }
.tt__head h3 { font-size: var(--fs-xl); }
.tt__facts { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-4); color: var(--ink-2); font: 600 var(--fs-sm)/1.4 var(--mono); margin: var(--s-3) 0 var(--s-4); }
.tt__stops { list-style: none; margin: 0; padding: 0; position: relative; }
.tt__stops::before { content: ""; position: absolute; left: 70px; top: 14px; bottom: 14px; width: 6px; border-radius: 3px; background: var(--line); }
.tt__stops li { display: flex; align-items: center; gap: var(--s-3); min-height: 38px; position: relative; padding-left: 0; }
.tt__stops li::after { content: ""; position: absolute; left: 66px; width: 14px; height: 14px; border-radius: 50%; background: var(--white); border: 3px solid var(--navy); box-sizing: border-box; }
.tt__stops time { font: 700 var(--fs-md)/1 var(--mono); width: 50px; }
.tt__stops time + span { margin-left: 32px; }
.tt__stops li > span:not(.plat):not(.tt__next) { font-weight: 600; }
.tt__next { font: 700 0.7rem/1 var(--sans); text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-2); border: 1.5px solid var(--rule); border-radius: 3px; padding: 4px 5px 2px; }
.tt__back { margin-top: var(--s-4); padding-top: var(--s-3); border-top: 1px solid var(--rule); color: var(--ink-2); font-size: var(--fs-sm); }

.night { margin-top: var(--s-6); background: var(--navy); color: var(--on-navy); border-radius: var(--r-l); padding: var(--s-5) var(--s-5) var(--s-4); box-shadow: var(--lift); }
.night__read { display: grid; grid-template-columns: auto 1fr; gap: 0 var(--s-5); align-items: baseline; min-height: 84px; }
.night__time { font: 700 clamp(2rem, 1.4rem + 2vw, 3rem)/1 var(--mono); color: var(--signal); grid-row: span 2; }
.night__where { font-weight: 800; font-size: var(--fs-xl); line-height: 1.15; }
.night__what { color: var(--on-navy-2); max-width: 70ch; }
.night__track { position: relative; height: 128px; margin: var(--s-5) 12px 0; touch-action: none; cursor: pointer; }
.night__phases { position: absolute; left: 0; right: 0; top: 52px; height: 22px; border-radius: 11px; overflow: hidden; display: flex; }
.night__phases span { height: 100%; position: relative; }
.night__phases .ph-eve { background: #4a6aa8; }
.night__phases .ph-quiet { background: #050d22; background-image: radial-gradient(circle at 20% 40%, #fff 0.7px, transparent 1.2px), radial-gradient(circle at 70% 70%, #fff 0.6px, transparent 1.1px); background-size: 34px 22px, 47px 22px; }
.night__phases .ph-morn { background: var(--signal); }
.night__legend { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); list-style: none; margin: var(--s-3) 0 0; padding: 0; font-size: var(--fs-sm); color: var(--on-navy-2); }
.night__legend li { display: flex; align-items: center; gap: var(--s-2); }
.night__legend i { width: 22px; height: 12px; border-radius: 6px; border: 1px solid var(--on-navy-2); }
.night__phases b { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); font: 700 0.7rem/1 var(--sans); letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; color: var(--white); }
.night__phases .ph-morn b { color: var(--navy); }
.night__ticks { position: absolute; inset: 0; }
.night__ticks span { position: absolute; top: 46px; height: 34px; width: 0; border-left: 2px solid var(--white); }
.night__ticks span::before { content: ""; position: absolute; left: -7px; top: 10px; width: 12px; height: 12px; border-radius: 50%; background: var(--white); border: 2px solid var(--navy); }
.night__ticks i { position: absolute; left: 0; transform: translateX(-50%); font: 600 0.75rem/1.2 var(--mono); font-style: normal; color: var(--on-navy-2); white-space: nowrap; text-align: center; }
.night__ticks span:nth-child(odd) i { bottom: 40px; }
.night__ticks span:nth-child(even) i { top: 42px; }
.night__ticks span:first-child i { transform: none; left: -6px; text-align: left; }
.night__ticks span:last-child i { transform: translateX(-100%); left: 6px; text-align: right; }
.night__ticks i b { display: block; color: var(--white); font: 700 0.8rem/1.2 var(--sans); }
.night__knob { position: absolute; top: 30px; width: 4px; height: 66px; margin-left: -2px; background: var(--signal); border-radius: 2px; outline: none; box-shadow: none; z-index: 3; }
.night__knob::before { content: ""; position: absolute; left: -14px; top: 19px; width: 32px; height: 32px; border-radius: 50%; background: var(--signal); border: 4px solid var(--navy); }
.night__knob:focus-visible::before { box-shadow: 0 0 0 4px var(--white); }
.night__flag { position: absolute; top: -26px; left: 50%; transform: translateX(-50%); background: var(--signal); color: var(--navy); font: 800 0.72rem/1 var(--sans); text-transform: uppercase; letter-spacing: 0.06em; padding: 5px 7px 3px; border-radius: 3px; white-space: nowrap; }
.night__knob.is-left .night__flag { left: -4px; transform: none; }
.night__knob.is-right .night__flag { left: auto; right: -4px; transform: none; }
.night__hint { margin-top: var(--s-2); color: var(--on-navy-2); font-size: var(--fs-sm); }

/* ---------- 7. Cabins ---------- */
.cabins { padding: var(--s-9) 0; background: var(--white); }
.cabins__tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-2); margin-bottom: var(--s-5); }
.cabins__tabs button {
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 2px var(--s-3); text-align: left; min-height: 64px;
  padding: var(--s-3) var(--s-4); border-radius: var(--r-m); border: 2px solid var(--rule); background: var(--enamel); color: var(--ink); font-weight: 800;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.cabins__tabs button .ico { grid-row: span 2; width: 28px; height: 28px; }
.cabins__tabs small { font: 600 var(--fs-sm)/1 var(--mono); color: var(--ink-2); }
.cabins__tabs button:hover { border-color: var(--navy); }
.cabins__tabs button[aria-selected="true"] { background: var(--navy); border-color: var(--navy); color: var(--white); }
.cabins__tabs button[aria-selected="true"] small { color: var(--on-navy-2); }
.cabins__tabs button[aria-selected="true"] .ico { color: var(--signal); }
.cabins__panels { display: grid; gap: var(--s-6); }
.cab { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: var(--s-7); align-items: center; }
.cab__fig { margin: 0; background: var(--enamel); border-radius: var(--r-l); padding: var(--s-5); }
.cab__fig svg { width: 100%; height: auto; }
.cab__fig figcaption { margin-top: var(--s-2); color: var(--ink-2); font-size: var(--fs-sm); text-align: center; }
.cut * { vector-effect: non-scaling-stroke; }
.cut path, .cut rect, .cut circle { stroke: var(--navy); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.cut .cut__body { fill: var(--navy); }
.cut .cut__wall { fill: var(--white); }
.cut .cut__window { fill: #c9d6ee; }
.cut .cut__bag, .cut .cut__seat rect, .cut .cut__berth rect { fill: #dfe5ef; }
.cut .cut__seat path { fill: #dfe5ef; }
.cut .is-you rect, .cut .is-you path:first-child { fill: var(--signal); }
.cut .is-you circle { fill: var(--white); }
.cut .cut__lamp { fill: var(--signal); }
.cut .cut__floor { stroke-width: 3; }
.cut .cut__bogie path { fill: var(--navy); }
.cut .cut__bogie circle { fill: var(--white); stroke-width: 4; }
.cut .cut__rail { stroke-width: 4; }
.cut .cut__tray, .cut .cut__basin { fill: #c9d6ee; }
.cut .cut__shower { stroke-width: 2.5; }
.cab__info h3 { font-size: var(--fs-xl); margin-bottom: var(--s-3); }
.cab__info > p { color: var(--ink-2); max-width: 54ch; }
.incl { list-style: none; padding: 0; margin: var(--s-5) 0; display: grid; gap: var(--s-3); }
.incl li { display: flex; align-items: center; gap: var(--s-3); font-weight: 600; }
.incl .ico { width: 34px; height: 34px; padding: 6px; border-radius: var(--r-s); background: var(--navy); color: var(--white); }
.fares { border-collapse: collapse; font-family: var(--mono); }
.fares caption { text-align: left; font: 700 var(--fs-xs)/1 var(--sans); text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-2); padding-bottom: var(--s-2); }
.fares th, .fares td { padding: var(--s-2) var(--s-3) var(--s-2) 0; border-bottom: 1px solid var(--rule); text-align: left; }
.fares th { font: 800 var(--fs-sm)/1 var(--sans); }
.fares td { font-weight: 700; font-size: var(--fs-lg); padding-right: var(--s-6); }
/* With the script: one panel at a time */
.js-cabins .cab:not(.is-on) { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .js-cabins .cab.is-on .cab__fig svg { animation: slide-in 520ms var(--ease-out); }
}
@keyframes slide-in { from { transform: translateX(-24px); opacity: 0.4; } to { transform: none; opacity: 1; } }

/* ---------- 8. Booking ---------- */
.book { padding: var(--s-9) 0; background: var(--navy); color: var(--on-navy); }
.book__grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: var(--s-6); align-items: start; }
.book__form { display: grid; gap: var(--s-4); min-width: 0; }
.step { margin: 0; border: 0; background: var(--white); color: var(--ink); border-radius: var(--r-l); padding: var(--s-5); min-width: 0; box-shadow: var(--lift-dark); }
.step legend { float: left; width: 100%; display: flex; align-items: center; gap: var(--s-3); font-weight: 800; font-size: var(--fs-xl); margin-bottom: var(--s-4); padding: 0; }
.step legend + * { clear: both; }
.step__note { color: var(--ink-2); font-size: var(--fs-sm); margin-top: var(--s-3); }
.err { color: var(--error); font-weight: 700; font-size: var(--fs-sm); margin-top: var(--s-2); display: flex; align-items: center; gap: var(--s-2); }
.err::before { content: ""; width: 16px; height: 16px; flex: none; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.400' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l9.500 17h-19zM12 10v4.500M12 17.500v.5'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.400' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l9.500 17h-19zM12 10v4.500M12 17.500v.5'/%3E%3C/svg%3E") center / contain no-repeat; }

.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-2); }
.choice {
  position: relative; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 2px var(--s-3);
  min-height: 64px; padding: var(--s-3) var(--s-4); border: 2px solid var(--rule); border-radius: var(--r-m); background: var(--enamel); cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.choice input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.choice .badge, .choice__pict { grid-row: span 2; }
.choice__pict { width: 30px; height: 30px; }
.choice__main { font-weight: 800; }
.choice__sub { font: 600 var(--fs-sm)/1.2 var(--mono); color: var(--ink-2); }
.choice:hover { border-color: var(--navy); }
.choice:has(input:checked) { border-color: var(--navy); background: var(--white); box-shadow: inset 0 0 0 2px var(--navy); }
.choice:has(input:checked) .choice__pict { color: var(--navy); }
.choice:has(input:checked)::after { content: ""; position: absolute; right: 10px; top: 10px; width: 22px; height: 22px; border-radius: 50%; background: var(--signal) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230f2147' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.500l4 4L18 8'/%3E%3C/svg%3E") center / 16px no-repeat; }
.choice:has(input:focus-visible) { outline: 3px solid var(--signal); outline-offset: 2px; box-shadow: 0 0 0 6px var(--navy); }
.dir { display: grid; grid-template-columns: 1fr 1fr; margin-top: var(--s-3); border: 2px solid var(--navy); border-radius: var(--r-m); overflow: hidden; }
.dir__opt { position: relative; display: flex; align-items: center; justify-content: center; text-align: center; gap: var(--s-2); min-height: 52px; padding: var(--s-2) var(--s-3); font-weight: 700; cursor: pointer; font-size: var(--fs-sm); }
.dir__opt + .dir__opt { border-left: 2px solid var(--navy); }
.dir__opt input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.dir__opt:has(input:checked) { background: var(--navy); color: var(--white); }
.dir__opt:has(input:focus-visible) { outline: 3px solid var(--signal); outline-offset: -5px; }

/* Calendar */
.cal { display: grid; gap: var(--s-3); }
.field--nojs { max-width: 280px; }
.cal__bar { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.cal__month { font-weight: 800; font-size: var(--fs-lg); }
.cal__nav { display: flex; gap: var(--s-2); }
.cal__nav button, .stepper__ctl button { display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r-s); border: 2px solid var(--navy); background: var(--white); color: var(--navy); }
.cal__nav button:hover, .stepper__ctl button:hover { background: var(--navy); color: var(--white); }
.cal__nav button:disabled, .stepper__ctl button:disabled { opacity: 0.35; cursor: not-allowed; background: var(--white); color: var(--navy); }
.cal__grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal__dow { text-align: center; font: 700 var(--fs-xs)/1 var(--sans); text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-2); padding: var(--s-2) 0; }
.cal__day {
  min-height: 52px; border-radius: var(--r-s); border: 2px solid transparent; background: var(--enamel); color: var(--ink);
  font: 700 var(--fs-md)/1 var(--mono); display: grid; place-items: center; align-content: center; gap: 4px; padding: 6px 0;
}
.cal__day small { font: 600 0.62rem/1 var(--sans); text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-2); }
.cal__day:hover:not(:disabled) { border-color: var(--navy); }
.cal__day:disabled { background: transparent; color: #9aa3b5; cursor: default; font-weight: 400; }
.cal__day.is-today { border-color: var(--rule); }
.cal__day[aria-pressed="true"] { background: var(--navy); color: var(--white); border-color: var(--navy); }
.cal__day[aria-pressed="true"] small { color: var(--signal); }
.cal__day.is-few small { color: var(--error); }
.cal__day[aria-pressed="true"].is-few small { color: var(--signal); }

/* Steppers */
.pax { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-2); }
.stepper { display: grid; gap: var(--s-3); padding: var(--s-3) var(--s-4); background: var(--enamel); border-radius: var(--r-m); }
.stepper__label { font-weight: 800; display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--s-2); }
.stepper__label small { flex-basis: 100%; font-weight: 600; font-size: var(--fs-sm); color: var(--ink-2); }
.stepper__label .ico { width: 20px; height: 20px; }
.stepper__ctl { display: flex; align-items: center; gap: var(--s-2); }
.stepper__ctl input { width: 3.2ch; min-width: 44px; height: 44px; text-align: center; font: 700 var(--fs-xl)/1 var(--mono); border: 0; background: transparent; -moz-appearance: textfield; appearance: textfield; }
.stepper__ctl input::-webkit-inner-spin-button, .stepper__ctl input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* Coach plan */
.coach { display: grid; gap: var(--s-3); }
.coach__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2) var(--s-4); }
.coach__name { font-weight: 800; display: flex; align-items: center; gap: var(--s-2); }
.coach__count { font: 700 var(--fs-sm)/1.2 var(--mono); padding: 6px 10px 4px; border-radius: var(--r-s); background: var(--enamel); }
.coach__count.is-done { background: var(--signal); }
.coach__key { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); font-size: var(--fs-sm); color: var(--ink-2); list-style: none; margin: 0; padding: 0; }
.coach__key li { display: flex; align-items: center; gap: var(--s-2); }
.coach__key i { width: 18px; height: 18px; border-radius: 3px; border: 2px solid var(--navy); background: var(--white); }
.coach__key i.k-you { background: var(--signal); }
.coach__key i.k-taken { background: repeating-linear-gradient(135deg, #b8c0ce 0 3px, #e4e8ee 3px 6px); border-color: #8a94a8; }
/* The plan: a coach body with a corridor along one side */
.plan { border: 3px solid var(--navy); border-radius: 22px 22px 10px 10px; padding: var(--s-3); background: var(--enamel); display: grid; gap: var(--s-2); }
.plan__corridor { height: 22px; border-radius: 4px; background: #dde2ea; display: flex; align-items: center; justify-content: center; font: 700 0.68rem/1 var(--sans); text-transform: uppercase; letter-spacing: 0.14em; color: var(--ink-2); }
.plan__comps { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: var(--s-2); }
.comp { background: var(--white); border: 2px solid var(--navy); border-radius: 6px; padding: 6px; display: grid; gap: 4px; }
.comp__h { font: 700 0.72rem/1 var(--sans); text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-2); display: flex; justify-content: space-between; align-items: center; gap: 4px; min-height: 18px; }
.comp__h .ico { width: 16px; height: 16px; color: var(--navy); }
.comp__berths { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.comp--seat .comp__berths { grid-template-columns: 1fr 1fr 0.4fr 1fr; }
.comp--seat .comp__berths::before { content: none; }
.berth {
  min-height: 44px; border-radius: 4px; border: 2px solid var(--navy); background: var(--white); color: var(--navy);
  font: 700 var(--fs-sm)/1 var(--mono); display: grid; place-items: center; align-content: center; gap: 2px; padding: 2px;
}
.berth small { font: 600 0.58rem/1 var(--sans); text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-2); }
.berth:hover:not([aria-disabled="true"]) { background: #fff3c4; }
.berth[aria-pressed="true"] { background: var(--signal); }
.berth[aria-pressed="true"] small { color: var(--navy); }
.berth[aria-disabled="true"] { cursor: not-allowed; color: #5d6880; border-color: #8a94a8; background: repeating-linear-gradient(135deg, #c3cad6 0 3px, #e4e8ee 3px 6px); }
.berth[aria-disabled="true"] small { color: #4d5870; }
.gap { grid-column: 3; }

/* Fields */
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); }
.field { display: grid; gap: var(--s-2); align-content: start; }
.field--wide { grid-column: 1 / -1; }
.field__label { font-weight: 700; font-size: var(--fs-sm); }
.field__label small { font-weight: 400; color: var(--ink-2); }
.field input {
  min-height: 52px; padding: 0.6em 0.8em 0.5em; border-radius: var(--r-s); border: 2px solid #7d88a0; background: var(--white); color: var(--ink); width: 100%;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.field input:hover { border-color: var(--navy); }
.field input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px var(--signal); }
.field input[aria-invalid="true"] { border-color: var(--error); background: #fff6f5; }
.field input.is-ok { border-color: var(--n2); }
.check { display: flex; align-items: flex-start; gap: var(--s-3); margin-top: var(--s-5); cursor: pointer; position: relative; font-size: var(--fs-sm); }
.check input { position: absolute; opacity: 0; width: 28px; height: 28px; margin: 0; }
.check__box { width: 28px; height: 28px; border: 2px solid var(--navy); border-radius: var(--r-s); display: grid; place-items: center; flex: none; background: var(--white); }
.check__box .ico { width: 18px; height: 18px; stroke-width: 3; opacity: 0; }
.check input:checked + .check__box { background: var(--signal); }
.check input:checked + .check__box .ico { opacity: 1; }
.check input:focus-visible + .check__box { outline: 3px solid var(--signal); outline-offset: 2px; box-shadow: 0 0 0 6px var(--navy); }
.check input[aria-invalid="true"] + .check__box { border-color: var(--error); }

.alert { display: flex; gap: var(--s-3); align-items: flex-start; background: #fff1ef; color: #5c120c; border: 2px solid var(--error); border-radius: var(--r-m); padding: var(--s-4); }
.alert .ico { color: var(--error); width: 26px; height: 26px; }
.alert__t { font-weight: 800; }

/* Summary */
.sum { position: sticky; top: 92px; }
.sum__in { background: var(--white); color: var(--ink); border-radius: var(--r-l); padding: var(--s-5); box-shadow: var(--lift-dark); display: grid; gap: var(--s-4); }
.sum__h { font-size: var(--fs-lg); }
.sum__route { display: flex; gap: var(--s-3); align-items: flex-start; padding-bottom: var(--s-4); border-bottom: 2px dashed var(--rule); }
.sum__ends { display: grid; gap: var(--s-2); }
.sum__ends p { display: grid; grid-template-columns: 56px 1fr; gap: var(--s-2); font-weight: 700; line-height: 1.25; }
.sum__ends time { font-family: var(--mono); }
.sum__facts { margin: 0; display: grid; gap: var(--s-2); }
.sum__facts div { display: grid; grid-template-columns: 70px 1fr; gap: var(--s-2); }
.sum__facts dt { color: var(--ink-2); font-size: var(--fs-sm); }
.sum__facts dd { margin: 0; font-weight: 700; }
.sum__lines { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.sum__lines th { text-align: left; font-weight: 600; padding: 6px 0; }
.sum__lines td { text-align: right; font-family: var(--mono); font-weight: 600; padding: 6px 0; }
.sum__lines tbody tr + tr th, .sum__lines tbody tr + tr td { border-top: 1px solid var(--rule); }
.sum__lines tfoot th, .sum__lines tfoot td { border-top: 2px solid var(--navy); padding-top: var(--s-3); font-size: var(--fs-lg); font-weight: 800; }
.sum__note { font-size: var(--fs-xs); color: var(--ink-2); }

/* Ticket */
.ticket-wrap { margin-top: var(--s-6); display: grid; justify-items: center; gap: var(--s-4); outline: none; }
.book.is-done .book__grid { display: none; }
.ticket {
  width: min(100%, 860px); display: grid; grid-template-columns: 1fr 240px; background: var(--white); color: var(--ink);
  border-radius: var(--r-l); overflow: hidden; box-shadow: var(--lift-dark);
}
.ticket__head { grid-column: 1 / -1; display: flex; align-items: center; gap: var(--s-3); background: var(--signal); padding: var(--s-4) var(--s-5); }
.ticket__head .logo__mark { background: var(--navy); }
.ticket__head .logo__mark svg { fill: var(--signal); }
.ticket__head h3 { font-size: var(--fs-xl); margin-right: auto; }
.ticket__body { padding: var(--s-5); display: grid; gap: var(--s-5); }
.ticket__trip { display: flex; align-items: center; gap: var(--s-4); flex-wrap: wrap; }
.ticket__trip p { display: grid; gap: 2px; font-weight: 700; }
.ticket__trip p:first-child { grid-template-columns: auto auto; column-gap: var(--s-3); }
.ticket__trip p:first-child .plat { justify-self: start; margin-top: 4px; }
.ticket__trip time { font: 700 var(--fs-xl)/1 var(--mono); }
.ticket__arrow { width: 32px; height: 32px; }
.ticket__facts { margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-4); }
.ticket__facts dt { font: 700 var(--fs-xs)/1 var(--sans); text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-2); margin-bottom: 4px; }
.ticket__facts dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.ticket__facts [data-t-ref] { font-family: var(--mono); }
.ticket__stub { border-left: 3px dashed var(--rule); padding: var(--s-5); display: grid; gap: var(--s-3); align-content: center; justify-items: center; text-align: center; font-size: var(--fs-sm); color: var(--ink-2); position: relative; }
.ticket__stub::before, .ticket__stub::after { content: ""; position: absolute; left: -15px; width: 28px; height: 28px; border-radius: 50%; background: var(--navy); }
.ticket__stub::before { top: -14px; }
.ticket__stub::after { bottom: -14px; }
.qr { width: 172px; height: 172px; }
.qr rect { fill: var(--navy); }
.ticket__after { color: var(--on-navy-2); display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); justify-content: center; text-align: center; }
.ticket__after .link { color: var(--signal); }

/* ---------- 9. On board ---------- */
.onboard { padding: var(--s-9) 0; background: var(--enamel); }
.onboard__grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: var(--s-6); }
.menu { background: var(--navy); color: var(--on-navy); border-radius: var(--r-l); padding: var(--s-6); box-shadow: var(--lift); }
.menu__h { font-size: var(--fs-xl); display: flex; align-items: center; gap: var(--s-3); padding-bottom: var(--s-4); border-bottom: 2px solid var(--navy-2); }
.menu__cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--s-6); }
.menu__list { margin: 0; }
.menu__list div { display: flex; align-items: baseline; gap: var(--s-2); padding: var(--s-3) 0; border-bottom: 1px solid var(--navy-2); }
.menu__list dt { font-weight: 600; }
.menu__list dt::after { content: ""; }
.menu__list dd { margin: 0 0 0 auto; font: 700 var(--fs-md)/1 var(--mono); color: var(--signal); white-space: nowrap; }
.menu__note { margin-top: var(--s-4); color: var(--on-navy-2); font-size: var(--fs-sm); }
.quiet { background: var(--white); border-radius: var(--r-l); padding: var(--s-6); box-shadow: var(--lift); }
.quiet__h { font-size: var(--fs-xl); margin-bottom: var(--s-4); }
.quiet__list { list-style: none; padding: 0; margin: 0; display: grid; }
.quiet__list li { display: grid; grid-template-columns: 36px 1fr; gap: 2px var(--s-3); padding: var(--s-3) 0; border-bottom: 1px solid var(--rule); }
.quiet__list li:last-child { border-bottom: 0; }
.quiet__t { grid-column: 2; font: 700 var(--fs-sm)/1.2 var(--mono); color: var(--ink-2); }
.quiet__list .ico { grid-row: 1 / span 2; grid-column: 1; width: 36px; height: 36px; padding: 7px; border-radius: var(--r-s); background: var(--enamel); }
.quiet__list .is-quiet .ico { background: var(--navy); color: var(--signal); }
.quiet__list p { grid-column: 2; color: var(--ink-2); }
.quiet__list strong { color: var(--ink); }
.rules { grid-column: 1 / -1; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-radius: var(--r-l); overflow: hidden; background: var(--white); box-shadow: var(--lift); }
.rules li { display: flex; gap: var(--s-3); padding: var(--s-5); align-items: flex-start; }
.rules li + li { border-left: 1px solid var(--rule); }
.rules__p { display: grid; place-items: center; width: 52px; height: 52px; border-radius: var(--r-m); background: var(--navy); color: var(--white); flex: none; }
.rules__p .ico { width: 30px; height: 30px; }
.rules p { color: var(--ink-2); font-size: var(--fs-sm); }
.rules strong { display: block; color: var(--ink); font-size: var(--fs-md); margin-bottom: 2px; }

/* ---------- 10. Stations ---------- */
.stations { padding: var(--s-9) 0; background: var(--white); }
.filter { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-bottom: var(--s-4); }
.filter button { min-height: 44px; min-width: 64px; padding: 0 var(--s-4); border-radius: var(--r-m); border: 2px solid var(--rule); background: var(--white); font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.filter button:hover { border-color: var(--navy); }
.filter button[aria-pressed="true"] { border-color: var(--navy); background: var(--navy); color: var(--white); box-shadow: 0 0 0 2px var(--signal) inset; }
.dir-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); }
.dir-list li { display: grid; grid-template-columns: auto 1fr auto; gap: var(--s-4); align-items: center; background: var(--navy); color: var(--on-navy); border-radius: var(--r-m); padding: var(--s-4) var(--s-5); box-shadow: var(--lift); }
.dir-list h3 { font-size: var(--fs-lg); margin-bottom: 4px; }
.dir-list p { color: var(--on-navy-2); font-size: var(--fs-sm); }
.dir-list__lines { display: flex; gap: 4px; align-self: start; }
.dir-list .is-change { background: var(--white); color: var(--ink); border: 3px solid var(--navy); }
.dir-list .is-change p { color: var(--ink-2); }

/* ---------- 11. Help ---------- */
.help { padding: var(--s-9) 0; background: var(--enamel); }
.help__in { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: var(--s-7); align-items: start; }
.help .sign-head { margin-bottom: 0; }
.faq { display: grid; gap: var(--s-2); }
.faq details { background: var(--white); border-radius: var(--r-m); box-shadow: var(--lift); }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: var(--s-4); min-height: 60px; padding: var(--s-3) var(--s-5); font-weight: 800; font-size: var(--fs-lg); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .ico { transition: transform var(--t-mid) var(--ease-out); }
.faq details[open] summary .ico { transform: rotate(180deg); }
.faq details[open] summary { border-bottom: 1px solid var(--rule); }
.faq details p { padding: var(--s-4) var(--s-5) var(--s-5); color: var(--ink-2); max-width: 68ch; }

/* ---------- 12. Footer ---------- */
.foot { background: var(--navy-deep); color: var(--on-navy); padding: var(--s-8) 0 var(--s-6); border-top: 6px solid var(--signal); }
.foot__in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: var(--s-6) var(--s-7); }
.foot__brand { display: grid; gap: var(--s-4); align-content: start; }
.foot__brand p { color: var(--on-navy-2); max-width: 44ch; font-size: var(--fs-sm); }
.foot__nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-5); }
.foot__nav h3 { font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: 0.12em; color: var(--signal); margin-bottom: var(--s-2); }
.foot__nav div { display: grid; align-content: start; }
.foot__nav a { color: var(--on-navy); text-decoration: none; min-height: 40px; display: flex; align-items: center; }
.foot__nav a:hover { text-decoration: underline; }
.foot__end { grid-column: 1 / -1; padding-top: var(--s-5); border-top: 1px solid var(--navy-2); color: var(--on-navy-2); font-size: var(--fs-xs); }

/* ---------- 13. Motion: quiet supporting transitions ---------- */
@media (prefers-reduced-motion: no-preference) {
  .berth, .cal__day { transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast) var(--ease-out); }
  .berth[aria-pressed="true"] { animation: press 260ms var(--ease-out); }
  .ticket-wrap:not([hidden]) .ticket { animation: issue 700ms var(--ease-out); }
}
@keyframes press { 40% { transform: scale(0.92); } }
@keyframes issue { from { transform: translateY(24px); clip-path: inset(0 0 100% 0); } to { transform: none; clip-path: inset(0); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- 14. Breakpoints ---------- */
@media (max-width: 1240px) {
  :root { --cw: 21px; --chh: 32px; --fs-flap: 21px; }
}
@media (max-width: 1100px) {
  :root { --cw: 19px; --chh: 30px; --fs-flap: 19px; }
  /* Board: drop the "Due" column */
  .board__cols, .board__row { grid-template-columns: calc(5 * var(--cs)) calc(2 * var(--cs)) calc(9 * var(--cs)) calc(9 * var(--cs)) calc(2 * var(--cs)) calc(8 * var(--cs)); }
  .c--due { display: none; }
  .book__grid { grid-template-columns: minmax(0, 1fr) 320px; }
  .rules { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rules li:nth-child(3) { border-left: 0; }
  .rules li:nth-child(n + 3) { border-top: 1px solid var(--rule); }
}
@media (max-width: 960px) {
  :root { --cw: clamp(12px, calc((100vw - 2 * var(--gutter) - 48px - 5 * var(--s-3)) / 35 - var(--cg)), 19px); --chh: calc(var(--cw) * 1.55); --fs-flap: calc(var(--cw) * 1.02); }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--navy); border-bottom: 4px solid var(--signal); flex-direction: column; align-items: stretch; padding: var(--s-3) var(--gutter) var(--s-5); gap: 2px; }
  .nav.is-open { display: flex; }
  .nav a { min-height: 52px; font-size: var(--fs-lg); }
  .nav .nav__book { margin: var(--s-3) 0 0; justify-content: center; }
  .top__menu { display: inline-flex; }
  .hero__copy { grid-template-columns: 1fr; }
  .hero h1 { grid-row: auto; }
  .lines__grid, .cab, .onboard__grid, .help__in, .foot__in { grid-template-columns: 1fr; }
  .cab { gap: var(--s-5); }
  .book__grid { grid-template-columns: 1fr; }
  .sum { position: static; }
  .dir-list { grid-template-columns: 1fr; }
  .cabins__tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  :root { --cw: clamp(10px, calc((100vw - 2 * var(--gutter) - 24px - 3 * var(--s-2)) / 24 - var(--cg)), 19px); --chh: calc(var(--cw) * 1.55); --fs-flap: calc(var(--cw) * 1.05); --cg: 1.5px; }
  /* Board on a phone: time, destination (its tiles take the line colour), platform, status */
  .board { padding: var(--s-3); }
  .board__head { padding-inline: 4px; }
  .board__foot { padding-inline: 4px; }
  .board__cols, .board__row { grid-template-columns: calc(5 * var(--cs)) calc(9 * var(--cs)) calc(2 * var(--cs)) calc(8 * var(--cs)); column-gap: var(--s-2); }
  .c--from, .c--line { display: none; }
  .board.is-live .c--to .f { --tile-bg: var(--line); color: var(--white); }
  .board__row .c--to { background-color: var(--line); }
  .board__title span[lang] { display: none; }
  /* Map on a phone: bigger names, only ends and interchanges are labelled */
  .map__stop text { font-size: 26px; stroke-width: 7px; }
  .map__stop:not(.is-end):not(.is-inter) text { display: none; }
  .map__stop.is-end text, .map__stop.is-inter text { font-size: 28px; }
  .map__track { stroke-width: 11; }
  .map__casing { stroke-width: 18; }
  .map.has-pick .map__line.is-on .map__track { stroke-width: 14; }
  .board__cols { font-size: 0.68rem; letter-spacing: 0.06em; }
  .board__title { font-size: var(--fs-lg); }
  .board__title .ico { width: 24px; height: 24px; }
  .board__row .c { padding-inline: 1px; }
  .hero { padding: var(--s-6) 0 var(--s-7); }
  .sign { font-size: 1.6rem; }
  .lines, .cabins, .book, .onboard, .stations, .help { padding: var(--s-8) 0; }
  .choice-grid, .pax, .fields, .menu__cols { grid-template-columns: 1fr; }
  .pax .stepper { grid-template-columns: 1fr auto; align-items: center; }
  .dir { grid-template-columns: 1fr; }
  .dir__opt + .dir__opt { border-left: 0; border-top: 2px solid var(--navy); }
  .step { padding: var(--s-4); }
  .night { padding: var(--s-4); }
  .night__read { grid-template-columns: 1fr; }
  .night__time { grid-row: auto; }
  .night__track { margin-inline: 14px; }
  .night__ticks i { display: none; }
  .night__ticks span:first-child i, .night__ticks span:last-child i { display: block; bottom: auto; top: 42px; }
  .night__legend { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); list-style: none; margin: var(--s-3) 0 0; padding: 0; font-size: var(--fs-sm); color: var(--on-navy-2); }
.night__legend li { display: flex; align-items: center; gap: var(--s-2); }
.night__legend i { width: 22px; height: 12px; border-radius: 6px; border: 1px solid var(--on-navy-2); }
.night__phases b { font-size: 0.6rem; left: 4px; }
  .ticket { grid-template-columns: 1fr; }
  .ticket__arrow { display: none; }
  .ticket__trip { display: grid; gap: var(--s-3); }
  .ticket__stub { border-left: 0; border-top: 3px dashed var(--rule); }
  .ticket__stub::before, .ticket__stub::after { top: -15px; bottom: auto; left: -14px; }
  .ticket__stub::after { left: auto; right: -14px; }
  .ticket__facts { grid-template-columns: 1fr 1fr; }
  .rules { grid-template-columns: 1fr; }
  .rules li + li { border-left: 0; border-top: 1px solid var(--rule); }
  .dir-list li { grid-template-columns: auto 1fr; padding: var(--s-4); }
  .dir-list__lines { grid-column: 2; grid-row: 1; justify-self: end; }
  .dir-list li > div { grid-column: 1 / -1; }
  .foot__nav { grid-template-columns: 1fr 1fr; }
  .menu, .quiet { padding: var(--s-5); }
  .cal__day { min-height: 46px; }
  .cal__day small { font-size: 0.55rem; }
  .plan__comps { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
}
@media (max-width: 420px) {
  .picker { grid-template-columns: 1fr; }
  .cabins__tabs { grid-template-columns: 1fr; }
  .tt { padding: var(--s-4); }
}
