/* ==========================================================
   FrontHub Toolbox Standard v53
   Visual model: working PDF Tools
   ========================================================== */

.fhstd-credit-wrap{
    margin:10px 0 12px;
    font-size:11px;
}

.fhstd-credit-toggle{
    appearance:none;
    -webkit-appearance:none;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    box-sizing:border-box;
    width:100%;
    min-height:42px;
    padding:0 13px;
    border:1px solid #e1e6ef;
    border-radius:11px;
    background:#f8faff;
    color:#445067;
    font:inherit;
    font-size:11px;
    font-weight:800;
    text-align:left;
    cursor:pointer;
}

.fhstd-credit-toggle:hover{
    border-color:#cbd3ef;
    background:#f5f7ff;
}

.fhstd-credit-toggle .fhstd-credit-summary{
    display:flex;
    align-items:center;
    gap:8px;
    min-width:0;
}

.fhstd-credit-toggle .fhstd-credit-badge{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width:26px;
    height:22px;
    padding:0 7px;
    border-radius:999px;
    background:#eef0ff;
    color:#5561df;
    font-size:10px;
    font-weight:900;
    white-space:nowrap;
}

.fhstd-credit-toggle .fhstd-chevron{
    flex:0 0 auto;
    color:#7d8899;
    font-size:13px;
    transition:transform .18s ease;
}

.fhstd-credit-wrap.open .fhstd-chevron{
    transform:rotate(180deg);
}

.fhstd-credit-panel{
    margin-top:7px;
    padding:12px 13px;
    border:1px solid #e1e6ef;
    border-radius:11px;
    background:#fff;
}

.fhstd-credit-panel[hidden]{
    display:none!important;
}

.fhstd-credit-intro{
    margin:0 0 10px;
    color:#7a8597;
    font-size:9px;
    line-height:1.45;
}

.fhstd-credit-line{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:14px;
    padding:8px 0;
    border-top:1px solid #edf0f5;
}

.fhstd-credit-line:first-of-type{
    border-top:0;
    padding-top:0;
}

.fhstd-credit-line>div{
    min-width:0;
}

.fhstd-credit-line strong,
.fhstd-credit-line small{
    display:block;
}

.fhstd-credit-line strong{
    overflow:hidden;
    color:#39465d;
    font-size:10px;
    text-overflow:ellipsis;
    white-space:nowrap;
}

.fhstd-credit-line small{
    margin-top:3px;
    color:#8994a6;
    font-size:9px;
}

.fhstd-credit-line>span{
    flex:0 0 auto;
    color:#4e59cf;
    font-size:10px;
    font-weight:900;
    white-space:nowrap;
}

.fhstd-credit-operation{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding:8px 0;
    border-top:1px solid #edf0f5;
}

.fhstd-credit-operation div strong,
.fhstd-credit-operation div small{
    display:block;
}

.fhstd-credit-operation div strong{
    color:#39465d;
    font-size:10px;
}

.fhstd-credit-operation div small{
    margin-top:3px;
    color:#8994a6;
    font-size:9px;
}

.fhstd-credit-operation>span{
    color:#788497;
    font-size:10px;
    font-weight:800;
}

.fhstd-credit-total{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    margin-top:2px;
    padding-top:10px;
    border-top:1px solid #dfe5ed;
    color:#2d394d;
    font-size:11px;
}

.fhstd-credit-total strong{
    color:#3546c5;
    font-size:12px;
}

.fhstd-credit-warning{
    margin-top:10px;
    padding:10px 11px;
    border:1px solid #f0cccc;
    border-radius:9px;
    background:#fff2f2;
    color:#aa291f;
    font-size:10px;
    line-height:1.45;
}

.fhstd-credit-warning[hidden]{
    display:none!important;
}

/* PDF password block - same visual family as PDF Tools */
.fhstd-password{
    display:grid;
    grid-template-columns:34px minmax(0,1fr);
    gap:9px 11px;
    align-items:center;
    box-sizing:border-box;
    margin-top:12px;
    padding:12px 13px;
    border:1px solid #ecd7a6;
    border-radius:11px;
    background:#fffaf0;
}

.fhstd-password[hidden]{
    display:none!important;
}

.fhstd-password-icon{
    display:flex;
    align-items:center;
    justify-content:center;
    width:32px;
    height:32px;
    border-radius:9px;
    background:#fff0c9;
    font-size:15px;
}

.fhstd-password strong,
.fhstd-password small{
    display:block;
}

.fhstd-password strong{
    color:#765400;
    font-size:10px;
}

.fhstd-password small{
    margin-top:3px;
    color:#8b7440;
    font-size:9px;
}

.fhstd-password input{
    grid-column:1/-1;
    box-sizing:border-box;
    width:100%;
    height:40px;
    padding:0 11px;
    border:1px solid #e2c980;
    border-radius:9px;
    outline:none;
    background:#fff;
    color:#283247;
}

/* Standard PDF Tools-style progress */
.fhstd-progress{
    margin-top:15px;
}

.fhstd-progress[hidden]{
    display:none!important;
}

.fhstd-progress-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    margin-bottom:6px;
    color:#596477;
    font-size:10px;
}

.fhstd-progress-head strong{
    color:#39465d;
}

.fhstd-progress-track{
    height:8px;
    overflow:hidden;
    border-radius:999px;
    background:#e9edf4;
}

.fhstd-progress-track i{
    display:block;
    width:0;
    height:100%;
    border-radius:inherit;
    background:linear-gradient(90deg,#6659ef,#38a0ed);
    transition:width .28s ease;
}

/* Normalize common existing progress blocks to same look without changing logic */
.fhpdf-progress,
.fh-progress,
.progress-bar-wrap,
.fh-convert-progress{
    overflow:hidden;
    border-radius:999px!important;
    background:#e9edf4!important;
}

.fhpdf-progress i,
.fh-progress i,
.progress-bar-wrap>i,
.fh-convert-progress>i{
    background:linear-gradient(90deg,#6659ef,#38a0ed)!important;
}

/* Common file row */
.fhstd-file-row{
    display:grid;
    grid-template-columns:36px minmax(0,1fr) 32px;
    align-items:center;
    gap:9px;
    margin-top:9px;
    padding:8px 9px;
    border:1px solid #e6eaf1;
    border-radius:10px;
    background:#fff;
}

.fhstd-file-row strong,
.fhstd-file-row small{
    display:block;
}

.fhstd-file-row strong{
    overflow:hidden;
    color:#354157;
    font-size:10px;
    text-overflow:ellipsis;
    white-space:nowrap;
}

.fhstd-file-row small{
    margin-top:2px;
    color:#8a95a6;
    font-size:9px;
}

/* Dark mode */
html[data-theme="dark"] .fhstd-credit-toggle,
html.dark .fhstd-credit-toggle,
body.dark .fhstd-credit-toggle{
    border-color:#303b4d;
    background:#161e2a;
    color:#e6edf7;
}

html[data-theme="dark"] .fhstd-credit-panel,
html.dark .fhstd-credit-panel,
body.dark .fhstd-credit-panel,
html[data-theme="dark"] .fhstd-file-row,
html.dark .fhstd-file-row,
body.dark .fhstd-file-row{
    border-color:#303b4d;
    background:#111823;
    color:#e6edf7;
}

html[data-theme="dark"] .fhstd-credit-line strong,
html.dark .fhstd-credit-line strong,
html[data-theme="dark"] .fhstd-credit-operation div strong,
html.dark .fhstd-credit-operation div strong,
html[data-theme="dark"] .fhstd-credit-total,
html.dark .fhstd-credit-total{
    color:#e4eaf4;
}


/* ===== v54: one credit detail UI only ===== */
.fhpc52-breakdown,
.fhpc51-breakdown,
.fhpc-credit-breakdown,
.fh-global-credit-v51,
.fh-global-credit-v50{
    display:none!important;
}

.fhstd-credit-panel{
    display:none!important;
}

.fhstd-credit-wrap.open > .fhstd-credit-panel{
    display:block!important;
}

.fhstd-credit-toggle{
    transition:border-color .16s ease,background .16s ease,box-shadow .16s ease;
}

.fhstd-credit-wrap.open .fhstd-credit-toggle{
    border-color:#cbd3ef;
    background:#f5f7ff;
    box-shadow:0 0 0 3px rgba(91,99,233,.05);
}

.fhstd-credit-toggle:focus-visible{
    outline:2px solid #6570e8;
    outline-offset:2px;
}

/* v55: compact credit toggle becomes visible after picker OR drag/drop */
.fhstd-credit-wrap:not([hidden]){
    display:block!important;
}
