/* v1.3 scan view: camera first, controls on the picture, list as a sheet below the camera. */
.svSrOnly{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0 0 0 0)!important;white-space:nowrap!important;border:0!important}


html.svOnScan .app>main{padding:0!important}
html.svOnScan #scanScreen>:not(.camera):not(#batchBar):not(.svSrOnly){margin-left:16px;margin-right:16px}
html.svOnScan #scanScreen>.scanHistory{margin-top:16px}

/* Camera stage */
.svScreen .camera{position:relative;aspect-ratio:auto;border-radius:0;background:#10272a;overflow:hidden;
  height:calc(100vh - var(--svTop,70px) - var(--svBottom,76px));
  height:calc(100dvh - var(--svTop,70px) - var(--svBottom,76px));
  min-height:360px;max-height:900px}
html.svBatch .svScreen .camera{height:clamp(250px,44vh,420px);height:clamp(250px,44dvh,420px);min-height:250px}
.svScreen .camera video{display:block;width:100%;height:100%;object-fit:cover;transform-origin:50% 50%;transition:transform .15s ease}
@media (min-width:640px){.svScreen .camera{border-radius:0 0 16px 16px}}

/* Aiming frame: four corners, only while the camera runs */
.svScreen .finder{left:50%;top:44%;right:auto;bottom:auto;width:min(62vw,250px);height:min(62vw,250px);transform:translate(-50%,-50%);border:0;border-radius:0;z-index:2}
html.svBatch .svScreen .finder{width:min(46vw,180px);height:min(46vw,180px);top:46%}
.svScreen .camera:not(.svLive) .finder{display:none}
.svScreen .finder i{position:absolute;width:42px;height:42px;border:4px solid #6ee7c8}
.svScreen .finder i:nth-child(1){left:0;top:0;border-right:0;border-bottom:0;border-top-left-radius:14px}
.svScreen .finder i:nth-child(2){right:0;top:0;border-left:0;border-bottom:0;border-top-right-radius:14px}
.svScreen .finder i:nth-child(3){left:0;bottom:0;border-right:0;border-top:0;border-bottom-left-radius:14px}
.svScreen .finder i:nth-child(4){right:0;bottom:0;border-left:0;border-top:0;border-bottom-right-radius:14px}
.svScreen .camera.svHit .finder i{border-color:#4ade80}
.svScreen .camera.svHit .finder{box-shadow:0 0 0 9999px rgba(22,101,52,.18)}

/* Placeholder with start button */
.svScreen .cameraPlaceholder{z-index:3;background:#10272a;font-size:16px;gap:16px;padding-bottom:90px}
.svScreen .svPlaceholderIcon{width:72px;height:72px;border-radius:50%;background:rgba(255,255,255,.1);display:flex;align-items:center;justify-content:center;color:#fff}
.svScreen .cameraPlaceholder #start{min-width:200px;min-height:50px;border-radius:14px;font-size:16px;font-weight:700;padding:0 22px}

/* Glass buttons on the picture */
.svScreen .svGlass{min-height:44px;padding:0 12px;border:0;border-radius:12px;background:rgba(255,255,255,.18);color:#fff;font-family:inherit;font-weight:600;font-size:13px;line-height:1.2;display:inline-flex;align-items:center;gap:6px;-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px)}
.svScreen .svGlass:hover{background:rgba(255,255,255,.26)}

/* Top bar */
.svScreen .svTop{position:absolute;z-index:4;top:12px;left:12px;right:12px;display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap}
.svScreen .svTopRight{display:flex;gap:6px;margin-left:auto}
.svScreen .svTop .scanModeChoice{margin:0;padding:4px;gap:4px;border-radius:999px;background:rgba(255,255,255,.18);-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px)}
.svScreen .svTop .scanModeChoice button{flex:0 0 auto;min-height:36px;padding:0 14px;border-radius:999px;color:#fff;font-family:inherit;font-weight:600;font-size:13px;line-height:1.2}
.svScreen .svTop .scanModeChoice button.on{background:#fff;color:#193b40;box-shadow:none}
.svScreen .svTop #stop{display:none!important}
.svScreen .svIcon{width:44px;padding:0;justify-content:center}
.svScreen .svIcon[hidden]{display:none!important}
.svScreen .svIcon[aria-expanded="true"]{background:#fff;color:#193b40}
@media (max-width:370px){.svScreen .svTop .scanModeChoice button{padding:0 10px}.svScreen .svControls{gap:12px}}

/* Status line */
.svScreen .svStatus{position:absolute;z-index:4;left:16px;right:16px;bottom:118px;display:flex;flex-direction:column;align-items:center;gap:8px;pointer-events:none}
html.svBatch .svScreen .svStatus{bottom:96px}
.svScreen .svStatus #cameraStatus{margin:0;max-width:100%;padding:8px 14px;border-radius:18px;background:rgba(0,0,0,.6);color:#fff;font-size:14px;font-weight:600;line-height:1.35;text-align:center;border:0;pointer-events:auto}
.svScreen .svStatus #cameraStatus[data-scan-warning]{background:#fff3d3;color:#68470e;border:0}
.svScreen .svGuide{margin:0;color:#e6efec;font-size:13px;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.5)}
.svScreen .camera:not(.svLive) .svGuide,html.svBatch .svScreen .svGuide{display:none}

/* Bottom controls */
.svScreen .svControls{position:absolute;z-index:4;left:0;right:0;bottom:16px;display:flex;justify-content:center;align-items:flex-end;gap:16px}
html.svBatch .svScreen .svControls{bottom:28px;gap:12px}
html.svBatch .svScreen .camera.svLive #cameraStatus:not([data-scan-warning]){display:none}
.svScreen .svControl{display:flex;flex-direction:column;align-items:center;gap:5px;color:#fff;font-size:12px;text-shadow:0 1px 2px rgba(0,0,0,.5)}
.svScreen .svControl[hidden]{display:none!important}
html.svBatch .svScreen .svControl>span{display:none}
.svScreen .svRound{width:54px;height:54px;margin:0;border-radius:50%;border:0;background:rgba(255,255,255,.18);color:#fff;display:flex;align-items:center;justify-content:center;cursor:pointer;padding:0;-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px)}
html.svBatch .svScreen .svRound{width:46px;height:46px}
.svScreen .svRound[aria-pressed="true"]{background:#fff;color:#193b40}
.svScreen .svUpload input{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}
.svScreen .svUpload:focus-within{outline:3px solid #6ee7c8;outline-offset:2px}
.svScreen .svZoom{display:flex;gap:4px;padding:4px;border-radius:999px;background:rgba(255,255,255,.18);-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px)}
.svScreen .svZoom button{width:44px;height:44px;min-height:44px;padding:0;border-radius:50%;border:0;background:transparent;color:#fff;font-family:inherit;font-weight:600;font-size:14px;line-height:1}
html.svBatch .svScreen .svZoom button{width:38px;height:38px;min-height:38px}
.svScreen .svZoom button[aria-pressed="true"]{background:#fff;color:#193b40;font-weight:700}

/* Green confirmation in list mode */
.svScreen .svHitBadge{position:absolute;z-index:5;left:50%;top:calc(46% + min(23vw,90px) + 16px);transform:translateX(-50%);padding:8px 14px;border-radius:999px;background:#166534;color:#fff;font-size:14px;font-weight:700;white-space:nowrap;opacity:0;transition:opacity .15s;pointer-events:none}
.svScreen .camera.svHit .svHitBadge{opacity:1}

/* List sheet below the camera */
.svScreen #batchBar.svSheet{position:relative;z-index:6;margin:-16px 0 0;padding:16px 16px 12px;border:0;border-radius:18px 18px 0 0;background:#fff;box-shadow:0 -6px 18px rgba(0,0,0,.12);display:flex;flex-direction:column;gap:10px}
.svScreen #batchBar.svSheet[hidden]{display:none!important}
.svScreen .svSheet .batchHeading{display:flex;justify-content:space-between;align-items:center;gap:10px;margin:0}
.svScreen .svSheetTitle{display:flex;flex-direction:column;min-width:0}
.svScreen .svSheetTitle #batchListLabel{font-size:16px;font-weight:700;color:#193b40;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.svScreen .svSheetSub{font-size:13px;color:#536866}
.svScreen .svSheet #batchChangeList{flex:none;width:auto;min-height:40px;margin:0;padding:0 12px;border-radius:10px;border:1px solid #d5e3dc;background:#fff;color:#175d58;font-size:13px}
.svScreen .svLast{display:flex;align-items:center;gap:10px;padding:10px 12px;border-radius:12px;background:#e5f0e9}
.svScreen .svLast #batchLast{flex:1;min-width:0;margin:0;font-size:13px;font-weight:600;color:#193b40;overflow-wrap:anywhere}
.svScreen .svUndo{flex:none;width:auto;min-height:40px;padding:0 14px;border-radius:10px;border:0;background:#fff;color:#193b40;font-weight:700;font-size:13px}
.svScreen .svUndo[hidden]{display:none}
.svScreen .svRows{display:flex;flex-direction:column}
.svScreen .svRow{display:flex;align-items:center;gap:10px;padding:9px 0;border-bottom:1px solid #e3ebe7}
.svScreen .svRowNr{width:24px;flex:none;font-size:12px;color:#647b7a;font-variant-numeric:tabular-nums}
.svScreen .svRowText{flex:1;min-width:0;display:flex;flex-direction:column}
.svScreen .svRowText strong{font-size:14px;font-weight:600;color:#193b40;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.svScreen .svRowText small{font-size:12px;color:#536866;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.svScreen .svChip{flex:none;padding:4px 8px;border-radius:999px;font-size:12px;font-weight:700;white-space:nowrap}
.svScreen .svChip-ok{background:#dcfce7;color:#166534}
.svScreen .svChip-wait{background:#eef0ef;color:#455a5c}
.svScreen .svChip-none{background:#fbf2dc;color:#70511d}
.svScreen .svChip-error{background:#fde8e8;color:#8a1c1c}
.svScreen .svEmpty{margin:4px 0;font-size:13px;color:#536866}
.svScreen .svSheet #batchReview{margin:2px 0 0;min-height:48px;font-size:15px}
.svScreen .svSheet #batchPersistence:empty{display:none}

/* Help panel opened from the header, even when the app keeps it hidden */
#scannerTroubleshooting.svForceOpen{display:block!important}
.svScreen .svManual[open]{scroll-margin-top:90px}
html.svBatch .svScreen .svHitBadge{top:46%;transform:translate(-50%,-50%)}
@media (max-height:700px){
  .svScreen .finder{top:40%;width:min(50vw,190px);height:min(50vw,190px)}
  .svScreen .svGuide{display:none}
  .svScreen .svStatus{bottom:104px}
}
