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

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

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

/* 設問テキスト */
.cb-question {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 600;
  color: #1A2332;
}

/* パターン1: チェックボックスの縦並びグループ */
.cb-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

/* パターン2: チェックボックスのグリッド（横並び・折り返し） */
.cb-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 0;
  margin-bottom: 14px;
}

/* グリッドの各アイテム: 3列固定でチェックボックスを縦横に揃える */
.cb-grid-item {
  width: calc(100% / 3);
}

/* 各選択肢ラベル（縦並び・グリッド共通） */
.cb-label,
.cb-grid-item label {
  display: flex;
  gap: 8px;
  font-size: 13px;
  color: #1A2332;
  cursor: pointer;
}

/* パターン1（縦並び）: 1行テキストなので中央揃えでOK */
.cb-label { align-items: center; }

/* パターン2（グリッド）: テキスト折り返し時もチェックボックス位置が揃うよう上揃えにする */
.cb-grid-item label { align-items: flex-start; }

.cb-label input[type="checkbox"],
.cb-grid-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #2B7FE8;
  cursor: pointer;
  flex-shrink: 0;
  /* テキスト1行目の高さ（line-height 1.4 × 13px ≒ 18px）に視覚的に合わせる */
  margin-top: 1px;
}

/* テキストボックス（パターン1） */
.cb-textbox {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid #D0D7E0;
  border-radius: 6px;
  font-size: 14px;
  color: #1A2332;
  background: #fff;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  box-sizing: border-box;
  font-family: sans-serif;
}
.cb-textbox:focus {
  border-color: #2B7FE8;
  box-shadow: 0 0 0 3px rgba(43, 127, 232, 0.12);
}
/* disabled 状態: 背景をグレーにして視覚的に無効と分かるようにする */
.cb-textbox:disabled {
  background: #E8EDF4;
  color: #9AA5B4;
  cursor: not-allowed;
}

/* 決定ボタン（パターン2） */
.cb-submit-btn {
  display: inline-block;
  padding: 9px 24px;
  background: #2B7FE8;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: sans-serif;
  transition: opacity 0.15s;
}
.cb-submit-btn:hover { opacity: 0.85; }

/* 結果表示エリア（パターン2） */
.cb-result {
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.6;
}
.cb-result.has-value {
  padding: 10px 14px;
  background: #fff;
  border: 1.5px solid #D0D7E0;
  border-radius: 6px;
  color: #1A2332;
}
.cb-result.has-value ul {
  margin: 0;
  padding: 0 0 0 18px;
}
.cb-result.has-value li {
  margin-bottom: 4px;
}
.cb-result.has-value li:last-child { margin-bottom: 0; }
.cb-result.has-error {
  color: #E53935;
  font-weight: 600;
}

/* 更新日表示 */
.updated-at {
  font-size: 12px;
  color: #9AA5B4;
}

/* サンプルソースヒント */
.source-hint {
  margin: 0 0 16px;
  padding: 10px 14px;
  font-size: 13px;
  color: #5A6A7A;
  background: #F4F6F9;
  border-left: 3px solid #2B7FE8;
  border-radius: 0 6px 6px 0;
  line-height: 1.7;
}
.source-hint code {
  font-family: monospace;
  background: #E8EDF4;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 12px;
}

/* 複数プロンプトブロック */
.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;
}

/* プロンプト補足（注意・ヒント） */
.prompt-notes {
  margin-bottom: 20px;
  padding: 14px 16px;
  background: #F4F6F9;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.7;
}
.prompt-note-caution {
  margin: 0 0 8px;
  color: #E65100;
}
.prompt-note-tip {
  margin: 0;
  color: #5A6A7A;
}

/* リセットボタン */
.demo-controls {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}
.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;
}

/* レスポンシブ: 480px 以下でグリッドアイテムを2列に */
@media (max-width: 480px) {
  .cb-pattern { max-width: 100%; }
  .cb-grid-item { width: 50%; }
  .demo-container { padding: 16px; }
}
/* 320px 以下では1列に */
@media (max-width: 320px) {
  .cb-grid-item { width: 100%; }
}
