@media (min-width: 861px) {
  #route-pane .route-sidebar {
    --route-calculator-gutter: 34px;
  }

  .route-calculator-sticky {
    position: sticky;
    z-index: 70;
    top: 0;
    margin: calc(var(--route-calculator-gutter) * -1) calc(var(--route-calculator-gutter) * -1) 0;
    padding: var(--route-calculator-gutter) var(--route-calculator-gutter) 18px;
    border-bottom: 1px solid transparent;
    background: rgba(255, 255, 255, .98);
    transition: padding .24s ease, border-color .24s ease, box-shadow .24s ease;
  }

  .route-calculator-sticky .panel-heading,
  .route-calculator-sticky .panel-heading h2,
  .route-calculator-sticky .section-kicker,
  .route-calculator-sticky .journey-fields,
  .route-calculator-sticky .journey-rail,
  .route-calculator-sticky .place-input,
  .route-calculator-sticky .time-choice,
  .route-calculator-sticky .time-choice .btn,
  .route-calculator-sticky .date-time-grid,
  .route-calculator-sticky .form-control,
  .route-calculator-sticky .search-button,
  .route-calculator-sticky .locate-button {
    transition-duration: .24s;
    transition-timing-function: ease;
  }

  .route-calculator-sticky.is-compact {
    padding: 11px 17px 12px;
    border-bottom-color: #dce8e3;
    box-shadow: 0 12px 28px rgba(16, 42, 67, .13);
  }

  .route-calculator-sticky.is-compact .panel-heading {
    min-height: 28px;
    margin-bottom: 7px;
    align-items: center;
  }

  .route-calculator-sticky.is-compact .section-kicker {
    display: none;
  }

  .route-calculator-sticky.is-compact .panel-heading h2 {
    font-size: .98rem;
    letter-spacing: -.025em;
  }

  .route-calculator-sticky.is-compact .locate-button {
    width: 30px;
    height: 30px;
    min-height: 30px;
    border-radius: 9px;
  }

  .route-calculator-sticky.is-compact .journey-fields {
    min-height: 66px;
    padding: 6px 38px 6px 10px;
    grid-template-columns: 1fr;
    border-radius: 12px;
  }

  .route-calculator-sticky.is-compact .journey-rail {
    display: none;
  }

  .route-calculator-sticky.is-compact .journey-inputs {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
  }

  .route-calculator-sticky.is-compact .journey-inputs label {
    margin: 0;
    font-size: .54rem;
    line-height: 1;
  }

  .route-calculator-sticky.is-compact .place-input {
    min-height: 30px;
    font-size: .74rem;
    line-height: 1.05;
  }

  .route-calculator-sticky.is-compact .field-divider {
    width: 1px;
    height: 43px;
    margin: 0;
  }

  .route-calculator-sticky.is-compact .swap-button {
    right: 7px;
    width: 27px;
    height: 27px;
    border-radius: 8px;
  }

  .route-calculator-sticky.is-compact .time-choice {
    margin-top: 7px;
    padding: 3px;
    border-radius: 10px;
  }

  .route-calculator-sticky.is-compact .time-choice .btn {
    padding: 5px 6px;
    font-size: .62rem;
    border-radius: 8px;
  }

  .route-calculator-sticky.is-compact .date-time-grid {
    margin-top: 7px;
    grid-template-columns: 1.2fr 1fr;
    gap: 7px;
  }

  .route-calculator-sticky.is-compact .date-time-grid .form-label {
    display: none;
  }

  .route-calculator-sticky.is-compact .date-time-grid .form-control {
    min-height: 34px;
    padding-top: 4px;
    padding-bottom: 4px;
    padding-left: 33px;
    font-size: .7rem;
    border-radius: 9px;
  }

  .route-calculator-sticky.is-compact .date-time-grid .input-with-icon > i {
    left: 11px;
    font-size: .72rem;
  }

  .route-calculator-sticky.is-compact .search-button {
    min-height: 36px;
    margin-top: 7px;
    padding-inline: 12px;
    font-size: .7rem;
    border-radius: 10px;
    box-shadow: 0 7px 15px rgba(255, 107, 85, .2);
  }

  .route-calculator-sticky.is-compact .autocomplete-menu {
    top: calc(100% + 5px);
  }
}

@media (min-width: 861px) and (max-width: 1100px) {
  #route-pane .route-sidebar {
    --route-calculator-gutter: 28px;
  }
}

/* Compact toolbar: zero-height shell keeps the scrollbar geometry stable. */
@media (min-width: 861px) {
  .route-calculator-toolbar-shell {
    position: sticky;
    z-index: 90;
    top: 0;
    height: 0;
    pointer-events: none;
  }

  .route-calculator-toolbar {
    position: absolute;
    top: calc(var(--route-calculator-gutter, 34px) * -1);
    right: calc(var(--route-calculator-gutter, 34px) * -1);
    left: calc(var(--route-calculator-gutter, 34px) * -1);
    display: grid;
    grid-template-columns: minmax(0, 1fr) 38px 38px;
    gap: 8px;
    align-items: center;
    min-height: 68px;
    padding: 10px 16px;
    border-bottom: 1px solid #dce8e3;
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 12px 28px rgba(16, 42, 67, .13);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-110%);
    transition: opacity .18s ease, transform .22s ease;
    backdrop-filter: blur(12px);
  }

  .route-calculator-toolbar.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .route-toolbar-summary {
    min-width: 0;
  }

  .route-toolbar-summary small,
  .route-toolbar-meta {
    display: block;
    color: #678091;
    font-size: .62rem;
    line-height: 1.2;
  }

  .route-toolbar-summary small {
    margin-bottom: 3px;
    color: #008a78;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
  }

  .route-toolbar-summary strong {
    display: flex;
    gap: 7px;
    align-items: center;
    min-width: 0;
    color: #102a43;
    font-size: .76rem;
  }

  .route-toolbar-summary strong span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .route-toolbar-summary strong i {
    flex: 0 0 auto;
    color: #00a991;
    font-size: .7rem;
  }

  .route-toolbar-meta {
    margin-top: 3px;
  }

  .route-toolbar-button {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid #d7e5df;
    border-radius: 12px;
    background: #fff;
    color: #176b60;
    transition: border-color .16s ease, transform .16s ease;
  }

  .route-toolbar-button:hover {
    border-color: #00a991;
    transform: translateY(-1px);
  }

  .route-toolbar-submit {
    border-color: #ff6b55;
    background: #ff6b55;
    color: #fff;
  }
}

@media (max-width: 860px) {
  .route-calculator-toolbar-shell {
    display: none;
  }
}

@media (min-width: 861px) {
  #route-pane .route-sidebar {
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: rgba(23, 107, 96, .42) transparent;
  }

  #route-pane .route-sidebar::-webkit-scrollbar {
    width: 10px;
  }

  #route-pane .route-sidebar::-webkit-scrollbar-track {
    background: transparent;
  }

  #route-pane .route-sidebar::-webkit-scrollbar-thumb {
    border: 3px solid transparent;
    border-radius: 999px;
    background: rgba(23, 107, 96, .42);
    background-clip: padding-box;
  }

  #route-pane .route-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(23, 107, 96, .68);
    background-clip: padding-box;
  }
}
