.profile-builder-demo-modal {
    --profile-demo-brand: #4154f1;
    --profile-demo-brand-soft: #eef2ff;
    --profile-demo-border: #dfe7f3;
    --profile-demo-heading: #0b1220;
    --profile-demo-muted: #536174;
}

.profile-builder-demo-modal .modal-dialog {
    max-width: 1120px;
    width: calc(100% - 32px);
}

.profile-builder-demo-modal .modal-content {
    border: 0;
    border-radius: 16px;
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.24);
    max-height: calc(100vh - 32px);
    overflow: hidden;
}

.profile-demo-header {
    align-items: flex-start;
    border-bottom-color: var(--profile-demo-border);
    padding: 20px 24px 18px;
}

.profile-demo-header h2 {
    color: var(--profile-demo-heading);
    font-size: clamp(1.35rem, 2.4vw, 2rem);
    font-weight: 800;
    margin: 2px 0 4px;
}

.profile-demo-header p {
    color: var(--profile-demo-muted);
    margin: 0;
}

.profile-demo-eyebrow {
    color: var(--profile-demo-brand, #4154f1);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.profile-demo-body {
    overflow: auto;
    padding: 20px 24px;
}

.profile-demo-stage {
    display: grid;
    gap: 18px;
    grid-template-columns: 190px minmax(0, 1fr);
    min-height: 460px;
}

.profile-demo-steps {
    align-self: stretch;
    background: #f8fafc;
    border: 1px solid var(--profile-demo-border);
    border-radius: 12px;
    display: grid;
    gap: 6px;
    padding: 12px;
}

.profile-demo-step {
    align-items: center;
    border-radius: 9px;
    color: var(--profile-demo-muted);
    display: grid;
    gap: 10px;
    grid-template-columns: 32px 1fr;
    padding: 8px;
}

.profile-demo-step span,
.profile-demo-panel-heading > span {
    align-items: center;
    background: var(--profile-demo-brand-soft);
    border-radius: 50%;
    color: var(--profile-demo-brand, #4154f1);
    display: inline-flex;
    font-weight: 800;
    height: 32px;
    justify-content: center;
    width: 32px;
}

.profile-demo-step.is-active {
    background: var(--profile-demo-brand-soft);
    color: var(--profile-demo-heading);
}

.profile-demo-step.is-active span,
.profile-demo-step.is-complete span,
.profile-demo-panel-heading > span {
    background: var(--profile-demo-brand, #4154f1);
    color: #fff;
}

.profile-demo-workspace {
    border: 1px solid var(--profile-demo-border);
    border-radius: 12px;
    min-height: 460px;
    overflow: hidden;
    padding: clamp(18px, 3vw, 28px);
    position: relative;
}

.profile-demo-panel {
    display: none;
}

.profile-demo-panel.is-active {
    display: block;
}

.profile-demo-panel-heading {
    align-items: flex-start;
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.profile-demo-panel-heading h3 {
    color: var(--profile-demo-heading);
    font-size: 1.3rem;
    font-weight: 800;
    margin: 0;
}

.profile-demo-panel-heading p {
    color: var(--profile-demo-muted);
    margin: 3px 0 0;
}

.profile-demo-kind-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.profile-demo-kind {
    align-items: center;
    border: 1px solid var(--profile-demo-border);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: center;
    min-height: 145px;
    padding: 14px 10px;
    text-align: center;
}

.profile-demo-kind i {
    color: var(--profile-demo-heading);
    font-size: 1.65rem;
}

.profile-demo-kind small {
    color: var(--profile-demo-muted);
}

.profile-demo-kind.is-selected {
    background: #f7f5ff;
    border-color: var(--profile-demo-brand, #4154f1);
    box-shadow: inset 0 0 0 1px var(--profile-demo-brand, #4154f1);
}

.profile-demo-faux-action {
    float: right;
    margin-top: 22px;
    pointer-events: none;
}

.profile-demo-label {
    color: var(--profile-demo-heading);
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.profile-demo-label-spaced {
    margin-top: 16px;
}

.profile-demo-input,
.profile-demo-select,
.profile-demo-textarea {
    background: #fff;
    border: 1px solid #ced4da;
    border-radius: 7px;
    color: #212529;
    min-height: 42px;
    padding: 9px 12px;
}

.profile-demo-caret {
    animation: profile-demo-caret 0.8s step-end infinite;
    border-left: 1px solid var(--profile-demo-heading);
    display: inline-block;
    height: 1.1em;
    margin-left: 2px;
    vertical-align: -2px;
}

.profile-demo-link-row {
    display: grid;
    gap: 10px;
    grid-template-columns: 155px minmax(0, 1fr);
}

.profile-demo-select {
    display: flex;
    justify-content: space-between;
}

.profile-demo-knowledge-card {
    border: 1px solid var(--profile-demo-border);
    border-radius: 10px;
    padding: 16px;
}

.profile-demo-textarea {
    min-height: 94px;
}

.profile-demo-generation-list {
    display: grid;
    gap: 10px;
}

.profile-demo-generation-list > div {
    align-items: center;
    background: #f8fafc;
    border: 1px solid var(--profile-demo-border);
    border-radius: 9px;
    color: var(--profile-demo-muted);
    display: grid;
    gap: 12px;
    grid-template-columns: 24px 1fr 24px;
    padding: 12px 14px;
}

.profile-demo-generation-list > div.is-complete {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}

.profile-demo-generation-list b {
    color: var(--profile-demo-brand, #4154f1);
    text-align: center;
}

.profile-demo-generation-list .is-complete b {
    color: #16a34a;
}

.profile-demo-generation-track,
.profile-demo-mobile-track {
    background: #e5e7eb;
    border-radius: 99px;
    display: block;
    height: 6px;
    margin-top: 18px;
    overflow: hidden;
}

.profile-demo-generation-track span,
.profile-demo-mobile-track span {
    background: var(--profile-demo-brand, #4154f1);
    display: block;
    height: 100%;
    transform: scaleX(0);
    transform-origin: left center;
}

.profile-demo-review-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.profile-demo-review-wide {
    grid-column: 1 / -1;
}

.profile-demo-textarea-short {
    font-size: 0.9rem;
    min-height: 66px;
}

.profile-demo-chip-list {
    border: 1px solid #ced4da;
    border-radius: 7px;
    min-height: 42px;
    padding: 7px 8px;
}

.profile-demo-chip-list span {
    background: var(--profile-demo-brand-soft);
    border-radius: 99px;
    color: #3342b5;
    display: inline-block;
    font-size: 0.78rem;
    margin: 1px 3px 1px 0;
    padding: 4px 8px;
}

.profile-demo-claim {
    align-items: center;
    color: var(--profile-demo-muted);
    display: flex;
    font-size: 0.9rem;
    gap: 8px;
    margin-top: 14px;
}

.profile-demo-claim > span {
    align-items: center;
    border: 1px solid #adb5bd;
    border-radius: 4px;
    color: transparent;
    display: inline-flex;
    height: 20px;
    justify-content: center;
    width: 20px;
}

.profile-demo-claim.is-checked > span {
    background: var(--profile-demo-brand, #4154f1);
    border-color: var(--profile-demo-brand, #4154f1);
    color: #fff;
}

.profile-demo-complete {
    padding: 54px 20px 20px;
    text-align: center;
}

.profile-demo-complete-icon {
    align-items: center;
    background: #dcfce7;
    border-radius: 50%;
    color: #15803d;
    display: inline-flex;
    font-size: 1.6rem;
    height: 64px;
    justify-content: center;
    margin-bottom: 14px;
    width: 64px;
}

.profile-demo-complete h3 {
    color: var(--profile-demo-heading);
    font-size: 1.65rem;
    font-weight: 800;
}

.profile-demo-complete > p {
    color: var(--profile-demo-muted);
}

.profile-demo-complete-list {
    display: grid;
    gap: 10px;
    margin: 22px auto 0;
    max-width: 560px;
    text-align: left;
}

.profile-demo-complete-list > div {
    align-items: center;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 9px;
    display: flex;
    gap: 12px;
    padding: 12px 14px;
}

.profile-demo-complete-list > div > i {
    color: #15803d;
    font-size: 1.3rem;
}

.profile-demo-complete-list span {
    display: flex;
    flex-direction: column;
}

.profile-demo-complete-list small {
    color: var(--profile-demo-muted);
}

.profile-demo-result {
    padding: 0;
}

.profile-demo-result-heading {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.profile-demo-result-heading span {
    color: var(--profile-demo-brand, #4154f1);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.profile-demo-result-heading h3 {
    color: var(--profile-demo-heading);
    font-size: 1.1rem;
    margin: 0;
}

.profile-demo-result-browser {
    border: 1px solid var(--profile-demo-border);
    border-radius: 11px;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.12);
    overflow: hidden;
}

.profile-demo-result-browser-bar {
    align-items: center;
    background: #fff;
    border-bottom: 1px solid var(--profile-demo-border);
    display: flex;
    gap: 6px;
    min-height: 34px;
    padding: 0 12px;
    position: relative;
}

.profile-demo-result-browser-bar > span {
    background: #d8e0eb;
    border-radius: 50%;
    height: 7px;
    width: 7px;
}

.profile-demo-result-browser-bar strong {
    color: var(--profile-demo-heading);
    font-size: 0.72rem;
    left: 50%;
    position: absolute;
    transform: translateX(-50%);
}

.profile-demo-result-page {
    background: linear-gradient(145deg, #f5fbff 0%, #e7f3fb 48%, #f8fafc 100%);
    min-height: 365px;
    padding: 22px 302px 20px 20px;
    position: relative;
}

.profile-demo-result-profile {
    margin: 0 auto;
    max-width: 520px;
    text-align: center;
}

.profile-demo-result-avatar {
    align-items: center;
    background: #fff;
    border: 1px solid #dce6f2;
    border-radius: 50%;
    box-shadow: 0 7px 18px rgba(15, 23, 42, 0.12);
    color: var(--profile-demo-brand, #4154f1);
    display: inline-flex;
    font-size: 1.25rem;
    height: 58px;
    justify-content: center;
    width: 58px;
}

.profile-demo-result-profile h4 {
    color: var(--profile-demo-heading);
    font-size: 1.65rem;
    margin: 10px 0 5px;
}

.profile-demo-result-profile h4 i {
    color: #16a363;
    font-size: 0.9rem;
    vertical-align: middle;
}

.profile-demo-result-profile > p {
    color: var(--profile-demo-muted);
    font-size: 0.85rem;
    margin: 0 auto 3px;
    max-width: 430px;
}

.profile-demo-result-profile > small {
    color: #77859a;
    font-size: 0.65rem;
}

.profile-demo-result-actions {
    display: grid;
    gap: 7px;
    margin-top: 16px;
    text-align: left;
}

.profile-demo-result-actions > div {
    align-items: center;
    background: #fff;
    border: 1px solid #e1e8f1;
    border-radius: 7px;
    color: var(--profile-demo-heading);
    display: flex;
    font-size: 0.78rem;
    gap: 9px;
    min-height: 36px;
    padding: 8px 12px;
}

.profile-demo-result-actions .profile-demo-result-primary {
    background: linear-gradient(90deg, #4154f1, #287bd9);
    border-color: transparent;
    color: #fff;
}

.profile-demo-result-widget {
    background: #fff;
    border: 1px solid #cdd8e6;
    border-radius: 11px;
    bottom: 12px;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.22);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: absolute;
    right: 14px;
    top: 12px;
    width: 274px;
}

.profile-demo-result-widget-header {
    align-items: center;
    background: #3f9bd7;
    color: #fff;
    display: flex;
    justify-content: space-between;
    min-height: 42px;
    padding: 9px 12px;
}

.profile-demo-result-widget-header strong {
    font-size: 0.8rem;
}

.profile-demo-result-widget-header span {
    align-items: center;
    background: rgba(255, 255, 255, 0.22);
    border-radius: 50%;
    display: inline-flex;
    font-size: 1rem;
    height: 22px;
    justify-content: center;
    width: 22px;
}

.profile-demo-result-widget-body {
    color: #263247;
    flex: 1;
    font-size: 0.72rem;
    line-height: 1.45;
    overflow: hidden;
    padding: 12px;
}

.profile-demo-result-widget-body p {
    margin: 0 0 9px;
}

.profile-demo-result-prompts {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.profile-demo-result-prompts span {
    border: 1px solid #5daedc;
    border-radius: 99px;
    color: #2574a4;
    font-size: 0.65rem;
    padding: 4px 7px;
}

.profile-demo-result-widget-input {
    align-items: center;
    border-top: 1px solid #dce4ee;
    color: #8a96a8;
    display: flex;
    font-size: 0.7rem;
    justify-content: space-between;
    min-height: 38px;
    padding: 8px 11px;
}

.profile-demo-result-widget-input i {
    color: #3f9bd7;
}

.profile-demo-footer {
    border-top-color: var(--profile-demo-border);
    justify-content: space-between;
    padding: 14px 24px;
}

.profile-demo-controls {
    display: flex;
    gap: 8px;
}

.profile-demo-controls .btn {
    align-items: center;
    display: inline-flex;
    gap: 0.5rem;
}

.home-ai-presence-actions {
    display: grid;
    gap: 0.5rem;
}

.home-ai-presence-primary-actions {
    display: flex;
    gap: 0.5rem;
    width: 100%;
}

.home-ai-presence-primary-actions .home-ai-presence-cta {
    flex: 1 1 0;
    min-width: 0;
}

.home-ai-presence-demo-action,
.home-ai-presence-demo-cta {
    width: 100%;
}

.profile-demo-review-lines {
    line-height: 1.55;
}

.profile-demo-mobile-progress,
.profile-demo-static-summary {
    display: none;
}

.profile-builder-demo-modal.profile-demo--static .profile-demo-stage,
.profile-builder-demo-modal.profile-demo--static .profile-demo-controls {
    display: none;
}

.profile-builder-demo-modal.profile-demo--static .profile-demo-static-summary {
    display: grid;
    gap: 12px;
    margin: 12px auto;
    max-width: 640px;
}

.profile-demo-static-summary > div {
    align-items: center;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 9px;
    display: flex;
    gap: 10px;
    padding: 14px;
}

.profile-demo-static-summary i {
    color: #15803d;
}

body.bg-dark .profile-builder-demo-modal .modal-content,
body.bg-dark .profile-builder-demo-modal .profile-demo-workspace,
body.bg-dark .profile-builder-demo-modal .profile-demo-input,
body.bg-dark .profile-builder-demo-modal .profile-demo-select,
body.bg-dark .profile-builder-demo-modal .profile-demo-textarea {
    background: #172033;
    color: #f8fafc;
}

body.bg-dark .profile-builder-demo-modal {
    --profile-demo-border: #34445e;
    --profile-demo-heading: #f8fafc;
    --profile-demo-muted: #bdc8d8;
    --profile-demo-brand-soft: #26356c;
}

body.bg-dark .profile-builder-demo-modal .profile-demo-steps,
body.bg-dark .profile-builder-demo-modal .profile-demo-generation-list > div,
body.bg-dark .profile-builder-demo-modal .profile-demo-static-summary > div,
body.bg-dark .profile-builder-demo-modal .profile-demo-complete-list > div {
    background: #202c42;
}

body.bg-dark .profile-builder-demo-modal .profile-demo-kind.is-selected {
    background: #26356c;
}

body.bg-dark .profile-builder-demo-modal .profile-demo-result-browser-bar,
body.bg-dark .profile-builder-demo-modal .profile-demo-result-actions > div,
body.bg-dark .profile-builder-demo-modal .profile-demo-result-widget {
    background: #202c42;
}

body.bg-dark .profile-builder-demo-modal .profile-demo-result-page {
    background: linear-gradient(145deg, #172033, #202c42);
}

body.bg-dark .profile-builder-demo-modal .profile-demo-result-widget-body,
body.bg-dark .profile-builder-demo-modal .profile-demo-result-widget-input {
    color: #d9e2ef;
}

body.bg-dark .profile-builder-demo-modal .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

@keyframes profile-demo-caret {
    50% { opacity: 0; }
}

@media (min-width: 768px) and (max-height: 800px) {
    .profile-builder-demo-modal .modal-dialog {
        margin-bottom: 8px;
        margin-top: 8px;
    }

    .profile-builder-demo-modal .modal-content {
        max-height: calc(100vh - 16px);
    }

    .profile-demo-header {
        padding: 12px 20px 10px;
    }

    .profile-demo-header h2 {
        font-size: 1.6rem;
    }

    .profile-demo-header p {
        font-size: 0.9rem;
    }

    .profile-demo-body {
        padding: 12px 20px;
    }

    .profile-demo-stage {
        gap: 12px;
        min-height: 0;
    }

    .profile-demo-steps {
        align-content: start;
        gap: 4px;
        padding: 10px;
    }

    .profile-demo-step {
        padding: 6px;
    }

    .profile-demo-workspace {
        min-height: 0;
        padding: 16px;
    }

    .profile-demo-panel-heading {
        margin-bottom: 12px;
    }

    .profile-demo-review-grid {
        gap: 8px;
    }

    .profile-demo-review-grid .profile-demo-label {
        margin-bottom: 4px;
    }

    .profile-demo-review-grid .profile-demo-input,
    .profile-demo-review-grid .profile-demo-textarea {
        padding: 7px 10px;
    }

    .profile-demo-review-grid .profile-demo-textarea-short {
        min-height: 54px;
    }

    .profile-demo-claim {
        margin-top: 8px;
    }

    .profile-demo-faux-action {
        margin-top: 12px;
    }

    .profile-demo-footer {
        padding: 10px 20px;
    }
}

html.profile-builder-demo-open .bitlife-widget-launcher,
html.profile-builder-demo-open .bitlife-widget-iframe {
    display: none !important;
}

@media (max-width: 767px) {
    .home-ai-presence-primary-actions {
        flex-direction: column;
    }

    .home-ai-presence-primary-actions .home-ai-presence-cta {
        flex-basis: auto;
        width: 100%;
    }

    .profile-builder-demo-modal .modal-dialog {
        height: 100%;
        margin: 0;
        max-width: none;
        width: 100%;
    }

    .profile-builder-demo-modal .modal-content {
        border-radius: 0;
        height: 100%;
        max-height: none;
    }

    .profile-demo-header {
        padding: 14px 16px;
    }

    .profile-demo-header p {
        display: none;
    }

    .profile-demo-body {
        padding: 14px 16px;
    }

    .profile-demo-stage {
        display: block;
        min-height: 0;
    }

    .profile-demo-steps {
        display: none;
    }

    .profile-demo-mobile-progress {
        display: block;
        margin-bottom: 12px;
    }

    .profile-demo-mobile-progress > div {
        display: flex;
        justify-content: space-between;
    }

    .profile-demo-mobile-progress span {
        color: var(--profile-demo-muted);
        font-size: 0.82rem;
    }

    .profile-demo-mobile-track {
        margin-top: 7px;
    }

    .profile-demo-workspace {
        min-height: 450px;
        padding: 16px;
    }

    .profile-demo-kind-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .profile-demo-kind {
        min-height: 105px;
    }

    .profile-demo-kind:nth-child(3),
    .profile-demo-kind:nth-child(4) {
        display: none;
    }

    .profile-demo-review-grid {
        grid-template-columns: 1fr;
    }

    .profile-demo-review-wide {
        grid-column: auto;
    }

    .profile-demo-review-grid > div:nth-child(4),
    .profile-demo-review-grid > div:nth-child(5) {
        display: none;
    }

    .profile-demo-result-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 3px;
    }

    .profile-demo-result-page {
        min-height: 0;
        padding: 16px;
    }

    .profile-demo-result-profile h4 {
        font-size: 1.35rem;
    }

    .profile-demo-result-widget {
        bottom: auto;
        margin-top: 14px;
        max-height: 300px;
        min-height: 280px;
        position: relative;
        right: auto;
        top: auto;
        width: 100%;
    }

    .profile-demo-footer {
        gap: 10px;
        padding: 12px 16px;
    }

    .profile-demo-footer > .btn-primary {
        margin-left: auto;
    }
}

@media (max-width: 420px) {
    .profile-demo-controls button span {
        display: none;
    }

    .profile-demo-link-row {
        grid-template-columns: 1fr;
    }

    .profile-demo-panel-heading p {
        font-size: 0.85rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .profile-demo-caret {
        animation: none;
    }
}
