.ocr-dialog { width: min(960px, calc(100vw - 24px)); max-height: 92dvh; overflow: auto; padding: clamp(16px, 3vw, 30px); padding-block-end: max(clamp(16px, 3vw, 30px), env(safe-area-inset-bottom, 0px)); }
/* Capture-owned: Help/Ask and the assistant FAB sit at inset-inline-end on a
   near-full-width OCR dialog. Hide them from hit-testing while this modal is
   open. Global chrome remains the other shell PR; this file only scopes OCR. */
html:has(#ocr-dialog[open]) .hk-btns,
html:has(#ocr-dialog[open]) .mh-fab,
html:has(#ocr-dialog[open]) .mh-panel,
html[data-ocr-open] .hk-btns,
html[data-ocr-open] .mh-fab,
html[data-ocr-open] .mh-panel {
  visibility: hidden;
  pointer-events: none;
}
.ocr-dialog::backdrop { background: rgb(20 37 31 / .62); }
.ocr-dialog label { display: grid; gap: 8px; }
.ocr-dialog input[type=file] { max-width: 100%; }
.ocr-tools { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; margin-block: 18px; }
.ocr-tools label { flex: 1 1 150px; }
.ocr-panels { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-block: 20px; align-items: start; }
.ocr-source-panel { min-width: 0; }
.ocr-zoom { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-block-end: 10px; }
.ocr-zoom output { min-width: 4ch; text-align: center; font-variant-numeric: tabular-nums; }
.ocr-replacement { padding: 14px; border: 1px solid var(--line, #d7dfd7); border-radius: 12px; }
.ocr-replacement p { margin-block: 0 12px; }
.ocr-replacement button { margin-inline-end: 8px; margin-block-end: 8px; }
.ocr-zoom[hidden], .ocr-replacement[hidden], .ocr-dialog [data-ocr=stop][hidden], .ocr-dialog [data-ocr=retry][hidden], .ocr-dialog [data-ocr=screen][hidden], .ocr-dialog [data-ocr=screen-upload-wrap][hidden], .ocr-ink-wrap[hidden], .ocr-dialog video[hidden], .ocr-dialog [data-ocr=htr-consent-wrap][hidden] { display: none; }
.ocr-dialog [data-ocr=screen-upload-label] { display: inline-flex; align-items: center; justify-content: center; position: relative; cursor: pointer; min-height: 44px; min-width: 44px; }
.ocr-dialog [data-ocr=screen-upload] { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.ocr-source { min-width: 0; max-height: 56dvh; overflow: auto; border: 1px solid var(--line, #d7dfd7); border-radius: 12px; }
.ocr-source:empty { min-height: 160px; background: #f4f6f2; }
.ocr-source img { display: block; width: 100%; height: auto; }
.ocr-source[data-ocr-zoom="150"] img { width: 150%; max-width: none; }
.ocr-source[data-ocr-zoom="200"] img { width: 200%; max-width: none; }
.ocr-source[data-ocr-zoom="300"] img { width: 300%; max-width: none; }
.ocr-source:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.ocr-source p { padding: 10px; margin: 0; overflow-wrap: anywhere; }
.ocr-dialog textarea { width: 100%; min-height: 280px; unicode-bidi: plaintext; text-align: start; }
.ocr-dialog video { width: min(100%, 640px); max-height: 40dvh; object-fit: contain; background: #1a2420; }
.ocr-ink-wrap { margin-block: 12px 4px; }
.ocr-ink-wrap canvas { display: block; width: 100%; height: min(36dvh, 280px); touch-action: none; background: #f4efe4; border: 1px solid var(--line, #d7dfd7); border-radius: 14px; cursor: crosshair; }
.ocr-ink-wrap button { margin-block-start: 10px; margin-inline-end: 8px; }
.ocr-dialog [data-ocr=status] { min-height: 1.6em; }
.ocr-dialog > button { margin-inline-end: 8px; margin-block-end: 8px; }
.ocr-dialog .checkbox { display: flex; align-items: start; margin-block: 16px; }
@media(max-width: 640px) { .ocr-panels { grid-template-columns: 1fr; } .ocr-source { max-height: 32dvh; } .ocr-dialog textarea { min-height: 220px; } }
