.bus-page {
  background:
    linear-gradient(180deg, rgba(0, 120, 132, 0.035), transparent 28rem),
    var(--soft);
}

.bus-shell {
  max-width: 1120px;
}

.bus-hero {
  min-height: 300px;
  padding-right: clamp(2rem, 26vw, 18rem);
}

.bus-hero h1 {
  font-size: clamp(2.5rem, 7vw, 4.8rem);
  max-width: 10ch;
}

.bus-hero .intro {
  max-width: 52ch;
}

.route-motif {
  align-items: center;
  display: flex;
  height: 4px;
  justify-content: space-between;
  max-width: none !important;
  position: absolute !important;
  right: clamp(2rem, 5vw, 4rem);
  top: 50%;
  width: clamp(9rem, 20vw, 14rem);
}

.route-motif::before {
  background: rgba(255, 255, 255, 0.68);
  border-radius: 999px;
  content: "";
  height: 4px;
  inset: 0;
  position: absolute;
}

.route-motif span {
  background: var(--navy);
  border: 4px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(134, 226, 223, 0.28);
  height: 18px;
  position: relative;
  width: 18px;
  z-index: 1;
}

.bus-finder-card,
.route-list-card,
.bus-guidance-card {
  padding: clamp(1rem, 2.8vw, 1.7rem);
}

.bus-finder-card {
  border-top: 5px solid var(--teal);
  margin-bottom: 1rem;
}

.bus-finder-heading,
.route-list-header,
.results-heading,
.browse-panel {
  align-items: end;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.information-status {
  align-items: center;
  background: var(--warning-bg);
  border: 1px solid #f0d6a7;
  border-radius: 999px;
  color: var(--warning-text);
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 850;
  margin-bottom: 1rem;
  padding: 0.42rem 0.72rem;
  white-space: nowrap;
}

.information-status::before {
  background: #c07800;
  border-radius: 50%;
  content: "";
  height: 7px;
  margin-right: 0.45rem;
  width: 7px;
}

.journey-choice {
  border: 0;
  margin: 0 0 1.25rem;
  padding: 0;
}

.journey-choice legend {
  color: var(--ink);
  font-weight: 800;
  margin-bottom: 0.55rem;
}

.segmented-control {
  background: #edf2f6;
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  gap: 0.35rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 0.35rem;
}

.segmented-control label {
  cursor: pointer;
  margin: 0;
  position: relative;
}

.segmented-control input {
  height: 1px;
  opacity: 0;
  position: absolute;
  width: 1px;
}

.segmented-control label > .journey-option {
  align-items: flex-start;
  border: 1px solid transparent;
  border-radius: 7px;
  color: #526074;
  display: flex;
  flex-direction: column;
  gap: 0.26rem;
  justify-content: center;
  min-height: 76px;
  padding: 0.78rem 1rem;
  text-align: left;
  transition: background 160ms ease, box-shadow 160ms ease, color 160ms ease;
}

.journey-time {
  color: #687588;
  display: block;
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.075em;
  line-height: 1;
  text-transform: uppercase;
}

.journey-direction {
  color: #435064;
  display: block;
  font-size: clamp(0.96rem, 1.7vw, 1.08rem);
  font-weight: 850;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.journey-direction span {
  color: #6c7889;
  font-weight: 600;
}

.segmented-control input:checked + .journey-option {
  background: #ffffff;
  border-color: rgba(0, 120, 132, 0.2);
  box-shadow:
    inset 3px 0 0 var(--teal),
    0 5px 16px rgba(0, 0, 120, 0.09);
  color: var(--navy);
}

.segmented-control input:checked + .journey-option .journey-time {
  color: var(--teal-dark);
}

.segmented-control input:checked + .journey-option .journey-direction {
  color: var(--navy);
}

.segmented-control input:focus-visible + .journey-option {
  outline: 3px solid rgba(0, 120, 132, 0.32);
  outline-offset: 2px;
}

.address-field label {
  margin-bottom: 0.2rem;
}

.field-help {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 0.7rem;
}

.field-help strong {
  color: #3b4859;
}

.combobox-wrap {
  flex: 1;
  min-width: 0;
  position: relative;
}

.bus-search-row input {
  font-size: 1.02rem;
  width: 100%;
}

.address-suggestions {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 16px 35px rgba(0, 0, 120, 0.16);
  display: grid;
  gap: 0;
  left: 0;
  list-style: none;
  margin: 0.35rem 0 0;
  overflow: hidden;
  padding: 0.35rem;
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 20;
}

.address-suggestions li {
  border-radius: 6px;
  color: #263447;
  cursor: pointer;
  font-weight: 700;
  padding: 0.7rem 0.8rem;
}

.address-suggestions li:hover,
.address-suggestions li[aria-selected="true"] {
  background: #eaf6f6;
  color: var(--teal-dark);
}

.finder-assurance {
  align-items: center;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.8rem;
  gap: 0.65rem 1.2rem;
  margin-top: 1rem;
  padding-bottom: 1rem;
}

.finder-assurance > span {
  align-items: center;
  display: inline-flex;
  gap: 0.4rem;
}

.assurance-mark {
  align-items: center;
  background: #e6f4f2;
  border-radius: 50%;
  color: var(--teal-dark);
  display: inline-flex;
  font-size: 0.68rem;
  font-weight: 900;
  height: 19px;
  justify-content: center;
  width: 19px;
}

.bus-finder-card > .result-panel {
  margin-top: 1rem;
}

.bus-results {
  border-top: 1px solid var(--line);
  margin-top: 1.25rem;
  outline: none;
  padding-top: 1.25rem;
}

.bus-results:focus-visible {
  border-radius: 8px;
  outline: 3px solid rgba(0, 120, 132, 0.25);
  outline-offset: 4px;
}

.results-heading {
  margin-bottom: 0.85rem;
}

.results-heading .section-heading,
.results-heading .eyebrow {
  margin-bottom: 0.35rem;
}

button.text-button {
  background: transparent;
  border: 0;
  color: var(--teal-dark);
  font-size: 0.84rem;
  min-height: 38px;
  padding: 0.35rem 0.5rem;
  text-decoration: underline;
  text-underline-offset: 0.2rem;
}

button.text-button:hover {
  background: #edf8f8;
  box-shadow: none;
  transform: none;
}

.bus-result-list {
  display: grid;
  gap: 0.85rem;
}

.bus-result-card {
  --route-colour: var(--teal);
  border: 1px solid var(--line);
  border-left: 6px solid var(--route-colour);
  border-radius: 9px;
  box-shadow: 0 7px 20px rgba(0, 0, 120, 0.055);
  overflow: hidden;
}

.bus-result-header {
  align-items: flex-start;
  background: linear-gradient(105deg, color-mix(in srgb, var(--route-colour) 8%, white), #ffffff 72%);
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 1rem;
}

.bus-route-title,
.route-summary {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.bus-route-title h3,
.route-summary .route-name {
  color: var(--navy);
  font-size: 1.17rem;
  line-height: 1.2;
  margin: 0;
}

.route-summary .route-name {
  display: block;
  font-weight: 850;
}

.route-number {
  background: var(--route-colour, var(--navy));
  border-radius: 6px;
  color: #ffffff;
  display: inline-flex;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  padding: 0.36rem 0.56rem;
}

.match-quality {
  border-radius: 999px;
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 850;
  margin-top: 0.5rem;
  padding: 0.31rem 0.58rem;
}

.match-quality.exact {
  background: var(--success-bg);
  color: var(--success-text);
}

.match-quality.possible {
  background: var(--warning-bg);
  color: var(--warning-text);
}

.result-direction {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
  margin: 0.35rem 0 0;
}

.journey-result {
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  padding: 1rem;
}

.journey-line {
  position: relative;
}

.journey-line::before {
  background: color-mix(in srgb, var(--route-colour) 45%, white);
  content: "";
  left: 8px;
  position: absolute;
  top: 10px;
  bottom: -1rem;
  width: 3px;
}

.journey-line::after {
  background: #ffffff;
  border: 4px solid var(--route-colour);
  border-radius: 50%;
  content: "";
  height: 17px;
  left: 1px;
  position: absolute;
  top: 2px;
  width: 17px;
}

.journey-label {
  color: var(--teal-dark);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  margin: 0 0 0.3rem;
  text-transform: uppercase;
}

.journey-stop {
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 850;
  margin: 0;
}

.journey-detail {
  color: var(--muted);
  font-size: 0.86rem;
  margin: 0.38rem 0 0;
}

.possible-stop-list {
  display: grid;
  gap: 0.35rem;
  list-style: none;
  margin: 0.7rem 0 0;
  padding: 0;
}

.possible-stop-list li {
  align-items: baseline;
  color: #3c4b5e;
  display: flex;
  font-size: 0.85rem;
  gap: 0.45rem;
}

.possible-stop-list li::before {
  color: var(--route-colour);
  content: "•";
  font-size: 1.2rem;
  line-height: 0;
}

.result-footer {
  align-items: center;
  background: #f8fafc;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 0.72rem 1rem;
}

.result-caution {
  color: #4f5f72;
  font-size: 0.81rem;
  margin: 0;
  max-width: 68ch;
}

button.route-detail-button {
  background: #ffffff;
  border: 1px solid var(--line);
  color: var(--navy);
  flex: 0 0 auto;
  font-size: 0.8rem;
  min-height: 38px;
  padding: 0.45rem 0.7rem;
}

.browse-panel {
  background: linear-gradient(120deg, rgba(0, 120, 132, 0.12), rgba(0, 0, 120, 0.055));
  border: 1px solid rgba(0, 120, 132, 0.16);
  border-radius: 8px;
  margin-bottom: 1rem;
  padding: clamp(1rem, 2.5vw, 1.4rem);
}

.browse-panel h2 {
  font-size: clamp(1.2rem, 2.5vw, 1.55rem);
}

.area-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: flex-end;
}

button.area-chip {
  background: #ffffff;
  border: 1px solid rgba(0, 120, 132, 0.24);
  border-radius: 999px;
  color: var(--navy);
  font-size: 0.8rem;
  min-height: 38px;
  padding: 0.42rem 0.75rem;
}

button.area-chip:hover,
button.area-chip[aria-pressed="true"] {
  background: var(--navy);
  color: #ffffff;
}

.bus-guidance-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 1rem;
}

.bus-guidance-card h2 {
  font-size: 1.32rem;
}

.bus-guidance-card > p:not(.eyebrow) {
  color: var(--muted);
  margin: 0.7rem 0 0;
}

.bus-help-card {
  background:
    linear-gradient(180deg, rgba(0, 120, 132, 0.08), rgba(0, 120, 132, 0)),
    #ffffff;
}

.bus-help-card .office-link {
  margin-top: 0.9rem;
}

.route-list-card {
  margin-bottom: 1rem;
}

.route-list-header {
  margin-bottom: 0.85rem;
}

.route-list-header > p {
  color: var(--muted);
  margin: 0 0 1rem;
  max-width: 34rem;
}

.route-list {
  display: grid;
  gap: 0.65rem;
}

.route-list details {
  --route-colour: var(--teal);
  background: #ffffff;
  border-left: 4px solid var(--route-colour);
}

.route-list details[hidden] {
  display: none;
}

.route-list summary {
  gap: 0.85rem;
}

.route-summary {
  flex: 1;
  min-width: 0;
}

.route-summary-copy {
  min-width: 180px;
}

.route-summary-copy > span:not(.route-name) {
  color: var(--muted);
  display: block;
  font-size: 0.81rem;
  font-weight: 650;
  margin-top: 0.12rem;
}

.route-detail-body {
  border-top: 1px solid var(--line);
  padding: 1rem;
}

.route-meta {
  display: grid;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.route-meta p {
  color: #3e4b5e;
  margin: 0;
}

.route-areas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.2rem;
}

.route-area {
  background: #eef4f7;
  border-radius: 999px;
  color: #465569;
  font-size: 0.73rem;
  font-weight: 750;
  padding: 0.26rem 0.5rem;
}

.stop-columns {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stop-column {
  background: #f7fafc;
  border-radius: 8px;
  padding: 0.9rem;
}

.stop-column h4 {
  color: var(--navy);
  margin: 0 0 0.65rem;
}

.stop-list {
  display: grid;
  gap: 0.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.stop-list li {
  border-bottom: 1px solid #e5ebf0;
  color: #3b4859;
  font-size: 0.84rem;
  padding: 0 0 0.4rem;
}

.bus-disclaimer {
  color: var(--muted);
  font-size: 0.8rem;
  margin: 0 auto 1rem;
  max-width: 80ch;
  text-align: center;
}

html.embed .bus-shell {
  max-width: none;
}

html.embed .bus-hero,
html.embed .bus-guidance-grid,
html.embed .bus-disclaimer {
  display: none;
}

html.embed .bus-finder-card,
html.embed .route-list-card {
  box-shadow: none;
}

html.embed .bus-finder-card {
  margin-bottom: 0.75rem;
  padding: 1rem;
}

html.embed .browse-panel {
  margin-bottom: 0.75rem;
}

@media (max-width: 800px) {
  .bus-finder-heading,
  .route-list-header,
  .results-heading,
  .browse-panel {
    align-items: stretch;
    flex-direction: column;
    gap: 0;
  }

  .information-status {
    align-self: flex-start;
  }

  .area-filters {
    justify-content: flex-start;
    margin-top: 0.8rem;
  }

  .bus-guidance-grid,
  .stop-columns {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .bus-hero {
    min-height: 0;
    padding-right: 1.6rem;
  }

  .route-motif {
    display: none;
  }

  .segmented-control {
    grid-template-columns: 1fr;
  }

  .segmented-control label > .journey-option {
    min-height: 68px;
  }

  .bus-search-row,
  html.embed .bus-search-row {
    flex-direction: column;
  }

  .bus-search-row button,
  html.embed .bus-search-row button {
    width: 100%;
  }

  .finder-assurance {
    align-items: flex-start;
    flex-direction: column;
  }

  .bus-result-header,
  .result-footer {
    align-items: stretch;
    flex-direction: column;
  }

  button.route-detail-button {
    width: 100%;
  }

  .route-summary {
    align-items: flex-start;
    flex-direction: column;
  }
}

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