/* =======================================================================
   画像エディタ（素材の クロップ / リサイズ / 回転 / 左右・上下反転 / 背景削除）の見た目
   — public/js/modules/image-editor-modal.js（window.DreamCoreImageEditorModal）と対になる CSS

   ## なぜ独立ファイルか（2026-09-28）
   founder「画像のクロップ、反転、回転もやらなきゃね」→ 案A「画像エディタを app.js から切り出して
   1つの部品にし、本番の Studio と v3 の机の両方から使う」。見た目も部品と一緒に持ち運べないと、
   style.css を読まない v3 では素の HTML になる。そこで /css/deferred-modals.css にあった
   画像エディタ専用の規則 188 個（2026-09-03 に style.css から機械分割されたもの）を**そのまま**ここへ移した。
   - 移した規則は本文も並び順も元のまま。変えたのは `var(--x)` に style.css :root の値を
     フォールバックとして添えたことだけ（`var(--red)` → `var(--red, #FF3B30)`）。Studio では変数が
     定義済みなのでフォールバックは効かず見た目は不変、v3 では変数が無くても同じ色・余白になる。
     `--radius-md` は style.css でも未定義（元から効いていない）なので、Studio と同じ結果になるよう添えていない。
   - Studio の読み込み順は「style.css → ルート CSS → deferred-modals.css → この CSS」。deferred の
     直後に置けば、移す前（deferred の中）と勝ち負けが一致することを、元 HTML の画像エディタの全要素 ×
     @media × :hover 等で計算して確認済み（差分 0・2026-09-28）。
   - 画像エディタの規則は今後ここに書く（deferred-modals.css / style.css には書かない —
     test/image-editor-modal.test.js が検査する）。

   ## 単独ページ用の土台（.dc-iem-standalone）
   Studio では .modal / .modal-content / .tool-btn / .primary-btn / .spinner / .hidden（style.css）や
   .apply-btn / .input-group / .ratio-shape / .tool-panel（css/routes/creator.css）など、クラス名が汎用で
   マーカー分割に乗らなかった規則が画像エディタの見た目の一部を持っている。これらは他画面でも同名クラスが
   使われ得るので**元の場所から動かしていない**。代わりに style.css を読まないページ（v3 の机）では、部品が
   ルート要素に .dc-iem-standalone を付け（image-editor-modal.js の isStandalonePage）、下の土台（写し）が効く。
   Studio では .dc-iem-standalone が付かないので 1 行も当たらない。
   - 写しの詳細度は元より 1 段上（`.dc-iem-standalone .x`）で、ファイル先頭に置くので、後ろの画像エディタ規則と
     同点なら順序で後ろが勝つ（Studio で style.css / ルート CSS が先に来るのと同じ関係）。
     「単独ページで組んだ時の勝ち負け == Studio」は全要素 × @media × :hover 等で計算して差分 0 を確認済み（2026-09-28）。
   - ページ側の CSS（v3 の button リセット等）に負けないよう、:where() で 0 詳細度にはしていない。
   ======================================================================= */

/* ---- 単独ページ用の土台（.dc-iem-standalone が付いた時だけ当たる。Studio では 1 行も当たらない） ----
   生成方法（2026-09-28）: 旧 editor.html の #imageEditorModal の全要素 × @media × :hover 等で、Studio で
   「style.css / css/routes/creator.css の規則が勝っている」宣言を列挙し、その規則だけを
   `.dc-iem-standalone` を前置して写した。変数（--gray-200 等）は style.css :root の値に解決済み
   （単独ページの変数と取り合わないため）。元の規則を変えたら、ここも同じ値に揃えること。
   継承で効く文字まわり（body の font-family / color / line-height）は計算に出ないので手で置く。 */
.dc-iem-standalone {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: #171717;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* style.css の @keyframes spin と同じ動き。名前を変えるのは、ページ側に別の spin があっても取り合わないため */
@keyframes dc-iem-spin {
  to { transform: rotate(360deg); }
}

/* ---- style.css の写し ---- */
.dc-iem-standalone,
.dc-iem-standalone * {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.hidden.dc-iem-standalone,
.dc-iem-standalone .hidden {
  display: none !important;
}

.dc-iem-standalone .modal-content {
  background: #FFFFFF;
  border-radius: 24px;
  width: 90%;
  max-width: 480px;
  max-height: 85vh;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.2);
  transform: scale(0.95) translateY(20px);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-reduced-motion: reduce) {
.dc-iem-standalone::after,
.dc-iem-standalone *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.modal.dc-iem-standalone {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

/* 詳細度を 1 段下げる（.modal.dc-iem-standalone → .dc-iem-standalone）: 3 クラスだと後ろの画像エディタ本来の
   .image-editor-modal .modal-header（余白 8px 10px）に勝ってしまい、v3 の机では上の帯の左右が 24px になって
   題名が「画像を…」と切れた（2026-09-28 実測）。同じ強さにすれば、ファイルの後ろにある本来の規則が勝つ */
.dc-iem-standalone .modal-header {
  padding: 24px;
  border-bottom: 1px solid #E5E5E5;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal.dc-iem-standalone .modal-close {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #F5F5F5;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #525252;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.dc-iem-standalone .tool-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 12px;
  background: #F5F5F5;
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 64px;
  flex-shrink: 0;
}

.dc-iem-standalone .tool-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.dc-iem-standalone .panel-title {
  font-weight: 600;
  margin-bottom: 12px;
  color: #404040;
}

.dc-iem-standalone .secondary-btn {
  padding: 12px 20px;
  background: #FFFFFF;
  border: 1.5px solid #D4D4D4;
  border-radius: 8px;
  color: #404040;
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dc-iem-standalone .secondary-btn:hover {
  background: #F5F5F5;
  border-color: #A3A3A3;
}

.dc-iem-standalone .secondary-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.dc-iem-standalone .primary-btn {
  padding: 12px 24px;
  background: #FF3B30;
  border: none;
  border-radius: 8px;
  color: #FFFFFF;
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

@media (max-width: 768px) {
.dc-iem-standalone .tool-btn {
    flex: 0 0 auto;
    min-width: 56px;
    padding: 8px 8px;
    background: transparent;
    border: none;
    border-radius: 0;
    color: #737373;
    transition: all 0.15s ease;
    position: relative;
  }

.dc-iem-standalone .tool-btn:disabled {
    opacity: 0.35;
  }

.dc-iem-standalone .tool-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: #FF3B30;
    transition: width 0.2s ease;
  }

.dc-iem-standalone .tool-btn:hover,
.dc-iem-standalone .tool-btn:active {
    background: #FAFAFA;
    color: #404040;
  }

.dc-iem-standalone .tool-btn svg {
    width: 24px;
    height: 24px;
    stroke-width: 1.5;
  }

.dc-iem-standalone .tool-btn span {
    font-size: 0.625rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    margin-top: 4px;
  }

.dc-iem-standalone .panel-title {
    color: var(--gray-800);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 12px;
    text-align: center;
    padding-top: 4px;
  }

.dc-iem-standalone .secondary-btn:hover {
    background: #E5E5E5;
  }

.dc-iem-standalone .secondary-btn:disabled {
    color: #A3A3A3;
    background: #FAFAFA;
  }

.dc-iem-standalone .primary-btn {
    padding: 10px 20px;
    background: #FF3B30;
    color: #FFFFFF;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
  }

.dc-iem-standalone .primary-btn:hover {
    transform: none;
    box-shadow: none;
    opacity: 0.9;
  }
}

.dc-iem-standalone .spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #E5E5E5;
  border-top-color: #FF3B30;
  border-radius: 50%;
  animation: dc-iem-spin 1s linear infinite;
}

/* ---- css/routes/creator.css の写し ---- */
@media (max-width: 768px) {
.dc-iem-standalone .canvas-wrapper {
    position: relative;
    display: inline-block;
    max-width: 100%;
    max-height: 100%;
  }

.dc-iem-standalone #editorCanvas {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
  }

.dc-iem-standalone .tool-panels {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    min-height: 0;
    pointer-events: none;
  }

.dc-iem-standalone .tool-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: #FFFFFF;
    border-radius: 16px 16px 0 0;
    padding: 16px;
    padding-bottom: calc(16px + var(--effective-safe-bottom, var(--page-safe-bottom, var(--safe-bottom, 0px))));
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    pointer-events: auto;
    max-height: 40vh;
    overflow-y: auto;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
  }

.dc-iem-standalone .tool-panel::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 3px;
    background: #D4D4D4;
    border-radius: 2px;
  }

.dc-iem-standalone .panel-desc {
    color: #737373;
    text-align: center;
    font-size: 0.8125rem;
    margin-bottom: 12px;
  }

.dc-iem-standalone .preset-ratios {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
    margin-bottom: 12px;
  }

.dc-iem-standalone .ratio-shape {
    border-width: 1.5px;
    transform: scale(0.85);
  }

.dc-iem-standalone .ratio-label {
    font-size: 0.5625rem;
  }

.dc-iem-standalone .ratio-label {
    font-size: 0.625rem;
  }

.dc-iem-standalone .crop-info {
    color: #737373;
    text-align: center;
    font-size: 0.8125rem;
  }

.dc-iem-standalone .resize-inputs {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 12px;
  }

.dc-iem-standalone .input-group {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #F5F5F5;
    border-radius: 10px;
    padding: 6px 10px;
  }

.dc-iem-standalone .input-group label {
    color: #737373;
    font-size: 0.6875rem;
    min-width: auto;
  }

.dc-iem-standalone .input-group input {
    width: 50px;
    padding: 4px;
    background: transparent;
    border: none;
    border-bottom: 1px solid #D4D4D4;
    color: var(--gray-800);
    font-size: 0.875rem;
    text-align: center;
  }

.dc-iem-standalone .input-group input:focus {
    border-bottom-color: #FF3B30;
    outline: none;
  }

.dc-iem-standalone .input-group span {
    color: #A3A3A3;
    font-size: 0.6875rem;
  }

.dc-iem-standalone .checkbox-label {
    color: #525252;
    justify-content: center;
    margin-bottom: 8px;
    font-size: 0.8125rem;
  }

.dc-iem-standalone .checkbox-label input {
    accent-color: #FF3B30;
    width: 16px;
    height: 16px;
  }

.dc-iem-standalone .panel-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
  }

.dc-iem-standalone .panel-cancel-btn {
    flex: 1;
    padding: 12px;
    background: #F5F5F5;
    border: none;
    border-radius: 10px;
    color: #404040;
    font-size: 0.9375rem;
    font-weight: 600;
    min-height: 46px;
    transition: background 0.15s ease;
  }

.dc-iem-standalone .panel-cancel-btn:active {
    background: #E5E5E5;
  }

.dc-iem-standalone .apply-btn {
    flex: 1.5;
    background: #FF3B30;
    color: #FFFFFF;
    border: none;
    border-radius: 10px;
    padding: 12px;
    font-size: 0.9375rem;
    font-weight: 600;
    margin-top: 0;
    min-height: 46px;
    transition: opacity 0.15s ease;
  }

.dc-iem-standalone .apply-btn:active {
    opacity: 0.85;
    transform: none;
    box-shadow: none;
  }

.dc-iem-standalone .crop-info {
    font-size: 0.75rem;
    text-align: center;
    color: #737373;
    margin-bottom: 0;
  }

.dc-iem-standalone .processing-indicator {
    color: #525252;
  }

.dc-iem-standalone .processing-indicator .spinner {
    border-color: #E5E5E5;
    border-top-color: #FF3B30;
  }
}

.dc-iem-standalone .canvas-wrapper {
  position: relative;
  display: inline-block;
}

.dc-iem-standalone #editorCanvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
}

.dc-iem-standalone .panel-desc {
  font-size: 0.875rem;
  color: #737373;
  margin-bottom: 12px;
}

.dc-iem-standalone .ratio-shape {
  border: 2px solid #A3A3A3;
  background: transparent;
}

.dc-iem-standalone .ratio-free {
  width: 24px;
  height: 18px;
  border-style: dashed;
  border-radius: 2px;
}

.dc-iem-standalone .ratio-1-1 {
  width: 20px;
  height: 20px;
  border-radius: 2px;
}

.dc-iem-standalone .ratio-4-3 {
  width: 24px;
  height: 18px;
  border-radius: 2px;
}

.dc-iem-standalone .ratio-16-9 {
  width: 28px;
  height: 16px;
  border-radius: 2px;
}

.dc-iem-standalone .ratio-9-16 {
  width: 14px;
  height: 24px;
  border-radius: 2px;
}

.dc-iem-standalone .ratio-circle {
  width: 20px;
  height: 20px;
  border-radius: 50%;
}

.dc-iem-standalone .crop-info {
  font-size: 0.875rem;
  color: #737373;
  margin-bottom: 12px;
}

.dc-iem-standalone .resize-inputs {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
}

.dc-iem-standalone .input-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dc-iem-standalone .input-group label {
  font-size: 0.875rem;
  color: #525252;
  min-width: 30px;
}

.dc-iem-standalone .input-group input {
  width: 80px;
  padding: 8px;
  border: 2px solid #E5E5E5;
  border-radius: 8px;
  font-size: 0.875rem;
  text-align: center;
}

.dc-iem-standalone .input-group input:focus {
  outline: none;
  border-color: #FF3B30;
}

.dc-iem-standalone .input-group span {
  font-size: 0.75rem;
  color: #A3A3A3;
}

.dc-iem-standalone .checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: #525252;
  margin-bottom: 12px;
  cursor: pointer;
}

.dc-iem-standalone .checkbox-label input {
  width: 18px;
  height: 18px;
  accent-color: #FF3B30;
}

.dc-iem-standalone .panel-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.dc-iem-standalone .panel-cancel-btn {
  flex: 1;
  padding: 12px;
  background: #FFFFFF;
  border: 1.5px solid #D4D4D4;
  border-radius: 8px;
  color: #525252;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dc-iem-standalone .panel-cancel-btn:hover {
  background: #F5F5F5;
  border-color: #A3A3A3;
}

.dc-iem-standalone .apply-btn {
  flex: 2;
  padding: 12px;
  background: #FF3B30;
  border: none;
  border-radius: 8px;
  color: #FFFFFF;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dc-iem-standalone .apply-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 59, 48, 0.4);
}

.dc-iem-standalone .processing-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  color: #525252;
}

.dc-iem-standalone .processing-indicator .spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #E5E5E5;
  border-top-color: #FF3B30;
  border-radius: 50%;
  animation: dc-iem-spin 1s linear infinite;
}

/* ---- ここから下: 画像エディタ本体（2026-09-28 に deferred-modals.css から移設・本文と順序は元のまま） ---- */

.image-editor-modal {
  max-width: 900px;
  width: 95vw;
}

.image-editor-body {
  padding: var(--s-16, 16px);
  display: flex;
  flex-direction: column;
  gap: var(--s-16, 16px);
}

.editor-canvas-area {
  position: relative;
  background: var(--gray-100, #F5F5F5);
  border-radius: var(--r-12, 12px);
  min-height: 300px;
  max-height: 50vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.editor-canvas-area.is-loading .canvas-wrapper,
.editor-canvas-area.is-loading .cropper-container-wrapper {
  visibility: hidden;
}

.image-editor-loading {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-12, 12px);
  z-index: 2;
}

.image-editor-loading span {
  font-size: 0.875rem;
  color: var(--gray-600, #525252);
}

.editor-canvas-area.is-saving .image-editor-loading {
  background: rgba(255, 255, 255, 0.7);
}

/* Cropper.js container */
.cropper-container-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cropper-container-wrapper > img {
  display: block;
  max-width: 100%;
  max-height: 100%;
}

/* Circle crop mode indicator */
.cropper-container-wrapper.circle-mode .cropper-view-box,
.cropper-container-wrapper.circle-mode .cropper-face {
  border-radius: 50%;
}

/* Cropper.js overrides - Product style (red accent, clean) */
.cropper-view-box {
  outline: 2px solid #e53935;
  outline-offset: -2px;
}

.cropper-line {
  background-color: #e53935;
  opacity: 0.6;
}

/* All handles - red */
.cropper-point {
  background-color: #e53935 !important;
  opacity: 1 !important;
  border-radius: 0 !important;
}

/* Corner handles - L-shaped thick lines */
.cropper-point.point-nw {
  width: 20px !important;
  height: 4px !important;
  border-left: 4px solid #e53935 !important;
  border-top: 4px solid #e53935 !important;
  background: transparent !important;
  box-sizing: border-box;
}

.cropper-point.point-nw::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 20px;
  background: #e53935;
}

.cropper-point.point-ne {
  width: 20px !important;
  height: 4px !important;
  border-right: 4px solid #e53935 !important;
  border-top: 4px solid #e53935 !important;
  background: transparent !important;
  box-sizing: border-box;
}

.cropper-point.point-ne::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 4px;
  height: 20px;
  background: #e53935;
}

.cropper-point.point-sw {
  width: 20px !important;
  height: 4px !important;
  border-left: 4px solid #e53935 !important;
  border-bottom: 4px solid #e53935 !important;
  background: transparent !important;
  box-sizing: border-box;
}

.cropper-point.point-sw::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 4px;
  height: 20px;
  background: #e53935;
}

.cropper-point.point-se {
  width: 20px !important;
  height: 4px !important;
  border-right: 4px solid #e53935 !important;
  border-bottom: 4px solid #e53935 !important;
  background: transparent !important;
  box-sizing: border-box;
}

.cropper-point.point-se::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 4px;
  height: 20px;
  background: #e53935;
}

/* Edge handles - bars */
.cropper-point.point-n,
.cropper-point.point-s {
  width: 40px !important;
  height: 4px !important;
  margin-left: -20px !important;
}

.cropper-point.point-e,
.cropper-point.point-w {
  width: 4px !important;
  height: 40px !important;
  margin-top: -20px !important;
}

.cropper-point::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  transform: translate(-50%, -50%);
  /* background は透明のまま = 視覚ノイズゼロのタッチ拡張領域 */
}

/* Corner handles - Instagram/X style L-shaped */
.crop-handle {
  position: absolute;
  width: 24px;
  height: 24px;
  pointer-events: auto;
}

.crop-handle::before,
.crop-handle::after {
  content: '';
  position: absolute;
  background: var(--white, #FFFFFF);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.crop-handle-nw { top: -3px; left: -3px; cursor: nw-resize; }

.crop-handle-nw::before { top: 0; left: 0; width: 24px; height: 4px; }

.crop-handle-nw::after { top: 0; left: 0; width: 4px; height: 24px; }

.crop-handle-ne { top: -3px; right: -3px; cursor: ne-resize; }

.crop-handle-ne::before { top: 0; right: 0; width: 24px; height: 4px; }

.crop-handle-ne::after { top: 0; right: 0; width: 4px; height: 24px; }

.crop-handle-sw { bottom: -3px; left: -3px; cursor: sw-resize; }

.crop-handle-sw::before { bottom: 0; left: 0; width: 24px; height: 4px; }

.crop-handle-sw::after { bottom: 0; left: 0; width: 4px; height: 24px; }

.crop-handle-se { bottom: -3px; right: -3px; cursor: se-resize; }

.crop-handle-se::before { bottom: 0; right: 0; width: 24px; height: 4px; }

.crop-handle-se::after { bottom: 0; right: 0; width: 4px; height: 24px; }

.editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-8, 8px);
}

.ratio-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: var(--s-8, 8px);
  background: var(--white, #FFFFFF);
  border: 2px solid var(--gray-200, #E5E5E5);
  border-radius: var(--r-8, 8px);
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 52px;
}

.ratio-btn:hover {
  border-color: var(--gray-400, #A3A3A3);
}

.ratio-btn.active {
  background: var(--red-light, rgba(255, 59, 48, 0.1));
  border-color: var(--red, #FF3B30);
}

.ratio-btn.active .ratio-shape {
  border-color: var(--red, #FF3B30);
}

.ratio-btn.active .ratio-label {
  color: var(--red, #FF3B30);
}

.rotate-btn {
  flex: 1;
  padding: var(--s-12, 12px);
  background: var(--white, #FFFFFF);
  border: 2px solid var(--gray-200, #E5E5E5);
  border-radius: var(--r-8, 8px);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.rotate-btn:hover {
  background: var(--gray-100, #F5F5F5);
  border-color: var(--gray-400, #A3A3A3);
}

.rotate-btn:active {
  transform: scale(0.98);
}

/* Background removal method selector */
.bg-method-selector {
  display: flex;
  flex-direction: column;
  gap: var(--s-8, 8px);
  margin-bottom: var(--s-16, 16px);
}

.bg-method-option {
  display: flex;
  align-items: flex-start;
  gap: var(--s-12, 12px);
  padding: var(--s-12, 12px);
  border: 1px solid var(--gray-200, #E5E5E5);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.bg-method-option:hover {
  border-color: var(--gray-300, #D4D4D4);
  background: var(--gray-50, #FAFAFA);
}

.bg-method-option:has(input:checked) {
  border-color: var(--red, #FF3B30);
  background: rgba(255, 107, 107, 0.05);
}

.bg-method-option input[type="radio"] {
  margin-top: 2px;
  accent-color: var(--red, #FF3B30);
}

.bg-method-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.bg-method-name {
  font-weight: 500;
  color: var(--gray-700, #404040);
  font-size: 0.875rem;
}

.bg-method-desc {
  font-size: 0.75rem;
  color: var(--gray-500, #737373);
}

.threshold-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--s-8, 8px);
  font-size: 0.875rem;
  color: var(--gray-700, #404040);
}

.threshold-value {
  font-weight: 500;
  color: var(--red, #FF3B30);
}

.threshold-slider {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--gray-200, #E5E5E5);
  border-radius: 3px;
  outline: none;
}

.threshold-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: var(--red, #FF3B30);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s ease;
}

.threshold-slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

.threshold-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: var(--red, #FF3B30);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.threshold-hints {
  display: flex;
  justify-content: space-between;
  margin-top: var(--s-4, 4px);
  font-size: 0.75rem;
  color: var(--gray-400, #A3A3A3);
}

.image-editor-footer {
  padding: var(--s-16, 16px) var(--s-24, 24px);
  border-top: 1px solid var(--gray-200, #E5E5E5);
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: var(--s-12, 12px);
}

@media (max-width: 768px) {
/* Full-screen modal */
  .image-editor-modal {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    background: var(--white, #FFFFFF);
    overflow: hidden;
  }

/* Minimal header */
  .image-editor-modal .modal-header {
    background: var(--white, #FFFFFF);
    border-bottom: 1px solid var(--gray-200, #E5E5E5);
    padding: var(--s-12, 12px) var(--s-16, 16px);
    flex-shrink: 0;
  }

.image-editor-modal .modal-header h3 {
    font-size: 1rem;
    font-weight: 600;
  }

/* Main body - flex layout */
  .image-editor-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    background: var(--gray-50, #FAFAFA);
  }

/* Canvas area takes most of the screen */
  .editor-canvas-area {
    flex: 1;
    min-height: 0;
    max-height: none;
    background: var(--gray-100, #F5F5F5);
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    touch-action: none;
  }

/* Bottom toolbar */
  .editor-toolbar {
    flex-shrink: 0;
    display: flex;
    gap: 0;
    justify-content: flex-start;
    background: var(--white, #FFFFFF);
    border-top: 1px solid var(--gray-200, #E5E5E5);
    padding: var(--s-8, 8px) var(--s-12, 12px);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

.editor-toolbar::-webkit-scrollbar {
    display: none;
  }

.ratio-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: var(--s-8, 8px) var(--s-4, 4px);
    background: var(--gray-50, #FAFAFA);
    border: 1.5px solid var(--gray-200, #E5E5E5);
    border-radius: var(--r-8, 8px);
    min-width: 0;
    min-height: 52px;
  }

.ratio-btn:hover {
    background: var(--gray-100, #F5F5F5);
  }

.ratio-btn.active {
    background: var(--red-light, rgba(255, 59, 48, 0.1));
    border-color: var(--red, #FF3B30);
  }

.rotate-btn {
    flex: none;
    width: 80px;
    padding: var(--s-12, 12px);
    background: var(--gray-100, #F5F5F5);
    border: 1px solid var(--gray-200, #E5E5E5);
    border-radius: 12px;
    color: var(--gray-700, #404040);
    font-size: 0.8125rem;
    transition: all 0.2s ease;
  }

.rotate-btn:hover,
  .rotate-btn:active {
    background: var(--gray-200, #E5E5E5);
    transform: scale(0.98);
  }

/* Footer */
  .image-editor-footer {
    flex-shrink: 0;
    padding: var(--s-16, 16px);
    padding-bottom: calc(var(--s-16, 16px) + var(--effective-safe-bottom, var(--page-safe-bottom, var(--safe-bottom, 0px))));
    background: var(--white, #FFFFFF);
    border-top: 1px solid var(--gray-200, #E5E5E5);
    display: flex;
    gap: var(--s-12, 12px);
    transition: opacity 0.2s ease, transform 0.2s ease;
  }

/* Hide footer and toolbar when tool panel is open */
  .image-editor-modal.tool-active .image-editor-footer,
  .image-editor-modal.tool-active .editor-toolbar {
    display: none;
  }

/* Tool panel becomes part of normal flow when active */
  .image-editor-modal.tool-active .tool-panels {
    position: relative;
    z-index: auto;
  }

.image-editor-modal.tool-active .tool-panel:not(.hidden) {
    position: relative;
    transform: none;
    border-radius: 0;
    max-height: none;
  }

/* Canvas area takes remaining space */
  .image-editor-modal.tool-active .editor-canvas-area {
    flex: 1;
    min-height: 200px;
  }

/* Footer buttons - outline style to differentiate from tool panel */
  .image-editor-footer .secondary-btn {
    flex: 1;
    padding: var(--s-14, 14px);
    background: transparent;
    border: 1.5px solid var(--gray-300, #D4D4D4);
    border-radius: 12px;
    color: var(--gray-600, #525252);
    font-size: 0.9375rem;
    font-weight: 600;
    min-height: 48px;
  }

.image-editor-footer .secondary-btn:active {
    background: var(--gray-100, #F5F5F5);
    border-color: var(--gray-400, #A3A3A3);
  }

  /* 分割の副作用対策（2026-09-03）: この節は style.css から移ったため、同じ詳細度の `.secondary-btn:hover` / `:disabled`
     （critical 側・元は本ルールより後ろ）に順序で負けなくなる。元の見た目（hover=--gray-200 / disabled=--gray-50）を明示して保つ */
  .image-editor-footer .secondary-btn:hover {
    background: var(--gray-200, #E5E5E5);
  }

.image-editor-footer .secondary-btn:disabled {
    color: var(--gray-400, #A3A3A3);
    background: var(--gray-50, #FAFAFA);
  }

.image-editor-footer .primary-btn {
    flex: 1.5;
    padding: var(--s-14, 14px);
    background: transparent;
    border: 1.5px solid var(--red, #FF3B30);
    border-radius: 12px;
    color: var(--red, #FF3B30);
    font-size: 0.9375rem;
    font-weight: 600;
    min-height: 48px;
  }

.image-editor-footer .primary-btn:active {
    background: var(--red-light, rgba(255, 59, 48, 0.1));
  }

/* Larger crop handles for touch */
  .crop-handle {
    width: 44px;
    height: 44px;
  }

.crop-handle::before,
  .crop-handle::after {
    background: var(--white, #FFFFFF);
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  }

.crop-handle-nw { top: -6px; left: -6px; }

.crop-handle-nw::before { width: 32px; height: 5px; }

.crop-handle-nw::after { width: 5px; height: 32px; }

.crop-handle-ne { top: -6px; right: -6px; }

.crop-handle-ne::before { width: 32px; height: 5px; }

.crop-handle-ne::after { width: 5px; height: 32px; }

.crop-handle-sw { bottom: -6px; left: -6px; }

.crop-handle-sw::before { width: 32px; height: 5px; }

.crop-handle-sw::after { width: 5px; height: 32px; }

.crop-handle-se { bottom: -6px; right: -6px; }

.crop-handle-se::before { width: 32px; height: 5px; }

.crop-handle-se::after { width: 5px; height: 32px; }

/* Cropper.js mobile overrides - larger touch targets */
  .cropper-view-box {
    outline: 3px solid #e53935;
    outline-offset: -3px;
  }

.cropper-line {
    background-color: #e53935;
  }

/* Corner handles - larger L-shapes for touch */
  .cropper-point.point-nw,
  .cropper-point.point-ne,
  .cropper-point.point-sw,
  .cropper-point.point-se {
    width: 28px !important;
    height: 6px !important;
    border-width: 6px !important;
  }

.cropper-point.point-nw::after,
  .cropper-point.point-ne::after,
  .cropper-point.point-sw::after,
  .cropper-point.point-se::after {
    width: 6px;
    height: 28px;
  }

/* Edge handles - larger bars for touch */
  .cropper-point.point-n,
  .cropper-point.point-s {
    width: 56px !important;
    height: 6px !important;
    margin-left: -28px !important;
  }

.cropper-point.point-e,
  .cropper-point.point-w {
    width: 6px !important;
    height: 56px !important;
    margin-top: -28px !important;
  }

/* Add padding to canvas area so crop handles aren't at edge */
  .editor-canvas-area {
    padding: var(--s-16, 16px);
  }
}

.modal .image-editor-modal {
  position: relative;
  width: 100%;
  max-width: 560px;
  height: 100dvh;
  max-height: none;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
  overflow: hidden;
  box-shadow: none;
  transform: none;
}

@media (min-width: 600px) {
.modal .image-editor-modal {
    height: 92dvh;
    max-height: 900px;
    border-radius: 24px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.2);
  }
}

/* ---- Top bar : back / title / actions ---- */
.image-editor-modal .modal-header {
  flex-shrink: 0;
  padding: 8px 10px;
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid var(--gray-200, #E5E5E5);
  background: #fff;
}

.image-editor-modal .modal-header h3 {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.image-editor-modal .modal-close.e2-back {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: none;
  color: var(--gray-900, #171717);
  font-size: 0;
}

.image-editor-modal .modal-close.e2-back:hover {
  background: var(--gray-100, #F5F5F5);
}

.image-editor-modal .modal-close.e2-back svg {
  width: 24px;
  height: 24px;
}

.image-editor-modal .e2-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.image-editor-modal .e2-copy {
  height: 34px;
  padding: 0 10px;
  border: none;
  background: none;
  color: var(--gray-600, #525252);
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 10px;
}

.image-editor-modal .e2-copy:hover {
  background: var(--gray-100, #F5F5F5);
  border: none;
}

.image-editor-modal .e2-done {
  height: 34px;
  padding: 0 16px;
  border: none;
  border-radius: 999px;
  background: var(--red, #FF3B30);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 800;
}

.image-editor-modal .e2-done:hover {
  transform: none;
  box-shadow: none;
  filter: brightness(0.97);
}

.image-editor-modal .e2-done:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ---- Body : column, no padding ---- */
.image-editor-modal .image-editor-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  background: #fff;
  overflow: hidden;
}

/* ---- Canvas : the image is the hero ---- */
.image-editor-modal .editor-canvas-area {
  flex: 1;
  min-height: 0;
  max-height: none;
  border-radius: 0;
  background: radial-gradient(120% 90% at 50% 40%, #fbfbfc, #eceef1);
}

/* ---- Bottom toolbar : clean icon tiles ---- */
.image-editor-modal .editor-toolbar {
  flex-shrink: 0;
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  gap: 4px;
  padding: 10px 8px calc(12px + env(safe-area-inset-bottom));
  background: #fff;
  border-top: 1px solid var(--gray-200, #E5E5E5);
  overflow: visible;
}

/* Declutter : hide power-user / redundant tools */
.image-editor-modal .tool-btn[data-tool="resize"],
.image-editor-modal #flipVertical,
.image-editor-modal #editorReset {
  display: none;
}

.image-editor-modal .tool-btn {
  flex: 1;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 4px 2px;
  background: none;
  border: none;
  border-radius: 12px;
  color: var(--gray-500, #737373);
}

.image-editor-modal .tool-btn::after {
  display: none;
}

.image-editor-modal .tool-btn svg {
  width: 46px;
  height: 46px;
  padding: 11px;
  border-radius: 14px;
  background: #f2f2f3;
  color: var(--gray-900, #171717);
  stroke-width: 2;
  box-sizing: border-box;
  transition: background 0.15s ease, color 0.15s ease;
}

.image-editor-modal .tool-btn span {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin-top: 0;
  color: inherit;
}

.image-editor-modal .tool-btn:hover {
  background: none;
}

.image-editor-modal .tool-btn:hover svg {
  background: #e9e9eb;
}

.image-editor-modal .tool-btn[data-tool].active {
  background: none;
  color: var(--gray-900, #171717);
}

.image-editor-modal .tool-btn[data-tool].active svg {
  background: var(--red, #FF3B30);
  color: #fff;
}

.image-editor-modal .tool-btn:disabled {
  opacity: 0.4;
}

/* ---- Contextual sheet (crop / remove-bg) slides up within the modal ---- */
.image-editor-modal .tool-panels {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 6;
  min-height: 0;
  pointer-events: none;
}

.image-editor-modal .tool-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: #fff;
  border-radius: 18px 18px 0 0;
  padding: 20px 16px calc(16px + env(safe-area-inset-bottom));
  transform: translateY(110%);
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
  pointer-events: auto;
  max-height: 70dvh;
  overflow-y: auto;
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.1);
}

.image-editor-modal .tool-panel::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--gray-300, #D4D4D4);
}

.image-editor-modal .tool-panel:not(.hidden) {
  transform: translateY(0);
}

.image-editor-modal .panel-title {
  text-align: center;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--gray-900, #171717);
  margin: 4px 0 14px;
}

/* ---- Ratio chips : horizontal contextual row ---- */
.image-editor-modal .preset-ratios {
  display: flex;
  grid-template-columns: none;
  gap: 6px;
  justify-content: center;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  margin-bottom: 14px;
}

.image-editor-modal .preset-ratios::-webkit-scrollbar {
  display: none;
}

.image-editor-modal .ratio-btn {
  flex: 0 0 auto;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: none;
  border: none;
  border-radius: 10px;
}

.image-editor-modal .ratio-btn:hover {
  background: var(--gray-50, #FAFAFA);
}

.image-editor-modal .ratio-btn.active {
  background: none;
  border: none;
}

.image-editor-modal .ratio-btn .ratio-shape {
  border: 2px solid var(--gray-400, #A3A3A3);
  transform: none;
}

.image-editor-modal .ratio-btn.active .ratio-shape {
  border-color: var(--red, #FF3B30);
  background: var(--red-light, rgba(255, 59, 48, 0.1));
}

.image-editor-modal .ratio-btn .ratio-label {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--gray-500, #737373);
}

.image-editor-modal .ratio-btn.active .ratio-label {
  color: var(--red, #FF3B30);
}

/* ---- Footer removed (actions live in the top bar) ---- */
.image-editor-modal .image-editor-footer {
  display: none;
}

.image-editor-modal.image-editor-modal--footer-actions .image-editor-footer {
  display: flex;
  flex-shrink: 0;
  gap: var(--s-12, 12px);
  padding: 12px 16px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--gray-200, #E5E5E5);
  background: #fff;
}

.image-editor-modal.image-editor-modal--footer-actions .image-editor-footer > button {
  flex: 1 1 0;
  min-height: 48px;
  border-radius: 12px;
  font-weight: 700;
}

#imageEditorModal {
  z-index: 5000;
}

body.image-editor-open .project-complete-view[data-active-tool="image"] .project-complete-asset-workbench,
body.image-editor-open .project-complete-tool-dock {
  display: none;
}

#imageEditorModal .editor-canvas-area {
  position: relative;
}

#imageEditorModal .cropper-container-wrapper {
  position: absolute;
  /* 18px breathing room via inset, NOT padding: Cropper sizes its canvas from this element's
     padded box, so padding made the canvas wider than the content area → crop box overflowed
     and image edges didn't line up. inset gives the same gap without confusing Cropper. */
  inset: 18px;
  width: auto;
  height: auto;
  z-index: 2;
  box-sizing: border-box;
}

#imageEditorModal .cropper-container-wrapper.hidden {
  display: none;
}

#imageEditorModal .canvas-wrapper.hidden {
  display: none;
}

#imageEditorModal .image-editor-modal.tool-active .editor-toolbar {
  display: flex;
}

/* contextual panel above the persistent toolbar */
#imageEditorModal .image-editor-body { display: flex; flex-direction: column; }

#imageEditorModal .editor-canvas-area { order: 0; }

#imageEditorModal .image-editor-modal.tool-active .tool-panels { order: 2; }

#imageEditorModal .editor-toolbar { order: 3; }

/* slim the crop panel into a contextual ratio row (no big title) */
#imageEditorModal .image-editor-modal.tool-active #cropPanel .panel-title { display: none; }

#imageEditorModal .image-editor-modal.tool-active .tool-panels {
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  z-index: auto;
  flex: 0 0 auto;
  pointer-events: auto;
}

#imageEditorModal .image-editor-modal.tool-active .tool-panel:not(.hidden) {
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  max-height: 46dvh;
  border-radius: 18px 18px 0 0;
  transform: none;
  pointer-events: auto;
}

#imageEditorModal .image-editor-modal.tool-active .editor-canvas-area {
  flex: 1 1 auto;
  min-height: 0;
}

#imageEditorModal .fallback-cropper-active {
  overflow: hidden;
}

#imageEditorModal .fallback-cropper-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

#imageEditorModal .fallback-cropper-box {
  position: absolute;
  box-sizing: border-box;
  border: 3px solid var(--red, #FF3B30);
  background:
    linear-gradient(rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0.32)) padding-box;
  box-shadow:
    0 0 0 9999px rgba(0, 0, 0, 0.34),
    0 8px 28px rgba(0, 0, 0, 0.22);
  cursor: move;
  touch-action: none;
  pointer-events: auto;
}

#imageEditorModal .fallback-cropper-box::before,
#imageEditorModal .fallback-cropper-box::after {
  content: '';
  position: absolute;
  inset: 33.333% 0 auto;
  height: 1px;
  background: rgba(255, 255, 255, 0.72);
  pointer-events: none;
}

#imageEditorModal .fallback-cropper-box::after {
  inset: 66.666% 0 auto;
}

#imageEditorModal .fallback-cropper-handle {
  position: absolute;
  z-index: 2;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #fff;
  border: 3px solid var(--red, #FF3B30);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.22);
  touch-action: none;
}

#imageEditorModal .fallback-cropper-handle-nw { left: -12px; top: -12px; cursor: nwse-resize; }

#imageEditorModal .fallback-cropper-handle-ne { right: -12px; top: -12px; cursor: nesw-resize; }

#imageEditorModal .fallback-cropper-handle-sw { left: -12px; bottom: -12px; cursor: nesw-resize; }

#imageEditorModal .fallback-cropper-handle-se { right: -12px; bottom: -12px; cursor: nwse-resize; }

#imageEditorModal .fallback-cropper-handle-n { left: 50%; top: -12px; transform: translateX(-50%); cursor: ns-resize; }

#imageEditorModal .fallback-cropper-handle-s { left: 50%; bottom: -12px; transform: translateX(-50%); cursor: ns-resize; }

#imageEditorModal .fallback-cropper-handle-e { right: -12px; top: 50%; transform: translateY(-50%); cursor: ew-resize; }

#imageEditorModal .fallback-cropper-handle-w { left: -12px; top: 50%; transform: translateY(-50%); cursor: ew-resize; }

#imageEditorModal .fallback-cropper-active.circle-mode .fallback-cropper-box {
  border-radius: 999px;
}

.image-editor-modal .crop-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.image-editor-modal .crop-reset-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: none;
  border: none;
  color: var(--gray-600, #525252);
  font: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 8px 6px;
  border-radius: 12px;
  cursor: pointer;
}

.image-editor-modal .crop-reset-btn:hover { background: var(--gray-100, #F5F5F5); }

.image-editor-modal .crop-reset-btn svg { width: 20px; height: 20px; }

.image-editor-modal .crop-apply {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: var(--red, #FF3B30);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 10px 22px -10px rgba(255, 59, 48, 0.6);
}

.image-editor-modal .crop-apply:hover { transform: none; filter: brightness(0.97); }

.image-editor-modal .crop-apply:disabled { opacity: 0.4; box-shadow: none; }

.image-editor-modal .crop-apply svg { width: 24px; height: 24px; }
