:root {
  color-scheme: light;
  --ink: #102a43;
  --muted: #627d98;
  --paper: #f7fafc;
  --card: #ffffff;
  --line: #d9e2ec;
  --ocean: #087f8c;
  --ocean-dark: #075f67;
  --warm: #f6ad55;
  --danger: #b42318;
  --shadow: 0 18px 45px rgb(16 42 67 / 10%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 80% 0%, rgb(8 127 140 / 13%), transparent 34rem),
    linear-gradient(180deg, #edf7f7 0, var(--paper) 24rem);
}

.shell {
  width: min(100% - 2rem, 760px);
  margin: 0 auto;
  padding: 3rem 0 2rem;
}

.hero {
  padding: 0.75rem 0 2rem;
}

.eyebrow,
.step {
  margin: 0 0 0.55rem;
  color: var(--ocean-dark);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 10ch;
  margin-bottom: 0.8rem;
  font-size: clamp(2.65rem, 11vw, 5rem);
  line-height: 0.94;
  letter-spacing: -0.055em;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.25rem, 4vw, 1.65rem);
  letter-spacing: -0.025em;
}

.intro {
  max-width: 39rem;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.65;
}

.controls,
.state-card,
.bus-card {
  border: 1px solid rgb(217 226 236 / 85%);
  border-radius: 1rem;
  background: rgb(255 255 255 / 92%);
  box-shadow: var(--shadow);
}

.controls {
  padding: 1.15rem;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.fields {
  display: grid;
  gap: 1rem;
  margin-top: 1.4rem;
}

label span {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 750;
}

select,
button {
  min-height: 2.9rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  font: inherit;
}

select {
  width: 100%;
  padding: 0 0.75rem;
  color: var(--ink);
  background: var(--card);
}

select:focus,
button:focus-visible {
  outline: 3px solid rgb(8 127 140 / 20%);
  outline-offset: 2px;
}

.refresh {
  min-height: 2.55rem;
  padding: 0 0.95rem;
  border-color: var(--ocean);
  color: white;
  background: var(--ocean);
  font-weight: 750;
  cursor: pointer;
}

.refresh:hover:not(:disabled) {
  background: var(--ocean-dark);
}

.refresh:disabled {
  cursor: wait;
  opacity: 0.48;
}

.status-panel {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.state-card,
.bus-card {
  padding: 1.25rem;
}

.state-card.error {
  border-color: rgb(180 35 24 / 30%);
}

.state-card.error .state-title {
  color: var(--danger);
}

.state-title {
  margin-bottom: 0.35rem;
  font-size: 1.15rem;
  font-weight: 800;
}

.state-copy,
.meta,
.evidence,
footer {
  color: var(--muted);
  line-height: 1.55;
}

.state-copy {
  margin-bottom: 0;
}

.pulse {
  width: 0.7rem;
  height: 0.7rem;
  margin-bottom: 0.85rem;
  border-radius: 999px;
  background: var(--ocean);
  box-shadow: 0 0 0 0 rgb(8 127 140 / 35%);
  animation: pulse 1.4s infinite;
}

.bus-topline {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.1rem;
}

.bus-identity {
  margin: 0;
  font-size: clamp(1.65rem, 7vw, 2.25rem);
  font-weight: 850;
  letter-spacing: -0.04em;
}

.scheduled {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.deviation {
  margin-bottom: 0.45rem;
  color: var(--ocean-dark);
  font-size: 1.3rem;
  font-weight: 850;
}

.evidence,
.meta {
  margin-bottom: 0;
  font-size: 0.9rem;
}

.meta {
  margin-top: 0.75rem;
}

.status-heading {
  margin: 0.6rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

footer {
  max-width: 38rem;
  margin: 2rem auto 0;
  text-align: center;
  font-size: 0.76rem;
}

footer p {
  margin-bottom: 0;
}

.footer-credit {
  margin-top: 0.45rem;
  color: var(--ocean-dark);
  font-size: 0.72rem;
  font-weight: 750;
}

@keyframes pulse {
  70% {
    box-shadow: 0 0 0 0.65rem rgb(8 127 140 / 0%);
  }
  100% {
    box-shadow: 0 0 0 0 rgb(8 127 140 / 0%);
  }
}

@media (min-width: 600px) {
  .shell {
    padding-top: 4.5rem;
  }

  .controls,
  .state-card,
  .bus-card {
    padding: 1.6rem;
  }

  .fields {
    grid-template-columns: 1fr 1.35fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pulse {
    animation: none;
  }
}
