:root {
  color-scheme: light;
  --navy: #0b1f3a;
  --navy-2: #15345e;
  --blue: #1769ff;
  --blue-hover: #0e57df;
  --blue-soft: #e8f0ff;
  --red: #dc3b3b;
  --green: #0f9d6e;
  --text: #111d33;
  --muted: #67758c;
  --surface: #ffffff;
  --surface-soft: #f7f9fc;
  --background: #eef3f8;
  --border: #dce5f0;
  --scanner: #edf4ff;
  --scanner-border: #bfd5ff;
  --shadow: 0 14px 38px rgba(13, 35, 66, 0.1);
  --overlay: rgba(7, 18, 35, 0.54);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --navy: #071426;
  --navy-2: #112844;
  --blue: #2274ff;
  --blue-hover: #3a83ff;
  --blue-soft: #112c56;
  --red: #e65353;
  --green: #27c18b;
  --text: #f4f7fb;
  --muted: #9aacbf;
  --surface: #0c1b2d;
  --surface-soft: #102238;
  --background: #06111f;
  --border: #203953;
  --scanner: #0d2035;
  --scanner-border: #244a75;
  --shadow: 0 14px 38px rgba(0, 0, 0, 0.32);
  --overlay: rgba(0, 0, 0, 0.7);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  min-height: 100%;
  margin: 0;
  font-family: Inter, Arial, Helvetica, sans-serif;
  background: var(--background);
  color: var(--text);
}

body {
  padding: 12px 10px 28px;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
}

.topbar,
.manual-card,
.result-card,
.history-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  margin-bottom: 12px;
}

.brand-block {
  min-width: 0;
}

.eyebrow,
.section-label {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.75px;
  text-transform: uppercase;
}

.topbar h1 {
  margin: 2px 0 0;
  font-size: clamp(19px, 4vw, 27px);
  line-height: 1.08;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex: 0 0 auto;
  min-width: 0;
}

.domain-switch {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 132px;
  padding: 4px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.domain-option {
  position: relative;
  z-index: 2;
  height: 34px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.domain-option.active {
  color: #ffffff;
}

.domain-slider {
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc(50% - 4px);
  height: 34px;
  background: var(--blue);
  border-radius: 999px;
  box-shadow: 0 5px 14px rgba(31, 111, 235, 0.28);
  transition: transform 0.22s ease;
}

.domain-switch.slu .domain-slider {
  transform: translateX(100%);
}

.online-indicator {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--green);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.online-dot {
  width: 9px;
  height: 9px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(15, 157, 110, 0.12);
}

.theme-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--text);
}

.theme-button {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  min-width: 42px;
  padding: 0;
  overflow: hidden;
  border-radius: 14px;
}

.theme-button svg {
  width: 21px;
  height: 21px;
}

.moon-icon {
  display: none;
}

html[data-theme="dark"] .sun-icon {
  display: none;
}

html[data-theme="dark"] .moon-icon {
  display: block;
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.scanner-column {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.scanner-card {
  position: relative;
  min-height: 270px;
  overflow: hidden;
  background: var(--scanner);
  border: 1px solid var(--scanner-border);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

#reader,
#reader__scan_region,
#reader video {
  width: 100% !important;
  min-height: 270px;
}

#reader {
  overflow: hidden;
  border: 0 !important;
  background: transparent !important;
}

#reader video {
  display: block;
  height: 100% !important;
  object-fit: cover;
}

#reader__scan_region img,
#reader__dashboard {
  display: none !important;
}

.camera-placeholder {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px;
  text-align: center;
  color: var(--muted);
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.camera-placeholder.hidden {
  opacity: 0;
}

.large-barcode-icon {
  width: 64px;
  height: 64px;
  margin-bottom: 12px;
  color: var(--blue);
}

.camera-placeholder strong {
  margin-bottom: 5px;
  color: var(--text);
  font-size: 17px;
}

.camera-placeholder span {
  max-width: 280px;
  font-size: 13px;
  line-height: 1.45;
}

.scanner-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.scanner-overlay.visible {
  display: flex;
}

.scan-window {
  position: relative;
  width: 88%;
  height: 120px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 14px;
}

.scan-line {
  position: absolute;
  top: 8px;
  left: 4%;
  width: 92%;
  height: 2px;
  background: #ff3b30;
  box-shadow: 0 0 11px #ff3b30;
  animation: scanning 1.8s ease-in-out infinite;
}

@keyframes scanning {
  0%,
  100% {
    top: 8px;
  }

  50% {
    top: calc(100% - 10px);
  }
}

.camera-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: min(100%, 290px);
  min-height: 50px;
  margin: 0 auto;
  padding: 0 18px;
  color: #ffffff;
  background: var(--blue);
  border: 0;
  border-radius: 13px;
  box-shadow: 0 10px 22px rgba(23, 105, 255, 0.25);
  font-weight: 900;
  letter-spacing: 0.2px;
}

.camera-button:hover {
  background: var(--blue-hover);
}

.camera-button.active {
  background: var(--red);
  box-shadow: 0 10px 22px rgba(220, 59, 59, 0.24);
}

.camera-button.loading {
  pointer-events: none;
  opacity: 0.78;
}

.camera-button svg {
  width: 24px;
  height: 24px;
}

.button-spinner {
  display: none;
  width: 22px;
  height: 22px;
  border: 3px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: rotate 0.8s linear infinite;
}

.camera-button.loading svg,
.camera-button.loading #cameraButtonText {
  display: none;
}

.camera-button.loading .button-spinner {
  display: block;
}

@keyframes rotate {
  to {
    transform: rotate(360deg);
  }
}

.consult-column {
  display: grid;
  align-content: start;
  gap: 12px;
}

.manual-card,
.result-card,
.history-card {
  padding: 16px;
}

.manual-card label {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
}

.manual-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.manual-row input {
  width: 100%;
  min-width: 0;
  height: 48px;
  padding: 0 14px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 13px;
  outline: none;
}

.manual-row input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(31, 111, 235, 0.11);
}

.manual-row button {
  height: 48px;
  padding: 0 18px;
  color: #ffffff;
  background: var(--navy);
  border: 0;
  border-radius: 13px;
  font-weight: 900;
}

html[data-theme="dark"] .manual-row button {
  background: var(--blue);
}

.manual-row button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.helper-text {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.status {
  min-height: 20px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.status.loading {
  color: var(--blue);
  font-weight: 800;
}

.status.success {
  color: var(--green);
  font-weight: 800;
}

.status.error {
  color: var(--red);
  font-weight: 800;
}

.result-header,
.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.result-header strong,
.history-header strong {
  display: block;
  margin-top: 5px;
}

.domain-badge {
  padding: 7px 10px;
  color: var(--blue);
  background: var(--blue-soft);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

.response-box {
  display: none;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.response-box.visible {
  display: block;
}

#responseContent {
  margin-top: 8px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.response-loading {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--blue);
  font-weight: 800;
}

.mini-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid #cfe0ff;
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: rotate 0.8s linear infinite;
}

.history-actions {
  display: flex;
  gap: 8px;
}

.secondary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  font-size: 12px;
  font-weight: 850;
}

.secondary-button {
  color: var(--text);
  background: var(--surface-soft);
}

.secondary-button svg {
  width: 17px;
  height: 17px;
  color: var(--red);
}

.ghost-button {
  color: var(--muted);
  background: var(--surface-soft);
}

.history-list {
  display: grid;
  gap: 0;
  margin-top: 12px;
}

.history-item {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(0, 1.6fr);
  gap: 18px;
  padding: 14px 4px;
  border-top: 1px solid var(--border);
}

.history-primary strong {
  display: block;
  font-size: 15px;
}

.history-primary time {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.history-response {
  padding-left: 18px;
  border-left: 1px solid var(--border);
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.empty-history {
  margin: 0;
  padding: 15px 0 2px;
  color: var(--muted);
  font-size: 13px;
}

.share-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
}

.share-modal.visible {
  display: block;
}

.share-backdrop {
  position: absolute;
  inset: 0;
  background: var(--overlay);
  backdrop-filter: blur(4px);
}

.share-sheet {
  position: absolute;
  left: 50%;
  bottom: 14px;
  width: min(calc(100% - 20px), 460px);
  padding: 10px 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.25);
  transform: translateX(-50%);
}

.share-handle {
  width: 42px;
  height: 4px;
  margin: 2px auto 12px;
  background: var(--border);
  border-radius: 999px;
}

.share-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.share-title-row h2 {
  margin: 3px 0 0;
  font-size: 18px;
}

.icon-button {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 11px;
  font-size: 23px;
}

.share-option {
  display: block;
  width: 100%;
  padding: 13px 12px;
  text-align: left;
  color: var(--text);
  background: transparent;
  border: 0;
  border-top: 1px solid var(--border);
}

.share-option strong,
.share-option span {
  display: block;
}

.share-option span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 760px) {
  body {
    padding: 8px 8px calc(20px + env(safe-area-inset-bottom));
  }

  .topbar {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
  }

  .topbar h1 {
    font-size: 20px;
  }

  .header-actions {
    flex-wrap: nowrap;
    gap: 7px;
  }

  .domain-switch {
    width: 112px;
    flex: 0 0 112px;
  }

  .online-indicator {
    gap: 5px;
    font-size: 11px;
  }

  .theme-button {
    flex-basis: 38px;
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 12px;
  }

  .main-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .scanner-column {
    gap: 10px;
  }

  .scanner-card,
  #reader,
  #reader__scan_region,
  #reader video {
    min-height: 230px;
  }

  .camera-button {
    position: relative;
    z-index: 5;
    width: 100%;
    max-width: none;
    min-height: 50px;
    margin: 0;
    border-radius: 14px;
  }

  .manual-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .manual-row button {
    min-width: 116px;
  }

  .history-header {
    align-items: center;
  }

  .history-actions {
    flex-wrap: nowrap;
    justify-content: flex-end;
  }

  .secondary-button,
  .ghost-button {
    flex: 0 0 auto;
    min-height: 40px;
  }

  .secondary-button svg {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
  }

  .history-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .history-response {
    padding-left: 0;
    border-left: 0;
  }
}

@media (max-width: 520px) {
  .topbar {
    grid-template-columns: 1fr;
  }

  .brand-block,
  .header-actions {
    width: 100%;
  }

  .header-actions {
    justify-content: space-between;
  }

  .online-indicator {
    margin-left: auto;
  }

  .scanner-card,
  #reader,
  #reader__scan_region,
  #reader video {
    min-height: 220px;
  }

  .camera-placeholder {
    padding: 22px;
  }

  .manual-card,
  .result-card,
  .history-card {
    padding: 14px;
  }
}

@media (max-width: 420px) {
  .manual-row {
    grid-template-columns: 1fr;
  }

  .manual-row button {
    width: 100%;
  }

  .history-header {
    display: grid;
    grid-template-columns: 1fr;
  }

  .history-actions {
    justify-content: stretch;
  }

  .history-actions button {
    flex: 1 1 0;
  }

  .secondary-button span {
    white-space: nowrap;
  }
}


.result-card {
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.result-card.alert-yellow {
  background: #fff8d8;
  border: 2px solid #e5ad00;
  box-shadow:
    0 0 0 4px rgba(229, 173, 0, 0.16),
    var(--shadow);
}

.result-card.alert-red {
  background: #ffe8e8;
  border: 2px solid #e33d3d;
  box-shadow:
    0 0 0 4px rgba(227, 61, 61, 0.16),
    var(--shadow);
  animation: alert-red-pulse 1s ease-in-out;
}

.result-card.alert-yellow .section-label,
.result-card.alert-yellow .domain-badge {
  color: #8a6500;
}

.result-card.alert-red .section-label,
.result-card.alert-red .domain-badge {
  color: #b42323;
}

.history-item.alert-yellow,
.history-item.alert-red {
  margin-top: 8px;
  padding-right: 12px;
  padding-left: 12px;
  border-top: 0;
  border-radius: 12px;
}

.history-item.alert-yellow {
  background: #fff8d8;
  border-left: 5px solid #e5ad00;
}

.history-item.alert-red {
  background: #ffe8e8;
  border-left: 5px solid #e33d3d;
}

html[data-theme="dark"] .result-card.alert-yellow,
html[data-theme="dark"] .history-item.alert-yellow {
  color: #fff5bf;
  background: #3a300f;
  border-color: #d7a400;
}

html[data-theme="dark"] .result-card.alert-red,
html[data-theme="dark"] .history-item.alert-red {
  color: #ffe1e1;
  background: #3c171b;
  border-color: #e65353;
}

html[data-theme="dark"] .result-card.alert-yellow #responseContent,
html[data-theme="dark"] .history-item.alert-yellow .history-response {
  color: #fff5bf;
}

html[data-theme="dark"] .result-card.alert-red #responseContent,
html[data-theme="dark"] .history-item.alert-red .history-response {
  color: #ffe1e1;
}

@keyframes alert-red-pulse {
  0%,
  100% {
    transform: scale(1);
  }

  35% {
    transform: scale(1.006);
  }
}


.scanner-controls {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 24px;
  min-height: 92px;
}

.scanner-control {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}

.camera-button,
.torch-button {
  position: relative;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 68px;
  width: 68px;
  height: 68px;
  min-height: 68px;
  margin: 0;
  padding: 0;
  border-radius: 50%;
}

.camera-button {
  color: #ffffff;
  background: var(--blue);
  border: 0;
  box-shadow: 0 10px 22px rgba(23, 105, 255, 0.28);
}

.camera-button.active {
  background: var(--red);
}

.torch-button {
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.torch-button.active {
  color: #172033;
  background: #ffd23f;
  border-color: #e4ad00;
  box-shadow: 0 8px 20px rgba(229, 173, 0, 0.3);
}

.torch-button:disabled {
  color: var(--muted);
  background: var(--surface-soft);
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.48;
}

.camera-button svg,
.torch-button svg {
  width: 29px;
  height: 29px;
}

.scanner-control-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.55px;
  line-height: 1;
  text-transform: uppercase;
}

.camera-button.active + .scanner-control-label {
  color: var(--red);
}

.torch-button.active + .scanner-control-label {
  color: #9b7200;
}

.history-response {
  margin: 0;
  text-align: left;
  text-indent: 0;
  white-space: pre-line;
}

@media (max-width: 520px) {
  .scanner-controls {
    gap: 22px;
  }

  .camera-button,
  .torch-button {
    flex-basis: 64px;
    width: 64px;
    height: 64px;
    min-height: 64px;
  }
}


#responseContent strong,
.history-response strong {
  font-weight: 900;
}


/* Mantém a câmera compacta sem reduzir a janela útil do Code 128. */
.scanner-card {
  height: 270px;
  min-height: 270px;
}

#reader,
#reader__scan_region,
#reader video {
  height: 100% !important;
  min-height: 0 !important;
  max-height: 270px !important;
}

#reader__scan_region {
  overflow: hidden !important;
}

#reader video {
  object-fit: cover !important;
  object-position: center center !important;
}

@media (max-width: 760px) {
  .scanner-card {
    height: 230px;
    min-height: 230px;
    max-height: 230px;
  }

  #reader,
  #reader__scan_region,
  #reader video {
    height: 230px !important;
    min-height: 0 !important;
    max-height: 230px !important;
  }
}

@media (max-width: 520px) {
  .scanner-card {
    height: 220px;
    min-height: 220px;
    max-height: 220px;
  }

  #reader,
  #reader__scan_region,
  #reader video {
    height: 220px !important;
    min-height: 0 !important;
    max-height: 220px !important;
  }

  .scan-window {
    height: 108px;
  }
}


/* Versão 11: visor baixo, sem elipse e com cantos suaves. */
.scanner-card {
  height: 200px !important;
  min-height: 200px !important;
  max-height: 200px !important;
}

#reader,
#reader__scan_region,
#reader video {
  height: 200px !important;
  min-height: 0 !important;
  max-height: 200px !important;
}

#reader,
#reader__scan_region {
  overflow: hidden !important;
}

#qr-shaded-region {
  border-color: transparent !important;
}

#qr-shaded-region > div {
  display: none !important;
}

.scan-window {
  width: 88%;
  height: 92px;
  border: 0 !important;
  border-radius: 0;
}

.scan-corner {
  position: absolute;
  width: 34px;
  height: 34px;
  border-color: rgba(255, 255, 255, 0.94);
  border-style: solid;
  border-width: 0;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.22));
}

.scan-corner.top-left {
  top: 0;
  left: 0;
  border-top-width: 4px;
  border-left-width: 4px;
  border-top-left-radius: 13px;
}

.scan-corner.top-right {
  top: 0;
  right: 0;
  border-top-width: 4px;
  border-right-width: 4px;
  border-top-right-radius: 13px;
}

.scan-corner.bottom-left {
  bottom: 0;
  left: 0;
  border-bottom-width: 4px;
  border-left-width: 4px;
  border-bottom-left-radius: 13px;
}

.scan-corner.bottom-right {
  right: 0;
  bottom: 0;
  border-right-width: 4px;
  border-bottom-width: 4px;
  border-bottom-right-radius: 13px;
}

.scan-line {
  top: 45px;
  left: 7%;
  width: 86%;
  animation: none;
}

@media (max-width: 760px) {
  .scanner-card {
    height: 180px !important;
    min-height: 180px !important;
    max-height: 180px !important;
  }

  #reader,
  #reader__scan_region,
  #reader video {
    height: 180px !important;
    min-height: 0 !important;
    max-height: 180px !important;
  }

  .scan-window {
    height: 86px;
  }

  .scan-line {
    top: 42px;
  }
}

@media (max-width: 520px) {
  .scanner-card {
    height: 170px !important;
    min-height: 170px !important;
    max-height: 170px !important;
  }

  #reader,
  #reader__scan_region,
  #reader video {
    height: 170px !important;
    min-height: 0 !important;
    max-height: 170px !important;
  }

  .scan-window {
    height: 82px;
  }

  .scan-corner {
    width: 30px;
    height: 30px;
  }

  .scan-line {
    top: 40px;
  }
}


/* Versão 12: visor ampliado e varredura animada. */
.scanner-card {
  height: 360px !important;
  min-height: 360px !important;
  max-height: 360px !important;
}

#reader,
#reader__scan_region,
#reader video {
  height: 360px !important;
  min-height: 0 !important;
  max-height: 360px !important;
}

.scan-window {
  width: 94%;
  height: 210px;
}

.scan-corner {
  width: 42px;
  height: 42px;
}

.scan-line {
  top: 8px;
  left: 2%;
  width: 96%;
  animation: scanning 1.7s ease-in-out infinite;
}

@media (max-width: 760px) {
  .scanner-card {
    height: 350px !important;
    min-height: 350px !important;
    max-height: 350px !important;
  }

  #reader,
  #reader__scan_region,
  #reader video {
    height: 350px !important;
    min-height: 0 !important;
    max-height: 350px !important;
  }

  .scan-window {
    width: 94%;
    height: 200px;
  }
}

@media (max-width: 520px) {
  .scanner-card {
    height: 340px !important;
    min-height: 340px !important;
    max-height: 340px !important;
  }

  #reader,
  #reader__scan_region,
  #reader video {
    height: 340px !important;
    min-height: 0 !important;
    max-height: 340px !important;
  }

  .scan-window {
    width: 94%;
    height: 190px;
  }

  .scan-corner {
    width: 38px;
    height: 38px;
  }
}

@media print {
  body {
    background: #ffffff;
    color: #000000;
  }

  .topbar,
  .main-grid,
  .history-actions,
  .status,
  .share-modal {
    display: none !important;
  }

  .history-card {
    box-shadow: none;
    border: 0;
  }

  .history-item {
    break-inside: avoid;
  }
}
