/* ===========================
   オーバーレイ
=========================== */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 100;
}
.overlay.is-active {
  opacity: 1;
  pointer-events: all;
}
/* ===========================
   モーダルウィンドウ
=========================== */
.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -48%) scale(0.96);
 
  /* 幅・最大高さ */
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 64px); /* 画面から上下32pxずつ余白 */
 
  display: flex;
  flex-direction: column; /* ヘッダー・ボディ・フッターを縦並び */
 
  background: #ffffff;
  border-radius: 16px;
  box-shadow:0 20px 60px rgba(0, 0, 0, 0.18),0 4px 16px rgba(0, 0, 0, 0.08);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 200;
  overflow: hidden;
}
.modal.is-active {
  opacity: 1;
  pointer-events: all;
  transform: translate(-50%, -50%) scale(1);
}
/* ✕ 閉じるボタン */
.modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  background: #f1f5f9;
  border: none;
  border-radius: 50%;
  font-size: 1rem;
  color: var(--main-color);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
  z-index: 1;
  font-family: inherit;
}
.modal__close:hover {
  background: #e2e8f0;
  color: #1e293b;
}
/* ヘッダー（固定） */
.modal__header {
  flex-shrink: 0;
  padding: 24px 28px 16px;
  border-bottom: 1px solid #e2e8f0;
}
.modal__title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1a202c;
  padding-right: 40px; /* ✕ボタンと重ならないよう余白 */
}
/* 本文（スクロール可能） */
.modal__body {
  flex: 1 1 auto;   /* 余白を埋める・縮む */
  overflow-y: auto; /* 内容が多い場合スクロール */
  padding: 20px 28px;
  color: #475569;
  font-size: 0.95rem;
  line-height: 1.8;
 
  /* スクロールバーを細くおしゃれに */
  scrollbar-width: thin;
  scrollbar-color: #cbd5e0 transparent;
}
.modal__body::-webkit-scrollbar {
  width: 6px;
}
.modal__body::-webkit-scrollbar-track {
  background: transparent;
}
.modal__body::-webkit-scrollbar-thumb {
  background: #cbd5e0;
  border-radius: 3px;
}
/* フッター（固定） */
.modal__footer {
  flex-shrink: 0;
  padding: 14px 28px 20px;
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid #e2e8f0;
}
.btn-close-footer {
  padding: 10px 28px;
  background: var(--main-color);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
}
.btn-close-footer:active {
  transform: scale(0.97);
}
/* ===========================
   アクセシビリティ
=========================== */
@media (prefers-reduced-motion: reduce) {
  .modal, .overlay, .tips_btn, .btn-close-footer {
    transition: none;
  }
}
/* ===========================
   レスポンシブ
=========================== */
@media (max-width: 480px) {
  .modal__header {
    padding: 20px 20px 14px;
  }
 
  .modal__body {
    padding: 16px 20px;
  }
 
  .modal__footer {
    padding: 12px 20px 16px;
  }
 
  .btn-close-footer {
    width: 100%;
    text-align: center;
  }
}
 
