:root {
  color-scheme: light dark;
  --bg: light-dark(#f5f6f8, #0b0c10);
  --glow: light-dark(rgb(110 130 255 / .12), rgb(110 130 255 / .10));
  --surface: light-dark(#ffffff, #131519);
  --surface-2: light-dark(#f1f2f5, #1a1d23);
  --hover: light-dark(#f7f8fa, #171a1f);
  --border: light-dark(rgb(12 16 24 / .08), rgb(255 255 255 / .07));
  --border-strong: light-dark(rgb(12 16 24 / .16), rgb(255 255 255 / .14));
  --text: light-dark(#0d0f13, #eef0f4);
  --text-2: light-dark(#5b6170, #9aa0ad);
  --text-3: light-dark(#6b7080, #8a90a0);
  --green: light-dark(#087a45, #3ddc84);
  --amber: light-dark(#8f5400, #ffb547);
  --red: light-dark(#d4322a, #ff6b5f);
  --shadow: light-dark(rgb(16 24 40 / .14), rgb(0 0 0 / .55));
  --radius: 16px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: 520px;
  background: radial-gradient(55% 70% at 50% 0%, var(--glow), transparent 70%);
  pointer-events: none;
  z-index: -1;
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.icon {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wrap {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding-inline: 20px;
}

/* Header */

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
}

.top-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 650;
  font-size: 17px;
  letter-spacing: -.02em;
}

.mark { width: 28px; height: 28px; }
.mark-ink { fill: var(--bg); }
.mark-live { fill: var(--green); }

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  margin-right: 14px;
  padding: 6px 12px 6px 10px;
  border-radius: 999px;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 560;
  text-decoration: none;
}
.nav-link:hover { background: var(--surface); color: var(--text); }
@media (max-width: 420px) { .nav-link span { display: none; } }
.nav-link + .clock { margin-left: 0; }

.lang-switch {
  display: flex;
  margin-left: 12px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 999px;
}
.lang-switch button {
  padding: 3px 8px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--text-2);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
  cursor: pointer;
}
.lang-switch button:hover { color: var(--text); }
.lang-switch button[aria-pressed="true"] { background: var(--text); color: var(--bg); }
@media (forced-colors: active) {
  .lang-switch button[aria-pressed="true"] { forced-color-adjust: none; background: Highlight; color: HighlightText; }
}

.clock {
  margin-left: auto;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* Hero & search */

.hero {
  margin: 56px 0 28px;
  font-size: clamp(32px, 6vw, 48px);
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -.035em;
}

.hero br + span { color: var(--text-3); }

body.on-board .hero { display: none; }

.search {
  position: relative;
  z-index: 5;
  margin-top: 16px;
}

.field {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 52px;
  padding: 0 14px 0 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 1px 2px var(--shadow), 0 8px 24px -16px var(--shadow);
  color: var(--text-2);
  transition: border-color .15s, box-shadow .15s;
}

.field:focus-within {
  border-color: var(--border-strong);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--text) 7%, transparent), 0 8px 24px -16px var(--shadow);
}

.field input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: none;
  outline: none;
  color: var(--text);
  font-size: 16px;
}

.field input::placeholder { color: var(--text-3); }

.field kbd {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  color: var(--text-3);
  font: 12px var(--font);
}

.field:focus-within kbd { visibility: hidden; }

.results {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline: 0;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 24px 60px -12px var(--shadow);
  animation: pop .16s var(--ease);
}

.results li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
}

.results li[aria-selected="true"] { background: var(--surface-2); }

.results .kind {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--text-2);
}

.results li[aria-selected="true"] .kind { background: var(--surface); }

.results .name { display: block; font-weight: 560; }
.results .name mark { background: none; color: inherit; text-decoration: underline 2px color-mix(in srgb, var(--text) 30%, transparent); text-underline-offset: 3px; }
.results .place { display: block; color: var(--text-2); font-size: 13px; }
.results .empty { color: var(--text-2); cursor: default; }

/* Home */

.home { padding: 36px 0 64px; }

.label {
  margin: 28px 0 12px;
  color: var(--text-3);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.home > div:first-child .label { margin-top: 0; }

.stop-chips { display: flex; flex-wrap: wrap; gap: 8px; }

.stop-chip {
  display: inline-flex;
  flex-direction: column;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  line-height: 1.3;
  transition: border-color .15s, transform .15s var(--ease);
}

.stop-chip:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.stop-chip b { font-weight: 560; }
.stop-chip small { color: var(--text-2); font-size: 12px; }

/* Board */

.board { padding: 36px 0 64px; }

.board-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0 16px;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
}

.board h1:focus { outline: none; }
.board-head .title { flex: 1 1 0; min-width: 0; }

.board h1 {
  margin: 0;
  overflow-wrap: break-word;
  hyphens: auto;
  font-size: clamp(28px, 5vw, 38px);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -.03em;
}

.stop-lines {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

/* The lines take a row of their own, under the name and the buttons. */
.board-head .stop-lines { flex: 1 0 100%; }

.stop-lines .badge {
  min-width: 34px;
  height: 22px;
  padding: 0 6px;
  border-radius: 6px;
  font-size: 12px;
}

.stop-lines .badge.sbahn { border-radius: 999px; }

.board-actions { display: flex; flex: none; gap: 8px; }

.round {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-2);
  box-shadow: 0 0 0 1px var(--border);
}

.round:hover { color: var(--text); }
.round .icon { width: 16px; height: 16px; }

.refresh .ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  fill: none;
  stroke: var(--text-3);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 100.53;
  stroke-dashoffset: 100.53;
}

.refresh.counting .ring { animation: countdown var(--refresh, 30s) linear forwards; }
.refresh.loading .icon { animation: spin .8s linear infinite; }

.modes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.modes::-webkit-scrollbar { display: none; }

.mode {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  height: 34px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  transition: background .15s, color .15s, border-color .15s;
}

.mode:hover { border-color: var(--border-strong); color: var(--text); }
.mode[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }
.mode .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 1px color-mix(in srgb, var(--text) 20%, transparent); }
.mode .count { color: var(--text-3); font-variant-numeric: tabular-nums; }
.mode[aria-pressed="true"] .count { color: color-mix(in srgb, var(--bg) 60%, transparent); }

/* Forced colors drop the pressed chip's background: mark it in system colors. */
@media (forced-colors: active) {
  .mode[aria-pressed="true"] { forced-color-adjust: none; background: Highlight; border-color: Highlight; color: HighlightText; }
  .mode[aria-pressed="true"] .count { color: HighlightText; }
  .mode .dot { forced-color-adjust: none; }
}

/* Alerts */

.alerts {
  margin-top: 16px;
  border: 1px solid color-mix(in srgb, var(--amber) 28%, transparent);
  border-radius: 14px;
  background: color-mix(in srgb, var(--amber) 7%, var(--surface));
}

.alerts > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  list-style: none;
  cursor: pointer;
  font-size: 14px;
}

.alerts > summary::-webkit-details-marker { display: none; }
.alerts > summary .icon { color: var(--amber); }
.alerts > summary b { flex: none; font-weight: 600; }
.alerts > summary .first { flex: 1; min-width: 0; overflow: hidden; color: var(--text-2); text-overflow: ellipsis; white-space: nowrap; }
.alerts > summary .chev { color: var(--text-3); transition: transform .2s var(--ease); }
.alerts[open] > summary .chev { transform: rotate(180deg); }

.alert-list { margin: 0; padding: 0 16px 6px; list-style: none; }
.alert-list > li { padding: 14px 0; border-top: 1px solid color-mix(in srgb, var(--amber) 18%, transparent); }
.alert-list h3 { margin: 0 0 6px; font-size: 14px; font-weight: 600; }
.alert-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; color: var(--text-2); font-size: 12px; }
.alert-meta .badge { min-width: 0; height: 20px; padding: 0 6px; font-size: 11px; border-radius: 5px; }
.alert-text { color: var(--text-2); font-size: 13.5px; }
.alert-text :is(p, ul, ol) { margin: 4px 0; }
.alert-text ul, .alert-text ol { padding-left: 20px; }
.alert-text b, .alert-text strong { color: var(--text); font-weight: 600; }
.alert-text a { color: inherit; }

.notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0 0;
  padding: 10px 12px 10px 16px;
  border: 1px solid color-mix(in srgb, var(--red) 30%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--red) 7%, var(--surface));
  color: var(--text-2);
  font-size: 14px;
}

.notice button {
  flex: none;
  padding: 5px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 500;
}

/* Departure table */

.table-card {
  margin-top: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 1px 2px var(--shadow), 0 12px 32px -24px var(--shadow);
}

table { width: 100%; border-collapse: collapse; }

th {
  padding: 12px 16px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text-3);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .05em;
  text-align: left;
  text-transform: uppercase;
}

td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: 0; }
tbody tr { position: relative; transition: background .12s; cursor: pointer; }

/* The destination links to the journey; its ::after makes the whole row clickable. */
.row-link { color: inherit; text-decoration: none; }
.row-link::after { content: ""; position: absolute; inset: 0; }
.row-link:focus-visible { outline: none; }
tbody tr:has(.row-link:focus-visible) { outline: 2px solid var(--text); outline-offset: -2px; }
/* Things with a tooltip sit above the stretched link. */
.dir span[role="img"], td.plat.changed > span, .in .live { position: relative; z-index: 1; }
tbody tr:hover { background: var(--hover); }
.table-card.enter tbody tr { animation: rise .35s var(--ease) both; animation-delay: calc(min(var(--i), 20) * 18ms); }

th.line, td.line { width: 1%; padding-right: 4px; }
th.time, td.time { width: 1%; white-space: nowrap; }
th.plat, td.plat { width: 1%; white-space: nowrap; }
th.in, td.in { width: 1%; text-align: right; white-space: nowrap; }

.badge {
  display: inline-grid;
  place-items: center;
  min-width: 46px;
  height: 28px;
  padding: 0 8px;
  border-radius: 7px;
  background: var(--bg-c, var(--surface-2));
  color: var(--fg-c, var(--text));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 14%, transparent);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -.01em;
  white-space: nowrap;
}

.badge.sbahn { border-radius: 999px; }
.badge.long { font-size: 12px; }

.dest { min-width: 0; overflow-wrap: break-word; hyphens: auto; }
.dir { font-size: 15.5px; font-weight: 560; }
.dir .icon { width: 14px; height: 14px; margin-left: 6px; color: var(--amber); vertical-align: -1px; }
.sub { display: none; margin-top: 2px; color: var(--text-2); font-size: 13px; }

.time { font-variant-numeric: tabular-nums; }
td.plat .part { display: block; color: var(--text-2); font-size: 12px; font-weight: 500; }
.dest .sub span[lang] { color: var(--text-2); }
.delay { margin-left: 4px; font-size: 13px; font-weight: 600; }
.delay.slight { color: var(--amber); }
.delay.late { color: var(--red); }

.plat { color: var(--text-2); font-variant-numeric: tabular-nums; }
.plat.changed { color: var(--amber); font-weight: 600; }

.in { font-variant-numeric: tabular-nums; }
.in b { font-size: 20px; font-weight: 650; letter-spacing: -.02em; }
.in small { margin-left: 3px; color: var(--text-2); font-size: 12px; }
.in .clocktime { font-size: 15px; font-weight: 560; }
.in .now { color: var(--green); font-size: 15px; font-weight: 650; }

.live {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--green);
  vertical-align: 4px;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 22%, transparent);
}

tr.cancelled .dir, tr.cancelled .time { color: var(--text-3); text-decoration: line-through; }
tr.cancelled .badge { opacity: .45; }
.cancel-tag { color: var(--red); font-size: 13px; font-weight: 600; }

/* States */

.state {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 56px 24px;
  color: var(--text-2);
  text-align: center;
}

.state b { color: var(--text); font-size: 16px; font-weight: 600; }

.state button {
  margin-top: 10px;
  padding: 8px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  font-weight: 500;
}

.skeleton td { padding-block: 16px; }
.skeleton span {
  display: block;
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--hover) 50%, var(--surface-2) 75%);
  background-size: 300% 100%;
  animation: shimmer 1.3s linear infinite;
}
.skeleton .line span { width: 46px; height: 28px; border-radius: 7px; }

/* Narrow screens: fold time and platform under the destination */

@media (max-width: 600px) {
  .wrap { padding-inline: 16px; }
  /* The scroller clips: leave room for the chips' focus ring. */
  .modes { flex-wrap: nowrap; margin: 20px -16px -2px; padding: 4px 16px; overflow-x: auto; scrollbar-width: none; }
  .badge.long { font-size: 11px; padding: 0 6px; }
  .hero { margin-top: 36px; }
  th.time, td.time, th.plat, td.plat { display: none; }
  .sub { display: block; }
  /* Fixed columns give the destination all remaining space. */
  table { table-layout: fixed; }
  th.line { width: 72px; }
  th.in { width: 84px; }
  td { padding: 12px 10px; }
  td.line { padding-right: 2px; }
  th { padding-inline: 10px; font-size: 11px; letter-spacing: 0; }
  .cancel-tag { font-size: 12px; }
  .badge { min-width: 42px; }
}

@media (max-width: 360px) {
  th.line { width: 62px; }
  th.in { width: 80px; }
  .badge { min-width: 38px; padding: 0 6px; font-size: 13px; }
  .dir { font-size: 14.5px; }
  .in b { font-size: 18px; }
}

@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.99); } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes countdown { to { stroke-dashoffset: 0; } }
@keyframes shimmer { to { background-position: -150% 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
