.skip-link{
  position: fixed;
  top: 8px;
  left: 8px;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-160%);
  transition: opacity var(--motion-fast) var(--motion-ease), transform var(--motion-fast) var(--motion-ease);
  z-index: 210;
}

.skip-link:focus-visible{
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.journey-nav {
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding-bottom: 10px;
}

.journey-stops {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface);
}

.journey-stop {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 8px 10px;
  border-right: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.journey-stop:last-child {
  border-right: 0;
}

.journey-stop > span {
  color: var(--accent);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.journey-stop:hover,
.journey-stop[aria-current="page"] {
  background: var(--soft);
  color: var(--ink);
}

.journey-stop[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 0;
  height: 3px;
  background: var(--accent);
}

.more-nav {
  position: relative;
  flex: 0 0 auto;
}

#moreButton {
  min-height: 46px;
  padding: 8px 15px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

#moreButton:hover,
#moreButton[aria-expanded="true"],
#moreButton[aria-current="page"] {
  border-color: var(--accent);
  color: var(--accent);
}

.more-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 180;
  display: grid;
  min-width: 220px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: 0 12px 32px rgba(35, 30, 23, .16);
}

.more-menu[hidden] {
  display: none;
}

.more-menu a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 4px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
}

.more-menu a:hover,
.more-menu a[data-active="true"] {
  background: var(--soft);
  color: var(--accent);
}

#toTop[hidden] {
  display: none;
}

.page:focus-visible,
.page h1:focus-visible,
.page h2:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 76%, white);
  outline-offset: 6px;
}

:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 76%, white);
  outline-offset: 3px;
}

#searchDialog {
  width: min(560px, calc(100% - 32px));
  max-width: 560px;
  max-height: min(760px, calc(100% - 32px));
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  overflow: visible;
}

#searchDialog::backdrop {
  background: rgba(12, 10, 9, .58);
  backdrop-filter: blur(3px);
}

#searchDialog .search-box {
  width: 100%;
  margin: 0;
}

.search-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 14px 10px 18px;
  border-bottom: 1px solid var(--line);
}

.search-head h2 {
  margin: 0;
  font-family: "Inter", sans-serif;
  font-size: 18px;
}

.search-head h2::after {
  display: none;
}

#searchClose {
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

@media (max-width: 640px) {
  .journey-nav {
    gap: 6px;
  }

  .journey-stops {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .journey-stops::-webkit-scrollbar {
    display: none;
  }

  .journey-stop {
    flex: 0 0 auto;
    min-width: 78px;
    padding-inline: 8px;
  }

  .journey-stop > span {
    display: none;
  }

  .more-menu {
    position: fixed;
    top: auto;
    right: 12px;
    bottom: 12px;
    left: 12px;
    max-height: min(70vh, 520px);
    overflow-y: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .journey-stop,
  #moreButton,
  .more-menu a {
    transition: none;
  }
}
