:root {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #0f172a;
  background: #ecfeff;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button, input { font: inherit; }
a { color: #0f766e; font-weight: 700; }

.app {
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 20px;
}

.hero {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: flex-start;
  padding: 24px;
  border-radius: 24px;
  background: linear-gradient(135deg, #0f766e, #0891b2);
  color: white;
  box-shadow: 0 16px 40px rgba(15, 118, 110, 0.25);
}

.eyebrow { margin: 0 0 8px; opacity: 0.85; }
h1 { margin: 0; font-size: clamp(28px, 7vw, 44px); line-height: 1.05; }
.stop-id { margin: 10px 0 0; opacity: 0.9; }
.hero-actions { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }

#refreshButton, .pill-button, #lookupButton {
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  color: #0f766e;
  background: white;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  text-align: center;
  text-decoration: none;
}

#lookupButton {
  color: white;
  background: #0f766e;
}

#refreshButton:disabled, #lookupButton:disabled {
  cursor: wait;
  opacity: 0.65;
}

.status-card, .notice, .arrival-card {
  margin-top: 16px;
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.status-card p, .notice p { margin: 0; }
.muted { color: #64748b; font-size: 14px; margin-top: 6px !important; overflow-wrap: anywhere; }
.arrival-list { display: grid; gap: 12px; margin-top: 16px; }
.arrival-card { margin-top: 0; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.route { font-size: 26px; font-weight: 800; color: #0f766e; }
.destination { color: #475569; margin-top: 4px; }
.eta { text-align: right; font-size: 24px; font-weight: 800; }
.eta small { display: block; font-size: 13px; color: #64748b; font-weight: 500; margin-top: 4px; }
.notice h2 { margin: 0 0 8px; font-size: 16px; }
.notice p + p { margin-top: 6px; }

.lookup-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  align-items: end;
}

.lookup-form label {
  display: grid;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
  color: #334155;
}

.lookup-form input {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 10px 12px;
  background: white;
  color: #0f172a;
}

.debug-details {
  margin-top: 12px;
}

.debug-details summary {
  cursor: pointer;
  font-weight: 800;
  color: #0f766e;
}

.debug-details pre {
  margin: 10px 0 0;
  max-height: 360px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  padding: 12px;
  border-radius: 12px;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 12px;
}

@media (max-width: 520px) {
  .app { padding: 14px; }
  .hero { flex-direction: column; }
  .hero-actions, #refreshButton, .pill-button, #lookupButton { width: 100%; }
  .lookup-form { grid-template-columns: 1fr; }
  .arrival-card { align-items: flex-start; }
}
