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

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

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

/* ========== トグルスイッチ 共通 ========== */
.tg-switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
  cursor: pointer;
  flex-shrink: 0;
}

/* チェックボックス本体を見えなくする（キーボードフォーカスは残す） */
.tg-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

/* スライドの台座 */
.tg-track {
  position: absolute;
  inset: 0;
  background: #ccc;
  border-radius: 14px;
  transition: background 0.2s;
}

/* スライドのつまみ */
.tg-thumb {
  position: absolute;
  width: 22px;
  height: 22px;
  top: 3px;
  left: 3px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s;
}

/* オン状態: 台座をアクセントカラーに変え、つまみを右に移動する */
.tg-input:checked + .tg-track { background: #2B7FE8; }
.tg-input:checked + .tg-track .tg-thumb { transform: translateX(24px); }

/* キーボードフォーカス時のアウトライン */
.tg-input:focus-visible + .tg-track {
  outline: 2px solid #2B7FE8;
  outline-offset: 2px;
}

/* ========== Pattern 1 — 決定ボタン ========== */
.tg-wrapper {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tg-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tg-label {
  font-size: 14px;
  font-weight: 600;
  color: #1A2332;
}

.tg-submit {
  display: block;
  width: 100%;
  padding: 10px;
  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;
}
.tg-submit:hover { opacity: 0.85; }

.tg-result {
  font-size: 14px;
  min-height: 20px;
}
.tg-result-placeholder {
  margin: 0;
  color: #9AA5B4;
}
.tg-result.has-value {
  padding: 12px;
  border: 1.5px solid #D0D7E0;
  border-radius: 8px;
  text-align: center;
}
.tg-result.has-value.is-on {
  border-color: #22c55e;
  background: #f0fdf4;
}
.tg-result.has-value.is-on .tg-result-value { color: #15803d; }
.tg-result.has-value:not(.is-on) { background: #F9FAFB; }
.tg-result.has-value:not(.is-on) .tg-result-value { color: #374151; }
.tg-result-value {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
}

/* ========== Pattern 2 — 複数の一括管理 ========== */
.tgb-wrapper {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tgb-controls {
  display: flex;
  gap: 8px;
}

.tgb-btn {
  padding: 8px 16px;
  border-radius: 6px;
  border: 1.5px solid;
  cursor: pointer;
  font-size: 13px;
  font-family: sans-serif;
  transition: opacity 0.15s;
}
.tgb-btn:hover { opacity: 0.8; }
.tgb-btn-on  { background: #2B7FE8; color: #fff; border-color: #2B7FE8; }
.tgb-btn-off { background: #fff; color: #374151; border-color: #D0D7E0; }

.tgb-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border: 1.5px solid #E5E7EB;
  border-radius: 8px;
  overflow: hidden;
}

.tgb-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: #fff;
  border-bottom: 1px solid #E5E7EB;
}
.tgb-item:last-child { border-bottom: none; }

.tgb-item-label {
  font-size: 14px;
  color: #1A2332;
}

.tgb-summary {
  font-size: 13px;
  color: #9AA5B4;
  text-align: right;
  margin: 0;
}

/* ========== Pattern 3 — 表示/非表示 ========== */
.tgv-wrapper {
  display: flex;
  flex-direction: column;
}

.tgv-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tgv-label {
  font-size: 14px;
  font-weight: 600;
  color: #1A2332;
}

/* max-height を 0 → 実コンテンツ高さ以上に変化させてスライドアニメーションを実現する */
.tgv-panel {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.35s ease;
}
.tgv-panel.is-open { max-height: 300px; }

.tgv-panel-inner {
  border: 1.5px solid #E5E7EB;
  border-radius: 8px;
  padding: 14px 16px;
  background: #fff;
  margin-top: 10px;
}

.tgv-panel-title {
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 10px;
  color: #1A2332;
}

.tgv-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  font-size: 14px;
  color: #374151;
  cursor: pointer;
}

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

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

/* レスポンシブ */
@media (max-width: 480px) {
  .tg-pattern { max-width: 100%; }
  .demo-container { padding: 16px; }
}
