:root {
  --green: #00613A;       /* primary-route sign green */
  --green-deep: #004A2C;
  --yellow: #FFD200;      /* route-number yellow */
  --ink: #1B2420;
  --paper: #F3F5F4;
  --card: #FFFFFF;
  --line: #D5DCD8;
  --muted: #56615B;
  --train: #9E1B32;
  --coach: #5B2A86;
  --taxi: #FFD200;
  --drive: #1D5BA4;       /* motorway blue */
  --tram: #00796B;
  --local: #00613A;
  --radius-sign: 18px;
  --radius-card: 10px;
  font-family: "Atkinson Hyperlegible", "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; line-height: 1.45; }
main { max-width: 640px; margin: 0 auto; padding: 16px 16px 48px; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }

/* The one bold element: the search is a road sign */
.sign {
  background: var(--green);
  border-radius: var(--radius-sign);
  padding: 7px;
  margin-top: max(4px, env(safe-area-inset-top));
}
.sign-inner {
  border: 3px solid #fff;
  border-radius: calc(var(--radius-sign) - 6px);
  padding: 18px 16px 16px;
  color: #fff;
}
.sign-title { margin: 0 0 14px; font-size: 2.1rem; line-height: 1.1; letter-spacing: -0.01em; }
.field { position: relative; margin-bottom: 12px; }
.field label { display: block; font-size: 0.95rem; margin-bottom: 4px; }
.field input {
  width: 100%; padding: 12px 12px; border: 0; border-radius: 6px;
  background: #fff; color: var(--ink); font-size: 1.1rem;
}
.from-row { display: flex; gap: 8px; }
.from-row input { flex: 1; min-width: 0; }
.ghost {
  flex: none; background: transparent; color: #fff; border: 2px solid #fff;
  border-radius: 6px; padding: 0 12px; cursor: pointer; font-size: 0.9rem;
}
.suggest {
  list-style: none; margin: 4px 0 0; padding: 4px 0; position: absolute; z-index: 5;
  left: 0; right: 0; background: #fff; color: var(--ink); border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 40, 20, 0.25); max-height: 280px; overflow: auto;
}
.suggest li { padding: 10px 12px; cursor: pointer; }
.suggest li[aria-selected="true"], .suggest li:hover { background: #E6F1EB; }
.suggest small { color: var(--muted); display: block; }
.row { display: flex; gap: 12px; align-items: flex-end; }
.people { margin-bottom: 0; }
.stepper { display: flex; align-items: center; background: #fff; border-radius: 6px; color: var(--ink); }
.stepper button { width: 44px; height: 46px; border: 0; background: none; font-size: 1.4rem; cursor: pointer; }
.stepper output { min-width: 24px; text-align: center; font-weight: 700; }
.go {
  flex: 1; height: 46px; border: 0; border-radius: 6px; cursor: pointer;
  background: var(--yellow); color: var(--ink); font-weight: 700; font-size: 1.05rem;
}
.go[disabled] { opacity: 0.7; cursor: progress; }

.notice { margin: 14px 2px 0; padding: 12px 14px; border-radius: var(--radius-card); background: #FFF6CC; }
.notice.error { background: #FBE3E3; }

/* Results */
.trip { margin: 22px 2px 10px; }
.trip h2 { margin: 0; font-size: 1.6rem; line-height: 1.15; }
.trip p { margin: 4px 0 0; color: var(--muted); }
.sort { display: flex; gap: 6px; margin: 12px 0; }
.sort button {
  flex: 1; padding: 9px 4px; border: 2px solid var(--green); border-radius: 999px;
  background: transparent; color: var(--green); font-weight: 700; cursor: pointer;
}
.sort button[aria-selected="true"] { background: var(--green); color: #fff; }

.options { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.opt {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-card);
  padding: 14px; display: grid; grid-template-columns: 44px 1fr auto; gap: 4px 12px;
}
.badge {
  grid-row: span 2; width: 44px; height: 44px; border-radius: 8px;
  display: grid; place-items: center; color: #fff;
}
.badge svg { width: 26px; height: 26px; }
.m-train .badge { background: var(--train); }
.m-coach .badge { background: var(--coach); }
.m-taxi .badge { background: var(--taxi); color: var(--ink); }
.m-drive .badge { background: var(--drive); }
.m-tram .badge { background: var(--tram); }
.m-local .badge { background: var(--local); }
.opt h3 { margin: 0; font-size: 1.15rem; }
.time { font-weight: 700; font-size: 1.15rem; text-align: right; white-space: nowrap; }
.sub { color: var(--muted); font-size: 0.95rem; }
.price { text-align: right; white-space: nowrap; }
.price b { font-size: 1.05rem; }
.price small { display: block; color: var(--muted); }
.detail { grid-column: 1 / -1; margin-top: 8px; }
.detail p { margin: 6px 0; font-size: 0.95rem; }
.tip { background: #EEF6F1; border-radius: 6px; padding: 8px 10px; }
.live { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 8px; }
.live h4 { margin: 0 0 6px; font-size: 0.95rem; display: flex; align-items: center; gap: 6px; }
.live h4::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #1FA463; }
.live table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.live td { padding: 4px 0; border-bottom: 1px solid #EEF1EF; }
.live td:last-child { text-align: right; }
.late { color: #B3261E; font-weight: 700; }
.links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.links a {
  text-decoration: none; padding: 8px 12px; border-radius: 6px; font-weight: 700; font-size: 0.95rem;
  background: var(--paper); color: var(--ink); border: 1px solid var(--line);
}
.links a.primary { background: var(--green); color: #fff; border-color: var(--green); }
.small { color: var(--muted); font-size: 0.85rem; margin-top: 16px; }

@media (prefers-reduced-motion: no-preference) {
  .options.fresh .opt { animation: rise .25s ease-out both; }
  .options.fresh .opt:nth-child(2) { animation-delay: .04s; }
  .options.fresh .opt:nth-child(3) { animation-delay: .08s; }
  .options.fresh .opt:nth-child(n+4) { animation-delay: .12s; }
  @keyframes rise { from { opacity: 0; transform: translateY(6px); } }
}
@media (max-width: 380px) {
  .sign-title { font-size: 1.8rem; }
  .row { flex-direction: column; align-items: stretch; }
}
