.pdf-open-button{width:100%;margin-top:10px}
.pdf-editor[hidden]{display:none}
.pdf-editor{position:fixed;inset:0;z-index:120;background:#20262ccc;color:#1c2630;display:flex;align-items:stretch;justify-content:center}
.pdf-editor-panel{display:flex;flex-direction:column;width:min(100%,1100px);min-height:0;background:var(--panel,#fff);color:var(--text,#1c2630);box-shadow:0 0 35px #0005}
.pdf-editor-head,.pdf-editor-tools,.pdf-editor-navigation,.pdf-editor-text{display:flex;align-items:center;gap:8px;padding:8px 12px;border-bottom:1px solid var(--line,#ddd);flex-wrap:wrap}
.pdf-editor-head{justify-content:space-between;gap:12px}
.pdf-editor-head strong{font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pdf-editor-disclosure{max-height:55vh;overflow:auto;flex:none}
.pdf-editor-disclosure summary{padding:8px 12px;border-bottom:1px solid var(--line,#ddd);font-size:13px;font-weight:700;cursor:pointer;list-style-position:inside}
.pdf-editor button{font:inherit;border:1px solid var(--line,#ccc);border-radius:9px;background:var(--panel,#fff);color:var(--text,#1c2630);padding:8px 10px;cursor:pointer}
.pdf-editor button:disabled{opacity:.45;cursor:not-allowed}
.pdf-editor button:focus-visible,.pdf-editor textarea:focus-visible,.pdf-editor select:focus-visible{outline:2px solid #ff0000;outline-offset:2px}
.pdf-editor-head #pdfEditorDone,.pdf-editor-tools button[aria-pressed=true]{background:#d90000;border-color:#d90000;color:#fff}
.pdf-editor-tools button{flex:1 1 110px;font-weight:700}
.pdf-editor-text textarea{flex:1 1 260px;min-width:0;min-height:48px;resize:vertical;padding:8px;border:1px solid var(--line,#ccc);border-radius:9px;background:var(--panel,#fff);color:var(--text,#1c2630);font:inherit}
.pdf-editor-text label{font-size:12px;font-weight:700;white-space:nowrap}
.pdf-editor-text select{padding:7px;border:1px solid var(--line,#ccc);border-radius:8px;background:var(--panel,#fff);color:var(--text,#1c2630)}
.pdf-editor-signature{padding:8px 12px;border-bottom:1px solid var(--line,#ddd)}
.pdf-editor-signature p{font-size:12px;margin:0 0 7px}
.pdf-editor-signature canvas{display:block;width:100%;max-width:640px;height:150px;background:#ececec;border:1px solid #aaa;border-radius:9px;touch-action:none;cursor:crosshair}
.pdf-editor-signature-actions,.pdf-editor-signature-resize{display:flex;gap:6px;align-items:center}
.pdf-editor-signature-actions{margin-top:7px}
.pdf-editor-signature-actions #pdfEditorSignaturePlace{background:#d90000;border-color:#d90000;color:#fff;font-weight:700}
.pdf-editor-signature-actions #pdfEditorSignaturePlace:disabled{background:var(--panel,#fff);border-color:var(--line,#ccc);color:var(--text,#1c2630)}
.pdf-editor-selection{display:flex;align-items:center;gap:8px;padding:8px 12px;border-bottom:1px solid var(--line,#ddd);flex-wrap:wrap;font-size:12px}
.pdf-editor-selection span{flex:1 1 100%;color:var(--muted,#585858)}
.pdf-editor-mobile-toolbar{display:none}
.pdf-editor-navigation{justify-content:center;font-weight:700}
.pdf-editor-zoom{display:flex;align-items:center;gap:5px;margin-left:auto}
.pdf-editor-zoom span{min-width:74px;text-align:center;font-size:12px}
.pdf-editor-navigation #pdfEditorUndo{margin-left:auto}
.pdf-editor-stage{flex:1;min-height:0;overflow:auto;padding:14px;background:#585858;text-align:center;overscroll-behavior:contain}
.pdf-editor-page{position:relative;margin:0 auto;box-shadow:0 4px 20px #0007;background:#fff;max-width:none}
.pdf-editor-page canvas{display:block;position:absolute;inset:0;width:100%;height:100%}
#pdfEditorOverlay{touch-action:none;cursor:crosshair}
#pdfEditorOverlay[data-tool=pan]{cursor:grab}
#pdfEditorOverlay[data-panning=true]{cursor:grabbing}
.pdf-editor-status{margin:0;padding:9px 12px;font-size:12px;line-height:1.4;border-top:1px solid var(--line,#ddd);background:var(--panel,#fff);color:var(--text,#1c2630)}
.pdf-editor-open{overflow:hidden}
@media(max-width:620px){
  .pdf-editor-head,.pdf-editor-navigation,.pdf-editor-text{padding:5px 7px;gap:5px}
  .pdf-editor-head{min-height:46px}
  .pdf-editor-head #pdfEditorDone,.pdf-editor-disclosure summary,.pdf-editor-tools{display:none}
  .pdf-editor button{padding:8px;font-size:12px}
  .pdf-editor-navigation>button,.pdf-editor-zoom>button{min-width:44px;min-height:44px}
  .pdf-editor-navigation #pdfEditorUndo{margin-left:auto;min-height:44px}
  .pdf-editor-zoom{margin-left:0;order:2;width:100%;justify-content:center}
  .pdf-editor-disclosure{max-height:38vh;max-height:38dvh}
  .pdf-editor-disclosure:not([open]){display:none}
  .pdf-editor-text textarea{flex-basis:100%}
  .pdf-editor-signature canvas{height:140px}
  .pdf-editor-stage{padding:7px}
  .pdf-editor-status{padding:5px 8px;min-height:29px;max-height:40px;overflow:hidden}
  .pdf-editor-mobile-toolbar{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;padding:6px max(6px,env(safe-area-inset-right)) max(6px,env(safe-area-inset-bottom)) max(6px,env(safe-area-inset-left));border-top:1px solid var(--line,#ddd);background:var(--panel,#fff)}
  .pdf-editor-mobile-toolbar button{min-height:48px;font-size:12px;font-weight:700;padding:5px 2px}
  .pdf-editor-mobile-toolbar button[aria-pressed=true],.pdf-editor-mobile-toolbar #pdfEditorDoneMobile{background:#d90000;border-color:#d90000;color:#fff}
  .pdf-editor-selection{padding:6px;gap:5px}
  .pdf-editor-selection button{min-height:44px}
}
