/* 画像の背景透過・白フチ付けツール（固有の部品。共通部分は /assets/image-tool.css） */

/* 白フチ・白化のとき、白が見えるよう市松模様を暗くする */
.checker.is-dark {
  background-color: #6b7a93;
  background-image: conic-gradient(#56657d 25%, transparent 0 50%, #56657d 0 75%, transparent 0);
}

.stage.is-picking canvas { cursor: crosshair; }

.pick-hint {
  margin: 10px 0 0;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--color-primary-soft);
  color: var(--color-primary-text);
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
}

/* スポイトと色の表示 */
.color-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.swatch {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--color-border-strong);
  box-shadow: inset 0 0 0 2px #fff, var(--shadow-xs);
  flex: none;
}
.swatch.is-auto {
  background-image: conic-gradient(#e4e8ef 25%, #fff 0 50%, #e4e8ef 0 75%, #fff 0);
  background-size: 12px 12px;
}
.color-text { font-variant-numeric: tabular-nums; font-size: 0.9rem; font-weight: 700; min-width: 5.5em; }

/* 詳細設定（折りたたみ .advanced）は、共通の image-tool.css にある */
.advanced-body .btn { margin-top: 16px; }

/* 画面2：ダウンロード */
.download {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--edge), var(--shadow);
  padding: 18px;
  text-align: center;
}
.download-title { margin: 0 0 12px; font-size: 1.15rem; font-weight: 800; outline: none; }
.stage-final {
  display: flex;
  align-items: center;
  justify-content: center;
  height: auto;
  min-height: 240px;
  padding: 16px;
}
.stage-final canvas {
  display: block;
  max-width: 100%;
  max-height: 62vh;
  width: auto;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 0 0 1px rgba(23, 26, 43, 0.1), 0 10px 30px -12px rgba(23, 26, 43, 0.35);
}
.final-meta {
  margin: 12px 0 0;
  min-height: 1.5em;
  color: var(--color-muted);
  font-size: 0.88rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.download-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}
.download-note {
  max-width: 640px;
  margin: 14px auto 0;
  color: var(--color-faint);
  font-size: 0.8rem;
}

/* スマホ: プレビューを上に固定（共通の image-tool.css）し、保存へ進むボタンを下に固定 */
@media (max-width: 860px) {
  /* 設定項目が多いツールなので、プレビューは他より少し低くして、設定欄の見える範囲を確保する */
  .editor { --stage-h: 36vh; }
  .pick-hint { margin-top: 6px; padding: 6px 10px; font-size: 0.85rem; }
  #btn-next {
    position: sticky;
    bottom: 12px;
    z-index: 4;
    box-shadow: 0 10px 28px -6px rgba(79, 70, 229, 0.5);
  }
  #btn-next:disabled { position: static; box-shadow: none; }
  .download-actions .btn { flex: 1 1 100%; }
}
