.region-editor-backdrop { position: fixed; inset: 0; z-index: 1000; overflow: auto; padding: 24px; background: #152c27b8; overscroll-behavior: contain; }
.region-editor { max-width: 1100px; margin: 0 auto; padding: 24px; border-radius: 16px; border: 1px solid #cddbd3; background: #fff; color: #243b39; box-shadow: 0 16px 60px #0004; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; line-height: 1.5; }
.region-editor *, .region-editor { box-sizing: border-box; }
.region-editor-title { margin: 0 0 12px; font-size: 22px; }
.region-editor-hint, .region-editor-units { margin: 8px 0 16px; color: #526861; font-size: 14px; }
.region-editor-viewport { max-height: 55vh; max-height: 55dvh; overflow: auto; border: 1px solid #a9bdb2; border-radius: 8px; background: #edf1ed; overscroll-behavior: contain; }
.region-editor-canvas { display: block; width: 100%; height: auto; cursor: crosshair; touch-action: none; user-select: none; -webkit-user-select: none; }
.region-editor-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 20px 0 12px; }
.region-editor-field { min-width: 0; }
.region-editor-label { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; font-weight: 650; }
.region-editor-coordinate { width: 100%; min-height: 44px; border: 1px solid #92ac9f; border-radius: 8px; padding: 8px 10px; background: #fff; color: inherit; font: inherit; }
.region-editor-coordinate[aria-invalid='true'] { border-color: #a13314; }
.region-editor-nudges { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.region-editor-button { min-height: 44px; padding: 8px 10px; border: 1px solid #aebfb5; border-radius: 8px; background: #fff; color: inherit; font: inherit; font-size: 14px; cursor: pointer; touch-action: manipulation; }
.region-editor-button:hover { background: #edf5ef; }
.region-editor-button:focus-visible, .region-editor-coordinate:focus-visible { outline: 3px solid #81b5ef; outline-offset: 2px; }
.region-editor-status { margin: 12px 0; min-height: 1.5em; font-size: 14px; overflow-wrap: anywhere; }
.region-editor-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.region-editor-actions > :first-child { margin-right: auto; }
.region-editor-apply { background: #236653; border-color: #236653; color: #fff; font-weight: 650; }
.region-editor-apply:hover { background: #174c3d; }
@media (max-width: 650px) {
  .region-editor-backdrop { padding: 10px; }
  .region-editor { padding: 16px; }
  .region-editor-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .region-editor-title { font-size: 19px; }
  .region-editor-viewport { max-height: 42vh; max-height: 42dvh; }
  .region-editor-actions .region-editor-button { flex: 1 1 auto; }
}

/* RTL affects interface text, never the source document or crop coordinates. */
html[dir=rtl] body{text-align:start}input[type=number],input[type=email],input[type=password],canvas,.region-editor-view,.region-editor-stage{direction:ltr}input[type=text],textarea{unicode-bidi:plaintext}button,a,label,p,summary{overflow-wrap:anywhere}select{max-width:100%}html[dir=rtl] .region-editor-controls{direction:rtl}
