:root {
  /* palette taken from the Dart Catcher logo */
  --bg: #fbf4ea;        /* logo cream */
  --card: #fffdf9;
  --ink: #1b1a18;
  --muted: #77706a;
  --line: #ede5d9;
  --accent: #2f7a4b;    /* DART green */

  /* one gradient per state */
  --g-plan: linear-gradient(150deg, #34935b 0%, #23663f 100%);    /* plenty of time */
  --g-now: linear-gradient(150deg, #e2513b 0%, #bf3a2c 100%);     /* leave now */
  --g-hurry: linear-gradient(150deg, #bf3a2c 0%, #7e2019 100%);   /* walk fast */
  --g-missed: linear-gradient(150deg, #57534e 0%, #2c2a27 100%);  /* too soon */
  --g-back: linear-gradient(150deg, #34312d 0%, #141311 100%);    /* heading home */
  --g-loading: linear-gradient(150deg, #e9e1d4 0%, #ddd3c4 100%);

  --radius: 28px;
  --shadow: 0 1px 2px rgba(27, 26, 24, .05), 0 8px 24px rgba(27, 26, 24, .07);
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font: 16px/1.4 "SF Pro Display", -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body.dark { background: #111; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
button:disabled { opacity: .45; cursor: default; }
main { max-width: 480px; margin: 0 auto; }

.screen {
  min-height: 100dvh; display: flex; flex-direction: column;
  padding: calc(env(safe-area-inset-top) + 16px) 20px calc(env(safe-area-inset-bottom) + 20px);
}

/* ---------- main ---------- */
.bar { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 22px; }
.hello { font-size: 15px; color: var(--muted); font-weight: 500; }
.route { font-size: 24px; font-weight: 750; letter-spacing: -.6px; margin-top: 2px; text-align: left; }
.caret { white-space: nowrap; font-size: 14px; color: var(--muted); vertical-align: 4px; }
.icon {
  width: 44px; height: 44px; border-radius: 50%; background: var(--card); box-shadow: var(--shadow);
  display: grid; place-items: center; color: var(--ink);
}

.hero {
  display: flex; flex-direction: column; text-align: left; width: 100%;
  min-height: 40dvh; padding: 24px 24px 20px; border-radius: var(--radius);
  color: #fff; background: var(--g-plan); box-shadow: 0 18px 40px -18px rgba(35, 102, 63, .55);
}
.hero.now { background: var(--g-now); box-shadow: 0 18px 40px -18px rgba(191, 58, 44, .55); }
.hero.hurry { background: var(--g-hurry); box-shadow: 0 18px 40px -18px rgba(126, 32, 25, .55); }
.hero.missed { background: var(--g-missed); box-shadow: none; }
.hero.back { background: var(--g-back); box-shadow: 0 18px 40px -18px rgba(20, 19, 17, .5); }
.hero.loading { background: var(--g-loading); color: var(--ink); box-shadow: none; }
.eyebrow { font-size: 13px; font-weight: 650; text-transform: uppercase; letter-spacing: 1.2px; opacity: .8; }
.big { font-size: 52px; font-weight: 800; letter-spacing: -1.8px; line-height: 1.02; margin-top: auto; }
.line { font-size: 20px; font-weight: 550; margin-top: 10px; opacity: .95; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.chip { font-size: 13px; font-weight: 600; padding: 5px 11px; border-radius: 99px; background: rgba(255, 255, 255, .2); backdrop-filter: blur(6px); }
.cta {
  margin-top: 22px; padding: 14px 18px; border-radius: 16px; background: rgba(255, 255, 255, .18);
  font-weight: 650; display: flex; justify-content: space-between;
}
.pill { margin-top: 16px; align-self: flex-start; background: #fff; color: var(--ink); border-radius: 99px; padding: 10px 18px; font-weight: 650; }

.quiet { color: var(--muted); font-size: 15px; text-align: center; margin: 18px 0 0; }
.quiet.small { font-size: 12.5px; margin-top: auto; padding-top: 20px; }

.timer {
  margin-top: 14px; background: var(--card); box-shadow: var(--shadow); border-radius: 20px; padding: 12px 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.timer button { background: var(--ink); color: #fff; border-radius: 99px; padding: 9px 14px; font-size: 14px; font-weight: 650; }

.alert {
  background: var(--ink); color: #fff; border-radius: 18px; padding: 14px 16px; font-weight: 650; margin-bottom: 14px;
  animation: pop .3s ease-out;
}
@keyframes pop { from { transform: translateY(-8px); opacity: 0; } }

/* ---------- full-screen train ---------- */
.train { color: #fff; background: var(--g-plan); }
.train.now { background: var(--g-now); }
.train.hurry { background: var(--g-hurry); }
.train.missed { background: var(--g-missed); }
.train.back { background: var(--g-back); }
.tbar { display: flex; justify-content: space-between; align-items: center; }
.round { width: 40px; height: 40px; border-radius: 50%; background: rgba(255, 255, 255, .18); display: grid; place-items: center; font-size: 16px; }
.round.ghost { background: none; }
.count { font-size: 14px; font-weight: 600; opacity: .85; }
.tbody { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 20px 0; }
.status { font-size: 54px; font-weight: 800; letter-spacing: -2px; line-height: 1.02; }
.substatus { font-size: 20px; font-weight: 550; opacity: .92; margin-top: 8px; }
.trainline { display: flex; align-items: baseline; gap: 10px; margin-top: 30px; }
.time { font-size: 34px; font-weight: 750; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.dest { font-size: 20px; font-weight: 550; opacity: .9; }
.note { margin-top: 14px; padding: 12px 14px; border-radius: 16px; background: rgba(0, 0, 0, .16); font-size: 15px; font-weight: 500; }
.glass { margin-top: 18px; border-radius: 22px; background: rgba(255, 255, 255, .14); backdrop-filter: blur(10px); padding: 6px 16px; }
.glabel { font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: 1.1px; opacity: .75; padding: 10px 0 2px; }
.srow { display: flex; justify-content: space-between; align-items: baseline; padding: 11px 0; border-top: 1px solid rgba(255, 255, 255, .14); }
.glabel + .srow { border-top: 0; }
.srow span { font-size: 17px; font-weight: 550; }
.srow b { font-size: 22px; font-weight: 750; font-variant-numeric: tabular-nums; }
.srow.strong b { font-size: 26px; }

.tfoot { display: flex; flex-direction: column; gap: 10px; }
.soft { width: 100%; padding: 14px; border-radius: 18px; background: rgba(255, 255, 255, .16); font-weight: 650; }
.soft.on { background: rgba(255, 255, 255, .3); }
.nav { display: flex; gap: 10px; }
.next { flex: 1; padding: 18px; border-radius: 20px; background: #fff; color: var(--ink); font-size: 17px; font-weight: 750; }
.prevbtn { width: 62px; border-radius: 20px; background: rgba(255, 255, 255, .18); font-size: 20px; font-weight: 700; }

/* ---------- sheets ---------- */
.scrim { position: fixed; inset: 0; background: rgba(15, 17, 21, .35); animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 480px; max-height: 88dvh; overflow: auto;
  background: var(--bg); border-radius: 28px 28px 0 0; padding: 10px 18px calc(env(safe-area-inset-bottom) + 18px);
  animation: up .25s cubic-bezier(.2, .8, .2, 1);
}
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.grab { width: 40px; height: 5px; border-radius: 9px; background: #dcd3c6; margin: 0 auto 12px; }
.sheet h3 { font-size: 22px; letter-spacing: -.4px; margin: 4px 4px 14px; }
.group { background: var(--card); border-radius: 22px; box-shadow: var(--shadow); margin-bottom: 14px; overflow: hidden; }
.opt {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: left;
  padding: 15px 18px; background: var(--card); border-top: 1px solid var(--line); font-size: 17px; color: var(--muted);
}
.group > .opt:first-child { border-top: 0; }
.opt > span:first-child { display: flex; flex-direction: column; color: var(--ink); }
.opt small { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.sheet > .opt { border-radius: 20px; border: 0; margin-bottom: 8px; box-shadow: var(--shadow); }
.opt.on { color: var(--accent); font-weight: 700; }
.sheet > .opt.on { box-shadow: inset 0 0 0 2px var(--accent); }
.val { color: var(--ink); }
.stepper { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.stepper button { width: 34px; height: 34px; border-radius: 50%; background: var(--bg); font-size: 20px; font-weight: 600; }
.stepper b { white-space: nowrap; min-width: 52px; text-align: center; font-variant-numeric: tabular-nums; }
.primary { width: 100%; padding: 17px; border-radius: 20px; background: var(--ink); color: #fff; font-size: 17px; font-weight: 700; }

/* ---------- setup ---------- */
.setup h1 { font-size: 32px; letter-spacing: -1px; line-height: 1.1; margin: 22px 0 8px; }
.lead { color: var(--muted); font-size: 16px; margin: 0 0 18px; }
.lead.small { font-size: 14px; text-align: center; margin-top: 10px; }
.sbar { display: flex; justify-content: space-between; align-items: center; min-height: 24px; }
.sbar > * { flex: 1; }
.dots { display: flex; gap: 6px; justify-content: center; }
.dots i { width: 7px; height: 7px; border-radius: 9px; background: #dcd3c6; transition: width .2s; }
.dots i.on { width: 22px; background: var(--ink); }
.link { color: var(--muted); font-weight: 600; text-align: left; }
.search {
  width: 100%; font: inherit; font-size: 17px; padding: 14px 16px; border-radius: 16px; border: 0;
  background: var(--card); box-shadow: var(--shadow); margin-bottom: 12px; color: var(--ink); outline: none;
}
.list { flex: 1; overflow: auto; background: var(--card); border-radius: 22px; box-shadow: var(--shadow); margin-bottom: 14px; max-height: 52dvh; }
.list > .opt:first-child { border-top: 0; }
.tick {
  width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center;
  font-style: normal; font-size: 14px; color: #fff;
}
.opt.on .tick { background: var(--accent); border-color: var(--accent); }
.sticky { margin-top: auto; }
.bigstep { display: flex; align-items: center; justify-content: center; gap: 28px; margin: 30px 0; }
.bigstep > div { text-align: center; }
.bigstep b { display: block; font-size: 88px; font-weight: 800; letter-spacing: -4px; line-height: 1; font-variant-numeric: tabular-nums; }
.bigstep span { color: var(--muted); font-weight: 600; }
.bigstep button { width: 60px; height: 60px; border-radius: 50%; background: var(--card); box-shadow: var(--shadow); font-size: 28px; font-weight: 500; }
.soft.dark { background: var(--card); box-shadow: var(--shadow); color: var(--ink); }
.caret-wrap { white-space: nowrap; }
.wordmark { display: block; width: 210px; margin: 0 auto 4px; }
.was { font-size: .7em; font-weight: 600; opacity: .65; text-decoration-thickness: 2px; margin-right: 2px; }

/* ---------- weather ---------- */
.wx { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; padding: 12px 14px; border-radius: 16px;
  background: rgba(0, 0, 0, .14); font-size: 15px; line-height: 1.35; }
.wxicon { font-size: 24px; line-height: 1; }

/* ---------- plan ahead card on the main screen (same build as Next train, in navy) ---------- */
:root { --navy: #1f3a68; --navy-ink: #1f3a68; --g-navy: linear-gradient(150deg, #34568f 0%, #172c52 100%); --navy-tile: #dde6f5; }
.hero.navy { margin-top: 14px; min-height: 0; background: var(--g-navy); box-shadow: 0 18px 40px -18px rgba(23, 44, 82, .6); }
.ptop { display: flex; align-items: center; gap: 12px; }
.pico { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; background: var(--navy-tile); color: var(--navy-ink); }
.pico svg { width: 30px; height: 30px; }
.big.pb { font-size: 40px; letter-spacing: -1.3px; margin-top: 22px; }

/* ---------- segmented switch ---------- */
.seg { display: flex; background: var(--line); border-radius: 12px; padding: 3px; }
.seg button { flex: 1; padding: 8px 6px; border-radius: 9px; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }

/* ---------- plan ahead: full screen (off-white, three text sizes) ---------- */
.t-lg { font-size: 42px; font-weight: 800; letter-spacing: -1.4px; line-height: 1.05; }
.t-md { font-size: 18px; font-weight: 550; line-height: 1.3; }
.t-sm { font-size: 14px; font-weight: 550; line-height: 1.35; }
.muted { color: var(--muted); }
.navy-ink { color: var(--navy-ink); }
.planscreen { background: var(--bg); color: var(--ink); }
.planscreen .round { background: var(--card); box-shadow: var(--shadow); color: var(--ink); }
.planscreen .round.ghost { background: none; box-shadow: none; }
.pcard { background: var(--card); border-radius: 22px; box-shadow: var(--shadow); padding: 14px 16px; margin-top: 12px; }
.frow { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 4px 0 10px; }
.field { background: var(--bg); border-radius: 14px; padding: 10px 14px; color: var(--ink); font-weight: 700; }
button.field { flex: 1; text-align: left; display: flex; justify-content: space-between; }
input.field { width: 100%; border: 0; outline: none; font-family: inherit; }
.planscreen .seg { background: var(--bg); }
.planscreen .seg button { font-size: 14px; padding: 7px 14px; }
.presult { flex: 1; padding: 22px 2px 14px; }
.presult > .t-md { margin: 6px 0 0; }
.prow2 { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.pcard > .prow2:first-child { border-top: 0; }
.latepill { background: #fde8e6; color: #bf3a2c; border-radius: 99px; padding: 2px 10px; font-weight: 700; }
.wxrow { display: flex; gap: 12px; align-items: flex-start; }
.pfoot { display: flex; flex-direction: column; gap: 10px; }
.pbtn { width: 100%; padding: 14px; border-radius: 18px; background: var(--card); box-shadow: var(--shadow); font-weight: 700; }
.pbtn.on { background: var(--navy); color: #fff; }
.planscreen code { background: var(--line); padding: 1px 6px; border-radius: 6px; }
.sheet.tall { height: 82dvh; display: flex; flex-direction: column; }
.sheet.tall .list { max-height: none; flex: 1; }
.lhead { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); padding: 14px 18px 6px; background: var(--card); }
