.ocr-preview-banner { padding: 16px 20px; color: #143c28; background: #eef8f1; border-bottom: 1px solid #bdd9c6; font: 14px/1.6 system-ui, sans-serif; }
.ocr-preview-banner strong { display: block; font-size: 17px; }
.ocr-preview-banner a { color: #185d36; text-decoration: underline; }
.ocr-panel { --ocr-green: #156b3c; margin-top: 8px; color: #22392d; font: inherit; text-align: left; }
.ocr-panel *, .ocr-panel *::before, .ocr-panel *::after { box-sizing: border-box; }
.ocr-panel [hidden] { display: none !important; }
.ocr-panel h3 { margin: 0; color: #164b2d; font-size: inherit; font-weight: 700; line-height: inherit; }
.ocr-panel p { margin: 8px 0; padding: 0; }
.ocr-heading { margin-bottom: 6px; }
.ocr-upload-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 680px; gap: 6px; }
.ocr-panel button { cursor: pointer; font-family: inherit; font-size: inherit; }
.ocr-panel button:focus-visible, .ocr-panel a:focus-visible, .ocr-panel input:focus-visible, .ocr-panel select:focus-visible { outline: 3px solid #e29724; outline-offset: 3px; }
.ocr-panel button:disabled { cursor: not-allowed; opacity: .55; }
.ocr-upload { display: flex; align-items: center; justify-content: flex-start; gap: 10px; min-height: 64px; padding: 12px 16px; border: 0; border-radius: 10px; text-align: left; box-shadow: 0 3px 10px #184f2515; transition: transform .15s, box-shadow .15s; }
.ocr-upload:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 9px 24px #184f2530; }
.ocr-upload-file { background: linear-gradient(125deg, #176b3e, #0d5030); color: white; }
.ocr-upload-camera { background: linear-gradient(125deg, #fff4dd, #ffe7b7); color: #67430a; border: 1px solid #efd099; }
.ocr-upload svg { flex: none; width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ocr-upload strong { display: block; font-size: inherit; font-weight: 600; line-height: 1.35; }
.ocr-upload small { display: block; margin-top: 2px; font-size: .9em; opacity: .9; }
.ocr-panel .ocr-formats { margin: 6px 0 0; color: #596c5f; font-size: .9em; }
.ocr-demo { margin: 18px 0; padding: 14px; border: 1px dashed #92abc6; border-radius: 12px; color: #345775; background: #f4f8fc; font-size: 12px; }
.ocr-demo strong { font-size: 11px; letter-spacing: .4px; }
.ocr-demo-actions, .ocr-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.ocr-toolbar button, .ocr-demo-actions button, .ocr-secondary { min-height: 42px; padding: 9px 13px; border: 1px solid #c7d6cc; border-radius: 9px; background: #fff; color: #234e34; font: inherit; font-weight: 600; }
.ocr-demo-actions button { min-height: 38px; font-size: 12px; border-color: #c5d5e4; color: #345775; }
.ocr-primary { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 12px 18px; border: 0; border-radius: 10px; background: var(--ocr-green); color: white; font: inherit; font-weight: 700; }
.ocr-toolbar .ocr-primary { background: var(--ocr-green); color: #fff; border-color: var(--ocr-green); }
.ocr-status { margin-top: 14px; padding: 12px 15px; border: 1px solid #c0dccb; border-radius: 10px; background: #eef8f1; color: #1b5c35; }
.ocr-error { margin: 16px 0; padding: 16px; border: 1px solid #edc5b2; border-radius: 12px; color: #873c23; background: #fff5ef; }
.ocr-error ul { padding-left: 20px; margin: 10px 0; list-style: disc; }
.ocr-error li + li { margin-top: 7px; }
.ocr-document { margin-top: 20px; border: 1px solid #d7e1d9; border-radius: 15px; overflow: hidden; background: #fff; }
.ocr-document, .ocr-error { scroll-margin-top: 16px; }
.ocr-document:focus { outline: 2px solid var(--ocr-green); outline-offset: 2px; }
.ocr-file-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; background: #f4f7f4; border-bottom: 1px solid #dce5de; }
.ocr-file-heading strong { display: block; overflow-wrap: anywhere; }
.ocr-file-heading small { display: block; margin-top: 3px; color: #64756a; }
.ocr-link-button { padding: 5px; background: none; border: 0; color: #945033; font: inherit; text-decoration: underline; flex-shrink: 0; }
.ocr-document-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 16px; padding: 12px; }
.ocr-document-tools { min-width: 0; overflow-wrap: anywhere; }
.ocr-page-actions { display: grid; grid-template-columns: 1fr; gap: 6px; margin: 0; }
.ocr-page-actions button { min-width: 0; }
.ocr-paper { display: flex; align-items: center; justify-content: center; min-height: 150px; padding: 12px; border: 1px solid #dce3de; border-radius: 10px; background: #e9eeeb; }
.ocr-paper canvas { display: block; max-width: 100%; width: auto; max-height: 360px; height: auto; background: white; box-shadow: 0 3px 10px #173c2820; }
.ocr-document-tools > .ocr-primary, .ocr-document-tools > .ocr-secondary { width: 100%; margin-bottom: 8px; }
.ocr-document-tools > button:last-child { margin-bottom: 0; }
.ocr-document-tools .ocr-confirm { margin: 12px 0; font-size: 12px; font-weight: 400; }
.ocr-page-select { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; }
.ocr-page-select select { min-width: 0; max-width: 100%; }
.ocr-panel select { padding: 7px 10px; border: 1px solid #bdcec2; border-radius: 7px; background: white; color: #234e34; }
.ocr-confirm { display: flex; align-items: flex-start; gap: 10px; margin: 18px 0 14px; font-weight: 650; cursor: pointer; }
.ocr-confirm input { flex: none; width: 19px; height: 19px; margin-top: 2px; accent-color: var(--ocr-green); }
.ocr-dialog { width: min(700px, calc(100vw - 24px)); max-height: calc(100dvh - 30px); margin: auto; padding: 22px; border: 1px solid #cedad1; border-radius: 16px; background: #fff; color: #263d30; overflow: auto; }
.ocr-dialog::backdrop { background: #132d21ad; }
.ocr-dialog h3 { font-size: 20px; }
.ocr-crop-stage { display: flex; justify-content: center; margin: 14px 0; padding: 10px; background: #edf1ee; border-radius: 8px; }
.ocr-crop-stage canvas { max-width: 100%; max-height: 42vh; height: auto; width: auto; touch-action: none; cursor: crosshair; }
.ocr-crop-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.ocr-crop-fields label { display: flex; flex-direction: column; font-size: 12px; gap: 4px; }
.ocr-crop-fields input { width: 100%; padding: 8px; border: 1px solid #bdcec2; border-radius: 6px; color: #234e34; background: #fff; }
.ocr-crop-error { color: #9c3920; }
textarea.ocr-text-highlight { outline: 3px solid #86bc95; outline-offset: 2px; }
.ocr-preview-inactive { opacity: .72; }
@media (min-width: 900px) and (pointer: fine) { .ocr-upload-camera { display: none; } .ocr-upload-actions { grid-template-columns: minmax(0, 340px); } }
@media (max-width: 639px) {
  .ocr-preview-banner { padding: 12px 16px; font-size: 12px; }
  .ocr-preview-banner strong { font-size: 14px; }
  .ocr-upload-actions { gap: 8px; }
  .ocr-upload { flex-direction: row; justify-content: center; gap: 5px; min-width: 0; min-height: 44px; padding: 5px 6px; border-radius: 8px; text-align: center; font: inherit; box-shadow: 0 2px 5px #184f2510; }
  .ocr-upload svg { width: 16px; height: 16px; }
  .ocr-upload > span { min-width: 0; max-width: 100%; }
  .ocr-upload-camera > span { width: min-content; }
  .ocr-upload strong { font: inherit; }
  .ocr-upload small { display: none; }
  .ocr-file-heading { align-items: flex-start; flex-direction: column; }
  .ocr-file-heading { padding: 8px; gap: 4px; font-size: 12px; }
  .ocr-paper { min-height: 0; padding: 4px; }
  .ocr-paper canvas { max-height: 300px; }
  .ocr-document-layout { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 8px; padding: 8px; }
  .ocr-document-tools button { min-height: 44px; padding: 8px 6px; line-height: 1.35; }
  .ocr-document-tools .ocr-confirm { gap: 6px; margin: 8px 0; line-height: 1.4; }
  .ocr-crop-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ocr-dialog { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) { .ocr-upload { transition: none; } .ocr-upload:hover:not(:disabled) { transform: none; } }
