:root {
  color-scheme: dark;
  --bg: #101923;
  --panel: #172432;
  --panel-strong: #203244;
  --text: #f4f8fb;
  --muted: #a8b8c7;
  --accent: #4db3ff;
  --good: #73d179;
  --warn: #ffd166;
  --bad: #ff6b6b;
  --border: rgba(255, 255, 255, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(30px, 4vw, 56px);
  line-height: 1.02;
}

h2 {
  font-size: 22px;
}

.status,
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  white-space: nowrap;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--warn);
  box-shadow: 0 0 18px var(--warn);
}

.status.ok .status-dot {
  background: var(--good);
  box-shadow: 0 0 18px var(--good);
}

.status.error .status-dot {
  background: var(--bad);
  box-shadow: 0 0 18px var(--bad);
}

.grid {
  display: grid;
  gap: 16px;
}

.modebar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 12px;
}

.mode {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 13px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-weight: 800;
  text-decoration: none;
}

.mode.active {
  background: var(--panel-strong);
  color: var(--text);
}

.tabs {
  display: flex;
  gap: 10px;
  margin: 0 0 16px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.tab {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  white-space: nowrap;
}

.tab.active {
  background: var(--accent);
  color: #07131e;
}

.grid-journeys {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 16px;
}

.grid-boards {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-strong);
}

.panel-subtitle {
  flex: 1 1 auto;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.journey-list,
.departure-list {
  display: grid;
}

.journey {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid var(--border);
}

.journey:last-child,
.departure:last-child {
  border-bottom: 0;
}

.time-stack {
  display: grid;
  align-content: start;
  gap: 4px;
}

.time {
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
}

.delay {
  color: var(--good);
  font-weight: 800;
}

.delay.late {
  color: var(--warn);
}

.delay.cancelled {
  color: var(--bad);
}

.route {
  min-width: 0;
}

.route-title {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  font-size: 18px;
  font-weight: 800;
}

.line-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
  padding: 4px 8px;
  background: #e7f4ff;
  color: #0f4167;
  font-size: 14px;
  font-weight: 900;
}

.legs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
}

.leg {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meta {
  color: var(--muted);
  font-size: 14px;
}

.departure {
  display: grid;
  grid-template-columns: 96px minmax(80px, auto) 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 15px 18px;
  border-bottom: 1px solid var(--border);
}

.departure .time {
  font-size: 28px;
}

.direction {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}

.platform {
  color: var(--muted);
  text-align: right;
}

.empty {
  padding: 18px;
  color: var(--muted);
}

@media (max-width: 920px) {
  .shell {
    padding: 16px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .grid-journeys,
  .grid-boards {
    grid-template-columns: 1fr;
  }

  .journey,
  .departure {
    grid-template-columns: 1fr;
  }

  .platform {
    text-align: left;
  }
}

@media (max-width: 560px) {
  .shell {
    padding: 12px;
  }

  h1 {
    font-size: 30px;
  }

  .panel-header {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px;
  }

  .tabs {
    gap: 8px;
  }

  .tab {
    flex: 1 0 auto;
  }

  .journey,
  .departure {
    padding: 14px;
  }

  .time {
    font-size: 30px;
  }

  .departure .time {
    font-size: 26px;
  }

  .route-title,
  .direction,
  .leg {
    white-space: normal;
  }
}
