.sd-document-scan-controls,.sd-ocr-tools{display:flex;flex-wrap:wrap;gap:10px;margin:14px 0}.sd-document-scan-controls button,.sd-ocr-tools button{min-height:44px}.sd-ocr-dialog{box-sizing:border-box;width:min(760px,calc(100% - 24px));max-height:calc(100dvh - 24px);padding:24px;border:1px solid #d5d9dc;border-radius:20px;background:#fff;color:#15191b;overflow:auto}.sd-ocr-dialog::backdrop{background:rgba(0,0,0,.6)}.sd-ocr-dialog h3{margin:0 0 14px}.sd-ocr-dialog p{margin:12px 0;line-height:1.45}.sd-ocr-dialog small{display:block;line-height:1.4;color:#555}.sd-ocr-preview{display:block;width:100%;max-height:300px;object-fit:contain;background:#f3f4f5;border-radius:12px}.sd-ocr-camera{position:relative}.sd-ocr-camera video{display:block;width:100%;max-height:400px;background:#16191b}.sd-ocr-frame{position:absolute;width:90%;aspect-ratio:1.586;max-height:85%;top:calc((100% - 64px)/2);left:50%;transform:translate(-50%,-50%);border:2px solid #fff;border-radius:10px;pointer-events:none}.sd-ocr-review h4{margin:18px 0 10px}.sd-ocr-rows{display:grid;grid-template-columns:1fr 1fr;gap:14px}.sd-ocr-row{display:flex;align-items:flex-start;gap:10px;min-width:0}.sd-ocr-row>input{width:20px;height:20px;flex:0 0 20px;margin-top:5px}.sd-ocr-row label{display:block;flex:1;min-width:0;font-weight:700}.sd-ocr-row label input,.sd-ocr-row select{box-sizing:border-box;display:block;width:100%;min-height:46px;margin-top:8px;padding:10px;border:1px solid #ccd1d6;border-radius:10px;background:#fff;color:#15191b;font:inherit}.sd-ocr-note{margin-top:6px;font-weight:400}.sd-ocr-dialog [hidden]{display:none!important}@media(max-width:600px){.sd-ocr-dialog{padding:16px}.sd-ocr-rows{grid-template-columns:1fr}.sd-ocr-tools button,.sd-document-scan-controls button{flex:1 1 180px}.sd-ocr-preview{max-height:220px}}

/* OCR-only additions: perspective crop and a viewfinder matching the captured image. */
.sd-ocr-viewfinder{position:relative;overflow:hidden}.sd-ocr-viewfinder video{object-fit:contain}.sd-ocr-viewfinder .sd-ocr-frame{box-sizing:border-box;max-height:none;aspect-ratio:auto;transform:none;left:0;top:0}
.sd-ocr-crop{padding:0 16px}.sd-ocr-crop-stage{position:relative;margin:26px 0;width:100%;touch-action:none}.sd-ocr-crop-stage>canvas{display:block;width:100%;height:auto;border-radius:8px}.sd-ocr-crop-stage>.sd-ocr-corner{position:absolute;transform:translate(-50%,-50%);box-sizing:border-box;width:38px;height:38px;min-width:38px;min-height:38px;padding:0;border:2px solid #15191b;border-radius:50%;background:#fff;color:#15191b;font:700 16px/1 sans-serif;cursor:grab;touch-action:none}.sd-ocr-corner:focus-visible{outline:3px solid #15191b;outline-offset:3px}

/* 20261010-mobile-3: only the document scanner, not the booking form. */
dialog.sd-ocr-dialog{position:fixed;inset:12px;margin:auto;box-sizing:border-box;width:min(760px,calc(100vw - 24px));max-width:calc(100vw - 24px);height:fit-content;max-height:calc(100vh - 24px);max-height:calc(var(--sd-ocr-viewport-height,100dvh) - 24px);overscroll-behavior:contain;overflow-x:hidden;-webkit-text-size-adjust:100%}
dialog.sd-ocr-dialog.sd-ocr-cropping{height:calc(100vh - 24px);height:min(900px,calc(var(--sd-ocr-viewport-height,100dvh) - 24px));display:flex;flex-direction:column;overflow-y:auto}
.sd-ocr-dialog.sd-ocr-cropping>[data-ocr-crop-hide]{display:none!important}
.sd-ocr-dialog.sd-ocr-cropping>h3{flex:0 0 auto;margin:0 0 10px}
.sd-ocr-dialog .sd-ocr-crop{box-sizing:border-box;min-width:0;min-height:0;padding:0;display:flex;flex-direction:column;flex:1 1 auto}
.sd-ocr-dialog .sd-ocr-crop>p{flex:0 0 auto;margin:0 0 8px}
.sd-ocr-dialog .sd-ocr-crop-stage{flex:0 0 auto;margin:22px auto;position:relative;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
.sd-ocr-dialog .sd-ocr-crop-stage>canvas{box-sizing:border-box;width:100%;height:100%;max-width:none;max-height:none;object-fit:fill;touch-action:none}
.sd-ocr-dialog .sd-ocr-crop-stage>.sd-ocr-corner{width:44px;height:44px;min-width:44px;min-height:44px;max-width:44px;max-height:44px;padding:0;margin:0;z-index:1;touch-action:none;user-select:none;-webkit-user-select:none}
.sd-ocr-dialog .sd-ocr-crop-actions{flex:0 0 auto;display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:8px 0 0}
.sd-ocr-dialog .sd-ocr-crop-actions button{box-sizing:border-box;min-width:0;min-height:44px;width:100%;margin:0;padding:10px 8px;white-space:normal;line-height:1.25}
.sd-ocr-dialog .sd-ocr-crop-actions .sd-ocr-crop-apply,.sd-ocr-dialog .sd-ocr-crop-actions button:last-child{grid-column:1 / -1}
.sd-ocr-dialog .sd-ocr-crop-error{font-weight:700}
@media(max-height:600px){.sd-ocr-dialog.sd-ocr-cropping{padding:10px}.sd-ocr-dialog .sd-ocr-crop>p{font-size:13px;line-height:1.25}.sd-ocr-dialog.sd-ocr-cropping>h3{font-size:16px;line-height:1.25;margin-bottom:6px}.sd-ocr-dialog .sd-ocr-crop-actions{grid-template-columns:repeat(3,1fr);gap:6px}.sd-ocr-dialog .sd-ocr-crop-actions button:last-child{grid-column:auto}.sd-ocr-dialog .sd-ocr-crop-actions button{font-size:13px;padding:8px 4px}}
