/* Scoped customer OCR workspace: compact, aligned, native theme variables. */
.customer-ocr-modal-open { overflow: hidden; }
.customer-ocr-entry .card-header { padding-block: 12px; }
.customer-ocr-json > summary { padding: 9px 18px; color: var(--muted); font-size: 12px; cursor: pointer; }
.customer-ocr-json[open] > summary { border-bottom: 1px solid var(--line); }
.customer-ocr-backdrop {
  position: fixed; inset: 0; z-index: 10050; display: grid; place-items: center;
  padding: 20px; background: rgb(3 7 12 / 76%);
}
.customer-ocr-dialog {
  width: min(1080px, 100%); max-height: calc(100dvh - 40px); display: flex; flex-direction: column;
  min-width: 0; overflow: hidden; color: var(--text); background: var(--panel);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 24px 80px rgb(0 0 0 / 40%);
}
.customer-ocr-header, .customer-ocr-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; flex-shrink: 0; }
.customer-ocr-header { border-bottom: 1px solid var(--line); }
.customer-ocr-header h2 { margin: 0; font-size: 20px; letter-spacing: .03em; }
.customer-ocr-header p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.customer-ocr-columns { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 24px; padding: 18px 20px; overflow: auto; min-height: 0; }
.customer-ocr-source, .customer-ocr-result { min-width: 0; }
.customer-ocr-file-label, .customer-ocr-result > label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 600; }
.customer-ocr-result > label > span { font-size: 11px; font-weight: 400; color: var(--muted); margin-left: 5px; }
.customer-ocr-dialog .input, .customer-ocr-dialog .select { min-height: 38px; height: 38px; padding: 7px 10px; font-size: 13px; width: 100%; }
.customer-ocr-dialog input[type="file"] { font-size: 12px; padding: 5px; }
.customer-ocr-dialog input[type="file"]::file-selector-button { border: 0; border-radius: 4px; padding: 4px 9px; margin-right: 8px; color: var(--text); background: var(--soft); font: inherit; cursor: pointer; }
.customer-ocr-photo { margin-top: 10px; height: 245px; position: relative; display: grid; place-items: center; overflow: hidden; border: 1px dashed var(--line); border-radius: 7px; background: var(--bg); color: var(--muted); font-size: 12px; }
.customer-ocr-photo.is-dragging { border-color: var(--blue); background: var(--soft); }
.customer-ocr-photo img { display: block; position: absolute; left: 50%; top: 50%; max-width: none; max-height: none; object-fit: contain; transform-origin: center; }
.customer-ocr-dialog [hidden] { display: none !important; }
.customer-ocr-file-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 7px; font-size: 11px; color: var(--muted); }
.customer-ocr-file-meta > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.customer-ocr-text-button { flex-shrink: 0; padding: 0; border: 0; color: var(--blue); background: none; font-size: 11px; cursor: pointer; }
.customer-ocr-anglebar { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.customer-ocr-anglebar > label { display: grid; gap: 4px; margin: 0; font-size: 12px; color: var(--muted); min-width: 0; }
.customer-ocr-anglebar > label:first-child { flex: 1 1 125px; }
.customer-ocr-anglebar > label:nth-child(2) { flex: 0 0 86px; }
.customer-ocr-angle-actions { display: flex; gap: 4px; }
.customer-ocr-anglebar .btn { min-height: 38px; height: 38px; padding: 6px 8px; font-size: 12px; white-space: nowrap; }
.customer-ocr-runbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.customer-ocr-runbar .btn { min-height: 38px; padding: 8px 12px; font-size: 12px; }
.customer-ocr-runbar .customer-ocr-sub { margin: 0; }
.customer-ocr-progress { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; margin-top: 14px; }
.customer-ocr-progress progress { height: 7px; width: 100%; border: 0; border-radius: 9px; overflow: hidden; accent-color: var(--blue); background: var(--soft); }
.customer-ocr-progress progress::-webkit-progress-bar { background: var(--soft); }
.customer-ocr-progress progress::-webkit-progress-value { background: var(--blue); }
.customer-ocr-progress > span { min-width: 60px; text-align: right; font: 12px ui-monospace, monospace; color: var(--muted); font-variant-numeric: tabular-nums; }
.customer-ocr-status { font-size: 12px; line-height: 1.65; margin: 9px 0 0; overflow-wrap: anywhere; }
.customer-ocr-status[data-tone="success"] { color: var(--green); }
.customer-ocr-status[data-tone="warning"] { color: var(--amber); }
.customer-ocr-sub { color: var(--muted); font-size: 11px; line-height: 1.55; margin: 5px 0 0; }
.customer-ocr-result #ocr-raw-text { min-height: 155px; height: 155px; max-height: 300px; width: 100%; padding: 10px 12px; font-size: 13px; line-height: 1.6; resize: vertical; }
.customer-ocr-field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 12px; margin-top: 12px; }
.customer-ocr-field-grid > label { display: grid; gap: 4px; min-width: 0; margin: 0; font-size: 12px; color: var(--muted); }
.customer-ocr-field-grid .customer-ocr-wide { grid-column: 1 / -1; }
.customer-ocr-warnings { color: var(--amber); font-size: 11px; line-height: 1.6; margin: 10px 0 0; padding-left: 18px; }
.customer-ocr-footer { border-top: 1px solid var(--line); background: var(--panel-2); }
.customer-ocr-footer .checkbox-row { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; font-size: 12px; }
.customer-ocr-footer .checkbox-row span { font-size: 11px; color: var(--muted); }
.customer-ocr-footer .btn { white-space: nowrap; min-height: 38px; padding: 8px 18px; font-size: 13px; }
.customer-ocr-dialog :focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.customer-ocr-dialog button:disabled { opacity: .5; cursor: not-allowed; }
@media (max-width: 760px) {
  .customer-ocr-backdrop { padding: 8px; }
  .customer-ocr-dialog { max-height: calc(100dvh - 16px); border-radius: 8px; }
  .customer-ocr-header, .customer-ocr-footer { padding: 12px; }
  .customer-ocr-header h2 { font-size: 17px; }
  .customer-ocr-columns { grid-template-columns: minmax(0, 1fr); gap: 18px; padding: 12px; }
  .customer-ocr-photo { height: 170px; }
  .customer-ocr-footer { align-items: flex-end; gap: 10px; }
  .customer-ocr-footer .checkbox-row span { flex-basis: 100%; }
}
