.import-tabs {
  margin: 4px 0 6px;
}

.ocr-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 10px 0 4px;
  text-align: center;
}

.ocr-loading[hidden] {
  display: none;
}

.ocr-stage {
  position: relative;
  width: 240px;
  height: 320px;
  border-radius: 14px;
  overflow: visible;
}

.ocr-tiles {
  position: absolute;
  inset: 0;
}

.ocr-tile {
  position: absolute;
  background-repeat: no-repeat;
  background-color: rgba(127, 140, 130, 0.15);
  animation: ocr-split 3.6s cubic-bezier(0.65, 0, 0.35, 1) infinite;
  animation-delay: var(--delay, 0ms);
  will-change: transform;
}

.ocr-tile::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  animation: ocr-tint 3.6s ease-in-out infinite;
  animation-delay: var(--delay, 0ms);
}

.ocr-tile.orange::after {
  background: rgba(255, 145, 75, 0.55);
}

.ocr-tile.blue::after {
  background: rgba(75, 160, 235, 0.68);
}

.ocr-scan {
  position: absolute;
  left: -6px;
  right: -6px;
  top: 0;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, transparent, #8be3b6, transparent);
  box-shadow: 0 0 18px 5px rgba(139, 227, 182, 0.55);
  animation: ocr-scan 3.6s linear infinite;
}

.ocr-status {
  margin: 14px 0 0;
  font-weight: 600;
  font-size: calc(14px * var(--font-scale, 1));
}

.ocr-dots::after {
  content: '';
  display: inline-block;
  width: 1.2em;
  text-align: left;
  animation: ocr-dots 1.2s steps(4, end) infinite;
}

.ocr-loading small {
  color: var(--muted);
  font-size: calc(11px * var(--font-scale, 1));
  max-width: 320px;
  line-height: 1.6;
}

#ocr-count {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: calc(11px * var(--font-scale, 1));
}

@keyframes ocr-split {
  0%, 18% {
    transform: none;
    box-shadow: inset 0 0 0 0 rgba(229, 57, 53, 0);
  }
  30% {
    transform: none;
    box-shadow: inset 0 0 0 1.5px rgba(229, 57, 53, 0.95);
  }
  45%, 72% {
    transform: translate(calc(var(--dx) * 16px), calc(var(--dy) * 16px)) scale(0.93);
    box-shadow: inset 0 0 0 1.5px rgba(229, 57, 53, 0.95);
  }
  90%, 100% {
    transform: none;
    box-shadow: inset 0 0 0 0 rgba(229, 57, 53, 0);
  }
}

@keyframes ocr-tint {
  0%, 40% { opacity: 0; }
  52%, 72% { opacity: 1; }
  88%, 100% { opacity: 0; }
}

@keyframes ocr-scan {
  0% { top: 0; opacity: 1; }
  25% { top: 100%; opacity: 1; }
  26%, 100% { top: 100%; opacity: 0; }
}

@keyframes ocr-dots {
  0% { content: ''; }
  25% { content: '.'; }
  50% { content: '..'; }
  75% { content: '...'; }
}
