.auto-prep{border:1px solid var(--border-2);background:var(--surface-2);padding:14px;margin:12px 0;border-radius:6px;}
.auto-prep label{display:flex;align-items:center;gap:10px;font-weight:700;}
.auto-prep input{width:18px;height:18px;}
.auto-prep p{margin:8px 0 0;font-size:14px;line-height:1.5;}
.auto-panel{margin-top:12px;padding:14px;border:1px solid var(--border-2);border-radius:6px;background:var(--surface);}
.auto-panel[hidden],.auto-prep[hidden],#manualStrokePrep[hidden],#autoStrokePrep[hidden],#strokeBtn[hidden],#autoViewZoomLabel[hidden],#autoCapControls[hidden],#autoGuideSizeLabel[hidden]{display:none!important;}
.auto-panel h3{margin:0 0 6px;font-size:18px;}
.auto-panel p{font-size:14px;line-height:1.45;margin:6px 0;}
.auto-actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin:10px 0;}
.auto-actions .btn{min-height:42px;}
.auto-status{padding:8px 10px;background:var(--surface-2);font-size:13px;line-height:1.4;}
.auto-status.warn{background:#fff5df;}
#autoOverlay{position:absolute;z-index:20;touch-action:none;cursor:crosshair;}
#autoOverlay[hidden]{display:none;}
#videoContainer.auto-mode #videoInfo{display:none;}
.auto-panel progress{width:100%;height:18px;accent-color:var(--brand);}
.auto-rows{display:flex;gap:7px;flex-wrap:wrap;max-height:230px;overflow:auto;margin:10px 0;}
.auto-mark{display:flex;border:1px solid var(--border-2);border-radius:4px;overflow:hidden;}
.auto-mark button{border:0;background:var(--surface-2);color:var(--ink);padding:10px;cursor:pointer;font:inherit;font-size:13px;}
.auto-mark button:focus-visible{outline:2px solid var(--brand);outline-offset:-3px;}
.auto-mark.omitted{opacity:.55;text-decoration:line-through;}
.auto-mark.active{border:2px solid var(--brand);}
.auto-mark button+button{border-left:1px solid var(--border-2);}
.auto-review-check{display:flex;align-items:flex-start;gap:9px;padding:10px 0;font-size:14px;}
.auto-review-check input{width:18px;height:18px;flex:none;}
.auto-time{font-variant-numeric:tabular-nums;}
.auto-window{display:block;color:var(--muted);font-size:12px;margin:4px 0;font-variant-numeric:tabular-nums;}
.auto-view-zoom{display:flex;gap:10px;align-items:center;font-size:13px;margin:10px 0;}
#autoCapControls label{display:grid;gap:4px;font-size:13px;}
#workspaceSection.auto-workspace .video-stage{max-width:none;padding:0;border:0;background:transparent;}
#workspaceSection.auto-workspace .video-stage>.section-title{display:none;}
#workspaceSection.auto-workspace #videoContainer{height:74svh;max-height:none;min-height:320px;aspect-ratio:auto;border-radius:4px;box-shadow:none;}
#workspaceSection.auto-workspace[data-auto-phase="calibrate"] #sourceVideo{transform:scale(var(--cap-view-zoom,2));transform-origin:50% 50%;}



dialog.guided-camera{position:fixed;inset:0;margin:0;width:100vw;height:100dvh;max-width:none;max-height:none;box-sizing:border-box;display:flex;flex-direction:column;gap:0;padding:0;border:0;border-radius:0;background:#0b2434;color:#fff;overflow:hidden;}
.guided-camera[hidden],.guided-camera [hidden]{display:none!important;}
dialog.guided-camera::backdrop{background:#0b2434;}
.camera-topbar{position:absolute;z-index:4;top:max(8px,env(safe-area-inset-top));right:max(8px,env(safe-area-inset-right));display:flex;}
.camera-topbar #cameraClose{display:inline-flex;align-items:center;justify-content:center;flex:0 0 44px;width:44px;height:44px;min-height:44px;padding:0;border:1px solid rgba(255,255,255,.65);border-radius:50%;background:rgba(11,36,52,.72);color:#fff;box-shadow:none;}
.camera-topbar #cameraClose:hover{background:#0b2434;border-color:#fff;transform:none;}
#cameraClose svg{display:block;width:21px;height:21px;pointer-events:none;}
.camera-viewport{position:relative;flex:0 1 auto;height:min(62dvh,calc(100dvh - 190px));min-height:180px;width:100%;overflow:hidden;background:#0b2434;line-height:0;}
#guidedCameraVideo{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);display:block;max-width:none;max-height:none;object-fit:contain;}
.camera-frame{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);border-radius:50%;pointer-events:none;box-sizing:border-box;}
.camera-frame.aim{border:3px solid #ffe18a;}
.camera-frame.search{border:2px dashed #fff;}
#cameraElapsed{position:absolute;top:12px;left:12px;padding:6px 8px;background:rgba(7,26,39,.8);color:#fff;font:700 14px/1 Arial,sans-serif;font-variant-numeric:tabular-nums;}
.guided-camera[data-phase="recording"] #cameraElapsed{background:#a12323;}
.camera-toolbar{display:flex;flex-direction:column;align-items:stretch;gap:8px;padding:8px 12px max(8px,env(safe-area-inset-bottom));background:#0b2434;flex:none;}
.guided-camera #cameraStatus{font-size:12px;line-height:1.35;margin:0;padding:0;text-align:center;flex:none;}
.guided-camera .auto-actions{margin:0;gap:6px;}
.guided-camera .auto-actions .btn{min-height:38px;padding:8px 12px;font-size:13px;}
.camera-capture-control{display:flex;justify-content:center;align-items:center;min-height:62px;}
.camera-shutter{display:inline-flex;align-items:center;justify-content:center;width:62px;height:62px;padding:5px;border:2px solid #fff;border-radius:50%;background:transparent;color:#fff;cursor:pointer;box-shadow:none;-webkit-tap-highlight-color:transparent;}
.camera-shutter span{display:block;width:46px;height:46px;border-radius:50%;background:#e12736;transition:width .18s ease,height .18s ease,border-radius .18s ease,transform .18s ease,opacity .18s ease;}
.camera-shutter:hover{background:rgba(255,255,255,.08);transform:none;}
.camera-shutter:active span{transform:scale(.9);}
.camera-shutter:disabled{cursor:wait;opacity:.48;}
.camera-shutter.recording span{width:29px;height:29px;border-radius:7px;animation:camera-recording-pulse 1.15s ease-in-out infinite;}
@keyframes camera-recording-pulse{0%,100%{opacity:1;transform:scale(1);}50%{opacity:.68;transform:scale(.86);}}
.camera-tools-row{display:grid;grid-template-columns:44px minmax(160px,320px) 44px;align-items:center;justify-content:center;gap:10px;min-height:58px;}
.camera-tools-row::before{content:"";width:44px;height:44px;}
.camera-tools-row:has(#cameraZoomLabel[hidden]){grid-template-columns:44px;}
.camera-tools-row:has(#cameraZoomLabel[hidden])::before{display:none;}
.camera-info-button{grid-column:3;display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;padding:0;border:1px solid rgba(255,255,255,.65);border-radius:50%;background:transparent;color:#fff;cursor:pointer;box-shadow:none;}
.camera-tools-row:has(#cameraZoomLabel[hidden]) .camera-info-button{grid-column:1;}
.camera-info-button:hover{background:rgba(255,255,255,.08);border-color:#fff;transform:none;}
.camera-info-button svg{display:block;width:24px;height:24px;pointer-events:none;}
.camera-review-actions:empty{display:none;}
#cameraZoomLabel{grid-column:2;display:grid;grid-template-rows:34px 18px;justify-items:center;align-items:center;width:100%;min-width:0;}
.camera-zoom-track{position:relative;width:100%;height:34px;}
.camera-zoom-track::before{content:"";position:absolute;left:11px;right:11px;top:8px;height:18px;background:repeating-linear-gradient(90deg,rgba(255,255,255,.42) 0 1px,transparent 1px 10%);pointer-events:none;}
#cameraZoom{position:relative;z-index:1;display:block;width:100%;height:34px;margin:0;padding:0;appearance:none;-webkit-appearance:none;background:transparent;cursor:pointer;touch-action:pan-x;}
#cameraZoom:disabled{cursor:default;opacity:.7;}
#cameraZoom::-webkit-slider-runnable-track{height:4px;border-radius:2px;background:#9bb2c0;}
#cameraZoom::-webkit-slider-thumb{width:22px;height:22px;margin-top:-9px;border:3px solid #fff;border-radius:50%;background:#ffe18a;appearance:none;-webkit-appearance:none;}
#cameraZoom::-moz-range-track{height:4px;border:0;border-radius:2px;background:#9bb2c0;}
#cameraZoom::-moz-range-thumb{width:16px;height:16px;border:3px solid #fff;border-radius:50%;background:#ffe18a;}
#cameraZoomValue{display:block;min-width:4ch;color:#fff;font-size:13px;font-weight:700;line-height:18px;text-align:center;font-variant-numeric:tabular-nums;}
.camera-tips-sheet{position:absolute;inset:56px 12px 84px auto;max-width:420px;width:calc(100% - 24px);box-sizing:border-box;overflow:auto;padding:16px;color:var(--ink);background:var(--surface);border-radius:6px;line-height:1.5;}
.camera-tips-head{display:flex;align-items:center;justify-content:space-between;gap:8px;}
.camera-tips-sheet p{font-size:14px;margin:14px 0;}
html:has(#guidedCameraPanel[open]){overflow:hidden;scroll-behavior:auto;}
.guided-camera :focus-visible{outline:2px solid #ffe18a;outline-offset:3px;}
@media(max-width:600px){.auto-panel{padding:10px;}.auto-actions .btn{flex:1 1 auto;font-size:13px;padding:9px;}.auto-rows{max-height:180px;}#workspaceSection.auto-workspace #videoContainer{height:68svh;min-height:300px;}.camera-toolbar{gap:6px;}.camera-tips-sheet{inset:52px 8px 80px;max-width:none;width:calc(100% - 16px);}}
@media(max-width:720px){
  .auto-panel{padding:14px;}
  .auto-actions{gap:10px;}
  .auto-actions .btn{flex:1 1 140px;min-width:0;min-height:46px;padding:10px 12px;font-size:14px;line-height:1.2;white-space:normal;}
  .auto-actions label{min-width:0;flex:1 1 140px;}
  .auto-actions select{font-size:16px;}
  .auto-view-zoom{flex-wrap:wrap;font-size:14px;}
  .auto-view-zoom input,#autoCapControls input,.auto-scrubber input{min-height:44px;touch-action:pan-x;}
  .auto-mark{max-width:100%;}
  .auto-mark button{min-height:44px;padding:10px 12px;font-size:14px;}
  .auto-review-check{min-height:44px;align-items:center;}
  .auto-review-check input{width:22px;height:22px;}
  
  
  
  #workspaceSection.auto-workspace #videoContainer{height:60svh;min-height:260px;}
  .camera-toolbar{align-items:stretch;gap:10px;padding:10px 12px max(12px,env(safe-area-inset-bottom));}
  .guided-camera #cameraStatus{font-size:14px;}
  .guided-camera .auto-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:100%;gap:8px;}
  .guided-camera .auto-actions .btn{min-height:44px;padding:9px 10px;font-size:14px;}
  #cameraUse{grid-column:1 / -1;}
  .camera-capture-control{min-height:66px;}
  .camera-tools-row{grid-template-columns:44px minmax(150px,1fr) 44px;gap:10px;}
  #cameraZoomLabel{width:100%;}
  .camera-tips-sheet{inset:54px 8px 8px;max-width:none;width:calc(100% - 16px);z-index:5;}
}
@media(max-width:360px){.guided-camera .auto-actions{grid-template-columns:minmax(0,1fr);}.guided-camera .auto-actions .btn{grid-column:1;}}
@media(max-height:520px){.camera-viewport{height:calc(100dvh - 180px);min-height:105px;}.camera-toolbar{gap:3px;padding:3px 10px max(3px,env(safe-area-inset-bottom));}.camera-capture-control{min-height:52px;}.camera-shutter{width:50px;height:50px;padding:4px;}.camera-shutter span{width:38px;height:38px;}.camera-shutter.recording span{width:24px;height:24px;}.camera-tools-row{min-height:55px;}.guided-camera[data-phase="preview"] #cameraStatus,.guided-camera[data-phase="recording"] #cameraStatus{flex-basis:auto;}.guided-camera .auto-actions .btn{min-height:34px;padding:6px 10px;}#workspaceSection.auto-workspace #videoContainer{height:85svh;min-height:220px;}}
@media(max-height:520px) and (max-width:720px){.guided-camera .auto-actions .btn,.camera-topbar .btn{min-height:44px;}.camera-toolbar{max-height:55dvh;overflow-y:auto;}.camera-viewport{min-height:100px;}}
@media(prefers-reduced-motion:reduce){.camera-shutter.recording span{animation:none;}}
