/* Shared PDF/document visual language, including upload and responsive action areas. */
.document-page:not(.merge-active):not(.pdf-work-active):not(.document-active) .thead { text-align:center;justify-content:center;margin:22px 0; }
.document-page .thead .ico,.document-page .badges { display:none; }
.document-page .thead__lead { font-size:14px;line-height:1.45;max-width:720px;margin:8px auto 0; }
.document-page .drop { min-height:170px;max-width:740px;margin:16px auto;padding:20px; }
.document-page .drop__title { display:inline-block;padding:14px 24px;border-radius:12px;background:var(--brand);color:#fff; }
.document-page .drop__hint { font-size:12px; }
.document-page .workspace { min-width:0; }
.document-page .tcontent { max-width:1200px;margin:32px auto; }
.document-active .thead { margin:8px 0; }
.document-active .thead h1 { font-size:24px; }
.document-active .thead__lead,.document-active .badges,.document-active .prostrip,.document-active .pro-strip,.document-active .next-steps { display:none; }
.document-active #fileName { overflow:hidden;white-space:nowrap;text-overflow:ellipsis; }
.document-active .workspace { max-height:calc(100dvh - 250px);overflow:auto;overscroll-behavior:contain; }
.document-active .bar:has(> .btn--primary) { position:sticky;bottom:0;z-index:8;background:var(--surface);padding:10px 0;border-top:1px solid var(--line); }
.document-active .bar .btn--primary { min-height:54px;font-weight:700; }
.document-active .tcontent { margin-top:100px; }
@media(max-width:879px){
 .document-page .thead h1 { font-size:22px; }
 .document-page .thead__lead { font-size:12px; }
 .document-page .drop { min-height:150px;padding:16px; }
 .document-page .drop__title { font-size:15px;padding:12px 18px; }
 .document-active .thead h1 { font-size:18px; }
 .document-active .workspace { max-height:calc(100dvh - 230px);padding:10px; }
 .document-active .bar:has(> .btn--primary) { display:flex;flex-direction:column;flex-wrap:nowrap;align-items:stretch;gap:6px; }
 .document-active .workspace .bar > .bar__grow:not(:empty) { flex:0 0 auto;font-size:11px; }
 .document-active .bar .btn--primary { width:100%;flex:0 0 auto;white-space:normal;min-height:52px;font-size:16px; }
 .document-active .fields { gap:8px; }
 .document-active .field label { font-size:12px; }
 .document-active .alert,.document-active .fitem__meta { font-size:12px; }
}

.document-page .prostrip,.document-page .pro-strip { display:none; }
.document-page [hidden] { display:none !important; }
.document-page[hidden] { display:none !important; }
.document-active .bar > .btn { min-width:0;max-width:100%;box-sizing:border-box; }
@media(max-width:879px){
 .document-active .workspace .bar > .bar__grow:not(:empty) { flex:0 0 auto;height:auto;min-height:0; }
 .document-active .workspace .bar:has(> .btn--primary) { min-width:0;width:100%;box-sizing:border-box; }
 .document-active.document-floor-shown .document-stage > .ad { display:none; }
 .document-active .filebar { min-width:0; }
 .document-active .filebar__name { font-size:12px; }
 .document-active .cv-opts,.document-active .pn-opts { min-width:0; }
 .document-active input,.document-active select { max-width:100%;min-width:0; }
}

.document-page #booklet .booklet__upload { margin-bottom:24px; }


.document-page .booklet__upload .bar { flex-wrap:nowrap; }
@media(max-width:879px){
 .document-page .booklet__upload .bar { flex-direction:column;align-items:stretch; }
 .document-page .workspace .booklet__upload .bar > .bar__grow:not(:empty) { flex:0 0 auto;font-size:11px; }
 .document-page #bookletMake { width:100%;min-height:52px;font-size:16px;white-space:normal; }
}

/* File editors keep processing controls inside their original DOM scopes. */
.document-active .tcontent,.document-active .next-steps { display:none; }
body.document-editing .ftr,body.document-editing #pageBottomAd { display:none; }
.document-active .document-action { flex-wrap:nowrap; }
.document-active .document-action > .bar__grow:not(:empty) { flex:0 0 auto;min-width:0; }
@media(max-width:879px){
 body.document-editing:not(.tool-result-open) { overflow:hidden; }
 .document-active { position:fixed;top:64px;left:0;right:0;bottom:calc(130px + env(safe-area-inset-bottom));display:flex;flex-direction:column;padding:0 10px;width:100%;box-sizing:border-box; }
 .document-active .thead { flex:0 0 auto;justify-content:center;text-align:center;margin:6px 0; }
 .document-active .thead h1 { font-size:17px;line-height:1.25; }
 .document-active .tool-workspace-stage { display:flex;flex:1;min-height:0; }
 .document-active .workspace { flex:1;min-height:0;max-height:none;width:100%;padding:8px 0 110px;border:0;box-shadow:none;border-radius:0;overflow:auto; }
 .document-active .document-action { position:fixed !important;bottom:calc(136px + env(safe-area-inset-bottom));left:10px;right:10px;z-index:12;width:auto !important;display:flex;flex-direction:column;flex-wrap:nowrap;gap:4px;padding:8px 0;background:var(--bg);margin:0;border-top:1px solid var(--line); }
 .document-active .document-action > * { flex:0 0 auto;min-width:0;max-width:100%; }
 .document-active .document-action > .bar__grow:not(:empty) { font-size:11px;line-height:1.3;height:auto; }
 .document-active .document-action .btn--primary { width:100%;min-height:52px;font-size:16px;white-space:normal; }
 .document-active .document-stage > .ad { position:fixed;bottom:0;left:10px;right:10px;height:120px;margin:0;overflow:hidden; }
 .document-active .document-stage > .ad .ad__box { height:90px;min-height:90px; }
 .document-active .flist { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px; }
 .document-active .fitem { flex-direction:column;min-width:0;padding:5px; }
 .document-active .fitem__thumb { width:100%;height:90px; }
 .document-active .fitem__name { font-size:10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
 .document-active .fitem__meta { font-size:10px; }
 .document-active .fitem__act { gap:2px; }
 .document-active .icon-btn { max-width:32px;min-width:0;padding:4px; }
 .document-active .pn-wrap { grid-template-columns:1fr;gap:10px; }
 .document-active .pn-page { min-height:160px; }
 .document-active .ed-bar { gap:5px; }
 .document-active .ed-bar .seg { flex-wrap:wrap; }
 .document-active .ed-stage { max-height:45dvh;overflow:auto; }
 body.document-editing.tool-result-open { overflow:auto; }
}

/* The introduction and upload occupy the first screen; useful guidance follows below. */
.document-stage { min-height:calc(100dvh - 64px);display:flex;flex-direction:column;padding-bottom:112px;box-sizing:border-box; }
.document-stage > .tool-workspace-stage { flex:1;min-height:0 !important; }
/* Idle uploads follow content height; loaded full-screen editors keep their sizing. */
body:not(.is-pro) .document-page:not(.document-active):not(.pdf-work-active):not(.merge-active):not(.photo-work-active):not(.pe-active) > .document-stage { min-height:0;padding-bottom:0; }
body:not(.is-pro) .document-page:not(.document-active):not(.pdf-work-active):not(.merge-active):not(.photo-work-active):not(.pe-active) > .document-stage > .tool-workspace-stage { flex:none; }
.document-stage > .next-steps { display:none; }
.document-page:not(.document-active):not(.pdf-work-active):not(.merge-active) .workspace .drop { min-height:140px;padding:14px 16px;margin:12px auto;gap:6px; }
.document-page:not(.document-active):not(.pdf-work-active):not(.merge-active) .drop__ico { display:none; }
.document-page:not(.document-active):not(.pdf-work-active):not(.merge-active) .drop__title { padding:12px 22px; }
.document-active .document-stage,.pdf-work-active .document-stage { flex:1;min-height:0;height:100%;padding-bottom:0; }
@media(max-width:879px){
 .document-page:not(.document-active):not(.pdf-work-active):not(.merge-active) .workspace .drop { min-height:112px;padding:10px 12px;margin:8px auto; }
 .document-page:not(.document-active):not(.pdf-work-active):not(.merge-active) .drop__title { padding:10px 16px;font-size:14px; }
 .document-page .drop__hint { font-size:11px;line-height:1.3; }
 .document-page .drop__pro { font-size:11px;margin-top:4px; }
}

/* Text and calculators use the same typography without a file-download flow. */
.document-page .workspace .textarea { min-height:140px; }
.document-page .workspace .fields { min-width:0; }
.document-page .workspace input,.document-page .workspace select { max-width:100%;box-sizing:border-box; }
@media(max-width:879px){
 .document-page .workspace .textarea { min-height:110px;max-height:35dvh;resize:vertical;font-size:14px; }
 .document-page .workspace .fields { gap:8px; }
 .document-page .workspace .field label { font-size:12px; }
 .document-page .workspace .bar:has(> .btn--primary) { flex-direction:column;flex-wrap:nowrap;align-items:stretch;gap:6px; }
 .document-page .workspace .bar > .bar__grow:not(:empty) { flex:0 0 auto;min-height:0; }
 .document-page .workspace .bar > .btn--primary { flex:0 0 auto;min-height:48px;max-width:100%;white-space:normal; }
}

@media(max-width:879px){
 .document-page.document-active .workspace .document-action > .bar__grow:not(:empty) { flex:0 0 auto !important;height:auto;min-height:0; }
 .document-page.document-active .workspace .document-action { flex-wrap:nowrap !important;flex-direction:column !important; }
 .document-page.document-active .workspace .document-action > .btn { flex:0 0 auto !important; }
 .document-page .workspace .fields { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .document-page .workspace .field { min-width:0; }
 .document-page .workspace .split { min-width:0;grid-template-columns:minmax(0,1fr); }
 .document-page .workspace .split > * { min-width:0; }
 .document-page .workspace .check { white-space:normal;overflow-wrap:anywhere; }
}
@media(max-width:879px){ .document-page.document-active .workspace .document-action { bottom:calc(136px + env(safe-area-inset-bottom)) !important; } .document-page.document-active .workspace .flist { width:100%;min-width:0; } .document-page.document-active .workspace .fitem__body { min-width:0;width:100%;overflow:hidden; } }
.document-page .drop input[type=file] { width:100%;height:100%;max-width:100%;box-sizing:border-box; }
