:root {
  --ink: #27332f;
  --muted: #65736d;
  --line: #d9e1dd;
  --paper: #fbfcfb;
  --canvas: #f1f5f2;
  --sage: #dce9e3;
  --sage-strong: #719286;
  --sage-dark: #48685d;
  --blue: #dfe9f1;
  --blue-dark: #526f84;
  --peach: #f3e4da;
  --gold: #eee4c8;
  --danger: #9a514c;
  --shadow: 0 18px 48px rgba(49, 68, 61, .09);
  --radius: 22px;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--canvas); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 0%, rgba(220, 233, 227, .9), transparent 28rem),
    radial-gradient(circle at 100% 12%, rgba(223, 233, 241, .75), transparent 32rem),
    var(--canvas);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button, input, select { font: inherit; }
button { color: inherit; }

.site-header {
  border-bottom: 1px solid rgba(113, 146, 134, .22);
  background: rgba(251, 252, 251, .78);
  backdrop-filter: blur(15px);
}

.header-inner, main, .footer-inner {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
}

.header-inner {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  background: var(--sage-dark);
  font-size: 1.2rem;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(72, 104, 93, .2);
}

.brand strong, .brand small { display: block; }
.brand strong { font-size: 1.05rem; letter-spacing: .01em; }
.brand small { margin-top: 1px; color: var(--muted); font-size: .76rem; }

.schedule-badge {
  padding: 7px 12px;
  border: 1px solid #d5c99f;
  border-radius: 999px;
  color: #6d6241;
  background: var(--gold);
  font-size: .78rem;
  font-weight: 700;
}

main { padding: 56px 0 72px; }

.search-panel {
  position: relative;
  padding: 38px;
  border: 1px solid rgba(113, 146, 134, .2);
  border-radius: 28px;
  background: rgba(251, 252, 251, .94);
  box-shadow: var(--shadow);
}

.intro { max-width: 650px; margin-bottom: 30px; }
.eyebrow {
  margin: 0 0 5px;
  color: var(--sage-dark);
  font-size: .77rem;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 7px; font-size: clamp(2rem, 4vw, 3rem); line-height: 1.1; letter-spacing: -.035em; }
h2 { margin-bottom: 0; font-size: clamp(1.45rem, 3vw, 2rem); letter-spacing: -.025em; }
.intro > p:last-child { margin: 0; color: var(--muted); }

.places-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px minmax(0, 1fr);
  gap: 14px;
  align-items: end;
}

.field { position: relative; min-width: 0; }
.field label {
  display: block;
  margin: 0 0 7px 3px;
  color: #53615c;
  font-size: .8rem;
  font-weight: 750;
}

.input-shell { position: relative; }
.field-symbol {
  position: absolute;
  z-index: 1;
  left: 17px;
  top: 50%;
  color: var(--sage-strong);
  transform: translateY(-50%);
  pointer-events: none;
}
.destination-symbol { color: var(--blue-dark); font-size: .8rem; }

input, select {
  width: 100%;
  height: 54px;
  border: 1px solid #cfd9d4;
  border-radius: 15px;
  outline: none;
  color: var(--ink);
  background: #fff;
  transition: border-color .18s, box-shadow .18s, background .18s;
}

input { padding: 0 15px; }
.input-shell input { padding-left: 43px; }
select { padding: 0 42px 0 15px; }
input:focus, select:focus {
  border-color: var(--sage-strong);
  box-shadow: 0 0 0 4px rgba(113, 146, 134, .13);
}

.swap-button {
  width: 42px;
  height: 42px;
  margin-bottom: 6px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--canvas);
  cursor: pointer;
  font-size: 1.15rem;
  transition: transform .16s, background .16s;
}
.swap-button:hover { background: var(--sage); transform: translateY(-1px); }

.suggestions {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  max-height: 330px;
  overflow-y: auto;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(42, 58, 52, .16);
}

.suggestion {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.suggestion:hover, .suggestion:focus { outline: none; background: var(--canvas); }
.suggestion strong { display: block; font-size: .93rem; }
.suggestion small { color: var(--muted); font-size: .75rem; }
.kind-pill { flex: 0 0 auto; padding: 4px 8px; border-radius: 999px; background: var(--blue); color: var(--blue-dark); font-size: .68rem; font-weight: 800; }
.suggestion.place .kind-pill { color: var(--sage-dark); background: var(--sage); }

.time-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr minmax(190px, 1.25fr);
  gap: 14px;
  align-items: end;
  margin-top: 19px;
}

.primary-button {
  height: 54px;
  border: 0;
  border-radius: 15px;
  color: #fff;
  background: var(--sage-dark);
  box-shadow: 0 10px 24px rgba(72, 104, 93, .21);
  cursor: pointer;
  font-weight: 800;
  transition: transform .16s, filter .16s;
}
.primary-button:hover { filter: brightness(1.05); transform: translateY(-1px); }
.primary-button:disabled { cursor: wait; filter: grayscale(.25); opacity: .75; transform: none; }
.button-spinner { display: none; width: 17px; height: 17px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.primary-button.loading .button-label { display: none; }
.primary-button.loading .button-spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.advanced-settings {
  margin-top: 22px;
  border-top: 1px solid var(--line);
}
.advanced-settings summary {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  width: fit-content;
  padding: 18px 3px 2px;
  color: var(--sage-dark);
  cursor: pointer;
  font-size: .86rem;
  font-weight: 800;
  list-style: none;
}
.advanced-settings summary::-webkit-details-marker { display: none; }
.advanced-settings summary small { color: var(--muted); font-size: .72rem; font-weight: 600; }
.advanced-settings summary::after { content: "⌄"; color: var(--sage-strong); font-size: .8rem; }
.advanced-settings[open] summary::after { content: "⌃"; }
.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 17px 14px;
  margin-top: 18px;
  padding: 21px;
  border-radius: 17px;
  background: var(--canvas);
}
.unit-input { position: relative; }
.unit-input input { padding-right: 58px; background: var(--paper); }
.unit-input span {
  position: absolute;
  top: 50%;
  right: 16px;
  color: var(--muted);
  pointer-events: none;
  transform: translateY(-50%);
  font-size: .76rem;
  font-weight: 700;
}
.field-help { display: block; margin: 7px 3px 0; color: var(--muted); font-size: .7rem; line-height: 1.4; }

.form-message {
  margin: 18px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  color: var(--danger);
  background: #f8e8e6;
  font-weight: 650;
}

.results-section { margin-top: 48px; }
.results-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin: 0 4px 20px; }
.results-tools { display: flex; align-items: end; gap: 12px; }
.results-summary { margin: 0 5px 11px 0; color: var(--muted); font-size: .88rem; white-space: nowrap; }
.results-tools label { margin-bottom: 11px; color: var(--muted); font-size: .76rem; font-weight: 750; }
.results-tools select { width: auto; min-width: 175px; height: 42px; border-radius: 12px; background: var(--paper); font-size: .82rem; }
.results { display: grid; gap: 24px; }

.journey-card {
  overflow: hidden;
  border: 1px solid rgba(113, 146, 134, .2);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: 0 12px 34px rgba(49, 68, 61, .07);
}

.journey-card.direct { border-color: rgba(113, 146, 134, .42); }
.journey-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  padding: 23px 26px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(120deg, rgba(220, 233, 227, .7), rgba(251, 252, 251, .65));
}
.journey-card:not(.direct) .journey-head { background: linear-gradient(120deg, rgba(223, 233, 241, .63), rgba(251, 252, 251, .65)); }
.journey-date { margin: 0 0 4px; color: var(--muted); font-size: .78rem; font-weight: 700; }
.journey-times { display: flex; align-items: baseline; gap: 9px; font-size: clamp(1.55rem, 5vw, 2.15rem); font-weight: 820; letter-spacing: -.035em; }
.journey-times span { color: var(--muted); font-size: 1.2rem; font-weight: 500; }
.journey-meta { text-align: right; }
.journey-meta strong { display: block; font-size: .98rem; }
.journey-meta small { color: var(--muted); }

.journey-body { padding: 25px 26px 27px; }
.best-stops { margin: 0 0 20px; padding: 10px 13px; border-radius: 11px; color: #50645c; background: var(--sage); font-size: .81rem; }
.leg { position: relative; display: grid; grid-template-columns: 57px 18px minmax(0, 1fr); gap: 9px; min-height: 62px; }
.leg-time { padding-top: 1px; font-weight: 780; font-variant-numeric: tabular-nums; }
.route-line { position: relative; display: flex; justify-content: center; }
.route-line::after { content: ""; position: absolute; top: 13px; bottom: -13px; width: 2px; background: #cbd9d3; }
.leg:last-of-type .route-line::after { display: none; }
.route-dot { z-index: 1; width: 12px; height: 12px; margin-top: 5px; border: 3px solid var(--paper); border-radius: 50%; background: var(--sage-dark); box-shadow: 0 0 0 2px var(--sage-dark); }
.leg-content { padding: 0 0 18px; }
.stop-name { margin: 0 0 7px; font-weight: 780; }
.ride { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; color: var(--muted); font-size: .86rem; }
.line-badge { padding: 4px 8px; border: 0; border-radius: 8px; color: #3f5b50; background: var(--sage); cursor: pointer; font-weight: 820; }
.line-badge:hover, .line-badge:focus-visible { outline: 2px solid rgba(72, 104, 93, .25); outline-offset: 2px; background: #d2e3da; }
.line-badge::after { content: "⌄"; margin-left: 6px; color: var(--sage-dark); font-size: .72rem; }
.line-badge[aria-expanded="true"]::after { content: "⌃"; }
.line-badge.static { cursor: default; }
.line-badge.static::after { display: none; }
.line-badge.static:hover { outline: 0; background: var(--sage); }
.line-stops-panel {
  margin: -5px 0 20px 84px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #f7faf8;
}
.line-stops-panel[hidden] { display: none; }
.line-stops-title { margin: 0 0 8px; color: var(--muted); font-size: .73rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.line-stops-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.line-stop { position: relative; min-height: 29px; padding: 4px 5px 4px 22px; font-size: .82rem; }
.line-stop::before { content: ""; position: absolute; left: 5px; top: 11px; width: 7px; height: 7px; border-radius: 50%; background: var(--sage-dark); }
.line-stop::after { content: ""; position: absolute; left: 8px; top: 18px; bottom: -11px; width: 1px; background: #cbd9d3; }
.line-stop:last-child::after { display: none; }
.line-stop.outside { color: #9aa39f; }
.line-stop.outside::before { background: #bac2be; }
.stop-role { margin-left: 7px; color: var(--sage-dark); font-size: .68rem; font-weight: 800; }
.line-stops-toggle { margin-top: 9px; padding: 5px 0; border: 0; color: var(--sage-dark); background: transparent; cursor: pointer; font-size: .76rem; font-weight: 800; }
.line-stops-toggle:hover, .line-stops-toggle:focus-visible { text-decoration: underline; }
.walk-leg { margin: 2px 0 17px 84px; padding: 9px 12px; border-left: 3px solid #b6c6d2; border-radius: 0 10px 10px 0; color: #5b6d79; background: var(--blue); font-size: .81rem; }
.arrival-row { display: grid; grid-template-columns: 57px 18px minmax(0, 1fr); gap: 9px; }
.arrival-row .route-dot { background: var(--blue-dark); box-shadow: 0 0 0 2px var(--blue-dark); }
.wait-note { margin: -7px 0 18px 84px; color: var(--muted); font-size: .78rem; }

.notice-box, .warning-box {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: .83rem;
}
.notice-box { color: #6c5d36; background: var(--gold); }
.warning-box { color: #7b4b45; background: var(--peach); }
.notice-box strong, .warning-box strong { display: block; margin-bottom: 3px; }

footer { border-top: 1px solid rgba(113, 146, 134, .2); background: rgba(251, 252, 251, .55); }
.footer-inner { min-height: 86px; display: flex; align-items: center; justify-content: space-between; gap: 20px; color: var(--muted); font-size: .76rem; }
.footer-inner p { margin: 0; }

@media (max-width: 760px) {
  .header-inner, main, .footer-inner { width: min(100% - 22px, 1080px); }
  .brand small { display: none; }
  main { padding: 28px 0 46px; }
  .search-panel { padding: 25px 18px; border-radius: 22px; }
  .intro { margin-bottom: 23px; }
  .places-grid { grid-template-columns: minmax(0, 1fr) 38px; }
  .places-grid .field:first-child { grid-column: 1 / -1; }
  .swap-button { grid-column: 2; grid-row: 2; margin: 0 0 7px; transform: rotate(90deg); }
  .swap-button:hover { transform: rotate(90deg); }
  .places-grid .field:last-child { grid-column: 1; grid-row: 2; }
  .time-grid { grid-template-columns: 1fr 1fr; }
  .time-grid .compact-field:first-child { grid-column: 1 / -1; }
  .primary-button { grid-column: 1 / -1; margin-top: 3px; }
  .settings-grid { grid-template-columns: 1fr 1fr; padding: 17px 14px; }
  .results-section { margin-top: 34px; }
  .results-heading { align-items: start; flex-direction: column; gap: 6px; }
  .results-tools { width: 100%; align-items: center; flex-wrap: wrap; }
  .results-summary, .results-tools label { margin-bottom: 0; }
  .results-tools select { flex: 1 1 175px; }
  .journey-head { grid-template-columns: 1fr; padding: 19px 18px; gap: 9px; }
  .journey-meta { display: flex; gap: 8px; align-items: baseline; text-align: left; }
  .journey-meta strong, .journey-meta small { display: inline; }
  .journey-body { padding: 21px 17px 23px; }
  .leg, .arrival-row { grid-template-columns: 51px 16px minmax(0, 1fr); gap: 7px; }
  .walk-leg, .wait-note, .line-stops-panel { margin-left: 74px; }
  .footer-inner { padding: 20px 0; align-items: start; flex-direction: column; justify-content: center; gap: 4px; }
}

@media (max-width: 520px) {
  .settings-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
