/* 画像の背景透過ツール専用スタイル */
.bg-remover-wrap {
  max-width: 900px;
  margin: 0 auto;
}

.privacy-note {
  background-color: var(--accent-bg, #eef6ff);
  border: 1px solid var(--accent, #2a9d8f);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 0.95rem;
  color: #333;
  text-align: left;
}

.upload-area {
  border: 2px dashed var(--accent, #2a9d8f);
  padding: 40px 20px;
  margin-bottom: 12px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--accent, #2a9d8f);
  text-align: center;
  transition: background-color 0.2s;
}
.upload-area.hover {
  background-color: var(--accent-bg, #eef6ff);
}
.upload-area .upload-sub {
  display: block;
  margin-top: 6px;
  font-size: 0.85rem;
  color: #888;
}
#inputFile {
  display: none;
}

.memory-note {
  font-size: 0.82rem;
  color: #888;
  text-align: left;
  margin: 0 0 20px;
  line-height: 1.7;
}

/* 出力オプション */
.bg-options {
  display: none;
  margin: 0 0 20px;
  padding: 14px 16px;
  background: #f9f9f9;
  border-radius: 8px;
  text-align: left;
}
.bg-options.show { display: block; }
.bg-options .opt-title {
  font-weight: bold;
  font-size: 0.92rem;
  color: #333;
  margin-bottom: 10px;
}
.bg-options .opt-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}
.bg-options label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.9rem;
  color: #444;
  cursor: pointer;
}
.bg-options input[type="color"] {
  width: 34px;
  height: 28px;
  padding: 0;
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
  vertical-align: middle;
}

/* 進捗表示 */
#progressArea {
  display: none;
  margin: 20px auto;
  text-align: center;
}
.spinner {
  display: inline-block;
  width: 34px;
  height: 34px;
  border: 4px solid #e0e0e0;
  border-top-color: var(--accent, #2a9d8f);
  border-radius: 50%;
  animation: bgr-spin 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 12px;
}
@keyframes bgr-spin { to { transform: rotate(360deg); } }
#progressText {
  display: inline-block;
  vertical-align: middle;
  color: #333;
  font-size: 0.95rem;
}

/* エラー */
#errorArea {
  display: none;
  margin: 0 0 20px;
  padding: 12px 16px;
  background: #fdf2f2;
  border: 1px solid #e57373;
  border-radius: 8px;
  text-align: left;
  color: #c0392b;
  font-size: 0.9rem;
}

/* 結果プレビュー */
#resultArea {
  display: none;
  margin: 10px 0 20px;
}
.preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.preview-cell {
  background: #f9f9f9;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 12px;
  text-align: center;
}
.preview-cell .cell-label {
  font-size: 0.82rem;
  color: #666;
  margin-bottom: 8px;
}
.preview-cell .canvas-holder {
  display: inline-block;
  max-width: 100%;
  line-height: 0;
  border-radius: 4px;
  overflow: hidden;
}
/* 透過部を市松模様で表示 */
.checker {
  background-image:
    linear-gradient(45deg, #ccc 25%, transparent 25%),
    linear-gradient(-45deg, #ccc 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #ccc 75%),
    linear-gradient(-45deg, transparent 75%, #ccc 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-color: #fff;
}
.preview-cell img,
.preview-cell canvas {
  max-width: 100%;
  height: auto;
  display: block;
}

.result-actions {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.result-actions button {
  padding: 10px 22px;
  font-size: 0.95rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  background-color: var(--accent, #2a9d8f);
  color: #fff;
  transition: background-color 0.2s;
}
.result-actions button:hover {
  background-color: var(--accent-hover, #21867a);
}
.result-actions button.secondary {
  background-color: #6b7280;
}
.result-actions button.secondary:hover {
  background-color: #556070;
}

/* モデルのクレジット */
.model-credit {
  font-size: 0.8rem;
  color: #94a3b8;
  text-align: center;
  margin: 24px 0 8px;
  line-height: 1.7;
}
.model-credit a { color: #94a3b8; }

.tool-cross-link {
  font-size: 0.9rem;
  color: #666;
  text-align: left;
  margin: 24px 0 0;
}
.tool-cross-link a { color: var(--accent, #2a9d8f); }

@media (max-width: 640px) {
  .preview-grid { grid-template-columns: 1fr; }
}
