:root {
  color-scheme: light;
  --bg: #f4f7f2;
  --surface: #ffffff;
  --surface-strong: #edf7f3;
  --ink: #15211e;
  --muted: #687671;
  --line: #dbe5df;
  --brand: #0f6f61;
  --brand-dark: #0f3d37;
  --accent: #f0b429;
  --alert: #d94b4b;
  --shadow: 0 18px 44px rgba(19, 48, 42, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(15, 111, 97, 0.14) 0, rgba(15, 111, 97, 0) 32vh),
    var(--bg);
}

button,
input,
textarea,
select {
  font: inherit;
}

.app-shell {
  width: min(100%, 31rem);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(1rem, env(safe-area-inset-top)) 1rem max(1.25rem, env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 8.5rem;
  padding: 1.25rem;
  color: #fff;
  background: var(--brand-dark);
  border-radius: 0;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 0.35rem;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.95rem;
  font-weight: 700;
}

h1 {
  margin: 0;
  max-width: 100%;
  font-size: clamp(4rem, 20vw, 6.5rem);
  line-height: 0.88;
  letter-spacing: 0;
  white-space: nowrap;
}

.icon-button {
  display: grid;
  flex: 0 0 auto;
  width: 3.5rem;
  height: 3.5rem;
  place-items: center;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 999px;
  cursor: pointer;
  transition:
    transform 160ms ease,
    background 160ms ease;
}

.icon-button:active {
  transform: scale(0.96);
}

.icon-button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.icon-button svg {
  width: 1.45rem;
  height: 1.45rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.status-strip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 3.25rem;
  margin: 0.8rem 0;
  padding: 0 0.25rem;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.status-strip time {
  margin-left: auto;
  color: var(--muted);
  font-weight: 650;
}

.status-dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0.25rem rgba(240, 180, 41, 0.18);
}

.status-dot.ok {
  background: var(--brand);
  box-shadow: 0 0 0 0.25rem rgba(15, 111, 97, 0.16);
}

.status-dot.error {
  background: var(--alert);
  box-shadow: 0 0 0 0.25rem rgba(217, 75, 75, 0.14);
}

.arrival-stack {
  display: grid;
  gap: 0.75rem;
}

.arrival-card {
  min-height: 9.5rem;
  padding: 1.15rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 0.45rem solid var(--brand);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(23, 37, 32, 0.08);
}

.arrival-card.secondary {
  border-left-color: var(--accent);
}

.arrival-card.empty,
.arrival-card.error {
  border-left-color: var(--alert);
}

.arrival-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 1.6rem;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.arrival-time {
  min-height: 4.2rem;
  margin-top: 0.4rem;
  font-size: 3.7rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
}

.arrival-card.empty .arrival-time,
.arrival-card.error .arrival-time {
  font-size: 1.45rem;
  line-height: 1.25;
}

.arrival-detail {
  min-height: 1.35rem;
  margin-top: 0.6rem;
  color: var(--muted);
  font-size: 0.98rem;
  font-weight: 700;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 1.65rem;
  padding: 0 0.55rem;
  color: var(--brand-dark);
  background: var(--surface-strong);
  border: 1px solid rgba(15, 111, 97, 0.18);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 850;
}

.stop-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 0.95rem;
}

.stop-panel > div {
  min-height: 5.25rem;
  padding: 0.95rem;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.panel-label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.stop-panel strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 1rem;
  line-height: 1.28;
}

.skeleton {
  pointer-events: none;
}

.skeleton .arrival-meta span,
.skeleton .arrival-time,
.skeleton .arrival-detail {
  display: block;
  overflow: hidden;
  color: transparent;
  background: linear-gradient(90deg, #e3ebe6 25%, #f5faf6 45%, #e3ebe6 65%);
  background-size: 240% 100%;
  border-radius: 999px;
  animation: shimmer 1.4s linear infinite;
}

.skeleton .arrival-meta span:first-child {
  width: 6rem;
  height: 1rem;
}

.skeleton .arrival-meta span:last-child {
  width: 3.4rem;
  height: 1rem;
}

.skeleton .arrival-time {
  width: 11rem;
  height: 3.4rem;
}

.skeleton .arrival-detail {
  width: 78%;
  height: 1rem;
}

@keyframes shimmer {
  to {
    background-position: -240% 0;
  }
}

@media (min-width: 42rem) {
  body {
    display: grid;
    place-items: start center;
  }

  .app-shell {
    min-height: auto;
    padding-top: 2rem;
  }

  .topbar {
    border-radius: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
