/* ── Modal Button Base ────────────────────────────────────────────────────── */

.modal-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    padding: 8px;
    background-color: var(--bs-body-bg);
    border-radius: 50%;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    transition: background-color 0.3s;
}

.modal-button::before {
    content: "";
    position: absolute;
    inset: 8px;
    background-color: var(--bs-body-color);
}

.popup-modal .modal-button {
    width: 35px;
    height: 35px;
    padding: 6px;
    background-color: var(--bs-secondary-bg);
}

.popup-modal .modal-button::before {
    inset: 6px;
}

/* Close button uses a Material Icons child instead of a mask */
.modal-button.modal-close::before {
    display: none;
}

.modal-button.modal-close .material-icons {
    font-size: 18px;
    line-height: 1;
    color: var(--bs-body-color);
    pointer-events: none;
}

/* Favorite (star) button */
.modal-button.modal-fav::before {
    display: none;
}

.modal-button.modal-fav .material-icons {
    font-size: 20px;
    line-height: 1;
    color: var(--bs-secondary-color, #6c757d);
    pointer-events: none;
    transition: color 0.15s;
}

.modal-button.modal-fav.fav-active .material-icons {
    color: #f59e0b;
}

.modal-button.more-info::before {
    mask-image: url(../images/three_dots.svg);
    -webkit-mask-image: url(../images/three_dots.svg);
}

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

.modal-button.favorite.filled::before {
    mask-image: url(../images/favorite_icon_filled.svg);
    -webkit-mask-image: url(../images/favorite_icon_filled.svg);
}

.modal-buttons {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    flex-shrink: 0;
}

@media (hover: hover) and (pointer: fine) {
    .modal-button:hover,
    .sheet-dropdown-item:not(.disabled):hover {
        background-color: var(--button-hover);
    }
}

.modal-button:active,
.sheet-dropdown-item:not(.disabled):active {
    background-color: var(--button-active);
}

/* ── Bottom Sheet Container ───────────────────────────────────────────────── */

.popup-modal {
    display: flex;
    flex-direction: column;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    margin-left: auto;
    margin-right: auto;
    width: calc(100% - 64px);
    height: var(--modal-start-height);
    max-width: 600px;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.35);
    background-color: var(--bs-body-bg);
    border-radius: 20px 20px 0 0;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    transition: transform 225ms cubic-bezier(0, 0, 0.2, 1),
                height 225ms cubic-bezier(0, 0, 0.2, 1);
    z-index: 2000;
}

.popup-modal:focus {
    outline: none;
}

.popup-modal.resizing {
    transition: transform 225ms cubic-bezier(0, 0, 0.2, 1);
}

.popup-modal.closed {
    transform: translateY(100%);
    box-shadow: none;
}

@media (max-width: 600px) {
    .popup-modal {
        width: 100%;
        max-width: 100%;
    }
}

/* ── Spinner ──────────────────────────────────────────────────────────────── */

.popup-modal .spinner-border {
    width: 3rem;
    height: 3rem;
    position: absolute;
    top: calc(50% - 1.5rem);
    left: calc(50% - 1.5rem);
}

/* ── Sheet Notice ─────────────────────────────────────────────────────────── */

.popup-modal .sheet-notice:not(:empty) {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px 24px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--bs-secondary-color);
    gap: 8px;
}

.popup-modal .sheet-notice.sheet-notice--warning:not(:empty) {
    background: rgba(245, 158, 11, 0.12);
    color: var(--bs-body-color);
    border-bottom: 1px solid var(--bs-border-color-translucent);
    font-weight: 500;
    padding: 14px 20px;
}

/* ── Sheet Header ─────────────────────────────────────────────────────────── */

.popup-modal .header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 12px 10px;
    cursor: ns-resize;
    flex-shrink: 0;
}

/* Drag indicator pill */
.popup-modal .header::before {
    position: absolute;
    content: "";
    display: block;
    width: 40px;
    height: 4px;
    top: 8px;
    left: 50%;
    transform: translate(-50%);
    border-radius: 2px;
    background-color: var(--bs-border-color);
}

/* ── Sheet Icon ───────────────────────────────────────────────────────────── */

.popup-modal .header .sheet-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background-color: var(--bs-secondary-bg);
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    padding: 7px;
    border-radius: 11px;
    overflow: hidden;
}

.popup-modal .header .sheet-icon::before {
    content: "";
    position: absolute;
    inset: 7px;
    background-color: var(--bs-body-color);
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
}

/* ── has-content: icon carries real child elements (e.g. vehicle badge) ── */

/* Vehicle badge: icon + line number side-by-side */
.popup-modal .header .sheet-icon.has-content {
    flex-direction: row;
    align-items: center;
    gap: 4px;
    width: auto;
    padding: 0 9px;
    color: #fff;
    height: 32px;
}

.popup-modal .header .sheet-icon.has-content::before {
    display: none;
}

.popup-modal .header .sheet-icon .sheet-vehicle-icon {
    font-size: 18px;
    line-height: 1;
    color: inherit;
    flex-shrink: 0;
}

.popup-modal .header .sheet-icon .sheet-vehicle-line {
    font-size: 16px;
    font-weight: 800;
    line-height: 1;
    color: inherit;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.popup-modal .header .sheet-icon.has-content:has(.sheet-icon-img),
.popup-modal .header .sheet-icon.has-content:has(> .material-icons:not(.sheet-vehicle-icon)) {
    width: 38px;
    height: 38px;
    padding: 7px;
    background-color: var(--bs-secondary-bg);
    color: inherit;
}

.popup-modal .header .sheet-icon .sheet-icon-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Icon variants */
.popup-modal .header .sheet-icon.stop::before {
    mask-image: url(../assets/Haltestelle-Icon.svg);
    -webkit-mask-image: url(../assets/Haltestelle-Icon.svg);
}

.popup-modal .header .sheet-icon.request::before {
    mask-image: url(../images/request_stop_icon.svg);
    -webkit-mask-image: url(../images/request_stop_icon.svg);
}

.popup-modal .header .sheet-icon.metro::before {
    mask-image: url(../images/subway_icon.svg);
    -webkit-mask-image: url(../images/subway_icon.svg);
}

/* ── Sheet Titles ─────────────────────────────────────────────────────────── */

.popup-modal .header .sheet-titles {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    flex: 1;
    gap: 1px;
}

.popup-modal .header .sheet-title {
    font-weight: 500;
    font-size: 1.125rem;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.popup-modal .header .sheet-subtitle {
    font-size: 0.8rem;
    color: var(--bs-secondary-color);
    line-height: 1.2;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    overflow: hidden;
}

/* ── Stop line badges (shown in header subtitle) ─────────────────────────── */

.stop-line-badge {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 7px;
    border-radius: 6px;
    color: #fff;
    flex-shrink: 0;
}

.stop-line-badge-name {
    font-size: 0.75rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

/* ── Sheet Content ────────────────────────────────────────────────────────── */

.popup-modal .sheet-content {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    flex: 1;
    padding-top: 4px;
}

/* ── Arrival / Departure Rows ─────────────────────────────────────────────── */

.popup-modal .sheet-content .arrival {
    display: flex;
    flex-direction: column;
    padding: 8px 16px;
    border-radius: 24px;
    max-height: 61px;
    user-select: none;
    -webkit-user-select: none;
    transition: background-color 0.2s, margin 0.2s, max-height 0.2s;
    cursor: pointer;
}

.popup-modal .sheet-content .arrival.cancelled .inner {
    opacity: 0.5;
}

.popup-modal .sheet-content .arrival:not(.expanded) .actions {
    display: none;
}

.popup-modal .sheet-content .arrival.expanded {
    background-color: var(--bs-secondary-bg);
    margin: 8px;
    max-height: 122px;
}

.popup-modal .sheet-content .arrival .inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
}

.popup-modal .sheet-content .arrival .arrival-header {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.popup-modal .sheet-content .arrival .time {
    flex-shrink: 0;
    text-align: right;
    font-size: 0.9rem;
}

.popup-modal .sheet-content .arrival .actions {
    display: flex;
    align-items: center;
    justify-content: space-evenly;
}

.popup-modal .sheet-content .arrival .actions .action {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px;
    border-radius: 16px;
    transition: background-color 0.2s;
    cursor: pointer;
}

.popup-modal .sheet-content .arrival .actions .action .icon {
    width: 24px;
    height: 24px;
    mask-size: contain;
    mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    background-color: var(--bs-body-color);
}

.popup-modal .sheet-content .arrival .actions .action .label {
    font-size: 14px;
}

@media (hover: hover) and (pointer: fine) {
    .popup-modal .sheet-content .arrival .actions .action:hover {
        background-color: var(--button-hover);
    }

    .popup-modal .sheet-content .arrival:not(:has(.action:active)):hover {
        background-color: var(--button-hover);
    }
}

.popup-modal .sheet-content .arrival .actions .action:active {
    background-color: var(--button-active);
}

.popup-modal .sheet-content .arrival:not(:has(.action:active)):active {
    background-color: var(--button-active);
}

/* ── Floating Dropdown Menu ───────────────────────────────────────────────── */

.sheet-dropdown {
    display: flex;
    flex-direction: column;
    position: absolute;
    background: var(--bs-secondary-bg);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    border-radius: 12px;
    padding: 4px 0;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    z-index: 100;
    min-width: 160px;
}

.sheet-dropdown-item {
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 0.9rem;
}

.sheet-dropdown-item.disabled {
    opacity: 0.5;
    cursor: default;
    pointer-events: none;
}

.dropdown-item-icon {
    display: inline-block;
    flex-shrink: 0;
    background-color: var(--bs-body-color);
    mask-size: contain;
    mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    width: 18px;
    height: 18px;
}

.dropdown-item-icon.share {
    mask-image: url(../images/share_icon.svg);
    -webkit-mask-image: url(../images/share_icon.svg);
}

/* ── Line Badge ───────────────────────────────────────────────────────────── */

.line-info {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.line-info .line {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.line-info .line .number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    height: 1.5rem;
    padding: 0 6px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.875rem;
    color: #fff;
    background-color: #666;
}

.line-info .line.tram    .number { background-color: #dc3545; }
.line-info .line.bus     .number { background-color: #0d6efd; }
.line-info .line.trolley .number { background-color: #28a745; }
.line-info .line.night   .number { background-color: #6610f2; }

.line-info .destination {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.9rem;
}

/* ── Trip Timeline ────────────────────────────────────────────────────────── */

.trip-timeline {
    display: flex;
    flex-direction: column;
    padding: 8px 16px 16px;
}

/* ── Each stop row ───────────────────────────────────────────────────────── */

.trip-stop {
    display: flex;
    align-items: stretch;
    gap: 12px;
    position: relative;
}

.trip-stop--linked {
    cursor: pointer;
    border-radius: 12px;
    margin: 0 -12px;
    padding: 0 12px 0 18px;
    transition: background-color 0.15s ease;
}

.trip-stop--linked .trip-stop-info {
    border-radius: 10px;
}

@media (hover: hover) and (pointer: fine) {
    .trip-stop--linked:hover {
        background: var(--bs-secondary-bg);
    }
}

.trip-stop--linked:active {
    background: var(--bs-secondary-bg);
}

.trip-stop--linked:focus-visible {
    outline: none;
}

.trip-stop--linked:focus-visible {
    background: var(--bs-secondary-bg);
}

/* ── Track column ────────────────────────────────────────────────────────── */

.trip-track {
    position: relative;
    flex-shrink: 0;
    width: 20px;
    padding: 4px 0;
}

/* Bar — runs full height of each row by default (middle stops) */
.trip-track::before {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    top: 0;
    bottom: 0;
    background-color: var(--trip-color, var(--bs-secondary-color));
}

/* First stop bar starts at dot centre, rounded top cap */
.trip-stop.first .trip-track::before {
    top: 32%;
    border-top-left-radius:  8px;
    border-top-right-radius: 8px;
}

/* Last stop bar ends at dot centre, rounded bottom cap */
.trip-stop.last .trip-track::before {
    bottom: 32%;
    border-bottom-left-radius:  8px;
    border-bottom-right-radius: 8px;
}

/* Dot — white circle, sits on top of bar */
.trip-dot {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #fff;
    z-index: 2;
    flex-shrink: 0;
}

.trip-stop.past .trip-dot {
    opacity: 0.55;
}

/* Hide legacy per-segment lines */
.trip-line { display: none; }

/* ── Info column ─────────────────────────────────────────────────────────── */

.trip-stop-info {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex: 1;
    min-width: 0;
    padding: 6px 0;
}

.trip-stop-name-block {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.trip-stop-name {
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.trip-stop.past .trip-stop-name {
    font-weight: 500;
    color: var(--bs-secondary-color);
}


.trip-stop-name-wrap {
    min-width: 0;
}

.trip-stop-platform {
    font-weight: 400;
    color: var(--bs-secondary-color);
}

/* ── Countdown (right side) ──────────────────────────────────────────────── */

.trip-stop-mins {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1;
    gap: 1px;
}

.trip-stop-mins strong {
    font-size: 1.25rem;
    font-weight: 500;
    line-height: 1;
}

.trip-stop-mins small {
    font-size: 0.68rem;
    color: var(--bs-secondary-color);
}

/* ── Status row ──────────────────────────────────────────────────────────── */

.trip-stop-status {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
    font-size: 0.78rem;
    flex-wrap: wrap;
}

.trip-status-sep {
    color: var(--bs-secondary-color);
}

.trip-status-time {
    color: var(--bs-secondary-color);
}

.trip-status-label {
    font-size: 0.78rem;
    font-weight: 500;
}

.trip-status-label.past {
    color: var(--bs-secondary-color);
    font-weight: 400;
}

.trip-status-label.ontime {
    color: var(--bs-success);
    font-weight: 600;
}

.trip-status-label.delayed {
    color: var(--bs-danger);
    font-weight: 700;
}

.trip-status-label.planned {
    color: var(--bs-secondary-color);
    font-weight: 400;
}

.trip-planned-time {
    text-decoration: line-through;
    color: var(--bs-secondary-color);
}

.trip-actual-time {
    color: var(--bs-danger);
    font-weight: 600;
}

/* ── Departure List ────────────────────────────────────────────────────────── */

.dep-list {
    display: flex;
    flex-direction: column;
    padding: 8px 16px 16px;
}

.dep-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 0;
}

.dep-row:last-child {
    border-bottom: none;
}

.dep-row--linked {
    cursor: pointer;
}

@media (hover: hover) and (pointer: fine) {
    .dep-row--linked:hover {
        background: var(--bs-secondary-bg);
        border-radius: 10px;
        margin: 0 -8px;
        padding-left: 8px;
        padding-right: 8px;
    }
}

.dep-row--linked:active {
    background: var(--bs-secondary-bg);
    border-radius: 10px;
    margin: 0 -8px;
    padding-left: 8px;
    padding-right: 8px;
}



.dep-badge {
    flex-shrink: 0;
    width: auto;
    height: 34px;
    border-radius: 10px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0 9px;
    color: #fff;
}

.dep-badge-icon {
    font-size: 18px !important;
    line-height: 1;
}

.dep-badge-line {
    font-size: 16px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.dep-info {
    flex: 1;
    min-width: 0;
}

.dep-headsign {
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dep-platform {
    font-weight: 400;
    color: var(--bs-secondary-color, #6c757d);
    margin-left: 3px;
}
.dep-time {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
}

.dep-mins {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1;
    gap: 1px;
}

.dep-mins strong {
    font-size: 1.25rem;
    font-weight: 500;
    line-height: 1;
}

.dep-mins small {
    font-size: 0.68rem;
    color: var(--bs-secondary-color);
}

.dep-status {
    font-size: 0.72rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dep-sentinel {
    height: 1px;
}

/* ── Favorites Sheet ──────────────────────────────────────────────────────── */

.fav-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 4px 12px 12px;
}

.fav-item {
    border-radius: 14px;
    overflow: hidden;
    background: var(--bs-secondary-bg);
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    transition: background-color 0.15s;
}

.fav-item:hover {
    background-color: var(--bs-tertiary-bg);
}

.fav-item:active {
    background-color: var(--bs-border-color);
}

.fav-item-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px 10px;
}

.fav-item-stop-icon-img {
    width: 22px;
    height: 22px;
    object-fit: contain;
    flex-shrink: 0;
    opacity: 0.85;
}

.fav-item-name {
    font-size: 0.95rem;
    font-weight: 600;
    flex: 1;
}

.fav-item-arrow {
    font-size: 20px !important;
    color: var(--bs-secondary-color);
    flex-shrink: 0;
}

.fav-item-deps {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 0 14px 10px;
}

.fav-dep-spinner {
    padding: 6px 0;
    display: flex;
    justify-content: center;
}

.fav-dep-empty {
    font-size: 0.8rem;
    color: var(--bs-secondary-color);
    padding: 4px 0;
}

.fav-dep-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
}

.fav-dep-chip:first-child {
    border-top: none;
}

.fav-dep-badge {
    flex-shrink: 0;
    height: 22px;
    padding: 0 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 800;
    color: #fff;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.fav-dep-badge-icon {
    font-size: 13px !important;
    line-height: 1;
}

.fav-dep-dir {
    flex: 1;
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--bs-body-color);
}

.fav-dep-mins {
    flex-shrink: 0;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--bs-body-color);
    text-align: right;
    min-width: 32px;
}

/* ── Vehicle List Sheet ────────────────────────────────────────────────────── */

.vlist-sort-bar {
    display: flex;
    gap: 8px;
    padding: 8px 16px 4px;
    flex-shrink: 0;
}

.vlist-sort-btn {
    padding: 5px 14px;
    border-radius: 20px;
    border: 1px solid var(--bs-border-color);
    background: var(--bs-secondary-bg);
    color: var(--bs-body-color);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.vlist-sort-btn.active {
    background: var(--bs-emphasis-color);
    color: var(--bs-body-bg);
    border-color: var(--bs-emphasis-color);
}

.vlist {
    display: flex;
    flex-direction: column;
}

.vlist-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.15s;
}

@media (hover: hover) and (pointer: fine) {
    .vlist-row:hover {
        background: var(--bs-secondary-bg);
    }
}

.vlist-row:active {
    background: var(--bs-secondary-bg);
}

.vlist-section-header {
    padding: 10px 16px 4px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--bs-secondary-color);
}

.vlist-section-header:not(:first-child) {
    margin-top: 6px;
}

.vlist-type-icon {
    width: 26px;
    height: 26px;
    object-fit: contain;
    flex-shrink: 0;
}

.vlist-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-width: 38px;
    height: 26px;
    padding: 0 8px;
    border-radius: 6px;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    white-space: nowrap;
    flex-shrink: 0;
}

.vlist-badge-icon {
    font-size: 14px !important;
    line-height: 1;
}

.vlist-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.vlist-dest {
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vlist-meta {
    font-size: 0.75rem;
    color: var(--bs-secondary-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vlist-arrow {
    font-size: 18px !important;
    color: var(--bs-secondary-color);
    flex-shrink: 0;
}

/* ── Search sheet ─────────────────────────────────────────────────────────── */

.search-sheet {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 4px 0 16px;
    min-height: 120px;
}

.search-sheet-input {
    box-sizing: border-box;
    align-self: stretch;
    width: auto;
    margin: 0 16px;
    min-width: 0;
    border-radius: 10px;
    font-size: 0.95rem;
}

.search-sheet-results {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-height: 48px;
}

.search-sheet-hint {
    padding: 16px 20px 8px;
    font-size: 0.88rem;
    color: var(--bs-secondary-color);
    line-height: 1.45;
}

.search-sheet-section {
    padding: 14px 16px 6px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--bs-secondary-color);
}

.search-sheet-section:not(:first-child) {
    margin-top: 8px;
}

.search-stop-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    margin: 0;
    border: none;
    background: transparent;
    color: var(--bs-body-color);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s;
}

.search-stop-row-icon {
    width: 26px;
    height: 26px;
    object-fit: contain;
    flex-shrink: 0;
}

.search-stop-row-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.search-stop-row-text {
    width: 100%;
    min-width: 0;
    font-size: 0.92rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-stop-row-lines {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    width: 100%;
}

.search-stop-row-lines--pending {
    font-size: 0.75rem;
    color: var(--bs-secondary-color);
    line-height: 1.2;
}

.search-stop-row-lines--empty {
    display: none !important;
}

.search-stop-line-badge {
    height: 18px;
    padding: 0 5px;
}

.search-stop-line-badge .stop-line-badge-name {
    font-size: 0.65rem;
}

.search-row-chevron {
    font-size: 20px !important;
    color: var(--bs-secondary-color);
    flex-shrink: 0;
}

button.search-vlist-row {
    width: 100%;
    margin: 0;
    border: none;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
}

button.search-vlist-row:focus-visible {
    outline: 2px solid rgba(59, 130, 246, 0.6);
    outline-offset: -2px;
}

@media (hover: hover) and (pointer: fine) {
    .search-stop-row:hover {
        background: var(--bs-secondary-bg);
    }
}

.search-stop-row:active {
    background: var(--bs-secondary-bg);
}

/* ── Routenplaner (INSA) — Bootstrap-first, minimal tweaks ─────────────────── */

/* Stronger than Bootstrap text-secondary on dark sheets + secondary-bg rows */
.route-bs {
    --route-bs-muted-fg: color-mix(in srgb, var(--bs-body-color) 84%, var(--bs-secondary-color));
    --route-bs-muted-fg-strong: color-mix(in srgb, var(--bs-body-color) 92%, var(--bs-secondary-color));
}

.route-bs .route-bs-muted {
    color: var(--route-bs-muted-fg);
}

.route-bs .route-bs-muted-strong {
    color: var(--route-bs-muted-fg-strong);
}

.route-bs .route-bs-foot-link {
    color: var(--route-bs-muted-fg-strong);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.route-bs .route-bs-foot-link:hover {
    color: var(--bs-body-color);
}

.route-bs .input-group-text {
    color: var(--route-bs-muted-fg-strong);
}

.route-bs ::placeholder {
    color: var(--route-bs-muted-fg);
    opacity: 1;
}

.route-bs .route-bs-swap {
    width: 44px;
    height: 44px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.route-bs .route-bs-swap .material-icons {
    font-size: 22px;
}

.route-bs-input-group:focus-within {
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25));
    border-radius: var(--bs-border-radius);
}

.route-bs-input-clear {
    flex-shrink: 0;
    padding-left: 0.45rem;
    padding-right: 0.45rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.route-bs-input-clear:disabled {
    pointer-events: none;
    opacity: 0.45;
}

/* Inline Haltestellenliste — schlicht, einzeilig */
.route-bs-stop-sug-list .list-group-item.active {
    z-index: 1;
}

.route-bs-stop-sug-list > .route-bs-sug-section.list-group-item {
    background: transparent;
    pointer-events: none;
    user-select: none;
    font-weight: 500;
    border-top-width: 0 !important;
    border-bottom-width: 0 !important;
}

/* Kein Strich zwischen letzter Zeile eines Blocks und der nächsten Überschrift (z. B. Favoriten → Zuletzt) */
.route-bs-stop-sug-list .route-bs-sug-row.list-group-item:has(+ .route-bs-sug-section) {
    border-bottom-width: 0 !important;
}

.route-bs-stop-sug-list .route-bs-sug-row.list-group-item {
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

.route-bs-stop-sug-list .route-bs-sug-fav-ic {
    font-size: 17px;
    line-height: 1;
    vertical-align: middle;
}

.route-bs-stop-sug-list .route-bs-sug-stop-ic {
    width: 20px;
    height: 20px;
    display: block;
    object-fit: contain;
}

.route-bs-stop-ic {
    opacity: 0.95;
    object-fit: contain;
}

.route-bs-dt-row {
    max-width: min(280px, 100%);
}

.route-bs-dt-input {
    width: 100%;
    font-variant-numeric: tabular-nums;
}

.route-bs-results.list-group {
    overflow: hidden;
}

/* Stronger contrast for departure label ("Ab") vs muted row background */
.route-bs .route-bs-ab-label {
    color: var(--bs-emphasis-color);
    font-weight: 600;
    letter-spacing: 0.02em;
}

.route-bs .route-bs-ab-place {
    color: var(--bs-body-color);
}

.route-bs-trip.list-group-item {
    background-color: var(--bs-secondary-bg);
}

.route-bs-time-arrow,
.route-bs-detail-title-ic {
    font-size: 1.15rem;
    line-height: 1;
    vertical-align: middle;
    color: var(--route-bs-muted-fg-strong);
}

.route-bs-detail-title-ic {
    font-size: 1.1rem !important;
    vertical-align: -2px;
}

.route-bs-leg-sep-ic {
    font-size: 16px !important;
    color: var(--route-bs-muted-fg);
    opacity: 1;
}

.route-bs-detail-meta-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    line-height: 1.35;
}

.route-bs-detail-meta-sep {
    color: var(--route-bs-muted-fg);
    user-select: none;
}

.route-bs-detail-meta-ab {
    color: var(--route-bs-muted-fg-strong);
    min-width: 0;
}

.route-bs-detail-meta-origin {
    color: var(--bs-body-color);
    font-weight: 500;
}

.route-bs-passlist-item {
    background-color: var(--bs-body-bg);
}

.route-bs-passlist-item--first {
    background-color: rgba(var(--bs-primary-rgb), 0.06);
}

.route-bs-passlist-item--last {
    background-color: rgba(var(--bs-primary-rgb), 0.06);
}

.route-bs-passlist-times {
    font-size: 0.78rem;
    line-height: 1.35;
}

.route-bs-passlist-stop-ic {
    display: flex;
    align-items: flex-start;
    padding-top: 1px;
}

.route-bs-passlist-stop-img {
    width: 20px;
    height: 20px;
}

/* Compact disclosure between Einstiegs- und Ausstiegshaltestelle */
.route-bs-passlist-dropdown {
    appearance: none;
    -webkit-appearance: none;
    font: inherit;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    margin: 0.4rem 0 0.35rem;
    padding: 0.3rem 0.5rem;
    border: 1px solid var(--bs-border-color-translucent);
    border-radius: var(--bs-border-radius);
    background: rgba(var(--bs-secondary-rgb), 0.22);
    font-size: 0.8125rem;
    line-height: 1.3;
    color: var(--route-bs-muted-fg-strong);
    text-align: left;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.route-bs-passlist-dropdown:hover {
    background: rgba(var(--bs-secondary-rgb), 0.32);
    border-color: var(--bs-border-color);
    color: var(--bs-body-color);
}

.route-bs-passlist-dropdown:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.35);
}

.route-bs-passlist-dropdown-label {
    flex: 1;
    min-width: 0;
    font-weight: 500;
}

.route-bs-passlist-dropdown-chev {
    flex-shrink: 0;
    font-size: 1.25rem !important;
    opacity: 0.85;
}

.route-bs-passlist-collapse {
    margin: 0 0 0.35rem;
}

.route-bs-step--transit {
    background-color: var(--bs-body-bg);
    border-color: var(--bs-border-color-translucent) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.route-bs-step--walk {
    background-color: rgba(var(--bs-secondary-rgb), 0.14);
}

.route-bs-step-walk-ic {
    font-size: 28px !important;
    line-height: 1;
}

.route-bs-step-place-ic {
    font-size: 18px !important;
    line-height: 1;
    margin-top: 2px;
    color: var(--route-bs-muted-fg-strong);
    opacity: 1;
}

.route-bs-step-times .route-bs-time-arrow {
    font-size: 1.35rem;
}

