/* Departure-board register: read at night, on a phone, in one glance.
   Dark ground because the page is used at the station after midnight,
   one amber accent because exactly one thing matters at a time (the next arrival). */

:root {
  color-scheme: dark;
  --bg: #0f110e;
  --ink: #e9e7df;
  --muted: #a8ab9f;
  --rule: rgba(233, 231, 223, 0.12);
  --accent: #f0b429;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
}

body {
  max-width: 32rem;
  margin: 0 auto;
  padding: 1.4rem 1.15rem 2.5rem;
}

/* ---------- header ---------- */

.top h1 {
  font-size: clamp(1.4rem, 1.15rem + 1.2vw, 1.8rem);
  font-weight: 650;
  letter-spacing: -0.01em;
  margin: 0 0 0.2rem;
}

.sub {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 0.95rem;
}

/* ---------- state messages (loading, error, empty, all done) ---------- */

.status {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 0.9rem 0 0.85rem;
  margin-bottom: 1.2rem;
}
.status.is-empty { display: none; }

.status-main {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 620;
  letter-spacing: -0.01em;
}

.status-side {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* ---------- arrival rows ---------- */

.list-title {
  margin: 0 0 0.1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
}

.batches {
  list-style: none;
  margin: 0;
  padding: 0;
}

.row {
  display: grid;
  grid-template-columns: 4.4rem 1fr;
  gap: 0.15rem 0.9rem;
  align-items: start;
  padding: 1.05rem 0;
  border-bottom: 1px solid var(--rule);
}

.row.next {
  border-left: 2px solid var(--accent);
  padding-left: 0.85rem;
  margin-left: -0.85rem;
}

.row.done { opacity: 0.5; }

.row-time {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 1.5rem;
  font-weight: 620;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.row.next .row-time { color: var(--accent); }

.est {
  display: block;
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0;
  margin-top: 0.15rem;
}

.row-station {
  font-size: 1.08rem;
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: -0.005em;
}

.state { color: var(--muted); font-weight: 500; }
.state.hot { color: var(--accent); }

.row-platform {
  margin-top: 0.1rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink);
}
.row-platform.pending { color: var(--muted); font-weight: 450; }

.row-train {
  margin-top: 0.25rem;
  font-size: 0.97rem;
  font-weight: 550;
  color: var(--ink);
}

.row-who {
  margin-top: 0.2rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.row-leave {
  margin-top: 0.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
}

/* ---------- notes ---------- */

.notes p {
  margin: 0.6rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}
.notes p:first-child { margin-top: 1.1rem; }
.notes .warn { color: var(--accent); }

/* ---------- footer ---------- */

.foot {
  margin-top: 2rem;
  border-top: 1px solid var(--rule);
  padding-top: 0.9rem;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.1rem;
}

button {
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.6rem 0.95rem;
  min-height: 44px;
  cursor: pointer;
}
button:hover { border-color: var(--muted); }
button:active { border-color: var(--accent); }
button:disabled { cursor: not-allowed; color: var(--muted); border-color: var(--rule); }

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0 0.1rem;
  font-size: 0.9rem;
  color: var(--muted);
  cursor: pointer;
}
.toggle input { width: 1.05rem; height: 1.05rem; accent-color: var(--accent); cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.meta {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

@media (min-width: 40rem) {
  body { padding-top: 2rem; }
  .top h1 { font-size: 1.85rem; }
}

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