.gd-ocr {
  --ocr-ink: #20334b;
  --ocr-muted: #526479;
  --ocr-line: #d5e1ec;
  --ocr-blue: #285b87;
  --ocr-tint: #edf5fc;
  color: var(--ocr-ink);
}
.gd-ocr *, .gd-ocr *::before, .gd-ocr *::after { box-sizing: border-box; }
.gd-ocr [hidden] { display: none !important; }
.gd-ocr .gd-tools-directory-header { padding-block: clamp(14px, 2.5vw, 23px); }
.gd-ocr-workbench { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 14px; }
.gd-ocr-card { min-width: 0; background: #fff; border: 1px solid var(--ocr-line); border-radius: 12px; padding: clamp(12px, 2.2vw, 19px); }
.gd-ocr-card h2 { font-size: clamp(18px, 2.4vw, 24px); line-height: 1.35; }
.gd-ocr-bar, .gd-ocr-actions, .gd-ocr-settings { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; }
.gd-ocr-bar { margin-bottom: 8px; }
.gd-ocr button { min-height: 40px; padding: 5px 10px; border: 1px solid #a4b8cc; border-radius: 7px; background: #fff; color: var(--ocr-blue); font: inherit; font-weight: 700; cursor: pointer; }
.gd-ocr button:hover:not(:disabled) { background: var(--ocr-tint); }
.gd-ocr button.gd-ocr-primary { background: var(--ocr-blue); color: #fff; border-color: var(--ocr-blue); }
.gd-ocr button.gd-ocr-primary:hover:not(:disabled) { background: #1e4b73; }
.gd-ocr button:disabled { opacity: .52; cursor: default; }
.gd-ocr :is(button, select, input, textarea, summary):focus-visible { outline: 2px solid var(--ocr-blue); outline-offset: 2px; }
.gd-ocr-drop { padding: 12px; background: var(--ocr-tint); border: 1px dashed #acbfd2; border-radius: 8px; text-align: center; }
.gd-ocr-drop p { margin-top: 4px; font-size: 13px; color: var(--ocr-muted); }
.gd-ocr .gd-ocr-help { color: var(--ocr-muted); font-size: 13px; line-height: 1.5; margin: 5px 0; }
.gd-ocr .gd-ocr-error { margin: 6px 0; padding: 7px 8px; color: #923a2d; background: #fff0eb; border-radius: 6px; overflow-wrap: anywhere; }
.gd-ocr-image-head { margin: 10px 0 5px; }
.gd-ocr-image-head p { overflow-wrap: anywhere; }
.gd-ocr-modes { display: flex; flex-wrap: wrap; gap: 5px 10px; min-width: 0; border: 0; padding: 0; margin: 0 0 6px; }
.gd-ocr-modes legend { margin-bottom: 4px; font-weight: 700; font-size: 14px; }
.gd-ocr-modes label, .gd-ocr-small { display: flex; align-items: center; gap: 6px; min-height: 38px; cursor: pointer; color: var(--ocr-ink); }
.gd-ocr-modes label { padding: 0 7px; background: #f2f5f9; border-radius: 6px; }
.gd-ocr :is([type=checkbox], [type=radio]) { appearance: auto; accent-color: var(--ocr-blue); width: 17px; height: 17px; }
.gd-ocr-preview { width: max-content; max-width: 100%; position: relative; overflow: hidden; border-radius: 6px; background: #1e2834; }
.gd-ocr-preview[data-selectable] { cursor: crosshair; touch-action: none; user-select: none; }
.gd-ocr-preview img { display: block; width: auto; height: auto; max-width: 100%; max-height: 390px; pointer-events: none; }
.gd-ocr-box { position: absolute; border: 2px solid #ffdb54; box-shadow: 0 0 0 2000px #0c162f81; pointer-events: none; }
.gd-ocr-range { margin: 7px 0; }
.gd-ocr-range details { margin-bottom: 6px; }
.gd-ocr-range summary { color: var(--ocr-blue); cursor: pointer; padding: 5px 0; }
.gd-ocr-range details div { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; margin: 5px 0; }
.gd-ocr-range details label { font-size: 12px; }
.gd-ocr :is(input[type=number], textarea, select) { min-width: 0; max-width: 100%; padding: 6px 7px; border: 1px solid #a5b9cb; border-radius: 6px; background: #fff; color: var(--ocr-ink); font: inherit; font-size: 16px; }
.gd-ocr-range input { display: block; width: 100%; }
.gd-ocr-settings { margin-top: 10px; }
.gd-ocr-settings label { font-size: 14px; }
.gd-ocr-settings select { display: block; }
.gd-ocr-actions { justify-content: flex-start; margin-top: 8px; }
.gd-ocr-output { border-top: 4px solid var(--ocr-blue); }
.gd-ocr .gd-ocr-status { background: var(--ocr-tint); color: #244d73; padding: 8px 10px; border-radius: 6px; }
.gd-ocr-result { margin-top: 10px; border: 1px solid var(--ocr-line); border-radius: 8px; padding: 8px; }
.gd-ocr-result h3 { margin: 0 0 6px; font-size: 15px; overflow-wrap: anywhere; }
.gd-ocr-result canvas { max-width: 100%; height: auto; display: block; border-radius: 4px; }
.gd-ocr-result textarea { display: block; width: 100%; resize: vertical; margin: 7px 0; }
.gd-ocr-result .gd-ocr-bar { margin-bottom: 0; }
.gd-ocr-copy-fallback { position: fixed; top: 0; left: 0; width: 1px; height: 1px; opacity: 0; }
@media (max-width: 730px) {
  .gd-ocr-workbench { grid-template-columns: minmax(0, 1fr); }
}

.gd-ocr-anchor { position: absolute; width: 12px; height: 12px; transform: translate(-50%, -50%); border: 2px solid #15243b; border-radius: 50%; background: #ffdb54; pointer-events: none; }
