/* A single page owns the scroll area; navigation and export never cover it. */
[data-tool="pdf-editor"] .pdf-editor { position:relative; display:flex; flex-direction:column; gap:8px; min-height:0; }
[data-tool="pdf-editor"] .pe-toolbar { display:flex; gap:6px; align-items:center; flex:0 0 auto; }
[data-tool="pdf-editor"] .pe-menu { position:relative; min-width:0; }
[data-tool="pdf-editor"] .pe-menu summary,.pe-small { display:flex; align-items:center; justify-content:center; gap:5px; min-height:38px; padding:7px 10px; border:1px solid var(--line); border-radius:9px; background:var(--surface); color:var(--ink); font:inherit; font-size:13px; cursor:pointer; list-style:none; white-space:nowrap; }
[data-tool="pdf-editor"] summary::-webkit-details-marker { display:none; }
[data-tool="pdf-editor"] .pe-menu[open] summary,[data-tool="pdf-editor"] .pe-small[aria-pressed="true"] { background:var(--brand-soft); border-color:var(--brand); color:var(--brand); }
[data-tool="pdf-editor"] .pe-popover { position:absolute; z-index:25; top:calc(100% + 5px); left:0; width:260px; max-width:calc(100vw - 32px); max-height:min(380px,55dvh); overflow:auto; overscroll-behavior:contain; background:var(--surface); border:1px solid var(--line); border-radius:12px; box-shadow:0 8px 24px #0002; padding:6px; }
[data-tool="pdf-editor"] .pe-popover button,[data-tool="pdf-editor"] .pe-popover a { display:block; width:100%; border:0; border-radius:6px; background:none; color:var(--ink); text-decoration:none; text-align:left; padding:9px 10px; min-height:38px; font:inherit; font-size:13px; cursor:pointer; }
[data-tool="pdf-editor"] .pe-popover button:hover,[data-tool="pdf-editor"] .pe-popover a:hover,[data-tool="pdf-editor"] .pe-popover button[aria-pressed="true"] { background:var(--brand-soft); color:var(--brand); }
[data-tool="pdf-editor"] button:disabled { opacity:.4; cursor:default; }
[data-tool="pdf-editor"] .pe-more { margin-left:auto; }
[data-tool="pdf-editor"] .pe-more .pe-popover { left:auto; right:0; }
[data-tool="pdf-editor"] .pe-popover p { font-size:12px; padding:5px 10px; margin:0 0 5px; color:var(--muted); }
[data-tool="pdf-editor"] .pe-properties { display:flex; gap:12px; padding:8px; border-top:1px solid var(--line); }
[data-tool="pdf-editor"] .pe-properties .select { min-height:32px; padding:4px; width:65px; }
[data-tool="pdf-editor"] .pe-hint { flex:0 0 auto; font-size:12px; line-height:1.4; margin:0; color:var(--muted); }
[data-tool="pdf-editor"] .pe-view { flex:1; min-height:100px; height:55dvh; overflow:auto; overscroll-behavior:contain; background:#e9ece8; border-radius:10px; padding:12px; display:block; }
[data-tool="pdf-editor"] .pe-sheet { position:relative; margin:auto; flex:none; }
[data-tool="pdf-editor"] .ed-page { position:absolute; top:50%; left:50%; transform-origin:center; touch-action:auto; }
[data-tool="pdf-editor"] .ed-page svg { touch-action:none; }
[data-tool="pdf-editor"] .ed-page[data-tool="edit"] svg { pointer-events:none; }
[data-tool="pdf-editor"] .ed-page[data-tool="read"] svg { pointer-events:none; touch-action:auto; }
[data-tool="pdf-editor"] .pe-native { position:absolute; inset:0; pointer-events:none; }
[data-tool="pdf-editor"] .ed-page[data-tool="edit"] .pe-native { pointer-events:auto; }
[data-tool="pdf-editor"] .pe-native button { position:absolute; padding:0; margin:0; min-height:0; border:0; border-radius:2px; background:transparent; cursor:text; color:transparent; }
[data-tool="pdf-editor"] .pe-native button:hover,[data-tool="pdf-editor"] .pe-native button:focus-visible { outline:1px solid var(--brand); background:#3f6b4720; }
[data-tool="pdf-editor"] .pe-native button.is-edited { background:#3f6b4710; outline:1px dashed var(--brand); }
[data-tool="pdf-editor"] .pe-navigation { display:flex; align-items:center; justify-content:center; gap:6px; flex:0 0 auto; }
[data-tool="pdf-editor"] .pe-navigation .select { min-height:36px; padding:5px 8px; width:150px; font-size:12px; margin-left:auto; }
[data-tool="pdf-editor"] .pe-page-number { display:flex; align-items:center; gap:5px; font-size:12px; white-space:nowrap; }
[data-tool="pdf-editor"] #pageNumber { width:48px; min-height:34px; border:1px solid var(--line); background:var(--surface); color:var(--ink); border-radius:7px; padding:4px; text-align:center; }
[data-tool="pdf-editor"] .pe-action { display:flex; align-items:center; gap:10px; flex:0 0 auto; padding-top:6px; border-top:1px solid var(--line); }
[data-tool="pdf-editor"] .pe-action #summary { flex:1; color:var(--muted); font-size:12px; }
[data-tool="pdf-editor"] .pe-action #btnGo { min-height:48px; min-width:200px; }
[data-tool="pdf-editor"] .pe-reader { max-width:70ch; margin:auto; padding:20px; background:var(--surface); border-radius:8px; font-size:19px; line-height:1.8; color:var(--ink); overflow-wrap:anywhere; white-space:pre-wrap; }
[data-tool="pdf-editor"] .pe-reader p { margin:0 0 10px; }
[data-tool="pdf-editor"] .pe-reader mark { background:#fff0a0; }
[data-tool="pdf-editor"] .pe-text-editor { flex:0 0 auto; padding:8px; background:var(--brand-soft); border-radius:9px; }
[data-tool="pdf-editor"] .pe-text-editor label { font-size:12px; font-weight:600; }
[data-tool="pdf-editor"] .pe-text-editor > div { display:flex; gap:5px; margin:4px 0; }
[data-tool="pdf-editor"] .pe-text-editor input { flex:1; width:0; min-height:38px; padding:6px 9px; }
[data-tool="pdf-editor"] .pe-text-editor p { font-size:11px; margin:0; line-height:1.4; }
[data-tool="pdf-editor"] .pdf-editor:has(#textEditor:not([hidden])) .pe-hint,
[data-tool="pdf-editor"] .pdf-editor:has(#textEditor:not([hidden])) .pe-action #summary,
[data-tool="pdf-editor"].document-active .workspace:has(#textEditor:not([hidden])) .usage { display:none; }
[data-tool="pdf-editor"] .pe-busy { position:absolute; inset:0; z-index:40; background:color-mix(in srgb,var(--surface) 94%,transparent); border-radius:12px; display:flex; align-items:center; justify-content:center; flex-direction:column; gap:15px; text-align:center; padding:20px; }
[data-tool="pdf-editor"] .pe-spinner { width:36px; height:36px; border:3px solid var(--line); border-top-color:var(--brand); border-radius:50%; animation:pe-spin .8s linear infinite; }
@keyframes pe-spin { to { transform:rotate(360deg); } }
@media(prefers-reduced-motion:reduce) { [data-tool="pdf-editor"] .pe-spinner { animation-duration:2s; } }
body:not(.tool-result-open) [data-tool="pdf-editor"].document-active { position:fixed; inset:72px 0 calc(var(--editor-ad-space,0px) + env(safe-area-inset-bottom)); width:100%; max-width:1400px; margin:auto; padding:0 16px 8px; display:flex; flex-direction:column; }
[data-tool="pdf-editor"].document-active .thead { display:none; }
[data-tool="pdf-editor"].document-active .document-stage { flex:1; min-height:0; height:100%; padding:0; }
[data-tool="pdf-editor"].document-active .tool-workspace-stage { display:flex; flex:1; min-height:0; }
[data-tool="pdf-editor"].document-active .workspace { display:flex; flex-direction:column; gap:8px; flex:1; max-height:none; min-height:0; overflow:visible; padding:10px; }
[data-tool="pdf-editor"].document-active #work { flex:1; min-height:0; }
[data-tool="pdf-editor"].document-active #fileBar { display:flex; flex-direction:row; flex:0 0 auto; gap:8px; padding:5px 8px; margin:0; min-height:40px; }
[data-tool="pdf-editor"].document-active #fileBar .fitem__thumb { width:30px; height:34px; flex:0 0 30px; min-height:0; font-size:10px; }
[data-tool="pdf-editor"].document-active #fileBar .fitem__body { width:auto; min-width:0; flex:1; }
[data-tool="pdf-editor"].document-active #btnNew { min-height:32px; padding:5px 8px; font-size:12px; }
[data-tool="pdf-editor"].document-active #err { flex:0 0 auto; margin:0; padding:6px; font-size:12px; }
[data-tool="pdf-editor"].document-active .usage { flex:0 0 auto; margin:0; font-size:11px; gap:6px; }
[data-tool="pdf-editor"].document-active .usage__hint { display:none; }
[data-tool="pdf-editor"].document-active .usage__bar { max-width:80px; }
[data-tool="pdf-editor"].document-active .document-stage > .ad { position:fixed; bottom:0; height:auto; max-height:130px; left:0; right:0; margin:0; }
body.document-editing:has([data-tool="pdf-editor"].document-active):not(.tool-result-open) { overflow:hidden; }
@media(max-width:879px) {
 body:not(.tool-result-open) [data-tool="pdf-editor"].document-active { top:64px; padding:0 8px 5px; }
 [data-tool="pdf-editor"].document-active .workspace { border:0; box-shadow:none; border-radius:0; padding:5px 0; gap:5px; }
 [data-tool="pdf-editor"] .pdf-editor { gap:5px; }
 [data-tool="pdf-editor"] .pe-toolbar { gap:4px; }
 [data-tool="pdf-editor"] .pe-menu summary,[data-tool="pdf-editor"] .pe-small { min-height:36px; font-size:11px; padding:6px; }
 [data-tool="pdf-editor"] #toolLabel { max-width:70px; overflow:hidden; text-overflow:ellipsis; }
 [data-tool="pdf-editor"] .pe-menu#pageMenu .pe-popover { left:-90px; }
 [data-tool="pdf-editor"] .pe-hint { font-size:11px; max-height:32px; overflow:auto; }
 [data-tool="pdf-editor"] .pe-view { padding:6px; }
 [data-tool="pdf-editor"] .pe-action { display:grid; gap:3px; }
 [data-tool="pdf-editor"] .pe-action #summary { font-size:10px; text-align:center; }
 [data-tool="pdf-editor"] .pe-action #btnGo { width:100%; min-height:46px; font-size:15px; }
 [data-tool="pdf-editor"] .pe-reader { padding:12px; font-size:18px; }
 [data-tool="pdf-editor"] .pe-navigation .select { width:120px; }
 [data-tool="pdf-editor"] .pe-text-editor { padding:6px; }
 [data-tool="pdf-editor"] .pe-text-editor p { font-size:10px; }
}
@media(max-height:540px) {
 [data-tool="pdf-editor"].document-active .usage,[data-tool="pdf-editor"] .pe-hint,[data-tool="pdf-editor"] .pe-action #summary { display:none; }
 [data-tool="pdf-editor"] .pe-view { min-height:70px; }
 [data-tool="pdf-editor"] .pe-action #btnGo { min-height:40px; }
 [data-tool="pdf-editor"] .pe-text-editor { position:absolute; z-index:20; top:42px; left:0; right:0; max-height:calc(100% - 100px); overflow:auto; box-shadow:0 4px 20px #0002; }
}
