.route-intro {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 0 0 16px;
}

.route-intro-icon {
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
    margin-top: 2px;
    object-fit: contain;
}
@media (prefers-color-scheme: dark) {
    .route-intro-icon {
        opacity: 1;
    }
}

.route-intro-title {
    margin: 0 0 4px;
    font-size: 18px;
    font-weight: 750;
    letter-spacing: -0.02em;
}

.route-intro-lead {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.4;
}

.route-back {
    margin: 18px 0 0;
    font-size: 14px;
}

.route-back a {
    color: var(--blue);
    text-decoration: none;
    font-weight: 650;
}

.route-back a:hover { text-decoration: underline; }

.search.is-complex {
    flex-direction: column;
    gap: 10px;
}

.complex-segments {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.complex-leg {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    background: var(--card);
    border-radius: 18px;
    box-shadow: var(--shadow);
    overflow: visible;
}

.complex-leg-label {
    padding: 10px 48px 0 14px;
    font-size: 13px;
    font-weight: 650;
    color: var(--muted);
}

.complex-leg-remove {
    position: absolute;
    top: 8px;
    right: 10px;
    z-index: 2;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: var(--field);
    color: var(--muted);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.complex-leg-remove:hover { color: var(--danger); }

.complex-leg .cities {
    display: flex;
    flex-direction: column;
    background: transparent;
    box-shadow: none;
    min-width: 0;
}

.complex-leg .when {
    background: transparent;
    box-shadow: none;
    border-top: 1px solid var(--line);
    border-radius: 0 0 18px 18px;
    min-width: 0;
}

.complex-leg .when .choice {
    border-radius: 0 0 18px 18px;
    width: 100%;
}

.add-leg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: flex-start;
    min-height: 44px;
    margin: 0;
    padding: 0 16px;
    border: 1.5px dashed var(--line);
    border-radius: 14px;
    background: transparent;
    color: var(--blue);
    font-size: 14px;
    font-weight: 650;
    cursor: pointer;
}

.add-leg:hover {
    border-color: var(--blue);
    background: var(--soft);
}

.complex-footer {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

@media (min-width: 920px) {
    .search.is-complex {
        flex-direction: column;
        flex-wrap: nowrap;
    }

    .complex-leg {
        flex-direction: row;
        align-items: stretch;
        min-height: clamp(52px, 4.4vw, 64px);
    }

    .complex-leg-label {
        display: flex;
        align-items: center;
        flex: 0 0 auto;
        padding: 0 4px 0 14px;
        white-space: nowrap;
        font-size: 12px;
    }

    .complex-leg .cities {
        display: flex;
        flex-direction: row;
        flex: 2.4 1 0;
        align-items: stretch;
    }

    .complex-leg .cities .field { flex: 1 1 0; }

    .complex-leg .cities .row,
    .complex-leg .when .choice {
        border-bottom: 0;
        min-height: clamp(52px, 4.4vw, 64px);
        height: 100%;
    }

    .complex-leg .cities .field:first-child .row {
        border-bottom: 0;
        border-radius: 0;
    }

    .complex-leg .cities .field:last-child .row {
        border-radius: 0;
        box-shadow: inset 1px 0 0 var(--line);
        padding-left: clamp(16px, 1.6vw, 22px);
    }

    .complex-leg .when {
        flex: 1.1 1 0;
        border-top: 0;
        border-radius: 0;
        box-shadow: inset 1px 0 0 var(--line);
    }

    .complex-leg .when .choice {
        border-radius: 0;
    }

    .complex-leg-remove {
        position: static;
        flex: 0 0 auto;
        align-self: center;
        margin: 0 10px 0 6px;
    }

    .complex-leg:not(:has(.complex-leg-remove)) .when .choice {
        border-radius: 0 18px 18px 0;
    }

    .complex-footer {
        flex-direction: row;
        align-items: stretch;
        flex-wrap: nowrap;
    }

    .complex-footer .who {
        flex: 1 1 auto;
        min-width: 0;
    }

    .complex-footer .find {
        flex: 0 0 auto;
        align-self: stretch;
        height: auto;
        min-height: 52px;
        padding: 0 clamp(16px, 1.5vw, 28px);
    }
}
