/* Shared operational barcode scanner overlay (dispatcher / driver / modes) */
#zcScanOverlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20, 24, 36, 0.92);
  z-index: 12000;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 12px;
  padding-top: max(12px, env(safe-area-inset-top, 0px));
  padding-bottom: max(16px, env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
#zcScanOverlay.open { display: flex; }
#zcScanCanvas { display: none; }
#zcScanVideo {
  width: 100%;
  max-width: min(420px, calc(100vw - 24px));
  max-height: min(48vh, 320px);
  border-radius: 10px;
  background: #000;
  object-fit: cover;
}
#zcScanOverlay .zc-scan-window-wrap {
  position: relative;
  width: 100%;
  max-width: min(420px, calc(100vw - 24px));
}
#zcScanOverlay .zc-scan-window-wrap #zcScanVideo {
  border-radius: 0;
  display: block;
  max-height: min(48vh, 320px);
}
.zc-scan-frame {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 85%;
  padding-bottom: 50%;
  border: 2px solid #24a0ed;
  border-radius: 8px;
  box-shadow: 0 0 0 2000px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}
.zc-scan-frame::before,
.zc-scan-frame::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-color: #24a0ed;
}
.zc-scan-frame::before {
  top: -2px;
  left: -2px;
  border-top: 3px solid;
  border-left: 3px solid;
  border-radius: 4px 0 0 0;
}
.zc-scan-frame::after {
  bottom: -2px;
  right: -2px;
  border-bottom: 3px solid;
  border-right: 3px solid;
  border-radius: 0 0 4px 0;
}
.zc-scan-line {
  position: absolute;
  left: 4px;
  right: 4px;
  height: 2px;
  background: #24a0ed;
  opacity: 0.85;
  animation: zcScanAnim 2s linear infinite;
  top: 20%;
}
@keyframes zcScanAnim {
  0% { top: 10%; }
  100% { top: 85%; }
}
.zc-scan-hint {
  color: #e8edf5;
  font-size: 13px;
  margin-top: 10px;
  text-align: center;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  max-width: min(420px, calc(100vw - 24px));
}
.zc-scan-status {
  color: #e8edf5;
  font-size: 12px;
  margin-top: 8px;
  text-align: center;
  min-height: 1.2em;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  max-width: min(420px, calc(100vw - 24px));
}
.zc-scan-manual-label {
  color: #e8edf5;
  font-size: 13px;
  margin-top: 14px;
  font-weight: 600;
  text-align: center;
  display: block;
  padding: 4px 8px;
}
#zcScanManual {
  margin-top: 6px;
  width: 100%;
  max-width: min(340px, calc(100vw - 32px));
  padding: 12px 14px;
  line-height: 1.35;
  border-radius: 8px;
  border: 1px solid #8b98a9;
  background: #fff;
  color: #111;
  font-size: 17px;
  text-align: center;
  box-sizing: border-box;
}
.zc-scan-submit {
  margin-top: 12px;
  padding: 12px 24px;
  min-height: 44px;
  background: #24a0ed;
  color: #fff;
  border: 1px solid #1a8fd0;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.zc-scan-submit:hover { background: #1a8fd0; }
.zc-scan-cancel {
  margin-top: 12px;
  padding: 12px 24px;
  min-height: 44px;
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
}

/* Scan field row — input + camera button (modes, freight, portals) */
.zc-scan-field-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: stretch;
  margin: 8px 0;
}
.zc-scan-field-row input[type="text"],
.zc-scan-field-row input[type="search"] {
  flex: 1 1 180px;
  min-width: 0;
  padding: 10px 12px;
  font-size: 16px;
  border-radius: 8px;
  border: 1px solid #c5c9d4;
}
.zc-scan-camera-btn {
  flex: 0 0 auto;
  min-height: 44px;
  min-width: 44px;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid #1a8fd0;
  background: #24a0ed;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.zc-scan-camera-btn:hover { background: #1a8fd0; }
.zc-scan-wedge-hint {
  font-size: 11px;
  color: #6b645c;
  margin: 4px 0 0;
}
