/* Image to Text — centered upload, compact result, clear states */

/* Workspace — full site content width (~80%) */
.ocr-board {
  display: grid;
  gap: 20px;
  margin: 0 0 44px;
  width: 100%;
}

.ocr-form {
  width: 100%;
}

.ocr-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}

.ocr-upload {
  width: 100%;
  max-width: none;
  padding: 40px 28px 32px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  text-align: center;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease);
}

.ocr-upload.is-dragover {
  border-color: var(--theme);
  background: var(--theme-dim);
}

.ocr-upload.is-loading {
  pointer-events: none;
  opacity: 0.92;
}

.ocr-upload__icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  color: var(--theme);
  transition: color 0.18s var(--ease);
}

.ocr-upload.is-ready .ocr-upload__icon {
  color: var(--theme-deep);
}

.ocr-upload__icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.ocr-upload__title {
  margin: 0 0 6px;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
}

/* Fixed one-line slot — filename replaces formats, no height jump */
.ocr-upload__hint {
  margin: 0 0 18px;
  height: 1.35em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.9rem;
  line-height: 1.35;
  color: var(--muted);
}

.ocr-upload.is-ready .ocr-upload__hint {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-soft);
}

.ocr-upload__actions {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}

.ocr-upload__actions .btn {
  min-width: 140px;
}

.ocr-submit__spin {
  display: none;
  width: 16px;
  height: 16px;
  margin-left: 8px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: ocr-spin 0.7s linear infinite;
  vertical-align: middle;
}

.ocr-upload.is-loading .ocr-submit__spin {
  display: inline-block;
}

.ocr-upload.is-loading .ocr-submit__label {
  opacity: 0.9;
}

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

/* Always reserved — toggled with opacity, never display:none */
.ocr-progress {
  margin-top: 18px;
  height: 4px;
  border-radius: 99px;
  background: var(--line);
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.15s var(--ease);
}

.ocr-upload.is-loading .ocr-progress {
  opacity: 1;
}

.ocr-progress__bar {
  height: 100%;
  width: 18%;
  border-radius: inherit;
  background: var(--theme);
  animation: none;
}

.ocr-upload.is-loading .ocr-progress__bar {
  animation: ocr-progress 1.1s var(--ease) infinite;
}

@keyframes ocr-progress {
  0% {
    width: 12%;
    margin-left: 0;
  }
  50% {
    width: 45%;
    margin-left: 25%;
  }
  100% {
    width: 12%;
    margin-left: 88%;
  }
}

.ocr-status {
  min-height: 1.35em;
  height: 1.35em;
  margin: 14px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.9rem;
  line-height: 1.35;
  color: var(--muted);
}

.ocr-status.is-error {
  color: #be123c;
}

.ocr-status.is-ok {
  color: var(--theme-deep);
}

.ocr-result {
  width: 100%;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

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

.ocr-result__head h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
}

.ocr-result__actions {
  display: flex;
  gap: 8px;
}

.ocr-output {
  width: 100%;
  box-sizing: border-box;
  min-height: 140px;
  max-height: 220px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 0.92rem;
  line-height: 1.55;
  resize: vertical;
  outline: none;
  box-shadow: none;
}

.ocr-output:focus,
.ocr-output:focus-visible {
  outline: none;
  border-color: var(--line);
  box-shadow: none;
}

.ocr-privacy {
  margin: 10px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.45;
  text-align: center;
}

/* Content blocks */
