.image-editor-container {
  width: 100%;
  max-width: 92rem;
}

.image-editor-workspace {
  display: grid;
  gap: 1rem;
}

.image-editor-header {
  display: flex;
  padding: 1rem 1.1rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border: 1px solid rgba(55, 71, 82, 0.2);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 10px 28px rgba(35, 48, 57, 0.16);
}

.image-editor-header h1,
.image-editor-gate h1 {
  margin: 0.2rem 0 0.3rem;
  color: #263c49;
  font-size: clamp(1.35rem, 3vw, 1.8rem);
}

.image-editor-header p:not(.storage-kicker),
.image-editor-gate p,
.image-editor-section-heading p {
  margin: 0;
  color: #5f707b;
}

.image-editor-header-actions,
.image-transform-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.image-editor-layout {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) minmax(17rem, 22rem);
  align-items: start;
  gap: 1rem;
}

.image-preview-card,
.image-tool-card {
  padding: 1rem;
}

.image-preview-card {
  min-width: 0;
}

.image-editor-section-heading {
  display: flex;
  margin-bottom: 0.85rem;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.image-editor-section-heading h2 {
  margin: 0 0 0.2rem;
  color: #2d4553;
  font-size: 1.05rem;
}

.image-editor-section-heading p {
  font-size: 0.8rem;
}

.image-output-summary {
  flex: 0 0 auto;
  padding: 0.35rem 0.6rem;
  border: 1px solid #c8d5db;
  border-radius: 999px;
  background: #f3f7f9;
  color: #476172;
  font-size: 0.74rem;
  font-weight: 700;
}

.image-editor-stage {
  display: grid;
  min-height: 31rem;
  padding: 1rem;
  place-items: center;
  overflow: auto;
  border: 1px solid #cbd6dc;
  border-radius: 12px;
  background-color: #dfe7ea;
  background-image:
    linear-gradient(45deg, rgba(255, 255, 255, 0.45) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, 0.45) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.45) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.45) 75%);
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
}

#editor-canvas {
  display: block;
  max-width: 100%;
  max-height: 38rem;
  border-radius: 4px;
  box-shadow: 0 6px 24px rgba(28, 42, 50, 0.28);
  cursor: crosshair;
  touch-action: none;
}

#editor-canvas.is-moving-crop {
  cursor: move;
}

.image-transform-actions {
  margin-top: 0.8rem;
}

.image-transform-actions .storage-button {
  min-height: 2.25rem;
  padding: 0.45rem 0.7rem;
  font-size: 0.78rem;
}

.image-editor-tools {
  display: grid;
  gap: 0.8rem;
}

.image-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.image-editor-field,
.image-range-field {
  display: grid;
  min-width: 0;
  gap: 0.3rem;
  color: #465d6a;
  font-size: 0.78rem;
  font-weight: 700;
}

.image-editor-field-wide {
  margin-bottom: 0.7rem;
}

.image-editor-field .form-control {
  height: 2.25rem;
  padding: 0.4rem 0.55rem;
  font-size: 0.82rem;
}

.image-input-unit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.35rem;
}

.image-input-unit > span {
  color: #6b7d87;
  font-size: 0.72rem;
  font-weight: 600;
}

.image-checkbox-field {
  display: flex;
  margin-top: 0.7rem;
  align-items: center;
  gap: 0.45rem;
  color: #516875;
  font-size: 0.78rem;
  font-weight: 600;
}

.image-checkbox-field input {
  width: 1rem;
  height: 1rem;
}

.image-range-field {
  margin-top: 0.65rem;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.image-range-field output {
  min-width: 3.1rem;
  color: #314b5a;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.image-range-field input[type="range"] {
  width: 100%;
  grid-column: 1 / -1;
  accent-color: #4c7389;
}

.image-save-note {
  margin: 0.75rem 0 0;
  color: #687b86;
  font-size: 0.75rem;
  line-height: 1.45;
}

.image-editor-gate {
  display: flex;
  max-width: 46rem;
  margin: 2rem auto;
  padding: 1.2rem;
  align-items: center;
  gap: 1rem;
}

.image-editor-gate[hidden] {
  display: none;
}

.image-editor-gate-icon {
  width: 4rem;
  height: 4rem;
  flex: 0 0 auto;
  border: 2px solid #b8cbd4;
  border-radius: 12px;
  background:
    linear-gradient(135deg, transparent 48%, #7898a8 49% 53%, transparent 54%),
    linear-gradient(35deg, #dcebef 42%, #98bdc7 43% 62%, #f0cf7b 63%);
  box-shadow: inset 0 0 0 5px #f8fbfc;
}

@media (max-width: 960px) {
  .image-editor-layout {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 680px) {
  .image-editor-header,
  .image-editor-gate {
    align-items: stretch;
    flex-direction: column;
  }

  .image-editor-header-actions .storage-button {
    flex: 1 1 9rem;
  }

  .image-editor-tools {
    grid-template-columns: 1fr;
  }

  .image-editor-stage {
    min-height: 20rem;
    padding: 0.55rem;
  }

  .image-transform-actions .storage-button {
    flex: 1 1 8rem;
  }
}
