
:root{font-family:Inter,ui-sans-serif,system-ui,-apple-system,Segoe UI,sans-serif;color:#1d2738;background:#f7f9fc}*{box-sizing:border-box}body{margin:0}a{color:#2356a6}header{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:17px max(4vw,20px);background:#fff;border-bottom:1px solid #e5eaf0;position:sticky;top:0;z-index:2}.brand{font-weight:850;font-size:1.4rem;text-decoration:none;color:#173d72}nav{display:flex;flex-wrap:wrap;gap:22px}nav a{text-decoration:none;color:#35465f;font-weight:650;font-size:.92rem}nav a[aria-current]{color:#165eb9}main{max-width:1160px;margin:auto;padding:24px 24px 80px}.hero{text-align:center;padding:50px 8px 35px}.hero h1{font-size:clamp(2.25rem,5vw,3.5rem);letter-spacing:-.05em;line-height:1.1;max-width:750px;margin:9px auto 18px}.hero p{color:#56657b;max-width:670px;margin:0 auto 20px}.eyebrow{font-size:.76rem;letter-spacing:.14em;color:#245eb2!important;font-weight:850}.heroactions{display:flex;gap:12px;justify-content:center;margin:25px auto}.button,button,.outline{display:inline-block;border-radius:10px;padding:13px 20px;border:1px solid #2057a8;text-decoration:none;font-weight:750;cursor:pointer}.button,button{background:#2057a8;color:white}.outline{background:white;color:#2057a8}.fine,.muted{color:#6c7788;font-size:.9rem}.value{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin:15px 0 46px}.value>div,.tool,.panel,.info{background:white;border:1px solid #e4e9f2;border-radius:14px}.value>div{padding:22px}.value strong{font-size:1.15rem}.value p{color:#66748a}.section-heading{font-size:1.9rem}.category{margin:32px 0}.category h2{font-size:1.18rem;color:#3c4759;margin:15px 0}.toolgrid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:11px}.tool{padding:18px 15px;display:flex;align-items:center;gap:12px;color:inherit;text-decoration:none;min-height:91px;transition:border-color .15s}.tool:hover{border-color:#8eadd4}.symbol{display:grid;place-items:center;width:36px;height:36px;flex-shrink:0;border-radius:10px;background:#eaf1fc;color:#2c69b7}.toolcopy{display:grid;gap:4px;flex:1}.toolcopy small{color:#69768a;font-size:.81rem}.state{font-size:.66rem;padding:5px 7px;border-radius:999px;white-space:nowrap}.ready{background:#e9f6ed;color:#20733c}.planned{background:#f1f3f7;color:#667184}.info{padding:24px 30px;margin-top:40px;line-height:1.6}.smallhero{padding:35px 0}.panel{max-width:650px;margin:5px auto;padding:28px}form{display:grid;gap:17px}label{font-weight:700}input,select{width:100%;padding:14px;border:1px solid #cdd7e4;border-radius:9px;background:#fff}#result{border-top:1px solid #e0e5ec;padding-top:20px;margin-top:25px}#result a,#result button{margin:5px 8px 5px 0}#message{line-height:1.5}footer{text-align:center;color:#778398;padding:30px}[hidden]{display:none!important}@media(max-width:850px){.toolgrid{grid-template-columns:repeat(2,minmax(0,1fr))}.value{grid-template-columns:1fr}}@media(max-width:560px){header{display:block}nav{gap:10px;margin-top:12px}.toolgrid{grid-template-columns:1fr}.state{font-size:.65rem}main{padding:18px 14px}.hero{padding:25px 0}}

.pdf-editor{border:1px solid #d4e0ef;background:#f5f8fd;padding:16px;border-radius:14px;margin:10px 0}.editor-controls{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin:12px 0}.editor-controls button{padding:8px 12px;font-size:.85rem}#editor-canvas-wrap{max-height:650px;overflow:auto;background:#dee8f5;padding:10px;border-radius:8px}#editor-canvas{display:block;max-width:100%;height:auto;background:#fff;margin:auto;cursor:crosshair;box-shadow:0 2px 12px #66789130}#editor-status{font-size:.85rem;color:#46546a}

/* FileHub Apple-inspired design system: shared across Tools */
:root{--fh-ink:#111827;--fh-muted:#667085;--fh-blue:#1677ff;--fh-border:#e5e7eb;--fh-surface:#fff;--fh-canvas:#f5f5f7;font-family:-apple-system,BlinkMacSystemFont,"SF Pro Display","Segoe UI",sans-serif;color:var(--fh-ink);background:var(--fh-canvas)}
body{background:var(--fh-canvas);color:var(--fh-ink)}
header{background:rgba(255,255,255,.9);backdrop-filter:blur(18px);border-bottom:1px solid #e9ebef;box-shadow:none}
.brand{color:var(--fh-ink);letter-spacing:-.045em}
nav a{color:#525761;font-weight:550}nav a[aria-current]{color:var(--fh-blue)}
.hero{padding:64px 12px 50px}.hero h1{font-weight:760;letter-spacing:-.052em}.eyebrow{color:var(--fh-blue)!important;letter-spacing:.1em}
.value>div,.tool,.panel,.info{border:1px solid var(--fh-border);border-radius:22px;background:var(--fh-surface);box-shadow:0 6px 26px rgba(19,27,44,.035)}
.tool{transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease}.tool:hover{transform:translateY(-2px);border-color:#bfcfe5;box-shadow:0 9px 22px rgba(19,27,44,.08)}
.symbol{background:#edf4ff;color:var(--fh-blue);border-radius:12px}.button,button,.outline{border-radius:12px;border-color:var(--fh-blue);font-weight:650}.button,button{background:var(--fh-blue)}.outline{color:var(--fh-blue)}
input:focus-visible,button:focus-visible,a:focus-visible{outline:3px solid #a5ceff;outline-offset:3px}.credit-panel{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:12px 0;padding:14px;background:#eff6ff;border:1px solid #c9e0ff;border-radius:14px}.credit-panel button{margin-left:auto}
@media(prefers-reduced-motion:reduce){.tool{transition:none}.tool:hover{transform:none}}

/* Shared workspace on every available tool: preview first, paywall only at download */
.workspace{margin:8px 0 16px;padding:18px;border:1px solid #e1e6ed;background:#fbfcff;border-radius:18px}
.workspace-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}.workspace-heading h2{margin:0 0 4px;font-size:1.05rem}.workspace-heading p{margin:0}.count{font-size:.82rem;color:#56677f}
.page-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(115px,1fr));gap:12px;margin:17px 0}
.page-card{background:#fff;border:1px solid #e0e6f0;border-radius:14px;padding:8px;display:grid;gap:6px;min-width:0;box-shadow:0 2px 7px #11283f0a}
.page-card canvas,.page-card img{width:100%;aspect-ratio:3/4;object-fit:contain;background:#edf0f5;border-radius:8px;display:block}
.page-card small{font-size:.74rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#59697e}
.page-actions{display:flex;gap:5px}.page-actions button{padding:7px 8px;min-width:0;flex:1;font-size:.8rem;background:#f2f6fc;color:#215baf;border:1px solid #d9e4f3}
.page-card[aria-grabbed="true"]{outline:2px solid var(--fh-blue)}.paywall{border:1px solid #d9e5f7;border-radius:16px;background:#f7faff;padding:18px;margin-top:16px}
.paywall h3{margin:0 0 8px}.paywall p{font-size:.91rem;color:#4b596d}
#unlock{width:100%}#download{margin-top:12px}
@media(max-width:520px){.page-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* V6.1: make PDF page order obvious and moves immediately visible */
.page-order-badge{font-size:.76rem;color:#1d4ed8;background:#eaf2ff;border-radius:8px;padding:5px 7px;text-align:center}
.page-source{white-space:normal!important;overflow:visible!important;overflow-wrap:anywhere;line-height:1.3;min-height:2.2em}
.page-card[draggable=true]{cursor:grab}
.page-card[draggable=true]:active{cursor:grabbing}
.page-actions button:disabled{opacity:.35;cursor:not-allowed}
.page-actions button:not(:disabled):hover{background:#dceaff}

/* V9.1 upload list */
.selected-files{display:grid;gap:7px;margin:10px 0 18px}
.selected-file{display:flex;gap:10px;align-items:center;justify-content:space-between;background:#f5f8fd;border:1px solid #e1e8f2;border-radius:12px;padding:8px 10px;font-size:13px;min-width:0}
.selected-file span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.selected-file .remove-file{flex:none;min-width:31px;height:31px;border:1px solid #f2c7c7;background:#fff0f1;border-radius:9px;color:#bf303c;font-weight:700;font-size:18px;cursor:pointer}
.selected-file .remove-file:hover{background:#ffe1e5}

/* FileHub V16: compact, touch-friendly, cross-device layer. */
:root{--fh-target:44px}
html{overflow-x:clip;-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{min-width:0;overflow-wrap:break-word}
body img,body video,body canvas,body svg{max-width:100%}
header,main,footer,.panel,.tool,.toolcopy,.workspace,.workspace-heading,.page-card{min-width:0}
main{width:100%;max-width:1200px}
button,input,select,textarea,a.button{font:inherit}
button,.button,.outline,nav a{touch-action:manipulation}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid #f0b74a;outline-offset:2px}
form input:not([type=checkbox]):not([type=radio]):not([type=color]),form select,form textarea{min-height:44px;max-width:100%;font-size:16px}
form button,.fh-camera-button{min-height:44px}
form textarea{resize:vertical}
#tool-form,.panel,#options,#workspace{min-width:0;max-width:100%}
#options{display:grid;grid-template-columns:minmax(0,1fr);gap:9px}
#options[hidden],#options [hidden]{display:none!important}
#files{width:100%;max-width:100%}
.fh-camera-actions{display:flex;align-items:center;justify-content:flex-start;gap:11px 16px;flex-wrap:wrap}
.fh-camera-actions .fh-camera-button{background:#fff;color:#173d72;border:1px solid #c7d4e3;border-radius:12px;padding:11px 17px;white-space:nowrap}
.fh-camera-hint{flex:1 1 200px;font-size:13px;color:#56657b;line-height:1.5}
.fh-camera-input{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none;overflow:hidden}
.selected-files{min-width:0}.selected-file{min-width:0;display:flex;align-items:center;gap:8px;justify-content:space-between}.selected-file span{overflow-wrap:anywhere;min-width:0}.selected-file .remove-file{flex-shrink:0;min-width:44px;min-height:44px}
#workspace,.page-card{max-width:100%}.page-card canvas,.page-card img{max-width:100%;height:auto}
#message,#result,#paywall{overflow-wrap:anywhere}
@media(max-width:900px){
 header{position:static;flex-direction:column;align-items:stretch;gap:10px;padding:14px 18px}
 header nav{display:flex;flex-wrap:wrap;justify-content:center;gap:6px}
 header nav a{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:8px 10px;text-align:center}
 .brand{text-align:center}
 main{padding:18px 18px 58px}.toolgrid{grid-template-columns:repeat(2,minmax(0,1fr))}
 .hero{padding:26px 0 22px}.heroactions{flex-wrap:wrap}
 .panel{padding:clamp(15px,3vw,27px);width:100%;max-width:760px}
}
@media(max-width:600px){
 main{padding:13px 12px 48px}header{padding:12px}
 .hero h1{font-size:clamp(28px,8vw,40px)}.hero p{font-size:15px;line-height:1.55}
 .toolgrid,.value{grid-template-columns:minmax(0,1fr)}
 .tool{padding:14px;min-height:76px}
 .panel{padding:16px;border-radius:15px}
 .fh-camera-actions{align-items:stretch;flex-direction:column}
 .fh-camera-actions .fh-camera-button{width:100%}
 .page-card{max-width:100%;touch-action:pan-y}
 .workspace-heading{display:flex;align-items:center;flex-wrap:wrap;gap:8px}
 .workspace-heading button{max-width:100%;white-space:normal}
 .heroactions .button,.heroactions .outline{width:100%;text-align:center}
}
@media(max-width:380px){header nav a{font-size:12px;padding:7px}main{padding-inline:9px}}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}*,*::before,*::after{animation-duration:.01ms!important;transition-duration:.01ms!important}}

/* FileHub mobile polish V17: size, touch, contrast and overflow fixes. */
:root { --fh-touch:44px; }
*,*::before,*::after { box-sizing:border-box; }
html { -webkit-text-size-adjust:100%; }
body { overflow-x:clip; }
#tool-form, #workspace, .workspace, .panel, .page-card, .page-actions, .selected-file { min-width:0; }
.page-actions {display:flex;flex-wrap:wrap;justify-content:center;gap:7px;align-items:center;margin-top:8px;}
.page-actions button, .page-undo, #clearImagePlacement, .remove-file {min-width:44px;min-height:44px;padding:9px 12px;touch-action:manipulation;}
.page-actions button {flex:0 0 auto;}
.page-actions button:disabled {opacity:.42;cursor:not-allowed;}
#options label, #image-controls label, #text-controls label {overflow-wrap:anywhere;}
#options input:not([type=checkbox]):not([type=radio]):not([type=color]), #options select, #options textarea {width:100%;min-width:0;max-width:100%;font-size:16px;}
#options input[type=color] {width:68px;min-height:44px;}
#options input[type=checkbox] {width:19px;height:19px;vertical-align:middle;}
#workspace button {white-space:normal;}
#page-grid {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,235px),1fr));gap:14px;}
.page-card {width:100%;padding:12px;overflow:hidden;}
.page-card .page-source {display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.filehub-image-stage,.filehub-text-select-stage {max-width:100%;}
.filehub-image-stage canvas, .filehub-text-select-stage canvas {display:block;max-width:100%;height:auto;}
.image-placement-preview {touch-action:none;}
.filehub-image-stage {touch-action:pan-y!important;}
.filehub-camera-image {display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin:10px 0;}
.filehub-camera-image button {min-height:44px;border-radius:12px;border:1px solid #c4d4e4;background:#fff;color:#123b68;padding:10px 16px;font-weight:700;}
.filehub-camera-image small {color:#5e6c7d;line-height:1.5;flex:1 1 185px;}
.filehub-camera-image input {position:absolute;left:-10000px;width:1px;height:1px;opacity:0;}
@media (max-width:760px) {
 .page-card {max-width:100%;}
 #page-grid {grid-template-columns:repeat(auto-fit,minmax(min(100%,190px),1fr));}
 .workspace-heading {gap:8px;flex-wrap:wrap;justify-content:center;}
 .workspace-heading button {flex:1 1 110px;}
 .page-actions {gap:9px;}
 .filehub-select-text {min-height:14px;}
 #tool-form button[type=submit] {width:100%;min-height:48px;}
}
@media(max-width:420px) {
 #page-grid {grid-template-columns:minmax(0,1fr);}
 .page-card {width:min(100%,360px);margin-inline:auto;}
 .filehub-camera-image {flex-direction:column;align-items:stretch;}
 .filehub-camera-image button {width:100%;}
}
@media(prefers-reduced-motion:reduce){ .page-card,button{scroll-behavior:auto;transition:none!important;} }

/* FileHub: accessible multipage camera scan controls */
.page-actions{display:flex;justify-content:center;gap:8px;flex-wrap:wrap;align-items:center}
.page-actions button{min-height:44px;min-width:44px;border-radius:10px;touch-action:manipulation}
.fh-camera-actions{max-width:100%}
.fh-scan-help{font-size:13px;line-height:1.45;color:#57677d;text-align:center;margin:8px auto}
@media(max-width:600px){.page-actions{width:100%;gap:7px}.page-actions button{flex:0 0 auto;min-height:44px;min-width:44px}.page-card{min-width:0;max-width:100%}}


/* FileHub V19 touch editor */
.filehub-image-stage,.filehub-text-select-stage{max-width:100%;}
.filehub-image-stage canvas,.filehub-text-select-stage canvas{max-width:100%;height:auto;}
.image-placement-preview,.text-placement-marker{user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;}
.image-placement-preview{touch-action:none;}
.image-resize-handle{min-width:28px;min-height:28px;right:0;bottom:0;transform:translate(4px,4px);}
.filehub-select-text{min-height:16px;touch-action:manipulation;}
.filehub-v19-sheet{position:fixed;inset:0;z-index:10050;background:rgba(12,23,40,.55);display:flex;align-items:center;justify-content:center;padding:16px;box-sizing:border-box;}
.filehub-v19-panel{width:min(100%,440px);max-height:90dvh;overflow:auto;box-sizing:border-box;background:#fff;color:#18263b;border-radius:18px;padding:22px;display:flex;gap:12px;flex-direction:column;box-shadow:0 18px 60px #0003;}
.filehub-v19-panel small{overflow-wrap:anywhere;color:#58677a;}
.filehub-v19-panel input{font-size:16px;min-height:48px;width:100%;box-sizing:border-box;border:1px solid #9daec0;border-radius:10px;padding:12px;}
.filehub-v19-actions{display:flex;gap:10px;justify-content:flex-end;flex-wrap:wrap;}
.filehub-v19-actions button{min-height:46px;min-width:115px;border-radius:10px;padding:10px 16px;}
.filehub-v19-primary{background:#153e66;color:#fff;border:1px solid #153e66;}
@media(max-width:650px){
 .filehub-v19-sheet{padding:0;align-items:flex-end;}
 .filehub-v19-panel{width:100%;max-height:78dvh;border-radius:20px 20px 0 0;padding:22px 18px max(22px,env(safe-area-inset-bottom));}
 .filehub-v19-actions button{flex:1 1 0;min-width:0;}
 .page-actions button,.page-undo,.remove-file{min-height:44px;min-width:44px;}
 .filehub-select-text{min-height:22px;}
}
