.live-source-toggle {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
    display: inline-flex;
    gap: .3rem;
    padding: .3rem;
    background: var(--background);
    border: 1px solid var(--brand-color-lighter);
    border-radius: .75em;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    max-width: calc(100% - 60px);
}

.live-source-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .42rem .9rem;
    border-radius: .75em;
    font-size: .82rem;
    font-weight: 500;
    color: var(--text-soft);
    background: var(--background);
    border: 1px solid transparent;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
}

.live-source-btn:hover {
    color: var(--text);
    border-color: var(--brand-color-mid);
    background: var(--background);
}

.live-source-btn.is-active {
    background: var(--brand-color-mid);
    border-color: var(--brand-color-mid);
    color: var(--text);
    font-weight: 600;
}

.live-source-btn.is-active:hover {
    border-color: var(--brand-color-light);
}

.live-source-note {
    position: absolute;
    top: 58px;
    left: 10px;
    z-index: 10;
    background: var(--background);
    border: 1px solid var(--brand-color-lighter);
    border-radius: .75em;
    color: var(--text-soft);
    padding: .35rem .6rem;
    font-size: .75rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    pointer-events: none;
    max-width: calc(100% - 60px);
}

.omsi-trip-map {
    width: 100%;
    height: 420px;
    border: 1px solid var(--brand-color-lighter);
    border-radius: .75em;
    overflow: hidden;
    background: var(--background);
    z-index: 0;
}

.omsi-journey-head h1 {
    margin: 0 0 1rem;
}

body.omsi-full main {
    max-width: none;
    padding: 1rem;
}

body.omsi-full .omsi-journey {
    grid-template-columns: minmax(340px, 460px) 1fr;
}

body.omsi-full .omsi-journey-map .omsi-trip-map {
    height: calc(100vh - 220px);
    min-height: 560px;
}

.omsi-journey {
    display: grid;
    grid-template-columns: minmax(320px, 430px) 1fr;
    gap: 1.5rem;
    align-items: start;
}

.omsi-journey-map {
    min-width: 0;
}

.omsi-journey-map .omsi-trip-map {
    height: calc(100vh - 240px);
    min-height: 520px;
}

.omsi-journey-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-top: 1.5rem;
    background: var(--background);
}

.omsi-journey-meta {
    display: block;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-soft);
}

.omsi-journey-value {
    font-size: 1rem;
    color: var(--text);
}

@media (max-width: 900px) {
    .omsi-journey {
        display: flex;
        flex-direction: column;
    }
    .omsi-journey-map {
        order: -1;
        width: 100%;
    }
    .omsi-journey-map .omsi-trip-map {
        height: 62vh;
        min-height: 320px;
    }
    body.omsi-full .omsi-journey-map .omsi-trip-map {
        height: 62vh;
        min-height: 320px;
    }
}

@media (max-width: 640px) {
    .omsi-trip-map {
        height: 300px;
    }
}

.omsi-vehicle-list {
    position: absolute;
    top: 104px;
    left: 10px;
    z-index: 9;
    display: flex;
    flex-direction: column;
    gap: .4rem;
    padding: .4rem;
    background: var(--background);
    border: 1px solid var(--brand-color-lighter);
    border-radius: .75em;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    max-width: min(320px, calc(100% - 60px));
    max-height: calc(100% - 130px);
    overflow-y: auto;
}

.omsi-vehicle-list[hidden] {
    display: none;
}

.omsi-vehicle-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: .45rem .6rem;
    background: var(--background);
    border: 1px solid transparent;
    border-radius: .75em;
    font-size: .8rem;
}

.omsi-vehicle-row strong {
    color: var(--text);
    font-weight: 600;
}

.omsi-vehicle-row span {
    color: var(--text-soft);
    font-size: .75rem;
}

.omsi-vehicle-row.is-stale {
    opacity: .6;
}

.omsi-vehicle-row.is-mappable {
    cursor: pointer;
}

.omsi-vehicle-row.is-mappable:hover {
    border-color: var(--brand-color-mid);
}

.omsi-vehicle-empty {
    padding: .6rem;
    color: var(--text-soft);
    font-size: .8rem;
}

@media (max-width: 640px) {
    .live-source-toggle {
        left: 8px;
        right: 52px;
    }
    .live-source-btn {
        flex: 1 1 0;
    }
    .live-source-note {
        left: 8px;
        right: 52px;
    }
.omsi-leaflet {
    background: var(--background);
}

.map-container > .omsi-leaflet {
    /* Leaflet sets position:relative inline on its container, so
       outrank it to keep the schematic pinned over the map frame. */
    position: absolute !important;
    inset: 0;
    z-index: 5;
}

.omsi-leaflet[hidden] {
    display: none;
}

.omsi-vehicle-list {
        left: 8px;
        right: 52px;
        max-width: none;
        max-height: 40%;
    }
}
