:root {
  color-scheme: dark;
  --bg: #05080b;
  --text: #f8fbff;
  --muted: #9fb3c7;
  --accent: #4db3ff;
  --warn: #ffd166;
  --bad: #ff6b6b;
}

* {
  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;
  overflow-x: hidden;
}

.compact-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
  padding: 24px;
}

header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 18px;
}

header p {
  margin: 0;
  color: var(--accent);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

#next-trains {
  display: grid;
  gap: 18px;
  align-content: center;
}

.train {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  padding-top: 20px;
}

.route {
  color: var(--muted);
  font-size: clamp(20px, 3vw, 38px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.time {
  font-size: clamp(56px, 12vw, 150px);
  font-weight: 950;
  line-height: 0.95;
}

.details {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 10px;
  font-size: clamp(22px, 4vw, 48px);
  font-weight: 800;
}

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

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

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

  header {
    align-items: flex-start;
    flex-direction: column;
    font-size: 15px;
  }

  .train {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .route {
    white-space: normal;
  }
}

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

  .details {
    gap: 8px;
    font-size: 22px;
  }
}
