.ocr-preview {
  background: #ffffff;
}

.ocr-dropzone.is-dragging {
  border-color: rgba(37, 99, 235, 0.75);
  background: #eef5ff;
  box-shadow: inset 0 0 0 2px rgba(37, 99, 235, 0.14);
}

.ocr-engine-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 5px;
}

.ocr-engine-toggle button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 900;
}

.ocr-engine-toggle button.active {
  background: #ffffff;
  color: var(--text);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
}

.ocr-output {
  align-items: stretch;
  min-height: 340px;
}

.ocr-output textarea {
  width: 100%;
  height: 300px;
  min-height: 300px;
  resize: none;
  border: 0;
  outline: 0;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.65;
}

.video-gif-layout.image-editor-layout {
  grid-template-columns: minmax(460px, 1fr) minmax(280px, 340px);
}

.image-editor-canvas-shell {
  display: grid;
  min-height: 420px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(45deg, #e2e8f0 25%, transparent 25%),
    linear-gradient(-45deg, #e2e8f0 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e2e8f0 75%),
    linear-gradient(-45deg, transparent 75%, #e2e8f0 75%);
  background-color: #f8fafc;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
}

.image-editor-preview-frame {
  position: relative;
  display: grid;
  max-width: 100%;
  max-height: 640px;
}

.image-editor-canvas-shell canvas {
  grid-area: 1 / 1;
  display: block;
  max-width: 100%;
  max-height: 640px;
  cursor: crosshair;
  object-fit: contain;
  touch-action: none;
  user-select: none;
}

.image-editor-canvas-shell canvas.is-dragging-overlay {
  cursor: grabbing;
}

.image-editor-canvas-shell canvas.is-move {
  cursor: move;
}

.image-editor-canvas-shell canvas.is-resize-nw,
.image-editor-canvas-shell canvas.is-resize-se {
  cursor: nwse-resize;
}

.image-editor-canvas-shell canvas.is-resize-ne,
.image-editor-canvas-shell canvas.is-resize-sw {
  cursor: nesw-resize;
}

.image-editor-selection-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.image-editor-selection-layer rect {
  fill: rgba(37, 99, 235, 0.08);
  stroke: #2563eb;
  stroke-dasharray: 2 1.2;
  stroke-width: 0.45;
  vector-effect: non-scaling-stroke;
}

.image-editor-selection-layer circle {
  fill: #ffffff;
  stroke: #2563eb;
  stroke-width: 0.45;
  vector-effect: non-scaling-stroke;
}

.image-editor-selection-layer .is-hovered rect {
  fill: rgba(15, 23, 42, 0.05);
  stroke: #0f172a;
}

.image-editor-selection-layer .is-hovered circle {
  stroke: #0f172a;
}

.image-editor-selection-layer .is-crop rect {
  fill: rgba(15, 23, 42, 0.04);
  stroke: #16a34a;
  stroke-dasharray: 3 1.4;
}

.image-editor-selection-layer .is-crop circle {
  stroke: #16a34a;
}

.image-editor-upload.is-dragging .video-gif-dropzone {
  border-color: rgba(37, 99, 235, 0.75);
  background: #eef5ff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.image-editor-controls {
  align-content: start;
}

.image-editor-format {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.image-editor-tabs {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.image-editor-button-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.image-editor-slider-grid {
  display: grid;
  gap: 12px;
}

.image-editor-slider-grid label {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 48px;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.image-editor-slider-grid input[type="range"] {
  width: 100%;
  accent-color: var(--blue);
}

.image-editor-slider-grid b {
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
  text-align: right;
}

.image-editor-overlay-controls {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.image-editor-overlay-controls.is-active {
  border-color: rgba(37, 99, 235, 0.55);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.image-editor-overlay-controls header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.image-editor-overlay-controls textarea {
  min-height: 72px;
}

.image-editor-overlay-select {
  display: inline-grid;
  width: 32px;
  min-height: 30px;
  place-items: center;
  padding: 0;
  font-size: 12px;
}

.image-editor-layer-toolbar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.image-editor-layer-toolbar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.image-editor-layer-panel {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.image-editor-layer-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.image-editor-layer-panel header span {
  color: var(--muted);
  font-size: 12px;
}

.image-editor-layer-list {
  display: grid;
  max-height: 210px;
  gap: 8px;
  overflow: auto;
}

.image-editor-layer-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  padding: 8px;
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.image-editor-layer-item:hover,
.image-editor-layer-item.is-hovered {
  border-color: rgba(15, 23, 42, 0.32);
  background: #f8fafc;
}

.image-editor-layer-item.is-active {
  border-color: rgba(37, 99, 235, 0.68);
  background: #eff6ff;
  box-shadow: inset 3px 0 0 #2563eb;
}

.image-editor-layer-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 8px;
  background: #eef2ff;
  color: #2563eb;
}

.image-editor-layer-item span:last-child {
  min-width: 0;
}

.image-editor-layer-item strong,
.image-editor-layer-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-editor-layer-item strong {
  font-size: 13px;
  font-weight: 900;
}

.image-editor-layer-item small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.image-editor-layer-actions {
  display: inline-flex;
  gap: 6px;
}

.image-editor-layer-empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 14px;
  text-align: center;
  font-size: 12px;
  font-weight: 850;
}

@media (max-width: 760px) {
  .image-editor-layout,
  .image-editor-button-row,
  .image-editor-slider-grid label {
    grid-template-columns: 1fr;
  }

  .image-editor-canvas-shell {
    min-height: 260px;
  }

  .image-editor-slider-grid label {
    gap: 6px;
  }

  .image-editor-slider-grid b {
    text-align: left;
  }
}
