body { text-align: center; }
h2 { text-align: center; }

.qr-scan-wrap {
  position: relative;
  width: min(92vw, 480px); height: min(92vw, 480px);
  margin: 20px auto 0;
  background: var(--color-surf2);
  border-radius: var(--radius-card);
  overflow: hidden;
}
#reader { width: 100%; height: 100%; }
/* La lib pose la largeur de la video en style inline mais laisse la hauteur suivre
   le ratio natif de la camera -> !important pour forcer un carre plein cadre,
   coherent avec le calcul de la zone grisee (basee sur les dimensions reelles de
   la video), quel que soit le ratio que l'appareil a negocie. */
#reader video { width: 100% !important; height: 100% !important; object-fit: cover; }
.qr-scan-overlay {
  position: absolute;
  inset: 0;
  border: var(--outline);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  pointer-events: none;
}
.qr-scan-help {
  text-align: center;
  margin: 14px 0 0;
  color: var(--color-muted);
  font-size: 15px;
}

.camera-error {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: min(92vw, 480px);
  margin: 20px auto 0;
  padding: 28px 20px;
  background: var(--color-card);
  border: var(--outline);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}
.camera-error.show { display: flex; }
.camera-error-icon { font-size: 40px; }
.camera-error-text { color: var(--color-text); font-size: 16px; margin: 0; }
.camera-error button { margin: 0; width: 100%; }
