.wizard-shell {
    --wiz-surface: #ffffff;
    --wiz-surface-sub: #f8f9fb;
    --wiz-surface-2: #f3f5f8;
    --wiz-surface-nest: #f3f5f8;
    --wiz-border: #d8dee8;
    --wiz-border-soft: #e9ecef;
    --wiz-text: #212529;
    --wiz-text-muted: #6c757d;
    --wiz-text-soft: #a3a6b1;
    --wiz-accent: #c2622a;
    --wiz-accent-soft: rgba(194, 98, 42, .08);
    --wiz-accent-border: rgba(194, 98, 42, .18);
    --wiz-shadow: 0 1px 3px rgba(0, 0, 0, .06);
    display: flex;
    flex: 1;
    min-height: 0;
    flex-direction: column;
    background: var(--wiz-surface);
    color: var(--wiz-text);
    font-size: 0.875rem;
}

.wizard-shell.theme-dark,
[data-bs-theme="dark"] .wizard-shell {
    --wiz-surface: #1f242c;
    --wiz-surface-sub: #252b34;
    --wiz-surface-2: #2a313b;
    --wiz-surface-nest: #2b313b;
    --wiz-border: #3a4452;
    --wiz-border-soft: #313947;
    --wiz-text: #edf2f7;
    --wiz-text-muted: #c0cad6;
    --wiz-text-soft: #9ca8b8;
    --wiz-accent: #de7c3a;
    --wiz-accent-soft: rgba(222, 124, 58, .16);
    --wiz-accent-border: rgba(222, 124, 58, .28);
    --wiz-shadow: 0 10px 24px rgba(0, 0, 0, .28);
}

.wizard-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: 2.95rem;
    padding: 0.64rem 0.9rem;
    border-bottom: 2px solid var(--wiz-accent-border);
    background: var(--wiz-surface);
}

.wizard-topbar-main {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    flex: 1 1 auto;
    flex-wrap: nowrap;
}

.wizard-topbar-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--wiz-accent);
    white-space: nowrap;
}

.wizard-topbar-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 1.7rem;
    padding: 0 0.62rem;
    border-radius: 0.55rem;
    border: 1px solid var(--wiz-accent-border);
    background: var(--wiz-accent-soft);
    color: var(--wiz-accent);
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}

.wizard-topbar-context-title {
    color: var(--wiz-text-muted);
    font-size: 0.84rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 16rem;
}

.wizard-topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-left: auto;
}

.wizard-topbar-actions .btn-close:not(.app-modal-close-btn) {
    font-size: 1.05rem;
    padding: 0.1rem;
}

.wizard-scroll-shell {
    display: flex;
    flex: 1;
    min-height: 0;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.56rem 0.78rem;
    background: var(--wiz-surface);
}

.wizard-panel-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    background: var(--wiz-surface);
}

.wizard-body {
    min-height: 100%;
    padding-bottom: 0.2rem;
}

.wizard-stepper-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    flex-wrap: wrap;
    padding: 0.64rem 0.78rem;
    border: 1px solid var(--wiz-border);
    border-radius: 0.82rem;
    background: var(--wiz-surface);
    box-shadow: var(--wiz-shadow);
}

.wizard-stepper-steps {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: nowrap;
    flex: 0 0 auto;
    min-width: 0;
}

.wizard-step-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    min-height: 1.875rem;
    padding: 0 0.8125rem;
    border-radius: 999px;
    border: 1px solid var(--wiz-border);
    background: var(--wiz-surface-sub);
    color: var(--wiz-text-muted);
    font-size: 0.75rem;
    font-weight: 600;
}

.wizard-step-btn.active {
    background: var(--wiz-accent);
    border-color: var(--wiz-accent);
    color: #ffffff;
}

.wizard-step-btn.completed,
.wizard-step-btn.completed-soft {
    background: rgba(25, 135, 84, .08);
    border-color: rgba(25, 135, 84, .18);
    color: #157347;
}

.wizard-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.125rem;
    height: 1.125rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, .1);
    font-size: 0.6875rem;
}

.wizard-step-btn.active .wizard-step-num {
    background: rgba(255, 255, 255, .25);
}

.wizard-step-label {
    white-space: nowrap;
}

.wizard-stepper-context {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: nowrap;
    flex: 1 0 32rem;
    justify-content: flex-end;
    min-width: 0;
}

.wizard-step-card {
    border: 1px solid var(--wiz-border);
    border-radius: 0.62rem;
    background: var(--wiz-surface);
    box-shadow: var(--wiz-shadow);
}

.wizard-step-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 0.58rem 0.78rem;
    border-bottom: 1px solid var(--wiz-border-soft);
    background: var(--wiz-surface-sub);
}

.wizard-step-card-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--wiz-text);
}

.wizard-step-card-subtitle {
    margin-top: 0.1rem;
    font-size: 0.78rem;
    color: var(--wiz-text-muted);
    line-height: 1.35;
}

.wizard-step-card-body {
    padding: 0.72rem 0.78rem 0.82rem;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.wizard-footer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: space-between;
    padding: 0.625rem 1.125rem 0.75rem;
    border-top: 1px solid var(--wiz-border);
    background: var(--wiz-surface);
    box-shadow: 0 -3px 12px rgba(0, 0, 0, .06);
    flex-shrink: 0;
}

.wizard-footer-start,
.wizard-footer-end {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.wizard-footer-end {
    margin-inline-start: auto;
}

.wizard-footer .btn {
    font-size: 0.8125rem;
    line-height: 1.3;
    padding: 0.42rem 0.9rem;
}

.wizard-footer .btn-primary,
.wizard-footer .btn-secondary {
    min-width: 6.75rem;
}

@media (max-width: 768px) {
    .wizard-topbar,
    .wizard-scroll-shell,
    .wizard-footer {
        padding-left: 0.7rem;
        padding-right: 0.7rem;
    }

    .wizard-topbar-main {
        flex-wrap: wrap;
    }

    .wizard-stepper-context {
        flex-basis: 100%;
        justify-content: flex-start;
    }
}
