.file-actions{
    display:flex;
    align-items:center;
    justify-content:flex-end;
    gap:8px;
    flex-wrap:wrap;
}

.btn-doc-copy{
    background:linear-gradient(135deg,#7c3aed,#8b5cf6);
}

.btn-doc-jpg{
    background:linear-gradient(135deg,#0ea5e9,#2563eb);
}

.btn-doc-jpg.is-ready{
    background:linear-gradient(135deg,#22c55e,#16a34a);
}

.btn-doc-jpg.is-processing{
    background:#94a3b8;
    cursor:wait;
}

.btn-doc-copy.is-disabled,
.btn-doc-jpg.is-disabled{
    background:#cbd5e1;
    box-shadow:none;
    color:#64748b;
}

.doc-tool-box{
    width:min(860px,96vw);
    max-height:92vh;
    overflow:hidden;
    border-radius:28px;
    background:#fff;
    box-shadow:0 30px 90px rgba(17,24,39,.30);
    border:1px solid rgba(255,255,255,.9);
    display:flex;
    flex-direction:column;
    animation:popupIn .25s ease both;
}

.doc-tool-head{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:14px;
    padding:20px 20px 14px;
    border-bottom:1px solid #f1f5f9;
}

.doc-tool-head h3{
    font-size:20px;
    margin:0 0 4px;
}

.doc-tool-head p{
    margin:0;
    color:#667085;
    font-size:12.5px;
    line-height:1.5;
    word-break:break-word;
}

.doc-tool-close{
    width:40px;
    height:40px;
    flex:0 0 40px;
    border-radius:14px;
    background:#f2f4f7;
    color:#475467;
    font-size:20px;
    font-weight:900;
}

.doc-copy-body{
    padding:16px 20px;
    overflow:auto;
    min-height:220px;
    max-height:62vh;
    background:#f8fafc;
}

.doc-copy-editor{
    min-height:260px;
    padding:20px;
    border:1px solid #e2e8f0;
    border-radius:18px;
    background:#fff;
    color:#111827;
    line-height:1.65;
    font-family:"Times New Roman",serif;
    font-size:16px;
    outline:0;
}

.doc-copy-editor[contenteditable="true"]:focus{
    border-color:#8b5cf6;
    box-shadow:0 0 0 4px rgba(139,92,246,.10);
}

.doc-copy-warning{
    display:none;
    margin:0 20px 14px;
    padding:12px 14px;
    border-radius:16px;
    background:#fff7ed;
    border:1px solid #fed7aa;
    color:#9a3412;
    font-size:12.5px;
    line-height:1.55;
}

.doc-copy-warning.show{
    display:block;
}

.doc-tool-actions{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:10px;
    padding:14px 20px 20px;
}

.doc-tool-actions button,
.doc-tool-actions a{
    min-height:46px;
    border-radius:16px;
    display:flex;
    align-items:center;
    justify-content:center;
    font-weight:950;
    font-size:13px;
}

.doc-btn-secondary{
    background:#f2f4f7;
    color:#344054;
}

.doc-btn-primary{
    color:#fff;
    background:linear-gradient(135deg,#7c3aed,#8b5cf6);
}

.doc-btn-primary:disabled{
    background:#cbd5e1;
    color:#64748b;
    cursor:not-allowed;
}

.doc-progress-body{
    padding:28px 20px 16px;
    text-align:center;
}

.doc-progress-icon{
    width:64px;
    height:64px;
    border-radius:22px;
    margin:0 auto 14px;
    display:flex;
    align-items:center;
    justify-content:center;
    color:#fff;
    background:linear-gradient(135deg,#0ea5e9,#7c3aed);
    font-size:26px;
    font-weight:950;
    box-shadow:0 16px 36px rgba(37,99,235,.20);
}

.doc-progress-title{
    font-size:20px;
    font-weight:950;
    margin-bottom:6px;
}

.doc-progress-msg{
    color:#667085;
    font-size:13px;
    line-height:1.55;
    min-height:21px;
}

.doc-progress-track{
    height:11px;
    margin-top:18px;
    border-radius:999px;
    overflow:hidden;
    background:#e2e8f0;
}

.doc-progress-bar{
    width:0;
    height:100%;
    border-radius:999px;
    background:linear-gradient(90deg,#2563eb,#8b5cf6);
    transition:width .25s ease;
}

.doc-progress-count{
    margin-top:8px;
    color:#475467;
    font-size:12px;
    font-weight:900;
}

.doc-download-ready{
    display:none;
    margin-top:16px;
    min-height:46px;
    border-radius:16px;
    align-items:center;
    justify-content:center;
    color:#fff;
    background:linear-gradient(135deg,#22c55e,#16a34a);
    font-size:13px;
    font-weight:950;
}

.doc-download-ready.show{
    display:flex;
}

@media(max-width:650px){
    .file-actions{
        display:grid;
        grid-template-columns:1fr 1fr;
        width:100%;
    }

    .file-actions .btn{
        width:100%;
        padding-left:8px;
        padding-right:8px;
        font-size:11.5px;
    }

    .doc-tool-box{
        width:100%;
        max-height:94vh;
        border-radius:28px 28px 0 0;
    }

    .doc-copy-body{
        max-height:58vh;
        padding:12px;
    }

    .doc-copy-editor{
        min-height:300px;
        padding:16px;
        font-size:15px;
    }

    .doc-tool-actions{
        padding:12px;
    }
}
