.rm-ocr-capture-overlay {
  position: fixed;
  inset: 0;
  z-index: 32000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 8px;
  background: rgba(15, 23, 42, .82);
  font-family: Arial, sans-serif;
}

.rm-ocr-capture-overlay.show { display: flex; }

.rm-ocr-capture-dialog {
  width: calc(100vw - 16px);
  max-width: none;
  max-height: calc(100vh - 16px);
  overflow: auto;
  padding: 18px;
  border: 1px solid #cbd5e1;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 28px 90px rgba(0, 0, 0, .45);
}

.rm-ocr-capture-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

.rm-ocr-capture-head h2 { margin: 0 0 5px; color: #172a46; font-size: 21px; }
.rm-ocr-capture-head p { margin: 0; color: #64748b; font-size: 13px; line-height: 1.45; }
.rm-ocr-capture-close { width: 36px; height: 36px; border: 0; border-radius: 9px; background: #edf2f7; color: #334155; font-size: 22px; font-weight: 900; cursor: pointer; }

.rm-ocr-capture-status {
  min-height: 20px;
  margin: 8px 0;
  color: #2b6cb0;
  font-size: 13px;
  font-weight: 800;
}

.rm-ocr-capture-stage {
  position: relative;
  display: flex;
  justify-content: flex-start;
  max-height: calc(100vh - 260px);
  overflow: auto;
  border: 1px solid #94a3b8;
  border-radius: 10px;
  background: #0f172a;
  touch-action: none;
}

.rm-ocr-capture-stage canvas {
  display: block;
  flex: 0 0 auto;
  max-width: none;
  height: auto;
  cursor: crosshair;
  user-select: none;
}

.rm-ocr-zoom-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.rm-ocr-zoom-actions .btn {
  width: auto;
  min-width: 42px;
  margin: 0;
  padding: 7px 10px;
  font-size: 12px;
}

.rm-ocr-capture-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.rm-ocr-capture-actions .btn { width: auto; margin: 0; }
.rm-ocr-capture-actions input[type=file] { display: none; }
.rm-ocr-capture-help { margin-top: 8px; color: #64748b; font-size: 12px; }
.rm-ocr-progress { height: 7px; margin-top: 8px; overflow: hidden; border-radius: 999px; background: #e2e8f0; }
.rm-ocr-progress > span { display: block; width: 0; height: 100%; background: #3182ce; transition: width .15s ease; }

html[data-theme="dark"] .rm-ocr-capture-dialog { background: #111827; border-color: #475569; }
html[data-theme="dark"] .rm-ocr-capture-head h2 { color: #f8fafc; }
html[data-theme="dark"] .rm-ocr-capture-head p,
html[data-theme="dark"] .rm-ocr-capture-help { color: #cbd5e1; }

@media (max-width: 720px) {
  .rm-ocr-capture-overlay { padding: 6px; }
  .rm-ocr-capture-dialog { width: calc(100vw - 12px); max-height: calc(100vh - 12px); padding: 12px; }
  .rm-ocr-capture-stage { max-height: calc(100vh - 290px); }
}
