/* ============================================================================
   AiniSpace Onboarding Kit
   Shared multi-step wizard components: stepper, floating fields, searchable
   dropdowns, file upload, validation states, review summary, success state.
   Built on top of ainispace-theme.css tokens — load that file first.
   ========================================================================== */

.wiz-shell {
    min-height: 100vh;
    background: var(--bg-page);
    padding-bottom: 48px;
}

/* ── Header band ─────────────────────────────────────────────────────────── */
.wiz-topbar {
    background: var(--aini-ink);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.wiz-topbar-logo {
    color: #fff;
    font-family: "Plus Jakarta Sans", sans-serif;
    font-weight: 800;
    font-size: 1.15rem;
    text-decoration: none;
    letter-spacing: -.01em;
}

.wiz-topbar-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, .78);
    font-size: .82rem;
    text-decoration: none;
    transition: color .2s;
}

.wiz-topbar-back:hover { color: #fff; }

.wiz-hero {
    background: linear-gradient(135deg, var(--aini-ink) 0%, var(--aini-muted) 55%, var(--aini-neutral) 100%);
    padding: 34px 24px 60px;
    text-align: center;
}

.wiz-hero h1 {
    color: #fff;
    font-family: "Plus Jakarta Sans", sans-serif;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 800;
    margin: 0 0 6px;
}

.wiz-hero p {
    color: rgba(255, 255, 255, .78);
    font-size: .92rem;
    max-width: 480px;
    margin: 0 auto;
}

/* ── Trust badges ─────────────────────────────────────────────────────────── */
.wiz-trust-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 18px;
}

.wiz-trust-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .22);
    color: #fff;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: .76rem;
    font-weight: 600;
}

/* ── Wizard container / card ────────────────────────────────────────────── */
.wiz-wrap {
    max-width: 760px;
    margin: -32px auto 0;
    padding: 0 16px;
    position: relative;
    z-index: 2;
}

.wiz-card {
    background: var(--bg-surface);
    border-radius: 18px;
    box-shadow: var(--shadow-panel);
    border: 1px solid var(--border);
    overflow: hidden;
}

/* ── Stepper ─────────────────────────────────────────────────────────────── */
.wiz-stepper {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 26px 28px 22px;
    border-bottom: 1px solid var(--border);
    gap: 4px;
    overflow-x: auto;
}

.wiz-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 0;
    position: relative;
}

.wiz-step::before {
    content: '';
    position: absolute;
    top: 15px;
    left: -50%;
    width: 100%;
    height: 2px;
    background: var(--border);
    z-index: 0;
}

.wiz-step:first-child::before { display: none; }

.wiz-step.is-done::before,
.wiz-step.is-active::before { background: var(--aini-accent); }

.wiz-step-circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--bg-surface);
    border: 2px solid var(--border);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .78rem;
    font-weight: 700;
    z-index: 1;
    transition: background .2s, border-color .2s, color .2s;
}

.wiz-step.is-active .wiz-step-circle {
    border-color: var(--aini-accent);
    color: var(--aini-ink);
    box-shadow: 0 0 0 4px rgba(213, 161, 29, .18);
}

.wiz-step.is-done .wiz-step-circle {
    background: var(--aini-accent);
    border-color: var(--aini-accent);
    color: #241c05;
}

.wiz-step-label {
    font-size: .72rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 8px;
    text-align: center;
    max-width: 88px;
    line-height: 1.3;
}

.wiz-step.is-active .wiz-step-label { color: var(--aini-ink); }

@media (max-width: 560px) {
    .wiz-step-label { display: none; }
    .wiz-stepper { padding: 20px 16px; }
}

/* ── Step panels ─────────────────────────────────────────────────────────── */
.wiz-body { padding: 30px 28px 8px; }

.wiz-panel { display: none; }
.wiz-panel.is-active {
    display: block;
    animation: wiz-fade-in .22s ease;
}

@keyframes wiz-fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .wiz-panel.is-active { animation: none; }
    * { scroll-behavior: auto !important; }
}

.wiz-panel-title {
    font-family: "Plus Jakarta Sans", sans-serif;
    font-size: 1.15rem;
    font-weight: 800;
    color: #16211d;
    margin: 0 0 4px;
}

.wiz-panel-sub {
    font-size: .85rem;
    color: var(--text-muted);
    margin: 0 0 22px;
}

/* ── Layout helpers ──────────────────────────────────────────────────────── */
.wiz-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 560px) {
    .wiz-row { grid-template-columns: 1fr; }
}

/* ── Floating-label fields ───────────────────────────────────────────────── */
.wiz-field {
    position: relative;
    margin-bottom: 20px;
}

.wiz-field input,
.wiz-field select,
.wiz-field textarea {
    width: 100%;
    padding: 16px 14px 8px;
    border: 1.5px solid rgba(6, 57, 47, .34);
    box-shadow: inset 0 0 0 1px rgba(6, 57, 47, .04);
    border-radius: 11px;
    background: #fbfcfb;
    font-size: .92rem;
    color: #16211d;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: border-color .18s, box-shadow .18s, background .18s;
    height: 54px;
}

body.aini-shell .wiz-modal .wiz-field input,
body.aini-shell .wiz-modal .wiz-field select,
body.aini-shell .wiz-modal .wiz-field textarea {
    background: #fff !important;
    border: 1.5px solid rgba(6, 57, 47, .34) !important;
    box-shadow: inset 0 0 0 1px rgba(6, 57, 47, .04) !important;
    color: #16211d !important;
}

body.aini-shell .wiz-modal .wiz-field input:focus,
body.aini-shell .wiz-modal .wiz-field select:focus,
body.aini-shell .wiz-modal .wiz-field textarea:focus {
    border-color: var(--aini-ink) !important;
    background: #fff !important;
    box-shadow: 0 0 0 3px rgba(6, 57, 47, .14), inset 0 0 0 1px rgba(6, 57, 47, .03) !important;
}

.wiz-field textarea { height: auto; min-height: 90px; padding-top: 20px; }

.wiz-field label {
    position: absolute;
    left: 14px;
    top: 16px;
    font-size: .92rem;
    color: #355c4f;
    background: transparent;
    pointer-events: none;
    transition: top .16s ease, font-size .16s ease, color .16s ease;
    font-weight: 500;
}

.wiz-field input:focus,
.wiz-field select:focus,
.wiz-field textarea:focus {
    border-color: var(--aini-ink);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(6, 57, 47, .14), inset 0 0 0 1px rgba(6, 57, 47, .03);
}

.wiz-field input:focus ~ label,
.wiz-field textarea:focus ~ label,
.wiz-field input:not(:placeholder-shown) ~ label,
.wiz-field textarea:not(:placeholder-shown) ~ label,
.wiz-field.has-value label,
.wiz-field select ~ label {
    top: 6px;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .02em;
    color: var(--aini-ink);
}

.wiz-field select {
    padding-top: 20px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath fill='none' stroke='%2306392F' stroke-width='2' d='M1 1l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

.wiz-field select ~ label {
    top: 6px;
    font-size: .68rem;
    font-weight: 700;
    color: var(--aini-ink);
}

.wiz-required { color: var(--danger); margin-left: 2px; }

.wiz-hint {
    font-size: .74rem;
    color: var(--text-muted);
    margin-top: -14px;
    margin-bottom: 16px;
    display: block;
}

/* Inline validation */
.wiz-field.is-valid input,
.wiz-field.is-valid select { border-color: var(--success); }

.wiz-field.is-invalid input,
.wiz-field.is-invalid select { border-color: var(--danger); }

.wiz-msg {
    font-size: .76rem;
    margin-top: -14px;
    margin-bottom: 16px;
    display: none;
    align-items: center;
    gap: 5px;
}

.wiz-field.is-valid .wiz-msg.wiz-msg-valid,
.wiz-field.is-invalid .wiz-msg.wiz-msg-invalid { display: flex; }

.wiz-msg-valid { color: var(--success); }
.wiz-msg-invalid { color: var(--danger); }

/* ── Pill / radio groups (gender, document type, etc.) ──────────────────── */
.wiz-pill-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.wiz-pill {
    position: relative;
}

.wiz-pill input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    margin: 0;
}

.wiz-pill span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border: 1.5px solid rgba(6, 57, 47, .22);
    border-radius: 999px;
    font-size: .84rem;
    font-weight: 600;
    color: #16211d;
    background: #fff;
    transition: all .16s;
}

.wiz-pill input:checked ~ span {
    border-color: var(--aini-accent);
    background: rgba(213, 161, 29, .12);
    color: var(--aini-ink);
}

.wiz-pill input:focus-visible ~ span {
    outline: 2px solid var(--aini-accent);
    outline-offset: 2px;
}

/* ── Searchable dropdown (combobox) ─────────────────────────────────────── */
.wiz-combo { position: relative; }

.wiz-combo-list {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 220px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid rgba(6, 57, 47, .18);
    border-radius: 11px;
    box-shadow: var(--shadow-hover);
    z-index: 20;
    display: none;
}

.wiz-combo.is-open .wiz-combo-list { display: block; }

.wiz-combo-option {
    padding: 10px 14px;
    font-size: .88rem;
    color: #16211d;
    cursor: pointer;
}

.wiz-combo-option:hover,
.wiz-combo-option.is-highlighted { background: rgba(213, 161, 29, .12); }

.wiz-combo-empty {
    padding: 12px 14px;
    font-size: .82rem;
    color: var(--text-muted);
}

/* ── File upload dropzone ────────────────────────────────────────────────── */
.wiz-upload {
    border: 1.5px dashed rgba(6, 57, 47, .22);
    border-radius: 14px;
    padding: 22px;
    text-align: center;
    background: #fff;
    cursor: pointer;
    transition: border-color .18s, background .18s;
    position: relative;
    margin-bottom: 20px;
}

.wiz-upload:hover,
.wiz-upload.is-dragover {
    border-color: var(--aini-accent);
    background: rgba(213, 161, 29, .06);
}

.wiz-upload input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.wiz-upload-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(6, 57, 47, .08);
    color: var(--aini-ink);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    font-size: 1.1rem;
}

.wiz-upload-title { font-size: .88rem; font-weight: 700; color: #16211d; margin-bottom: 2px; }
.wiz-upload-sub { font-size: .74rem; color: var(--text-muted); }

.wiz-upload-label {
    font-size: .82rem;
    font-weight: 700;
    color: #16211d;
    margin-bottom: 8px;
    display: block;
}

.wiz-upload.has-file {
    border-style: solid;
    border-color: var(--success);
    background: rgba(46, 138, 104, .06);
    padding: 12px 16px;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 12px;
}

.wiz-upload-preview {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: #fff;
    border: 1px solid var(--border);
}

.wiz-upload-filename {
    font-size: .82rem;
    font-weight: 600;
    color: #16211d;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wiz-upload-check {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--success);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .7rem;
    flex-shrink: 0;
}

.wiz-upload-remove {
    background: none;
    border: none;
    color: var(--danger);
    font-size: .78rem;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
    padding: 4px 8px;
}

.wiz-upload-remove:focus-visible,
.wiz-upload input:focus-visible {
    outline: 2px solid var(--aini-accent);
    outline-offset: 2px;
}

.wiz-upload-bar {
    height: 4px;
    border-radius: 4px;
    background: var(--border);
    overflow: hidden;
    margin-top: 8px;
    display: none;
}

.wiz-upload-bar-fill {
    height: 100%;
    width: 0%;
    background: var(--aini-accent);
    transition: width .2s;
}

.wiz-upload-error {
    font-size: .76rem;
    color: var(--danger);
    margin-top: 6px;
    display: none;
}

/* ── Nav buttons ─────────────────────────────────────────────────────────── */
.wiz-nav {
    display: flex;
    gap: 12px;
    padding: 22px 28px 28px;
    border-top: 1px solid var(--border);
    margin-top: 10px;
}

.wiz-btn {
    flex: 1;
    padding: 14px;
    border-radius: 11px;
    font-size: .92rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: transform .15s, box-shadow .15s, opacity .15s;
    font-family: inherit;
}

.wiz-btn:active { transform: translateY(1px); }

.wiz-btn-primary {
    background: var(--aini-accent);
    color: #241c05;
}

.wiz-btn-primary:hover { box-shadow: 0 8px 18px rgba(213, 161, 29, .32); }
.wiz-btn-primary:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }

.wiz-btn-secondary {
    background: var(--bg-page);
    color: var(--text-muted);
    flex: 0 0 120px;
}

.wiz-btn:focus-visible { outline: 2px solid var(--aini-ink); outline-offset: 2px; }

@media (max-width: 560px) {
    .wiz-nav {
        position: sticky;
        bottom: 0;
        background: var(--bg-surface);
        box-shadow: 0 -6px 16px rgba(0, 0, 0, .06);
        z-index: 10;
    }
}

/* ── Review step ─────────────────────────────────────────────────────────── */
.wiz-review-group {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 14px;
}

.wiz-review-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.wiz-review-head h4 {
    font-family: "Plus Jakarta Sans", sans-serif;
    font-size: .88rem;
    font-weight: 800;
    color: var(--aini-ink);
    margin: 0;
}

.wiz-review-edit {
    font-size: .76rem;
    font-weight: 700;
    color: var(--aini-muted);
    text-decoration: none;
    cursor: pointer;
    background: none;
    border: none;
}

.wiz-review-edit:hover { color: var(--aini-accent); }

.wiz-review-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    font-size: .84rem;
    border-bottom: 1px dashed var(--border);
}

.wiz-review-row:last-child { border-bottom: none; }
.wiz-review-row dt { color: var(--text-muted); flex-shrink: 0; }
.wiz-review-row dd { color: #16211d; font-weight: 600; text-align: right; margin: 0; }

/* ── Success state ───────────────────────────────────────────────────────── */
.wiz-success {
    text-align: center;
    padding: 40px 24px;
}

.wiz-success-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(46, 138, 104, .12);
    color: var(--success);
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
    animation: wiz-pop .3s ease;
}

@keyframes wiz-pop {
    from { transform: scale(.6); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

.wiz-success h2 {
    font-family: "Plus Jakarta Sans", sans-serif;
    font-size: 1.25rem;
    font-weight: 800;
    color: #16211d;
    margin-bottom: 8px;
}

.wiz-success p { font-size: .88rem; color: var(--text-muted); margin-bottom: 4px; }

.wiz-success-ref {
    display: inline-block;
    background: var(--bg-page);
    border-radius: 10px;
    padding: 10px 20px;
    font-family: monospace;
    font-size: .92rem;
    font-weight: 700;
    color: var(--aini-ink);
    margin: 14px 0;
}

/* ── Top-level form alert (network / server error) ──────────────────────── */
.wiz-alert {
    padding: 13px 16px;
    border-radius: 10px;
    font-size: .84rem;
    margin: 0 28px 0;
    display: none;
}

.wiz-alert.is-visible { display: block; margin-top: 20px; }
.wiz-alert-error { background: rgba(164, 74, 56, .1); color: var(--danger); border: 1px solid rgba(164, 74, 56, .3); }
.wiz-alert-success { background: rgba(46, 138, 104, .1); color: var(--success); border: 1px solid rgba(46, 138, 104, .3); }

/* ── Loading spinner (submit state) ──────────────────────────────────────── */
.wiz-spinner {
    display: inline-block;
    width: 15px;
    height: 15px;
    border: 2px solid rgba(36, 28, 5, .3);
    border-top-color: #241c05;
    border-radius: 50%;
    animation: wiz-spin .7s linear infinite;
    margin-right: 7px;
    vertical-align: -2px;
}

@keyframes wiz-spin { to { transform: rotate(360deg); } }

/* ============================================================================
   Section-nav modal pattern (overlay, sidebar with free navigation,
   per-section status: empty / draft / complete)
   ========================================================================== */

.wiz-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(7, 8, 10, .6);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: wiz-overlay-in .2s ease;
}

@keyframes wiz-overlay-in { from { opacity: 0; } to { opacity: 1; } }

.wiz-modal {
    background: #fff;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 1px solid rgba(255, 255, 255, .6);
    border-radius: 20px;
    box-shadow: 0 30px 70px rgba(6, 41, 34, .35);
    width: 100%;
    max-width: 980px;
    height: min(88vh, 760px);
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: wiz-modal-in .25s ease;
    position: relative;
}

.wiz-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    width: 100%;
    min-width: 0;
    min-height: 0;
    flex: 1;
    overflow: hidden;
}

@keyframes wiz-modal-in {
    from { opacity: 0; transform: translateY(14px) scale(.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .wiz-modal-overlay, .wiz-modal { animation: none; }
}

.wiz-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(6, 57, 47, .08);
    border: none;
    color: var(--aini-ink);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    transition: background .15s;
}

.wiz-modal-close:hover { background: rgba(6, 57, 47, .16); }
.wiz-modal-close:focus-visible { outline: 2px solid var(--aini-accent); outline-offset: 2px; }

/* ── Sidebar section list ────────────────────────────────────────────────── */
.wiz-modal-sidebar {
    background: linear-gradient(180deg, #12151a 0%, #07080a 100%);
    border-right: 1px solid rgba(255, 255, 255, .08);
    padding: 24px 14px;
    overflow-y: auto;
    min-height: 0;
}

.wiz-modal-sidebar-title {
    font-family: "Plus Jakarta Sans", sans-serif;
    font-weight: 800;
    font-size: 1rem;
    color: #fff;
    padding: 0 10px 16px;
}

.wiz-side-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 11px 10px;
    border-radius: 11px;
    border: none;
    background: transparent;
    cursor: pointer;
    text-align: left;
    margin-bottom: 2px;
    transition: background .15s;
}

.wiz-side-item:hover { background: rgba(255, 255, 255, .08); }

.wiz-side-item.is-active {
    background: rgba(255, 255, 255, .12);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
}

.wiz-side-status {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .36);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .62rem;
    color: transparent;
    transition: background .2s, border-color .2s, color .2s, transform .2s;
}

.wiz-side-item.is-draft .wiz-side-status {
    border-color: var(--warning);
    background: rgba(201, 149, 40, .15);
}

.wiz-side-item.is-complete .wiz-side-status {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
    animation: wiz-check-pop .3s ease;
}

@keyframes wiz-check-pop {
    0%   { transform: scale(.4); }
    60%  { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.wiz-side-text { flex: 1; min-width: 0; }

.wiz-side-label {
    font-size: .84rem;
    font-weight: 700;
    color: rgba(255, 255, 255, .93);
    display: block;
    line-height: 1.3;
}

.wiz-side-item.is-active .wiz-side-label { color: #fff; }

.wiz-side-sub {
    font-size: .68rem;
    color: rgba(255, 255, 255, .68);
    font-weight: 600;
}

.wiz-side-item.is-draft .wiz-side-sub { color: var(--warning); }
.wiz-side-item.is-complete .wiz-side-sub { color: var(--success); }

.wiz-side-optional {
    font-size: .64rem;
    color: var(--text-muted);
    font-weight: 500;
    font-style: italic;
}

/* ── Right panel (active section content) ───────────────────────────────── */
.wiz-modal-main {
    padding: 30px 34px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    background: linear-gradient(180deg, rgba(250, 252, 251, .98), rgba(245, 248, 246, .98));
}

.wiz-modal-main-head {
    margin-bottom: 20px;
}

.wiz-modal-main-head h2 {
    font-family: "Plus Jakarta Sans", sans-serif;
    font-size: 1.3rem;
    font-weight: 800;
    color: #16211d;
    margin: 0 0 4px;
}

.wiz-modal-main-head p {
    font-size: .85rem;
    color: var(--text-muted);
    margin: 0;
}

.wiz-modal-body { flex: 1; }

.wiz-section-panel { display: none; animation: wiz-fade-in .2s ease; }
.wiz-section-panel.is-active { display: block; }

/* ── Section action bar ──────────────────────────────────────────────────── */
.wiz-section-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

.wiz-sa-primary {
    background: var(--aini-accent);
    color: #241c05;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: .88rem;
    font-weight: 700;
    cursor: pointer;
    transition: box-shadow .15s, transform .15s;
}

.wiz-sa-primary:hover { box-shadow: 0 8px 16px rgba(213, 161, 29, .32); }
.wiz-sa-primary:active { transform: translateY(1px); }
.wiz-sa-primary:focus-visible { outline: 2px solid var(--aini-ink); outline-offset: 2px; }

.wiz-sa-draft {
    background: none;
    border: none;
    color: var(--aini-muted);
    font-size: .84rem;
    font-weight: 700;
    cursor: pointer;
    padding: 12px 10px;
}

.wiz-sa-draft:hover { color: var(--aini-ink); text-decoration: underline; }

.wiz-sa-delete {
    background: none;
    border: none;
    color: var(--danger);
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    padding: 12px 10px;
    margin-left: auto;
}

.wiz-sa-delete:hover { text-decoration: underline; }

.wiz-sa-saved-tick {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: .8rem;
    color: var(--success);
    font-weight: 700;
    opacity: 0;
    transition: opacity .25s;
}

.wiz-sa-saved-tick.is-visible { opacity: 1; }

/* ── Tablet tier: sidebar narrows, fields drop to single column so they
   have room to breathe instead of being squeezed by the fixed sidebar
   width — a real "adaptive" tier, not just a scaled-down desktop. ────── */
@media (max-width: 1024px) and (min-width: 761px) {
    .wiz-layout { grid-template-columns: 200px minmax(0, 1fr); }
    .wiz-modal-sidebar { padding: 20px 10px; }
    .wiz-side-label { font-size: .8rem; }
    .wiz-modal-main { padding: 26px 24px; }
    .wiz-row { grid-template-columns: 1fr; }
}

/* ── Mobile: stack sidebar above content as a scrollable labeled chip
   strip (not just bare status dots — a user needs to see which section
   they're on), sticky footer nav. ────────────────────────────────────── */
@media (max-width: 760px) {
    .wiz-modal-overlay { padding: 0; align-items: flex-start; }
    .wiz-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
        max-width: none;
    }
    .wiz-modal-sidebar {
        border-right: none;
        border-bottom: 1px solid rgba(6, 57, 47, .1);
        display: flex;
        gap: 6px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 12px 12px;
        white-space: nowrap;
        scrollbar-width: thin;
    }
    .wiz-modal-sidebar-title { display: none; }
    .wiz-side-item {
        flex-shrink: 0;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        min-width: 76px;
        min-height: 44px;
        padding: 8px 8px 6px;
        text-align: center;
    }
    .wiz-side-text { display: block; }
    .wiz-side-label {
        font-size: .62rem;
        white-space: normal;
        line-height: 1.2;
        max-width: 72px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .wiz-side-sub { display: none; }
    .wiz-modal-main { padding: 22px 18px 90px; }
    .wiz-section-actions {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: #fff;
        padding: 14px 18px;
        box-shadow: 0 -6px 16px rgba(0,0,0,.08);
        z-index: 20;
        margin-top: 0;
        border-top: none;
    }
    .wiz-sa-primary { flex: 1; min-height: 46px; }
    .wiz-sa-draft, .wiz-sa-delete { min-height: 44px; display: flex; align-items: center; }
}