/* GTKZ FORGE — COMMERCIAL POLISH OWNER */

@media (min-width:901px) {

    .topbar {
        display:flex !important;
        align-items:center !important;
        gap:8px !important;
        width:100% !important;
    }

    .gtkz-top-search {
        flex:1 1 500px !important;
        max-width:620px !important;
        min-width:260px !important;
    }

    .gtkz-top-search input,
    input.gtkz-top-search {
        width:100% !important;
    }

    .gtkz-forge-ai-command {
        flex:0 0 auto !important;
        min-width:140px !important;
        height:40px !important;
        padding:0 13px !important;
        font-size:12px !important;
        font-weight:700 !important;
        white-space:nowrap !important;
    }

    .gtkz-admin-command {
        flex:0 0 auto !important;
        min-width:112px !important;
        height:40px !important;
        padding:5px 10px !important;
        font-size:10px !important;
        white-space:nowrap !important;
    }

    .gtkz-logout-button {
        flex:0 0 auto;
        min-width:90px;
        height:40px;
        padding:0 12px;

        display:inline-flex;
        align-items:center;
        justify-content:center;
        gap:6px;

        border:1px solid rgba(255,72,100,.8);
        border-radius:8px;

        background:rgba(90,14,30,.78);
        color:#fff;

        text-decoration:none;

        font-size:11px;
        font-weight:800;
    }

    .gtkz-logout-button svg {
        width:15px;
        height:15px;
        fill:none;
        stroke:currentColor;
        stroke-width:1.9;
        stroke-linecap:round;
        stroke-linejoin:round;
    }
}


/* ACTION BUTTONS */

.action.gtkz-commercial-action {
    min-height:49px !important;
    padding:7px 7px !important;

    display:flex !important;
    flex-direction:row !important;
    align-items:center !important;
    justify-content:center !important;

    gap:7px !important;

    font-size:11.5px !important;
    font-weight:750 !important;
    line-height:1 !important;

    white-space:nowrap !important;
}

.action.gtkz-commercial-action svg {
    width:17px;
    height:17px;
    flex:0 0 17px;

    fill:none;
    stroke:currentColor;
    stroke-width:1.85;
    stroke-linecap:round;
    stroke-linejoin:round;
}


/* LIVE SESSIONS */

.gtkz-live-sessions-panel .panel-head {
    min-height:38px !important;

    display:flex !important;
    align-items:center !important;
    justify-content:space-between !important;

    gap:10px !important;
}

.gtkz-live-sessions-panel .panel-title {
    font-size:15px !important;
    font-weight:800 !important;
}

.gtkz-live-toolbar {
    display:flex !important;
    align-items:center !important;
    gap:8px !important;
}

.gtkz-live-toolbar button,
.gtkz-live-toolbar a,
.gtkz-live-toolbar span {
    font-size:10px !important;
    font-weight:700 !important;
}

.gtkz-view-website {
    min-height:29px !important;
    padding:5px 9px !important;

    display:inline-flex !important;
    align-items:center !important;
    gap:5px !important;
}

.gtkz-view-website svg {
    width:13px;
    height:13px;

    fill:none;
    stroke:currentColor;
    stroke-width:1.8;
}


/* TV EXPERIENCE BUILDER */

.gtkz-tv-preview-panel {
    min-height:250px !important;
}

.gtkz-tv-preview-panel .panel-head {
    min-height:35px !important;
    margin-bottom:7px !important;
}

.gtkz-tv-preview-panel .panel-title {
    font-size:14px !important;
    font-weight:800 !important;
}

.gtkz-tv-preview-panel .preview {
    min-height:195px !important;
    height:auto !important;
}

.gtkz-tv-preview-panel .preview-hero {
    min-height:118px !important;
    padding:14px 17px !important;
}

.gtkz-tv-preview-panel .preview-copy h2 {
    margin:5px 0 8px !important;
    font-size:23px !important;
    line-height:1.02 !important;
}

.gtkz-tv-preview-panel .preview-copy p {
    font-size:10px !important;
}

.gtkz-tv-preview-panel .preview-categories {
    min-height:35px !important;
    gap:5px !important;
}

.gtkz-tv-preview-panel .preview-cat {
    min-height:32px !important;

    display:flex !important;
    align-items:center !important;
    justify-content:center !important;

    font-size:8px !important;
}

.mid {
    align-items:stretch !important;
}

.mid > .panel {
    min-height:250px !important;
}


/* =========================================================
   GTKZ FORGE — TOPBAR FINAL FILL OWNER
   Search | Forge AI | Admin | Logout
   ========================================================= */

@media (min-width: 901px) {

    .topbar {
        display:
            grid !important;

        grid-template-columns:
            minmax(300px, 1fr)
            max-content
            max-content
            max-content !important;

        align-items:
            stretch !important;

        gap:
            8px !important;

        width:
            100% !important;
    }


    /* Search uses every leftover pixel. */

    .gtkz-top-search {
        width:
            100% !important;

        min-width:
            0 !important;

        max-width:
            none !important;

        flex:
            none !important;
    }

    .gtkz-top-search input,
    input.gtkz-top-search {
        width:
            100% !important;

        height:
            40px !important;

        min-width:
            0 !important;
    }


    /* TALK TO FORGE */

    .gtkz-forge-ai-command {
        width:
            auto !important;

        min-width:
            142px !important;

        height:
            40px !important;

        margin:
            0 !important;
    }


    /* ADMIN */

    .gtkz-admin-command {
        width:
            auto !important;

        min-width:
            120px !important;

        height:
            40px !important;

        margin:
            0 !important;
    }


    /* LOGOUT */

    .gtkz-logout-button {
        width:
            auto !important;

        min-width:
            102px !important;

        height:
            40px !important;

        margin:
            0 !important;

        box-sizing:
            border-box !important;
    }
}


/*
 * On more constrained desktop widths, retain all four controls.
 */
@media (min-width: 901px) and (max-width: 1180px) {

    .topbar {
        grid-template-columns:
            minmax(220px, 1fr)
            max-content
            max-content
            max-content !important;

        gap:
            6px !important;
    }

    .gtkz-forge-ai-command {
        min-width:
            126px !important;
    }

    .gtkz-admin-command {
        min-width:
            105px !important;
    }

    .gtkz-logout-button {
        min-width:
            88px !important;
    }
}


/* =========================================================
   GTKZ FORGE — COMMERCIAL ADMIN ACCOUNT CONTROL
   ========================================================= */

@media (min-width: 901px) {

    .gtkz-admin-command {
        position:
            relative !important;

        width:
            auto !important;

        min-width:
            158px !important;

        height:
            40px !important;

        padding:
            4px 11px 4px 7px !important;

        display:
            grid !important;

        grid-template-columns:
            29px minmax(0, 1fr) !important;

        grid-template-rows:
            1fr !important;

        align-items:
            center !important;

        gap:
            8px !important;

        border:
            1px solid
            rgba(54,163,255,.48) !important;

        border-radius:
            8px !important;

        background:
            linear-gradient(
                180deg,
                rgba(8,29,51,.96),
                rgba(4,18,34,.96)
            ) !important;

        box-shadow:
            inset 0 1px 0
            rgba(255,255,255,.035),
            0 0 0 1px
            rgba(0,0,0,.18) !important;

        color:
            #fff !important;

        cursor:
            pointer !important;

        transition:
            border-color .15s ease,
            background .15s ease,
            box-shadow .15s ease,
            transform .15s ease !important;
    }


    .gtkz-admin-command:hover {
        border-color:
            rgba(70,190,255,.86) !important;

        background:
            linear-gradient(
                180deg,
                rgba(11,42,72,.98),
                rgba(5,24,44,.98)
            ) !important;

        box-shadow:
            0 0 14px
            rgba(0,145,255,.12),
            inset 0 1px 0
            rgba(255,255,255,.055) !important;

        transform:
            translateY(-1px) !important;
    }


    /* Avatar */

    .gtkz-admin-avatar {
        position:
            relative;

        width:
            29px;

        height:
            29px;

        display:
            flex;

        align-items:
            center;

        justify-content:
            center;

        border:
            1px solid
            rgba(71,181,255,.52);

        border-radius:
            50%;

        background:
            radial-gradient(
                circle at 35% 30%,
                rgba(33,130,218,.62),
                rgba(8,42,77,.92)
            );

        color:
            #dff6ff;

        box-shadow:
            inset 0 0 8px
            rgba(40,170,255,.12);
    }


    .gtkz-admin-avatar svg {
        width:
            15px;

        height:
            15px;

        fill:
            none;

        stroke:
            currentColor;

        stroke-width:
            1.8;

        stroke-linecap:
            round;

        stroke-linejoin:
            round;
    }


    /* Online dot */

    .gtkz-admin-avatar::after {
        content:
            "";

        position:
            absolute;

        right:
            -1px;

        bottom:
            1px;

        width:
            7px;

        height:
            7px;

        border:
            2px solid
            #071727;

        border-radius:
            50%;

        background:
            #00e894;

        box-shadow:
            0 0 7px
            rgba(0,232,148,.55);
    }


    /* Text stack */

    .gtkz-admin-copy {
        min-width:
            0;

        display:
            flex;

        flex-direction:
            column;

        justify-content:
            center;

        align-items:
            flex-start;

        line-height:
            1.05;
    }


    .gtkz-admin-title {
        color:
            #ffffff;

        font-size:
            10.5px;

        font-weight:
            800;

        letter-spacing:
            .045em;

        text-transform:
            uppercase;

        white-space:
            nowrap;
    }


    .gtkz-admin-role {
        margin-top:
            3px;

        color:
            #8eb8d7;

        font-size:
            7.5px;

        font-weight:
            600;

        letter-spacing:
            .015em;

        white-space:
            nowrap;

        overflow:
            hidden;

        text-overflow:
            ellipsis;

        max-width:
            105px;
    }
}


/* =========================================================
   GTKZ FORGE — PREVIEW + CLIENT IDENTITY OWNER
   ========================================================= */


/* =========================================================
   1. TV EXPERIENCE BUILDER — TRUE PREVIEW PROPORTION
   ========================================================= */

.gtkz-tv-preview-panel {
    min-height: 300px !important;
}

.gtkz-tv-preview-panel .panel-head {
    min-height: 38px !important;
    margin-bottom: 8px !important;
}

.gtkz-tv-preview-panel .preview {
    width: 100% !important;

    min-height: 240px !important;

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

    overflow: hidden !important;
}

.gtkz-tv-preview-panel .sim-top {
    min-height: 34px !important;
}

.gtkz-tv-preview-panel .preview-hero {
    flex: 1 1 auto !important;

    min-height: 150px !important;

    padding: 18px 20px !important;
}

.gtkz-tv-preview-panel .preview-copy h2 {
    font-size: 26px !important;
    line-height: 1.02 !important;

    margin: 7px 0 9px !important;
}

.gtkz-tv-preview-panel .preview-copy p {
    font-size: 11px !important;
}

.gtkz-tv-preview-panel .preview-categories {
    min-height: 40px !important;

    gap: 6px !important;
}

.gtkz-tv-preview-panel .preview-cat {
    min-height: 36px !important;

    font-size: 8px !important;
}


/*
 * Live Sessions stays aligned with the preview card.
 */
.mid {
    align-items: stretch !important;
}

.mid > .panel {
    min-height: 300px !important;
}


/* =========================================================
   2. LOWER UNIVERSAL DEVICE SIMULATOR PLAYER
   Commercial TV proportion — centered, not billboard-wide
   ========================================================= */

@media (min-width: 901px) {

    /*
     * Player wrapper uses a true TV-style width.
     */
    .simulator-grid > div:nth-child(3) {
        width: min(100%, 860px) !important;
        max-width: 860px !important;

        justify-self: center !important;

        margin-left: auto !important;
        margin-right: auto !important;
    }


    /*
     * 16:9 presentation surface.
     */
    .simulator-grid > div:nth-child(3) .sim-screen {
        width: 100% !important;

        height: auto !important;
        min-height: 0 !important;

        aspect-ratio: 16 / 9 !important;

        max-width: 860px !important;
    }


    /*
     * Make the internal live area expand naturally
     * inside the 16:9 screen.
     */
    .simulator-grid > div:nth-child(3) .sim-live {
        flex: 1 1 auto !important;

        min-height: 0 !important;
    }


    /*
     * Launch button follows TV width.
     */
    .simulator-grid > div:nth-child(3) .deploy-button {
        width: 100% !important;
        max-width: 860px !important;
    }
}


/* =========================================================
   3. COMMERCIAL CLIENT IDENTITY CONTROL
   ========================================================= */

.gtkz-admin-command {
    position: relative !important;

    min-width: 190px !important;

    height: 44px !important;

    padding: 5px 10px 5px 7px !important;

    display: grid !important;

    grid-template-columns:
        32px minmax(0, 1fr) 22px !important;

    align-items: center !important;

    gap: 8px !important;

    border:
        1px solid rgba(62,174,255,.60) !important;

    border-radius:
        9px !important;

    background:
        linear-gradient(
            180deg,
            rgba(10,38,66,.98),
            rgba(4,22,40,.98)
        ) !important;

    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.045),
        0 0 16px rgba(0,133,255,.06) !important;
}


/* Avatar */

.gtkz-admin-avatar {
    width: 32px !important;
    height: 32px !important;
}


/* Identity stack */

.gtkz-admin-copy {
    min-width: 0;

    display: flex;

    flex-direction: column;

    justify-content: center;

    align-items: flex-start;
}


.gtkz-client-name {
    max-width: 120px;

    color: #fff;

    font-size: 11px;

    font-weight: 850;

    letter-spacing: .015em;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;
}


.gtkz-framework-role {
    margin-top: 2px;

    color: #8fd7ff;

    font-size: 7.5px;

    font-weight: 650;

    white-space: nowrap;
}


/* Edit icon */

.gtkz-admin-edit {
    width: 22px;
    height: 22px;

    display: flex;

    align-items: center;

    justify-content: center;

    border:
        1px solid rgba(80,170,230,.24);

    border-radius:
        6px;

    background:
        rgba(5,25,44,.72);

    color:
        #9edfff;

    cursor:
        pointer;

    transition:
        background .15s ease,
        border-color .15s ease;
}


.gtkz-admin-edit:hover {
    background:
        rgba(12,55,91,.90);

    border-color:
        rgba(87,190,255,.72);
}


.gtkz-admin-edit svg {
    width: 12px;

    height: 12px;

    fill: none;

    stroke: currentColor;

    stroke-width: 1.8;

    stroke-linecap: round;

    stroke-linejoin: round;
}


/* =========================================================
   CLIENT IDENTITY EDITOR
   ========================================================= */

.gtkz-identity-editor {
    position: fixed;

    top: 74px;

    right: 118px;

    z-index: 99999;

    width: 310px;

    padding: 16px;

    border:
        1px solid rgba(52,173,255,.56);

    border-radius:
        12px;

    background:
        rgba(4,17,31,.98);

    box-shadow:
        0 22px 55px rgba(0,0,0,.48),
        0 0 22px rgba(0,140,255,.08);

    backdrop-filter:
        blur(16px);
}


.gtkz-identity-editor[hidden] {
    display: none !important;
}


.gtkz-identity-editor h3 {
    margin:
        0 0 5px;

    color:
        #fff;

    font-size:
        15px;
}


.gtkz-identity-editor .identity-sub {
    margin-bottom:
        14px;

    color:
        #7ea4bf;

    font-size:
        9px;

    line-height:
        1.4;
}


.gtkz-identity-row {
    margin-bottom:
        11px;
}


.gtkz-identity-row label {
    display:
        block;

    margin-bottom:
        5px;

    color:
        #8fd7ff;

    font-size:
        9px;

    font-weight:
        700;

    text-transform:
        uppercase;

    letter-spacing:
        .05em;
}


.gtkz-identity-row input {
    width:
        100%;

    height:
        38px;

    box-sizing:
        border-box;

    padding:
        0 10px;

    border:
        1px solid rgba(53,132,188,.48);

    border-radius:
        7px;

    outline:
        none;

    background:
        #07182a;

    color:
        #fff;

    font-size:
        12px;
}


.gtkz-identity-row input:focus {
    border-color:
        #28baff;

    box-shadow:
        0 0 0 2px
        rgba(40,186,255,.08);
}


/*
 * Framework identity is visible but locked.
 */
.gtkz-framework-input {
    opacity:
        .78;

    cursor:
        not-allowed;
}


.gtkz-identity-actions {
    display:
        flex;

    justify-content:
        flex-end;

    gap:
        7px;

    margin-top:
        14px;
}


.gtkz-identity-actions button {
    min-height:
        34px;

    padding:
        0 12px;

    border-radius:
        7px;

    font-size:
        10px;

    font-weight:
        750;

    cursor:
        pointer;
}


.gtkz-identity-cancel {
    border:
        1px solid #264862;

    background:
        #091827;

    color:
        #b3ccdd;
}


.gtkz-identity-save {
    border:
        1px solid #168feb;

    background:
        #087ee0;

    color:
        #fff;
}


/* Mobile editor positioning */

@media (max-width: 900px) {

    .gtkz-identity-editor {
        top: 70px;
        right: 10px;
        left: 10px;

        width: auto;
    }
}
