/*
 * Layout:
 *   [ Title                         ] [ Buttons (top-right) ]
 *   [ Status flow under title       ]
 */
.form-toolbar:has(.gs-doc-header),
.jv-card-header:has(.gs-doc-header) {
    align-items: flex-start;
}

.gs-doc-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0.2rem;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
}

.form-toolbar > .gs-doc-header,
.jv-card-header > .gs-doc-header {
    flex: 1 1 auto;
    min-width: 0;
    max-width: calc(100% - 0.75rem);
}

.form-toolbar:has(.gs-doc-header) > .toolbar-actions,
.jv-card-header:has(.gs-doc-header) > .toolbar-actions {
    flex: 0 0 auto;
    margin-left: auto;
    align-self: flex-start;
}

.gs-doc-header > .rz-text,
.gs-doc-header > .jv-card-title,
.gs-doc-header .gs-doc-header__title {
    margin: 0 !important;
    line-height: 1.25 !important;
}

.gs-status-flow {
    width: 100%;
    max-width: 32rem;
    min-width: 0;
    margin: 0;
    box-sizing: border-box;
}

.gs-status-flow .gs-status-flow-stepper,
.gs-status-flow .mud-stepper {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

/* Indicator only */
.gs-status-flow .mud-stepper-content,
.gs-status-flow .mud-stepper-complete,
.gs-status-flow .mud-stepper-actions {
    display: none !important;
}

.gs-status-flow .mud-stepper-nav {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    align-items: center;
    box-sizing: border-box;
}
.mud-stepper-nav2 {
    width: 70%;
    max-width: 100%;
    min-width: 0;
    align-items: center;
    box-sizing: border-box;
}

/* Compact single-row steps (icon + label) */
.gs-status-flow .mud-stepper-nav .mud-step {
    flex: 1 1 0 !important;
    flex-basis: 0 !important;
    min-width: 0 !important;
    padding: 0 !important;
    box-sizing: border-box;
}

.gs-status-flow .mud-step-label {
    width: 100%;
    min-width: 0;
    gap: 0.25rem !important;
    height: auto !important;
}

.gs-status-flow .mud-step-label-icon {
    width: 1.125rem !important;
    height: 1.125rem !important;
    font-size: 0.625rem !important;
}

.gs-status-flow .mud-step-label-icon .mud-icon-root,
.gs-status-flow .mud-step-label-icon .mud-svg-icon {
    font-size: 0.75rem !important;
    width: 0.75rem !important;
    height: 0.75rem !important;
}

.gs-status-flow .mud-step-label-content {
    width: auto !important;
    min-width: 0;
    overflow: hidden;
}

.gs-status-flow .mud-step-label-content-title {
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.6875rem !important;
    font-weight: 600;
    line-height: 1.125rem !important;
}

.gs-status-flow .mud-stepper-nav-connector {
    flex: 0.25 1 0.5rem;
    min-width: 0.35rem;
    max-width: 1.25rem;
    margin: 0 -0.15rem !important;
    align-self: center !important;
}

.gs-status-flow .mud-stepper-nav-connector-line {
    border-top-width: 1px !important;
}

.gs-status-flow.is-rejected .mud-step.active .mud-step-label-content {
    color: var(--mud-palette-error, #dc2626);
}

@media (max-width: 767.98px) {
    .gs-status-flow {
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .gs-status-flow .mud-stepper-nav {
        min-width: 20rem;
    }

    .gs-status-flow .mud-step-label-content-title {
        font-size: 0.625rem !important;
    }
}
