:root {
  color-scheme: light;
  --bg: #ffffff;
  --card: #ffffff;
  --card-border: #ececec;
  --text: #1c1c1e;
  --muted: #8e8e93;
  --accent: #ff3b30;
  --good: #34c759;
  --bad: #ff3b30;
  --border: #efeff0;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  display: flex;
  justify-content: center;
  padding: 24px 16px;
}

.app {
  width: 100%;
  max-width: 560px;
}

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

.route-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 14px 16px;
  margin-bottom: 14px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

button {
  font: inherit;
  cursor: pointer;
}

.swap-btn,
.refresh-btn {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--card-border);
  background: #fff;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
}

.refresh-btn {
  width: 38px;
  height: 38px;
  color: var(--muted);
}

.swap-btn:active,
.refresh-btn:active {
  background: #f5f5f6;
}

.stations {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.station-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.station-icon {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.station-name {
  font-size: 1.05rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status {
  min-height: 20px;
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 8px;
  padding: 0 2px;
}

.status.error {
  color: var(--bad);
}

.board {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  overflow: hidden;
}

.board th,
.board td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}

.board th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.board tbody tr:last-child td {
  border-bottom: none;
}

.platform {
  font-weight: 700;
  color: var(--text);
}

.on-time {
  color: var(--good);
}

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

footer {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: center;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.8rem;
}

@media (max-width: 480px) {
  .board th:nth-child(5),
  .board td:nth-child(5) {
    display: none;
  }
}
