/* PDF page operations: viewport editor, independent preview scrolling. */
.pdf-work-active .tcontent,.pdf-work-active .prostrip,.pdf-work-active .pro-strip,.pdf-work-active .next-steps { display:none; }
.pdf-work-editor[hidden] { display:none; }
.pdf-work-panel { display:flex;flex-direction:column;gap:12px;min-width:0;overflow:auto;padding:20px;background:var(--surface);border:1px solid var(--line);border-radius:12px; }
.pdf-work-panel h2 { font-size:24px;margin:0; }
.pdf-work-panel > .bar:last-child { margin-top:auto;flex-direction:column;align-items:stretch; }
.pdf-work-panel #btnGo { width:100%;min-height:64px;font-size:19px; }
.pdf-work-panel .seg { flex-wrap:wrap; }
.pdf-work-panel .toolbar { flex-wrap:wrap; }
.pdf-work-panel .toolbar input { min-width:0;width:100%; }
@media(min-width:880px){
 .wrap.pdf-work-page { max-width:none;padding:0 20px; }
 body.pdf-editing { overflow:hidden; }
 body.pdf-editing .ftr,body.pdf-editing #pageBottomAd { display:none; }
 .pdf-work-active .thead { display:none; }
 .pdf-work-active .workspace { border:0;padding:0;background:transparent;box-shadow:none;height:calc(100dvh - 210px);display:flex;flex-direction:column; }
 .pdf-work-active #fileBar { flex:0 0 auto;margin:8px 0; }
 .pdf-work-editor { display:grid;grid-template-columns:minmax(0,1fr) clamp(300px,27vw,420px);gap:20px;flex:1;min-height:0; }
 .pdf-work-editor #grid { overflow:auto;min-height:0;align-content:start;margin:0;padding:4px;grid-template-columns:repeat(auto-fill,minmax(155px,1fr)); }
 .pdf-work-editor .pcard__img { height:160px; }
 .pdf-work-active .ad { margin:8px auto;width:min(100%,1000px); }
 .pdf-work-active .ad__box { height:90px;min-height:90px; }
}
@media(max-width:879px){
 body.pdf-editing { overflow:hidden; }
 body.pdf-editing .ftr,body.pdf-editing #pageBottomAd { display:none; }
 .pdf-work-active .thead { text-align:center;justify-content:center;margin:6px 0; }
 .pdf-work-active .thead .ico,.pdf-work-active .badges,.pdf-work-active .thead__lead { display:none; }
 .pdf-work-active .thead h1 { font-size:18px; }
 .pdf-work-active .workspace { height:calc(100dvh - 240px);display:flex;flex-direction:column;padding:8px;border:0; }
 .pdf-work-active #fileBar { padding:6px;margin:0 0 6px;font-size:11px;flex:0 0 auto; }
 .pdf-work-active .filebar__name { font-size:11px; }
 .pdf-work-editor { flex:1;min-height:0;display:flex;flex-direction:column;gap:6px; }
 .pdf-work-editor #grid { flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;margin:0;padding:2px;align-content:start; }
 .pdf-work-editor .pcard { padding:4px;min-width:0; }
 .pdf-work-editor .pcard__img { height:90px; }
 .pdf-work-editor .pcard__n { font-size:10px; }
 .pdf-work-editor .icon-btn { width:26px;height:30px;padding:3px; }
 .pdf-work-panel { flex:0 0 auto;padding:6px;gap:5px;max-height:45%;border:0; }
 .pdf-work-panel h2 { display:none; }
 .pdf-work-panel .seg button { font-size:10px;padding:6px; }
 .pdf-work-panel p,.pdf-work-panel label,.pdf-work-panel small,.pdf-work-panel .bar__grow { font-size:10px; }
 .pdf-work-panel .bar { margin:0;gap:5px; }
 .pdf-work-panel #btnGo { min-height:48px;font-size:15px; }
 .pdf-work-active .ad { position:fixed;bottom:0;left:12px;right:12px;height:116px;margin:0;overflow:hidden; }
 .pdf-work-active .ad__box { height:90px;min-height:90px; }
 body.pdf-editing.tool-result-open { overflow:auto; }
}

.pdf-work-page #progress:not([hidden]) { position:fixed;inset:64px 0 130px;z-index:55;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;background:rgba(251,251,249,.97); }
.pdf-work-page #progress .progress__track { width:min(360px,80vw);height:8px; }
.pdf-work-page #progress .progress__lbl { text-align:center;font-size:16px; }

.pdf-work-page .thead__lead { font-size:13px;line-height:1.45; }
.pdf-work-page .tool-workspace-stage { min-height:calc(100dvh - 310px); }
.pdf-work-page .tcontent { max-width:1200px;margin:32px auto; }
.pdf-work-page .drop__title { display:inline-block;background:var(--brand);color:white;padding:16px 24px;border-radius:12px; }
.pdf-work-page .drop { max-width:740px;margin:20px auto; }
.pdf-work-active .tool-workspace-stage { min-height:0; }
.pdf-work-page [hidden] { display: none !important; }

.pdf-work-page:not(.pdf-work-active) .thead { justify-content:center;text-align:center;margin:26px 0 32px; }
.pdf-work-page:not(.pdf-work-active) .thead .ico,.pdf-work-page .badges,.pdf-work-page .prostrip,.pdf-work-page .pro-strip { display:none; }
.pdf-work-page:not(.pdf-work-active) .thead h1 { font-size:clamp(24px,3vw,38px); }
.pdf-work-page:not(.pdf-work-active) .thead__lead { max-width:720px;margin:8px auto 0;font-size:16px; }
.pdf-work-page:not(.pdf-work-active) .workspace { background:transparent;border:0;box-shadow:none; }
.pdf-work-page:not(.pdf-work-active) .tool-workspace-stage { min-height:calc(100dvh - 260px); }
.pdf-work-page .drop { min-height:210px; }
.pdf-work-page #progress::before { content:'';width:48px;height:48px;border:4px solid var(--line);border-top-color:var(--brand);border-radius:50%;animation:pdf-process-spin .8s linear infinite; }
.pdf-work-page .progress__fill { transition:width .25s ease; }
@keyframes pdf-process-spin { to {transform:rotate(360deg);} }
@media(prefers-reduced-motion:reduce){.pdf-work-page #progress::before{animation:none;}}
@media(max-width:879px){
 .pdf-work-page:not(.pdf-work-active) .thead { margin:12px 0 16px; }
 .pdf-work-page:not(.pdf-work-active) .thead h1 { font-size:22px; }
 .pdf-work-page:not(.pdf-work-active) .thead__lead { font-size:12px; }
 .pdf-work-page:not(.pdf-work-active) .tool-workspace-stage { min-height:calc(100dvh - 260px); }
}

.pdf-work-options { display:flex;flex-direction:column;gap:10px; }
@media(max-width:879px){
 .pdf-work-active { position:fixed;top:64px;left:0;right:0;bottom:calc(130px + env(safe-area-inset-bottom));padding:0 10px;display:flex;flex-direction:column; }
 .pdf-work-active .thead { flex:0 0 auto; }
 .pdf-work-active .tool-workspace-stage { flex:1;min-height:0;display:flex; }
 .pdf-work-active .workspace { height:auto;flex:1;min-height:0;width:100%;padding:0;background:transparent; }
 .pdf-work-active #fileBar { min-width:0; }
 .pdf-work-active #fileName { overflow:hidden;white-space:nowrap;text-overflow:ellipsis;max-width:55vw;font-size:11px; }
 .pdf-work-editor { display:flex;flex-direction:column;min-height:0; }
 .pdf-work-editor .pdf-work-panel { display:contents; }
 .pdf-work-options { order:0;flex:0 0 auto;gap:4px;max-height:35%;overflow:auto; }
 .pdf-work-options .seg { display:flex;flex-wrap:wrap;margin-top:0 !important;gap:3px; }
 .pdf-work-options .seg button { flex:1 1 40%;min-height:34px;font-size:11px;line-height:1.2; }
 .pdf-work-options .toolbar { margin-top:0 !important;gap:4px;display:flex;flex-wrap:wrap; }
 .pdf-work-options .toolbar input { flex:1 1 120px;width:auto;min-width:0;min-height:34px;font-size:12px; }
 .pdf-work-options .toolbar .btn { padding:6px 8px;min-height:34px;font-size:11px; }
 .pdf-work-options p { margin:0 !important;font-size:10px; }
 .pdf-work-options .field { margin-top:0 !important; }
 .pdf-work-options .input { padding:6px 10px;min-height:34px; }
 .pdf-work-editor #grid { order:1;flex:1;min-height:60px; }
 .pdf-work-editor .pdf-work-action { order:2;flex:0 0 auto;display:flex;flex-direction:column;align-items:stretch;gap:4px;margin:0;padding:6px 0;background:var(--bg);border-top:1px solid var(--line); }
 .pdf-work-action .bar__grow { font-size:11px;line-height:1.25; }
 .pdf-work-action #btnGo { width:100%;min-height:52px;font-size:16px;font-weight:700;border-radius:10px; }
 .pdf-work-action #btnReset { padding:5px;min-height:30px;font-size:11px; }
 .pdf-work-active.mobile-floor-shown .ad { display:none; }
}
.pdf-work-page[hidden] { display:none !important; }

@media(max-width:879px){
 .pdf-work-editor .pdf-work-action { flex-wrap:nowrap;min-width:0;width:100%;box-sizing:border-box; }
 .pdf-work-action > * { flex:0 0 auto;max-width:100%;min-width:0;box-sizing:border-box; }
 .pdf-work-action #btnGo { flex:0 0 auto;white-space:normal;line-height:1.25; }
 .pdf-work-active .workspace { min-width:0;box-sizing:border-box;padding:0 !important;border-radius:0;box-shadow:none; }
 .pdf-work-active .thead h1 { font-size:17px;line-height:1.25; }
 .pdf-work-active .thead { margin:6px 0 8px; }
 .pdf-work-options { min-width:0; }
 .pdf-work-editor #grid { min-width:0; }
}
@media(max-width:879px){ .pdf-work-editor .pdf-work-action .bar__grow { flex:0 0 auto; height:auto; min-height:0; } .pdf-work-options > * { flex-shrink:0; } .pdf-work-active { width:100%;box-sizing:border-box; } }
@media(max-width:879px){ .pdf-work-page .workspace .pdf-work-action > .bar__grow:not(:empty) { flex:0 0 auto; height:auto; } }

.pdf-work-page:not(.pdf-work-active) .tool-workspace-stage { min-height:calc(100dvh - 420px); }
@media(max-width:879px){ .pdf-work-page:not(.pdf-work-active) .tool-workspace-stage { min-height:calc(100dvh - 360px); } }
