:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --surface: #ffffff;
  --ink: #1d2527;
  --muted: #5c686b;
  --line: #d9dfdd;
  --green: #1f6f5b;
  --blue: #276c9b;
  --gold: #b8872c;
  --danger: #a33b2f;
  --shadow: 0 18px 45px rgba(29, 37, 39, 0.09);
}

* {
  box-sizing: border-box;
}

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

button,
select {
  font: inherit;
}

.app-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: end;
  padding: 36px 0 24px;
}

.eyebrow,
.section-kicker,
.status-label {
  display: block;
  margin: 0 0 8px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  max-width: 780px;
  font-size: clamp(2.2rem, 8vw, 5rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.lede {
  max-width: 660px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 1.08rem;
}

.status-panel,
.next-trip,
.schedule-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.status-panel {
  min-height: 140px;
  padding: 20px;
}

.status-panel strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.4rem;
}

.status-panel span:last-child {
  color: var(--muted);
}

.controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 12px;
  align-items: end;
  margin: 8px 0 22px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

select,
button {
  min-height: 44px;
  border: 1px solid #bdc8c6;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
}

select {
  width: 100%;
  padding: 0 38px 0 12px;
}

button {
  padding: 0 16px;
  background: var(--green);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

button:hover {
  background: #195b4b;
}

button:disabled {
  cursor: wait;
  opacity: 0.75;
}

.message {
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid #e5c6bf;
  border-radius: 8px;
  background: #fff2ef;
  color: var(--danger);
}

.hidden {
  display: none;
}

.results-grid {
  display: grid;
  grid-template-columns: minmax(310px, 0.9fr) minmax(0, 1.35fr);
  gap: 18px;
}

.next-trip {
  padding: 24px;
}

.next-trip h2 {
  margin: 4px 0 8px;
  color: var(--blue);
  font-size: clamp(3rem, 8vw, 5.8rem);
  line-height: 0.95;
}

#routeSummary {
  color: var(--muted);
  font-size: 1rem;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 24px;
}

.metric-row div {
  min-height: 86px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.metric-row span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.metric-row strong {
  font-size: 1.3rem;
}

.schedule-list {
  min-height: 420px;
  padding: 20px;
}

.list-heading {
  display: flex;
  gap: 16px;
  align-items: start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.list-heading h2,
.reference h2 {
  font-size: 1.4rem;
}

.count-pill {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 999px;
  background: #e8f0ee;
  color: var(--green);
  font-size: 0.84rem;
  font-weight: 800;
}

.trip-list {
  display: grid;
  gap: 10px;
}

.trip-row {
  display: grid;
  grid-template-columns: 86px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.trip-row strong {
  font-size: 1.08rem;
}

.trip-row p {
  color: var(--muted);
  font-size: 0.92rem;
}

.trip-row span:last-child {
  color: var(--gold);
  font-size: 0.9rem;
  font-weight: 800;
}

.reference {
  margin-top: 20px;
}

.stop-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.stop-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--blue);
  border-radius: 8px;
  background: var(--surface);
}

.stop-card strong {
  display: block;
  margin-bottom: 6px;
}

.stop-card span {
  color: var(--muted);
  font-size: 0.92rem;
}

@media (max-width: 840px) {
  .hero,
  .controls,
  .results-grid,
  .stop-grid {
    grid-template-columns: 1fr;
  }

  .status-panel {
    min-height: auto;
  }

  .controls {
    align-items: stretch;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 24px, 1120px);
    padding-top: 16px;
  }

  .hero {
    padding-top: 22px;
  }

  .metric-row {
    grid-template-columns: 1fr;
  }

  .trip-row {
    grid-template-columns: 1fr;
  }
}
