/* Riviera bus pages: phone first, light and dark. */
:root {
  --bg: #f6f7f5;
  --card: #ffffff;
  --text: #1d2321;
  --muted: #5e6a66;
  --line: #dde3e0;
  --accent: #0f6f7a;
  --accent-text: #ffffff;
  --soft: #e5f1f1;
  --warn: #8a5a00;
  --warn-soft: #fbf1dc;
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121615;
    --card: #1b2120;
    --text: #e6ebe9;
    --muted: #9aa7a3;
    --line: #2d3533;
    --accent: #4fb3bd;
    --accent-text: #0b1716;
    --soft: #1f3234;
    --warn: #e9b65a;
    --warn-soft: #3a2f1b;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
main { max-width: 36rem; margin: 0 auto; padding: 1rem 1rem 3rem; }
a { color: var(--accent); }
h1 { font-size: 1.15rem; margin: 0; line-height: 1.3; }
h2 { font-size: 1rem; margin: 0 0 0.5rem; }

header.page { display: flex; gap: 0.75rem; align-items: center; margin-bottom: 1rem; }
.badges { display: flex; gap: 0.25rem; flex-shrink: 0; }
.badge {
  display: inline-block; min-width: 2.4rem; padding: 0.2rem 0.45rem; border-radius: 6px;
  background: var(--accent); color: var(--accent-text); font-weight: 700; text-align: center; font-variant-numeric: tabular-nums;
}
.sub { color: var(--muted); font-size: 0.85rem; margin: 0.1rem 0 0; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.9rem; margin-bottom: 1rem; }
.field { margin-bottom: 0.9rem; }
.field:last-child { margin-bottom: 0; }
.label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.35rem; }

.directions { display: grid; gap: 0.4rem; }
button, select, input {
  font: inherit; color: inherit; background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
  min-height: 2.75rem; padding: 0.45rem 0.7rem;
}
button { cursor: pointer; text-align: left; }
button:hover { border-color: var(--accent); }
button[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 600; }
select { width: 100%; }
.when { display: grid; grid-template-columns: 1fr auto auto; gap: 0.4rem; }
.when input { min-width: 0; }
.when button { text-align: center; }
.when button.live { background: var(--soft); border-color: var(--accent); }
.day { margin: 0.5rem 0 0; font-size: 0.9rem; color: var(--muted); }
.day.holiday { color: var(--warn); }

.prompt { color: var(--muted); text-align: center; padding: 1.5rem 0.5rem; }
.results h2 { font-weight: 600; }
.results h2 span { color: var(--muted); font-weight: 400; }

ol.departures { list-style: none; margin: 0; padding: 0; }
ol.departures > li { border-top: 1px solid var(--line); }
ol.departures > li:first-child { border-top: 0; }
ol.departures > li.past { opacity: 0.55; }
summary {
  display: grid; grid-template-columns: 4.2rem 1fr auto; column-gap: 0.6rem; row-gap: 0.15rem;
  align-items: baseline; padding: 0.6rem 0.1rem; cursor: pointer; list-style: none;
}
summary::-webkit-details-marker { display: none; }
summary .time { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }
summary .where { font-weight: 600; min-width: 0; }
summary .where .line { display: inline-block; font-size: 0.8rem; font-weight: 700; color: var(--accent); margin-right: 0.35rem; }
summary .arr { color: var(--muted); font-size: 0.85rem; text-align: right; white-space: nowrap; }
summary .rel { grid-column: 1; font-size: 0.8rem; color: var(--muted); }
summary .notes { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 0.3rem; }
summary .rel:empty + .notes:empty { display: none; }
.chip { font-size: 0.75rem; padding: 0.05rem 0.45rem; border-radius: 999px; background: var(--soft); color: var(--text); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
details[open] summary { border-bottom: 1px dashed var(--line); }

ol.onward { list-style: none; margin: 0; padding: 0.4rem 0 0.7rem 0.1rem; font-size: 0.9rem; }
ol.onward li { display: grid; grid-template-columns: 4.2rem 1fr; column-gap: 0.6rem; padding: 0.1rem 0; }
ol.onward .t { font-variant-numeric: tabular-nums; color: var(--muted); }
ol.onward li:last-child { font-weight: 600; }

.more { width: 100%; text-align: center; margin-top: 0.6rem; }
.line-link { display: flex; gap: 0.75rem; align-items: center; text-decoration: none; color: var(--text); font-weight: 600; }
.line-link:hover { color: var(--accent); }

footer { font-size: 0.8rem; color: var(--muted); margin-top: 1.5rem; }
footer p { margin: 0 0 0.6rem; }
