#auto-trace-dialog{box-sizing:border-box;width:min(960px,94vw);max-height:92vh;margin:28px auto;border:1px solid #d9ddec;border-radius:16px;padding:18px;color:#24313a;background:#fff;box-shadow:0 24px 90px #17203355;transition:background-color 240ms ease,border-color 240ms ease,box-shadow 240ms ease}
#auto-trace-dialog::backdrop{background:#17203388;opacity:1;transition:opacity 260ms ease}
#auto-trace-dialog.auto-trace-animating{overflow:visible;pointer-events:none}
#auto-trace-dialog>.auto-trace-heading,#auto-trace-dialog>.auto-trace-mode-row,#auto-trace-dialog>.auto-trace-mode-hint,#auto-trace-dialog>.auto-trace-options,#auto-trace-dialog>.auto-trace-actions,#auto-trace-dialog>.auto-trace-canvas,#auto-trace-dialog>.auto-trace-footer{opacity:1;transition:opacity 220ms ease}
#auto-trace-dialog.auto-trace-entering,#auto-trace-dialog.auto-trace-closing{background:transparent!important;border-color:transparent!important;box-shadow:none!important}
#auto-trace-dialog.auto-trace-entering>.auto-trace-heading,#auto-trace-dialog.auto-trace-entering>.auto-trace-mode-row,#auto-trace-dialog.auto-trace-entering>.auto-trace-mode-hint,#auto-trace-dialog.auto-trace-entering>.auto-trace-options,#auto-trace-dialog.auto-trace-entering>.auto-trace-actions,#auto-trace-dialog.auto-trace-entering>.auto-trace-canvas,#auto-trace-dialog.auto-trace-entering>.auto-trace-footer,#auto-trace-dialog.auto-trace-closing>.auto-trace-heading,#auto-trace-dialog.auto-trace-closing>.auto-trace-mode-row,#auto-trace-dialog.auto-trace-closing>.auto-trace-mode-hint,#auto-trace-dialog.auto-trace-closing>.auto-trace-options,#auto-trace-dialog.auto-trace-closing>.auto-trace-actions,#auto-trace-dialog.auto-trace-closing>.auto-trace-canvas,#auto-trace-dialog.auto-trace-closing>.auto-trace-footer{opacity:0}
.auto-trace-shared-image{position:fixed;display:block;max-width:none;max-height:none;margin:0;padding:0;border:0;border-radius:0;object-fit:contain;transform:none!important;pointer-events:none;will-change:left,top,width,height,opacity;z-index:2}
#auto-trace-dialog.auto-trace-entering::backdrop,#auto-trace-dialog.auto-trace-closing::backdrop{opacity:0}
.auto-trace-heading,.auto-trace-actions,.auto-trace-footer{display:flex;align-items:center;justify-content:space-between;gap:12px}
.auto-trace-heading h2{font-size:20px;margin:0 0 4px}.auto-trace-heading p{font-size:12px;margin:0;color:#64748b}.auto-trace-heading button{flex:none}
.auto-trace-mode-row{display:flex;align-items:center;gap:10px;margin-top:16px;font-size:13px;flex-wrap:wrap}.auto-trace-mode-row select{padding:8px 12px;border:1px solid #c4b5fd;border-radius:8px;background:#f5f3ff;color:#4c1d95;font:inherit;min-width:220px}.auto-trace-mode-row button{margin-left:auto;font-size:12px}.auto-trace-mode-hint{font-size:12px;color:#64748b;line-height:1.5;margin:8px 0 12px}
.auto-trace-options{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:12px 0 16px}
.auto-trace-advanced>summary{display:none}
#auto-trace-dialog.auto-trace-entering>.auto-trace-advanced,#auto-trace-dialog.auto-trace-closing>.auto-trace-advanced{opacity:0}
.auto-trace-options label{font-size:12px;display:flex;flex-direction:column;gap:5px;background:#f8fafc;border:1px solid #e2e8f0;border-radius:10px;padding:10px}.auto-trace-options input{width:100%;height:28px;margin:0;accent-color:#7c3aed;cursor:ew-resize}.auto-trace-options input:focus-visible{outline:2px solid #7c3aed;outline-offset:3px;border-radius:5px}.auto-trace-options small{font-size:11px;color:#64748b;line-height:1.4}.auto-trace-option-title,.auto-trace-range-ends{display:flex;justify-content:space-between;gap:4px}.auto-trace-option-title{font-weight:600}.auto-trace-option-title output{color:#6d28d9;font-variant-numeric:tabular-nums}.auto-trace-range-ends{font-size:11px;color:#475569}
.auto-trace-actions{justify-content:flex-start;font-size:12px;flex-wrap:wrap}.auto-trace-actions label{display:flex;align-items:center;gap:4px}.auto-trace-actions input{width:auto}.auto-trace-actions span{margin-left:auto;color:#475569}
.auto-trace-actions .auto-trace-legend{margin-left:0;color:#123f8c;display:flex;align-items:center;gap:6px}.auto-trace-legend::before{content:"";width:24px;border-top:3px solid #123f8c;border-radius:2px}
#auto-trace-svg[aria-busy="true"] #auto-trace-lines,#auto-trace-svg[aria-busy="true"] #auto-trace-issues{opacity:.35}
.auto-trace-predicted-line{cursor:pointer}.auto-trace-predicted-line:focus{outline:none;stroke:#7c3aed}
.sparse-curve-controls{display:grid;gap:6px;margin:0 0 12px;padding:10px;border:1px solid #bae6fd;background:#f0f9ff;border-radius:10px;font-size:12px}.sparse-curve-controls small{color:#64748b;line-height:1.5}.sparse-curve-controls input{width:100%;min-width:0}
.auto-trace-canvas{background:#f8fafc;border:1px solid #dce3ee;border-radius:10px;margin:12px 0;overflow:auto}
#auto-trace-svg{display:block;width:100%;height:46vh;background:#fff}
.auto-trace-footer{font-size:12px;color:#64748b;line-height:1.5;flex-wrap:wrap}.auto-trace-footer button{flex:none;font-size:14px}
.auto-trace-footer>span{flex:1 1 200px}.auto-trace-footer>label{display:flex;align-items:center;gap:6px;min-height:36px}.auto-trace-footer input{width:auto}
#auto-trace-dialog [hidden]{display:none!important}
#auto-field-controls{margin:8px 0 12px;padding:10px 12px;border:1px solid #c4b5fd;border-radius:10px;background:#faf8ff;font-size:12px;color:#40335e}
.auto-field-notice{margin:0 0 8px;line-height:1.5}.auto-field-toolbar{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.auto-field-toolbar label{display:flex;align-items:center;gap:5px}.auto-field-toolbar input{width:auto}.auto-field-toolbar button,.auto-field-toolbar select{font-size:12px;min-height:36px}.auto-field-toolbar select{border:1px solid #c4b5fd;border-radius:6px;background:#fff;color:#40335e;padding:4px}
#auto-field-select[aria-pressed="true"]{background:#6d28d9;color:white;border-color:#6d28d9}
.auto-field-numeric{margin-top:8px}.auto-field-numeric summary{cursor:pointer;padding:4px 0}.auto-field-numeric>div{display:flex;gap:8px;align-items:end;flex-wrap:wrap;margin-top:6px}.auto-field-numeric label{display:grid;gap:3px}.auto-field-numeric input{width:74px;background:#fff;color:#40335e;border:1px solid #c4b5fd;border-radius:5px;padding:5px}
#auto-trace-dialog[data-field-preview] .auto-trace-actions>label{display:none}
#auto-trace-dialog[data-field-preview] .auto-trace-canvas{overflow:hidden}
#auto-trace-svg.auto-field-selecting{cursor:crosshair;touch-action:none}
#auto-trace-dialog.auto-trace-entering>#auto-field-controls,#auto-trace-dialog.auto-trace-closing>#auto-field-controls{opacity:0}
#auto-trace-summary,#auto-trace-dialog[data-purpose="fill"] .auto-trace-legend{color:inherit}
#auto-trace-dialog[data-purpose="fill"] .auto-trace-legend::before{width:14px;height:14px;border:0;border-radius:4px;background:#ef9b47}
@media(max-width:700px){.auto-trace-options{grid-template-columns:repeat(2,1fr);gap:8px}#auto-trace-svg{height:40vh}.auto-trace-footer{align-items:flex-start}}
@media(max-width:700px){.auto-trace-advanced>summary{display:list-item;padding:9px 0;cursor:pointer;font-size:12px;color:inherit}.auto-trace-advanced{margin-bottom:8px}.auto-trace-options{margin-top:6px}}
@media(prefers-reduced-motion:reduce){#auto-trace-dialog,#auto-trace-dialog::backdrop,#auto-trace-dialog>*{transition:none}}
