:root {
  --ink: #1b2130;
  --mute: #727a88;
  --line: #eceef2;
  --chip: #eef0f4;
  --accent: #d52b1e;
  --blue: #1d7fc0;
  --panel: rgba(255, 255, 255, .97);
}
* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden; background: #cfd4dc;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  color: var(--ink); -webkit-font-smoothing: antialiased;
}
canvas#c { display: block; width: 100vw; height: 100vh; cursor: grab; touch-action: none; }
canvas#c.drag { cursor: grabbing; }
canvas#c.hover { cursor: pointer; }

/* golden hour: a soft-light colour wash over the map (opacity set from the sun's altitude) */
#tint { position: fixed; inset: 0; pointer-events: none; mix-blend-mode: soft-light; opacity: 0; transition: opacity 2s, background-color 2s; }
/* tilt-shift: blur fading in towards the top and bottom edges makes the scene read as a miniature */
.tilt { position: fixed; left: 0; right: 0; pointer-events: none; -webkit-backdrop-filter: blur(2.6px); backdrop-filter: blur(2.6px); }
.tilt.top { top: 0; height: 28vh; -webkit-mask-image: linear-gradient(to bottom, #000 20%, transparent); mask-image: linear-gradient(to bottom, #000 20%, transparent); }
.tilt.bot { bottom: 0; height: 24vh; -webkit-mask-image: linear-gradient(to top, #000 20%, transparent); mask-image: linear-gradient(to top, #000 20%, transparent); }
body.no-tilt .tilt { display: none; }

.box { background: var(--panel); border-radius: 10px; box-shadow: 0 2px 14px rgba(0, 0, 0, .16); font-size: 12.5px; overflow: hidden; }
.side { position: fixed; left: 12px; top: 12px; width: 272px; max-height: calc(100vh - 24px); display: flex; flex-direction: column; }
.hd { display: flex; align-items: center; gap: 8px; padding: 11px 13px 3px; }
.hd b { font-size: 14px; flex: 1; }
.flag { width: 16px; height: 16px; border-radius: 3px; background: var(--accent); position: relative; flex: none; }
.flag::before, .flag::after { content: ""; position: absolute; background: #fff; }
.flag::before { left: 6.5px; top: 3px; width: 3px; height: 10px; }
.flag::after { left: 3px; top: 6.5px; width: 10px; height: 3px; }
.pill { font-size: 10.5px; padding: 2px 7px; border-radius: 99px; background: var(--chip); color: var(--mute); white-space: nowrap; }
.pill.sim { background: #fff3df; color: #a35b06; }
.pill.live { background: #e3f6ea; color: #16803c; }
.pill.live::before, .pill.sim::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; animation: blink 1.6s infinite; }
.pill.live::before { background: #22a355; }
.pill.sim::before { background: #f0a02a; }
@keyframes blink { 50% { opacity: .25; } }
.intro { margin: 3px 13px 9px; color: var(--mute); line-height: 1.45; }
.intro.small { font-size: 11.5px; margin-top: 0; }
.row { display: flex; align-items: center; justify-content: space-between; padding: 7px 13px; border-top: 1px solid var(--line); gap: 8px; cursor: default; color: inherit; text-decoration: none; }
.row.nav { cursor: pointer; }
.row.nav:hover { background: #f5f6f8; }
.row.nav::after { content: "›"; color: #9aa0ab; font-size: 15px; line-height: 1; }
.row.link { color: var(--blue); }
.v { color: var(--mute); text-align: right; font-variant-numeric: tabular-nums; margin-left: auto; }
.seg { display: flex; background: var(--chip); border-radius: 7px; padding: 2px; }
.seg button { border: 0; background: none; font: inherit; font-size: 11.5px; padding: 3px 7px; border-radius: 5px; cursor: pointer; color: #444; }
.seg button.on { background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .15); color: var(--ink); }
.tog { cursor: pointer; }
.tog input { appearance: none; width: 30px; height: 18px; border-radius: 9px; background: #d3d7df; position: relative; cursor: pointer; transition: .15s; margin: 0; flex: none; }
.tog input::after { content: ""; position: absolute; left: 2px; top: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: .15s; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.tog input:checked { background: var(--accent); }
.tog input:checked::after { left: 14px; }
.sub { display: none; }
.sub.open { display: block; }
.sub .back { display: flex; align-items: center; gap: 6px; padding: 11px 13px 7px; font-weight: 600; cursor: pointer; font-size: 13px; }
.sub .back::before { content: "‹"; font-size: 17px; color: var(--mute); line-height: .8; }
.list { max-height: 52vh; overflow: auto; }
.fl { display: grid; grid-template-columns: auto 1fr auto; gap: 2px 8px; padding: 7px 13px; border-top: 1px solid var(--line); cursor: pointer; align-items: center; }
.fl:hover { background: #f5f6f8; }
.fl .sw { width: 4px; height: 26px; border-radius: 2px; grid-row: span 2; }
.fl b { font-size: 12.5px; }
.fl .r { color: var(--mute); font-size: 11.5px; grid-column: 2/4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fl .a { color: var(--mute); font-size: 11.5px; text-align: right; font-variant-numeric: tabular-nums; }
.empty { padding: 12px 13px; color: var(--mute); border-top: 1px solid var(--line); }
.tabs { display: flex; gap: 4px; padding: 0 13px 8px; }
.tabs button { flex: 1; border: 0; border-radius: 6px; padding: 5px; font: inherit; font-size: 11.5px; cursor: pointer; background: var(--chip); color: #444; }
.tabs button.on { background: var(--ink); color: #fff; }
.rw { padding: 7px 13px; border-top: 1px solid var(--line); cursor: pointer; display: grid; grid-template-columns: 1fr auto; gap: 1px 8px; }
.rw:hover { background: #f5f6f8; }
.rw span { color: var(--mute); font-size: 11.5px; }
.use { font-size: 10.5px; padding: 1px 6px; border-radius: 4px; background: #e7f3fb; color: #17739f; justify-self: end; align-self: center; }
.use.dep { background: #fdf0e3; color: #a85a12; }
.use.off { background: var(--chip); color: var(--mute); }
.foot { padding: 8px 13px 10px; font-size: 10.5px; color: #8d94a2; line-height: 1.5; border-top: 1px solid var(--line); }
.foot a { color: inherit; }
.foot b { color: var(--ink); }

.card { position: fixed; left: 12px; top: 12px; width: 272px; max-height: calc(100vh - 24px); overflow: auto; }
.card .top { display: flex; align-items: center; gap: 8px; padding: 11px 13px 0; }
.card .top b { font-size: 14px; flex: 1; }
.card .top .sw { width: 4px; height: 16px; border-radius: 2px; }
.card .top button { border: 0; background: none; cursor: pointer; color: var(--mute); font-size: 16px; }
.card canvas { display: block; width: 100%; height: 120px; }
.card h4 { margin: 0; padding: 8px 13px 4px; font-size: 11.5px; display: flex; align-items: center; gap: 8px; }
.card h4::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.card dl { margin: 0; padding: 0 13px 6px; display: grid; grid-template-columns: auto 1fr; gap: 5px 10px; font-size: 11.5px; }
.card dt { color: var(--mute); }
.card dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .route { display: flex; align-items: center; gap: 8px; padding: 6px 13px 8px; }
.card .route div { flex: 1; min-width: 0; }
.card .route div:last-child { text-align: right; }
.card .route b { display: block; font-size: 20px; letter-spacing: -.01em; }
.card .route span { display: block; font-size: 11px; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .route i { font-style: normal; color: #9aa0ab; }
.card .meta { display: flex; justify-content: space-between; padding: 4px 13px 10px; font-size: 10.5px; color: #9aa0ab; }
.card .act { display: flex; gap: 6px; padding: 2px 13px 10px; }
.card .act button { flex: 1; border: 0; border-radius: 7px; padding: 6px; font: inherit; font-size: 11.5px; cursor: pointer; background: var(--chip); color: var(--ink); }
.card .act button.on { background: var(--accent); color: #fff; }

.board { position: fixed; right: 12px; top: 12px; width: 324px; max-height: calc(100vh - 44px); display: flex; flex-direction: column; }
.board .bhd { display: flex; align-items: center; gap: 8px; padding: 11px 13px 8px; }
.board .bhd b { font-size: 14px; flex: 1; }
.board .atc { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 99px; background: var(--ink); color: #fff; text-decoration: none; }
.board .atc:hover { background: var(--accent); }
.board .btabs { display: flex; gap: 4px; padding: 0 13px 8px; }
.board .btabs button { flex: 1; border: 0; border-radius: 7px; padding: 6px; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; background: var(--chip); color: #444; }
.board .btabs button.on { background: var(--ink); color: #fff; }
.board .bcols, .board .brow { display: grid; grid-template-columns: 4px 70px 1fr auto; gap: 0 8px; align-items: center; }
.board .bcols { padding: 4px 13px; font-size: 10.5px; color: var(--mute); text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--line); }
.board .bcols span:last-child { text-align: right; }
.board .blist { overflow: auto; }
.board .brow { padding: 6px 13px; border-bottom: 1px solid var(--line); cursor: pointer; }
.board .brow:hover { background: #f5f6f8; }
.board .brow i { align-self: stretch; border-radius: 2px; }
.board .brow b { font-size: 12.5px; font-variant-numeric: tabular-nums; display: block; }
.board .brow small { font-size: 10.5px; color: var(--mute); display: block; }
.board .brow .city { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board .brow .st { text-align: right; font-size: 11px; white-space: nowrap; }
.board .brow .st em { font-style: normal; display: block; font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); }
.board .st { color: var(--mute); }
.board .st.go { color: #16803c; }
.board .st.now { color: #c2410c; }
.board .st.late { color: var(--accent); }
.board .st.gone { color: var(--mute); }
.board .bempty { padding: 14px 13px; color: var(--mute); font-size: 12px; }
.board .bfoot { padding: 7px 13px; font-size: 10.5px; color: #8d94a2; border-top: 1px solid var(--line); }
.boardBtn { display: none; position: fixed; right: 12px; top: 12px; border: 0; border-radius: 99px; padding: 7px 13px; font: inherit; font-size: 12px; font-weight: 600; background: var(--ink); color: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .2); cursor: pointer; }

.hint { position: fixed; right: 12px; bottom: 10px; font-size: 11px; color: rgba(255, 255, 255, .8); text-align: right; pointer-events: none; text-shadow: 0 1px 2px rgba(0, 0, 0, .45); }

@media (max-width: 900px) {
  .board { display: none; top: 56px; max-height: calc(100vh - 80px); }
  .board.show { display: flex; }
  .boardBtn { display: block; }
}
@media (max-width: 600px) {
  .side, .card { width: calc(100vw - 24px); }
  .side { top: auto; bottom: 12px; max-height: 46vh; }
  .side .intro { display: none; }
  .card { top: auto; bottom: 12px; max-height: 60vh; }
  .board { left: 12px; right: 12px; width: auto; }
  .hint { display: none; }
}
