:root {
  --night: #0E1A2B;
  --panel: #15253B;
  --panel-2: #1B2F4A;
  --line: rgba(201, 213, 226, 0.14);
  --mist: #EEF2F6;
  --muted: #9FB0C3;
  --amber: #F2A93B;
  --green: #5FD39A;
  --red: #FF7A6E;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100svh;
  background: var(--night);
  color: var(--mist);
  font: 16px/1.5 Inter, system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column;
}
a { color: inherit; }
button, input { font: inherit; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.top { padding: 18px 16px 6px; max-width: 760px; width: 100%; margin: 0 auto; }
.logo {
  font-family: "Space Grotesk", sans-serif; font-weight: 700; font-size: 26px;
  letter-spacing: -0.03em; text-decoration: none;
}
.logo .dot { color: var(--amber); }

main { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 8px 16px 32px; }

/* Search */
.search { display: grid; gap: 12px; margin-bottom: 20px; }
.mode { display: inline-grid; grid-template-columns: 1fr 1fr; background: var(--panel); border-radius: 999px; padding: 4px; width: max-content; }
.mode input { position: absolute; opacity: 0; pointer-events: none; }
.mode span {
  display: block; padding: 8px 18px; border-radius: 999px; cursor: pointer;
  font-weight: 600; font-size: 15px; color: var(--muted); text-align: center;
}
.mode input:checked + span { background: var(--amber); color: var(--night); }
.mode input:focus-visible + span { outline: 2px solid var(--mist); outline-offset: 2px; }

.field label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 0 0 6px 4px; }
.combo { position: relative; }
.combo input {
  width: 100%; padding: 14px 16px; border-radius: 16px;
  background: var(--panel); border: 1px solid var(--line); outline: none;
  font-size: 18px;
}
.combo input:focus { border-color: var(--amber); }
.suggest {
  position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 6px);
  margin: 0; padding: 6px; list-style: none;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  max-height: 340px; overflow-y: auto;
}
.suggest li {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 10px 12px; border-radius: 10px; cursor: pointer;
}
.suggest li[aria-selected="true"], .suggest li:hover { background: rgba(242, 169, 59, 0.16); }
.suggest .crs { color: var(--muted); font-family: "Space Grotesk", sans-serif; font-weight: 600; }

.filter summary { cursor: pointer; color: var(--muted); font-size: 14px; font-weight: 600; padding: 2px 4px; width: max-content; }
.filter[open] summary { margin-bottom: 8px; }

.recent { display: flex; flex-wrap: wrap; gap: 8px; }
.recent button {
  border: 1px solid var(--line); background: transparent; border-radius: 999px;
  padding: 6px 12px; font-size: 14px; cursor: pointer; color: var(--muted);
}
.recent button:hover { color: var(--mist); border-color: var(--muted); }

/* Board */
.board-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.board-head h1 { margin: 0; font: 600 clamp(24px, 6vw, 32px)/1.15 "Space Grotesk", sans-serif; letter-spacing: -0.02em; }
.updated { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.refresh {
  flex: none; width: 42px; height: 42px; border-radius: 50%;
  background: var(--panel); border: 1px solid var(--line); cursor: pointer;
  display: grid; place-items: center;
}
.refresh.spin svg { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.messages { display: grid; gap: 8px; margin-bottom: 12px; }
.messages p {
  margin: 0; padding: 10px 14px; border-radius: 12px; font-size: 14px;
  background: rgba(242, 169, 59, 0.12); color: #F7D9A8;
}

.services { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.service { background: var(--panel); border-radius: 16px; overflow: hidden; }
.service > a {
  display: grid; grid-template-columns: 76px 1fr auto; gap: 12px; align-items: center;
  padding: 14px; text-decoration: none; border-radius: 16px;
}
.service > a:hover { background: rgba(255, 255, 255, 0.04); }
.service > a:focus-visible { outline: 2px solid var(--amber); outline-offset: -2px; }
.time { font: 600 22px/1 "Space Grotesk", sans-serif; letter-spacing: -0.01em; }
.state { display: block; margin-top: 5px; font-size: 12px; font-weight: 600; }
.on-time .state { color: var(--green); }
.late .state, .delayed .state { color: var(--amber); }
.cancelled .state { color: var(--red); }
.cancelled .time { text-decoration: line-through; color: var(--muted); }
.unknown .state { color: var(--muted); }
.where { min-width: 0; }
.where strong { display: block; font-size: 17px; font-weight: 600; line-height: 1.25; }
.where small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.plat { text-align: center; min-width: 46px; }
.plat b { display: block; font: 600 20px/1 "Space Grotesk", sans-serif; }
.plat span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.reason { margin: -4px 14px 12px 102px; font-size: 13px; color: var(--muted); }

.status { text-align: center; color: var(--muted); padding: 32px 0; }
.status.error { color: var(--red); }

.credits {
  max-width: 760px; width: 100%; margin: 0 auto;
  padding: 16px 16px calc(20px + env(safe-area-inset-bottom));
  font-size: 12px; color: var(--muted); line-height: 1.6;
}

@media (max-width: 420px) {
  .service > a { grid-template-columns: 70px 1fr auto; gap: 10px; padding: 12px; }
  .reason { margin-left: 92px; }
  .time { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .refresh.spin svg { animation: none; }
}

/* Weather */
.here-weather { margin: 6px 0 0; font-size: 15px; color: var(--mist); }
.here-weather:empty { display: none; }
.wx { white-space: nowrap; color: var(--mist); display: inline-flex; align-items: center; gap: 4px; vertical-align: -3px; }
.wx .wxi { flex: none; }
.wx:empty { display: none; }
.board-head > div { min-width: 0; }
.here-weather .wx { white-space: normal; }
