/* === デモ: セレクトボックス 2 — 複数選択（2パターン） === */

/* デモコンテナ: 縦並びで各パターンを表示する */
.demo-container {
  flex-direction: column;
  align-items: stretch;
  padding: 24px;
}

/* パターンラベル */
.fs2-pattern { max-width: 520px; }
.fs2-pattern + .fs2-pattern { margin-top: 32px; }
.fs2-pattern-label {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 700;
  color: #2B7FE8;
  letter-spacing: 0.04em;
}

/* ========== Pattern 1: ネイティブ ========== */
.ms-wrapper { width: 100%; }

.ms-label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 700;
  color: #1A2332;
}

.ms-hint {
  margin: 0 0 12px;
  font-size: 12px;
  color: #9AA5B4;
  line-height: 1.5;
}

.ms-select-row { display: flex; gap: 12px; align-items: flex-start; }

.ms-select {
  flex: 1;
  border: 1.5px solid #D0D7E0;
  border-radius: 8px;
  font-size: 14px;
  color: #1A2332;
  background: #fff;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
  font-family: sans-serif;
}
.ms-select:focus {
  border-color: #2B7FE8;
  box-shadow: 0 0 0 3px rgba(43, 127, 232, 0.12);
}

.ms-side { display: flex; flex-direction: column; gap: 8px; min-width: 88px; }

.ms-count-badge {
  display: block;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: #2B7FE8;
  background: #EBF3FD;
  border-radius: 20px;
  padding: 4px 8px;
  white-space: nowrap;
}

.ms-confirm-btn {
  padding: 8px 0;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: #2B7FE8;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-family: sans-serif;
  transition: background 0.15s, opacity 0.15s;
}
.ms-confirm-btn:hover:not(:disabled) { background: #1a6fd1; }
.ms-confirm-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.ms-result {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1.5px solid #D0D7E0;
  border-radius: 8px;
  background: #fff;
}
.ms-result-label {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  color: #9AA5B4;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ms-result-body { display: flex; flex-wrap: wrap; gap: 6px; min-height: 28px; }
.ms-tag {
  display: inline-block;
  padding: 4px 12px;
  background: #2B7FE8;
  color: #fff;
  border-radius: 20px;
  font-size: 13px;
}
.ms-empty { font-size: 13px; color: #9AA5B4; }

/* ========== Pattern 2: カスタムドロップダウン ========== */
.cd-wrapper { width: 100%; }

.cd-label {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 700;
  color: #1A2332;
}

/* ドロップダウン全体（パネルの position: absolute の基点） */
.cd-dropdown { position: relative; }

/* トリガーボタン */
.cd-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 9px 12px;
  font-size: 14px;
  color: #1A2332;
  background: #fff;
  border: 1.5px solid #D0D7E0;
  border-radius: 8px;
  cursor: pointer;
  font-family: sans-serif;
  text-align: left;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}
.cd-trigger:focus {
  border-color: #2B7FE8;
  box-shadow: 0 0 0 3px rgba(43, 127, 232, 0.12);
  outline: none;
}
#cd-trigger-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.cd-arrow {
  font-size: 10px;
  color: #9AA5B4;
  transition: transform 0.2s;
  flex-shrink: 0;
  margin-left: 8px;
}
/* パネルが開いているとき矢印を上向きに回転する */
.cd-trigger[aria-expanded="true"] .cd-arrow { transform: rotate(180deg); }

/* ドロップダウンパネル */
.cd-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1.5px solid #D0D7E0;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  z-index: 100;
}

.cd-list {
  list-style: none;
  margin: 0;
  padding: 6px 0;
  max-height: 260px;
  overflow-y: auto;
}

.cd-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-size: 14px;
  color: #1A2332;
  cursor: pointer;
  transition: background 0.12s;
}
.cd-item:hover { background: #F4F6F9; }
.cd-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #2B7FE8;
  flex-shrink: 0;
  cursor: pointer;
}

.cd-panel-footer {
  padding: 8px 14px 12px;
  border-top: 1px solid #D0D7E0;
  display: flex;
  justify-content: flex-end;
}

.cd-confirm-btn {
  padding: 7px 20px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: #2B7FE8;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-family: sans-serif;
  transition: background 0.15s;
}
.cd-confirm-btn:hover { background: #1a6fd1; }

.cd-result {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1.5px solid #D0D7E0;
  border-radius: 8px;
  background: #fff;
}
.cd-result-label {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  color: #9AA5B4;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.cd-result-body { display: flex; flex-wrap: wrap; gap: 6px; min-height: 28px; }
.cd-tag {
  display: inline-block;
  padding: 4px 12px;
  background: #2B7FE8;
  color: #fff;
  border-radius: 20px;
  font-size: 13px;
}
.cd-empty { font-size: 13px; color: #9AA5B4; }

/* ========== 共通パーツ ========== */

/* チェックボックスとの比較テーブル */
.comparison-table-wrapper {
  overflow-x: auto;
  margin: 12px 0 16px;
}
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  line-height: 1.5;
}
.comparison-table th,
.comparison-table td {
  padding: 8px 12px;
  border: 1px solid #D0D7E0;
  text-align: left;
  vertical-align: top;
}
.comparison-table thead th {
  background: #F4F6F9;
  font-weight: 700;
  color: #1A2332;
}
.comparison-table tbody tr:nth-child(even) { background: #FAFBFC; }
.comparison-table code {
  font-size: 12px;
  background: #E8EDF4;
  padding: 1px 4px;
  border-radius: 3px;
  font-family: monospace;
}

/* 更新日表示 */
.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-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; }

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

/* リセットボタン */
.demo-controls {
  display: flex;
  justify-content: flex-end;
  max-width: 520px;
  margin-top: 24px;
}
.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 以下 */
@media (max-width: 480px) {
  .demo-container { padding: 16px; }
  .fs2-pattern { max-width: 100%; }
  .demo-controls { max-width: 100%; }
  .ms-side { min-width: 76px; }
}
