.scanner-dialog [hidden] { display: none !important; }

.camera-button {
  min-height: 44px;
  border: 1px solid #0a6ed1;
  border-radius: 4px;
  background: #fff;
  color: #0a6ed1;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font: inherit;
  cursor: pointer;
}

.camera-button span { font-size: 19px; }

.scanner-dialog {
  width: min(100% - 16px, 620px);
  max-height: calc(100vh - 16px);
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: #101820;
  color: #fff;
  overflow: hidden;
}

.scanner-head {
  min-height: 64px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  background: #354a5f;
}

.scanner-head p { color: #d5dadd; font-size: 11px; }
.scanner-head h2 { font-size: 18px; }
.scanner-head .close-button { color: #fff; }

.camera-stage {
  position: relative;
  width: 100%;
  min-height: 330px;
  height: min(62vh, 560px);
  background: #000;
  overflow: hidden;
}

.camera-stage video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#fallbackReader {
  width: 100%;
  height: 100%;
  background: #000;
  overflow: hidden;
}

#fallbackReader video {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

#fallbackReader img,
#fallbackReader__dashboard_section_csr span,
#fallbackReader__dashboard_section_swaplink {
  display: none !important;
}

.scan-frame {
  position: absolute;
  left: 10%;
  right: 10%;
  top: 50%;
  height: 42%;
  transform: translateY(-50%);
  border: 3px solid #fff;
  border-radius: 10px;
  box-shadow: 0 0 0 999px rgba(0,0,0,.35);
}

.scanner-help {
  min-height: 48px;
  padding: 12px 16px;
  color: #eef3f6;
  text-align: center;
  font-size: 13px;
}

.scanner-actions {
  padding: 0 14px 14px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.scanner-actions .secondary-button {
  background: transparent;
  border-color: #91c8f6;
  color: #91c8f6;
}

@media (max-width: 520px) {
  .scan-row { flex-wrap: wrap; }
  .scan-row .input-wrap { flex-basis: 100%; }
  .camera-button, .scan-row > .primary-button { flex: 1; }
  .scanner-dialog { width: 100%; height: 100%; max-height: 100%; border-radius: 0; }
  .camera-stage { height: calc(100vh - 178px); min-height: 300px; }
}
