/* PlayRAS Remove BG Studio - SaaS compact layout */
.prs-rbg-app,
.prs-rbg-app *{
    box-sizing:border-box;
}

.prs-rbg-app{
    width:100%;
    max-width:100%;
    margin:0;
    padding:0;
    color:#f3f3f3;
    font-family:Arial, Helvetica, sans-serif;
}

.prs-rbg-shell{
    width:100%;
    max-width:100%;
    background:linear-gradient(180deg,#090909 0%, #0d0d10 100%);
    border:1px solid rgba(224,193,87,.20);
    border-radius:24px;
    padding:14px;
    box-shadow:0 12px 30px rgba(0,0,0,.35);
    position:relative;
    overflow:hidden;
}

.prs-rbg-shell:before{
    content:"";
    position:absolute;
    inset:0;
    background:
        radial-gradient(circle at top center, rgba(224,193,87,.06), transparent 42%),
        radial-gradient(circle at bottom right, rgba(224,193,87,.05), transparent 34%);
    pointer-events:none;
}

.prs-rbg-shell > *{
    position:relative;
    z-index:1;
}

.prs-rbg-grid{
    display:grid;
    grid-template-columns:minmax(0,1fr) minmax(0,1fr);
    gap:14px;
    margin-bottom:14px;
}

.prs-rbg-panel{
    background:linear-gradient(180deg,#121214 0%, #0b0b0d 100%);
    border:1px solid rgba(224,193,87,.18);
    border-radius:22px;
    padding:12px;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.03);
}

.prs-rbg-panel-head{
    display:flex;
    align-items:flex-start;
    gap:12px;
    margin-bottom:10px;
}

.prs-rbg-step{
    width:40px;
    height:40px;
    min-width:40px;
    border-radius:14px;
    display:flex;
    align-items:center;
    justify-content:center;
    background:linear-gradient(180deg,#e0c157 0%, #be9233 100%);
    color:#101010;
    font-weight:800;
    font-size:14px;
    box-shadow:0 8px 18px rgba(224,193,87,.20);
}

.prs-rbg-panel-head h3{
    margin:0;
    color:#fff;
    font-size:19px;
    line-height:1.1;
    font-weight:800;
}

.prs-rbg-panel-head p{
    margin:4px 0 0;
    font-size:12px;
    color:#9d9d9d;
}

.prs-rbg-stage{
    position:relative;
    width:100%;
    height:clamp(260px, 36vh, 345px);
    background:
        linear-gradient(45deg, rgba(255,255,255,.025) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(255,255,255,.025) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(255,255,255,.025) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(255,255,255,.025) 75%),
        #050505;
    background-size:24px 24px;
    background-position:0 0, 0 12px, 12px -12px, -12px 0;
    border:1px solid rgba(224,193,87,.18);
    border-radius:18px;
    overflow:hidden;
    display:flex;
    align-items:center;
    justify-content:center;
}

.prs-rbg-stage img{
    max-width:100%;
    max-height:100%;
    width:auto;
    height:auto;
    display:block;
    object-fit:contain;
}

.prs-rbg-stage-input{
    cursor:pointer;
    transition:.25s ease;
}

.prs-rbg-stage-input:hover{
    border-color:rgba(224,193,87,.42);
    transform:translateY(-1px);
}

.prs-rbg-empty{
    text-align:center;
    padding:20px;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:12px;
    color:#fff;
}

.prs-rbg-empty strong{
    font-size:22px;
    line-height:1.1;
    font-weight:800;
}

.prs-rbg-empty span{
    color:#b7b7b7;
    font-size:13px;
}

.prs-rbg-empty-icon{
    width:68px;
    height:68px;
    border-radius:22px;
    background:linear-gradient(180deg,#e0c157 0%, #be9233 100%);
    display:flex;
    align-items:center;
    justify-content:center;
    color:#111;
    font-size:28px;
    box-shadow:0 12px 24px rgba(224,193,87,.18);
}

.prs-rbg-loader{
    position:absolute;
    inset:0;
    background:rgba(5,5,5,.78);
    backdrop-filter:blur(8px);
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:10px;
    text-align:center;
    z-index:5;
}

.prs-rbg-loader span{
    width:46px;
    height:46px;
    border-radius:50%;
    border:4px solid rgba(224,193,87,.20);
    border-top-color:#e0c157;
    animation:prs-rbg-spin .8s linear infinite;
}

.prs-rbg-loader strong{
    color:#fff;
    font-size:16px;
}

.prs-rbg-loader small{
    color:#b7b7b7;
    font-size:12px;
}

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

.prs-rbg-result-actions{
    position:absolute;
    left:14px;
    right:14px;
    bottom:14px;
    display:flex;
    gap:10px;
    justify-content:flex-end;
    flex-wrap:wrap;
}

.prs-rbg-btn,
.prs-rbg-chip{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding:10px 16px;
    border-radius:16px;
    border:1px solid rgba(224,193,87,.22);
    text-decoration:none;
    cursor:pointer;
    transition:.22s ease;
    font-size:14px;
    font-weight:700;
    background:none;
    color:#fff;
    white-space:nowrap;
}

.prs-rbg-btn:hover,
.prs-rbg-chip:hover{
    transform:translateY(-1px);
}

.prs-rbg-btn-gold,
.prs-rbg-chip-btn{
    background:linear-gradient(180deg,#e0c157 0%, #be9233 100%);
    color:#101010;
    border-color:transparent;
}

.prs-rbg-btn-dark{
    background:#1a1d22;
    color:#f1f1f1;
}

.prs-rbg-btn-small{
    padding:8px 12px;
    font-size:12px;
}

.prs-rbg-toolbar{
    display:flex;
    flex-wrap:wrap;
    gap:12px;
    margin-bottom:8px;
}

.prs-rbg-toolbar-centered{
    justify-content:center;
    align-items:center;
}

.prs-rbg-select-wrap{
    display:flex;
    flex-direction:column;
    gap:0;
}

.prs-rbg-select-wrap label{
    position:absolute !important;
    width:1px !important;
    height:1px !important;
    padding:0 !important;
    margin:-1px !important;
    overflow:hidden !important;
    clip:rect(0,0,0,0) !important;
    border:0 !important;
}

.prs-rbg-select-inline select,
.prs-rbg-select-inline input[type="color"]{
    min-width:170px;
    height:44px;
    border-radius:999px;
    border:1px solid rgba(224,193,87,.30);
    background:#14171c;
    color:#fff;
    padding:0 16px;
    box-sizing:border-box;
    outline:none;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.02);
}

.prs-rbg-select-inline select{
    appearance:none;
    -webkit-appearance:none;
    background-image:linear-gradient(45deg, transparent 50%, #d8b548 50%), linear-gradient(135deg, #d8b548 50%, transparent 50%);
    background-position:calc(100% - 16px) calc(50% - 2px), calc(100% - 11px) calc(50% - 2px);
    background-size:5px 5px, 5px 5px;
    background-repeat:no-repeat;
    padding-right:34px;
}

.prs-rbg-color-wrap input[type="color"]{
    min-width:54px;
    width:54px;
    padding:4px;
}

.prs-rbg-status{
    min-height:22px;
    margin:0 0 10px;
    font-size:13px;
    font-weight:600;
    color:#c7c7c7;
    text-align:center;
}

.prs-rbg-status.is-error{ color:#ff7a7a; }
.prs-rbg-status.is-success{ color:#86efac; }
.prs-rbg-status.is-loading{ color:#e8c75d; }

.prs-rbg-composer{
    display:flex;
    align-items:center;
    gap:10px;
    padding:8px;
    background:linear-gradient(180deg,#15181d 0%, #121417 100%);
    border:1px solid rgba(224,193,87,.22);
    border-radius:22px;
}

.prs-rbg-composer-icon,
.prs-rbg-composer-send{
    width:54px;
    height:54px;
    min-width:54px;
    border:none;
    border-radius:18px;
    cursor:pointer;
    font-size:22px;
    font-weight:700;
    transition:.25s ease;
    background:linear-gradient(180deg,#e0c157 0%, #be9233 100%);
    color:#101010;
}

.prs-rbg-composer-icon:hover,
.prs-rbg-composer-send:hover{
    transform:translateY(-1px);
    box-shadow:0 10px 20px rgba(224,193,87,.18);
}

.prs-rbg-composer-input{
    flex:1;
    height:54px;
    border:none;
    outline:none;
    background:#1b1f24;
    border-radius:16px;
    color:#fff;
    padding:0 16px;
    font-size:14px;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.02);
}

.prs-rbg-composer-input::placeholder{
    color:#989898;
}

.prs-rbg-app.is-busy .prs-rbg-composer-send,
.prs-rbg-app.is-busy .prs-rbg-composer-icon{
    opacity:.65;
    pointer-events:none;
}

.prs-rbg-history-modal{
    position:fixed;
    inset:0;
    z-index:99999;
}

.prs-rbg-history-backdrop{
    position:absolute;
    inset:0;
    background:rgba(0,0,0,.72);
    backdrop-filter:blur(6px);
}

.prs-rbg-history-dialog{
    position:relative;
    z-index:2;
    width:min(1080px, calc(100vw - 32px));
    max-height:min(84vh, 820px);
    margin:6vh auto 0;
    background:linear-gradient(180deg,#0f1115 0%, #090a0d 100%);
    border:1px solid rgba(224,193,87,.22);
    border-radius:24px;
    padding:16px;
    box-shadow:0 24px 60px rgba(0,0,0,.45);
    overflow:auto;
}

.prs-rbg-history-dialog-head{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:14px;
    margin-bottom:14px;
}

.prs-rbg-history-dialog-head h4{
    margin:0;
    font-size:22px;
    color:#fff;
    font-weight:800;
}

.prs-rbg-history-dialog-actions{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
}

.prs-rbg-history-grid{
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(180px,1fr));
    gap:12px;
}

.prs-rbg-history-grid-modal{
    padding-bottom:4px;
}

.prs-rbg-history-item{
    background:#171a20;
    border:1px solid rgba(224,193,87,.14);
    border-radius:14px;
    overflow:hidden;
    padding:10px;
    cursor:pointer;
    transition:.22s ease;
}

.prs-rbg-history-item:hover{
    transform:translateY(-2px);
    border-color:rgba(224,193,87,.34);
}

.prs-rbg-history-item img{
    width:100%;
    height:140px;
    object-fit:contain;
    background:#0b0b0d;
    border-radius:10px;
    display:block;
}

.prs-rbg-history-item strong{
    display:block;
    margin-top:8px;
    font-size:12px;
    color:#fff;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.prs-rbg-history-item span,
.prs-rbg-history-empty{
    display:block;
    margin-top:4px;
    font-size:11px;
    color:#a8a8a8;
}

@media (max-width: 1024px){
    .prs-rbg-grid{
        grid-template-columns:1fr;
    }

    .prs-rbg-stage{
        height:320px;
    }
}

@media (max-width: 767px){
    .prs-rbg-shell{
        padding:10px;
        border-radius:18px;
    }

    .prs-rbg-panel{
        padding:10px;
        border-radius:16px;
    }

    .prs-rbg-stage{
        height:280px;
    }

    .prs-rbg-empty strong{
        font-size:19px;
    }

    .prs-rbg-toolbar{
        gap:8px;
    }

    .prs-rbg-select-inline select{
        min-width:150px;
        width:150px;
        font-size:13px;
    }

    .prs-rbg-chip{
        min-width:120px;
        font-size:13px;
    }

    .prs-rbg-composer{
        gap:8px;
        padding:8px;
    }

    .prs-rbg-composer-icon,
    .prs-rbg-composer-send{
        width:48px;
        height:48px;
        min-width:48px;
        border-radius:14px;
        font-size:20px;
    }

    .prs-rbg-composer-input{
        height:48px;
        font-size:13px;
    }

    .prs-rbg-history-dialog{
        width:calc(100vw - 16px);
        margin:3vh auto 0;
        max-height:90vh;
        padding:12px;
        border-radius:18px;
    }

    .prs-rbg-history-dialog-head{
        align-items:flex-start;
        flex-direction:column;
    }
}
