/* === デモ: 縦並びレイアウト === */
.demo-container {
  flex-direction: column;
  align-items: stretch;
  padding: 24px;
}

/* 各パターンを囲むカード */
.cp-pattern {
  margin-bottom: 16px;
  padding: 20px;
  background: #F4F6F9;
  border-radius: 8px;
  max-width: 520px;
}

.cp-pattern:last-of-type { margin-bottom: 0; }

.cp-pattern-label {
  margin: 0 0 16px;
  font-size: 11px;
  font-weight: 700;
  color: #2B7FE8;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* === Pattern 1: HEX/RGB変換ピッカー === */

.cp-wrapper { width: 100%; }

.cp-trigger {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  position: relative;
}

.cp-swatch {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1.5px solid #D0D7E0;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.15s;
}

.cp-swatch:hover { border-color: #9AA5B4; }

/* ネイティブの color input は非表示にしてJSで.click()する */
.cp-hidden-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.cp-open-btn {
  padding: 8px 16px;
  font-size: 14px;
  font-family: sans-serif;
  color: #fff;
  background: #2B7FE8;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

.cp-open-btn:hover { background: #1a6fd4; }

.cp-formats { display: flex; flex-direction: column; gap: 10px; }

.cp-format-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cp-format-label {
  width: 36px;
  font-size: 11px;
  font-weight: 700;
  color: #5A6A7A;
  flex-shrink: 0;
}

.cp-hex-input {
  flex: 1;
  padding: 7px 10px;
  border: 1.5px solid #D0D7E0;
  border-radius: 6px;
  font-size: 14px;
  font-family: monospace;
  color: #1E2A3A;
  background: #fff;
  outline: none;
  transition: border-color 0.15s;
}

.cp-hex-input:focus { border-color: #2B7FE8; }

.cp-rgb-value {
  flex: 1;
  font-size: 13px;
  font-family: monospace;
  color: #1E2A3A;
  padding: 7px 0;
}

.cp-copy-btn {
  padding: 6px 12px;
  font-size: 12px;
  font-family: sans-serif;
  border: 1.5px solid #D0D7E0;
  border-radius: 6px;
  background: #fff;
  color: #1E2A3A;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.cp-copy-btn.copied {
  background: #e6f0fd;
  border-color: #2B7FE8;
  color: #2B7FE8;
}

/* プレビューカード */
.cp-preview-card {
  margin-top: 20px;
  border-radius: 10px;
  overflow: hidden;
  border: 1.5px solid #D0D7E0;
}

.cp-preview-header {
  padding: 20px 16px;
  transition: background 0.2s;
}

.cp-preview-hex {
  font-size: 13px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  font-family: monospace;
  letter-spacing: 0.04em;
}

.cp-preview-body {
  padding: 14px 16px;
  background: #fff;
}

.cp-preview-title {
  font-size: 14px;
  font-weight: 700;
  color: #1E2A3A;
  margin: 0 0 4px;
}

.cp-preview-text {
  font-size: 13px;
  color: #5A6A7A;
  margin: 0;
}

/* === Pattern 2: プリセットパレット === */

.cp-palette-wrapper { width: 100%; }

.cp-palette-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 32px);
  gap: 6px;
  margin-bottom: 12px;
}

.cp-swatch-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 2.5px solid transparent;
  cursor: pointer;
  position: relative;
  transition: transform 0.1s, border-color 0.1s;
  padding: 0;
}

.cp-swatch-btn:hover { transform: scale(1.1); }
.cp-swatch-btn.is-selected { border-color: #1E2A3A; }

.cp-palette-custom {
  margin-bottom: 14px;
  position: relative;
}

.cp-custom-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1.5px dashed #D0D7E0;
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
  font-family: sans-serif;
  color: #5A6A7A;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.cp-custom-btn:hover {
  border-color: #9AA5B4;
  color: #1E2A3A;
}

.cp-palette-preview-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.cp-palette-preview-label {
  font-size: 13px;
  color: #5A6A7A;
}

.cp-label-tag {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s, color 0.2s;
}

.cp-palette-hex-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cp-palette-hex {
  font-size: 14px;
  font-family: monospace;
  font-weight: 700;
  color: #1E2A3A;
}

/* リセットボタン */
.reset-btn {
  padding: 6px 16px;
  font-size: 13px;
  color: #5A6A7A;
  background: #fff;
  border: 1.5px solid #D0D7E0;
  border-radius: 6px;
  cursor: pointer;
  font-family: sans-serif;
  transition: background 0.15s, border-color 0.15s;
}

.reset-btn:hover {
  background: #F4F6F9;
  border-color: #9AA5B4;
}

/* プロンプトブロック */
.prompt-block { margin-bottom: 20px; }
.prompt-block:last-child { margin-bottom: 0; }

.prompt-block-label {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  color: #2B7FE8;
  letter-spacing: 0.04em;
}
