:root {
  color-scheme: light;
  --ink: #142c2a;
  --muted: #61716f;
  --green: #0d3b36;
  --green-2: #17645b;
  --mint: #dff4eb;
  --paper: #f6f8f5;
  --line: #dce5df;
  --white: #fff;
  --amber: #fbf2df;
  --shadow: 0 18px 48px rgba(22, 53, 46, .08);
  font-family: 'Segoe UI', Arial, sans-serif;
  background: var(--paper);
  color: var(--ink);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; background: radial-gradient(circle at 82% 8%, #e8f3e9 0, transparent 29rem), var(--paper); }
button, input { font: inherit; }
button { cursor: pointer; }
.shell { max-width: 1120px; margin: 0 auto; padding: 0 28px 34px; }
.topbar { height: 62px; display: flex; align-items: center; gap: 16px; border-bottom: 1px solid rgba(13,59,54,.1); }
.brand { display: inline-flex; align-items: center; gap: 9px; min-width: 0; color: var(--green); font: 800 18px 'Segoe UI', sans-serif; text-decoration: none; letter-spacing: -.4px; }
.brand-mark { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 10px; color: #eafff5; background: var(--green); font-size: 19px; transform: rotate(0deg); }
.brand-subtitle { margin-left: 2px; padding-left: 10px; border-left: 1px solid var(--line); color: var(--green-2); font: 700 11px 'Segoe UI', sans-serif; letter-spacing: 1px; text-transform: uppercase; white-space: nowrap; }
.feed-status { margin-left: auto; color: var(--muted); font-size: 12px; text-align: right; }
.language-control { margin: 0; }
.language-control select { width: auto; height: 32px; padding: 0 25px 0 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--green); background: #fff; font-size: 11px; font-weight: 700; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.search-panel { margin-top: 17px; }
.startup-overlay { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 24px; background: rgba(15, 31, 28, .54); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.startup-overlay[hidden] { display: none; }
.startup-card { display: grid; justify-items: center; gap: 15px; width: min(100%, 440px); padding: 27px 25px 23px; border: 1px solid rgba(255,255,255,.6); border-radius: 17px; background: var(--white); box-shadow: 0 22px 70px rgba(0,0,0,.2); text-align: center; }
.startup-card strong { color: var(--green); font-size: 19px; font-weight: 800; line-height: 1.4; }
.startup-spinner { width: 30px; height: 30px; border: 3px solid #dcece3; border-top-color: var(--green-2); border-radius: 50%; animation: startup-spin .8s linear infinite; }
.startup-progress { width: 100%; height: 6px; overflow: hidden; border-radius: 10px; background: #e9f0eb; }
.startup-progress span { display: block; width: 4%; height: 100%; border-radius: inherit; background: var(--green-2); transition: width .25s ease; }
@keyframes startup-spin { to { transform: rotate(360deg); } }
.intro { padding: 45px 0 25px; }
.eyebrow { margin: 0 0 12px; color: var(--green-2); text-transform: uppercase; letter-spacing: 1.5px; font-size: 11px; font-weight: 700; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 12px; max-width: 700px; font: 800 clamp(36px, 5vw, 56px)/1.04 'Segoe UI', sans-serif; letter-spacing: -2.4px; color: var(--green); }
.lede { margin-bottom: 0; max-width: 640px; color: #526763; font-size: 16px; line-height: 1.55; }
.search-panel { position: relative; display: grid; grid-template-columns: minmax(150px, 1fr) 42px minmax(150px, 1fr) minmax(145px, .75fr) minmax(130px, .65fr) 190px; gap: 10px; align-items: end; padding: 18px; background: var(--white); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.station-field, .date-field, .time-field { position: relative; min-width: 0; }
label { display: block; margin: 0 0 7px 2px; color: #62736f; font-size: 11px; font-weight: 700; letter-spacing: .4px; }
input { width: 100%; height: 48px; border: 1px solid #dbe4df; border-radius: 11px; background: #fbfcfa; color: var(--ink); outline: none; padding: 0 12px; transition: border-color .15s, box-shadow .15s, background .15s; }
input::placeholder { color: #94a19d; }
input:focus { border-color: #3b8e7e; background: #fff; box-shadow: 0 0 0 3px rgba(46, 132, 116, .13); }
.swap-button { height: 48px; width: 42px; border: 1px solid var(--line); border-radius: 11px; color: var(--green-2); background: #f2f8f4; font-size: 22px; }
.swap-button:hover { background: var(--mint); }
.search-button { height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 0 15px; border: 0; border-radius: 11px; color: #effff7; background: var(--green); font-size: 13px; font-weight: 700; transition: background .15s, transform .15s; }
.search-button:hover { background: #14524a; transform: translateY(-1px); }
.search-button:disabled { cursor: wait; opacity: .65; transform: none; }
.filter-toolbar { display: flex; justify-content: flex-end; margin-top: 10px; }
.filters-toggle { display: inline-flex; align-items: center; gap: 9px; padding: 7px 10px; border: 1px solid transparent; border-radius: 9px; color: var(--green-2); background: transparent; font-size: 12px; font-weight: 700; }
.filters-toggle:hover, .filters-toggle.expanded { border-color: var(--line); background: #fff; }
.filter-count { padding: 3px 7px; border-radius: 20px; color: #61736d; background: #e8f1eb; font-size: 10px; font-weight: 500; }
.filter-chevron { color: #71827b; font-size: 15px; transition: transform .15s; }
.filters-toggle.expanded .filter-chevron { transform: rotate(180deg); }
.filter-panel { display: grid; grid-template-columns: minmax(190px,.8fr) minmax(0,1fr) minmax(280px,1.1fr); gap: 20px; margin-top: 2px; padding: 17px 19px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.88); box-shadow: 0 8px 24px rgba(22,53,46,.045); }
.filter-group h2 { margin: 0 0 4px; color: var(--green); font: 700 14px 'Segoe UI', sans-serif; }
.filter-group p { margin: 0 0 11px; color: #7b8983; font-size: 10px; }
.carrier-options { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 6px 10px; }
.carrier-option { display: flex; align-items: center; gap: 7px; min-width: 0; margin: 0; color: #40544d; font-size: 11px; font-weight: 500; letter-spacing: 0; cursor: pointer; }
.carrier-option input, .train-option input { width: 14px; height: 14px; flex: 0 0 14px; margin: 0; accent-color: var(--green-2); }
.carrier-option span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#train-filter-input { height: 38px; background: #fff; font-size: 12px; }
.train-search-results { max-height: 190px; overflow-y: auto; margin-top: 6px; border: 1px solid #e5ece7; border-radius: 9px; background: #fff; }
.train-option { display: flex; align-items: flex-start; gap: 9px; padding: 9px 10px; margin: 0; border-bottom: 1px solid #eef2ef; cursor: pointer; }
.train-option:last-child { border-bottom: 0; }
.train-option:hover { background: #f5faf6; }
.train-option input { margin-top: 2px; }
.train-option-copy { display: grid; gap: 3px; min-width: 0; }
.train-option-copy strong { overflow: hidden; color: #344943; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.train-option-copy small { overflow: hidden; color: #89958f; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.selected-trains { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.selected-trains-heading { flex-basis: 100%; color: #7a8982; font-size: 10px; }
.selected-train-chip { padding: 5px 8px; border: 1px solid #dce9df; border-radius: 20px; color: #28574a; background: #eff7f0; font-size: 10px; }
.selected-train-chip:hover { border-color: #bfd8c7; background: #e3f1e6; }
.filter-loading { color: #89958f; font-size: 11px; }
.suggestions { position: absolute; z-index: 5; top: calc(100% + 6px); left: 0; right: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 16px 35px rgba(22,53,46,.15); }
.suggestion { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 11px 12px; text-align: left; color: var(--ink); background: #fff; border: 0; border-bottom: 1px solid #eef2ef; }
.suggestion:last-child { border-bottom: 0; }
.suggestion:hover, .suggestion:focus { outline: 0; background: #f0f8f3; }
.suggestion-name { font-size: 13px; font-weight: 600; }
.suggestion-count { margin-left: 10px; color: #82918c; font-size: 10px; white-space: nowrap; }
.search-notes { display: flex; align-items: center; gap: 8px; padding: 15px 4px 0; color: #73817d; font-size: 11px; flex-wrap: wrap; }
.note-dot { width: 7px; height: 7px; border-radius: 50%; background: #58a383; }
.note-divider { color: #b2bfba; }
.results-section { min-height: 250px; padding-top: 29px; }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 250px; text-align: center; border: 1px dashed #d3ded7; border-radius: 17px; background: rgba(255,255,255,.46); }
.empty-icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 14px; border-radius: 16px; color: var(--green-2); background: #e2f0e8; font-size: 25px; }
.empty-state h2 { margin: 0 0 7px; font: 700 17px 'Segoe UI', sans-serif; color: var(--green); }
.empty-state p { margin: 0; color: var(--muted); font-size: 13px; }
.message.error { min-height: 100px; padding: 22px; border: 1px solid #f0d8d4; border-radius: 14px; background: #fff6f4; color: #913e34; }
.message.loading { min-height: 120px; display: grid; place-items: center; color: var(--muted); }
.results-header { display: flex; align-items: end; justify-content: space-between; margin-bottom: 14px; gap: 16px; }
.results-header h2 { margin-bottom: 4px; color: var(--green); font: 700 22px 'Segoe UI', sans-serif; letter-spacing: -.5px; }
.results-caption { margin: 0; color: var(--muted); font-size: 12px; }
.page-indicator { color: #697a75; font-size: 11px; white-space: nowrap; }
.results-list { display: grid; gap: 6px; }
.journey-card { min-width: 0; padding: 7px 9px 6px; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: 0 7px 20px rgba(20,48,43,.035); animation: reveal .24s ease both; }
@keyframes reveal { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.journey-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 4px; }
.journey-summary { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; min-width: 0; }
.journey-time-range { color: var(--green); font: 700 19px 'Segoe UI', sans-serif; letter-spacing: -.35px; white-space: nowrap; }
.journey-duration { color: #76847f; font-size: 11px; }
.change-badge { padding: 5px 8px; border-radius: 7px; color: #286253; background: #e7f5ec; font-weight: 700; }
.journey-route { display: grid; align-items: start; min-width: 0; overflow-x: auto; padding: 0 0 3px; scrollbar-width: thin; scrollbar-color: #c4d8cb transparent; }
.timeline-stop { position: relative; display: flex; flex-direction: column; align-items: flex-start; min-width: 0; padding: 0 8px 0 0; }
.timeline-stop.change { align-items: center; text-align: center; padding: 0 4px; }
.timeline-stop.destination { align-items: flex-end; text-align: right; padding: 0 0 0 8px; }
.timeline-dot { position: absolute; top: 5px; left: 0; z-index: 1; width: 8px; height: 8px; border: 2px solid #4e9a7c; border-radius: 50%; background: #fff; }
.timeline-stop.change .timeline-dot { left: 50%; transform: translateX(-50%); }
.timeline-stop.destination .timeline-dot { left: auto; right: 0; }
.timeline-name { display: block; max-width: 100%; overflow: hidden; margin-top: 17px; color: #334743; font-size: 12px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.timeline-time { margin-top: 4px; color: var(--green-2); font-size: 11px; font-weight: 700; white-space: nowrap; }
.timeline-wait { margin-top: 2px; color: #8a6c2d; font-size: 10px; white-space: nowrap; }
.timeline-platform { max-width: 100%; overflow: hidden; margin-top: 2px; color: #81908a; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.timeline-segment { position: relative; display: flex; flex-direction: column; align-items: center; min-width: 0; padding: 4px 5px 0; }
.timeline-rail { position: absolute; top: 4px; left: 0; right: 0; height: 1px; background: #a9cdb9; }
.timeline-train { position: relative; z-index: 1; display: flex; align-items: flex-start; gap: 4px; width: 100%; max-width: 100%; margin-top: 5px; padding: 3px 5px; border-radius: 6px; color: #5b766b; background: #f1f7f2; font-size: 9px; line-height: 1.25; text-align: center; cursor: pointer; }
.timeline-train input { width: 12px; height: 12px; flex: 0 0 12px; margin: 0; accent-color: var(--green-2); opacity: 0; transition: opacity .12s; }
.timeline-train span { min-width: 0; overflow-wrap: anywhere; white-space: normal; }
.timeline-train:hover input, .timeline-train:focus-within input, .timeline-train input:checked { opacity: 1; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 20px 0; }
.page-button { min-width: 112px; height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; color: var(--green); background: white; font-size: 12px; font-weight: 700; }
.page-button:hover:not(:disabled) { background: #eaf5ed; }
.page-button:disabled { cursor: default; opacity: .45; }
.page-count { min-width: 64px; color: #6c7b76; text-align: center; font-size: 11px; }
.warning { margin: 12px 0; padding: 11px 13px; border-radius: 9px; color: #765d2e; background: var(--amber); font-size: 11px; }
.footer { display: flex; justify-content: space-between; gap: 12px; padding-top: 27px; color: #8b9893; font-size: 10px; border-top: 1px solid rgba(13,59,54,.08); }
.feed-meta { display: grid; gap: 3px; text-align: right; }
.footer a { color: var(--green-2); text-decoration: underline; text-decoration-color: rgba(23,100,91,.35); text-underline-offset: 2px; }
.footer a:hover { text-decoration-color: currentColor; }

@media (max-width: 930px) {
  .search-panel { grid-template-columns: minmax(160px, 1fr) 42px minmax(160px, 1fr); }
  .date-field, .time-field { grid-row: 2; }
  .search-button { grid-column: 3; grid-row: 2; }
  .date-field { grid-column: 1; }
  .time-field { grid-column: 2; }
  .filter-panel { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 620px) {
  .shell { padding: 0 16px 25px; }
  .topbar { height: auto; min-height: 62px; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 4px 8px; padding: 8px 0; }
  .brand { display: grid; grid-template-columns: 27px minmax(0,1fr); grid-template-rows: auto auto; grid-column: 1; grid-row: 1; gap: 0 7px; font-size: 16px; }
  .brand-mark { grid-row: 1 / 3; width: 27px; height: 27px; font-size: 17px; }
  .brand-subtitle { grid-column: 2; margin: 0; padding: 0; border: 0; font-size: 11px; letter-spacing: .4px; white-space: nowrap; }
  .feed-status { grid-column: 1 / -1; grid-row: 2; max-width: none; margin: 0; text-align: left; font-size: 10px; }
  .language-control { grid-column: 2; grid-row: 1; }
  .search-panel { margin-top: 12px; }
  .intro { padding: 0; }
  h1 { letter-spacing: -1.6px; }
  .lede { font-size: 14px; }
  .search-panel { grid-template-columns: 1fr 42px 1fr; gap: 8px; padding: 12px; border-radius: 15px; }
  .station-field[data-field="from"] { grid-column: 1 / 3; }
  .swap-button { grid-column: 3; grid-row: 1; align-self: end; }
  .station-field[data-field="to"] { grid-column: 1 / 4; }
  .date-field { grid-column: 1; grid-row: auto; }
  .time-field { grid-column: 2 / 4; grid-row: auto; }
  .search-button { grid-column: 1 / 4; grid-row: auto; }
  .search-notes { align-items: flex-start; font-size: 10px; line-height: 1.45; }
  .note-dot { margin-top: 4px; flex: 0 0 7px; }
  .note-divider { display: none; }
  .results-header { align-items: start; }
  .journey-card { padding: 6px 7px; }
  .journey-heading { align-items: flex-start; }
  .journey-time-range { font-size: 17px; }
  .journey-summary { gap: 4px 8px; }
  .journey-duration { flex-basis: 100%; }
  .journey-route { margin-right: -5px; }
  .timeline-stop { min-width: 112px; }
  .timeline-segment { min-width: 104px; }
  .filter-panel { grid-template-columns: 1fr; gap: 18px; padding: 14px; }
  .carrier-options { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .footer { flex-direction: column; }
  .feed-meta { text-align: left; }
}
