/* Professional ticket camera — Ontario POA intake */
.hta-cam-overlay {
  align-items: stretch;
  background: #0b1220;
  bottom: 0;
  display: none;
  flex-direction: column;
  left: 0;
  padding-top: env(safe-area-inset-top, 0px);
  position: fixed;
  right: 0;
  top: 0;
  z-index: 10050;
}
.hta-cam-overlay.is-open { display: flex; }

.hta-cam-top {
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.35;
  padding: 14px 16px 6px;
  text-align: center;
}
.hta-cam-hint {
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 600;
  margin-top: 4px;
}
.hta-cam-status {
  color: #fbbf24;
  font-size: 13px;
  font-weight: 700;
  margin-top: 8px;
  min-height: 1.3em;
  transition: color 0.2s ease;
}
.hta-cam-status.is-bad { color: #fca5a5; }
.hta-cam-status.is-warn { color: #fbbf24; }
.hta-cam-status.is-ok { color: #86efac; }

.hta-cam-stage {
  flex: 1;
  margin: 0 auto;
  max-width: 640px;
  min-height: 280px;
  overflow: hidden;
  position: relative;
  width: 100%;
}
.hta-cam-stage video {
  background: #000;
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}
.hta-cam-quad {
  fill: none;
  height: 100%;
  left: 0;
  pointer-events: none;
  position: absolute;
  top: 0;
  width: 100%;
  z-index: 2;
}
.hta-cam-quad polygon {
  fill: none;
  stroke: rgba(255, 255, 255, 0.55);
  stroke-dasharray: 6 5;
  stroke-linejoin: round;
  stroke-width: 2;
  transition: stroke 0.15s ease;
}
.hta-cam-quad.is-bad polygon { stroke: #ef4444; }
.hta-cam-quad.is-warn polygon { stroke: #eab308; }
.hta-cam-quad.is-ok polygon { stroke: #22c55e; stroke-dasharray: none; }

.hta-cam-guide {
  aspect-ratio: 8.5 / 7;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 8px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);
  left: 50%;
  max-height: 72%;
  max-width: 88%;
  pointer-events: none;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(88%, calc(72% * 8.5 / 7));
  z-index: 1;
}
.hta-cam-guide::before,
.hta-cam-guide::after {
  border: 3px solid currentColor;
  content: "";
  height: 22px;
  position: absolute;
  width: 22px;
}
.hta-cam-guide::before {
  border-bottom: 0;
  border-right: 0;
  left: -2px;
  top: -2px;
}
.hta-cam-guide::after {
  border-left: 0;
  border-top: 0;
  bottom: -2px;
  right: -2px;
}
.hta-cam-guide .corner-br,
.hta-cam-guide .corner-tl {
  border: 3px solid currentColor;
  height: 22px;
  position: absolute;
  width: 22px;
}
.hta-cam-guide .corner-tl {
  border-bottom: 0;
  border-left: 0;
  right: -2px;
  top: -2px;
}
.hta-cam-guide .corner-br {
  border-right: 0;
  border-top: 0;
  bottom: -2px;
  left: -2px;
}
.hta-cam-guide {
  color: #fff;
}
.hta-cam-guide.is-bad {
  border-color: #ef4444;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55), 0 0 0 2px rgba(239, 68, 68, 0.35);
  color: #ef4444;
}
.hta-cam-guide.is-warn {
  border-color: #eab308;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5), 0 0 0 2px rgba(234, 179, 8, 0.35);
  color: #eab308;
}
.hta-cam-guide.is-ok {
  border-color: #22c55e;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.42), 0 0 0 3px rgba(34, 197, 94, 0.4);
  color: #22c55e;
}

.hta-cam-ready-ring {
  border: 3px solid rgba(34, 197, 94, 0.25);
  border-radius: 999px;
  border-top-color: #22c55e;
  display: none;
  height: 36px;
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  z-index: 3;
}
.hta-cam-ready-ring.is-active {
  animation: hta-cam-spin 0.9s linear infinite;
  display: block;
}
@keyframes hta-cam-spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.hta-cam-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px));
}
.hta-cam-btn {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 800;
  min-height: 48px;
  min-width: 110px;
  padding: 12px 18px;
}
.hta-cam-btn-cancel { background: #334155; color: #fff; }
.hta-cam-btn-gallery { background: #1e293b; color: #e2e8f0; }
.hta-cam-btn-flash { background: #1e293b; color: #e2e8f0; min-width: 48px; }
.hta-cam-btn-flash.is-on { background: #ca8a04; color: #111; }
.hta-cam-btn-shot {
  background: #7c3aed;
  color: #fff;
  opacity: 0.5;
  pointer-events: none;
}
.hta-cam-btn-shot.is-ready {
  opacity: 1;
  pointer-events: auto;
}
.hta-cam-btn-shot.is-armed {
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.35);
}

/* Review screen */
.hta-cam-review {
  align-items: stretch;
  background: #0b1220;
  bottom: 0;
  display: none;
  flex-direction: column;
  left: 0;
  padding-top: env(safe-area-inset-top, 0px);
  position: fixed;
  right: 0;
  top: 0;
  z-index: 10060;
}
.hta-cam-review.is-open { display: flex; }
.hta-cam-review-top {
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  padding: 16px 18px 8px;
  text-align: center;
}
.hta-cam-review-body {
  background: #111827;
  flex: 1;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 8px;
  touch-action: pan-x pan-y pinch-zoom;
}
.hta-cam-review-body img {
  display: block;
  height: auto;
  margin: 0 auto;
  max-width: none;
  width: 100%;
}
.hta-cam-review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px));
}
.hta-cam-btn-use { background: #7c3aed; color: #fff; }
.hta-cam-btn-retake { background: #334155; color: #fff; }
