/* Image to text / OCR (/tools/image-to-text/ and /ko/tools/image-to-text/).
   Loaded after /css/clean-home.css, /tools/shared/audio-task.css and /tools/shared/text-qr-tools.css
   (which sets Noto Sans KR and keep-all on Korean pages). Only what those don't cover. */

.at-drop .ocr-pick-row { justify-content: center; }
.at-drop kbd, .at-article kbd {
  font: inherit; font-size: .85em; font-weight: 700; padding: 1px 6px; border-radius: 6px;
  border: 1px solid #DCCFF5; background: #fff; color: var(--et-ink); white-space: nowrap;
}

/* Settings ------------------------------------------------------------------------- */
.ocr-settings { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 16px 22px; align-items: start; }
@media (max-width: 680px) { .ocr-settings { grid-template-columns: minmax(0, 1fr); } }
.ocr-settings select { width: 100%; }
.at-tool fieldset.ocr-clean { margin: 0; padding: 0; display: grid; gap: 10px; }
.ocr-clean legend { padding: 0; }
.ocr-contrast { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.ocr-contrast .at-unit { color: var(--et-ink); font-weight: 700; font-size: 14px; }
.ocr-contrast .at-seg span { min-height: 36px; padding: 5px 12px; font-size: 13.5px; }

/* Results bar ---------------------------------------------------------------------- */
.ocr-bar { justify-content: space-between; }
.ocr-summary { margin: 0; font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; flex: 1 1 auto; }
.ocr-output-bar { margin-top: 14px; padding-top: 12px; border-top: 1px solid #F1ECF9; }
.ocr-spacer { flex: 1 1 auto; }
@media (max-width: 520px) { .ocr-spacer { display: none; } .ocr-output-bar .at-check { flex: 1 1 100%; } }

/* Result list ---------------------------------------------------------------------- */
.ocr-list { list-style: none; display: grid; gap: 12px; margin: 14px 0 0; padding: 0; }
.ocr-item { background: #FBF9FF; border: 1px solid #EEE7FA; border-radius: 14px; padding: 12px; min-width: 0; }
.ocr-item.is-working { border-color: #D9CCF6; box-shadow: 0 0 0 2px rgba(130, 87, 230, .12); }
.ocr-head { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 8px 12px; align-items: center; }
.ocr-thumb {
  width: 56px; height: 56px; border-radius: 10px; overflow: hidden; background: #F1ECF9;
  display: grid; place-items: center; font-size: 11px; font-weight: 800; color: var(--et-purple-dark); text-align: center; line-height: 1.2;
}
.ocr-thumb img { width: 100%; height: 100%; object-fit: contain; background: #fff; display: block; transition: transform .15s ease; }
.ocr-main { min-width: 0; display: grid; gap: 3px; }
.ocr-name { font-weight: 700; font-size: 14.5px; overflow-wrap: anywhere; word-break: normal; }
.ocr-meta { font-size: 13px; color: var(--et-mute); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ocr-meta.is-error { color: #8A2219; }
.ocr-main progress { width: 100%; height: 6px; accent-color: var(--et-purple); }
.ocr-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 520px) {
  .ocr-head { grid-template-columns: 48px minmax(0, 1fr); }
  .ocr-thumb { width: 48px; height: 48px; }
  .ocr-actions { grid-column: 1 / -1; justify-content: flex-start; }
}
.ocr-conf { margin-right: 4px; }
.ocr-conf--fair { background: #FFF4E0; color: #6E4A0E; }
.ocr-conf--low { background: #FFECEA; color: #8A2219; }

.ocr-body { margin-top: 12px; display: grid; gap: 10px; min-width: 0; }
.ocr-note { margin: 0; font-size: 13.5px; line-height: 1.5; color: #3D2A75; background: var(--et-purple-soft); border-radius: 10px; padding: 8px 12px; }
.ocr-note.is-warn { color: #6E4A0E; background: #FFF4E0; }
.at-tool textarea.ocr-text { min-height: 150px; font-size: 15.5px; line-height: 1.65; background: #fff; }
html[lang="ko"] .at-tool textarea.ocr-text { word-break: normal; }
.ocr-row { gap: 8px 10px; }
.ocr-boxes { margin-left: auto; font-size: 13.5px; }
@media (max-width: 520px) { .ocr-boxes { margin-left: 0; } }
.ocr-preview { margin: 0; min-width: 0; }
.ocr-preview canvas { display: block; max-width: 100%; height: auto; border-radius: 10px; border: 1px solid #EEE7FA; background: #fff; }
.ocr-preview figcaption { margin-top: 6px; }

@media (prefers-reduced-motion: reduce) { .ocr-thumb img { transition: none; } }
