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

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

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

/* ===== Datepicker 共通 ===== */
.dp-wrap {
  position: relative;
  display: inline-block;
}

.dp-field {
  display: inline-flex;
  flex-direction: column;
}

.dp-input-row {
  display: flex;
  align-items: center;
}

.dp-input {
  width: 140px;
  padding: 7px 10px;
  font-size: 14px;
  border: 1px solid #D0D7E0;
  border-radius: 4px 0 0 4px;
  outline: none;
  font-family: sans-serif;
  transition: border-color 0.15s;
  color: #1A2332;
}
.dp-input:focus { border-color: #2B7FE8; }
.dp-input.is-error { border-color: #E53E3E; }

.dp-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid #D0D7E0;
  border-left: none;
  border-radius: 0 4px 4px 0;
  background: #fff;
  color: #5A6A7A;
  cursor: pointer;
  transition: background 0.15s;
  flex-shrink: 0;
}
.dp-icon-btn:hover { background: #F4F6F9; }

.dp-error {
  min-height: 16px;
  margin: 4px 0 0;
  font-size: 12px;
  color: #E53E3E;
  line-height: 1.4;
}

/* カレンダーポップアップ */
.dp-calendar {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 200;
  background: #fff;
  border: 1px solid #D0D7E0;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  padding: 12px;
  width: 270px;
}
.dp-calendar.is-open { display: block; }

/* カレンダーヘッダー */
.dp-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.dp-cal-title {
  font-size: 14px;
  font-weight: 700;
  color: #1A2332;
}

.dp-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
  background: none;
  border: 1px solid #D0D7E0;
  border-radius: 4px;
  cursor: pointer;
  color: #5A6A7A;
  transition: background 0.15s;
  font-family: sans-serif;
}
.dp-nav-btn:hover { background: #F4F6F9; }

/* 曜日ヘッダー */
.dp-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 4px;
}

.dp-wd {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: #9AA5B4;
  padding: 3px 0;
}
.dp-wd--sun { color: #E53E3E; }
.dp-wd--sat { color: #2B7FE8; }

/* カレンダーグリッド */
.dp-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.dp-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  font-size: 13px;
  border-radius: 4px;
  cursor: pointer;
  color: #1A2332;
  transition: background 0.1s;
  user-select: none;
}
.dp-cell:hover { background: #EFF4FD; }

.dp-cell--other-month {
  color: #C5CAD4;
  cursor: default;
}
.dp-cell--other-month:hover { background: transparent; }

.dp-cell--sun { color: #E53E3E; }
.dp-cell--sat { color: #2B7FE8; }

/* 今日のハイライト（選択状態でない場合のみ色をつける） */
.dp-cell--today:not(.dp-cell--selected) {
  font-weight: 700;
  color: #2B7FE8;
}

/* 単一選択済みセル（Pattern 1 / 2） */
.dp-cell--selected {
  background: #2B7FE8 !important;
  color: #fff !important;
  border-radius: 50%;
  font-weight: 600;
}

/* ===== Pattern 2: 2ピッカー横並び ===== */
.dp-range-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.dp-range-item {
  display: flex;
  flex-direction: column;
}

.dp-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #5A6A7A;
  margin-bottom: 4px;
}

.dp-range-sep {
  align-self: flex-end;
  padding-bottom: 10px;
  font-size: 18px;
  color: #9AA5B4;
}

/* ===== 決定ボタン・結果 ===== */
.dp-confirm-btn {
  display: inline-block;
  margin-top: 14px;
  padding: 8px 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;
}
.dp-confirm-btn:hover { opacity: 0.85; }

.dp-result {
  margin: 8px 0 0;
  font-size: 14px;
  min-height: 20px;
}
.dp-result.has-value {
  padding: 10px 14px;
  background: #F0F7FF;
  border: 1px solid #2B7FE8;
  border-radius: 6px;
  color: #1A5EA8;
  font-weight: 600;
}
.dp-result.is-error { color: #E53E3E; }

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

.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: 540px) {
  .dp-pattern { max-width: 100%; }
  .demo-container { padding: 16px; }
  .dp-range-row { flex-direction: column; gap: 12px; }
  .dp-range-sep { display: none; }
}
