:root {
  --bg: #f5f7fa;
  --card: #fff;
  --text: #1a202c;
  --muted: #667085;
  --border: #dde3ea;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #12161c; --card: #1b212a; --text: #e6e9ee; --muted: #9aa4b2; --border: #2c3542; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.top { background: var(--accent); color: var(--accent-text); padding: 14px 16px; }
.top h1 { margin: 0 auto; max-width: 760px; font-size: 1.25rem; }
main { max-width: 760px; margin: 0 auto; padding: 16px; }
.picker, .results { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 16px; margin-bottom: 16px; }
label { display: block; font-size: .8rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
select { display: block; width: 100%; margin-top: 4px; padding: 10px; font-size: 1rem; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 8px; }
.stations { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: end; margin-top: 12px; }
.swap { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: var(--accent-text); text-decoration: none; font-size: 1.3rem; }
.swap.off { background: var(--border); color: var(--muted); }
.swap:hover { filter: brightness(1.1); }
.results h2 { margin: 0; font-size: 1.1rem; }
.arrow { color: var(--muted); }
.sub { margin: 4px 0 12px; color: var(--muted); font-size: .9rem; }
a { color: inherit; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: .75rem; text-transform: uppercase; color: var(--muted); padding: 6px 8px; }
td { padding: 10px 8px; border-top: 1px solid var(--border); }
td.time { font-weight: 600; white-space: nowrap; }
small { color: var(--muted); font-weight: 400; }
tr.past { opacity: .45; }
tr.next td { background: color-mix(in srgb, var(--accent) 14%, transparent); }
tr.next td:first-child { box-shadow: inset 4px 0 0 var(--accent); }
.mapcard { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 16px; margin-bottom: 16px; }
.mapcard h2 { margin: 0 0 10px; font-size: 1.1rem; }
.mapcard .sub { margin: 10px 0 0; }
#map { height: 380px; border-radius: 8px; z-index: 0; }
.train-icon { background: none; border: 0; }
.train { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--accent); color: var(--accent-text); border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .55); font-size: 13px; line-height: 1; }
.train span { display: block; }
.train.faded { opacity: .55; filter: grayscale(.6); }
.notice { background: var(--card); border: 1px dashed var(--border); border-radius: 10px; padding: 14px 16px; color: var(--muted); }
footer { max-width: 760px; margin: 0 auto; padding: 0 16px 24px; color: var(--muted); font-size: .8rem; }
@media (max-width: 560px) {
  .stations { grid-template-columns: 1fr; }
  .swap { justify-self: center; transform: rotate(90deg); }
  th:nth-child(4), td:nth-child(4) { display: none; }
}
