.button .icon.directions {
    mask-image: url(../images/directions_icons.svg);
    -webkit-mask-image: url(../images/directions_icons.svg);
}

.trip-planner-modal .header .icon::before {
    mask-image: url(../images/directions_icons.svg);
    -webkit-mask-image: url(../images/directions_icons.svg);
}

@media (hover: none) and (pointer: coarse) {
    .trip-planner-modal.resizing,
    .trip-planner-modal.resizing .content,
    .trip-planner-modal.resizing .results,
    .trip-planner-modal.resizing .suggestions {
        overflow: hidden;
    }
}

.trip-planner-modal.itinerary-focused .header .icon {
    cursor: pointer;
    transition: background-color 0.2s;
}

@media (hover: hover) and (pointer: fine) {
    .trip-planner-modal.itinerary-focused .header .icon:hover {
        background-color: var(--button-hover);
    }
}

.trip-planner-modal.itinerary-focused .header .icon:active {
    background-color: var(--button-active);
}

.trip-planner-modal.itinerary-focused .header .icon::before {
    mask-image: url(../images/arrow_left.svg);
    -webkit-mask-image: url(../images/arrow_left.svg);
}

.trip-planner-modal.itinerary-focused .planner-inputs,
.trip-planner-modal.itinerary-focused .planner-options-wrapper,
.trip-planner-modal.itinerary-focused #tripPlannerSwap {
    display: none;
}

.trip-planner-modal.itinerary-focused .results .result-card:not(.expanded) {
    display: none;
}

.trip-planner-modal.itinerary-focused .results .result-card.expanded .result-departure {
    display: none;
}

.modal-button.swap::before {
    mask-image: url(../images/swap_icon.svg);
    -webkit-mask-image: url(../images/swap_icon.svg);
}

.trip-route-marker {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--bs-body-bg);
    border: 4px solid var(--bs-body-color);
    box-shadow: var(--shadow-marker);
}

.trip-route-marker.end {
    border-radius: 4px;
    background: var(--bs-body-color);
    border: 4px solid var(--bs-body-bg);
}

.trip-planner-modal .content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0 12px 12px 12px;
    min-height: 0;
    flex: 1 1 auto;
}

.trip-planner-modal .planner-inputs {
    display: flex;
    align-items: stretch;
    gap: 8px;
    flex: 0 0 auto;
    position: relative;
    z-index: 2;
}

.trip-planner-modal .planner-dots {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 16px;
    padding: 14px 0;
}

.trip-planner-modal .planner-dots .dot,
.trip-planner-modal .step-indicators .dot {
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: 2px solid var(--bs-body-color);
    background: var(--bs-body-bg);
}

.trip-planner-modal .planner-dots .dot.end,
.trip-planner-modal .step-indicators .dot.end {
    border-radius: 2px;
    background-color: var(--bs-body-color);
}

.trip-planner-modal .planner-dots .dot-line {
    flex: 1 1 auto;
    width: 4px;
    margin: 2px 0;
    background-image: radial-gradient(circle, var(--bs-secondary-color) 1px, transparent 2px);
    background-position: right;
    background-size: 4px 7px;
    background-repeat: repeat-y;
}

.trip-planner-modal .planner-fields {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1 1 auto;
    min-width: 0;
}

.trip-planner-modal .planner-fields .field {
    position: relative;
}

.trip-planner-modal .planner-fields .search-bar {
    transition: box-shadow 0.15s;
}

.trip-planner-modal .planner-fields .search-bar:focus-within {
    box-shadow: inset 0 0 0 2px var(--bs-primary);
}

.trip-planner-modal .planner-inputs .swap {
    align-self: center;
}

.trip-planner-modal .planner-inputs .swap::before {
    transition: transform 0.3s cubic-bezier(0.2, 0, 0, 1);
}

.trip-planner-modal .planner-inputs .swap.flipped::before {
    transform: rotate(180deg);
}


.trip-planner-modal .planner-options-wrapper {
    position: relative;
    align-self: flex-start;
    max-width: 100%;
}

.trip-planner-modal .planner-options {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.trip-planner-modal .planner-options::-webkit-scrollbar {
    display: none;
}

.trip-planner-modal .time-select,
.trip-planner-modal .modes-select {
    flex: 0 0 auto;
}

.trip-planner-modal .toggle .icon.filter {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    background-color: var(--bs-secondary-color);
    mask-image: url(../images/filter_icon.svg);
    -webkit-mask-image: url(../images/filter_icon.svg);
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
}

.trip-planner-modal .modes-select.open .toggle .chevron {
    transform: rotate(180deg);
}

:is(.trip-planner-modal, .stop-modal) .toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 12px;
    border-radius: 16px;
    background-color: var(--bs-secondary-bg);
    cursor: pointer;
    transition: background-color 0.2s;
}

@media (hover: hover) and (pointer: fine) {
    :is(.trip-planner-modal, .stop-modal) .toggle:hover {
        background-color: var(--button-hover);
    }
}

:is(.trip-planner-modal, .stop-modal) .toggle:active {
    background-color: var(--button-active);
}

.trip-planner-modal .modes-select .toggle.active,
.stop-modal .time-select .toggle.active {
    background-color: var(--bs-primary);
    color: white;
}

.trip-planner-modal .modes-select .toggle.active .icon.filter,
.trip-planner-modal .modes-select .toggle.active .chevron,
.stop-modal .time-select .toggle.active .icon.clock,
.stop-modal .time-select .toggle.active .chevron {
    background-color: white;
}

:is(.trip-planner-modal, .stop-modal) .toggle .icon.clock {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    background-color: var(--bs-secondary-color);
    mask-image: url(../images/clock_icon.svg);
    -webkit-mask-image: url(../images/clock_icon.svg);
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
}

:is(.trip-planner-modal, .stop-modal) .toggle-label {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

:is(.trip-planner-modal, .stop-modal) .toggle .chevron {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    background-color: var(--bs-secondary-color);
    mask-image: url(../images/chevron_down.svg);
    -webkit-mask-image: url(../images/chevron_down.svg);
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    transition: transform 0.2s;
}

.trip-planner-modal .modes-picker {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 270px;
    background-color: var(--bs-secondary-bg);
    border-radius: 16px;
    box-shadow: var(--shadow-16);
    padding: 6px;
    z-index: 10;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.trip-planner-modal .modes-picker.hidden {
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
}

.trip-planner-modal .suggestions {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 300px;
    overflow-y: auto;
    background-color: var(--bs-secondary-bg);
    border-radius: 16px;
    box-shadow: var(--shadow-16);
    padding: 4px;
    z-index: 10;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.trip-planner-modal .suggestions.hidden {
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
}

.trip-planner-modal .suggestion {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 0.2s;
}

@media (hover: hover) and (pointer: fine) {
    .trip-planner-modal .suggestion:hover {
        background-color: var(--button-hover);
    }
}

.trip-planner-modal .suggestion:active {
    background-color: var(--button-active);
}

.trip-planner-modal .suggestions .suggestion .icon {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    background-color: var(--bs-secondary-color);
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
}

.trip-planner-modal .suggestion .icon.stop {
    mask-image: url(../images/stop_icon.svg);
    -webkit-mask-image: url(../images/stop_icon.svg);
}

.trip-planner-modal .suggestion .icon.place {
    mask-image: url(../images/location_on_icon.svg);
    -webkit-mask-image: url(../images/location_on_icon.svg);
}

.trip-planner-modal .suggestion .icon.home {
    mask-image: url(../images/home_icon.svg);
    -webkit-mask-image: url(../images/home_icon.svg);
}

.trip-planner-modal .suggestion .icon.work {
    mask-image: url(../images/work_icon.svg);
    -webkit-mask-image: url(../images/work_icon.svg);
}

.trip-planner-modal .suggestion .icon.saved-place {
    mask-image: url(../images/bookmark_icon_filled.svg);
    -webkit-mask-image: url(../images/bookmark_icon_filled.svg);
}

.trip-planner-modal .suggestion .icon.plus {
    mask-image: url(../images/plus_icon.svg);
    -webkit-mask-image: url(../images/plus_icon.svg);
}

.trip-planner-modal .suggestion .icon.gps {
    mask-image: url(../images/location_gps_icon.svg);
    -webkit-mask-image: url(../images/location_gps_icon.svg);
}

.trip-planner-modal .suggestion .icon.map {
    mask-image: url(../images/map_icon.svg);
    -webkit-mask-image: url(../images/map_icon.svg);
}

.trip-planner-modal .suggestion .icon.recent {
    mask-image: url(../images/clock_icon.svg);
    -webkit-mask-image: url(../images/clock_icon.svg);
}

.trip-planner-modal .suggestions-section-title {
    padding: 10px 12px 4px 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--bs-secondary-color);
}

.trip-planner-modal .suggestion.saved-place.unset {
    color: var(--bs-secondary-color);
}

.trip-planner-modal .suggestion.saved-place.unset .icon {
    opacity: 0.6;
}

.trip-planner-modal .remove-place {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin-left: auto;
    background-color: var(--bs-secondary-color);
    mask-image: url(../images/close_circle_icon.svg);
    -webkit-mask-image: url(../images/close_circle_icon.svg);
    mask-size: contain;
    -webkit-mask-size: contain;
    mask-repeat: no-repeat;
    -webkit-mask-repeat: no-repeat;
    mask-position: center;
    -webkit-mask-position: center;
    transition: background-color 0.2s;
}

@media (hover: hover) and (pointer: fine) {
    .trip-planner-modal .remove-place:hover {
        background-color: var(--bs-body-color);
    }
}

.trip-planner-modal .save-place-prompt {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
}

.trip-planner-modal .save-place-prompt .prompt-label {
    font-size: 14px;
    font-weight: 600;
}

.trip-planner-modal .save-place-prompt .save-place-name {
    width: 100%;
    padding: 8px 10px;
    border-radius: 10px;
    border: none;
    background-color: var(--bs-tertiary-bg);
    color: var(--bs-body-color);
    font-size: 14px;
}

.trip-planner-modal .save-place-prompt .prompt-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.trip-planner-modal .save-place-prompt .prompt-button {
    padding: 6px 12px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.trip-planner-modal .save-place-prompt .prompt-button.save {
    background-color: var(--bs-primary);
    color: white;
}

@media (hover: hover) and (pointer: fine) {
    .trip-planner-modal .save-place-prompt .prompt-button:hover {
        opacity: 0.85;
    }
}

.trip-planner-modal .save-place-prompt .prompt-button.cancel {
    background-color: var(--bs-tertiary-bg);
}

.trip-planner-modal .suggestion-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.trip-planner-modal .suggestion-text .name {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.trip-planner-modal .suggestion-text .location {
    font-size: 12px;
    color: var(--bs-secondary-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.trip-planner-modal .suggestions-message {
    padding: 12px;
    text-align: center;
    font-size: 14px;
    color: var(--bs-secondary-color);
}

.trip-planner-modal .notice {
    flex-direction: column;
    gap: 12px;
    align-self: center;
    max-width: 320px;
    padding: 24px;
    font-size: 15px;
    font-weight: 600;
    color: var(--bs-secondary-color);
    text-align: center;
}

.trip-planner-modal .notice::before {
    content: "";
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    background-color: var(--bs-secondary-color);
    opacity: 0.5;
    mask-image: url(../images/directions_icons.svg);
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    -webkit-mask-image: url(../images/directions_icons.svg);
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
}

.trip-planner-modal .results {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
}

.trip-planner-modal .results-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 40px 24px;
    text-align: center;
}

.trip-planner-modal .results-empty .icon {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    background-color: var(--bs-secondary-color);
    opacity: 0.5;
    mask-image: url(../images/directions_icons.svg);
    -webkit-mask-image: url(../images/directions_icons.svg);
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
}

.trip-planner-modal .results-empty .message {
    max-width: 260px;
    font-size: 15px;
    font-weight: 600;
    color: var(--bs-secondary-color);
}

.trip-planner-modal .results-empty.results-error .icon {
    background-color: var(--bs-danger);
    mask-image: url(../images/alert_icon.svg);
    -webkit-mask-image: url(../images/alert_icon.svg);
}

.trip-planner-modal .result-card {
    flex: 0 0 auto;
    border-radius: 16px;
    background-color: var(--bs-secondary-bg);
    overflow: hidden;
    transition: background-color 0.2s, transform 0.2s cubic-bezier(0.2, 0, 0, 1);
}

@media (hover: hover) and (pointer: fine) {
    .trip-planner-modal .result-card.expandable:not(.expanded):hover {
        background-color: color-mix(in srgb, var(--bs-secondary-bg), var(--bs-body-color) 6%);
    }
}

.trip-planner-modal .result-card.expandable:not(.expanded):active {
    transform: scale(0.985);
}

.trip-planner-modal .result-summary {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
}

.trip-planner-modal .result-card.expandable .result-summary,
.trip-planner-modal .result-card.expandable .result-departure {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.trip-planner-modal .result-main {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
}

.trip-planner-modal .result-main .duration {
    flex: 0 0 auto;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.3;
}

.trip-planner-modal .result-main .details {
    display: flex;
    flex-wrap: wrap;
    column-gap: 4px;
    min-width: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--bs-secondary-color);
}

.trip-planner-modal .result-main .expand-toggle {
    align-self: center;
    margin-left: auto;
}

.trip-planner-modal .result-preview {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    min-width: 0;
    font-size: 14px;
}

.trip-planner-modal .result-preview .leg-separator {
    flex: 0 0 auto;
    width: 14px;
    height: 14px;
    margin: 0 -2px;
    background-color: var(--bs-secondary-color);
    opacity: 0.7;
    mask-image: url(../images/chevron_right.svg);
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    -webkit-mask-image: url(../images/chevron_right.svg);
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
}

.trip-planner-modal .result-departure {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    padding: 0 12px 12px 12px;
    margin-top: -4px;
    font-size: 13px;
    color: var(--bs-secondary-color);
}

.trip-planner-modal :is(.result-main, .result-departure, .stop-time, .arrival-time) {
    font-variant-numeric: tabular-nums;
}

.trip-planner-modal .result-preview .leg-walk {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    height: 1.5em;
    gap: 1px;
    border-radius: 0.375em;
    background-color: var(--button-hover);
}

.trip-planner-modal .result-preview .leg-walk-time {
    font-size: 13px;
    font-weight: 700;
    margin-right: 7px;
    color: var(--bs-body-color);
}

.trip-planner-modal .result-preview .leg-icon {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    padding: 4px;
    border-radius: 50%;
    background-color: var(--bs-body-color);
    mask-size: 60%;
    mask-repeat: no-repeat;
    mask-position: center;
    -webkit-mask-size: 60%;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    box-sizing: content-box;
}

.trip-planner-modal .result-preview .leg-walk .leg-icon {
    padding: 3px;
}

.trip-planner-modal .result-preview .leg-icon.walk {
    mask-image: url(../images/walk_icon.svg);
    -webkit-mask-image: url(../images/walk_icon.svg);
}

.trip-planner-modal .result-preview .line-info {
    flex: 0 0 auto;
}

.trip-planner-modal .expand-toggle {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    mask-image: url(../images/chevron_down.svg);
    -webkit-mask-image: url(../images/chevron_down.svg);
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    transition: transform 0.2s;
}

.trip-planner-modal .result-card.expanded .expand-toggle {
    transform: rotate(180deg);
}

.trip-planner-modal .result-steps-collapse {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.25s ease;
}

.trip-planner-modal .result-card.expanded .result-steps-collapse {
    grid-template-rows: 1fr;
}

.trip-planner-modal .result-card.skeleton .result-main {
    align-items: center;
    height: 22px;
}

.trip-planner-modal .result-card.skeleton .skeleton-bar {
    border-radius: 4px;
    background-color: var(--button-hover);
}

.trip-planner-modal .result-card.skeleton .skeleton-bar.duration {
    width: 50px;
    height: 17px;
}

.trip-planner-modal .result-card.skeleton .skeleton-bar.times {
    width: 88px;
    height: 13px;
}

.trip-planner-modal .result-card.skeleton .skeleton-bar.departure {
    width: 200px;
    max-width: 100%;
    height: 13px;
    margin: 3px 0;
}

.trip-planner-modal .result-card.skeleton .skeleton-bar.leg {
    width: 34px;
    height: 21px;
    border-radius: 10.5px;
}

.trip-planner-modal .result-steps {
    overflow: hidden;
    min-height: 0;
}

.trip-planner-modal .result-steps-inner {
    display: flex;
    flex-direction: column;
    padding: 0 12px 12px 12px;
}

.trip-planner-modal .intermediate-collapse {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
}

.trip-planner-modal .intermediate-collapse-inner {
    display: flex;
    flex-direction: column;
}

.trip-planner-modal .step {
    display: flex;
    align-items: stretch;
    flex: 0 0 auto;
    gap: 10px;
    min-height: 30px;
}

.trip-planner-modal .step-indicators {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 0 0 auto;
    width: 18px;
}

.trip-planner-modal .step-indicators .marker {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 18px;
    height: 20px;
}

.trip-planner-modal .step-indicators .marker.icon-marker {
    background-color: var(--bs-secondary-bg);
}

.trip-planner-modal .step-indicators .icon.walk,
.trip-planner-modal .step-indicators .icon.transfer {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    background-color: var(--bs-secondary-color);
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
}

.trip-planner-modal .step-indicators .icon.walk {
    mask-image: url(../images/walk_icon.svg);
    -webkit-mask-image: url(../images/walk_icon.svg);
}

.trip-planner-modal .step-indicators .icon.transfer {
    mask-image: url(../images/transfer_icon.svg);
    -webkit-mask-image: url(../images/transfer_icon.svg);
}

.trip-planner-modal .step-indicators .circle {
    flex: 0 0 auto;
    width: 12px;
    height: 12px;
    box-sizing: border-box;
    border-radius: 50%;
    background-color: var(--bs-secondary-bg);
    border: 3px solid var(--bs-secondary-color);
}

.trip-planner-modal .step-indicators .line {
    position: absolute;
    z-index: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    background-color: var(--bs-secondary-color);
}

.trip-planner-modal .step-indicators .line:not(.line-in):not(.line-out) {
    top: 0;
    bottom: 0;
}

.trip-planner-modal .step-indicators .line.line-in {
    top: 0;
    height: 10px;
}

.trip-planner-modal .step-indicators .line.line-out {
    top: 10px;
    bottom: 0;
}

.trip-planner-modal .step-indicators .line.walk {
    background-color: transparent;
    background-image: radial-gradient(circle, var(--bs-secondary-color) 1px, transparent 1px);
    background-position: center;
    background-size: 4px 6px;
    background-repeat: repeat-y;
}

/* .trip-planner-modal .step:has(.marker.icon-marker) + .step .step-indicators .line.line-in.walk,
.trip-planner-modal .step:has(+ .step .marker.icon-marker) .step-indicators .line.line-out.walk {
    display: none;
} */

[data-bs-theme=dark] .trip-planner-modal .step-indicators .line.night {
    background-color: var(--night-line-casing) !important;
}

[data-bs-theme=dark] .trip-planner-modal .step-indicators .circle.night {
    border-color: var(--night-line-casing) !important;
}

.trip-planner-modal .step:last-of-type:not(.intermediate) .step-indicators .line.line-out,
.trip-planner-modal .step:last-of-type:not(.intermediate) .step-indicators .line:not(.line-in):not(.line-out) {
    display: none;
}

.trip-planner-modal .step:first-of-type:not(.intermediate) .step-indicators .line.line-in {
    display: none;
}

.trip-planner-modal .step:first-of-type:not(.intermediate) .step-indicators .line:not(.line-in):not(.line-out) {
    top: 20px;
}

.trip-planner-modal .step-details {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 2px;
    padding-bottom: 15px;
    min-width: 0;
}

.trip-planner-modal .step:has(.marker.icon-marker) .step-indicators,
.trip-planner-modal .step:has(.marker.icon-marker) .step-details {
    padding-top: 15px;
}

.trip-planner-modal .step:not(:has(.marker.icon-marker)):has(+ .step .marker.icon-marker) {
    min-height: 20px;
}

.trip-planner-modal .step:not(:has(.marker.icon-marker)):has(+ .step .marker.icon-marker) .step-details {
    padding-bottom: 0;
}

.trip-planner-modal .step-details .label {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
    min-height: 20px;
    font-size: 15px;
    font-weight: 600;
    line-height: 20px;
    /* overflow: hidden; */
    text-overflow: ellipsis;
    /* white-space: nowrap; */
}

.trip-planner-modal .step-details .label:has(.headsign) {
    align-items: center;
}

.trip-planner-modal .step-details .label .line-info {
    flex: 0 0 auto;
}

.trip-planner-modal .step-details .label .headsign {
    min-width: 0;
}

.trip-planner-modal .step-details .label .stop-name {
    flex: 1 1 auto;
    min-width: 0;
}

.trip-planner-modal .step.intermediate .step-details .label .stop-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.trip-planner-modal .step-details .stop-time {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    color: var(--bs-secondary-color);
}

.trip-planner-modal .step-details .label .stop-time {
    flex: 0 0 auto;
}

.trip-planner-modal .step-details .stop-time .time.strikethrough {
    text-decoration: line-through;
}

.trip-planner-modal .step-details .duration {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    font-size: 14px;
    color: var(--bs-secondary-color);
}

.trip-planner-modal .transfer-warning {
    color: var(--delay-delayed);
    font-weight: 600;
}

.trip-planner-modal .step .arrival-time {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex: 0 0 auto;
    margin-left: auto;
}

.trip-planner-modal .step .arrival-time .time {
    font-size: 18px;
    height: 24px;
}

.trip-planner-modal .step .arrival-time .unit {
    font-size: 14px;
    color: var(--bs-secondary-color);
}

.trip-planner-modal :is(.stops-toggle, .departures-toggle) {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 6px 1px 8px;
    border-radius: 10px;
    background-color: rgba(var(--bs-body-color-rgb), 0.08);
    cursor: pointer;
    font-weight: 600;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.2s;
}

@media (hover: hover) and (pointer: fine) {
    .trip-planner-modal :is(.stops-toggle, .departures-toggle):hover {
        background-color: rgba(var(--bs-body-color-rgb), 0.14);
    }
}

.trip-planner-modal :is(.stops-toggle, .departures-toggle):active {
    background-color: rgba(var(--bs-body-color-rgb), 0.2);
}

.trip-planner-modal :is(.stops-toggle, .departures-toggle) .chevron {
    flex: 0 0 auto;
    width: 14px;
    height: 14px;
    background-color: var(--bs-secondary-color);
    mask-image: url(../images/chevron_down.svg);
    -webkit-mask-image: url(../images/chevron_down.svg);
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    transition: transform 0.2s;
}

.trip-planner-modal :is(.stops-toggle, .departures-toggle).expanded .chevron {
    transform: rotate(180deg);
}

.trip-planner-modal .step.leg-info .step-details {
    padding-bottom: 6px;
}

.trip-planner-modal .step.departures-step .step-details {
    flex: 1 1 auto;
}

.trip-planner-modal .leg-departures {
    display: flex;
    flex-direction: column;
    min-width: 0;
    font-size: 14px;
    color: var(--bs-secondary-color);
}

.trip-planner-modal .departures-toggle {
    align-self: flex-start;
}

.trip-planner-modal .departures-toggle .spinner-border {
    display: none;
    position: static;
    width: 14px;
    height: 14px;
    border-width: 2px;
}

.trip-planner-modal .departures-toggle.loading .spinner-border {
    display: inline-block;
}

.trip-planner-modal .departures-toggle.loading .chevron {
    display: none;
}

.trip-planner-modal .departures-empty {
    padding: 4px 0;
}

.trip-planner-modal .departures-collapse {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
}

.trip-planner-modal .departures-list {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 8px;
}

.trip-planner-modal .departure-card {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 8px 12px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 12px;
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.2s, opacity 0.2s, box-shadow 0.2s;
}

.trip-planner-modal .departure-card.leaving {
    position: absolute;
    left: 0;
    right: 0;
    margin: 0;
    pointer-events: none;
}

.trip-planner-modal .departure-card.selected {
    box-shadow: inset 0 0 0 2px var(--bs-primary);
    cursor: default;
}

.trip-planner-modal .departure-card.loading,
.trip-planner-modal .departure-card.missed {
    opacity: 0.5;
}

.trip-planner-modal .departure-card.loading {
    pointer-events: none;
}

.trip-planner-modal .departure-card .line-info {
    flex: 0 0 auto;
}

.trip-planner-modal .departure-card .headsign {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 400;
}

.trip-planner-modal .departure-card .stop-time {
    flex: 0 0 auto;
    margin-left: auto;
}

.trip-planner-modal .departure-card .stop-time.delay-none .time:not(.strikethrough) {
    color: var(--delay-none);
}

.trip-planner-modal .departure-card .stop-time.delay-early .time:not(.strikethrough) {
    color: var(--delay-early);
}

.trip-planner-modal .departure-card .stop-time.delay-delayed .time:not(.strikethrough) {
    color: var(--delay-delayed);
}

@media (hover: hover) and (pointer: fine) {
    .trip-planner-modal .departure-card:not(.selected):hover {
        background-color: var(--button-hover);
    }
}

.trip-planner-modal .step.intermediate {
    min-height: 26px;
}

.trip-planner-modal .step.intermediate .step-indicators .circle {
    width: 8px;
    height: 8px;
    border-width: 2px;
}

.trip-planner-modal .step.intermediate .step-details {
    padding-bottom: 6px;
}

.trip-planner-modal .step.intermediate .label {
    font-size: 14px;
    font-weight: 400;
    color: var(--bs-body-color);
}