.wizardPage {
    $border: #f0f1f4;
    $muted: #646970;
    $faint: #8c8f94;


    .wizard {
        background: $white_color;
        border-radius: 18px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
        min-height: 620px;
        display: flex;
        &.withRail {
            display: grid;
            grid-template-columns: 268px minmax(0, 1fr);
        }
    }

    // Rail
    .rail {
        background: #fafbfc;
        border-right: 1px solid $border;
        border-radius: 18px 0 0 18px;
        padding: 26px 22px;
        display: flex;
        flex-direction: column;
    }
    .railHead {
        font-size: 11px;
        font-weight: 700;
        letter-spacing: 0.6px;
        text-transform: uppercase;
        color: $faint;
    }
    .steps {
        list-style: none;
        margin: 18px 0 20px;
        padding: 0;
    }
    .step {
        display: flex;
        gap: 12px;
        position: relative;
        margin: 0;
        padding-bottom: 20px;
        &:not(:last-child)::before {
            content: "";
            position: absolute;
            left: 15px;
            top: 34px;
            bottom: 2px;
            width: 2px;
            background: #e7e9ef;
        }
        &.done::before {
            background: $secondary_color;
        }
    }
    .dot {
        width: 32px;
        height: 32px;
        flex: 0 0 32px;
        border-radius: 10px;
        border: 1.5px solid #e2e4ea;
        background: $white_color;
        color: $faint;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        z-index: 1;
        box-sizing: border-box;
    }
    .done .dot {
        background: $secondary_color;
        border-color: $secondary_color;
        color: $white_color;
    }
    .current .dot {
        border-color: $secondary_color;
        background: #eef3ff;
        color: $secondary_color;
        box-shadow: 0 0 0 4px rgba($secondary_color, 0.1);
    }
    .stepText {
        min-width: 0;
    }
    .stepLabel {
        margin-top: 2px;
        font-size: 14px;
        font-weight: 600;
        color: $muted;
    }
    .done .stepLabel,
    .current .stepLabel {
        color: $primary_color;
    }
    .stepDesc {
        margin-top: 2px;
        font-size: 12px;
        line-height: 1.4;
        color: $faint;
        overflow-wrap: anywhere;
    }
    .stepValue {
        display: flex;
        align-items: center;
        gap: 5px;
        font-weight: 500;
        color: $primary_color;
        img {
            width: 15px;
            height: 15px;
            object-fit: contain;
        }
    }
    .subSteps {
        list-style: none;
        margin: 10px 0 0;
        padding: 0;
        li {
            display: flex;
            align-items: center;
            gap: 8px;
            margin: 0;
            padding: 5px 0 5px 10px;
            border-left: 2px solid #e7e9ef;
            font-size: 12.5px;
            color: $faint;
        }
        .subDone {
            color: $primary_color;
            svg {
                color: #1a7f37;
            }
        }
        .subCurrent {
            border-color: $secondary_color;
            color: $secondary_color;
            font-weight: 600;
        }
    }
    .help {
        margin-top: auto;
        display: flex;
        gap: 10px;
        padding: 14px;
        border: 1px solid #eceef2;
        border-radius: 12px;
        background: $white_color;
        font-size: 12.5px;
        line-height: 1.5;
        color: $muted;
        strong {
            display: block;
            margin-bottom: 2px;
            font-size: 13px;
            color: $primary_color;
        }
        a {
            display: inline-flex;
            align-items: center;
            gap: 3px;
            font-weight: 600;
            color: $secondary_color;
            text-decoration: none;
        }
    }
    .helpIcon {
        width: 30px;
        height: 30px;
        flex: 0 0 30px;
        border-radius: 9px;
        background: #eef3ff;
        color: $secondary_color;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    // Main column
    .main {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
    }
    .head {
        display: flex;
        align-items: flex-start;
        gap: 16px;
        padding: 26px 36px 0;
        h1 {
            margin: 4px 0 6px;
            padding: 0;
            font-size: 22px;
            font-weight: 700;
            line-height: 1.3;
            color: $primary_color;
        }
        p {
            margin: 0;
            font-size: 14px;
            line-height: 1.5;
            color: $muted;
            a {
                color: $secondary_color;
                text-decoration: none;
                &:hover {
                    text-decoration: underline;
                }
            }
        }
    }
    .logo {
        width: 56px;
        height: 56px;
        flex: 0 0 56px;
        border-radius: 14px;
        border: 1px solid #eceef2;
        background: $white_color;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
        img {
            max-width: 34px;
            max-height: 34px;
            object-fit: contain;
        }
    }
    .body {
        flex: 1;
        padding: 22px 36px 28px;
        color: $primary_color;
        // Compact form fields (shared inputs default to a larger size).
        label {
            font-size: 13px;
            font-weight: 600;
            color: $primary_color;
        }
        input:not([type="checkbox"]):not([type="radio"]):not(:global(.selectInput-__input)),
        textarea {
            padding: 11px 14px 11px var(--wpmcs-input-pl, 14px) !important;
            font-size: 14px !important;
            border-radius: 10px !important;
        }
        input:not([type="checkbox"]):not([type="radio"]):not(:global(.selectInput-__input)) {
            height: 44px;
        }
        input:global(.selectInput-__input) {
            padding: 0 !important;
        }
        :global(.selectInput-__control) {
            min-height: 44px !important;
            border-radius: 10px !important;
        }
        :global(.selectInput-__value-container) {
            padding: 0 14px 0 var(--wpmcs-input-pl, 14px) !important;
        }
        :global(.selectInput-__single-value),
        :global(.selectInput-__placeholder) {
            font-size: 14px !important;
        }
        p[class*="error"] {
            position: static;
            margin: 6px 0 0;
            text-align: left;
        }
        pre,
        code {
            font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important;
        }
    }
    .foot {
        padding: 16px 36px;
        border-top: 1px solid $border;
        background: #fafbfc;
        border-radius: 0 0 18px 0;
    }
    .wizard:not(.withRail) .foot {
        border-radius: 0 0 18px 18px;
    }

    // Narrow screens: the rail becomes a row of step icons.
    @media screen and (max-width: 960px) {
        .wizard.withRail {
            display: flex;
            flex-direction: column;
        }
        .rail {
            border-right: 0;
            border-bottom: 1px solid $border;
            border-radius: 18px 18px 0 0;
            padding: 16px 20px;
        }
        .steps {
            display: flex;
            align-items: flex-start;
            gap: 8px;
            margin: 12px 0 0;
        }
        .step {
            flex: 1 1 0;
            min-width: 0;
            flex-direction: column;
            align-items: center;
            gap: 6px;
            padding: 0;
            text-align: center;
            &:not(:last-child)::before {
                left: calc(50% + 20px);
                top: 15px;
                bottom: auto;
                width: calc(100% - 32px);
                height: 2px;
            }
        }
        .stepLabel {
            font-size: 12px;
        }
        .stepDesc,
        .subSteps,
        .help {
            display: none;
        }
        .foot {
            border-radius: 0 0 18px 18px;
        }
    }
    @media screen and (max-width: 600px) {
        .stepLabel {
            display: none;
        }
        .current .stepLabel {
            display: block;
            white-space: nowrap;
        }
        .head {
            padding: 20px 18px 0;
            gap: 12px;
            h1 {
                font-size: 19px;
            }
        }
        .logo {
            width: 44px;
            height: 44px;
            flex-basis: 44px;
            img {
                max-width: 28px;
                max-height: 28px;
            }
        }
        .body {
            padding: 18px 18px 22px;
        }
        .foot {
            padding: 14px 18px;
        }
    }
}
