/* Toolxora PDF Toolkit v1 — premium UI, Toolxora design language */
.txpdf-tool{font-family:inherit;color:#0f172a}
.txpdf-grid{display:grid;grid-template-columns:minmax(0,.95fr) minmax(440px,1.05fr);gap:28px;align-items:start}
.txpdf-panel,.txpdf-preview-panel{background:#fff;border:1px solid #e2e8f0;border-radius:28px;padding:30px;box-shadow:0 24px 70px rgba(15,23,42,.07)}
.txpdf-preview-panel{position:sticky;top:96px;height:fit-content}
.txpdf-section-title{display:flex;align-items:flex-start;gap:18px;margin:0 0 24px}
.txpdf-section-title>span{display:grid;place-items:center;min-width:52px;height:52px;border-radius:17px;background:linear-gradient(135deg,#2563eb,#7c3aed);color:#fff;font-size:24px;flex:0 0 auto}
.txpdf-section-title h3{margin:0 0 5px;font-size:28px;line-height:1.15;color:#0f172a}
.txpdf-section-title p{margin:0;color:#64748b;font-size:16px}
.txpdf-dropzone{display:block;border:2px dashed #a5b4fc;border-radius:22px;background:linear-gradient(180deg,#f5f7ff,#eef2ff);padding:34px 22px;text-align:center;cursor:pointer;transition:.25s;margin-bottom:20px}
.txpdf-dropzone:hover,.txpdf-dropzone.is-drag{border-color:#6d28d9;background:linear-gradient(180deg,#eef2ff,#ede9fe);box-shadow:0 0 0 6px rgba(109,40,217,.08)}
.txpdf-dropzone input{display:none}
.txpdf-dropzone-inner i{display:grid;place-items:center;width:60px;height:60px;margin:0 auto 12px;border-radius:19px;background:linear-gradient(135deg,#2563eb,#7c3aed);color:#fff;font-style:normal;font-size:24px;box-shadow:0 14px 30px rgba(79,70,229,.35)}
.txpdf-dropzone-inner strong{display:block;font-size:18px;color:#0f172a;margin-bottom:5px}
.txpdf-dropzone-inner span{color:#64748b;font-size:13.5px;font-weight:600}
.txpdf-field{margin:0 0 18px}
.txpdf-field-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}
.txpdf-field label{display:block;font-weight:800;margin:0 0 8px;color:#0f172a}
.txpdf-field select,.txpdf-field input{width:100%;border:1px solid #dbe3ee;border-radius:16px;background:#f8fafc;color:#0f172a;padding:13px 15px;font:inherit;outline:none;box-sizing:border-box;transition:.2s}
.txpdf-field select:focus,.txpdf-field input:focus{border-color:#4f46e5;box-shadow:0 0 0 4px rgba(79,70,229,.1);background:#fff}
.txpdf-btnrow{display:flex;flex-wrap:wrap;gap:8px}
.txpdf-chip{border:1px solid #dbe3ee;background:#f8fafc;border-radius:12px;padding:11px 15px;font:inherit;font-weight:800;color:#0f172a;cursor:pointer;transition:.2s}
.txpdf-chip:hover{border-color:#4f46e5;background:#eef2ff;color:#2563eb}
.txpdf-hint{margin:8px 0 0;color:#64748b;font-size:12.5px;font-weight:600}
.txpdf-actions{display:flex;flex-wrap:wrap;gap:12px;margin-top:6px}
.txpdf-primary-btn,.txpdf-light-btn{border:0;border-radius:16px;padding:15px 22px;font:inherit;font-weight:900;cursor:pointer;transition:.2s}
.txpdf-primary-btn{background:linear-gradient(135deg,#2563eb,#7c3aed);color:#fff}
.txpdf-primary-btn:hover{transform:translateY(-1px);box-shadow:0 12px 26px rgba(79,70,229,.35)}
.txpdf-primary-btn:disabled{opacity:.6;cursor:wait;transform:none;box-shadow:none}
.txpdf-light-btn{background:#f1f5f9;color:#0f172a;border:1px solid #dbe3ee}
.txpdf-progress{display:flex;align-items:center;gap:12px;margin-top:14px;background:#eef2ff;border:1px solid #c7d2fe;border-radius:14px;padding:12px 16px;font-weight:800;color:#3730a3}
.txpdf-progress i{width:18px;height:18px;border:3px solid #c7d2fe;border-top-color:#4f46e5;border-radius:50%;animation:txpdfspin .8s linear infinite;flex:0 0 auto}
@keyframes txpdfspin{to{transform:rotate(360deg)}}
.txpdf-message{min-height:24px;margin:10px 0 0;color:#dc2626;font-weight:700}
.txpdf-message.is-success{color:#059669}
.txpdf-privacy{margin:14px 0 0;color:#64748b;font-size:13px;font-weight:600;text-align:center}
.txpdf-preview-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:20px}
.txpdf-preview-head strong{font-size:22px}
.txpdf-preview-head span{background:#eef2ff;color:#2563eb;border-radius:999px;padding:9px 14px;font-weight:800;font-size:13px}
.txpdf-stage{max-height:520px;overflow:auto;padding-right:4px}
.txpdf-empty{display:grid;place-items:center;text-align:center;background:#f8fafc;border:1px dashed #cbd5e1;border-radius:20px;padding:40px 20px;color:#64748b}
.txpdf-empty i{font-style:normal;font-size:34px;margin-bottom:10px}
.txpdf-empty p{margin:0;font-weight:600;font-size:14px;max-width:280px}
.txpdf-filelist{display:grid;gap:12px}
.txpdf-file{display:grid;grid-template-columns:44px 1fr auto;gap:12px;align-items:center;background:#f8fafc;border:1px solid #e2e8f0;border-radius:16px;padding:12px 14px}
.txpdf-file>i{display:grid;place-items:center;width:44px;height:44px;border-radius:12px;background:linear-gradient(135deg,#2563eb,#7c3aed);color:#fff;font-style:normal;font-weight:900;font-size:11px}
.txpdf-file img{width:44px;height:44px;object-fit:cover;border-radius:12px;border:1px solid #e2e8f0;background:#fff}
.txpdf-file-meta strong{display:block;color:#0f172a;font-size:13.5px;word-break:break-all}
.txpdf-file-meta span{display:block;color:#64748b;font-size:12px;font-weight:700;margin-top:3px}
.txpdf-file-ctrl{display:flex;gap:6px}
.txpdf-file-ctrl button{border:1px solid #dbe3ee;background:#fff;border-radius:10px;width:34px;height:34px;font:inherit;font-weight:900;cursor:pointer;color:#0f172a;transition:.15s}
.txpdf-file-ctrl button:hover{border-color:#4f46e5;color:#2563eb}
.txpdf-file-ctrl button.is-remove:hover{border-color:#fca5a5;color:#dc2626}
.txpdf-thumbs{display:grid;grid-template-columns:repeat(auto-fill,minmax(110px,1fr));gap:12px}
.txpdf-thumb{position:relative;border:2px solid #e2e8f0;border-radius:14px;overflow:hidden;cursor:pointer;background:#fff;transition:.18s;user-select:none}
.txpdf-thumb canvas{width:100%;height:auto;display:block}
.txpdf-thumb-num{position:absolute;left:7px;bottom:7px;background:rgba(15,23,42,.82);color:#fff;font-size:11px;font-weight:900;border-radius:8px;padding:3px 8px}
.txpdf-thumb-rot{position:absolute;right:7px;bottom:7px;background:#fff;border:1px solid #e2e8f0;color:#0f172a;font-size:11px;font-weight:900;border-radius:8px;padding:3px 7px}
.txpdf-thumb.is-selected{border-color:#7c3aed;box-shadow:0 0 0 4px rgba(124,58,237,.18)}
.txpdf-thumb.is-selected:after{content:"✓";position:absolute;top:7px;right:7px;width:24px;height:24px;display:grid;place-items:center;background:linear-gradient(135deg,#2563eb,#7c3aed);color:#fff;border-radius:50%;font-weight:900;font-size:13px}
.txpdf-thumb:hover{transform:translateY(-2px)}
.txpdf-results{display:grid;gap:12px;margin-top:16px}
.txpdf-result{display:grid;grid-template-columns:1fr auto;gap:12px;align-items:center;background:linear-gradient(135deg,#ecfdf5,#f0fdf4);border:1px solid #a7f3d0;border-radius:16px;padding:14px 16px}
.txpdf-result-meta strong{display:block;color:#065f46;font-size:14px;word-break:break-all}
.txpdf-result-meta span{display:block;color:#047857;font-size:12.5px;font-weight:700;margin-top:3px}
.txpdf-download-btn{border:0;border-radius:12px;padding:12px 18px;font:inherit;font-weight:900;cursor:pointer;background:linear-gradient(135deg,#059669,#10b981);color:#fff;white-space:nowrap}
.txpdf-download-btn:hover{box-shadow:0 10px 22px rgba(16,185,129,.35)}
/* Dark mode */
body.tx-dark-mode .txpdf-tool,html[data-theme=dark] .txpdf-tool{color:#e5e7eb}
.tx-dark-mode .txpdf-panel,.tx-dark-mode .txpdf-preview-panel,html[data-theme=dark] .txpdf-panel,html[data-theme=dark] .txpdf-preview-panel{background:#0f172a;border-color:#1e293b}
.tx-dark-mode .txpdf-section-title h3,.tx-dark-mode .txpdf-field label,.tx-dark-mode .txpdf-preview-head strong,.tx-dark-mode .txpdf-dropzone-inner strong,.tx-dark-mode .txpdf-file-meta strong,html[data-theme=dark] .txpdf-section-title h3,html[data-theme=dark] .txpdf-field label,html[data-theme=dark] .txpdf-preview-head strong,html[data-theme=dark] .txpdf-dropzone-inner strong,html[data-theme=dark] .txpdf-file-meta strong{color:#e5e7eb}
.tx-dark-mode .txpdf-section-title p,.tx-dark-mode .txpdf-privacy,.tx-dark-mode .txpdf-hint,.tx-dark-mode .txpdf-dropzone-inner span,html[data-theme=dark] .txpdf-section-title p,html[data-theme=dark] .txpdf-privacy,html[data-theme=dark] .txpdf-hint,html[data-theme=dark] .txpdf-dropzone-inner span{color:#94a3b8}
.tx-dark-mode .txpdf-dropzone,html[data-theme=dark] .txpdf-dropzone{background:linear-gradient(180deg,#111827,#1e1b4b);border-color:#4338ca}
.tx-dark-mode .txpdf-field select,.tx-dark-mode .txpdf-field input,.tx-dark-mode .txpdf-chip,html[data-theme=dark] .txpdf-field select,html[data-theme=dark] .txpdf-field input,html[data-theme=dark] .txpdf-chip{background:#111827;color:#e5e7eb;border-color:#334155}
.tx-dark-mode .txpdf-file,.tx-dark-mode .txpdf-empty,html[data-theme=dark] .txpdf-file,html[data-theme=dark] .txpdf-empty{background:#111827;border-color:#334155;color:#94a3b8}
.tx-dark-mode .txpdf-file-ctrl button,html[data-theme=dark] .txpdf-file-ctrl button{background:#1e293b;border-color:#334155;color:#e5e7eb}
.tx-dark-mode .txpdf-thumb,html[data-theme=dark] .txpdf-thumb{border-color:#334155;background:#111827}
.tx-dark-mode .txpdf-thumb-rot,html[data-theme=dark] .txpdf-thumb-rot{background:#1e293b;border-color:#334155;color:#e5e7eb}
.tx-dark-mode .txpdf-light-btn,html[data-theme=dark] .txpdf-light-btn{background:#1e293b;color:#e5e7eb;border-color:#334155}
.tx-dark-mode .txpdf-preview-head span,html[data-theme=dark] .txpdf-preview-head span{background:#1e1b4b;color:#c7d2fe}
.tx-dark-mode .txpdf-result,html[data-theme=dark] .txpdf-result{background:linear-gradient(135deg,#052e16,#064e3b);border-color:#065f46}
.tx-dark-mode .txpdf-result-meta strong,html[data-theme=dark] .txpdf-result-meta strong{color:#a7f3d0}
.tx-dark-mode .txpdf-result-meta span,html[data-theme=dark] .txpdf-result-meta span{color:#6ee7b7}
.tx-dark-mode .txpdf-progress,html[data-theme=dark] .txpdf-progress{background:#1e1b4b;border-color:#4338ca;color:#c7d2fe}
@media(max-width:1100px){.txpdf-grid{grid-template-columns:1fr}.txpdf-preview-panel{position:relative;top:auto}}
@media(max-width:700px){.txpdf-panel,.txpdf-preview-panel{padding:20px;border-radius:22px}.txpdf-section-title h3{font-size:23px}.txpdf-actions>*{width:100%}.txpdf-field-grid{grid-template-columns:1fr}.txpdf-thumbs{grid-template-columns:repeat(auto-fill,minmax(90px,1fr))}}

/* v1 additions: quick buttons row + two-column fields */
.txpdf-quickbtns{display:flex;flex-wrap:wrap;gap:9px;margin:0 0 18px}
.txpdf-row2{display:grid;grid-template-columns:1fr 1fr;gap:0 16px}
@media(max-width:700px){.txpdf-row2{grid-template-columns:1fr}.txpdf-quickbtns .txpdf-chip{flex:1;text-align:center}}

/* Batch 2: signature pad, organize controls, sign target */
.txpdf-sigpad{border:2px dashed #a5b4fc;border-radius:16px;background:#fff;overflow:hidden}
.txpdf-sigpad canvas{display:block;width:100%;height:160px;touch-action:none;cursor:crosshair}
.txpdf-org-ctrl{position:absolute;bottom:6px;left:50%;transform:translateX(-50%);display:flex;gap:5px;z-index:2}
.txpdf-org-ctrl button{border:0;background:rgba(15,23,42,.85);color:#fff;border-radius:8px;width:26px;height:26px;cursor:pointer;font-size:12px;line-height:1}
.txpdf-org-ctrl button:hover{background:#4338ca}
.txpdf-thumb{position:relative}
.txpdf-thumb.is-removed{opacity:.32;filter:grayscale(1)}
.txpdf-thumb.is-removed:after{content:"REMOVED";position:absolute;top:8px;left:50%;transform:translateX(-50%);background:#dc2626;color:#fff;font-size:10px;font-weight:900;border-radius:999px;padding:3px 9px}
.txpdf-thumb.is-signtarget{outline:3px solid #6d28d9;outline-offset:2px}
.txpdf-thumb.is-signtarget:after{content:"✍ SIGN HERE";position:absolute;top:8px;left:50%;transform:translateX(-50%);background:linear-gradient(135deg,#2563eb,#7c3aed);color:#fff;font-size:10px;font-weight:900;border-radius:999px;padding:3px 9px;white-space:nowrap}
.tx-dark-mode .txpdf-sigpad,html[data-theme=dark] .txpdf-sigpad{background:#f8fafc;border-color:#4338ca}

/* Fix: [hidden] must always hide (display:grid override bug) */
.txpdf-empty[hidden],.txpdf-progress[hidden],[data-view="rangeWrap"][hidden]{display:none!important}
.txpdf-results-left{margin-top:16px;display:grid;gap:12px}
