/* PDF kit: styles added for Compress PDF, Sign PDF and PDF to text (loaded after style.css) */
.pk-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.pk-compare figure { margin: 0; min-width: 0; }
.pk-compare figcaption { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.pk-compare figcaption span { color: var(--muted); font-weight: 400; }
.pk-view { overflow: auto; max-height: 70vh; border: 1px solid var(--border); border-radius: 8px; background: #1b1d24; }
.pk-view canvas { display: block; }
@media (max-width: 700px) { .pk-compare { grid-template-columns: 1fr; } .pk-view { max-height: 50vh; } }
#qualityOut { color: var(--accent); margin-left: 4px; }

/* PDF to text */
.pk-pages { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 4px; max-height: 320px; overflow: auto; }
.pk-page { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; gap: 8px; align-items: center; font-size: 12px; padding: 4px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--panel-2); }
.pk-page .kind { color: var(--muted); }
.pk-page .kind.ocr { color: var(--accent-2); }
.pk-page .kind.warn { color: var(--warn); }
.pk-text { width: 100%; min-height: 320px; resize: vertical; font: 13px/1.5 ui-monospace, "SF Mono", Menlo, Consolas, monospace; white-space: pre; overflow: auto; }
.pk-text.wrap { white-space: pre-wrap; }

/* Sign PDF */
.pk-tools { display: flex; flex-wrap: wrap; gap: 6px; }
.pk-tools .chip { display: inline-flex; align-items: center; gap: 6px; }
.pk-tools .chip img { height: 20px; max-width: 80px; object-fit: contain; background: #fff; border-radius: 3px; }
.pk-sheets { display: grid; gap: 18px; justify-items: center; }
.pk-sheet { position: relative; box-shadow: 0 2px 10px rgba(0, 0, 0, .5); background: #fff; touch-action: pan-x pan-y pinch-zoom; }
.pk-sheet canvas { display: block; width: 100%; height: 100%; }
.pk-sheet.placing { cursor: crosshair; outline: 2px dashed var(--accent); outline-offset: 3px; }
.pk-pageno { font-size: 12px; color: var(--muted); margin-bottom: -12px; }
.pk-item { position: absolute; border: 1px dashed transparent; touch-action: none; cursor: move; user-select: none; -webkit-user-select: none; }
.pk-item:hover, .pk-item.sel { border-color: var(--accent-2); }
.pk-item img { display: block; width: 100%; height: 100%; pointer-events: none; }
.pk-item .txt { display: block; width: 100%; height: 100%; color: #111; font-family: Helvetica, Arial, sans-serif; white-space: nowrap; line-height: 1; pointer-events: none; overflow: visible; }
.pk-item svg { display: block; width: 100%; height: 100%; pointer-events: none; }
.pk-handle { position: absolute; right: -11px; bottom: -11px; width: 22px; height: 22px; border-radius: 50%; background: var(--accent-2); border: 2px solid #fff; cursor: nwse-resize; display: none; touch-action: none; }
.pk-x { position: absolute; right: -11px; top: -11px; width: 22px; height: 22px; border-radius: 50%; background: #ff6b6b; color: #fff; border: 2px solid #fff; display: none; font: 700 12px/18px system-ui, sans-serif; text-align: center; padding: 0; cursor: pointer; }
.pk-item.sel .pk-handle, .pk-item.sel .pk-x { display: block; }
.pk-formfield { position: absolute; box-sizing: border-box; border: 1px solid rgba(145, 71, 255, .7); background: rgba(185, 140, 255, .18); color: #111; font: 13px/1.2 Helvetica, Arial, sans-serif; padding: 0 3px; margin: 0; border-radius: 2px; }
input.pk-formfield[type="checkbox"], input.pk-formfield[type="radio"] { accent-color: #9147ff; padding: 0; }
.pk-pad { width: 100%; height: 220px; background: #fff; border-radius: 8px; touch-action: none; display: block; cursor: crosshair; }
.pk-typed { width: 100%; height: 120px; background: #fff; border-radius: 8px; display: block; }
.pk-sigs { display: flex; flex-wrap: wrap; gap: 8px; }
.pk-sig { position: relative; border: 1px solid var(--border); border-radius: 8px; background: #fff; padding: 4px; cursor: pointer; }
.pk-sig[aria-pressed="true"] { outline: 3px solid var(--accent); }
.pk-sig img { display: block; height: 44px; max-width: 160px; object-fit: contain; }
.pk-legal { font-size: 12px; color: var(--muted); margin: 0; }
.pk-dlg.wide { width: min(560px, calc(100vw - 24px)); }
.pk-tabs { display: flex; gap: 6px; }
.pk-layer { position: absolute; inset: 0; }
.pk-toolbar { position: sticky; top: 0; z-index: 6; margin-bottom: 14px; box-shadow: 0 6px 18px rgba(0, 0, 0, .45); }
