.modal-content:has(.project-wizard) {
    border: 0;
    border-radius: 18px;
    overflow: hidden;
    max-height: calc(100vh - 40px);
}

#frame_modal:has(.project-wizard) {
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: calc(100vh - 40px);
}

.project-wizard {
    display: flex;
    flex-direction: column;
    height: min(920px, calc(100vh - 40px));
    min-height: 0;
    background: #fff;
    color: #25313f;
}

.project-wizard-header {
    height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    border-bottom: 1px solid #dfe5ec;
}

.project-wizard-header h2 { 
    margin: 0;
    font-size: 30px;
    font-weight: 800;
}

.project-wizard-close {
    border: 0;
    background: transparent;
    color: #777;
    font-size: 52px;
    line-height: 1;
}

.project-wizard-shell {
    display: grid;
    grid-template-columns: 300px 1fr;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.project-wizard-sidebar {
    display: flex;
    flex-direction: column;
    gap: 58px;
    padding: 32px;
    background: #f5f7fb;
    border-right: 1px solid #dfe5ec;
    min-height: 0;
    overflow-y: auto;
}

.project-wizard-card {
    background: #fff;
    border: 1px solid #e1e7ef;
    border-radius: 18px;
    padding: 26px;
}

.project-wizard-intro {
    min-height: 164px;
}

.project-wizard-eyebrow {
    display: flex;
    gap: 12px;
    align-items: center;
    color: #48ad64;
    font-weight: 800;
    margin-bottom: 18px;
}

.project-wizard-avatar {
    width: 68px;
    height: 68px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #edf2fa;
    color: #64748b;
    font-weight: 800;
    font-size: 22px;
}

.project-wizard-section-title {
    color: #617182;
    font-weight: 800;
    margin-bottom: 24px;
}

.project-wizard-progress {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.project-wizard-progress-item {
    display: grid;
    grid-template-columns: 48px 1fr;
    align-items: center;
}

.project-wizard-progress-dot {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #d4deea;
    color: #64748b;
    font-weight: 800;
    background: #fff;
}

.project-wizard-progress-item.is-active .project-wizard-progress-dot {
    background: #0f172a;
    color: #fff;
    border-color: #0f172a;
}

.project-wizard-progress-item.is-done .project-wizard-progress-dot {
    background: #52bd7b;
    color: #fff;
    border-color: #52bd7b;
}

.project-wizard-progress-label,
.project-wizard-progress-subtitle {
    display: block;
}

.project-wizard-progress-label {
    font-size: 24px;
    font-weight: 800;
    color: #111827;
}

.project-wizard-progress-subtitle {
    color: #607386;
    font-size: 20px;
}

.project-wizard-cancel {
    margin-top: auto;
    font-size: 22px;
}

.project-wizard-main {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.project-wizard-main > form {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}

.project-wizard-content {
    padding: 20px;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.project-wizard-title {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    margin-bottom: 36px;
}

.project-wizard-title > span {
    font-size: 34px;
    line-height: 1.1;
}

.project-wizard-title h3 {
    margin: 0;
    font-size: 38px;
    font-weight: 850;
}

.project-wizard-title h4 {
    margin: 0;
    font-size: 30px;
    font-weight: 850;
}

.project-wizard-title p {
    margin: 8px 0 0;
    font-size: 24px;
    color: #65778a;
}

.project-wizard-title-sm {
    margin-bottom: 18px;
}

.project-wizard .form-control,
.project-wizard .form-select,
.project-wizard .input-group-text {
    border-color: #dde5ee;
    border-radius: 12px;
}

.project-wizard .form-control-lg,
.project-wizard .form-select-lg,
.project-wizard .input-group-lg > .form-control,
.project-wizard .input-group-lg > .input-group-text {
    min-height: 32px;
}

.project-wizard-textarea {
    min-height: 200px;
    font-size: 18px;
}

.project-wizard-switch {
    border: 1px solid #dde5ee;
    border-radius: 18px;
    padding: 26px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.project-wizard-switch .form-check-input {
    width: 48px;
    height: 28px;
}

.project-upload-zone {
    min-height: 340px;
    border: 2px dashed #c9d7eb;
    border-radius: 18px;
    background: #fbfcff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    text-align: center;
    cursor: pointer;
}

.project-upload-zone.is-invalid {
    border-color: var(--bs-danger);
}

.project-upload-icon,
.project-choice-icon {
    width: 86px;
    height: 86px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eef2ff;
    color: #4d7cff;
    font-size: 38px;
}

.project-upload-title {
    font-size: 24px;
}

.project-upload-link {
    font-size: 22px;
    color: #25313f;
    text-decoration: underline;
}

.project-upload-name {
    color: #607386;
    font-size: 20px;
}

.project-wizard-advice {
    border: 1px solid #f6d673;
    border-radius: 18px;
    padding: 28px;
}

.project-import-panel {
    background: #f6f7f9;
    border-radius: 20px;
    padding: 28px;
}

.project-import-panel h4 {
    font-size: 30px;
    font-weight: 850;
    margin-bottom: 26px;
}

.project-choice-card {
    min-height: 290px;
    border: 2px solid #dde5ee;
    border-radius: 18px;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    cursor: pointer;
    text-align: center;
}

.project-choice-card.is-selected {
    border-color: #4d7cff;
    box-shadow: 0 0 0 3px rgba(77, 124, 255, .14);
}

.project-choice-card strong {
    font-size: 28px;
    color: #000;
}

.project-choice-card span:last-child {
    font-size: 22px;
    color: #607386;
}

.project-choice-icon-purple {
    background: #efe7ff;
    color: #7c4dff;
}

.project-choice-icon-green {
    background: #effdf4;
    color: #49ad62;
}

.project-import-check {
    min-height: 70px;
    border: 1px solid #dde5ee;
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    font-size: 22px;
    color: #8a97a6;
}

.project-import-check input {
    width: 24px;
    height: 24px;
}

.project-wizard-footer {
    min-height: 86px;
    border-top: 1px solid #dfe5ec;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 36px;
}

.project-wizard-next {
    background: #50b976;
    border: 0;
    color: #fff;
    border-radius: 12px;
    padding: 16px 30px;
    font-weight: 800;
}

.text-purple {
    color: #7c4dff;
}

@media (max-width: 992px) {
    .project-wizard-shell {
        grid-template-columns: 1fr;
        overflow-y: auto;
    }

    .project-wizard-sidebar {
        gap: 20px;
        overflow: visible;
    }

    .project-wizard-progress {
        gap: 16px;
    }
}

/* Match the partner wizard while retaining the project form's scroll layout. */
.project-wizard.partner-simulation-modal {
    background: var(--bs-tertiary-bg);
    color: var(--bs-body-color);
}
.project-wizard.partner-simulation-modal .project-wizard-shell { grid-template-columns: 296px minmax(0, 1fr); }
.project-wizard.partner-simulation-modal .project-wizard-sidebar {
    gap: 1.25rem;
    padding: 1.5rem;
    background: var(--bs-tertiary-bg);
    border-color: var(--simulation-border);
}
.project-wizard.partner-simulation-modal .project-wizard-card {
    padding: 1rem;
    border-color: var(--simulation-border);
    border-radius: 14px;
    background: var(--bs-body-bg);
    box-shadow: 0 3px 14px rgba(25, 65, 52, .035);
}
.project-wizard.partner-simulation-modal .project-wizard-main { margin: 1rem; }
.project-wizard.partner-simulation-modal .project-wizard-content {
    padding: 1.5rem;
    border: 1px solid var(--simulation-border);
    border-radius: 18px;
    background: var(--bs-body-bg);
    box-shadow: 0 3px 14px rgba(25, 65, 52, .035);
}
.project-wizard.partner-simulation-modal .project-wizard-title {
    gap: .8rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--simulation-border);
}
.project-wizard.partner-simulation-modal .project-wizard-title > span {
    display: grid;
    place-items: center;
    min-width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--simulation-tint);
    color: var(--simulation-accent);
    font-size: 1.35rem;
}
.project-wizard.partner-simulation-modal .project-wizard-title :is(h3, h4) { font-size: 1.2rem; font-weight: 700; }
.project-wizard.partner-simulation-modal .project-wizard-title p { margin: .25rem 0 0; font-size: .85rem; color: var(--bs-secondary-color); }
.project-wizard.partner-simulation-modal .project-wizard-progress { gap: .5rem; }
.project-wizard.partner-simulation-modal .project-wizard-progress-item {
    gap: .75rem;
    padding: .65rem;
    border: 1px solid transparent;
    border-radius: 11px;
    color: var(--bs-secondary-color);
}
.project-wizard.partner-simulation-modal .project-wizard-progress-label { font-size: .85rem; }
.project-wizard.partner-simulation-modal .project-wizard-progress-dot {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    border: 1px solid var(--simulation-border);
    border-radius: 10px;
    background: var(--bs-body-bg);
    color: var(--bs-secondary-color);
    font-size: .8rem;
}
.project-wizard.partner-simulation-modal .project-wizard-progress-item.is-active {
    border-color: #a7c9bf;
    box-shadow: inset 3px 0 0 var(--simulation-accent);
    color: var(--simulation-accent);
}
.project-wizard.partner-simulation-modal .is-active .project-wizard-progress-dot {
    background: var(--simulation-accent);
    border-color: var(--simulation-accent);
    color: #fff;
}
.project-wizard.partner-simulation-modal .is-done .project-wizard-progress-dot,
.project-wizard.partner-simulation-modal .project-wizard-avatar {
    background: var(--simulation-tint);
    color: var(--simulation-accent);
    border-color: #c8ded6;
}
.project-wizard.partner-simulation-modal .project-wizard-footer {
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: .75rem;
    min-height: auto;
    padding: 1rem 1.5rem;
    background: var(--bs-body-bg);
    border-color: var(--simulation-border);
    box-shadow: 0 -6px 20px rgba(20, 45, 40, .05);
}
.project-wizard.partner-simulation-modal .project-wizard-footer .btn { border-radius: 10px; padding: .7rem 1.15rem; font-weight: 600; }
@media (max-width: 991.98px) {
    .project-wizard.partner-simulation-modal .project-wizard-shell { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; }
    .project-wizard.partner-simulation-modal .project-wizard-sidebar { max-height: 24vh; overflow-y: auto; border-right: 0; border-bottom: 1px solid var(--simulation-border); }
    .project-wizard.partner-simulation-modal .project-wizard-content { padding: 1rem; border-radius: 12px; }
    .project-wizard.partner-simulation-modal .project-wizard-footer { padding: 1rem; }
}
