@charset "UTF-8";
.putko-scan-overlay{position:fixed;inset:0;z-index:350;display:flex;align-items:center;justify-content:center;padding:18px;background:#112b2ac7;backdrop-filter:blur(5px);overflow:hidden;overscroll-behavior:none}
.putko-scan-dialog{display:flex;flex-direction:column;width:min(740px,100%);height:min(880px,calc(100vh - 36px));height:min(880px,calc(100dvh - 36px));min-width:0;max-width:100%;background:#f7f8f4;border:1px solid #dbe7dc;border-radius:24px;box-shadow:0 25px 90px #071d2b4d;overflow:hidden;color:#1b2e2b}
.putko-scan-header{display:flex;gap:18px;justify-content:space-between;align-items:flex-start;padding:23px 25px 19px;border-bottom:1px solid #e4e9e2;background:#fff;flex:none;min-width:0}
.putko-scan-header>div{min-width:0}.putko-scan-kicker{display:block;font-size:10px;font-weight:750;letter-spacing:1.4px;color:#167b58;margin-bottom:5px}.putko-scan-header h2{font-size:23px;line-height:1.3;letter-spacing:-.6px}.putko-scan-header p{font-size:12px;color:var(--sub);margin-top:5px;overflow-wrap:anywhere}
.putko-scan-close{display:flex;align-items:center;justify-content:center;flex:none;border:1px solid #e4e9e2;border-radius:12px;color:var(--sub);background:#fff;font-size:27px;line-height:1;width:44px;height:44px;padding:0}.putko-scan-close:hover{background:#eaf4ed;color:#167b58}
.putko-scan-main{display:flex;flex-direction:column;gap:10px;min-height:0;min-width:0;flex:1;padding:17px 22px 11px;overflow:hidden}.putko-scan-status{font-size:12px;line-height:1.55;color:#536a60;flex:none;overflow-wrap:anywhere}.putko-scan-view{display:flex;align-items:center;justify-content:center;min-height:90px;min-width:0;flex:1;position:relative;overflow:hidden;border:1px solid #dce4dd;border-radius:14px;background:repeating-conic-gradient(#e9eee8 0% 25%,#f0f3ec 0% 50%) 50%/20px 20px;padding:18px;touch-action:pan-y}
.putko-scan-preview{display:block;max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain;box-shadow:0 4px 20px #263d3022;background:#fff;border-radius:2px}.putko-scan-editor{position:relative;flex:none;min-width:0;max-width:100%;max-height:100%;margin:auto;touch-action:none;user-select:none;-webkit-user-select:none}.putko-scan-editor canvas{display:block;width:100%;height:100%;object-fit:fill}.putko-scan-editor svg{position:absolute;inset:0;display:block;width:100%;height:100%;overflow:visible;pointer-events:none}.putko-scan-editor polygon{fill:#167b5820;stroke:#2aca94;stroke-width:6;vector-effect:non-scaling-stroke;stroke-linejoin:round}.putko-scan-editor[data-scan-selection-valid=false] polygon{stroke:#b96343;fill:#b9634320}
.putko-scan-handle{position:absolute;display:flex;align-items:center;justify-content:center;width:38px;height:38px;min-width:38px;border-radius:50%;border:3px solid #fff;background:#167b58;color:#fff;transform:translate(-50%,-50%);padding:0;font-size:13px;font-weight:750;box-shadow:0 2px 10px #183b3450;touch-action:none;cursor:grab;z-index:2}.putko-scan-handle::before{content:"";position:absolute;inset:-6px;border-radius:50%}.putko-scan-handle.dragging{cursor:grabbing;transform:translate(-50%,-50%) scale(1.12);box-shadow:0 0 0 6px #dff49b80,0 2px 10px #183b3450}.putko-scan-handle:focus-visible{outline:3px solid #dff49b;outline-offset:3px}
.putko-scan-photo-tools{display:flex;justify-content:center;flex-wrap:wrap;gap:10px 20px;flex:none}.putko-scan-text{font-size:12px;font-weight:650;line-height:1.45;color:#167b58;background:none;border:0;padding:8px 5px;min-height:44px;text-align:center;white-space:normal;max-width:100%}.putko-scan-text:hover{text-decoration:underline}.putko-scan-error{padding:10px 12px;border:1px solid #eed4cb;border-radius:10px;background:#fff3ef;color:#9e513d;flex:none;font-size:12px;overflow-wrap:anywhere}.putko-scan-error[hidden]{display:none}
.putko-scan-footer{display:flex;justify-content:flex-end;align-items:center;flex-wrap:wrap;gap:9px;padding:15px 22px 20px;background:#fff;border-top:1px solid #e4e9e2;flex:none}.putko-scan-footer button{font:inherit;font-size:12px;font-weight:650;padding:11px 15px;min-height:44px;border-radius:11px;text-align:center;white-space:normal;max-width:100%;min-width:0}.putko-scan-secondary{border:1px solid #dfe7dc;background:#fff;color:#476358}.putko-scan-secondary:hover{background:#eaf4ed}.putko-scan-primary{border:1px solid #167b58;background:#167b58;color:#fff;box-shadow:0 3px 9px #167b5820}.putko-scan-primary:hover{background:#116344}.putko-scan-footer button[hidden]{display:none}.putko-scan-footer button[data-scan-command=cancel]{margin-right:auto}.putko-scan-loading{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:13px;color:var(--sub);font-size:12px;padding:24px;min-width:0}.putko-scan-spinner{display:block;width:28px;height:28px;border:3px solid #d0e0d4;border-top-color:#167b58;border-radius:50%;animation:putkoScanSpin .8s linear infinite}
@keyframes putkoScanSpin{to{transform:rotate(360deg)}}
@media(max-width:600px){.putko-scan-overlay{padding:0}.putko-scan-dialog{width:100%;height:100vh;height:100dvh;border:0;border-radius:0}.putko-scan-header{padding:calc(16px + env(safe-area-inset-top)) 17px 14px;gap:12px}.putko-scan-header h2{font-size:21px}.putko-scan-main{padding:12px 14px 8px;gap:8px}.putko-scan-status{font-size:11px}.putko-scan-footer{padding:12px 14px calc(12px + env(safe-area-inset-bottom));gap:7px}.putko-scan-footer button{padding:11px 12px;font-size:11px;min-height:44px}.putko-scan-view{padding:18px;border-radius:12px}.putko-scan-photo-tools{gap:5px 15px}.putko-scan-text{font-size:11px}.putko-scan-handle{width:36px;height:36px;min-width:36px}.putko-scan-handle::before{inset:-7px}}
@media(max-width:360px){.putko-scan-header p{font-size:11px}.putko-scan-header h2{font-size:20px}.putko-scan-footer button[data-scan-command=cancel]{flex:1 1 100%}.putko-scan-footer button:not([data-scan-command=cancel]){flex:1 1 95px}.putko-scan-main{padding-inline:12px}}
@media(max-height:500px) and (orientation:landscape){.putko-scan-header{padding:8px max(18px,env(safe-area-inset-right)) 8px max(18px,env(safe-area-inset-left))}.putko-scan-kicker{display:none}.putko-scan-header h2{font-size:17px}.putko-scan-header p{display:none}.putko-scan-main{padding:7px max(18px,env(safe-area-inset-right)) 7px max(18px,env(safe-area-inset-left));gap:5px}.putko-scan-status{font-size:11px}.putko-scan-photo-tools{position:absolute;right:max(25px,env(safe-area-inset-right));bottom:85px;flex-direction:column;align-items:flex-end;z-index:3;background:#f7f8f4ee;border-radius:9px;padding:2px 8px;gap:0}.putko-scan-text{font-size:11px;min-height:44px}.putko-scan-footer{padding:7px max(18px,env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom)) max(18px,env(safe-area-inset-left))}.putko-scan-footer button{min-height:44px;padding:7px 12px}}
@media(prefers-reduced-motion:reduce){.putko-scan-spinner{animation:none}}

/* Advanced local scanner. Video and contour share the exact visible aspect ratio. */
.putko-scan-overlay{backdrop-filter:none}.putko-scan-dialog{border-radius:16px}.putko-scan-header p,.putko-scan-status,.putko-scan-error,.putko-scan-quality{font-size:16px;line-height:1.5}.putko-scan-quality{margin:0;color:#674d18;background:#fff8e7;padding:10px 12px;border:1px solid #e6d8ad;border-radius:10px;overflow-wrap:anywhere}.putko-scan-quality[hidden]{display:none}.putko-scan-camera-note{font-size:16px;line-height:1.6;text-align:center;max-width:36ch;color:#425e53;padding:18px;margin:auto}.putko-scan-view:has(.putko-scan-live-stage){background:#112925;padding:6px}.putko-scan-live-stage{position:relative;flex:none;min-width:0;max-width:100%;max-height:100%;margin:auto;overflow:hidden;background:#112925}.putko-scan-live-stage video{display:block;width:100%;height:100%;object-fit:contain}.putko-scan-live-stage svg{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;overflow:visible}.putko-scan-live-stage svg[hidden]{display:none}.putko-scan-live-stage polygon{fill:#1ac99514;stroke:#f3d37b;stroke-width:3;vector-effect:non-scaling-stroke;stroke-linejoin:round}.putko-scan-live-stage[data-ready=true] polygon{stroke:#52edb7;fill:#19cc8d10}.putko-scan-live-controls{display:flex;gap:12px;align-items:center;justify-content:center;flex:none}.putko-scan-live-controls[hidden]{display:none}.putko-scan-live-controls button{min-height:48px;border-radius:12px;font:inherit;font-size:16px;font-weight:650;padding:11px 16px;line-height:1.3;white-space:normal}.putko-scan-live-controls button[data-scan-command=shutter]{min-width:150px}.putko-scan-live-controls button[aria-pressed=true]{background:#dff0e8;border-color:#13795a;color:#155f48}.putko-scan-live-controls button:disabled,.putko-scan-footer button:disabled{opacity:.55;cursor:wait}.putko-scan-photo-tools{gap:2px 16px}.putko-scan-text,.putko-scan-footer button{font-size:16px;min-height:44px;line-height:1.35}.putko-scan-handle{width:44px;height:44px;min-width:44px}.putko-scan-overlay button:focus-visible{outline:3px solid #147d5e;outline-offset:3px}.putko-scan-overlay ::selection{background:#c9eadc;color:#173f32}
@media(max-width:600px){.putko-scan-dialog{border-radius:0}.putko-scan-main{gap:8px;padding:10px 12px 6px}.putko-scan-header{padding-bottom:10px}.putko-scan-header p,.putko-scan-status,.putko-scan-error,.putko-scan-quality{font-size:16px}.putko-scan-header p{margin-top:3px}.putko-scan-photo-tools{gap:0 10px}.putko-scan-text{font-size:15px;padding:6px 4px}.putko-scan-footer button{font-size:16px;padding:10px 12px}.putko-scan-footer{padding-top:10px;padding-bottom:calc(10px + env(safe-area-inset-bottom))}.putko-scan-live-controls{gap:8px}.putko-scan-live-controls button{font-size:16px;padding:10px 12px;flex:1}.putko-scan-live-controls button[data-scan-command=shutter]{min-width:0}.putko-scan-handle{width:44px;height:44px;min-width:44px}.putko-scan-view{min-height:80px}.putko-scan-quality{padding:7px 10px}}
@media(max-height:600px) and (orientation:landscape){.putko-scan-header p{display:none}.putko-scan-main{gap:4px}.putko-scan-status{font-size:15px;line-height:1.3}.putko-scan-photo-tools{position:static;flex-direction:row;justify-content:center;align-items:center;background:none;border-radius:0;padding:0;gap:0 12px}.putko-scan-text{min-height:44px;font-size:15px;padding:4px}.putko-scan-main:has(.putko-scan-live-stage){display:grid;grid-template-columns:minmax(0,1fr) 150px;grid-template-rows:auto minmax(60px,1fr) auto;column-gap:12px}.putko-scan-main:has(.putko-scan-live-stage) .putko-scan-status{grid-column:1 / -1;grid-row:1}.putko-scan-main:has(.putko-scan-live-stage) .putko-scan-view{grid-column:1;grid-row:2;align-self:stretch}.putko-scan-main:has(.putko-scan-live-stage) .putko-scan-photo-tools{grid-column:1 / -1;grid-row:3}.putko-scan-live-controls{position:static;grid-column:2;grid-row:2;flex-direction:column;max-width:150px;align-self:center;z-index:3}.putko-scan-live-controls button{font-size:15px;min-width:0!important;width:100%;background:#fff;color:#165e46}.putko-scan-live-controls button[data-scan-command=shutter]{background:#167b58;color:#fff}.putko-scan-view{min-height:60px}.putko-scan-quality{font-size:14px;line-height:1.3;padding:4px 8px}.putko-scan-footer{padding-top:6px;padding-bottom:calc(6px + env(safe-area-inset-bottom))}.putko-scan-footer button{font-size:15px;padding:7px 10px}}

/* Keep quality guidance and alternate capture controls reachable on short screens. */
.putko-scan-main{overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#7ba995 #eef3ee}.putko-scan-view{flex-shrink:0;min-height:120px}
@media(max-height:600px) and (orientation:landscape){.putko-scan-view{min-height:60px}}
