#trip-steps-content p {
    margin: 0;
    padding: 0;
}

#trip-steps-content .title {
    font-size: 1.2rem;
}

#trip-steps-content .title_bold {
    font-weight: 600;
}

#trip-steps-content .subtitle {
    font-size: 1rem;
    color: #86888e;
}

#trip-header {
    padding: 12px 16px 14px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.4);
}

#trip-header .title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

#trip-header .subtitle {
    font-size: 1rem;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.6);
}

#trip-steps-content .start {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-image: url("/images/live-bus-times/trip-viewer/start-line.png");
    background-repeat: no-repeat;
    background-position: left center;
    background-size: 32px 600px;
    margin: 0 8px 0 10px;
    padding: 20px 0 10px 36px;
}

#trip-steps-content .start .title {
    font-weight: 600;
}

#trip-steps-content .start .time {
    white-space: nowrap;
}

#trip-steps-content .leg {
    margin: 0;
}

#trip-steps-content .leg-walking-step {
    background-image: url("/images/live-bus-times/trip-viewer/walking-line.png");
    background-repeat: no-repeat;
    background-position: left center;
    background-size: 32px 600px;
    padding: 20px 16px 20px 36px;
    margin-left: 10px;
}

#trip-steps-content .leg-walking-step p.title {
    margin-bottom: 0.15rem;
}

#trip-steps-content .transit-leg-card {
    padding: 4px 16px 16px 16px;
    background-color: #f3f4f6;
    border-radius: 12px;
}

#trip-steps-content .transit-leg-card .route-header {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    left: -2px;
    margin: 12px 0 8px 0;
}

#trip-steps-content .transit-leg-card .icon {
    display: inline-block;
    background-image: url("/images/live-bus-times/trip-viewer/transport-icons/monochrome-bus-24dp.png");
    background-repeat: no-repeat;
    background-size: 24px 24px;
    width: 24px;
    height: 24px;
}

#trip-steps-content .transit-leg-card .icon_train {
    background-image: url("/images/live-bus-times/trip-viewer/transport-icons/monochrome-train-24dp.png");
}

#trip-steps-content .transit-leg-card .icon_subway {
    background-image: url("/images/live-bus-times/trip-viewer/transport-icons/monochrome-subway-24dp.png");
}

#trip-steps-content .transit-leg-card .icon_tram {
    background-image: url("/images/live-bus-times/trip-viewer/transport-icons/monochrome-tram-24dp.png");
}

#trip-steps-content .transit-leg-card .icon_streetcar {
    background-image: url("/images/live-bus-times/trip-viewer/transport-icons/monochrome-streetcar-24dp.png");
}

#trip-steps-content .transit-leg-card .icon_ferry {
    background-image: url("/images/live-bus-times/trip-viewer/transport-icons/monochrome-ferry-24dp.png");
}

#trip-steps-content .transit-leg-card .icon_gondola {
    background-image: url("/images/live-bus-times/trip-viewer/transport-icons/monochrome-gondola-24dp.png");
}

#trip-steps-content .transit-leg-card .icon_funicular {
    background-image: url("/images/live-bus-times/trip-viewer/transport-icons/monochrome-funicular-24dp.png");
}

#trip-steps-content .transit-leg-card .route-name {
    display: inline-block;
    padding: 1.5px 8px 1.5px 8px;
    font-weight: 700;
    border-radius: 3px;
}

#trip-steps-content .transit-leg-card .description {
    padding-left: 30px;
}

#trip-steps-content .transit-leg-card .details {
    margin-top: 20px;
    display: flex;
}

#trip-steps-content .transit-leg-card .details .left-column {
    width: 30px;
    flex-shrink: 0;
}

#trip-steps-content .transit-leg-card .details .transit-leg-line {
    width: 16px;
    position: relative;
    height: 100%;
    border-radius: 8px;
    left: 2px;
}

#trip-steps-content .transit-leg-card .details .top-dot,
#trip-steps-content .transit-leg-card .details .bottom-dot {
    width: 8px;
    height: 8px;
    background-color: white;
    border-radius: 50%;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

#trip-steps-content .transit-leg-card .details .top-dot {
    top: 5px;
}

#trip-steps-content .transit-leg-card .details .bottom-dot {
    bottom: 5px;
}

#trip-steps-content .transit-leg-card .details .right-column {
    flex-grow: 1;
}

#trip-steps-content .transit-leg-card .details .origin-stop,
#trip-steps-content .transit-leg-card .details .destination-stop {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

#trip-steps-content .transit-leg-card .details .origin-stop .title,
#trip-steps-content .transit-leg-card .details .destination-stop .title {
    font-size: 1rem;
}

#trip-steps-content .transit-leg-card .details .origin-stop .subtitle,
#trip-steps-content .transit-leg-card .details .destination-stop .subtitle {
    font-size: 0.9rem;
    white-space: nowrap;
}

#trip-steps-content .transit-leg-card .details .stay-on-for {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px; /* Adds spacing between the toggle and text */
    min-height: 36px;
    margin: 12px 0 12px 0;
    cursor: pointer;
}

#trip-steps-content .transit-leg-card .details .stay-on-for .intermediate-stops-toggle {
    display: inline-block;
    width: 16px;
    height: 16px;
    background-image: url("/images/live-bus-times/trip-viewer/intermediate-stops-expand.png");
    background-size: 16px 16px;
    background-repeat: no-repeat;
}

#trip-steps-content .transit-leg-card .details .stay-on-for p {
    font-size: 0.9rem;
    color: rgba(0, 0, 0, 0.7);
}

#trip-steps-content .transit-leg-card .details .intermediate-stops {
    opacity: 0;
    max-height: 0;
    height: 0;
    overflow: visible;
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
    position: relative; /* Ensure child elements are positioned relative to this */
}

#trip-steps-content .transit-leg-card .details .intermediate-stop {
    position: relative;
    overflow: visible; /* Ensure child elements are not clipped */
}

#trip-steps-content .transit-leg-card .details .intermediate-stop .intermediate-stop-dot {
    width: 6px;
    height: 6px;
    background-color: white;
    border-radius: 50%;
    position: absolute;
    left: -20px;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 1; /* Ensure it's above other elements */
}

#trip-steps-content .transit-leg-card .details .intermediate-stop p.stop-name {
    font-size: 0.9rem;
    margin: 10px 0 10px 0;
    color: rgba(0, 0, 0, 0.8);
}

#trip-steps-content .destination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-image: url("/images/live-bus-times/trip-viewer/destination-line.png");
    background-repeat: no-repeat;
    background-position: left center;
    background-size: 32px 600px;
    margin: 0 8px 0 10px;
    padding: 20px 0 10px 36px;
}

#trip-steps-content .destination .title {
    font-weight: 600;
}

#trip-steps-content .destination .time {
    white-space: nowrap;
}

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    #trip-steps-content .start {
        background-image: url("/images/live-bus-times/trip-viewer/start-line@2x.png");
    }

    #trip-steps-content .leg-walking-step {
        background-image: url("/images/live-bus-times/trip-viewer/walking-line@2x.png");
    }

    #trip-steps-content .transit-leg-card .details .stay-on-for .intermediate-stops-toggle {
        background-image: url("/images/live-bus-times/trip-viewer/intermediate-stops-expand@2x.png");
    }

    #trip-steps-content .destination {
        background-image: url("/images/live-bus-times/trip-viewer/destination-line@2x.png");
    }

    #trip-steps-content .transit-leg-card .icon {
        background-image: url("/images/live-bus-times/trip-viewer/transport-icons/monochrome-bus-24dp@2x.png");
    }

    #trip-steps-content .transit-leg-card .icon_train {
        background-image: url("/images/live-bus-times/trip-viewer/transport-icons/monochrome-train-24dp@2x.png");
    }

    #trip-steps-content .transit-leg-card .icon_subway {
        background-image: url("/images/live-bus-times/trip-viewer/transport-icons/monochrome-subway-24dp@2x.png");
    }

    #trip-steps-content .transit-leg-card .icon_tram {
        background-image: url("/images/live-bus-times/trip-viewer/transport-icons/monochrome-tram-24dp@2x.png");
    }

    #trip-steps-content .transit-leg-card .icon_streetcar {
        background-image: url("/images/live-bus-times/trip-viewer/transport-icons/monochrome-streetcar-24dp@2x.png");
    }

    #trip-steps-content .transit-leg-card .icon_ferry {
        background-image: url("/images/live-bus-times/trip-viewer/transport-icons/monochrome-ferry-24dp@2x.png");
    }

    #trip-steps-content .transit-leg-card .icon_gondola {
        background-image: url("/images/live-bus-times/trip-viewer/transport-icons/monochrome-gondola-24dp@2x.png");
    }

    #trip-steps-content .transit-leg-card .icon_funicular {
        background-image: url("/images/live-bus-times/trip-viewer/transport-icons/monochrome-funicular-24dp@2x.png");
    }
}

@media (-webkit-min-device-pixel-ratio: 3), (min-resolution: 288dpi) {
    #trip-steps-content .start {
        background-image: url("/images/live-bus-times/trip-viewer/start-line@3x.png");
    }

    #trip-steps-content .leg-walking-step {
        background-image: url("/images/live-bus-times/trip-viewer/walking-line@3x.png");
    }

    #trip-steps-content .transit-leg-card .details .stay-on-for .intermediate-stops-toggle {
        background-image: url("/images/live-bus-times/trip-viewer/intermediate-stops-expand@3x.png");
    }

    #trip-steps-content .destination {
        background-image: url("/images/live-bus-times/trip-viewer/destination-line@3x.png");
    }

    #trip-steps-content .transit-leg-card .icon {
        background-image: url("/images/live-bus-times/trip-viewer/transport-icons/monochrome-bus-24dp@3x.png");
    }

    #trip-steps-content .transit-leg-card .icon_train {
        background-image: url("/images/live-bus-times/trip-viewer/transport-icons/monochrome-train-24dp@3x.png");
    }

    #trip-steps-content .transit-leg-card .icon_subway {
        background-image: url("/images/live-bus-times/trip-viewer/transport-icons/monochrome-subway-24dp@3x.png");
    }

    #trip-steps-content .transit-leg-card .icon_tram {
        background-image: url("/images/live-bus-times/trip-viewer/transport-icons/monochrome-tram-24dp@3x.png");
    }

    #trip-steps-content .transit-leg-card .icon_streetcar {
        background-image: url("/images/live-bus-times/trip-viewer/transport-icons/monochrome-streetcar-24dp@3x.png");
    }

    #trip-steps-content .transit-leg-card .icon_ferry {
        background-image: url("/images/live-bus-times/trip-viewer/transport-icons/monochrome-ferry-24dp@3x.png");
    }

    #trip-steps-content .transit-leg-card .icon_gondola {
        background-image: url("/images/live-bus-times/trip-viewer/transport-icons/monochrome-gondola@3x.png");
    }

    #trip-steps-content .transit-leg-card .icon_funicular {
        background-image: url("/images/live-bus-times/trip-viewer/transport-icons/monochrome-funicular@3x.png");
    }
}

@media (prefers-color-scheme: dark) {
    #trip-header {
        border-bottom: 1px solid rgba(255, 255, 255, 0.4);
    }

    #trip-steps-content .start {
        background-image: url("/images/live-bus-times/trip-viewer/start-line-dark.png");
    }

    #trip-steps-content .leg-walking-step {
        background-image: url("/images/live-bus-times/trip-viewer/walking-line-dark.png");
    }

    #trip-steps-content .destination {
        background-image: url("/images/live-bus-times/trip-viewer/destination-line-dark.png");
    }

    #trip-steps-content .subtitle {
        color: rgba(255, 255, 255, 0.6);
    }

    #trip-steps-content .transit-leg-card {
        background-color: rgba(32, 36, 38, 0.7);
    }

    #trip-steps-content .transit-leg-card .icon,
    #trip-steps-content .transit-leg-card .details .stay-on-for .intermediate-stops-toggle {
        filter: invert(1);
    }

    #trip-steps-content .transit-leg-card .details .stay-on-for p {
        color: rgba(255, 255, 255, 0.7);
    }

    #trip-steps-content .transit-leg-card .details .intermediate-stop p.stop-name {
        color: rgba(255, 255, 255, 0.8);
    }

    @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
        #trip-steps-content .start {
            background-image: url("/images/live-bus-times/trip-viewer/start-line-dark@2x.png");
        }

        #trip-steps-content .leg-walking-step {
            background-image: url("/images/live-bus-times/trip-viewer/walking-line-dark@2x.png");
        }

        #trip-steps-content .destination {
            background-image: url("/images/live-bus-times/trip-viewer/destination-line-dark@2x.png");
        }
    }

    @media (-webkit-min-device-pixel-ratio: 3), (min-resolution: 288dpi) {
        #trip-steps-content .start {
            background-image: url("/images/live-bus-times/trip-viewer/start-line-dark@3x.png");
        }

        #trip-steps-content .leg-walking-step {
            background-image: url("/images/live-bus-times/trip-viewer/walking-line-dark@3x.png");
        }

        #trip-steps-content .destination {
            background-image: url("/images/live-bus-times/trip-viewer/destination-line-dark@3x.png");
        }
    }
}

@media (max-width: 719px) {
    #trip-steps-content .title {
        font-size: 1.3rem;
    }

    #trip-steps-content .subtitle {
        font-size: 1rem;
    }

    #trip-header .title {
        font-size: 1.3rem;
        font-weight: 700;
        margin-bottom: 0.1rem;
    }

    #trip-steps-content .leg-walking-step {
        margin-left: 10px;
    }

    #trip-steps-content .leg-walking-step p.title {
        margin-bottom: 0.1rem;
    }

    #trip-steps-content .transit-leg-card {
        padding: 4px 16px 16px 16px;
        border-radius: 12px;
    }

    #trip-steps-content .transit-leg-card .route-name {
        font-size: 1.3rem;
        padding: 1.5px 8px 2.5px 8px;
        font-weight: 700;
        border-radius: 5px;
    }

    #trip-steps-content .transit-leg-card .description {
        font-size: 1rem;
    }

    #trip-steps-content .transit-leg-card .details {
        margin-top: 20px;
        display: flex;
    }

    #trip-steps-content .transit-leg-card .details .origin-stop .title,
    #trip-steps-content .transit-leg-card .details .destination-stop .title {
        font-size: 1rem;
    }

    #trip-steps-content .transit-leg-card .details .origin-stop .subtitle,
    #trip-steps-content .transit-leg-card .details .destination-stop .subtitle {
        font-size: 1rem;
    }

    #trip-steps-content .transit-leg-card .details .stay-on-for p {
        font-size: 0.9rem;
    }
}