/* Preserve the existing breadcrumb, panel-top and history-actions country hooks.
   Position controls only after their translated, country-styled sizes are known. */
:where([data-procedure-navigation="ready"]) .breadcrumbs {
    border-block-end: 0;
}
:where([data-procedure-navigation="ready"]) .panel-top {
    margin-block-end: 0;
}
:where([data-procedure-navigation="ready"]) .history-actions {
    margin-block-end: 0;
}
@media (min-width: 1024px) {
    :where([data-procedure-navigation="ready"] .history-actions) .back-link {
        position: absolute;
        top: var(--procedure-back-top);
        inset-inline-start: var(--procedure-back-start);
        z-index: 2;
    }
    /* Only the title reserves room for controls; the trail uses the full row. */
    :where([data-procedure-navigation="ready"]) .breadcrumbs li:where(:first-child) {
        padding-inline-end: var(--procedure-actions-space, 0px);
        box-sizing: border-box;
    }
    :where([data-procedure-navigation="ready"] .history-actions) .step-actions {
        position: absolute;
        top: var(--procedure-actions-top);
        inset-inline-end: 15px;
        width: max-content;
    }
}
@media (max-width: 1023px) {
    :where([data-procedure-navigation="ready"]) .history-actions {
        justify-content: flex-start;
    }
    :where([data-procedure-navigation="ready"]) .history-actions .step-actions {
        flex-wrap: wrap;
        justify-content: flex-start;
        width: auto;
    }
    :where([data-procedure-navigation="ready"]) .panel-top {
        margin-block-end: 16px;
    }
}

/* Keep the final separator with its label when a long breadcrumb wraps. */
.breadcrumb-trailing-separator {
    color: var(--gray-600);
    margin-inline-start: 8px;
    white-space: nowrap;
}

/* Center both chevrons above the baseline in proportion to the text size. */
:where(app-breadcrumb) .breadcrumbs li + li + li::before,
.breadcrumb-trailing-separator::after {
    content: "";
    display: inline-block;
    box-sizing: border-box;
    flex: none;
    inline-size: 7px;
    block-size: 7px;
    border-block-start: 1px solid currentColor;
    border-inline-end: 1px solid currentColor;
    transform: translate(-2px, calc(50% - 0.3em)) rotate(45deg);
}
:where([dir="rtl"] app-breadcrumb) .breadcrumbs li + li + li::before,
:where([dir="rtl"]) .breadcrumb-trailing-separator::after {
    transform: translate(2px, calc(50% - 0.3em)) rotate(-45deg);
}
