:root {
  --bg: #f4f2ed;
  --panel: #ffffff;
  --ink: #171614;
  --muted: #6f6c66;
  --faint: #a19d95;
  --line: #e6e2d9;
  --soft: #f4f2ed;
  --track: #ebe7df;
  --hero: #171614;
  --hero-ink: #f7f5f0;
  --hero-muted: #a8a49b;
  --green: #1f7a4d;
  --green-bg: #e3f2e9;
  --blue: #2558b8;
  --blue-bg: #e5edfb;
  --today: #d4442c;
  --radius: 20px;
  --mono: "DM Mono", ui-monospace, "SF Mono", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121110; --panel: #1c1b19; --ink: #f1eee8; --muted: #a39f97; --faint: #77736c;
    --line: #2e2c28; --soft: #252320; --track: #2b2925; --hero: #23211e;
    --green: #6fcf9a; --green-bg: #1d3226; --blue: #8fb0f0; --blue-bg: #1d2638;
  }
}
:root[data-theme="dark"] {
  --bg: #121110; --panel: #1c1b19; --ink: #f1eee8; --muted: #a39f97; --faint: #77736c;
  --line: #2e2c28; --soft: #252320; --track: #2b2925; --hero: #23211e;
  --green: #6fcf9a; --green-bg: #1d3226; --blue: #8fb0f0; --blue-bg: #1d2638;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.45 "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
p, h1, h2, h3, dl, dd, ol { margin: 0; padding: 0; }
a { color: inherit; }
strong { font-weight: 700; }
.muted { color: var(--muted); }

.preview-banner {
  background: var(--ink); color: var(--bg);
  text-align: center; font-size: 13px; font-weight: 500; padding: 7px 16px;
}

.page {
  max-width: 640px;
  margin: 0 auto;
  padding: 18px 16px calc(36px + env(safe-area-inset-bottom));
  display: grid;
  gap: 14px;
}

/* ── header ─────────────────────────────── */
.top {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 12px;
  padding: 4px 2px 6px;
}
.brand { white-space: nowrap; font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.now { text-align: right; display: flex; flex-direction: column; line-height: 1.2; }
.now-time { font-family: var(--mono); font-size: 17px; font-weight: 500; }
.now-date { font-size: 13px; color: var(--muted); }

/* ── hero ───────────────────────────────── */
.hero {
  background: var(--hero);
  color: var(--hero-ink);
  border-radius: 24px;
  padding: 22px 20px 20px;
}
.hero-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.eyebrow {
  font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--hero-muted);
}
.hero-title { font-size: 26px; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; margin-top: 8px; }
.hero-title .who { color: color-mix(in srgb, var(--accent) 45%, #ffffff); }
.live {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600;
  background: rgba(255, 255, 255, .1); border-radius: 999px; padding: 4px 12px 4px 10px;
}
.live i { width: 8px; height: 8px; border-radius: 50%; background: #5ee39a; animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .3 } }

.count {
  display: grid; grid-template-columns: repeat(4, 1fr);
  margin: 22px 0 20px;
}
.unit { display: flex; flex-direction: column; }
.unit + .unit { border-left: 1px solid rgba(255,255,255,.12); padding-left: 12px; }
.num {
  font-family: var(--mono); font-weight: 500;
  font-size: clamp(38px, 12vw, 72px); line-height: 1; letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
}
.lbl { font-size: 12px; color: var(--hero-muted); margin-top: 6px; letter-spacing: .06em; text-transform: uppercase; }

.facts {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 12px;
  border-top: 1px solid rgba(255,255,255,.12); padding-top: 16px;
}
.facts dt { font-size: 12px; color: var(--hero-muted); letter-spacing: .06em; text-transform: uppercase; }
.facts dd { font-size: 18px; font-weight: 600; }
.hero-note {
  margin-top: 16px; font-size: 15px; color: var(--hero-ink);
  background: rgba(255,255,255,.07); border-radius: 12px; padding: 10px 12px;
}

/* ── panels ─────────────────────────────── */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}
.panel-head { margin-bottom: 14px; }
.panel-head h3 { font-size: 17px; font-weight: 700; }
.panel-head p { font-size: 15px; color: var(--muted); margin-top: 2px; }

/* who's home when */
.lane + .lane { margin-top: 12px; }
.lane-head { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; margin-bottom: 6px; }
.lane-name { font-weight: 600; }
.lane-sub { color: var(--muted); font-variant-numeric: tabular-nums; }
.track { position: relative; height: 12px; background: var(--track); border-radius: 999px; }
.tick { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--panel); opacity: .9; }
.bar { position: absolute; top: 0; bottom: 0; border-radius: 999px; background: var(--accent); }
.bar--together { background: var(--ink); }
.today { position: absolute; top: -5px; bottom: -5px; width: 2px; margin-left: -1px; background: var(--today); border-radius: 2px; }
.axis { position: relative; height: 18px; margin-top: 8px; font-size: 12px; color: var(--faint); }
.axis span { position: absolute; transform: translateX(-50%); white-space: nowrap; }

/* person */
.people { display: grid; gap: 14px; }
.person-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.person-head h2 {
  font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15;
  display: flex; align-items: center; gap: 10px;
}
.person-head h2::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.person-head p { font-size: 14px; margin-top: 2px; }
.status {
  flex: none; font-size: 13px; font-weight: 600; border-radius: 999px; padding: 5px 11px;
  background: var(--soft); color: var(--muted); white-space: nowrap;
}
.status--home { background: var(--green-bg); color: var(--green); }
.status--transit { background: var(--blue-bg); color: var(--blue); }

.trip { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 16px; }
.trip--done { opacity: .5; }
.trip-head { display: flex; justify-content: space-between; align-items: baseline; }
.trip-kind { font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.trip-rel { font-size: 14px; font-weight: 600; color: var(--accent); }
.trip-when { display: flex; flex-direction: column; margin-top: 6px; }
.trip-time { font-size: 38px; font-weight: 600; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.trip-day { font-size: 17px; }
.trip-day em { display: block; font-style: normal; font-size: 14px; font-weight: 600; color: var(--accent); }

.route { margin: 16px 0 14px; }
.stops { list-style: none; display: flex; justify-content: space-between; position: relative; }
.stops::before {
  content: ""; position: absolute; left: 6px; right: 6px; top: 5px; height: 2px; background: var(--line);
}
.stops li { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; }
.stops li:first-child { align-items: flex-start; text-align: left; }
.stops li:last-child { align-items: flex-end; text-align: right; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--panel); border: 2px solid var(--faint); margin-bottom: 6px; }
.stops .end .dot { background: var(--accent); border-color: var(--accent); }
.stops b { font-family: var(--mono); font-size: 16px; font-weight: 500; }
.stops small { font-size: 12px; color: var(--muted); }
.route-meta { font-size: 13px; color: var(--muted); margin-top: 8px; }

.pickup {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
}
.pickup > div { background: var(--soft); padding: 11px 12px; display: flex; flex-direction: column; }
.pickup .k { font-size: 12px; color: var(--muted); }
.pickup .v { font-size: 21px; font-weight: 600; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.pickup .s { font-size: 13px; color: var(--muted); }

.legs { margin-top: 12px; }
.legs summary {
  list-style: none; cursor: pointer; font-size: 15px; font-weight: 600; color: var(--muted);
  display: flex; align-items: center; gap: 6px; padding: 6px 0; min-height: 40px;
}
.legs summary::-webkit-details-marker { display: none; }
.legs summary::after { content: "›"; font-size: 20px; line-height: 1; transition: transform .15s; }
.legs[open] summary::after { transform: rotate(90deg); }
.legs ol { list-style: none; display: grid; gap: 8px; margin-top: 4px; }
.leg { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.leg-top { display: flex; align-items: center; gap: 8px; }
.leg-no { font-family: var(--mono); font-weight: 500; font-size: 15px; }
.leg-air { flex: 1; font-size: 13px; color: var(--muted); min-width: 0; }
a.track-link {
  all: unset; cursor: pointer; font-size: 13px; font-weight: 600;
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px;
}
a.track-link:hover { background: var(--soft); }
.leg-times { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; font-size: 15px; }
.leg-times span { display: flex; flex-direction: column; }
.leg-times span:last-child { text-align: right; }
.leg-times b { font-family: var(--mono); font-weight: 500; }
.leg-times small { font-size: 12px; color: var(--muted); }
.leg-dur { font-size: 12px; color: var(--faint); align-items: center; }
.layover { font-size: 13px; color: var(--muted); padding: 2px 12px; }
.layover strong { color: var(--today); font-weight: 600; }
.fine { font-size: 12px; color: var(--faint); margin-top: 8px; }

.call {
  display: flex; justify-content: center; align-items: center; margin-top: 16px; min-height: 52px;
  border-radius: 14px; background: #1f9d55; color: #fff; font-weight: 600; text-decoration: none;
}

.foot { text-align: center; color: var(--faint); font-size: 13px; padding: 6px 0; }

@media (min-width: 900px) {
  .page { max-width: 1040px; padding-top: 28px; gap: 16px; }
  .people { grid-template-columns: 1fr 1fr; gap: 16px; }
  .hero { padding: 28px 32px; display: grid; grid-template-columns: 1.4fr 1fr; column-gap: 40px; }
  .hero-head, .hero-title, .count { grid-column: 1; }
  .facts { grid-column: 2; grid-row: 1 / span 3; align-self: center; border-top: 0; padding-top: 0;
           border-left: 1px solid rgba(255,255,255,.12); padding-left: 32px; }
  .hero-note { grid-column: 1 / -1; }
  .count { margin-bottom: 0; }
  .hero-title { font-size: 32px; }
}
