:root {
  --bg: #f7f2e8;
  --ink: #1f2a2e;
  --muted: #67717a;
  --card: #ffffff;
  --barry: #2563eb;
  --barry-dark: #1d4ed8;
  --louise: #db2777;
  --louise-dark: #be185d;
  --accent: #d94f3d;
  --accent-dark: #a93b2e;
  --border: #eadfce;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #fff8ee 0%, var(--bg) 100%);
  color: var(--ink);
}
header, footer { text-align: center; padding: 1.5rem 1rem; }
.badge { font-size: 2rem; margin-bottom: .35rem; }
h1 { margin: 0 0 .25rem; font-size: clamp(1.8rem, 4vw, 3rem); }
p { color: var(--muted); margin: 0; }
main { width: min(1180px, 94vw); margin: 0 auto 2rem; }
.panel, .card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(40, 31, 20, .08);
}
.panel { padding: 1rem; margin-bottom: 1rem; }
.api-row, .controls { display: flex; gap: .75rem; align-items: end; flex-wrap: wrap; }
.controls > div { flex: 1 1 260px; }
label { display: block; font-weight: 700; margin-bottom: .35rem; }
small { color: var(--muted); }
input {
  width: 100%;
  padding: .8rem .9rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  font: inherit;
}
.api-row input { flex: 1 1 300px; }
button {
  border: 0;
  border-radius: 12px;
  padding: .85rem 1.1rem;
  background: var(--accent);
  color: white;
  font-weight: 800;
  cursor: pointer;
}
button:hover { background: var(--accent-dark); }
button.secondary { background: #33434a; }
.dashboard {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}
.card { padding: 1rem; }
.label { color: var(--muted); display: block; font-size: .9rem; }
.card strong { font-size: 1.55rem; }
.person-heading { display: flex; gap: .8rem; align-items: center; margin-bottom: 1rem; }
.avatar {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  color: white;
  font-weight: 900;
  font-size: 1.3rem;
}
.barry .avatar { background: var(--barry); }
.louise .avatar { background: var(--louise); }
.person-card { border-top-width: 5px; }
.person-card.barry { border-top-color: var(--barry); }
.person-card.louise { border-top-color: var(--louise); }
.mini-row { display: flex; justify-content: space-between; gap: 1rem; margin: .55rem 0; color: var(--muted); }
.mini-row strong { font-size: 1rem; color: var(--ink); }
.mini-bar {
  height: 14px;
  background: #eadfce;
  border-radius: 999px;
  overflow: hidden;
}
.mini-bar div { height: 100%; width: 0%; transition: width .35s ease; }
#barryProgressBar { background: var(--barry); }
#louiseProgressBar { background: var(--louise); }
.route-card p { margin-top: .5rem; }
.compact { display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap; }
.legend span { color: var(--muted); font-weight: 700; }
.dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: .35rem;
  vertical-align: -1px;
}
.barry-dot { background: var(--barry); }
.louise-dot { background: var(--louise); }
.start-dot { background: #16a34a; }
.finish-dot { background: var(--accent); }
#map {
  width: 100%;
  height: 68vh;
  min-height: 480px;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 18px 50px rgba(40, 31, 20, .12);
}
@media (max-width: 860px) {
  .dashboard { grid-template-columns: 1fr; }
  #map { height: 55vh; min-height: 360px; }
}
