/* 1.9.13: the visible image is the output frame, not a large photo with a mask. */
:is(.bsgp-frame-dialog,.bsgp-frame-scan) [hidden]{display:none!important}
:is(.bsgp-frame-dialog,.bsgp-frame-scan),:is(.bsgp-frame-dialog,.bsgp-frame-scan) *{box-sizing:border-box}
dialog.bsgp-photo-dialog.bsgp-frame-dialog,dialog.bsgp-frame-scan{
  width:min(590px,calc(100vw - 24px))!important;max-width:590px!important;height:fit-content!important;min-height:0!important;
  max-height:calc(100vh - 24px)!important;max-height:calc(100dvh - 24px)!important;margin:auto!important;
  padding:0!important;border:1px solid #d7e0ed!important;border-radius:14px!important;background:#fff!important;
  color:#17245b;overflow:auto!important;overscroll-behavior:contain;font:14px/1.5 Arial,sans-serif;
}
:is(.bsgp-frame-dialog,.bsgp-frame-scan) :is(.bsgp-crop-head,header){padding:12px 18px;gap:8px;border-bottom:1px solid #e2e8f1;display:flex;align-items:center;justify-content:space-between}
.bsgp-photo-dialog.bsgp-frame-dialog h2,.bsgp-frame-scan h2{font:700 19px/1.3 Arial,sans-serif!important;margin:0!important;padding:0!important;color:#17245b!important}
:is(.bsgp-frame-dialog,.bsgp-frame-scan) .bsgp-frame-content{padding:14px 18px;min-width:0}
.bsgp-photo-dialog.bsgp-frame-dialog .bsgp-frame-hint,.bsgp-frame-scan .bsgp-frame-hint{font-size:13px!important;margin:0 0 12px!important;padding:0!important;line-height:1.5!important;color:#52617b!important}
:is(.bsgp-frame-dialog,.bsgp-frame-scan) :is(.bsgp-crop-stage,.bsgp-scan-stage){
  position:relative;width:min(100%,var(--bsgp-frame-width,100%));max-width:100%;min-height:0!important;height:auto!important;
  aspect-ratio:var(--bsgp-frame-ratio,1.586)!important;margin:0 auto!important;padding:0!important;
  border:1px solid #8093b2;border-radius:0!important;overflow:hidden!important;isolation:isolate;background:#f3f5f8;box-shadow:none!important;
}
:is(.bsgp-frame-dialog,.bsgp-frame-scan)[data-frame-kind=photo] :is(.bsgp-crop-stage,.bsgp-scan-stage){background-color:#fff;background-image:repeating-conic-gradient(#e5e9f0 0% 25%,#fff 0% 50%);background-size:18px 18px}
:is(.bsgp-frame-dialog,.bsgp-frame-scan) :is(.bsgp-crop-stage,.bsgp-scan-stage)>:is(canvas,img){display:block;width:100%!important;height:auto!important;max-width:100%!important;max-height:none!important;aspect-ratio:var(--bsgp-frame-ratio)!important;object-fit:contain!important;border:0!important;padding:0!important;margin:0!important;touch-action:none;user-select:none;-webkit-user-select:none}
.bsgp-frame-dialog canvas{cursor:grab}.bsgp-frame-dialog canvas:active{cursor:grabbing}
/* Keep the video decoding on mobile without ever exposing pixels outside the crop. */
.bsgp-frame-scan .bsgp-scan-stage video.bsgp-camera-source{display:block!important;position:absolute!important;inset:0 auto auto 0!important;width:1px!important;height:1px!important;min-width:0!important;min-height:0!important;opacity:0!important;pointer-events:none!important;clip-path:inset(50%)!important}
:is(.bsgp-frame-dialog,.bsgp-frame-scan) .bsgp-frame-caption{display:flex;justify-content:space-between;flex-wrap:wrap;gap:3px 12px;font-size:11px;color:#65728b;margin:6px auto 12px;max-width:100%}
:is(.bsgp-frame-dialog,.bsgp-frame-scan) .bsgp-frame-label{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:13px;font-weight:700}
:is(.bsgp-frame-dialog,.bsgp-frame-scan) .bsgp-frame-label label{margin:0!important;font:inherit!important}
:is(.bsgp-frame-dialog,.bsgp-frame-scan) output{font:700 13px/1.4 Arial,sans-serif;font-variant-numeric:tabular-nums;min-width:52px;text-align:right;color:#17245b}
:is(.bsgp-frame-dialog,.bsgp-frame-scan) .bsgp-frame-zoom{display:grid;grid-template-columns:44px minmax(0,1fr) 44px;align-items:center;gap:12px}
:is(.bsgp-frame-dialog,.bsgp-frame-scan) button{touch-action:manipulation;min-height:44px;max-width:100%;font:600 13px/1.3 Arial,sans-serif!important}
:is(.bsgp-frame-dialog,.bsgp-frame-scan) .bsgp-frame-zoom button{width:44px;height:44px;padding:0!important;font-size:24px!important;line-height:1!important;min-width:44px}
:is(.bsgp-frame-dialog,.bsgp-frame-scan) input[type=range]{appearance:none!important;-webkit-appearance:none!important;display:block!important;position:static!important;float:none!important;transform:none!important;visibility:visible!important;opacity:1!important;width:100%!important;min-width:0!important;max-width:100%!important;height:44px!important;min-height:44px!important;max-height:44px!important;padding:0!important;margin:0!important;border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important;cursor:pointer;touch-action:none;pointer-events:auto!important}
:is(.bsgp-frame-dialog,.bsgp-frame-scan) input[type=range]::-webkit-slider-runnable-track{height:6px;background:#ccd7e7!important;border:0;border-radius:6px}
:is(.bsgp-frame-dialog,.bsgp-frame-scan) input[type=range]::-webkit-slider-thumb{appearance:none!important;-webkit-appearance:none!important;margin-top:-7px;width:20px;height:20px;border-radius:50%;border:2px solid #fff;background:#17245b;box-shadow:0 0 0 1px #17245b}
:is(.bsgp-frame-dialog,.bsgp-frame-scan) input[type=range]::-moz-range-track{height:6px;background:#ccd7e7!important;border:0;border-radius:6px}
:is(.bsgp-frame-dialog,.bsgp-frame-scan) input[type=range]::-moz-range-thumb{width:17px;height:17px;border-radius:50%;border:2px solid #fff;background:#17245b;box-shadow:0 0 0 1px #17245b}
:is(.bsgp-frame-dialog,.bsgp-frame-scan) .bsgp-frame-tools{display:flex;gap:8px;margin-top:8px;flex-wrap:wrap}
.bsgp-photo-dialog.bsgp-frame-dialog [data-crop-resolution],.bsgp-photo-dialog.bsgp-frame-dialog [data-crop-message],.bsgp-frame-scan [data-status]{font-size:12px!important;line-height:1.5!important;margin:10px 0 0!important;padding:0!important;overflow-wrap:anywhere}
.bsgp-photo-dialog.bsgp-frame-dialog [data-crop-resolution]{color:#805d16!important}
.bsgp-photo-dialog.bsgp-frame-dialog [data-crop-message].is-error,.bsgp-frame-scan [data-status].is-error{padding:10px!important;background:#fff1ef;color:#9a2929!important}
:is(.bsgp-frame-dialog,.bsgp-frame-scan) :is(.bsgp-crop-footer,footer){position:sticky;bottom:0;z-index:3;padding:12px 18px max(12px,env(safe-area-inset-bottom));display:flex;align-items:center;justify-content:space-between;gap:10px;background:#fff;border-top:1px solid #e2e8f1}
:is(.bsgp-frame-dialog,.bsgp-frame-scan) :is(.bsgp-crop-footer,footer) button{white-space:nowrap;min-width:0!important;flex:1;padding:11px!important}
:is(.bsgp-frame-dialog,.bsgp-frame-scan) :is(button,input,canvas):focus-visible{outline:3px solid #839fed!important;outline-offset:2px}
:is(.bsgp-frame-dialog,.bsgp-frame-scan) canvas:focus-visible{outline-offset:-4px}

/* Compact form rows: no nested mock frame, padded image or hover zoom. */
.bsgp-app[data-bsgp-form] .bsgp-capture-grid{gap:12px}
.bsgp-app[data-bsgp-form] .bsgp-capture-card{display:grid;grid-template-columns:180px minmax(0,1fr);gap:16px;align-items:center;min-height:0;padding:14px;overflow:visible;border-radius:10px;box-shadow:none}
.bsgp-app[data-bsgp-form] .bsgp-capture-card .bsgp-capture-preview{position:relative;display:block;width:100%;height:auto!important;min-height:0!important;max-height:none!important;aspect-ratio:var(--bsgp-preview-ratio,1.586)!important;padding:0!important;margin:0!important;border:1px solid #b9c7db!important;border-radius:0!important;overflow:hidden!important;background:#f4f6fa;align-self:center;box-shadow:none!important}
.bsgp-app[data-bsgp-form] .bsgp-capture-card[data-kind=passport_photo] .bsgp-capture-preview{width:min(100%,126px);justify-self:center;aspect-ratio:7/9!important;background-color:#fff;background-image:repeating-conic-gradient(#e5e9f0 0% 25%,#fff 0% 50%);background-size:16px 16px}
.bsgp-app[data-bsgp-form] .bsgp-capture-card .bsgp-capture-preview img{position:absolute;inset:0;display:block;width:100%!important;height:100%!important;max-height:none!important;padding:0!important;margin:0!important;border-radius:0!important;background:transparent!important;object-fit:contain!important;transform:none!important;transition:none!important}
.bsgp-app[data-bsgp-form] .bsgp-preview-placeholder{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;gap:0;padding:12px;font-size:12px;line-height:1.4;background:#f4f6fa}
.bsgp-app[data-bsgp-form] .bsgp-mini-frame{display:none!important}
.bsgp-app[data-bsgp-form] .bsgp-preview-zoom{display:none!important}
.bsgp-app[data-bsgp-form] .bsgp-capture-copy{padding:0;min-width:0}
.bsgp-app[data-bsgp-form] .bsgp-capture-copy h3{font-size:16px;margin:0 0 6px;line-height:1.3}
.bsgp-app[data-bsgp-form] .bsgp-capture-copy p{font-size:12px;line-height:1.5;margin:0 0 8px}
.bsgp-app[data-bsgp-form] .bsgp-capture-actions-inline{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.bsgp-app[data-bsgp-form] .bsgp-capture-actions-inline .bsgp-btn{padding:10px 9px;min-height:44px;font-size:12px;line-height:1.3;overflow-wrap:normal}
.bsgp-app[data-bsgp-form] .bsgp-state{font-size:11px;margin-top:7px}
.bsgp-mobile-page .bsgp-mobile-preview{position:relative;aspect-ratio:var(--bsgp-preview-ratio,1.586);width:min(100%,300px);margin:10px auto;overflow:hidden;border:1px solid #b9c7db;border-radius:0;background:#f3f5f8}
.bsgp-mobile-page .bsgp-mobile-preview img{display:block;width:100%;height:100%;max-height:none;max-width:none;margin:0;padding:0;object-fit:contain}
.bsgp-mobile-page .bsgp-mobile-item[data-kind=passport_photo] .bsgp-mobile-preview{width:min(100%,150px);aspect-ratio:7/9;background:repeating-conic-gradient(#e5e9f0 0% 25%,#fff 0% 50%) 0 / 16px 16px}
.bsgp-mobile-page .bsgp-mobile-item{padding:12px;margin:10px 0}
@media(max-width:700px){
  .bsgp-app[data-bsgp-form] .bsgp-capture-card{grid-template-columns:140px minmax(0,1fr);gap:12px}
  .bsgp-app[data-bsgp-form] .bsgp-capture-actions-inline{grid-template-columns:1fr}
}
@media(max-width:480px){
  :is(.bsgp-frame-dialog,.bsgp-frame-scan) .bsgp-frame-content{padding:12px}
  :is(.bsgp-frame-dialog,.bsgp-frame-scan) :is(.bsgp-crop-head,header,.bsgp-crop-footer,footer){padding-left:12px;padding-right:12px}
  .bsgp-photo-dialog.bsgp-frame-dialog h2,.bsgp-frame-scan h2{font-size:17px!important}
  :is(.bsgp-frame-dialog,.bsgp-frame-scan)[data-frame-kind=photo] :is(.bsgp-crop-stage,.bsgp-scan-stage){width:min(100%,210px)}
  .bsgp-app[data-bsgp-form] .bsgp-capture-card{grid-template-columns:minmax(0,1fr);gap:10px;padding:12px}
  .bsgp-app[data-bsgp-form] .bsgp-capture-card .bsgp-capture-preview{width:min(100%,300px);justify-self:center}
  .bsgp-app[data-bsgp-form] .bsgp-capture-card[data-kind=passport_photo] .bsgp-capture-preview{width:140px}
  .bsgp-app[data-bsgp-form] .bsgp-capture-actions-inline{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-height:740px){:is(.bsgp-frame-dialog,.bsgp-frame-scan)[data-frame-kind=photo] :is(.bsgp-crop-stage,.bsgp-scan-stage){width:min(100%,180px)}}
@media(max-height:500px){:is(.bsgp-frame-dialog,.bsgp-frame-scan) :is(.bsgp-crop-stage,.bsgp-scan-stage){max-width:280px}:is(.bsgp-frame-dialog,.bsgp-frame-scan)[data-frame-kind=photo] :is(.bsgp-crop-stage,.bsgp-scan-stage){width:150px}}

.bsgp-app[data-bsgp-form] .bsgp-capture-actions-inline .bsgp-btn{box-shadow:none}
.bsgp-app[data-bsgp-form] .bsgp-state{padding:0;border:0;border-radius:0;background:none;color:#65728b}
.bsgp-app[data-bsgp-form] .bsgp-state.ok{color:#236943}
.bsgp-app[data-bsgp-form] .bsgp-invalid-block .bsgp-state{color:#9a2929}
