:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, sans-serif;
  color: #142747;
  background: #f1f4f9;
  line-height: 1.5;
  --navy: #132647;
  --muted: #465875;
  --line: #dce4ef;
  --yellow: #ffd158;
  --blue: #254f9b;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
button, input, select { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #235dc8; outline-offset: 4px; }
h1, h2, h3, p, dl, dd { margin: 0; }
h2 { font-size: 1.375rem; line-height: 1.2; letter-spacing: -.025em; }
h3 { font-size: 1.125rem; line-height: 1.3; }
a { color: var(--blue); text-underline-offset: .22em; }

.wrap { width: min(100% - 2rem, 62rem); margin-inline: auto; }
.top { color: #fff; background: var(--navy); }
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 5rem;
  border-bottom: 1px solid #ffffff30;
}
.brand { display: flex; align-items: center; gap: .65rem; font-size: 1.4rem; font-weight: 800; letter-spacing: -.04em; white-space: nowrap; }
.brand-icon {
  display: grid;
  place-items: center;
  inline-size: 2rem;
  block-size: 2rem;
  border-radius: .5rem;
  color: var(--navy);
  background: var(--yellow);
  font-size: 1.2rem;
}
.place { color: #dce6f7; font-size: .875rem; font-weight: 650; text-align: right; }

.hero { padding: 2.65rem 0 4.6rem; }
.eyebrow { font-size: .875rem; font-weight: 750; letter-spacing: .045em; text-transform: uppercase; }
.hero .eyebrow { color: var(--yellow); }
.hero h1 {
  margin: .45rem 0 .65rem;
  font-size: clamp(2.7rem, 7vw, 5rem);
  font-weight: 800;
  letter-spacing: -.067em;
  line-height: .98;
}

.main { margin-top: -2.15rem; }
.journey-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 1.1rem; }
.card {
  min-width: 0;
  background: white;
  border: 1px solid var(--line);
  border-radius: 1.15rem;
  padding: clamp(1.15rem, 3.3vw, 1.65rem);
  box-shadow: 0 8px 24px #1326470a;
}

.stops { list-style: none; margin: 1.4rem 0 .1rem; padding: 0; }
.stops li { position: relative; padding: 0 0 1.65rem 1.6rem; }
.stops li:last-child { padding-bottom: 0; }
.stops li::before {
  content: "";
  position: absolute;
  z-index: 1;
  left: 0;
  top: .24rem;
  width: .92rem;
  height: .92rem;
  border: 3px solid var(--blue);
  border-radius: 50%;
  background: white;
}
.stops li:last-child::before { background: var(--blue); }
.stops li:first-child::after {
  content: "";
  position: absolute;
  left: .39rem;
  top: .8rem;
  height: calc(100% - .42rem);
  border-left: 2px solid #aabedc;
}
.stops h3 { margin: .15rem 0 .25rem; }
.stops p:not(.eyebrow) { color: var(--muted); }
.stops a { display: inline-flex; align-items: center; min-height: 2.75rem; font-weight: 650; }
.stops a[hidden] { display: none; }
.stops .eyebrow, .headsign .eyebrow { color: var(--muted); }

.card-heading { display: flex; align-items: center; justify-content: space-between; gap: .55rem; }
.refresh {
  background: #fff;
  border: 1px solid #aebed5;
  border-radius: .65rem;
  color: var(--blue);
  padding: .45rem .8rem;
  min-height: 2.75rem;
  font-size: .875rem;
  font-weight: 700;
}
.refresh:hover { background: #edf3fc; }
.refresh:disabled { opacity: .65; cursor: wait; }
#journey-departures { display: inline-flex; align-items: center; }
#data-status, .error { margin-top: .4rem; font-size: .875rem; }
#data-status { color: var(--muted); }
.error { color: #a12626; }
.next-bus { display: flex; align-items: center; gap: .9rem; margin-top: 1rem; }
.route-number {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: .65rem;
  min-width: 3.35rem;
  height: 3.35rem;
  padding: 0 .35rem;
  background: var(--yellow);
  font-size: 1.75rem;
  font-weight: 800;
}
.time-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; margin-top: 1rem; }
.time-grid > div { background: #f2f5fa; border-radius: .72rem; padding: .65rem .72rem; }
.time-grid dt, .time-grid dd span { font-size: .875rem; color: var(--muted); }
.time-grid time { display: block; font-size: clamp(1.5rem, 5vw, 2rem); line-height: 1.2; font-weight: 780; font-variant-numeric: tabular-nums; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
footer { padding: 1.25rem 0 1.65rem; color: var(--muted); font-size: .875rem; }

@media (max-width: 42rem) {
  .masthead { min-height: 4rem; }
  .hero { padding: 1.7rem 0 3.85rem; }
  .journey-grid { grid-template-columns: 1fr; }
}

.destination-control { margin-top: 1.3rem; display: grid; gap: .35rem; max-width: 22rem; }
.destination-control label { color: #dce6f7; font-size: .875rem; font-weight: 700; }
.destination-control select {
  appearance: none;
  width: 100%;
  min-height: 3rem;
  padding: .55rem 2.75rem .55rem .85rem;
  border: 1px solid #ffffff80;
  border-radius: .65rem;
  background:
    linear-gradient(45deg, transparent 50%, var(--navy) 50%) right 1.26rem center / .38rem .38rem no-repeat,
    linear-gradient(135deg, var(--navy) 50%, transparent 50%) right .9rem center / .38rem .38rem no-repeat,
    #fff;
  color: var(--navy);
  font: inherit;
  font-weight: 700;
}
.destination-control select:focus-visible { outline-color: var(--yellow); }
.hero h1 { overflow-wrap: break-word; }
.headsign-text { margin-top: .12rem; font-size: 1.1rem; font-weight: 750; line-height: 1.25; }
.missed {
  margin-top: 1rem;
  min-height: 2.75rem;
  padding: .45rem .9rem;
  border: 1px solid #aebed5;
  border-radius: .65rem;
  background: white;
  color: var(--blue);
  font-size: .875rem;
  font-weight: 750;
}
.missed:hover { background: #edf3fc; }
.missed:disabled { opacity: .65; cursor: wait; }
.recovery {
  margin-top: .85rem;
  padding: .7rem .85rem;
  border-radius: .65rem;
  background: #eef3ff;
  color: #203a68;
}
.recovery button {
  padding: .45rem 0;
  min-height: 2.75rem;
  border: 0;
  background: none;
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: .22em;
  font-size: .875rem;
  font-weight: 700;
}
.stops .walk, .walk { margin-top: .3rem; color: var(--muted); }
.alternative { margin-top: 1.1rem; }
.alternative-summary { display: grid; grid-template-columns: 1.1fr 1fr; gap: 1rem; align-items: end; }
.direct-walk { margin-bottom: 1rem; }
.leave-reminder { margin-block: .35rem; }
.alternative-details { margin-top: 1rem; display: grid; gap: .35rem; }
.alternative-details .walk { margin-top: 0; }
.alternative-details a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  justify-self: start;
  font-weight: 650;
}
@media (max-width: 42rem) {
  .alternative-summary { display: block; }
}

.rail-handoff { margin-bottom: 1.1rem; }
.rail-handoff summary { font-weight: 750; cursor: pointer; }
.rail-handoff form { display: grid; gap: .6rem; max-width: 25rem; margin-top: .9rem; }
.rail-handoff label { font-weight: 650; }
.rail-handoff :is(input, select) {
  width: 100%;
  min-height: 2.75rem;
  color: var(--navy);
  background: #fff;
  border: 1px solid #aebed5;
  border-radius: .65rem;
  padding: .4rem .65rem;
}
.rail-handoff form p { color: var(--muted); font-size: .875rem; }
.rail-buttons { display: flex; flex-wrap: wrap; gap: .5rem; }
.rail-options, .train-picker { display: grid; gap: .55rem; }
.rail-options { margin-block: .85rem 1rem; padding-bottom: .9rem; border-bottom: 1px solid var(--line); }
.rail-options > button { justify-self: start; }
.rail-options p { color: var(--muted); font-size: .875rem; }
.train-picker { max-width: 30rem; }
#aston-bus-picker { margin-top: .65rem; }
#aston-onward h3 { margin-top: 1rem; }
#aston-onward button { margin-top: .35rem; }
.train-picker label { font-weight: 700; }
.train-picker select {
  width: 100%;
  min-height: 2.75rem;
  padding: .45rem .55rem;
  border: 1px solid #aebed5;
  border-radius: .65rem;
  color: var(--navy);
  background: #fff;
  font: inherit;
}
.connection-change {
  margin-top: .7rem;
  padding: .6rem .75rem;
  border-radius: .6rem;
  background: #eef3ff;
  color: #203a68;
  font-weight: 650;
}

.masthead .brand { color: inherit; text-decoration: none; }
.masthead .place { text-underline-offset: .2em; }
.masthead a:focus-visible { outline-color: var(--yellow); }

.guide-action {
  min-height: 2.75rem;
  padding: .45rem .9rem;
  border: 1px solid transparent;
  border-radius: .65rem;
  background: var(--yellow);
  color: var(--navy);
  font-size: .875rem;
  font-weight: 750;
}
.guide-action:hover { background: #ffe38a; }
.guide-action:disabled { opacity: .65; cursor: wait; }
#start-real-journey { margin: .6rem 0 0 .35rem; }
.guide-start-time { margin-top: .5rem; color: var(--muted); font-size: .875rem; }
.resume-link { display: inline-block; margin-top: .7rem; font-weight: 700; }
.guided-trip { max-width: 43rem; }
.guide-progress {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  margin: 1.4rem 0 1rem;
  padding: 0;
  list-style: none;
  text-align: center;
  font-size: .875rem;
  color: var(--muted);
}
.guide-progress li { position: relative; padding: 1.15rem .15rem 0; }
.guide-progress li::before {
  position: absolute;
  content: "";
  z-index: 1;
  top: .1rem;
  left: calc(50% - .35rem);
  width: .7rem;
  aspect-ratio: 1;
  border: 2px solid #647da2;
  border-radius: 50%;
  background: #f1f4f9;
}
.guide-progress li:not(:last-child)::after {
  position: absolute;
  content: "";
  top: .43rem;
  left: 50%;
  width: 100%;
  border-top: 2px solid #a9b9cf;
}
.guide-progress li.passed::before { background: var(--blue); border-color: var(--blue); }
.guide-progress li[aria-current] { font-weight: 800; color: var(--navy); }
.guide-progress li[aria-current]::before { background: var(--yellow); border-color: var(--navy); }
.guide-card { margin-top: 1.05rem; }
.guide-card h1 { margin: .35rem 0 .6rem; font-size: clamp(1.8rem, 6vw, 2.8rem); line-height: 1.12; letter-spacing: -.045em; }
.guide-card #guide-phase { color: var(--blue); }
.guide-card #guide-detail { color: var(--muted); }
.guide-card #guide-map-panel { margin-top: 1rem; }
#guide-map { height: clamp(14rem, 45vw, 21rem); border-radius: .75rem; background: #e9eff7; }
#guide-route-sketch { margin: 0; }
#guide-route-sketch canvas { display: block; width: 100%; max-height: 21rem; object-fit: contain; border-radius: .75rem; background: #e9eff7; }
#guide-route-sketch figcaption { display: flex; flex-wrap: wrap; gap: .4rem 1rem; padding: .5rem 0 0; font-size: .875rem; color: var(--muted); }
.sketch-marker { display: inline-flex; align-items: center; gap: .35rem; }
.sketch-marker::before { content: ""; width: .7rem; height: .7rem; border: 2px solid var(--navy); border-radius: 50%; background: #fff; }
.sketch-finish::before { border-radius: .1rem; background: var(--yellow); }
#guide-map-link { display: inline-flex; align-items: center; min-height: 2.75rem; font-size: .875rem; font-weight: 650; }
#guide-map-unavailable { font-size: .875rem; color: var(--muted); }
.guide-timing { margin-top: .75rem; background: #edf4ff; border-radius: .65rem; padding: .62rem .8rem; }
.fare-details { margin-top: .75rem; }
.fare-details summary { cursor: pointer; font-weight: 700; }
.fare-details p, .fare-details a { margin-top: .4rem; }
#guide-read-walk { margin-top: .6rem; }
#guide-current-step { margin-top: .45rem; }
#guide-speak-bus { margin-top: .75rem; }
#guide-speak-bus[aria-pressed="true"] { background: var(--navy); color: white; }
#guide-walking-step-list { margin: .65rem 0; padding-inline-start: 1.6rem; }
#guide-walking-step-list li + li { margin-top: .45rem; }
.guide-actions { margin-top: 1rem; }

.guide-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.origin-shortcuts { margin-top: 0; }
#journey-home-dialog { width: min(28rem, calc(100% - 2rem)); margin: auto; }
#journey-home-dialog::backdrop { background: rgb(19 38 71 / 55%); }
#guide-end { margin-top: 1rem; }
.guide-recovery-status { margin-top: .75rem; color: var(--muted); }
.stop-departures { list-style: none; margin: .75rem 0 0; padding: 0; }
.stop-departures li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .2rem 1rem; padding: .75rem 0; border-top: 1px solid #d5dfed; }
.stop-service { font-weight: 750; }
.stop-service small { display: block; font-weight: 400; color: var(--muted); }
.stop-departures time { font-variant-numeric: tabular-nums; }
#stop-actions { margin-bottom: .75rem; align-items: center; }
.stop-choices { list-style: none; padding: 0; }
.stop-choices button { width: 100%; text-align: left; background: #f2f5fa; border: 0; margin-bottom: .25rem; padding: .65rem; color: var(--navy); font: inherit; cursor: pointer; }
.bus-journey-results { list-style: none; margin: .65rem 0; padding: 0; }
.bus-journey-results > li { padding: .9rem 0; border-top: 1px solid #d5dfed; }
.bus-journey-results h3 { margin: 0 0 .25rem; }
.bus-journey-legs { padding-inline-start: 1.35rem; margin: .6rem 0 0; }
.bus-journey-legs li + li { margin-top: .65rem; }
.bus-journey-legs p { margin-top: .2rem; }
.bus-journey-legs small { color: var(--muted); }
.bus-journey-change { color: var(--navy); font-weight: 700; }
.bus-trip-progress { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0,1fr); }
#bus-trip-missed, #bus-trip-recovery, #bus-trip-alternatives button { margin-top: .65rem; }
