/* Placeholder styling: functional first, real design later. */
:root {
  --bg: #fbfaf7;
  --fg: #1d1d1b;
  --muted: #6b6a65;
  --line: #e4e1d9;
  --land: #efece4;
  --on_time: #2f9e5b;
  --minor_delays: #e0a020;
  --major_delays: #d0453a;
  --no_active_trains: #b9b6ad;
  --unknown: #b9b6ad;
  --late: var(--minor_delays);
  --very_late: var(--major_delays);
  --code-bg: #f1eee6;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161615;
    --fg: #ecebe6;
    --muted: #9c9a93;
    --line: #2e2d2a;
    --land: #23221f;
    --no_active_trains: #55534d;
    --unknown: #55534d;
    --code-bg: #23221f;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.5 system-ui, -apple-system, sans-serif;
}
main { max-width: 720px; margin: 0 auto; padding: 32px 16px 64px; }
h1 { margin: 0; font-size: 28px; }
h2 { margin-top: 56px; font-size: 20px; }
h3 { margin: 24px 0 8px; font-size: 15px; }
a { color: inherit; }
.sub, .muted { color: var(--muted); }
code, pre { font: 13px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; }
pre { background: var(--code-bg); padding: 12px; border-radius: 8px; overflow-x: auto; }
:not(pre) > code { background: var(--code-bg); padding: 1px 5px; border-radius: 4px; }

#map-wrap { position: relative; margin-top: 16px; }
#map { width: 100%; height: auto; display: block; }
#map .land { fill: var(--land); stroke: none; }
#map .route { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: opacity .15s, stroke-width .15s; }
#map .hit { fill: none; stroke: transparent; stroke-width: 14; cursor: pointer; }
#map.has-focus .route { opacity: .25; }
#map.has-focus .route.focus { opacity: 1; stroke-width: 3.5; }
#map .train { stroke: var(--bg); stroke-width: 1; pointer-events: none; }

#tooltip {
  position: absolute; pointer-events: none; transform: translate(-50%, calc(-100% - 12px));
  background: var(--fg); color: var(--bg); font-size: 13px; padding: 4px 8px; border-radius: 6px; white-space: nowrap;
}

.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--muted); margin-top: 8px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.dot.on_time { background: var(--on_time); }
.dot.minor_delays, .dot.late { background: var(--minor_delays); }
.dot.major_delays, .dot.very_late { background: var(--major_delays); }
.dot.no_active_trains, .dot.unknown { background: var(--no_active_trains); }

#route-info { margin-top: 20px; min-height: 48px; }
#route-info h3 { margin: 0 0 4px; font-size: 18px; }
#route-info ul { list-style: none; padding: 0; margin: 12px 0 0; }
#route-info li { padding: 6px 0; border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: baseline; }
#route-info li .grow { flex: 1; min-width: 0; }
#route-info li .delay { white-space: nowrap; color: var(--muted); font-size: 14px; }

.copy-row { display: flex; gap: 8px; align-items: center; }
.copy-row code { flex: 1; padding: 8px 10px; font-size: 15px; overflow-x: auto; white-space: nowrap; }
button {
  font: inherit; font-size: 14px; padding: 7px 14px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--bg); color: var(--fg); cursor: pointer;
}
.tools { padding-left: 18px; }
.tools li { margin: 4px 0; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
td { padding: 8px 8px 8px 0; border-top: 1px solid var(--line); vertical-align: top; }
td:first-child { white-space: nowrap; }
@media (max-width: 560px) {
  td { display: block; border: 0; padding: 2px 0; }
  tr { display: block; border-top: 1px solid var(--line); padding: 8px 0; }
}

footer { margin-top: 64px; font-size: 13px; color: var(--muted); }

/* A compact station directory, with the map still taking the lead. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.small { font-size: 12px; }
.eyebrow { margin: 0 0 7px; font-size: 10px; font-weight: 650; letter-spacing: .13em; color: var(--muted); }
#stations { margin-top: 32px; padding-top: 28px; border-top: 1px solid var(--line); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.section-heading h2 { margin: 0; font-size: 25px; font-weight: 600; letter-spacing: -.7px; }
.search-box { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 9px; padding: 11px 13px; color: var(--muted); background: var(--bg); }
.search-box:focus-within { border-color: var(--fg); outline: 2px solid var(--line); outline-offset: 2px; }
.search-box input { min-width: 0; flex: 1; border: 0; background: transparent; outline: 0; font: inherit; font-size: 14px; color: var(--fg); }
.search-box input::placeholder { color: var(--muted); }
.search-box svg { flex-shrink: 0; }
.search-hint { font-size: 10px; }
#station-summary { margin: 17px 0 8px; }
.station-table th { color: var(--muted); font-size: 10px; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; text-align: left; padding: 8px 0; }
.station-table td { padding: 13px 0; vertical-align: middle; }
.station-table td:first-child { white-space: normal; }
.station-table th:nth-child(2), .station-table td:nth-child(2) { width: 60px; }
.station-table th:last-child, .station-table td:last-child { width: 105px; text-align: right; }
.station-table tbody tr:hover { background: var(--code-bg); }
.station-link { text-decoration: none; font-size: 14px; font-weight: 550; display: inline-block; padding: 3px 0; }
.station-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.station-detail { display: block; margin: 1px 0 0; color: var(--muted); font-size: 11px; font-weight: 400; }
.state-cell { font-size: 12px; color: var(--muted); }
.next-countdown { font-size: 15px; font-weight: 550; font-variant-numeric: tabular-nums; }
.station-table .empty-state { text-align: left; padding: 28px 0; color: var(--muted); }
.station-controls { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.text-button { padding: 4px 0; border: 0; border-radius: 0; font-size: 12px; }
.text-button:hover { text-decoration: underline; text-underline-offset: 3px; }
button:disabled { opacity: .4; cursor: default; }
#station-pagination button { font-size: 12px; padding: 5px 9px; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--fg); outline-offset: 4px; }
.station-nav { display: flex; align-items: center; justify-content: space-between; font-size: 13px; }
.station-nav a { text-decoration: none; }
.station-nav a:hover { text-decoration: underline; }
.wordmark { font-weight: 650; letter-spacing: -.3px; }
.station-header { margin: 52px 0 36px; }
.station-header h1 { font-size: clamp(28px, 5vw, 38px); font-weight: 600; letter-spacing: -1.2px; line-height: 1.2; }
.station-header .sub { margin-top: 12px; font-size: 14px; }
.station-code { display: inline-block; border: 1px solid var(--line); border-radius: 4px; padding: 2px 5px; margin-left: 6px; }
.board-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.board-tabs { display: flex; gap: 18px; }
.board-tabs button { border: 0; border-radius: 0; background: none; padding: 12px 0; color: var(--muted); border-bottom: 2px solid transparent; }
.board-tabs button[aria-pressed="true"] { border-bottom-color: var(--fg); color: var(--fg); font-weight: 600; }
#board-message { min-height: 18px; margin: 14px 0; }
.train-card { display: grid; grid-template-columns: 100px minmax(0, 1fr) auto; align-items: start; gap: 16px; padding: 21px 0; border-top: 1px solid var(--line); }
.train-time time { font-size: 19px; font-weight: 550; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.train-journey h2 { margin: 0; font-size: 16px; font-weight: 550; }
.train-journey .small { margin: 6px 0 0; }
.train-status { font-size: 11px; white-space: nowrap; border: 1px solid var(--line); border-radius: 5px; padding: 3px 7px; margin-top: 2px; }
.train-status.on-time { color: var(--on_time); }
.train-status.scheduled { color: var(--muted); }
.train-status.delayed, .feed-warning { color: var(--major_delays); }
.board-empty { border-top: 1px solid var(--line); padding: 30px 0; }
.board-empty h2 { font-size: 20px; margin: 0 0 8px; }
@media (max-width: 560px) {
  .station-table tr { display: table-row; padding: 0; }
  .station-table td { display: table-cell; padding: 13px 0; border-top: 1px solid var(--line); }
  .station-table th:nth-child(2), .station-table td:nth-child(2) { width: 40px; }
  .station-table th:last-child, .station-table td:last-child { width: 85px; }
  .search-hint { display: none; }
  .section-heading > .small { font-size: 10px; }
  .train-card { grid-template-columns: 82px minmax(0, 1fr); gap: 7px 12px; }
  .train-time time { font-size: 17px; }
  .train-status { grid-column: 2; justify-self: start; }
  .station-header { margin-top: 36px; }
  .station-controls { gap: 10px; }
  #station-feed-note { width: 100%; font-size: 10px; }
}
