*,*:before,*:after{box-sizing:border-box}:root{--bg: #0f1419;--surface: #1a2332;--surface-2: #243044;--border: #2d3a4f;--text: #e8edf4;--muted: #8b9cb3;--primary: #4f7cff;--primary-hover: #3d6aef;--danger: #ef4444;--radius: 10px;--shadow: 0 8px 32px rgba(0, 0, 0, .35);font-family:Segoe UI,system-ui,-apple-system,sans-serif;line-height:1.5;color:var(--text);background:var(--bg)}body{margin:0;height:100vh;overflow:hidden}#root{height:100vh;overflow:hidden}.app{display:flex;height:100vh;overflow:hidden}.toolbar{width:280px;flex-shrink:0;height:100vh;position:fixed;left:0;top:0;background:var(--surface);border-right:1px solid var(--border);padding:1.25rem;display:flex;flex-direction:column;gap:1.25rem;overflow-y:auto;z-index:10}.toolbar-brand{display:flex;align-items:center;gap:.75rem}.brand-icon{font-size:1.75rem}.toolbar-brand strong,.toolbar-brand .brand-title{display:block;font-size:1.1rem;font-weight:700;margin:0}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.toolbar-brand small{color:var(--muted);font-size:.8rem}.privacy-badge{display:flex;align-items:flex-start;gap:.45rem;padding:.55rem .65rem;font-size:.78rem;line-height:1.4;color:var(--muted);background:#4f7cff14;border:1px solid rgba(79,124,255,.22);border-radius:8px}.zoom-row{display:flex;flex-direction:column;gap:.4rem}.zoom-label{font-size:.75rem;color:var(--muted)}.zoom-btns{display:flex;flex-wrap:wrap;gap:.3rem}.zoom-btns .btn{flex:1;min-width:2.5rem;padding:.3rem .4rem}.toolbar-section{display:flex;flex-direction:column;gap:.6rem}.section-label{font-size:.7rem;font-weight:600;text-transform:uppercase;letter-spacing:.06em;color:var(--muted)}.tool-grid{display:grid;grid-template-columns:1fr 1fr;gap:.5rem}.tool-btn{display:flex;flex-direction:column;align-items:center;gap:.25rem;padding:.65rem .5rem;background:var(--surface-2);border:1px solid var(--border);border-radius:var(--radius);color:var(--text);cursor:pointer;font-size:.75rem;transition:border-color .15s,background .15s}.tool-btn:hover{border-color:var(--primary)}.tool-btn.active{background:#4f7cff26;border-color:var(--primary);color:#a8c0ff}.tool-icon{font-size:1.1rem;font-weight:700}.btn{display:inline-flex;align-items:center;justify-content:center;gap:.4rem;padding:.55rem 1rem;border-radius:var(--radius);border:none;font-size:.875rem;font-weight:500;cursor:pointer;transition:background .15s,opacity .15s}.btn:disabled{opacity:.45;cursor:not-allowed}.btn-primary{background:var(--primary);color:#fff}.btn-primary:hover:not(:disabled){background:var(--primary-hover)}.btn-secondary{background:var(--surface-2);color:var(--text);border:1px solid var(--border)}.btn-secondary:hover:not(:disabled){border-color:var(--primary)}.btn-danger{background:var(--danger);color:#fff}.btn-danger:hover:not(:disabled){filter:brightness(1.08)}.btn-ghost{background:transparent;color:var(--muted)}.btn-ghost:hover:not(:disabled){color:var(--text);background:var(--surface-2)}.btn-sm{padding:.35rem .65rem;font-size:.8rem}.file-btn{cursor:pointer}.undo-redo-row{display:flex;gap:.4rem}.undo-redo-row .btn{flex:1}.field{display:flex;flex-direction:column;gap:.35rem;font-size:.85rem}.field.inline{flex-direction:row;align-items:center;justify-content:space-between}.field span{color:var(--muted)}.field input[type=text],.field input[type=number],.field textarea{background:var(--surface-2);border:1px solid var(--border);border-radius:6px;padding:.4rem .6rem;color:var(--text);width:100%;font-family:inherit;resize:vertical}.field.inline input{width:auto;min-width:4rem}.hint{font-size:.78rem;color:var(--muted);margin:0}.options-panel{padding:.75rem;background:var(--surface-2);border-radius:var(--radius);border:1px solid var(--border)}.checkbox-field{display:flex;align-items:center;gap:.5rem;cursor:pointer}.checkbox-field input[type=checkbox]{accent-color:var(--primary)}.color-swatches{display:flex;flex-wrap:wrap;gap:.4rem}.color-swatch{width:1.75rem;height:1.75rem;border-radius:50%;border:2px solid transparent;cursor:pointer;padding:0;transition:border-color .15s,transform .15s}.color-swatch:hover{transform:scale(1.08)}.color-swatch.active{border-color:var(--primary);box-shadow:0 0 0 2px var(--surface-2)}.range-value{min-width:2.5rem;font-size:.85rem;color:var(--muted)}.stored-list{display:flex;flex-direction:column;gap:.4rem}.stored-item{display:flex;align-items:center;gap:.5rem;padding:.4rem;background:var(--surface);border:1px solid var(--border);border-radius:6px;cursor:pointer;color:var(--text);text-align:left}.stored-item.active{border-color:var(--primary)}.stored-item img{height:28px;max-width:80px;object-fit:contain;background:#fff;border-radius:3px}.page-controls{display:flex;align-items:center;justify-content:space-between;gap:.5rem}.workspace{flex:1;min-width:0;margin-left:280px;height:100vh;overflow:auto;padding:1.5rem;display:flex;flex-direction:column;align-items:stretch;gap:2rem;position:relative;background:radial-gradient(circle at 20% 20%,rgba(79,124,255,.06),transparent 40%),var(--bg)}.workspace-drag-over{outline:2px dashed var(--primary);outline-offset:-8px}.drop-overlay{position:absolute;inset:0;z-index:50;display:flex;align-items:center;justify-content:center;background:#0f1419bf;backdrop-filter:blur(2px);pointer-events:none}.drop-overlay-card{text-align:center;padding:2rem 2.5rem;background:var(--surface);border:2px dashed var(--primary);border-radius:16px}.drop-overlay-icon{font-size:2.5rem;display:block;margin-bottom:.75rem}.drop-overlay-card p{margin:0;font-size:1.15rem;font-weight:600;color:var(--text)}.workspace-editor{width:max-content;min-width:100%;display:flex;justify-content:center;align-items:flex-start}.empty-state{width:100%;display:flex;justify-content:center;padding-top:4rem}.empty-card{text-align:center;max-width:420px;padding:2.5rem;background:var(--surface);border:1px dashed var(--border);border-radius:16px}.empty-privacy{display:flex;align-items:flex-start;gap:.5rem;text-align:left;margin:0 0 1.25rem;padding:.75rem 1rem;font-size:.88rem;line-height:1.5;color:var(--muted);background:#4f7cff14;border:1px solid rgba(79,124,255,.2);border-radius:10px}.empty-privacy-icon{flex-shrink:0;font-size:1rem;line-height:1.5}.empty-icon{font-size:3rem;display:block;margin-bottom:1rem}.empty-import-btn{font-size:1.05rem;padding:.75rem 1.5rem}.empty-hint{margin:1rem 0 0;color:var(--muted);font-size:.9rem}.empty-steps{text-align:left;margin:1.25rem 0 0;padding-left:1.25rem;color:var(--muted);font-size:.88rem;line-height:1.7}.loading-card{display:flex;flex-direction:column;align-items:center;gap:1rem}.loading-spinner{display:inline-block;width:28px;height:28px;border:3px solid var(--border);border-top-color:var(--primary);border-radius:50%;animation:spin .7s linear infinite}.loading-spinner-lg{width:40px;height:40px;border-width:4px}@keyframes spin{to{transform:rotate(360deg)}}.page-placeholder{display:flex;align-items:center;justify-content:center;width:100%;min-width:300px;background:#f3f4f6}.onboarding-banner{position:sticky;top:0;z-index:40;width:100%;max-width:900px;margin:0 auto 1rem;padding:.75rem 1rem;background:#4f7cff1f;border:1px solid rgba(79,124,255,.35);border-radius:10px;align-self:center}.onboarding-content{display:flex;flex-direction:column;gap:.2rem;font-size:.88rem;color:var(--text)}.onboarding-content strong{font-size:.95rem}.viewer-wrap{width:max-content;min-width:100%;display:flex;justify-content:center}.pdf-document{display:flex;flex-direction:column;align-items:center;gap:1.5rem;padding-bottom:2rem;width:max-content}.page-container{display:flex;flex-direction:column;align-items:stretch;gap:.5rem;width:max-content}.page-header{display:flex;align-items:center;justify-content:space-between;width:100%;max-width:100%;gap:.75rem}.page-label{font-size:.8rem;color:var(--muted);padding-left:.25rem}.page-delete-btn{color:var(--danger);flex-shrink:0}.page-count{margin:0;font-size:.95rem;font-weight:500}.page-stage{position:relative;box-shadow:var(--shadow);border-radius:4px;overflow:hidden;background:#fff;flex-shrink:0}.page-stage.tool-text,.page-stage.tool-signature,.page-stage.tool-initial,.page-stage.tool-image,.page-stage.tool-cross,.page-stage.tool-checkbox{cursor:crosshair}.page-stage.tool-highlight,.page-stage.tool-draw{cursor:crosshair;touch-action:none}.page-stage.tool-select{cursor:default}.annotation-layer{position:absolute;inset:0;pointer-events:none;z-index:6}.pdf-canvas{display:block;vertical-align:top}.watermark-canvas{position:absolute;inset:0;pointer-events:none;z-index:2}.draw-canvas{position:absolute;inset:0;pointer-events:none}.draw-canvas.active{pointer-events:auto;cursor:crosshair}.annotation{position:absolute;user-select:none;pointer-events:auto;cursor:move}.annotation.text{display:block;font-family:Helvetica,Arial,sans-serif;padding:4px;box-sizing:border-box;background:transparent;overflow:visible}.annotation.text .annotation-text{width:100%;height:100%;overflow:visible}.text-line{line-height:1.35;min-height:1.35em;word-break:break-word}.annotation.signature,.annotation.initial,.annotation.image,.annotation.cross,.annotation.highlight,.annotation.checkbox{overflow:visible}.annotation.signature img,.annotation.initial img,.annotation.image img{width:100%;height:100%;object-fit:contain;pointer-events:none;display:block}.annotation.cross .cross-mark{width:100%;height:100%;display:block;pointer-events:none;overflow:hidden}.annotation.highlight .highlight-fill{width:100%;height:100%;opacity:.45;border-radius:2px;pointer-events:none}.annotation.checkbox .checkbox-box{width:100%;height:100%;border:2px solid currentColor;border-radius:3px;display:flex;align-items:center;justify-content:center;background:#fff;box-sizing:border-box;pointer-events:none}.checkbox-check{font-size:1.1em;font-weight:700;line-height:1}.highlight-preview{position:absolute;opacity:.45;border-radius:2px;pointer-events:none;z-index:5}.annotation.selected{outline:2px solid var(--primary);outline-offset:2px}.resize-handle{position:absolute;right:-6px;bottom:-6px;width:12px;height:12px;background:var(--primary);border:2px solid #fff;border-radius:2px;cursor:nwse-resize;z-index:2;box-shadow:0 1px 4px #00000040}.resize-handle:hover{background:var(--primary-hover)}.ann-delete{position:absolute;top:-10px;right:-10px;width:22px;height:22px;border-radius:50%;border:2px solid #fff;background:var(--danger);color:#fff;font-size:14px;font-weight:700;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center;z-index:5;box-shadow:0 1px 4px #00000040;pointer-events:auto}.ann-toggle{position:absolute;top:-10px;left:-10px;width:22px;height:22px;border-radius:50%;border:2px solid #fff;background:var(--primary);color:#fff;font-size:11px;font-weight:700;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center;z-index:5;box-shadow:0 1px 4px #00000040;pointer-events:auto}.live-text-block{position:absolute;z-index:30;pointer-events:auto;display:flex;flex-direction:column;background:transparent;border:none;box-shadow:none;overflow:visible;gap:.35rem}.live-text-field{width:100%;min-height:2.5rem;resize:vertical;border:none;outline:1px dashed rgba(79,124,255,.65);outline-offset:2px;background:transparent;font-family:Helvetica,Arial,sans-serif;line-height:1.35;padding:0;margin:0;box-sizing:border-box;white-space:pre-wrap;word-break:break-word;overflow-wrap:anywhere}.live-text-options{display:flex;align-items:center;flex-wrap:wrap;gap:.4rem;padding:.4rem .5rem;background:var(--surface-2);border-top:1px solid var(--border)}.live-text-opt{display:flex;align-items:center;gap:.3rem;font-size:.75rem;color:var(--muted)}.live-text-opt input[type=number]{width:2.75rem;background:var(--surface-2);border:1px solid var(--border);border-radius:4px;padding:.15rem .25rem;color:var(--text);font-size:.8rem}.live-text-opt input[type=color]{width:1.75rem;height:1.75rem;padding:0;border:1px solid var(--border);border-radius:4px;cursor:pointer}.live-text-hint{margin:.35rem .5rem .45rem;font-size:.72rem;color:var(--muted)}.live-text-opt input[type=range]{width:5.5rem;accent-color:var(--primary)}.live-text-field::placeholder{color:currentColor;opacity:.35}.page-tool-box{position:absolute;left:50%;bottom:12px;transform:translate(-50%);z-index:15;display:flex;align-items:center;flex-wrap:wrap;gap:.5rem;padding:.5rem .75rem;background:var(--surface);border:1px solid var(--border);border-radius:10px;box-shadow:var(--shadow);max-width:calc(100% - 24px);pointer-events:auto}.page-tool-label{font-size:.75rem;font-weight:600;color:var(--muted);text-transform:uppercase;letter-spacing:.03em}.page-tool-opt{display:flex;align-items:center;gap:.3rem;font-size:.75rem;color:var(--muted)}.page-tool-opt input[type=number]{width:2.75rem;background:var(--surface-2);border:1px solid var(--border);border-radius:4px;padding:.15rem .25rem;color:var(--text);font-size:.8rem}.page-tool-opt input[type=color]{width:1.75rem;height:1.75rem;padding:0;border:1px solid var(--border);border-radius:4px;cursor:pointer}.page-tool-opt select{background:var(--surface-2);border:1px solid var(--border);border-radius:4px;padding:.15rem .25rem;color:var(--text);font-size:.8rem}.page-tool-hint{font-size:.75rem;color:var(--muted);white-space:nowrap}.page-tool-thumb{width:32px;height:32px;object-fit:contain;border-radius:4px;border:1px solid var(--border);background:#fff}.page-tool-pick{width:36px;height:28px;padding:2px;border:1px solid var(--border);border-radius:4px;background:var(--surface-2);cursor:pointer}.page-tool-pick.active{border-color:var(--primary);box-shadow:0 0 0 2px #4f7cff40}.page-tool-pick img{width:100%;height:100%;object-fit:contain}.text-popover{margin-top:.5rem}.image-preview img{max-width:100%;max-height:80px;object-fit:contain;background:#fff;border-radius:6px;border:1px solid var(--border)}.text-popover{position:absolute;z-index:20;pointer-events:auto;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:.75rem;box-shadow:var(--shadow);min-width:220px}.text-popover input{width:100%;background:var(--surface-2);border:1px solid var(--border);border-radius:6px;padding:.5rem;color:var(--text);margin-bottom:.5rem}.text-popover-options{display:flex;flex-direction:column;gap:.4rem;margin-bottom:.5rem}.popover-actions{display:flex;justify-content:flex-end;gap:.4rem}.modal-backdrop{position:fixed;inset:0;background:#0009;display:flex;align-items:center;justify-content:center;z-index:100;padding:1rem}.modal{background:var(--surface);border:1px solid var(--border);border-radius:14px;padding:1.5rem;width:100%;max-width:520px;box-shadow:var(--shadow)}.modal h2{margin:0 0 1rem;font-size:1.25rem}.sig-pad-wrap{margin:1rem 0}.sig-pad{width:100%;height:160px;border:2px dashed var(--border);border-radius:var(--radius);touch-action:none;cursor:crosshair}.sig-hint{display:block;font-size:.75rem;color:var(--muted);margin-top:.35rem}.modal-actions{display:flex;justify-content:flex-end;gap:.5rem;margin-top:1rem}.manage-modal .manage-list{list-style:none;padding:0;margin:1rem 0 0;display:flex;flex-direction:column;gap:.5rem}.manage-list li{display:flex;align-items:center;gap:.75rem;padding:.5rem;background:var(--surface-2);border-radius:8px}.manage-list img{height:36px;max-width:100px;object-fit:contain;background:#fff;border-radius:4px;padding:2px}.manage-list span{flex:1}.empty-list{color:var(--muted);font-size:.9rem}.toast-container{position:fixed;bottom:1.25rem;right:1.25rem;z-index:200;display:flex;flex-direction:column;gap:.5rem;max-width:min(360px,calc(100vw - 2rem))}.toast{display:flex;align-items:flex-start;justify-content:space-between;gap:.75rem;padding:.75rem 1rem;background:var(--surface);border:1px solid var(--border);border-radius:10px;box-shadow:var(--shadow);font-size:.88rem;animation:toast-in .2s ease}.toast-success{border-color:#22c55e66}.toast-error{border-color:#ef444466}.toast-close{flex-shrink:0;background:none;border:none;color:var(--muted);font-size:1.1rem;cursor:pointer;padding:0;line-height:1}.toast-close:hover{color:var(--text)}@keyframes toast-in{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}@media (max-width: 768px){.app{flex-direction:column}.toolbar{position:relative;width:100%;height:auto;max-height:45vh;border-right:none;border-bottom:1px solid var(--border)}.workspace{margin-left:0;height:auto;flex:1;min-height:0}.tool-grid{grid-template-columns:repeat(3,1fr)}.zoom-btns .btn{flex:0 1 auto}.toast-container{left:1rem;right:1rem;bottom:1rem;max-width:none}}
