.adv-toolbar{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:8px 0 20px}.adv-toolbar button,.adv-empty button,.adv-options>button,.adv-options details>button{border-radius:12px;padding:10px 15px;background:#f3eaf4;color:#87187a;font-weight:600;font-size:13px;min-height:42px}.adv-empty{min-height:330px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:18px;text-align:center;color:#6b6370;max-width:490px;margin:auto;font-size:14px;line-height:1.7}.adv-empty h2{font-size:25px;font-weight:700;color:#382d34}.adv-empty>.material-symbols-outlined{font-size:58px;color:#87187a}.adv-files{display:flex;gap:12px;flex-wrap:wrap;margin:20px 0}.adv-file{width:150px;min-width:0;padding:10px;background:#fff;border:1px solid #e7dfe7;border-radius:18px;display:flex;flex-direction:column;gap:6px}.adv-file.active{border-color:#87187a;box-shadow:0 0 0 2px #87187a12}.adv-file-preview{display:flex;align-items:center;justify-content:center;width:100%;height:105px;border-radius:10px;overflow:hidden;background:#f7f5f8;cursor:pointer}.adv-file-preview img{width:82%;height:82%;object-fit:contain;pointer-events:none}.adv-file p{font-size:12px;font-weight:600;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.adv-file .tool-hint{font-size:11px}.adv-file-actions{display:flex;gap:5px}.adv-file-actions button{background:#f5f1f6;color:#66365c;border-radius:8px;min-width:29px;min-height:30px;font-size:16px}.adv-file-actions button:last-child{margin-left:auto}.adv-file-actions button:disabled{opacity:.3}.adv-options{display:flex;flex-direction:column;gap:12px}.adv-options input:not([type=checkbox]):not([type=range]),.adv-options select{width:100%;min-width:0;border:1px solid #e2d8df;border-radius:10px;padding:10px 12px;font-size:13px;background:white}.adv-options .field-label{margin-bottom:4px}.adv-options .tool-hint{margin:0}.adv-options .option-actions button{font-size:11px}.adv-options details{font-size:13px;line-height:1.7}.adv-options summary{color:#87187a;cursor:pointer}.adv-options details>*:not(summary){margin-top:10px}.adv-options input[type=range]{width:100%;accent-color:#87187a}.adv-options select:disabled,.adv-options input:disabled{background:#faf8fb}.adv-options button:disabled{opacity:.4}.adv-action{position:sticky;top:0;background:white;padding-bottom:8px;z-index:30}.has-advanced-files #merge-btn:not(:disabled){background:#87187a;color:white;box-shadow:0 2px 6px #87187a18}.adv-stage{position:relative;max-width:720px;width:100%;margin:20px auto 32px;box-shadow:0 3px 22px #22191f15;background:white;isolation:isolate}.adv-stage canvas{display:block;width:100%;height:auto}.adv-overlay{position:absolute;inset:0;pointer-events:none}.adv-editable .adv-overlay{pointer-events:auto;touch-action:none;user-select:none}.adv-overlay svg{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;overflow:visible}.adv-overlay polygon{stroke:#87187a;stroke-width:.4;fill:#87187a12}.adv-corner{position:absolute;width:22px;height:22px;border:3px solid white;background:#87187a;border-radius:50%;transform:translate(-50%,-50%);cursor:move;box-shadow:0 0 0 1px #87187a}.adv-mark{position:absolute;cursor:move;box-sizing:border-box;border:1px dashed #87187a;background:transparent}.adv-mark img{display:block;width:100%;height:100%;pointer-events:none}.adv-mark.selected{outline:2px solid #87187a;outline-offset:2px}.adv-redaction{opacity:.75}.adv-redaction.selected{opacity:.9}.adv-resize{position:absolute;right:-6px;bottom:-6px;width:15px;height:15px;background:#87187a;border:2px solid white;cursor:nwse-resize;border-radius:3px}.adv-editable{cursor:crosshair}.adv-preview .preview-toolbar button,.preview-toolbar>button{background:#f3eaf4;color:#87187a;border-radius:8px;padding:5px 10px}.preview-toolbar>span:first-child{font-weight:600;overflow-wrap:anywhere}.preview-toolbar select{max-width:160px}.adv-camera{padding:16px;border:1px solid #e2d8df;background:white;border-radius:20px;margin-bottom:20px}.adv-camera video{display:block;width:100%;max-height:420px;object-fit:contain;margin-bottom:12px}.adv-processed,.adv-comparison{margin:26px 0;padding:16px;background:#fff;border:1px solid #e7dfe7;border-radius:18px}.adv-processed h3{font-weight:600;font-size:14px;margin-bottom:16px}.adv-processed img{display:block;width:100%;max-height:650px;object-fit:contain}.adv-compare-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.adv-compare-grid figure{min-width:0}.adv-compare-grid figcaption{font-size:12px;font-weight:600;margin-bottom:10px}.adv-compare-grid img{width:100%;height:auto;border:1px solid #e2d8df}.adv-comparison details{font-size:13px;line-height:1.7;margin-top:18px}.adv-comparison h4{font-weight:600;margin:12px 0 4px}.adv-comparison p{white-space:pre-wrap;overflow-wrap:anywhere;max-height:200px;overflow:auto}.adv-comparison #adv-removed-text{color:#991b1b}.adv-comparison #adv-added-text{color:#166534}#adv-recognized-text{width:100%;border:1px solid #e2d8df;border-radius:12px;padding:14px;font-size:13px;line-height:1.7;background:white;resize:vertical}#sign-pad{width:100%;height:auto;touch-action:none;background:white;border:1px dashed #b5a0b5;border-radius:12px;cursor:crosshair}#adv-progress{width:100%;height:8px;accent-color:#87187a;flex-shrink:0}#adv-summary{overflow-wrap:anywhere}#adv-preview{padding:4px 10px}body[data-tool=redact] .adv-overlay{cursor:crosshair}
@media(min-width:1024px){.adv-files{max-height:240px;overflow:auto;padding:3px}.adv-stage{max-width:min(720px,calc((100dvh - 300px)*var(--adv-ratio,.75)))}}
@media(max-width:1023px){.adv-empty{min-height:260px}.adv-file{width:calc(50% - 6px)}.adv-file-actions button{flex:1;min-height:36px}.adv-toolbar{flex-wrap:wrap}.adv-file-preview{height:115px}.adv-stage{max-width:calc(60dvh * var(--adv-ratio,.75))}.adv-compare-grid{grid-template-columns:1fr}.adv-compare-grid img{max-height:500px;object-fit:contain}.adv-corner{width:26px;height:26px}.adv-stage{margin-top:30px}.adv-resize{width:24px;height:24px}.adv-mark{min-width:8px;min-height:8px}}

.scan-camera-frame {
  position: relative;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 12px;
}
.scan-camera-frame video {
  width: auto;
  max-width: 100%;
  margin: 0;
}
.scan-camera-frame svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.scan-camera-frame polygon {
  fill: #19d6b820;
  stroke: #19d6b8;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}
