
/* ===============================================
   BRIX AI — LIVE ENGINE
   =============================================== */

.generated-preview-frame {
    width: 100%;
    height: 100%;
    min-height: 560px;

    display: block;

    border: 0;

    background: #ffffff;
}

.workspace-code-shell {
    height: 100%;

    display: flex;
    flex-direction: column;

    background: #09090d;
}

.code-file-bar {
    min-height: 39px;

    display: flex;
    align-items: center;
    gap: 6px;

    padding: 5px 8px;

    overflow-x: auto;

    border-bottom: 1px solid #1d1d25;

    background: #0d0d12;
}

.code-file-tab {
    flex: 0 0 auto;

    padding: 6px 9px;

    border: 1px solid transparent;
    border-radius: 7px;

    background: transparent;
    color: #646472;

    font-size: 8px;
}

.code-file-tab:hover {
    color: #c4c4cd;
    background: #15151c;
}

.code-file-tab.active {
    border-color: #302c43;

    background: #191720;
    color: #a99cff;
}

.code-editor {
    width: 100%;
    flex: 1;

    min-height: 500px;

    padding: 17px 19px;

    resize: none;

    border: 0;

    background:
        linear-gradient(
            90deg,
            #0a0a0e,
            #09090d
        );

    color: #d1d1dc;

    tab-size: 4;

    font-family:
        "SFMono-Regular",
        Consolas,
        "Liberation Mono",
        monospace;

    font-size: 11px;
    line-height: 1.65;
}

.generated-files {
    padding: 9px;
}

.generated-file {
    width: 100%;
    min-height: 37px;

    display: flex;
    align-items: center;
    gap: 10px;

    padding: 0 10px;

    border: 0;
    border-radius: 8px;

    background: transparent;
    color: #898895;

    text-align: left;

    font-size: 9px;
}

.generated-file:hover,
.generated-file.active {
    background: #15151c;
    color: #d5d5de;
}

.generated-file.active {
    color: #a695ff;
}

.file-type {
    width: 26px;

    color: #6f60c1;

    font-size: 7px;
    font-weight: 800;

    text-transform: uppercase;
}

.file-name {
    min-width: 0;
    flex: 1;

    overflow: hidden;

    white-space: nowrap;
    text-overflow: ellipsis;
}

.file-size {
    color: #4f4f5a;

    font-size: 7px;
}

.engine-btn {
    min-height: 28px;

    padding: 0 8px;

    border: 1px solid #292934;
    border-radius: 7px;

    background: #121218;
    color: #858591;

    font-size: 8px;
}

.engine-btn:hover {
    color: #fff;
    border-color: #3c394a;
}

.engine-btn.primary {
    border-color: #504496;

    background: #1c1830;
    color: #a899ff;
}

.builder-message.assistant .bubble {
    border-color: #29263a;

    background:
        linear-gradient(
            145deg,
            #13121b,
            #111117
        );
}

.builder-message .bubble {
    white-space: pre-wrap;
}

.builder-message.loading .bubble {
    color: #8f82df;
}

.engine-loading {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.engine-loading i {
    width: 4px;
    height: 4px;

    display: block;

    border-radius: 50%;

    background: #8976f7;

    animation:
        brixPulse 1s infinite ease-in-out;
}

.engine-loading i:nth-child(2) {
    animation-delay: .15s;
}

.engine-loading i:nth-child(3) {
    animation-delay: .3s;
}

@keyframes brixPulse {

    0%,
    100% {
        opacity: .25;
        transform: translateY(0);
    }

    50% {
        opacity: 1;
        transform: translateY(-3px);
    }
}

.chat-message {
    margin: 0 auto 13px;

    max-width: 760px;
}

.chat-message small {
    display: block;

    margin-bottom: 5px;

    color: #61616f;

    font-size: 8px;
    font-weight: 700;
}

.chat-message .bubble {
    padding: 12px 13px;

    border: 1px solid #24242e;
    border-radius: 11px;

    background: #111117;
    color: #c0bfc9;

    white-space: pre-wrap;

    font-size: 10px;
    line-height: 1.65;
}

.chat-message.user .bubble {
    border-color: #302b4b;

    background: #171421;
}

.chat-message.assistant .bubble {
    border-color: #29263a;
}

.engine-error {
    color: #ff7e86 !important;
}

.project-summary-bar {
    display: flex;
    align-items: center;
    gap: 7px;

    min-height: 34px;

    padding: 0 10px;

    border-bottom: 1px solid #1c1c24;

    background: #0c0c11;
}

.project-summary-bar strong {
    font-size: 8px;
}

.project-summary-bar span {
    color: #595966;

    font-size: 8px;
}

.workspace-view {
    overflow: auto;
}

#workspace-preview {
    overflow: hidden;
}

@media(max-width:820px) {

    .generated-preview-frame {
        min-height: 550px;
    }

}



/* ==========================================================
   BRIX AGENT ACTIVITY
   ========================================================== */

.agent-activity {
    margin: 8px 0 12px;

    padding: 10px 11px;

    border: 1px solid #242331;
    border-radius: 9px;

    background:
        linear-gradient(
            145deg,
            #111019,
            #0f0f15
        );

    color: #a2a0ae;

    font-size: 9px;
}

.agent-activity-row {
    display: flex;
    align-items: center;
    gap: 8px;

    min-height: 25px;
}

.agent-activity-icon {
    width: 18px;

    display: inline-flex;
    justify-content: center;

    color: #8a76ff;
}

.agent-activity-text {
    min-width: 0;
    flex: 1;

    overflow: hidden;

    white-space: nowrap;
    text-overflow: ellipsis;
}

.agent-activity-meta {
    color: #53525e;

    font-size: 8px;
}

.agent-activity.done
.agent-activity-icon {
    color: #4fd292;
}

.agent-activity.error
.agent-activity-icon {
    color: #ff737b;
}

.agent-progress {
    height: 3px;

    margin-top: 7px;

    overflow: hidden;

    border-radius: 10px;

    background: #24232d;
}

.agent-progress > span {
    width: 0;
    height: 100%;

    display: block;

    border-radius: inherit;

    background:
        linear-gradient(
            90deg,
            #765dff,
            #9b87ff
        );

    transition:
        width .3s ease;
}

.agent-plan {
    margin-top: 7px;

    color: #787684;

    font-size: 8px;
    line-height: 1.55;
}

.agent-plan strong {
    color: #bdb8d8;
}

.generate-btn.stop-mode {
    background: #3a2025;

    color: #ff8b93;
}

.android-project-badge,
.web-project-badge {
    display: inline-flex;
    align-items: center;

    margin-top: 8px;

    padding: 4px 7px;

    border: 1px solid #302b4a;
    border-radius: 6px;

    background: #171421;
    color: #aa9cff;

    font-size: 7px;
    font-weight: 800;
    letter-spacing: .5px;
}

.android-no-preview {
    height: 100%;

    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;

    padding: 30px;

    text-align: center;
}

.android-no-preview .android-icon {
    width: 53px;
    height: 53px;

    display: grid;
    place-items: center;

    margin-bottom: 13px;

    border: 1px solid #2f2c40;
    border-radius: 15px;

    background: #17141f;
    color: #a28eff;

    font-weight: 800;
}

.android-no-preview strong {
    font-size: 11px;
}

.android-no-preview p {
    max-width: 310px;

    margin: 7px 0 0;

    color: #656371;

    font-size: 9px;
    line-height: 1.6;
}



/* ==========================================================
   BRIX AI REPLIT MODE V4
   ========================================================== */

#page-builder {
    height:
        calc(
            100dvh - 119px
        ) !important;

    min-height: 0 !important;

    overflow: hidden !important;
}

.builder-shell {
    height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
}

.builder-left {
    height: 100% !important;

    min-height: 0 !important;

    overflow: hidden !important;

    display: flex !important;
    flex-direction: column !important;
}

.builder-intro {
    min-height: 0 !important;
}

.builder-chat {
    flex:
        1 1 auto !important;

    min-height:
        0 !important;

    overflow-y:
        auto !important;

    overflow-x:
        hidden !important;

    overscroll-behavior:
        contain;

    scrollbar-gutter:
        stable;

    padding:
        18px 14px 28px !important;

    scroll-behavior:
        smooth;
}

.builder-chat::-webkit-scrollbar {
    width: 8px;
}

.builder-chat::-webkit-scrollbar-track {
    background:
        transparent;
}

.builder-chat::-webkit-scrollbar-thumb {
    border:
        2px solid transparent;

    border-radius:
        20px;

    background:
        #34313f;

    background-clip:
        padding-box;
}

.builder-chat::-webkit-scrollbar-thumb:hover {
    background:
        #484258;

    background-clip:
        padding-box;
}

.builder-composer {
    flex:
        0 0 auto !important;

    position:
        relative;

    z-index:
        10;

    margin:
        10px 12px 12px !important;

    box-shadow:
        0 -15px 35px
        rgba(
            9,
            9,
            13,
            .44
        );
}


/* REPLIT-LIKE NARRATIVE */

.agent-narrative {
    margin:
        7px 0 15px;

    color:
        #ececf2;

    font-size:
        11px;

    line-height:
        1.65;
}

.agent-narrative p {
    margin:
        0 0 8px;
}

.agent-narrative .muted-thinking {
    color:
        #74717e;

    font-size:
        9px;
}

.agent-run-card {
    margin:
        9px 0 15px;

    overflow:
        hidden;

    border:
        1px solid #262431;

    border-radius:
        11px;

    background:
        #0f0f15;
}

.agent-run-header {
    min-height:
        42px;

    display:
        flex;

    align-items:
        center;

    gap:
        9px;

    padding:
        0 12px;

    border-bottom:
        1px solid #1d1c25;
}

.agent-run-icon {
    width:
        23px;

    height:
        23px;

    display:
        grid;

    place-items:
        center;

    border-radius:
        7px;

    background:
        #191623;

    color:
        #9b86ff;

    font-size:
        10px;
}

.agent-run-title {
    min-width:
        0;

    flex:
        1;
}

.agent-run-title strong {
    display:
        block;

    color:
        #cbc9d4;

    font-size:
        9px;
}

.agent-run-title small {
    display:
        block;

    margin-top:
        2px;

    color:
        #585662;

    font-size:
        7px;
}

.agent-run-percent {
    color:
        #777280;

    font-size:
        8px;
}

.agent-run-progress {
    height:
        3px;

    background:
        #1b1a22;
}

.agent-run-progress span {
    width:
        0;

    height:
        100%;

    display:
        block;

    background:
        linear-gradient(
            90deg,
            #7057f7,
            #9a84ff
        );

    transition:
        width .25s ease;
}

.agent-events {
    padding:
        7px 7px 8px;
}

.agent-event {
    min-height:
        31px;

    display:
        grid;

    grid-template-columns:
        22px
        minmax(0,1fr)
        auto;

    align-items:
        center;

    gap:
        5px;

    padding:
        0 6px;

    border-radius:
        7px;

    color:
        #85838f;

    font-size:
        8px;
}

.agent-event:hover {
    background:
        #14141b;
}

.agent-event-icon {
    display:
        grid;

    place-items:
        center;

    color:
        #7462dc;
}

.agent-event.running
.agent-event-icon {
    animation:
        brixSpin
        1.05s
        linear
        infinite;
}

.agent-event.done
.agent-event-icon {
    color:
        #4dd68e;
}

.agent-event.error
.agent-event-icon {
    color:
        #ff777f;
}

.agent-event-name {
    min-width:
        0;

    overflow:
        hidden;

    white-space:
        nowrap;

    text-overflow:
        ellipsis;
}

.agent-event-meta {
    padding-left:
        8px;

    color:
        #4f4d58;

    font-size:
        7px;
}

@keyframes brixSpin {
    to {
        transform:
            rotate(
                360deg
            );
    }
}


/* JUMP TO LATEST */

.brix-jump-latest {
    position:
        absolute;

    right:
        20px;

    bottom:
        132px;

    z-index:
        30;

    display:
        none;

    min-height:
        30px;

    padding:
        0 10px;

    border:
        1px solid #353047;

    border-radius:
        100px;

    background:
        #191622;

    color:
        #a99bff;

    box-shadow:
        0 10px 25px
        rgba(
            0,
            0,
            0,
            .35
        );

    font-size:
        8px;
}

.brix-jump-latest.show {
    display:
        block;
}


/* FILE TREE */

.brix-file-tree {
    padding:
        8px;
}

.brix-tree-row {
    width:
        100%;

    min-height:
        31px;

    display:
        flex;

    align-items:
        center;

    gap:
        7px;

    padding:
        0 8px;

    border:
        0;

    border-radius:
        7px;

    background:
        transparent;

    color:
        #85838f;

    text-align:
        left;

    font-size:
        8px;
}

.brix-tree-row:hover {
    background:
        #14141b;

    color:
        #c5c3cd;
}

.brix-tree-row.file.active {
    background:
        #181522;

    color:
        #a999ff;
}

.brix-tree-icon {
    width:
        16px;

    color:
        #7565d7;
}

.brix-tree-name {
    min-width:
        0;

    flex:
        1;

    overflow:
        hidden;

    white-space:
        nowrap;

    text-overflow:
        ellipsis;
}

.brix-tree-size {
    color:
        #4f4d58;

    font-size:
        7px;
}


@media(max-width:820px) {

    #page-builder {
        height:
            auto !important;

        overflow:
            visible !important;
    }

    .builder-left {
        height:
            650px !important;
    }

}



/* ==========================================================
   V7 PREVIEW LOADER
   ========================================================== */

.brix-preview-loading {
    height: 100%;

    min-height: 560px;

    position: relative;

    overflow: hidden;

    display: flex;

    align-items: center;

    justify-content: center;

    flex-direction: column;

    padding: 40px;

    background:
        radial-gradient(
            circle at 50% 45%,
            rgba(113, 90, 255, .07),
            transparent 38%
        ),
        #151516;
}


.brix-preview-loading small {
    color: #85828d;

    font-size: 10px;

    margin-bottom: 8px;
}


.brix-preview-loading h2 {
    margin: 0 0 30px;

    color: #eeeeF2;

    font-size: 23px;
}


.preview-tip-stage {
    width: min(470px, 84%);

    min-height: 290px;

    position: relative;
}


.preview-tip-card {
    min-height: 280px;

    display: flex;

    align-items: center;

    justify-content: center;

    flex-direction: column;

    padding: 30px;

    border: 1px solid #2b2a2f;

    border-radius: 22px;

    background:
        linear-gradient(
            145deg,
            #202022,
            #1b1b1d
        );

    box-shadow:
        0 25px 80px
        rgba(0,0,0,.25);

    text-align: center;
}


.preview-tip-logo {
    width: 80px;
    height: 80px;

    display: grid;

    place-items: center;

    margin-bottom: 25px;

    border-radius: 22px;

    background:
        linear-gradient(
            145deg,
            #785dff,
            #5940da
        );

    box-shadow:
        0 20px 50px
        rgba(113,90,255,.22);

    font-size: 30px;
}


.preview-tip-card strong {
    margin-bottom: 8px;

    font-size: 16px;
}


.preview-tip-card p {
    max-width: 340px;

    margin: 0;

    color: #8c8993;

    font-size: 11px;

    line-height: 1.65;
}


.preview-loader-bar {
    width: min(470px, 84%);

    height: 4px;

    margin-top: 20px;

    overflow: hidden;

    border-radius: 50px;

    background: #28272d;
}


.preview-loader-bar span {
    width: 28%;
    height: 100%;

    display: block;

    border-radius: inherit;

    background:
        linear-gradient(
            90deg,
            #765cff,
            #aa98ff
        );

    animation:
        brixPreviewLoad 2.2s
        ease-in-out
        infinite;
}


@keyframes brixPreviewLoad {

    0% {
        transform:
            translateX(-120%);
    }

    100% {
        transform:
            translateX(430%);
    }
}


.preview-building-status {
    margin-top: 11px;

    color: #686570;

    font-size: 9px;
}


.generated-preview-frame {
    background: #fff;
}


.preview-error-screen {
    height: 100%;

    display: flex;

    align-items: center;

    justify-content: center;

    flex-direction: column;

    padding: 35px;

    background: #111114;

    text-align: center;
}


.preview-error-screen strong {
    color: #ff8a91;

    font-size: 13px;
}


.preview-error-screen p {
    max-width: 400px;

    color: #797681;

    font-size: 10px;

    line-height: 1.6;
}

