:root {
  color-scheme: light;
  --bg: #fff;
  --paper: #fff;
  --text: #142844;
  --muted: #4e617a;
  --border: #dce5f0;
  --accent: #174ba1;
  --soft: #eef4fc;
  --red: #cc233b;
  --error: #af2037;
  --shadow: 0 12px 34px #17365a0f;
  font-family: "Segoe UI", system-ui, sans-serif;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101b2c;
  --paper: #17253a;
  --text: #edf4ff;
  --muted: #bfcee2;
  --border: #374b66;
  --accent: #a8cbff;
  --soft: #223754;
  --red: #ff8799;
  --error: #ffacb6;
  --shadow: 0 12px 34px #0003;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
button, select, summary { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
h1, h2, h3, p { margin: 0; }
svg { width: 19px; height: 19px; flex: none; vertical-align: middle; }
.container { width: min(1152px, calc(100% - 64px)); margin-inline: auto; }
.skip-link { position: fixed; z-index: 10; top: 8px; left: 8px; transform: translateY(-160%); padding: 12px; background: var(--paper); }
.skip-link:focus { transform: none; }
.topbar { background: var(--paper); border-bottom: 1px solid var(--border); }
.topbar-inner { min-height: 75px; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.brand { display: inline-flex; align-items: center; justify-self: start; text-decoration: none; font-size: 32px; font-weight: 800; letter-spacing: -.055em; }
.brand-icon { background: #174ba1; color: #fff; display: grid; place-items: center; border-radius: 11px; width: 38px; height: 38px; margin-right: 9px; }
.brand-dot { color: var(--red); }
nav { display: flex; gap: 6px; font-size: 14px; font-weight: 650; }
nav a { text-decoration: none; padding: 10px 14px; border-radius: 9px; color: var(--muted); }
nav a:hover, nav a[aria-current="page"] { background: var(--soft); color: var(--accent); }
.icon-button { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--border); border-radius: 11px; background: var(--paper); }
.icon-button:hover { background: var(--soft); }
.hero { overflow: hidden; display: grid; grid-template-columns: 55% 45%; min-height: 262px; margin-top: 26px; border: 1px solid var(--border); border-radius: 20px; background: var(--soft); }
.hero-copy { align-self: center; padding: 30px clamp(20px, 4vw, 46px); }
.eyebrow { display: flex; align-items: center; gap: 8px; color: var(--accent); font-size: 11px; letter-spacing: .15em; font-weight: 750; }
.hero h1 { margin: 13px 0 10px; font-size: clamp(36px, 5.4vw, 68px); line-height: 1.05; letter-spacing: -.057em; }
.hero h1 span { color: var(--red); }
.hero-copy > p:last-child { color: var(--muted); font-size: 15px; line-height: 1.55; max-width: 360px; }
.hero-photo { background: url("./coach.png") 66% 56% / cover, var(--soft); }
.search-panel { margin: 0 0 25px; display: grid; grid-template-columns: minmax(0, 2.4fr) minmax(130px, 1fr) auto; gap: 14px; align-items: end; padding: 19px; border: 1px solid var(--border); border-radius: 17px; background: var(--paper); box-shadow: var(--shadow); }
.route-fields { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; align-items: end; }
.search-panel label, .checkout-form label { display: grid; gap: 6px; font-size: 12px; font-weight: 750; min-width: 0; }
.field-control { min-width: 0; height: 46px; display: flex; align-items: center; gap: 3px; padding: 0 9px; border: 1px solid var(--border); border-radius: 9px; background: var(--soft); color: var(--accent); }
.field-control input, .field-control select { min-width: 0; width: 100%; height: 100%; border: 0; background: transparent; font-size: 14px; font-weight: 600; color: var(--text); }
select option { background: var(--paper); color: var(--text); }
.swap { margin-bottom: 5px; width: 36px; height: 36px; color: var(--accent); }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 43px; padding: 0 16px; border: 1px solid var(--border); border-radius: 9px; background: var(--paper); font-size: 14px; font-weight: 750; text-decoration: none; white-space: nowrap; }
.button:hover { background: var(--soft); }
.button.primary { background: #174ba1; border-color: #174ba1; color: #fff; }
.button.primary:hover { background: #113b81; }
:root[data-theme="dark"] .button.primary { color: #142844; background: #a8cbff; border-color: #a8cbff; }
:root[data-theme="dark"] .button.primary:hover { background: #cee1ff; }
.button:disabled { opacity: .55; cursor: default; }
.search-button { min-height: 46px; }
.form-error { grid-column: 1 / -1; color: var(--error); font-size: 14px; }
.section-heading { display: flex; gap: 12px; justify-content: space-between; align-items: end; margin-bottom: 14px; }
.section-heading h2 { font-size: clamp(23px, 3vw, 30px); letter-spacing: -.04em; }
.section-heading p, .subpage > p { color: var(--muted); font-size: 14px; margin-top: 5px; }
.sort-label { display: flex; gap: 7px; align-items: center; color: var(--muted); font-size: 12px; white-space: nowrap; }
.sort-label select { padding: 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--paper); color: var(--text); font-weight: 650; }
.departure-list, .ticket-list { display: grid; gap: 10px; }
.trip { display: grid; grid-template-columns: minmax(0, 1fr) minmax(86px, .56fr) minmax(0, 1fr) minmax(90px, .65fr) auto; align-items: center; gap: 17px; padding: 15px 19px; background: var(--paper); border: 1px solid var(--border); border-radius: 13px; }
.trip-time { display: block; font-size: 23px; font-weight: 750; letter-spacing: -.04em; }
.station { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.trip-duration { display: grid; gap: 5px; justify-items: center; color: var(--muted); font-size: 11px; white-space: nowrap; }
.duration-line { width: 100%; display: flex; align-items: center; gap: 5px; color: var(--accent); }
.duration-line::before, .duration-line::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.duration-line svg { width: 15px; height: 15px; }
.fare { text-align: right; }
.fare strong { font-size: 22px; letter-spacing: -.04em; }
.fare small { display: block; color: var(--muted); margin-top: 2px; font-size: 11px; }
.trip-action { display: grid; justify-items: center; gap: 3px; }
.availability { font-size: 11px; color: var(--accent); }
.routes { margin: 24px 0 26px; }
.results { margin-bottom: 30px; }
.route-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.route-card { width: 100%; text-align: left; display: flex; align-items: center; gap: 10px; padding: 13px; border: 1px solid var(--border); border-radius: 13px; background: var(--paper); box-shadow: var(--shadow); }
.route-card:hover { border-color: var(--accent); background: var(--soft); }
.route-card-icon { background: var(--soft); color: var(--accent); border-radius: 9px; padding: 8px; }
.route-card-cities { display: grid; gap: 4px; }
.route-card-cities > span { color: var(--muted); font-size: 13px; }
.route-card-cities svg { color: var(--accent); width: 13px; height: 13px; }
.route-card-fare { margin-left: auto; text-align: right; white-space: nowrap; color: var(--red); }
.route-card-fare small { display: block; font-size: 11px; color: var(--muted); }
.route-card-fare strong { font-size: 19px; letter-spacing: -.04em; }
.subpage { min-height: 65vh; padding: 48px 0; }
.subpage h1 { letter-spacing: -.055em; font-size: clamp(38px, 6vw, 64px); }
.contact-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); align-items: start; gap: 18px; margin-top: 25px; max-width: 870px; }
.contact-form, .contact-info { padding: clamp(16px, 3vw, 26px); border: 1px solid var(--border); border-radius: 14px; background: var(--paper); }
.contact-form { display: grid; gap: 13px; }
.contact-form .dialog-note { margin: 0; }
.contact-form label { display: grid; gap: 5px; font-size: 14px; font-weight: 650; }
.contact-form input, .contact-form select, .contact-form textarea { width: 100%; min-height: 44px; padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px; background: var(--soft); }
.contact-form textarea { resize: vertical; }
.contact-form .button { justify-self: start; }
#contact-status { font-size: 14px; color: var(--accent); }
#contact-status:empty { margin-top: -13px; }
.contact-info { background: var(--soft); }
.contact-info p { margin: 8px 0 15px; color: var(--muted); line-height: 1.6; }
.contact-info .button { margin: 0 4px 5px 0; }
.faq, .ticket-list { margin-top: 25px; max-width: 820px; }
.faq details, .empty, .ticket-card { padding: 18px 20px; margin-bottom: 8px; border: 1px solid var(--border); border-radius: 12px; background: var(--paper); }
.faq summary { font-weight: 700; }
.faq p, .empty p, .ticket-card p { color: var(--muted); line-height: 1.6; margin: 7px 0; }
.empty .button { margin-top: 7px; }
.ticket-card { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.ticket-card h3 { font-size: 18px; }
.footer { display: flex; justify-content: space-between; gap: 15px; border-top: 1px solid var(--border); padding-block: 20px; color: var(--muted); font-size: 13px; }
dialog { width: min(510px, calc(100% - 24px)); max-height: calc(100% - 30px); color: var(--text); border: 1px solid var(--border); border-radius: 17px; padding: 23px; background: var(--paper); box-shadow: var(--shadow); }
dialog::backdrop { background: #0a1712a8; }
.dialog-top { display: flex; justify-content: space-between; gap: 12px; align-items: start; margin-bottom: 14px; }
.dialog-top h2 { letter-spacing: -.04em; }
.dialog-top .icon-button { flex: none; }
.summary-box { background: var(--soft); border-radius: 10px; padding: 13px; margin-bottom: 14px; font-size: 14px; line-height: 1.55; }
.checkout-form { display: grid; gap: 12px; }
.checkout-form input { padding: 10px; min-height: 44px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); font-size: 15px; }
.dialog-note { color: var(--muted); font-size: 13px; line-height: 1.5; margin-bottom: 12px; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 1040px) {
  .search-panel { grid-template-columns: minmax(0, 1fr) auto; }
  .route-fields { grid-column: 1 / -1; }
  .route-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .container { width: calc(100% - 28px); }
  .topbar-inner { gap: 6px; min-height: 62px; }
  .brand { font-size: 25px; }
  .brand-icon { width: 30px; height: 30px; margin-right: 5px; border-radius: 8px; }
  .brand-icon svg { width: 16px; }
  nav { font-size: 12px; gap: 1px; }
  nav a { padding: 9px 6px; }
  .topbar .icon-button { width: 35px; height: 35px; }
  .hero { grid-template-columns: 1fr; min-height: 0; margin-top: 15px; border-radius: 16px; }
  .hero-copy { padding: 22px 17px; }
  .hero h1 { font-size: clamp(34px, 8.7vw, 52px); }
  .hero-copy > p:last-child { max-width: 265px; }
  .hero-photo { min-height: 120px; background-position: 66% 58%; }
  .search-panel { margin: 0 0 25px; padding: 12px; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; }
  .sort-label { display: grid; gap: 3px; }
  .sort-label select { max-width: 123px; padding: 6px 4px; }
  .trip { grid-template-columns: minmax(0, 1fr) minmax(52px, .65fr) minmax(0, 1fr); gap: 8px; padding: 12px; }
  .trip-time { font-size: 20px; }
  .fare { grid-column: 1; text-align: left; }
  .trip-action { grid-column: 2 / -1; justify-items: end; }
  .route-card-icon { display: none; }
  .route-card { padding: 10px; gap: 5px; }
  .route-card-cities strong, .route-card-cities > span { font-size: 12px; }
  .route-card-fare strong { font-size: 16px; }
  .contact-layout { grid-template-columns: 1fr; }
  .ticket-card { align-items: start; flex-direction: column; }
}
@media (max-width: 450px) {
  .topbar-inner { display: grid; grid-template-columns: 1fr auto; gap: 4px; padding: 8px 0; }
  .topbar nav { grid-column: 1 / -1; grid-row: 2; justify-content: space-between; }
}
