:root {
  --night: #0c1222;
  --night-2: #121a2e;
  --panel: #161f37;
  --panel-2: #1c2742;
  --line: #2a3655;
  --ink: #f1ece2;
  --ink-2: #c9c6c0;
  --muted: #8f99b3;
  --lamp: #f0b45c;
  --lamp-ink: #241605;
  --lamp-soft: rgba(240, 180, 92, .14);
  --good: #8fd3a8;
  --warn: #f2a07b;
  --radius: 14px;
  --radius-s: 9px;
  --display: "Fraunces", Georgia, serif;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }

body {
  margin: 0;
  background: var(--night);
  color: var(--ink);
  font: 400 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.12; margin: 0; letter-spacing: -.01em; }
p { margin: 0; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.wrap { width: min(1180px, 100% - 40px); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--lamp); color: var(--lamp-ink); padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--lamp); outline-offset: 2px; }

.eyebrow { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--lamp); font-weight: 600; }

/* Header */
.top { position: sticky; top: 0; z-index: 5; background: rgba(12, 18, 34, .86); backdrop-filter: blur(10px); border-bottom: 1px solid rgba(42, 54, 85, .6); }
.top__inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-size: 22px; font-weight: 600; color: var(--ink); }
.brand svg { color: var(--lamp); }
.brand--small { font-size: 17px; gap: 8px; }
.top__nav { display: flex; gap: 28px; }
.top__nav a { text-decoration: none; color: var(--ink-2); font-size: 15px; }
.top__nav a:hover { color: var(--ink); }

/* Hero */
.hero { position: relative; padding: 64px 0 72px; overflow: hidden;
  background:
    radial-gradient(900px 500px at 85% 10%, rgba(76, 104, 180, .22), transparent 60%);
}
.hero__grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(38px, 5.2vw, 64px); margin: 14px 0 18px; }
.lede { color: var(--ink-2); font-size: 18px; max-width: 34em; }

/* Search */
.search { margin-top: 32px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 12px; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.search__pair { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: end; }
.search__row { display: grid; grid-template-columns: 1fr 140px auto; gap: 12px; align-items: end; }
.search__error { color: var(--warn); font-size: 14px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field--block { margin-top: 16px; }
.field__label { font-size: 13px; color: var(--muted); font-weight: 500; }
.field select, .field input {
  width: 100%; height: 48px; padding: 0 14px; background: var(--night-2); border: 1px solid var(--line);
  border-radius: var(--radius-s); color: var(--ink); appearance: none; -webkit-appearance: none;
}
.field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%238f99b3' stroke-width='1.6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
.field input::-webkit-calendar-picker-indicator { filter: invert(.8); cursor: pointer; }
.field select:hover, .field input:hover { border-color: #3a4870; }
.field input[aria-invalid="true"] { border-color: var(--warn); }
.swap { width: 40px; height: 48px; border-radius: var(--radius-s); border: 1px solid var(--line); background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.swap:hover { color: var(--lamp); border-color: var(--lamp); }

.btn { height: 48px; padding: 0 22px; border-radius: var(--radius-s); border: 1px solid transparent; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .15s, transform .1s, border-color .15s; }
.btn:active { transform: translateY(1px); }
.btn--lamp { background: var(--lamp); color: var(--lamp-ink); }
.btn--lamp:hover { background: #f6c477; }
.btn--lamp:disabled { background: #4a4434; color: #8d846f; cursor: not-allowed; }
.btn--ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn--ghost:hover { border-color: var(--muted); }
.btn--sm { height: 38px; padding: 0 16px; font-size: 14px; }

/* Map */
.map { margin: 0; position: relative; }
.map svg { width: 100%; height: auto; display: block; }
.map__caption { text-align: center; color: var(--muted); font-size: 14px; margin-top: 6px; }
.m-line { fill: none; stroke: #3e4d7c; stroke-width: 1.6; stroke-linecap: round; transition: stroke .25s, stroke-width .25s; }
.m-line.is-on { stroke: var(--lamp); stroke-width: 2.6; }
.m-line.is-dim { stroke: #29345a; }
.m-train { fill: var(--lamp); }
.m-city { cursor: pointer; }
.m-city circle.dot { fill: var(--night); stroke: #8f99b3; stroke-width: 1.6; transition: fill .2s, stroke .2s; }
.m-city circle.hit { fill: transparent; }
.m-city text { fill: var(--ink-2); font: 500 13px var(--sans); }
.m-city:hover circle.dot, .m-city:focus-visible circle.dot { stroke: var(--lamp); }
.m-city.is-from circle.dot, .m-city.is-to circle.dot { fill: var(--lamp); stroke: var(--lamp); }
.m-city.is-from text, .m-city.is-to text { fill: var(--ink); font-weight: 600; }
.m-city:focus { outline: none; }
.m-star { fill: #c8d2ff; }

/* Booking */
.book { padding: 40px 0 72px; border-top: 1px solid var(--line); background: var(--night-2); scroll-margin-top: 64px; }
.steps { list-style: none; display: flex; gap: 8px; padding: 0; margin: 0 0 24px; flex-wrap: wrap; }
.steps li { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; padding: 6px 14px 6px 6px; border-radius: 99px; border: 1px solid var(--line); }
.steps li span { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; background: var(--panel-2); }
.steps li.is-current { color: var(--ink); border-color: var(--lamp); }
.steps li.is-current span { background: var(--lamp); color: var(--lamp-ink); }
.steps li.is-done span { background: var(--panel-2); color: var(--lamp); }

.book__grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.panel__head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 24px; margin-bottom: 20px; }
.panel__head h2 { font-size: 26px; }
.panel__sub { color: var(--muted); font-size: 15px; width: 100%; }
.panel__actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; flex-wrap: wrap; }

.daystrip { display: flex; gap: 6px; max-width: 100%; }
.book__main { min-width: 0; }
.day { flex: none; white-space: nowrap; border: 1px solid var(--line); background: transparent; border-radius: var(--radius-s); padding: 6px 10px; min-width: 64px; cursor: pointer; text-align: center; line-height: 1.25; }
.day small { display: block; color: var(--muted); font-size: 12px; }
.day b { font-size: 14px; font-weight: 600; }
.day em { display: block; font-style: normal; font-size: 12px; color: var(--good); }
.day:hover { border-color: var(--muted); }
.day[aria-pressed="true"] { border-color: var(--lamp); background: var(--lamp-soft); }
.day:disabled { opacity: .35; cursor: not-allowed; }

.results { display: grid; gap: 12px; }
.train { display: grid; grid-template-columns: 1fr auto; gap: 16px 24px; align-items: center; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--night-2); }
.train__times { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; }
.train__t b { display: block; font-family: var(--display); font-size: 28px; font-weight: 600; line-height: 1; }
.train__t sup { font-family: var(--sans); font-size: 12px; color: var(--lamp); margin-left: 3px; vertical-align: top; }
.train__t small { color: var(--muted); font-size: 13px; }
.train__t--end { text-align: right; }
.train__track { position: relative; height: 22px; text-align: center; }
.train__track::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px dashed #445380; }
.train__track span { white-space: nowrap; position: relative; background: var(--night-2); padding: 0 10px; font-size: 13px; color: var(--muted); }
.train__meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 12px; }
.train__meta b { color: var(--ink-2); font-weight: 500; }
.train__price { text-align: right; }
.train__price small { display: block; color: var(--muted); font-size: 13px; }
.train__price strong { font-size: 22px; font-weight: 600; }
.train__price .btn { margin-top: 8px; }
.empty { padding: 32px; text-align: center; color: var(--ink-2); border: 1px dashed var(--line); border-radius: var(--radius); }
.empty p + p { margin-top: 8px; color: var(--muted); font-size: 15px; }
.link { background: none; border: 0; color: var(--lamp); text-decoration: underline; cursor: pointer; padding: 0; }

.options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.opt { position: relative; text-align: left; display: flex; flex-direction: column; gap: 10px; padding: 18px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--night-2); cursor: pointer; transition: border-color .15s, background .15s; }
.opt:hover { border-color: #46557f; }
.opt[aria-checked="true"] { border-color: var(--lamp); background: linear-gradient(180deg, var(--lamp-soft), transparent 70%), var(--night-2); }
.opt[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.opt h3 { font-size: 20px; }
.opt__price { font-size: 15px; color: var(--muted); }
.opt__price strong { font-size: 24px; color: var(--ink); font-weight: 600; }
.opt ul { margin: 0; padding: 0; list-style: none; font-size: 14px; color: var(--ink-2); display: grid; gap: 4px; }
.opt ul li::before { content: "·"; color: var(--lamp); margin-right: 8px; font-weight: 700; }
.opt__avail { font-size: 13px; margin-top: auto; color: var(--good); }
.opt__avail.is-low { color: var(--warn); }
.opt__check { position: absolute; top: 16px; right: 16px; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line); }
.opt[aria-checked="true"] .opt__check { border-color: var(--lamp); background: radial-gradient(circle, var(--lamp) 0 5px, transparent 6px); }

.extras { margin-top: 20px; display: grid; gap: 10px; }
.extras:empty { display: none; }
.extras h3:not(:first-child) { margin-top: 8px; }
.extras h3 { font-family: var(--sans); font-size: 14px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.choice-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: var(--radius-s); border: 1px solid var(--line); background: var(--night-2); cursor: pointer; font-size: 14px; }
.chip input { accent-color: var(--lamp); margin: 0; }
.chip:has(input:checked) { border-color: var(--lamp); background: var(--lamp-soft); }
.chip small { color: var(--muted); }

.paxfields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.paxfields .field__label b { color: var(--ink-2); font-weight: 500; }
.notice { margin-top: 20px; padding: 14px 16px; border-radius: var(--radius-s); background: var(--lamp-soft); border: 1px solid rgba(240, 180, 92, .35); font-size: 14px; color: var(--ink-2); }
.notice strong { color: var(--lamp); }
.notice--soft { background: var(--night-2); border-color: var(--line); }
.err { color: var(--warn); font-size: 13px; }

/* Summary */
.summary { position: sticky; top: 84px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.summary__title { font-size: 20px; margin-bottom: 14px; }
.summary__body { display: grid; gap: 14px; font-size: 14px; }
.sum-route { display: grid; grid-template-columns: 12px 1fr; gap: 0 12px; }
.sum-route i { grid-row: span 2; width: 12px; border-left: 2px solid var(--lamp); margin-left: 5px; position: relative; }
.sum-route i::before, .sum-route i::after { content: ""; position: absolute; left: -6px; width: 10px; height: 10px; border-radius: 50%; background: var(--lamp); }
.sum-route i::before { top: 4px; } .sum-route i::after { bottom: 4px; }
.sum-route div { padding: 2px 0; }
.sum-route div + div { padding-top: 12px; }
.sum-route b { display: block; font-size: 15px; }
.sum-route small { color: var(--muted); }
.sum-lines { display: grid; gap: 6px; border-top: 1px solid var(--line); padding-top: 14px; }
.sum-line { display: flex; justify-content: space-between; gap: 12px; color: var(--ink-2); }
.sum-total { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--line); padding-top: 14px; }
.sum-total strong { font-family: var(--display); font-size: 28px; }
.sum-muted { color: var(--muted); }

/* Sections */
.section { padding: 80px 0; }
.section--alt { background: var(--night-2); border-block: 1px solid var(--line); }
.section__head { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 32px; flex-wrap: wrap; }
.section__head h2 { font-size: clamp(28px, 3.4vw, 40px); }
.section__head p { color: var(--muted); max-width: 30em; }

.routecards { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.rc { width: 100%; text-align: left; display: grid; gap: 14px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); cursor: pointer; transition: border-color .15s, transform .15s; }
.rc:hover { border-color: var(--lamp); transform: translateY(-2px); }
.rc__cities { font-family: var(--display); font-size: 21px; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rc__cities svg { color: var(--lamp); flex: none; }
.rc__times { display: flex; justify-content: space-between; color: var(--ink-2); font-size: 14px; }
.rc__foot { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--line); padding-top: 12px; font-size: 14px; color: var(--muted); }
.rc__foot strong { color: var(--ink); font-size: 17px; }

.tiers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.tier { padding: 24px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); display: grid; gap: 10px; align-content: start; }
.tier--feature { border-color: rgba(240, 180, 92, .5); }
.tier__plan { width: 100%; max-width: 220px; height: auto; margin-bottom: 8px; }
.plan-wall { fill: var(--night); stroke: var(--line); stroke-width: 1.5; }
.plan-item rect { fill: var(--lamp); fill-opacity: .8; }
.tier h3 { font-size: 24px; }
.tier__from { color: var(--muted); }
.tier__from strong { color: var(--ink); font-size: 18px; }
.tier > p:not(.tier__from) { color: var(--ink-2); }
.ticks { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; font-size: 14px; color: var(--ink-2); }
.ticks li { padding-left: 22px; position: relative; }
.ticks li::before { content: ""; position: absolute; left: 2px; top: 6px; width: 10px; height: 6px; border-left: 2px solid var(--lamp); border-bottom: 2px solid var(--lamp); transform: rotate(-45deg); }

.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; }
.fact h3 { font-size: 19px; margin-bottom: 8px; }
.fact p { color: var(--muted); font-size: 15px; }

.foot { border-top: 1px solid var(--line); padding: 28px 0; }
.foot__inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center; }
.foot__note { color: var(--muted); font-size: 13px; }

/* Dialog */
.review { border: 1px solid var(--line); border-radius: 18px; background: var(--panel); color: var(--ink); padding: 0; width: min(520px, calc(100% - 32px)); }
.review::backdrop { background: rgba(5, 8, 16, .7); backdrop-filter: blur(3px); }
.review__inner { padding: 28px; display: grid; gap: 14px; }
.review h2 { font-size: 30px; }
.review dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 15px; }
.review dt { color: var(--muted); }
.review dd { margin: 0; text-align: right; }
.review .panel__actions { margin-top: 4px; }

@media (max-width: 980px) {
  .hero__grid { grid-template-columns: 1fr; }
  .map { max-width: 520px; margin-inline: auto; }
  .book__grid { grid-template-columns: minmax(0, 1fr); }
  .summary { position: static; }
  .options, .routecards, .tiers { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .wrap { width: calc(100% - 32px); }
  .top__nav { display: none; }
  .hero { padding: 40px 0 48px; }
  .m-city text { font-size: 19px; }
  .search__pair { grid-template-columns: 1fr; }
  .swap { justify-self: end; margin-block: -4px; height: 36px; transform: rotate(90deg); }
  .search__row { grid-template-columns: 1fr 1fr; }
  .search__go { grid-column: 1 / -1; }
  .panel { padding: 18px; }
  .train { grid-template-columns: 1fr; }
  .train__price { text-align: left; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .train__price .btn { margin-top: 0; }
  .daystrip { width: 100%; overflow-x: auto; }
  .paxfields, .facts { grid-template-columns: 1fr; }
  .section { padding: 56px 0; }
}
