/* Shared laptop layout for every web install guide. */
@media (min-width: 901px) {
    body.ci-install-shell .ci-wizard {
        display: grid;
        grid-template-columns: minmax(240px, .27fr) minmax(0, 1fr);
        grid-template-rows: min-content min-content minmax(0, 1fr) min-content min-content;
        grid-template-areas:
            "context guide"
            "downloads guide"
            ". guide"
            "progress guide"
            "navigation guide";
        align-content: stretch;
        align-items: stretch;
        column-gap: clamp(.75rem, 1.25vw, 1.15rem);
        row-gap: .45rem;
    }

    body.ci-install-shell .ci-wizard > .install-guide-context {
        grid-area: context;
        display: grid;
        grid-template-columns: 72px minmax(0, 1fr);
        grid-template-areas:
            "media details"
            "change change";
        align-items: center;
        gap: .45rem .6rem;
        min-width: 0;
        min-height: 0;
        align-self: start;
        margin: 0;
        padding: .55rem;
    }

    body.ci-install-shell .ci-wizard .install-guide-context__media {
        grid-area: media;
        box-sizing: border-box;
        width: 100%;
        height: 58px;
        min-width: 0;
        flex: initial;
    }

    body.ci-install-shell .ci-wizard .install-guide-context__details {
        grid-area: details;
        min-width: 0;
    }

    body.ci-install-shell .ci-wizard .install-guide-context__make {
        overflow: visible;
        text-overflow: clip;
    }

    body.ci-install-shell .ci-wizard .install-guide-context__model {
        overflow: visible;
        text-overflow: clip;
        overflow-wrap: anywhere;
    }

    body.ci-install-shell .ci-wizard .install-guide-context__part {
        display: block;
        width: fit-content;
        max-width: 100%;
        white-space: normal;
        overflow-wrap: normal;
        word-break: normal;
        font-size: clamp(.62rem, 1.1vw, .76rem);
        line-height: 1.3;
    }

    body.ci-install-shell .ci-wizard .install-guide-context__change {
        grid-area: change;
        box-sizing: border-box;
        width: 100%;
        min-width: 0;
        min-height: 38px;
        margin: 0;
    }

    body.ci-install-shell .ci-wizard > [data-ci-downloads] {
        grid-area: downloads;
        display: flex;
        align-self: start;
        flex-direction: column;
        gap: .5rem;
        width: 100%;
        margin: 0;
    }

    body.ci-install-shell .ci-wizard > [data-ci-downloads] .ci-button {
        width: 100%;
        min-width: 0;
        min-height: 2.65rem;
        text-align: center;
    }

    body.ci-install-shell .ci-wizard > .ci-progress-wrap {
        grid-area: progress;
        align-self: end;
        width: 100%;
        margin: 0;
    }

    body.ci-install-shell .ci-wizard > .ci-progress-wrap .ci-progress-label {
        gap: .4rem;
        margin-bottom: .25rem;
        font-size: clamp(.68rem, .9vw, .82rem);
    }

    body.ci-install-shell .ci-wizard > [data-ci-wizard] {
        grid-area: guide;
        display: flex;
        min-width: 0;
        min-height: 0;
        height: 100%;
        overflow: hidden;
        margin: 0;
    }

    body.ci-install-shell .ci-wizard-step:not([hidden]) {
        box-sizing: border-box;
        display: flex;
        min-width: 0;
        min-height: 0;
        height: 100%;
        flex: 1 1 auto;
        flex-direction: column;
        gap: .3rem;
        overflow: hidden;
        padding: clamp(.55rem, 1vh, .85rem);
    }

    body.ci-install-shell .ci-wizard-step h3 {
        flex: 0 0 auto;
        margin: 0 0 .2rem;
        font-size: clamp(1.08rem, 1.45vw, 1.4rem);
        line-height: 1.18;
    }

    body.ci-install-shell .ci-wizard-step .ci-stage-images {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
        grid-template-rows: none;
        grid-auto-rows: auto;
        align-content: start;
        min-width: 0;
        min-height: 0;
        height: auto;
        flex: 0 0 auto;
        gap: .5rem;
        margin: .2rem 0 .35rem;
        overflow: visible;
    }

    body.ci-install-shell .ci-wizard-step .ci-step-image {
        display: block;
        box-sizing: border-box;
        width: 100%;
        height: auto;
        min-width: 0;
        min-height: 0;
        flex: none;
        margin: 0;
        overflow: hidden;
    }

    body.ci-install-shell .ci-wizard-step .ci-step-image .install-guide-image-open {
        display: block;
        box-sizing: border-box;
        width: 100%;
        height: auto;
        min-width: 0;
        min-height: 0;
        flex: none;
        overflow: hidden;
    }

    body.ci-install-shell .ci-wizard-step .ci-step-image img {
        display: block;
        width: 100%;
        height: auto;
        min-width: 0;
        min-height: 0;
        max-height: none;
        flex: none;
        object-fit: contain;
    }

    body.ci-install-shell .ci-wizard-step .ci-step-image figcaption {
        flex: 0 0 auto;
    }

    body.ci-install-shell .ci-wizard-step .ci-guide-copy {
        min-width: 0;
        min-height: 0;
        max-height: none;
        flex: 1 1 0;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        margin: .15rem 0 0;
        padding: 0 .35rem .15rem 0;
        font-size: clamp(.9rem, 1vw, .98rem);
        line-height: 1.42;
    }

    body.ci-install-shell .ci-wizard-step .install-guide-video {
        flex: 0 0 auto;
        width: auto;
        margin-top: .15rem;
    }

    body.ci-install-shell .ci-wizard > .ci-stage-actions {
        grid-area: navigation;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: center;
        width: 100%;
        gap: .4rem;
        margin: 0;
    }

    body.ci-install-shell .ci-wizard > .ci-stage-actions .ci-button {
        box-sizing: border-box;
        width: 100%;
        min-width: 0;
        min-height: 2.55rem;
        padding: .4rem .5rem;
        text-align: center;
    }
}
/* Keep long step descriptions fully readable: scroll the complete guide panel, not a nested text box. */
@media (min-width: 901px) {
    body.ci-install-shell .ci-wizard > [data-ci-wizard] {
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    body.ci-install-shell .ci-wizard-step:not([hidden]) {
        height: auto;
        min-height: 100%;
        flex: 0 0 auto;
        overflow: visible;
    }

    body.ci-install-shell .ci-wizard-step .ci-guide-copy {
        max-height: none;
        flex: 0 0 auto;
        overflow: visible;
    }
}
/* Let wheel scrolling over a guide step move the page in every desktop guide. */
@media (min-width: 701px) {
    body.ci-install-shell {
        height: auto;
        min-height: 100svh;
        overflow-x: hidden;
        overflow-y: auto;
    }

    body.ci-install-shell .ci-install-main {
        height: auto;
        min-height: calc(100svh - 58px);
        overflow: visible;
    }

    body.ci-install-shell .ci-install {
        height: auto;
        min-height: calc(100svh - 58px);
        overflow: visible;
    }

    body.ci-install-shell .ci-wrap {
        height: auto;
        min-height: calc(100svh - 74px);
    }

    body.ci-install-shell .ci-wizard {
        height: auto;
        min-height: calc(100svh - 74px);
        overflow: visible;
    }

    body.ci-install-shell .ci-wizard > [data-ci-wizard] {
        height: auto;
        min-height: 0;
        overflow: visible;
    }

    body.ci-install-shell .ci-wizard-step:not([hidden]) {
        height: auto;
        min-height: calc(100svh - 170px);
        flex: 0 0 auto;
        overflow: visible;
    }

    body.ci-install-shell .ci-wizard-step .ci-guide-copy {
        max-height: none;
        flex: 0 0 auto;
        overflow: visible;
    }
}
/* Desktop guide footer: keep the step counter between navigation buttons. */
@media (min-width: 901px) {
    body.ci-install-shell .ci-wizard {
        grid-template-rows: min-content min-content min-content;
        grid-template-areas:
            "context guide"
            "downloads guide"
            "navigation navigation";
    }

    body.ci-install-shell .ci-wizard > .ci-stage-actions {
        grid-template-columns: minmax(120px, auto) minmax(0, 1fr) minmax(120px, auto);
    }

    body.ci-install-shell .ci-wizard > .ci-stage-actions > [data-ci-back] {
        grid-column: 1;
        grid-row: 1;
    }

    body.ci-install-shell .ci-wizard > .ci-stage-actions > .ci-progress-wrap {
        grid-column: 2;
        grid-row: 1;
        width: 100%;
        min-width: 0;
        margin: 0;
    }

    body.ci-install-shell .ci-wizard > .ci-stage-actions > :is([data-ci-next], [data-ci-finish]) {
        grid-column: 3;
        grid-row: 1;
        justify-self: end;
    }

    body.ci-install-shell .ci-wizard-step .ci-guide-copy,
    body.ci-install-shell .ci-wizard-step .install-guide-text {
        font-size: clamp(1rem, 1.05vw, 1.08rem);
    }
}
/* Let mouse-wheel scrolling move through the full desktop guide instead of nested text panes. */
@media (min-width: 701px) {
    body.ci-install-shell .ci-wizard > [data-ci-wizard] {
        height: auto;
        overflow: visible;
        overscroll-behavior: auto;
    }

    body.ci-install-shell .ci-wizard-step:not([hidden]) {
        height: auto;
        min-height: calc(100svh - 170px);
        flex: 0 0 auto;
        overflow: visible;
        overscroll-behavior: auto;
    }

    body.ci-install-shell .ci-wizard-step .ci-guide-copy {
        height: auto;
        max-height: none;
        flex: 0 0 auto;
        overflow: visible;
        overscroll-behavior: auto;
    }
}
/* On landscape desktop, place step controls directly below the guide content column. */
@media (min-width: 901px) and (orientation: landscape) {
    body.ci-install-shell .ci-wizard {
        grid-template-rows: min-content minmax(min-content, 1fr);
        grid-template-areas:
            "context guide"
            "downloads navigation";
        align-content: stretch;
        height: auto;
        min-height: calc(100svh - 74px);
    }

    body.ci-install-shell .ci-wizard > [data-ci-downloads] {
        align-self: end;
    }

    body.ci-install-shell .ci-wizard > .ci-stage-actions {
        grid-column: 2;
        grid-row: 2;
        align-self: end;
        width: 100%;
        margin-top: .5rem;
    }
}
/* Short steps on PC should keep their content height instead of stretching to the viewport. */
@media (min-width: 901px) {
    body.ci-install-shell .ci-wizard-step:not([hidden]) {
        min-height: 0;
    }
}
