.pdf-color-control{display:grid;gap:8px;min-width:0}
.pdf-shortcut-menu{position:absolute;right:5px;top:5px;z-index:5;min-width:36px;min-height:36px;background:white;color:#20396d;border:1px solid #c4d1e4;border-radius:5px;cursor:pointer;font-size:22px}
.file-card,.organize-page,.merge-page,.wm-sheet,.pn-sheet,.adv-sheet{position:relative}
.pdf-word-palette>summary{display:flex;gap:8px;align-items:center;min-height:38px;cursor:pointer;border:1px solid #cbd6e4;padding:6px;border-radius:5px}
.pdf-word-palette summary i{display:block;width:30px;height:22px;border:1px solid #9aacc0;flex:none}
.pdf-color-panel{position:relative;display:grid;gap:8px;padding:42px 8px 10px;border:1px solid #cbd6e4;background:white;border-radius:6px;margin-top:5px}
.pdf-color-panel strong{font-size:12px}.pdf-color-panel .pdf-color-palette{grid-template-columns:repeat(10,minmax(0,1fr));gap:3px}
.pdf-color-panel .pdf-color-palette button{height:22px;min-height:22px!important;border-radius:0!important;font-size:13px!important;color:white;text-shadow:0 1px 2px #000}
.pdf-palette-close{position:absolute;right:3px;top:3px;width:34px;min-height:32px!important;padding:0!important}
.pdf-color-panel .pdf-color-auto{width:100%;text-align:left;background:#edf1f6!important}
.pdf-color-panel details>summary{cursor:pointer;font-size:13px;padding:8px 0}
.pdf-object-popup{position:fixed;z-index:1400;width:330px;max-width:calc(100vw - 16px);max-height:calc(100dvh - 24px);background:#fff;color:#20396d;border:1px solid #b9cbe0;border-radius:10px;box-shadow:0 12px 48px #14243d44;display:flex;flex-direction:column;font-size:13px}
.pdf-object-popup>header{display:flex;align-items:center;gap:8px;border-bottom:1px solid #dae3ec;padding:6px 10px;flex:none}
.pdf-object-popup>header strong{flex:1}.pdf-object-popup>header button{height:38px;min-width:38px;border:0;background:#f1f5fa;border-radius:5px;color:inherit;font-size:22px;cursor:pointer}
.pdf-object-popup-body{overflow:auto;overscroll-behavior:contain;padding:12px;min-height:0}
.pdf-object-menu-list{display:grid;gap:3px}
.pdf-object-popup button{cursor:pointer}.pdf-object-menu-list>button{border:0;background:white;text-align:left;color:inherit;min-height:40px;font:inherit;padding:8px;border-radius:5px}
.pdf-object-menu-list>button:hover,.pdf-object-menu-list>button:focus-visible{background:#e3f0f6}
.pdf-object-popup button:disabled{opacity:.45;cursor:default}
.pdf-object-popup .ae-field{display:grid;gap:5px;margin:0 0 12px}
.pdf-object-popup .ae-check{display:flex;gap:8px;align-items:center;margin:10px 0}
.pdf-object-popup input[type=checkbox]{width:auto}
.pdf-object-popup .ae-colors{display:block}
.annotation-editor .ae-colors{grid-template-columns:minmax(0,1fr)}
.pdf-object-popup input,.pdf-object-popup select,.pdf-object-popup textarea{max-width:100%;min-width:0;width:100%;box-sizing:border-box;border:1px solid #c4d1e4;border-radius:6px;padding:9px;font:inherit;color:inherit}
.pdf-object-popup .ae-format,.pdf-object-popup .ae-alignment{display:flex;gap:5px;margin-bottom:12px}
.pdf-object-popup .ae-format button,.pdf-object-popup .ae-alignment button{flex:1;min-height:40px;border:1px solid #c4d1e4;background:white;border-radius:5px;color:inherit}
.pdf-object-popup svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.6}
.pdf-object-popup [aria-pressed=true]{background:#d9eef4!important;border-color:#137d92!important}
.pdf-object-popup [aria-pressed=mixed]{border-style:dashed!important}
.ae-object.locked{cursor:default}.ae-object.locked.selected{outline:2px dashed #9b7420}
.ae-object{user-select:none}.ae-inline-text{user-select:text}
.ae-object-access{display:flex;gap:4px}.ae-object-access button{min-width:38px;min-height:40px}
.pdf-object-menu-list>hr{border:0;border-top:1px solid #d9e1ea;margin:5px 0;width:100%}
.pdf-menu-arrow{float:right;margin-left:12px}
.ae-panels svg,.ae-sign-tools svg,.ae-object-access svg{width:22px!important;height:22px!important;stroke-width:1.6;fill:none;stroke:currentColor}
.pdf-sign-dialog h2{font-size:20px;margin:0 42px 8px 0}.pdf-sign-dialog p{font-size:13px;line-height:1.5;margin:0 0 14px}
@media(min-width:901px){
 .ae-subbar{display:grid!important;grid-template-columns:1fr auto auto 1fr;gap:14px}
 .ae-subbar>.ae-tools{grid-column:2}.ae-subbar>.ae-history{grid-column:3}
 .ae-subbar>.ae-close-toolbar{grid-column:4;justify-self:end;margin-left:0}
}
@media(max-width:700px){
 .pdf-object-popup{left:8px!important;right:8px!important;top:auto!important;bottom:max(8px,env(safe-area-inset-bottom));width:auto;max-height:65dvh}
 .pdf-object-menu-list>button{min-height:44px}
 .pdf-color-panel .pdf-color-palette button{min-height:26px!important;height:26px}
 .pdf-sign-dialog{padding-top:14px!important}
}
@media(max-width:540px){
 .ae-sign-tools{display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr));gap:5px}
 .ae-sign-tools>.ae-history,.ae-sign-tools>.ae-object-access{display:contents}
 .ae-sign-tools>button,.ae-sign-tools>.ae-history>button,.ae-sign-tools>.ae-object-access>button{width:100%;min-height:40px}
 .ae-sign-tools>.ae-sign-add{grid-column:1/-1;grid-row:3;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px}
}
.pdf-color-custom{display:flex;gap:6px;min-width:0}
.pdf-color-custom input[type=color]{width:48px!important;flex:0 0 48px;padding:3px!important}
.pdf-color-custom input[type=text]{width:0;flex:1;min-width:0;text-transform:uppercase}
.pdf-color-palette{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:4px}
.pdf-color-palette button{min-width:0!important;width:100%;height:32px;min-height:32px!important;padding:0!important;border:1px solid #9aacc0!important;border-radius:5px!important;font-size:18px!important}
.pdf-color-palette button[aria-pressed=true]{outline:2px solid #137d92;outline-offset:1px}
.pdf-sign-dialog{width:min(720px,calc(100vw - 24px));max-width:none;padding:48px 14px 14px;border:1px solid #cfdae7;border-radius:12px;background:#fff;color:#20396d;box-shadow:0 20px 70px #14243d55;overflow:hidden}
.pdf-sign-dialog::backdrop,.pdf-preview-dialog::backdrop{background:#15284488}
.pdf-sign-dialog canvas{display:block;width:100%;height:auto;max-height:65dvh;aspect-ratio:800/340;background:#f7f9fc;border:1px dashed #91a7c0;border-radius:5px;touch-action:none;cursor:crosshair}
.pdf-dialog-close{position:absolute;right:8px;top:4px;width:40px;height:40px;border:0;border-radius:6px;background:white;color:#20396d;font-size:28px;cursor:pointer}
.annotation-editor[data-subbar-hidden=true] .ae-subbar{display:none!important}
.ae-close-toolbar{margin-left:auto;flex:none!important;border:1px solid #cbd6e4!important;background:white!important;font-size:22px!important}
.ae-panel-heading button{display:block}
@media(min-width:901px){
 .annotation-editor[data-left-hidden=true] .ae-pages,.annotation-editor[data-right-hidden=true] .ae-properties{display:none}
 .annotation-editor[data-left-hidden=true] .ae-body{grid-template-columns:minmax(0,1fr) 270px}
 .annotation-editor[data-right-hidden=true] .ae-body{grid-template-columns:160px minmax(0,1fr)}
 .annotation-editor[data-left-hidden=true][data-right-hidden=true] .ae-body{grid-template-columns:minmax(0,1fr)}
}
.ae-sign-tools{display:flex;align-items:center;justify-content:center;gap:8px;flex-wrap:wrap;width:100%}
.ae-sign-add{display:flex;align-items:center;gap:5px}
.ae-sign-add button{display:flex;align-items:center;gap:6px;min-height:44px}
.ae-sign-add small{font-size:12px;white-space:nowrap}
.ae-sign-add span{font-size:22px}
.signature-editor .ae-toolbar{padding:6px 10px}
.signature-editor .ae-toolbar button{min-height:44px;min-width:44px}
.signature-editor .ae-lefttabs[hidden]{display:none}
.signature-editor .ae-status{justify-content:flex-end}
.ae-viewport{touch-action:pan-x pan-y}
.pdf-preview-dialog{width:min(1000px,calc(100vw - 24px));height:calc(100dvh - 40px);max-width:none;max-height:none;padding:0;border:1px solid #cad6e5;border-radius:10px;background:#eef1f6;overflow:hidden;color:#20396d}
.pdf-preview-dialog[open]{display:flex;flex-direction:column}
.pdf-preview-heading{position:relative;min-height:48px;padding:12px 52px 10px 14px;background:white;font-size:14px}
.pdf-preview-controls{display:flex;align-items:center;justify-content:center;gap:5px;flex-wrap:wrap;padding:8px;background:white;border-top:1px solid #cad6e5}
.pdf-preview-controls button,.pdf-preview-controls input,.pdf-preview-controls select{height:40px;min-width:40px;padding:6px;border:1px solid #cad6e5;border-radius:6px;background:white;color:#20396d}
.pdf-preview-controls input{width:64px}
.pdf-preview-viewport{flex:1;min-height:0;min-width:0;overflow:auto;padding:16px;touch-action:pan-x pan-y}
.pdf-preview-content{width:max-content;min-width:100%;display:flex;justify-content:center;align-items:flex-start}
.pdf-preview-content>canvas{display:block;flex:none;max-width:none!important;background:white;box-shadow:0 1px 8px #182d4d33}
.pdf-preview-dialog.pdf-preview-clean{width:min(820px,calc(100vw - 24px));height:calc(100dvh - 24px);border:0;border-radius:0;background:transparent;color:white;box-shadow:none}
.pdf-preview-dialog.pdf-preview-clean::backdrop{background:rgb(0 0 0 / 75%)}
.pdf-preview-clean .pdf-preview-heading{min-height:44px;flex:none;padding:0;background:transparent}
.pdf-preview-clean .pdf-dialog-close{position:absolute;right:4px;top:0;width:44px;height:44px;padding:0;min-width:44px;border:0;background:transparent;font-size:28px;line-height:1;color:white}
.pdf-preview-clean .pdf-preview-viewport{padding:16px;background:transparent;cursor:grab;outline-offset:-3px;overscroll-behavior:contain}
.pdf-preview-clean .pdf-preview-viewport:active{cursor:grabbing}
.pdf-preview-clean .pdf-preview-content{min-height:100%;align-items:center}
.pdf-preview-clean .pdf-preview-content>canvas{box-shadow:0 2px 12px #0006}
.pdf-preview-clean :is(button,.pdf-preview-viewport):focus-visible{outline:2px solid white;outline-offset:-3px}
.pdf-preview-pager{display:flex;align-items:center;justify-content:center;gap:18px;flex:none;min-height:44px;background:white;font-size:13px}
.pdf-preview-pager button{border:0;background:transparent;color:#20396d;min-width:44px;min-height:44px;font-size:24px}
.pdf-preview-clean .pdf-preview-pager{background:transparent;color:white}
.pdf-preview-clean .pdf-preview-pager button{color:white;cursor:pointer}
.pdf-preview-clean .pdf-preview-pager button:disabled{cursor:default;opacity:.4}
.advanced-pdf .adv-scroll{height:min(70dvh,800px);box-sizing:border-box}
.pdf-enlarge-preview{display:block;margin:7px auto;border:1px solid #ced9e9;border-radius:6px;background:white;color:#20396d;padding:7px 10px;min-height:38px;font:inherit;font-size:12px;cursor:pointer}
.pdf-inline-zoom{display:flex;align-items:center;flex-wrap:wrap;gap:5px;margin:8px 0}
.pdf-inline-zoom input{width:64px!important}
.pdf-inline-zoom input,.pdf-inline-zoom button,.pdf-inline-zoom select{min-height:40px;border:1px solid #cbd6e4;border-radius:6px;background:white;color:#20396d;padding:6px}
/* File cards: three per row, with incomplete rows centred at the same card size. */
.document-tools :is([data-tool=compress-pdf],[data-focused-workspace]):not([data-tool=merge-pdf]):not([data-compact-files]) .file-list{--card-columns:3;--card-gap:clamp(4px,1.5vw,24px);display:flex;flex-wrap:wrap;justify-content:center;align-items:stretch;gap:var(--card-gap)}
.document-tools :is([data-tool=compress-pdf],[data-focused-workspace]):not([data-tool=merge-pdf]):not([data-compact-files]) .file-list:not(:has(>:nth-child(3))){--card-columns:2}
.document-tools :is([data-tool=compress-pdf],[data-focused-workspace]):not([data-tool=merge-pdf]):not([data-compact-files]) .file-list:not(:has(>:nth-child(2))){--card-columns:1}
.document-tools :is([data-tool=compress-pdf],[data-focused-workspace]):not([data-tool=merge-pdf]):not([data-compact-files]) .file-list>.file-card{flex:0 0 min(240px,calc((100% - (var(--card-columns) - 1)*var(--card-gap))/var(--card-columns)));min-width:0;max-width:100%}
@media(max-width:760px){
 .document-tools :is([data-tool=compress-pdf],[data-focused-workspace]):not([data-tool=merge-pdf]):not([data-compact-files]) .file-list:has(>:nth-child(2))>.file-card{padding:0 0 10px}
 .document-tools :is([data-tool=compress-pdf],[data-focused-workspace]):not([data-tool=merge-pdf]):not([data-compact-files]) .file-list:has(>:nth-child(2)) .file-preview{height:190px;max-height:none;padding:48px 6px 8px;margin-bottom:8px}
 .document-tools :is([data-tool=compress-pdf],[data-focused-workspace]):not([data-tool=merge-pdf]):not([data-compact-files]) .file-list:has(>:nth-child(3)) .file-preview{height:166px}
 .document-tools :is([data-tool=compress-pdf],[data-focused-workspace]):not([data-tool=merge-pdf]):not([data-compact-files]) .file-list:has(>:nth-child(2)) :is(.compress-remove,.focused-remove){right:0;top:0;width:44px;height:44px}
 .document-tools :is([data-tool=compress-pdf],[data-focused-workspace]):not([data-tool=merge-pdf]):not([data-compact-files]) .file-list:has(>:nth-child(2)) :is(.compress-zoom-icon,.focused-zoom-icon){right:44px;top:0;width:44px;height:44px}
 .document-tools :is([data-tool=compress-pdf],[data-focused-workspace]):not([data-tool=merge-pdf]):not([data-compact-files]) .file-list:has(>:nth-child(2)) .file-name{font-size:12px;line-height:1.5;white-space:normal;overflow-wrap:anywhere;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;min-height:3em;margin:0;padding:0 4px}
 .document-tools :is([data-tool=compress-pdf],[data-focused-workspace]):not([data-tool=merge-pdf]):not([data-compact-files]) .file-list:has(>:nth-child(2)) .file-size{font-size:11px;line-height:1.5;overflow-wrap:anywhere;padding:0 4px;min-height:3em}
 .document-tools :is([data-tool=compress-pdf],[data-focused-workspace]):not([data-tool=merge-pdf]):not([data-compact-files]) .file-list:has(>:nth-child(2)) .file-actions{gap:0}
 .document-tools [data-focused-workspace] .file-list:has(>:nth-child(2)) .sort-card-heading{padding:4px 2px 0;gap:2px}
 .document-tools [data-focused-workspace] .file-list:has(>:nth-child(2)) .drag-handle{min-width:44px;min-height:44px;padding:4px}
}
@media(max-width:900px){
 .pdf-color-palette{grid-template-columns:repeat(5,minmax(0,1fr))}
 .pdf-color-palette button{min-height:44px!important;height:44px}
 .annotation-editor button{min-height:44px}
 .ae-sign-tools{gap:4px;justify-content:space-between}
 .ae-sign-add{order:3;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));flex-basis:100%}
 .ae-sign-add button{justify-content:center;flex-direction:column;gap:2px;padding:4px;min-width:0!important}
 .ae-sign-add small{font-size:10px}
 .signature-editor .ae-history{padding-left:3px;gap:1px}
 .signature-editor .ae-toolbar button{min-width:38px}
 .ae-close-toolbar{position:sticky;right:0}
 .pdf-sign-dialog{padding:48px 8px 8px}
 .pdf-preview-controls input,.pdf-preview-controls select{font-size:16px}
}
