:root {
  color-scheme: light;
  --ink: #132647;
  --muted: #4c5d78;
  --paper: #f2f5fa;
  --line: #d6dfea;
  --yellow: #ffd159;
  --white: #fff;
  font: 16px/1.5 system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, h3, p, dl, dd { margin: 0; }
a { color: inherit; }
button, input { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #235cb7; outline-offset: 4px; }
.shell { width: min(100% - 2rem, 58rem); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.topbar { background: var(--white); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: .65rem; min-height: 4.5rem; }
.brand { display: inline-flex; align-items: center; gap: .55rem; font-size: 1.32rem; font-weight: 800; letter-spacing: -.04em; text-decoration: none; white-space: nowrap; }
.brand span { display: grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: .5rem; background: var(--yellow); }
.pilot-link, .back { display: inline-flex; align-items: center; min-height: 2.75rem; font-weight: 700; font-size: .875rem; text-underline-offset: .2em; }

.hero { margin-top: clamp(1.25rem, 5vw, 3rem); position: relative; isolation: isolate; display: grid; grid-template-columns: minmax(0, 1fr) .75fr; overflow: hidden; border-radius: 1.35rem; background: var(--ink); color: var(--white); }
.hero-copy { padding: clamp(1.4rem, 5vw, 3.5rem); }
.hero h1 { font-size: clamp(3rem, 8vw, 5.2rem); line-height: .99; font-weight: 800; letter-spacing: -.075em; }
.hero p { margin: .9rem 0 1.3rem; color: #e1e9f8; max-width: 29ch; font-size: clamp(1rem, 2.1vw, 1.2rem); }
.hero a:focus-visible { outline-color: var(--white); }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 3rem; padding: .62rem 1rem; border: 1px solid transparent; border-radius: .7rem; font-weight: 750; text-decoration: none; }
.primary { background: var(--yellow); color: var(--ink); }
.primary:hover { background: #ffe287; }
.outline { background: var(--white); color: var(--ink); border-color: #adc0db; }
.outline:hover { background: #eaf0fa; }

.journey-mark { position: relative; min-height: 12rem; background-image: linear-gradient(0deg,#ffffff0e 1px,transparent 1px),linear-gradient(90deg,#ffffff0e 1px,transparent 1px); background-size: 28px 28px; mask-image: linear-gradient(90deg,transparent,#000 14%); }
.journey-mark span { position: absolute; left: 19%; top: 27%; width: 64%; height: 48%; border: solid var(--yellow); border-width: 0 4px 4px 0; border-bottom-right-radius: 44px; }
.journey-mark i { position: absolute; z-index: 1; width: 1.25rem; aspect-ratio: 1; border: 3px solid var(--yellow); border-radius: 50%; background: var(--ink); }
.journey-mark i:nth-child(1) { left: calc(19% - .6rem); top: calc(75% - .75rem); }
.journey-mark i:nth-child(2) { left: calc(52% - .6rem); top: calc(75% - .75rem); }
.journey-mark i:nth-child(3) { right: calc(17% - .5rem); top: calc(27% - .6rem); background: var(--yellow); }

.saved { margin-top: 2rem; }
h2 { font-size: 1.26rem; letter-spacing: -.025em; }
.saved p, .secondary, .hint { color: var(--muted); }
.saved > div { margin-top: .7rem; }
.saved-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .65rem; }
.saved-list a { display: grid; gap: .15rem; border-radius: .85rem; border: 1px solid var(--line); background: var(--white); text-decoration: none; padding: .8rem 1rem; }
.saved-list a:hover, .place:hover { border-color: #7598c9; }
.saved-list span { color: var(--muted); font-size: .875rem; }
.saved-list .saved-live { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .6rem; }
.saved-live button { min-height: 2.75rem; color: var(--ink); background: transparent; border: 0; text-decoration: underline; }

.task { max-width: 43rem; margin: clamp(1rem, 3.5vw, 2rem) auto 0; }
.task h1 { margin: .25rem 0 .85rem; font-size: clamp(2.1rem, 7vw, 3.6rem); line-height: 1.08; letter-spacing: -.055em; }
.back { color: #254f9b; }
#place-query { display: block; width: 100%; min-height: 3.35rem; border: 1px solid #8aa2c7; border-radius: .7rem; padding: .65rem .9rem; background: white; color: var(--ink); }
#place-query::placeholder { color: #536680; }
.hint { margin: .7rem 0 .55rem; font-size: .875rem; min-height: 1.3rem; }
.results { list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; }
.place { text-decoration: none; display: grid; gap: .15rem; padding: .8rem .9rem; border-radius: .8rem; border: 1px solid var(--line); background: var(--white); }
.place span { font-size: .875rem; color: var(--muted); }
.destination-name { font-size: 1.18rem; font-weight: 760; }
.journey-context { display: flex; flex-wrap: wrap; gap: .8rem 1.75rem; margin: 1.2rem 0; padding: .8rem 0; border-block: 1px solid var(--line); }
.journey-context dt, .plan-option small { color: var(--muted); font-size: .875rem; }
.journey-context dd { font-weight: 670; }
fieldset { border: 0; padding: 0; margin: 0 0 1.15rem; }
legend { font-weight: 750; margin-bottom: .5rem; }
.plan-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .65rem; }
.plan-option { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .65rem; align-items: start; border-radius: .8rem; border: 1px solid var(--line); padding: .8rem; background: var(--white); cursor: pointer; }
.plan-option:has(input:checked) { background: #edf4ff; border-color: #426eaf; }
.plan-option input { margin: .22rem 0 0; width: 1.05rem; height: 1.05rem; accent-color: #254f9b; }
.plan-option strong, .plan-option small { display: block; }
.plan-option .arrival { font-size: 1.25rem; letter-spacing: -.02em; }
.error { margin-top: .65rem; color: #982427; }

.leave-panel { margin: 1.25rem 0; padding: 1.1rem; border-radius: .95rem; background: var(--ink); color: var(--white); display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.leave-panel h2, .leave-panel h3 { font-size: 1rem; font-weight: 700; }
.leave-panel .leave-time { display: block; font-size: 2.55rem; color: var(--yellow); letter-spacing: -.06em; line-height: 1.2; }
.leave-panel p { color: #dce7f9; font-size: .875rem; margin-top: .2rem; }
.itinerary { background: var(--white); border-radius: .95rem; border: 1px solid var(--line); padding: 1rem; margin-bottom: 1rem; }
.itinerary ol { list-style: none; padding: 0; margin: .7rem 0 0; }
.itinerary li { display: grid; grid-template-columns: 3.2rem minmax(0,1fr); gap: .5rem; padding: .55rem 0; border-top: 1px solid var(--line); }
.itinerary time { font-variant-numeric: tabular-nums; font-weight: 760; }
.itinerary li span { color: var(--muted); display: block; font-size: .875rem; }
.footer { color: var(--muted); font-size: .875rem; padding-block: 1.5rem; }

@media (max-width: 37rem) {
  .hero { grid-template-columns: minmax(0,2fr) minmax(0,1fr); }
  .journey-mark { margin-left: -1rem; }
  .journey-mark span { left: 12%; width: 72%; }
  .journey-mark i:nth-child(1) { left: calc(12% - .6rem); }
  .plan-grid { grid-template-columns: 1fr; }
}
@media (max-width: 24rem) {
  .hero { grid-template-columns: 1fr; }
  .journey-mark { display: none; }
  .leave-panel { grid-template-columns: 1fr; }
}

.trip-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1rem; }
.guide-mode { font-size: .875rem; font-weight: 700; color: var(--muted); }
.journey-line {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  list-style: none;
  margin: .85rem 0 1rem;
  padding: 0;
  text-align: center;
  font-size: .875rem;
  color: var(--muted);
}
.journey-line li { position: relative; padding: 1.2rem .2rem 0; }
.journey-line li::before {
  position: absolute;
  content: "";
  inset-block-start: .15rem;
  inset-inline-start: calc(50% - .34rem);
  width: .68rem;
  aspect-ratio: 1;
  border: 2px solid #647da2;
  border-radius: 50%;
  background: var(--paper);
  z-index: 1;
}
.journey-line li:not(:last-child)::after {
  position: absolute;
  content: "";
  inset-block-start: .43rem;
  inset-inline-start: 50%;
  width: 100%;
  border-top: 2px solid #a9b9cf;
}
.journey-line li.passed::before { border-color: #426eaf; background: #426eaf; }
.journey-line li[aria-current] { font-weight: 800; color: var(--ink); }
.journey-line li[aria-current]::before { background: var(--yellow); border-color: var(--ink); }

.guide-panel { background: var(--white); border: 1px solid var(--line); border-radius: 1rem; padding: clamp(1rem, 4vw, 1.7rem); }
.guide-panel h1 { margin-block: .3rem .55rem; }
.guide-phase { color: #254f9b; font-weight: 750; }
.guide-detail { color: var(--muted); }
.guide-walk {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(1.5rem, 1fr) minmax(0, auto);
  align-items: center;
  gap: .55rem;
  margin-top: 1rem;
  background: #edf4ff;
  border-radius: .7rem;
  padding: .8rem;
  font-size: .875rem;
  font-weight: 700;
}
.guide-walk i { border-top: 3px dotted #426eaf; }
.guide-walk small { grid-column: 1 / -1; color: var(--muted); font-weight: 500; }
.guide-fact { display: grid; gap: .1rem; margin-top: .8rem; padding-block: .55rem; }
.guide-fact span { color: var(--muted); font-size: .875rem; }
.guide-fact strong { font-size: clamp(1.35rem, 6vw, 2rem); line-height: 1.2; }
.guide-panel .button { margin-top: .9rem; }
.guide-update {
  margin-top: .5rem;
  padding: .72rem .85rem;
  background: #edf4ff;
  border-radius: .65rem;
  color: #203a68;
  font-weight: 650;
}
.rehearsal-controls {
  display: grid;
  gap: .35rem;
  margin-top: .9rem;
  max-width: 25rem;
}
.rehearsal-controls label { font-size: .875rem; color: var(--muted); font-weight: 700; }
.rehearsal-controls select {
  min-height: 2.75rem;
  color: var(--ink);
  font: inherit;
  background: var(--white);
  border: 1px solid #8aa2c7;
  border-radius: .65rem;
  padding: .45rem .65rem;
}

.resume-trip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .65rem 1rem;
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: .85rem;
  margin-top: 1rem;
  padding: .85rem 1rem;
}
.resume-trip p { color: var(--muted); }
.resume-trip + .hero { margin-top: 1rem; }
.resume-trip[hidden] + .hero { margin-top: clamp(1.25rem, 5vw, 3rem); }

.result-group + .result-group { margin-top: 1.35rem; }
.result-group h2 { margin-bottom: .5rem; font-size: 1.05rem; }
