/* Scanning: base, responsive and interaction states. */
#scannerVideo {
  width: 100%;
  border-radius: 12px;
  max-height: 220px;
  background: #242620;
}

#labelScanPanel[hidden], #barcodeScanPanel[hidden] {
  display: none;
}

#labelPhotoPreview {
  display: block;
  max-width: 100%;
  max-height: 320px;
  object-fit: contain;
  border-radius: var(--radius, 12px);
}

#labelPhotoPreview[hidden] {
  display: none;
}

#labelScanPanel {
  min-width: 0;
}

#labelPhoto {
  max-width: 100%;
}

#labelConfirmation {
  scroll-margin-top: 24px;
}

.scan-form {
  gap: 24px;
}

.scan-form > .scan-methods {
  margin-bottom: 0;
}

#barcodeScanPanel,#labelScanPanel {
  display: grid;
  gap: 24px;
  min-width: 0;
}

#barcodeScanPanel[hidden],#labelScanPanel[hidden] {
  display: none;
}

#barcodeScanPanel > p,#labelScanPanel > p,#labelScanPanel > h3 {
  margin: 0;
}

#labelScanPanel > h3 {
  margin-bottom: -12px;
}

#barcodeForm {
  gap: 24px;
}

.label-photo-field {
  display: grid;
  gap: 8px;
}

.label-photo-field label {
  margin: 0;
}

#scanMessage:empty,#productDetails:empty,#labelStatus:empty,#labelVerification:empty,#labelConfirmation:empty {
  display: none;
}

#labelManual {
  justify-self: start;
}

#labelPhoto {
  padding: 8px;
  font: inherit;
  color: var(--text);
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

#labelPhoto::file-selector-button {
  font: inherit;
  font-weight: 700;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--secondary-border);
  border-radius: 12px;
  min-height: 44px;
  padding: 10px 16px;
  margin-right: 12px;
  cursor: pointer;
  transition: background .15s ease;
}

#labelPhoto::file-selector-button:hover {
  background: var(--card);
}

#labelCamera[hidden] {
  display: none;
}

#labelCamera {
  display: grid;
  gap: 16px;
}

#labelCameraVideo {
  display: block;
  width: 100%;
  max-height: 50vh;
  object-fit: contain;
  border-radius: 12px;
  background: #181b16;
}

#labelCamera .row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

#labelCamera .row button {
  flex: 1;
}

#barcodeScanPanel > h3 {
  margin: 0 0 -12px;
}

#barcodeManual {
  justify-self: start;
}

#labelStatus.label-scan-error {
  border-left: 4px solid var(--accent, #842b2b);
  background: var(--card);
  border-radius: 0 8px 8px 0;
  padding: 16px;
  color: var(--text);
  font-weight: 500;
}
