/* FileHub document workspace — responsive, high-contrast and touch-first */
body.fh-editor-full main{max-width:none!important;width:100%!important;padding:0!important;margin:0!important}
body.fh-editor-full main>.hero,body.fh-editor-full main>.panel{display:none!important}
body.fh-editor-full .fh-seo{max-width:1100px;margin:30px auto;padding:0 20px}
.fhe{--ink:#10233e;--border:#d9e1ee;--blue:#2363e8;--bg:#f2f5fa;color:var(--ink);background:var(--bg);font:14px/1.45 system-ui,-apple-system,'Segoe UI',sans-serif;min-height:74vh;}
.fhe *{box-sizing:border-box}.fhe button,.fhe input,.fhe select,.fhe textarea{font:inherit}.fhe button{cursor:pointer}.fhe button:disabled{opacity:.4;cursor:not-allowed}
.fhe button:focus-visible,.fhe input:focus-visible,.fhe select:focus-visible,.fhe textarea:focus-visible{outline:3px solid #79b5ff;outline-offset:2px}
.fhe-header{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:13px 22px;background:white;border-bottom:1px solid var(--border);position:sticky;top:0;z-index:40;flex-wrap:wrap}
.fhe-brand{display:flex;align-items:center;gap:10px;min-width:0}.fhe-brand b{font-size:18px}.fhe-brand span{display:block;font-size:12px;color:#66768e}.fhe-logo{background:#0a1b37;color:#fff;font-size:13px;font-weight:800;border-radius:7px;padding:8px}
.fhe-main-actions,.fhe-tools,.fhe-properties-buttons{display:flex;align-items:center;gap:7px;flex-wrap:wrap}.fhe-btn{border:1px solid var(--border);border-radius:10px;background:white;color:var(--ink);padding:10px 13px;min-height:42px;font-weight:600;white-space:nowrap}.fhe-btn.active{background:#e8efff;border-color:#86acff;color:#1048b8}.fhe-btn.primary{background:var(--blue);border-color:var(--blue);color:white}.fhe-btn.danger{color:#b92230}.fhe-btn:hover{box-shadow:0 2px 8px #0a214018}
.fhe-tools{padding:10px 18px;background:#fff;border-bottom:1px solid var(--border);position:sticky;top:70px;z-index:38;gap:6px;overflow-x:auto;flex-wrap:nowrap}.fhe-tools .fhe-btn{min-width:max-content;padding:9px 12px}.fhe-tools .fhe-spacer{flex:1;min-width:4px}
.fhe-grid{display:grid;grid-template-columns:172px minmax(0,1fr) 270px;min-height:68vh;max-height:calc(100vh - 182px)}.fhe-pages,.fhe-inspector{background:white;overflow:auto;padding:14px;border-right:1px solid var(--border)}.fhe-inspector{border-right:0;border-left:1px solid var(--border)}.fhe-pages h3,.fhe-inspector h3{font-size:14px;margin:0 0 12px}.fhe-page{border:2px solid transparent;border-radius:11px;margin:0 0 12px;padding:9px;background:#f7f9fc}.fhe-page.active{border-color:#2f75ec;background:#eaf1ff}.fhe-page canvas{width:100%;display:block;background:#fff;box-shadow:0 1px 4px #1c324022}.fhe-page label{display:block;text-align:center;margin:5px 0;font-weight:700}.fhe-page-controls{display:flex;gap:3px;justify-content:center;flex-wrap:wrap}.fhe-page-controls button{flex:1 1 30px;padding:7px;border:1px solid #d5dfed;background:white;border-radius:7px;min-width:27px}.fhe-page-controls button:focus-visible{outline:2px solid #2170ff}
.fhe-canvas-area{min-width:0;overflow:auto;position:relative;padding:22px 26px 50px;display:flex;align-items:flex-start;justify-content:center;background:#e9edf5}.fhe-document{position:relative;flex-shrink:0;background:#fff;box-shadow:0 8px 30px #1c2b4440;max-width:none;touch-action:pan-y pan-x}.fhe-document>canvas{display:block;width:100%;height:100%}.fhe-overlay{position:absolute;inset:0;overflow:hidden;pointer-events:none}.fhe-word{position:absolute;padding:0;margin:0;border:1px solid transparent;cursor:text;pointer-events:auto;white-space:pre;overflow:visible;font-family:Arial,sans-serif;color:transparent;background:transparent;line-height:1}.fhe-word:hover,.fhe-word:focus-visible{border:1px dashed #2563eb;background:#dbeafe66;color:#0f2752}.fhe-object{position:absolute;pointer-events:auto;touch-action:none;cursor:move;outline:1.5px dashed #2363e8;overflow:visible}.fhe-object.active{outline:2px solid #d09c27}.fhe-object .handle{position:absolute;right:-7px;bottom:-7px;width:21px;height:21px;background:#d4a12c;border:2px solid #fff;border-radius:5px;touch-action:none;cursor:nwse-resize}.fhe-object .object-label{pointer-events:none;font-size:9px;background:#d6a739;color:#101e32;position:absolute;top:-17px;left:0;padding:1px 4px;border-radius:3px}.fhe-object.image img{width:100%;height:100%;object-fit:fill;pointer-events:none}.fhe-object.text{padding:2px;white-space:pre-wrap;overflow:hidden;background:#fffdf5f0;color:#152036}.fhe-object.rectangle{border:2px solid #2363e8}.fhe-object.redact{background:#111827c0}.fhe-object.line{border-top:3px solid #2563eb;transform-origin:top left}.fhe-object.replacement{background:white;color:#10233e;white-space:nowrap;padding:1px 2px}
.fhe-inspector label{display:block;margin:11px 0 4px;font-size:12px;font-weight:650}.fhe-inspector input,.fhe-inspector select,.fhe-inspector textarea{width:100%;background:white;border:1px solid #cbd5e1;border-radius:8px;padding:9px;min-height:40px}.fhe-inspector textarea{min-height:100px;resize:vertical}.fhe-inspector input[type=color]{padding:3px;height:42px}.fhe-inspector .fhe-btn{width:100%;margin-top:8px}.fhe-muted{color:#66768e;font-size:12px}.fhe-status{font-size:12px;padding:10px 18px;background:#eef3fd;border-top:1px solid #d6e0f1;min-height:35px}.fhe-notice{font-size:12px;padding:9px;border:1px solid #f4d692;background:#fff9e9;border-radius:8px;margin:10px 0}.fhe-empty{text-align:center;max-width:500px;margin:12vh auto;padding:38px 22px;background:#fff;border:1px solid #dae3f1;border-radius:20px}.fhe-empty h2{font-size:25px;margin-bottom:10px}.fhe-empty p{color:#596a85}.fhe-empty .fhe-btn{margin-top:15px}.fhe-hidden{display:none!important}.fhe-mobile-pages{display:none}.fhe-small-row{display:flex;gap:7px}.fhe-small-row>*{flex:1;min-width:0}.fhe-output-info{background:#edf6f2;padding:10px;border-radius:9px;font-size:12px;margin-bottom:12px}.fhe-highlight{color:#1d55b6;font-weight:700}
@media(max-width:1020px){.fhe-grid{grid-template-columns:122px minmax(0,1fr) 220px}.fhe-pages,.fhe-inspector{padding:10px}.fhe-canvas-area{padding:16px}.fhe-brand b{font-size:15px}.fhe-header{padding:9px 12px}.fhe-tools{top:63px}}
@media(max-width:720px){.fhe-header{position:sticky;top:0;gap:7px}.fhe-main-actions{width:100%;justify-content:center}.fhe-main-actions .fhe-btn{flex:1;font-size:12px;padding:9px 7px;min-height:44px}.fhe-tools{top:106px;padding:8px;gap:5px}.fhe-tools .fhe-btn{min-height:44px}.fhe-grid{display:block;min-height:calc(100vh - 220px);max-height:none}.fhe-pages{display:none}.fhe-canvas-area{padding:13px 7px 28px;overflow:auto;min-height:430px;max-height:70vh}.fhe-inspector{border-top:1px solid #d9e1ee;border-left:0;overflow:visible;min-height:130px;padding:12px 15px}.fhe-inspector label{margin-top:7px}.fhe-inspector .fhe-btn{min-height:46px}.fhe-mobile-pages{display:flex;gap:10px;align-items:center;justify-content:center;background:white;padding:8px}.fhe-mobile-pages button{min-width:44px;min-height:44px}.fhe-document{box-shadow:0 3px 12px #1c2b442d}.fhe-word{min-height:10px}.fhe-empty{margin:5vh 12px}.fhe-header .fhe-brand span{display:none}}
@media(prefers-reduced-motion:reduce){.fhe *{scroll-behavior:auto!important}}

/* Edit PDF selection v22: text scope is readable and touch-accessible */
.fhe-selection-scope{display:flex;align-items:center;gap:6px;font-size:12px;font-weight:700;white-space:nowrap}
.fhe-selection-scope select{min-height:42px;border:1px solid #b7c8e0;border-radius:9px;background:#fff;color:#10233e;padding:6px 10px;font-size:14px}
.fhe-word:hover,.fhe-word:focus-visible{background:#cce0ff99;outline:2px solid #2563eb;outline-offset:0}
@media(max-width:720px){.fhe-selection-scope select{min-height:44px}.fhe-selection-scope{padding:2px 0}}

/* Real text selection: no duplicated text above the original PDF. */
.fhe-word,.fhe-word:hover,.fhe-word:focus-visible{font-size:0!important;color:transparent!important;text-shadow:none!important;}
.fhe-word:hover,.fhe-word:focus-visible{background:#93c5fd40!important;outline:1px solid #2563eb!important;border:0!important;}
.fhe-object.replacement{box-shadow:none;border:0;line-height:1.05;overflow:hidden;}
.fhe-focus .fhe-grid{grid-template-columns:0 minmax(0,1fr) 0;}
.fhe-focus .fhe-pages,.fhe-focus .fhe-inspector{display:none;}
.fhe-inline-editor{position:fixed;z-index:99999;width:min(342px,calc(100vw - 16px));background:#fff;border:1px solid #b8c9e4;border-radius:14px;box-shadow:0 14px 45px #071b3b45;padding:12px;display:flex;flex-direction:column;gap:9px;color:#10233e;font:14px system-ui,sans-serif;}
.fhe-inline-heading{font-weight:750;}
.fhe-inline-editor textarea{width:100%;min-height:60px;resize:vertical;font:16px system-ui,sans-serif;border:1px solid #b9cbe3;border-radius:8px;padding:9px;box-sizing:border-box;}
.fhe-inline-actions{display:flex;gap:6px;flex-wrap:wrap;}
.fhe-inline-actions .fhe-btn{flex:1;min-width:78px;padding:8px;}
@media(max-width:720px){.fhe-inline-editor{position:fixed!important;bottom:8px!important;top:auto!important;left:8px!important;width:calc(100vw - 16px)!important;}.fhe-focus .fhe-grid{display:block;}}

/* Actual PDF form fields: unobtrusive until hovered or selected. */
.fhe-form-hit{position:absolute;pointer-events:auto;background:transparent;border:1px solid transparent;border-radius:3px;cursor:text;color:transparent;font-size:0;}
.fhe-form-hit:hover,.fhe-form-hit:focus-visible{background:#dbeafe55;border:1px solid #2563eb;outline:0;}
.fhe-object.form{background:#e4f1ff88;outline:2px solid #2563eb;cursor:text;pointer-events:none;overflow:hidden;padding:1px;font-family:Arial,sans-serif;}
.fhe-object.form .handle{display:none;}
@media(max-width:720px){.fhe-form-hit{min-height:15px}.fhe-inline-editor textarea{font-size:16px;}}

/* Single editor: read-only selection details, no duplicate input in the sidebar. */
.fhe-selection-summary{overflow-wrap:anywhere;white-space:pre-wrap;border:1px solid #dbe4f2;background:#f5f8fd;border-radius:9px;padding:10px 12px;font-size:13px;line-height:1.5;color:#243852;}
.fhe-inline-editor{max-height:min(360px,calc(100dvh - 28px));overflow-y:auto;}
@media(max-width:720px){.fhe-inline-editor{max-height:min(55dvh,380px);}.fhe-selection-summary{padding:9px;}}


/* FILEHUB_INLINE_APPLY_STYLE_20261121 */
.fhe-inline-editor .fhe-apply-change{display:block!important;position:relative!important;visibility:visible!important;opacity:1!important;align-self:stretch;width:100%!important;min-height:46px!important;font-size:15px!important;font-weight:750!important;background:#2463eb!important;color:#fff!important;border:1px solid #2463eb!important;border-radius:10px!important;cursor:pointer!important;}
.fhe-inline-editor .fhe-apply-change:disabled{opacity:.48!important;cursor:not-allowed!important;}
.fhe-inline-editor .fhe-inline-hint{font-size:11px;line-height:1.35;color:#607189;}
.fhe-inline-editor .fhe-inline-actions{justify-content:space-between;gap:10px;}
.fhe-inline-editor .fhe-inline-actions>.fhe-btn{flex:1 1 auto;min-width:105px;}
@media(max-width:720px){.fhe-inline-editor .fhe-apply-change{min-height:50px!important;}.fhe-inline-editor .fhe-inline-actions>.fhe-btn{min-height:44px;}}

/* FileHub simplified form filling mode */
.fh-smart-form .fhe-smart-input {
    box-sizing: border-box;
    z-index: 30;
    pointer-events: auto;
    border: 1px solid rgba(37,99,235,.45);
    border-radius: 2px;
    background: rgba(219,234,254,.65);
    color: #111827;
    padding: 0 2px;
    margin: 0;
    min-width: 0;
    min-height: 0;
    font-family: Arial,sans-serif;
    line-height: 1;
}

.fh-smart-form .fhe-smart-input:focus {
    background: #fff;
    outline: 2px solid #2563eb;
    z-index: 40;
}

.fh-smart-form input.fhe-smart-input[type=checkbox] {
    appearance: auto;
    accent-color: #2563eb;
    cursor: pointer;
}

.fh-smart-form .fhe-tools [data-tool="select-image"],
.fh-smart-form .fhe-tools [data-tool="area-text"],
.fh-smart-form .fhe-tools [data-tool="rectangle"],
.fh-smart-form .fhe-tools [data-tool="redact"],
.fh-smart-form .fhe-tools [data-tool="line"],
.fh-smart-form .fhe-tools [data-tool="pages"],
.fh-smart-form .fhe-selection-scope {
    display: none !important;
}

.fh-smart-form .fhe-grid {
    grid-template-columns: 125px minmax(0,1fr) 200px !important;
}

@media(max-width:900px) {
    .fh-smart-form .fhe-grid {
        grid-template-columns: minmax(0,1fr) !important;
    }
}


/* Smart form polish */
.fh-smart-form .fhe-smart-input {
    background: rgba(219,234,254,.38);
    border-color: rgba(37,99,235,.28);
    transition: background .12s, outline .12s;
}
.fh-smart-form .fhe-smart-input:hover {
    background: rgba(219,234,254,.75);
}
.fh-smart-form .fhe-smart-input:focus {
    background: #ffffff;
    outline: 2px solid #2563eb;
}
.fh-smart-form textarea.fhe-smart-input {
    resize: none;
    white-space: pre-wrap;
    overflow-wrap: break-word;
    line-height: 1.2;
}
.fh-smart-form .fhe-tools {
    flex-wrap: wrap;
}

/* Responsive PDF Studio layout */

body.fh-editor-full main {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

#filehub-pdf-studio {
    position: relative !important;
    isolation: isolate;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-width: 0 !important;
    box-sizing: border-box;
    background: #fff;
    overflow: hidden;
}

#filehub-pdf-studio .fhe-grid {
    min-width: 0;
    height: auto !important;
    grid-template-columns:
        125px minmax(0, 1fr) 250px !important;
}

#filehub-pdf-studio .fhe-grid > * {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

#filehub-pdf-studio .fhe-canvas-area {
    overflow: auto;
}

#filehub-pdf-studio .fhe-header,
#filehub-pdf-studio .fhe-tools,
#filehub-pdf-studio .fhe-main-actions {
    flex-wrap: wrap;
    max-width: 100%;
}

#filehub-pdf-studio .fhe-inspector,
#filehub-pdf-studio #result,
#filehub-pdf-studio #paywall {
    background: #fff;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    overflow-wrap: anywhere;
}

#filehub-pdf-studio #result button,
#filehub-pdf-studio #result .button {
    width: 100%;
    max-width: 100%;
    white-space: normal;
    box-sizing: border-box;
    text-align: center;
}

body.fh-editor-full .fh-seo {
    position: relative !important;
    clear: both !important;
    margin-top: 32px !important;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

@media (max-width: 1200px) {

    #filehub-pdf-studio .fhe-grid {
        grid-template-columns:
            100px minmax(0, 1fr) !important;
    }

    #filehub-pdf-studio .fhe-inspector {
        grid-column: 1 / -1;
        position: relative !important;
        height: auto !important;
    }
}

@media (max-width: 768px) {

    #filehub-pdf-studio .fhe-grid {
        grid-template-columns:
            minmax(0, 1fr) !important;
    }

    #filehub-pdf-studio .fhe-pages {
        display: none !important;
    }

    #filehub-pdf-studio .fhe-header,
    #filehub-pdf-studio .fhe-main-actions {
        width: 100%;
    }

    #filehub-pdf-studio .fhe-main-actions button {
        flex: 1 1 auto;
    }

    #filehub-pdf-studio .fhe-canvas-area {
        padding: 8px !important;
    }

    #filehub-pdf-studio .fhe-inspector {
        width: 100%;
    }
}

