:root {
  color-scheme: light;
  --bg: #f5f3ed;
  --surface: #fffefa;
  --ink: #17211b;
  --muted: #687068;
  --line: #dddcd5;
  --green: #176b47;
  --green-soft: #e2f0e8;
  --red: #9a3f32;
  --red-soft: #f5e5e1;
  --amber: #8a5b14;
  --amber-soft: #f6ecd7;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

main {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
}

.header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 58px 0 28px;
  border-bottom: 1px solid var(--line);
}

h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.9rem, 5vw, 2.8rem); letter-spacing: -.045em; line-height: 1; }
h2 { font-size: 1.55rem; letter-spacing: -.025em; }

.eyebrow, .label {
  display: block;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.eyebrow { margin-bottom: 8px; }
.updated, .hint, footer { color: var(--muted); font-size: .82rem; }
.updated { white-space: nowrap; }
.live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: #2b9c66;
  box-shadow: 0 0 0 4px rgba(43, 156, 102, .12);
}

.summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  margin: 24px 0 68px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.summary > div { padding: 20px 22px; }
.summary > div + div { border-left: 1px solid var(--line); }
.summary strong { display: block; margin-top: 3px; font-size: 1.65rem; letter-spacing: -.04em; }

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}
.chart-key { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: .66rem; white-space: nowrap; }
.chart-key span { display: inline-flex; align-items: center; gap: 4px; }
.chart-key .actual-key::before { width: 6px; height: 8px; border-radius: 1px; background: #578c67; content: ""; }
.chart-key .forecast-key::before { width: 6px; height: 8px; border-radius: 1px; background: #578c67; content: ""; opacity: .32; }

.ride-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.ride {
  display: grid;
  grid-template-columns: 96px minmax(180px, 1fr) 180px auto;
  align-items: center;
  gap: 16px;
  min-height: 104px;
  padding: 11px 14px;
}
.ride + .ride { border-top: 1px solid var(--line); }
.ride-image {
  width: 96px;
  height: 68px;
  border-radius: 8px;
  background: #e8e6df;
  object-fit: cover;
}
.ride-info { min-width: 0; }
.ride-name { overflow: hidden; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.ride-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 12px; margin-top: 6px; font-size: .74rem; }
.wait { min-width: 68px; text-align: right; font-size: 1.25rem; font-weight: 750; }
.wait span { color: var(--muted); font-size: .74rem; font-weight: 500; }
.closed { color: var(--muted); font-size: .86rem; }

.ride-height { color: var(--muted); }
.map-link { padding: 0; border: 0; background: none; color: var(--muted); cursor: pointer; font: inherit; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.map-link:hover { color: var(--ink); }
.ride-popularity { min-width: 0; }
.chart-scale { display: flex; align-items: center; gap: 5px; height: 12px; color: var(--muted); font-size: .5rem; white-space: nowrap; }
.chart-scale::after { flex: 1; border-top: 1px dashed #d8d6cf; content: ""; }
.mini-bars { display: flex; align-items: end; gap: 2px; height: 46px; }
.mini-bar { display: grid; grid-template-rows: 32px 12px; align-items: end; justify-items: center; flex: 1; min-width: 0; height: 44px; }
.bar-stack { position: relative; display: block; width: 100%; height: 32px; }
.bar-stack > i { position: absolute; bottom: 0; left: 21%; width: 58%; min-height: 2px; max-height: 32px; border-radius: 2px 2px 1px 1px; }
.bar-stack .forecast-bar { z-index: 1; opacity: .32; }
.bar-stack .actual-bar { z-index: 2; opacity: .94; }
.bar-stack .no-value { height: 2px; background: #e6e4de; opacity: .8; }
.forecast-tick { position: absolute; z-index: 3; left: 24%; width: 52%; height: 1px; background: #fff; box-shadow: 0 0 0 1px rgba(23, 33, 27, .22); transform: translateY(1px); }
.mini-bar.current .actual-bar { outline: 1px solid rgba(23, 33, 27, .28); outline-offset: 1px; }
.mini-bar small { z-index: 3; color: var(--muted); font-size: .5rem; line-height: 12px; }

.empty { padding: 28px; color: var(--muted); text-align: center; }

.map-dialog {
  width: min(1100px, calc(100% - 28px));
  max-width: none;
  max-height: calc(100dvh - 28px);
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(23, 33, 27, .28);
}
.map-dialog::backdrop { background: rgba(19, 27, 22, .6); }
.map-dialog-inner { display: flex; flex-direction: column; max-height: calc(100dvh - 28px); }
.map-dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.map-dialog-header strong { display: block; margin-top: 2px; font-size: 1.05rem; }
.map-close { width: 34px; height: 34px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--ink); cursor: pointer; font-size: 1.45rem; line-height: 1; }
.map-stage { position: relative; }
.map-viewport { position: relative; height: min(62dvh, 650px); overflow: auto; background: #e4efca; overscroll-behavior: contain; touch-action: pan-x pan-y pinch-zoom; }
.map-canvas { position: relative; width: 1000px; aspect-ratio: 1200 / 737; }
.map-canvas > img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.target-marker { position: absolute; z-index: 3; width: 30px; height: 38px; transform: translate(-50%, -100%); filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .28)); pointer-events: none; }
.target-marker i { position: absolute; left: 3px; bottom: 0; width: 24px; height: 24px; border: 3px solid #fff; border-radius: 50% 50% 50% 0; background: #cf3f32; transform: rotate(-45deg); }
.target-marker i::after { position: absolute; top: 6px; left: 6px; width: 6px; height: 6px; border-radius: 50%; background: #fff; content: ""; }
.target-marker b { position: absolute; left: 50%; bottom: 35px; padding: 4px 7px; border-radius: 6px; background: #fff; color: var(--ink); font-size: .68rem; line-height: 1.15; transform: translateX(-50%); white-space: nowrap; }
.user-marker { position: absolute; z-index: 5; width: 48px; height: 48px; transform: translate(-50%, -50%); pointer-events: none; }
.user-marker[hidden] { display: none; }
.user-marker > i { position: absolute; top: -20px; left: 10px; width: 28px; height: 52px; background: linear-gradient(to top, rgba(47, 119, 219, .1), rgba(47, 119, 219, .58)); clip-path: polygon(50% 0, 100% 100%, 50% 84%, 0 100%); transform-origin: 50% 44px; transition: transform .18s ease-out; }
.user-marker > b { position: absolute; top: 14px; left: 14px; width: 20px; height: 20px; border: 3px solid #fff; border-radius: 50%; background: #2f77db; box-shadow: 0 1px 5px rgba(0, 0, 0, .42); }
.user-marker > b::after { position: absolute; top: 4px; left: 4px; width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, .45); content: ""; }
.nav-compass { position: absolute; z-index: 4; top: 12px; right: 12px; width: 64px; height: 64px; pointer-events: none; }
.compass-ring { position: relative; width: 64px; height: 64px; border: 2px solid rgba(23, 33, 27, .28); border-radius: 50%; background: rgba(255, 254, 250, .9); box-shadow: 0 3px 12px rgba(0, 0, 0, .14); }
.compass-ring span { position: absolute; top: 50%; left: 50%; color: var(--red); font-size: .62rem; font-weight: 800; transform: rotate(0deg) translateY(-23px) rotate(0deg); transform-origin: center; }
.compass-ring > i { position: absolute; top: 13px; left: 22px; color: var(--green); font-size: 2rem; font-style: normal; line-height: 36px; transform-origin: 10px 19px; transition: transform .18s ease-out; }
.map-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px 7px; }
.map-controls button { min-height: 34px; padding: 6px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); cursor: pointer; font: inherit; font-size: .78rem; }
.map-controls button:disabled { color: var(--muted); cursor: default; }
.zoom-controls { display: flex; gap: 5px; }
.zoom-controls button { width: 36px; padding: 0; font-size: 1.1rem; }
.map-status { padding: 0 16px; color: var(--ink); font-size: .76rem; font-weight: 650; }
.map-warning { padding: 3px 16px 13px; color: var(--muted); font-size: .68rem; }

footer { margin-top: 72px; padding: 24px 0 36px; border-top: 1px solid var(--line); }
a { color: inherit; }

@media (max-width: 640px) {
  main { width: min(100% - 24px, 920px); }
  .header { display: block; padding-top: 38px; }
  .updated { margin-top: 20px; }
  .summary { margin-bottom: 52px; }
  .summary > div { padding: 16px; }
  .summary strong { font-size: 1.35rem; }
  .section-heading { display: block; }
  .chart-key { margin-top: 8px; }
  .hint { margin-top: 5px; }
  .ride { position: relative; grid-template-columns: 72px minmax(0, 1fr); align-items: start; gap: 7px 12px; padding: 10px; }
  .ride-image { grid-row: 1 / span 2; width: 72px; height: 64px; }
  .ride-info { grid-row: 1; grid-column: 2; padding-right: 52px; }
  .ride-meta { gap: 3px 10px; }
  .ride-popularity { grid-row: 2; grid-column: 2; justify-self: end; width: min(180px, 100%); }
  .wait { position: absolute; top: 10px; right: 10px; min-width: 48px; padding-top: 2px; font-size: 1.05rem; }
  .mini-bars { gap: 2px; }
  .map-dialog { width: calc(100% - 12px); max-height: calc(100dvh - 12px); border-radius: 12px; }
  .map-dialog-inner { max-height: calc(100dvh - 12px); }
  .map-viewport { height: 58dvh; }
  .map-dialog-header { padding: 12px 14px; }
}
