.ocr-active #propertyFields, .ocr-active #inspector > .property-section { display: none; }
.ocr-active #editLayer { pointer-events: none !important; }
#ocrLayer { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.studio-page #editLayer { z-index: 3; }
.studio-page #searchLayer { z-index: 4; }
.studio-page #formLayer { z-index: 5; }
.ocr-active #formLayer { display: none; }
.ocr-line { position: absolute; white-space: pre; cursor: text; user-select: text; }
.ocr-active #ocrLayer[data-mode="edit"] .ocr-line { outline: 1px solid #26796766; background: #347c6310 !important; cursor: pointer; }
.ocr-active #ocrLayer[data-mode="edit"] .ocr-line.replaced { background: var(--ocr-background, #fff) !important; }
.ocr-active #ocrLayer[data-mode="edit"] .ocr-line.selected { outline: 2px solid #a54c2f; }
.ocr-line.replaced { box-shadow: 0 0 0 2px var(--ocr-background, #fff); }
.ocr-line::selection { background: #38987666; }
.text-edit-active .ocr-tabs, .text-edit-active #ocrLineConfidence, .text-edit-active .ocr-check { display: none; }
.text-edit-active #ocrLines { max-height: 170px; }
.text-edit-active #ocrLineEditor { scroll-margin-top: 12px; }
#textEditControls { display: grid; gap: 10px; }
#textEditStatus { margin: 0; font-size: 12px; }
#replacementFontInfo { margin: 0; font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.ocr-line:focus-visible { outline: 2px solid #a54c2f !important; }
.ocr-language { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: #496a59; }
.ocr-tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 3px; border-radius: 5px; background: #f0f3f1; }
.studio-page .ocr-tabs button { border: 0; background: transparent; }
.studio-page .ocr-tabs [aria-selected="true"] { background: #fff; box-shadow: 0 1px 4px #1739211a; }
#ocrReadText { width: 100%; min-height: 230px; max-height: 55dvh; font-size: 12px; line-height: 1.6; font-weight: 400; resize: vertical; }
#ocrLines { display: grid; gap: 3px; max-height: 230px; overflow: auto; }
.studio-page .ocr-line-row { display: grid; grid-template-columns: 18px minmax(0, 1fr) 28px; padding: 7px 4px; font-size: 11px; text-align: left; gap: 5px; border: 0; border-radius: 3px; }
.ocr-line-row .ocr-excerpt { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ocr-line-row > span:first-child { color: #708379; font-variant-numeric: tabular-nums; }
.ocr-line-row small { font-size: 10px; color: #538368; }
.ocr-line-row .low-confidence { color: #a84d1c; font-weight: 700; }
#ocrLineEditor { display: grid; gap: 12px; padding-top: 14px; margin-top: 10px; border-top: 1px solid #e1e7e3; }
#ocrLineEditor details { font-size: 11px; color: #6b7971; }
#ocrOriginal { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 7px; }
.studio-page .ocr-check { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.ocr-check input { width: 15px; height: 15px; accent-color: #a54630; flex-shrink: 0; }
.studio-page .background-check { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.background-check input { width: 15px; height: 15px; accent-color: #a54630; flex-shrink: 0; }
.studio-page #ocrBackground:disabled { opacity: 1; }
.ocr-actions, .ocr-edit-actions { display: flex; align-items: center; justify-content: space-between; gap: 5px; }
.studio-page .ocr-edit-actions .primary { white-space: normal; font-size: 12px; flex: 1; }
.ocr-progress-backdrop { position: fixed; inset: 0; display: grid; place-items: center; z-index: 40; background: #1c322b66; padding: 20px; }
.ocr-progress { background: #fff; width: min(420px, 100%); border-radius: 8px; padding: 24px; display: grid; gap: 20px; box-shadow: 0 10px 40px #172e3924; }
.ocr-progress progress { width: 100%; height: 8px; accent-color: #26785f; }
.ocr-progress h2 { font-size: 18px; }
.ocr-progress p { overflow-wrap: anywhere; }
@media print { .ocr-progress-backdrop { display: none !important; } }
