/* ============================================================================
   グローバル設定
============================================================================ */
:root {
  --col-seq-width: 36px;
}

html,
body {
  touch-action: manipulation;
  display: block;
  justify-content: center;
  font-family: sans-serif;
  padding: 2px;
  background: #F2F9F2;
  color: #333;
}

.container {
  width: 100%;
  max-width: 480px;
}

@media (min-width: 481px) {
  body {
    display: flex;
    justify-content: center;
    /* 横中央 */
  }
}

button,
.btn-modal,
.btn-refresh,
.btn-qr {
  touch-action: manipulation;
  cursor: pointer;
  text-align: center
}

.card {
  background: #ffffff;
  /* padding: 1px 16px 2px 16px;*/
  padding: 10px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* ============================================================================
   ボタン共通
============================================================================ */
.btn-modal {
  width: 100%;
  padding: 12px;
  font-size: 17px;
  margin: 10px 0;
  border: none;
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  display: block;
  box-sizing: border-box;
}

.btn-blue {
  background: #4285f4;
}

.btn-green {
  background: #28a745;
}

.btn-red {
  background: #d9534f;
}

.btn-gray {
  background: #a9a9a9 !important;
  color: #f0f0f0 !important;
  cursor: not-allowed !important;
  opacity: 0.85;
  transition: none;
}

h2 {
  font-size: 20px;
}

/* ============================================================================
   モーダル
============================================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
}

#modal,
#modalConfirm,
#modalDeleteConfirm {
  z-index: 20;
}

#modalManage,
#modalRegister,
#modalDone,
#modalTutorial {
  z-index: 10;
}

#modalRegister input {
  width: 100%;
  padding: 12px;
  font-size: 17px;
  border: 1px solid #ccc;
  border-radius: 6px;
  margin-bottom: 14px;
  box-sizing: border-box;
}

#modalSmartPass label {
  text-align: left;
  /* これで確実に左寄せ */
  margin-bottom: 8px;
}

.modal-box {
  background: #fff;
  padding: 20px;
  width: 85%;
  max-width: 360px;
  border-radius: 10px;
  font-size: 17px;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.15);
}

.modal-message {
  margin-bottom: 20px;
  line-height: 1.5;
}

/* ============================================================================
   受付状況表示
============================================================================ */
#statusArea {
  font-size: 17px;
  line-height: 1.3;
  font-weight: 500;
  color: #333;


  border-top: 2px solid #4A90E2;
  ;
  padding: 8px 0;
}

#statusArea .status-title {
  font-weight: 700;
  margin-bottom: 6px;
}

#statusArea .info-main {
  font-weight: 600;
  color: #333;
  line-height: 1.6;
}

#statusArea .info-last {
  border-bottom: 2px solid #4A90E2;
  padding-bottom: 6px;
  margin-bottom: 6px;
}

/* 患者登録ボタンの点滅アニメーション */
@keyframes blink {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
  100% {
    opacity: 1;
  }
}

#registerBtn.blinking {
  animation: blink 1s infinite;
}

#registerBtn {
  background: #ff9800 !important;
}

/* ============================================================================
   初回チュートリアル
============================================================================ */
.tutorial-box {
  background: #fff;
  padding: 16px 20px;
  border-radius: 8px;
  max-width: 360px;
  width: 90%;
  line-height: 1.5;
}

.tut-title {
  font-size: 20px;
  text-align: center;
  margin-bottom: 10px;
}

.tut-body p {
  margin: 17px 0;
  font-size: 17px;
}

.tut-body strong {
  font-weight: 600;
}

.tut-footer {
  margin-top: 17px;
  text-align: center;
  font-size: 17px;
}

.tut-footer label {
  display: block;
  margin-bottom: 17px;
}

.btn-close {
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 6px;
  background: #6A84FD;
  color: #fff;
  font-size: 17px;
}

/* ============================================================================
   家族リスト (grid UI)
============================================================================ */
.family-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.family-row {
  display: grid;
  grid-template-columns: var(--col-seq-width) 1fr 80px 60px;
  column-gap: 4px;
  align-items: center;
  padding: 4px 0;
  margin-bottom: 4px;
}

.col-icon {
  display: flex;
  justify-content: center;
  align-items: center;
}

.family-name {
  font-size: 20px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  line-height: 32px;
  height: 32px;
}

.family-meta {
  grid-column: 2 / 5;
  font-size: 16px;
  color: #555;
  white-space: nowrap;
}

.seq {
  background: #e7f0ff;
  color: #1e67d1;
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
  padding: 4px 0;
  border-radius: 6px;
  min-width: var(--col-seq-width);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.family-divider {
  grid-column: 1 / 5;
  height: 1px;
  background: #e5e5e5;
  margin-top: 3px;
}

/* ============================================================================
   WEB問診 / 管理ボタン
============================================================================ */
.btn-manage,
.btn-web,
.btn-web-done {
  height: 32px;
  font-size: 17px;
  border-radius: 4px;
  padding: 0;
  box-sizing: border-box;
  align-items: center;
  justify-self: end;
  text-align: center;
}

.btn-manage {
  width: 50px;
  background: #920c0c;
  color: #fff;
  border: none;
}

.btn-web {
  width: 70px;
  background: #ff6b6b;
  color: #fff;
  border: none;
}

.btn-web-done {
  width: 70px;
  background: #3bdf1a;
  color: #f0f0f0;
  border: none;
  cursor: not-allowed;
  opacity: 0.8;
}

/* ============================================================================
   チェックボックス
============================================================================ */
.chkReserve,
.chkDisabled {
  width: var(--col-seq-width);
  display: flex;
  justify-content: center;
  align-items: center;
}

.chkDisabled {
  cursor: not-allowed;
  opacity: 0.45;
  filter: grayscale(100%);
}

/* ============================================================================
   WEB未問診
============================================================================ */
.web-alert {
  grid-column: 2 / 5;
  font-size: 14px;
  color: red;
  font-weight: bold;
  text-align: left;
  margin: 3px 0 2px;
  line-height: 1.3;
  animation: blink 1.2s infinite;
}

@keyframes blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.2;
  }
}

/* ============================================================================
   QR コードビュー
============================================================================ */
.btn-qr {
  background: #4A90E2;
  color: #fff;
  font-size: 16px;
  padding: 4px 8px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.35;
  /* ★追加：行間圧縮 */
}

.btn-refresh {
  position: relative;
  background: #4A90E2;
  color: #fff;
  font-size: 17px;
  padding: 4px 8px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  height: 50px;
  align-items: center;
  justify-content: center;
}

@keyframes blink {
  0% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}

#notice {
  background-color: red;
  animation: blink 1s infinite;
  position: absolute;
  top: 1rem;
  right: 0;
  z-index:100;
  display:none;
}

.qr-fullscreen {
  position: fixed;
  inset: 0;
  background: #fff;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  overflow: hidden;
}

.qr-scroll {
  flex: 1;
  width: 100%;
  height: 100vh;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

.qr-slide {
  height: 100vh;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 160px;
  scroll-snap-align: start;
  flex-shrink: 0;
}

.qr-name {
  font-size: 30px;
  font-weight: bold;
  text-align:center;
  margin-bottom:15px;
}

.qr-box {
  position: relative;
  border: 3px solid #333;
  padding: 28px 20px 20px;
  margin: 30px auto 0;
  width: fit-content;
  min-width: 320px;
  box-sizing: border-box;
  border-radius: 16px;
}

.qr-seqtitle {
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  font-size: 30px;
  font-weight: bold;
  background: #fff;
  padding: 0 16px;
  line-height: 1.2;
  white-space: nowrap;
}

.qr-seqtitle span {
  display: inline-block;
}

.qr-seq {
  text-align: center;
  font-size: 100px;
  font-weight: bold;
  margin: -10px 0;
}

.qr-notice {
  margin-top: 0;
  font-size: 20px;
  color: red;
  text-align: center;
}

.qr-pid {
  font-size: 20px;
  margin-top: 10px;
  color: #555;
  text-align: center;
}

.qr-code {
  width: 120px;
  height: 120px;
  margin:0 auto 15px;
}

.qr-hint-top,
.qr-hint-bottom {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  z-index: 10001;
  pointer-events: auto;
  cursor: pointer;

  background: rgba(0, 102, 255, 0.9);
  padding: 6px 16px;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  border: 2px solid #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);

  animation: hint-blink 1s infinite, hint-float 1s infinite ease-in-out;
}

.qr-hint-top {
  top: 20px;
}

.qr-hint-bottom {
  bottom: 20px;
}

@keyframes hint-blink {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.55;
  }
}

@keyframes hint-float {
  0%, 100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(4px);
  }
}

/* =====================================================================
   受付状況タイトルのステータス色
===================================================================== */
#status-label,
#openstatus-label {
  margin-left: 4px;
  font-weight: 600;
}

.status-open {
  color: #2ecc71;
}

.status-stop {
  color: #e67e22;
}

.status-closed {
  color: #e74c3c;
}

/* 下部エリアを左右2カラム構成にする */
.reception-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  /* ← 縦中央揃え */
  margin-top: 4px;
  gap: 10px;
  /* 左右の隙間 */
}

/* 左側（最終受付時刻・上限人数） */
.reception-info {
  font-size: 17px;
  color: #333;
  line-height: 1.5;
}

/* 右側（患者登録ボタン） */
.btn-register {
  position: relative;
  top: 2px;
}

.modal-divider {
  margin: 14px 0;
  border: none;
  border-top: 3px solid #ccc;
  width: 100%;
  opacity: 0.8;
}

.arrived {
  color: #2ecc71;
  /* 明るい緑（status-open と統一） */
  font-weight: 700;
}

/* ============================================================
   操作カード（ログアウト／初めての方／ヒント）
   ※ 既存 card のデザインをそのまま使う
=========================================================== */
.action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-start;
}

.action-btn {
  flex: 0 0 auto;
  width: auto;
  height: 42px;
  padding: 0 14px;
  border: none;
  border-radius: 6px;
  font-size: 17px;
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
}

/* 既存カラーパターンを踏襲 */
.gray {
  background: #777;
  /* 落ち着いたグレー（logout に自然） */
}

.blue {
  background: #4285f4;
  /* 既存の btn-blue と同じカラー */
}

.green {
  background: #28a745;
  /* 既存の btn-green と同じカラー */
}

.red {
  background: #e74c3c;
  /* 赤（警告・削除などに使用） */
}

/* =====================================================
   患者登録モーダル：radio 補正
===================================================== */
#modalRegister input[type="radio"] {
  width: auto;
  padding: 0;
  margin-right: 6px;
}

.scroll-area {
  max-height: 400px;
  overflow-y: auto;
  /* スクロール可能にする */
}

.time-table {
  margin-bottom: 20px;
}

.time-table h3 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 10px;
}

ul {
  padding: 0;
  list-style: none;
}

.time-slot {
  padding: 10px;
  font-size: 16px;
  border: 1px solid #ccc;
  margin: 5px 0;
  text-align: center;
  cursor: pointer;
  border-radius: 6px;
  transition: background-color 0.3s;
}

.time-slot:hover {
  background-color: #f0f8ff;
}

/* 状態による色分け */
.time-slot.available {
  background-color: #28a745;
  color: #fff;
}

.time-slot.unavailable {
  background-color: #d9534f;
  color: #fff;
  cursor: not-allowed;
}

/* 注釈スタイル */
.status-note {
  font-size: 14px;
  margin-bottom: 20px;
  color: #333;
}

.status-note p {
  margin: 5px 0;
}

.status-note .status-green {
  background-color: #28a745;
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
}

.status-note .status-red {
  background-color: #ff6b6b;
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
}

.status-note .status-grey {
  background-color: #d9534f;
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
}

/* 時間帯のスタイル */
.time-slot {
  padding: 10px;
  font-size: 16px;
  border: 1px solid #ccc;
  margin: 5px 0;
  text-align: center;
  cursor: pointer;
  border-radius: 6px;
  transition: background-color 0.3s;
}

/* クリック時の色分け */
.time-slot.available {
  background-color: #28a745;
  color: #fff;
}

.time-slot.unavailable {
  background-color: #ff6b6b;
  color: #fff;
  cursor: not-allowed;
}

.time-slot.disabled {
  background-color: #d9534f;
  color: #fff;
  cursor: not-allowed;
}

.fever {
  background: #e7f0ff;
  color: 1111;
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
  padding: 4px 0;
  border-radius: 6px;
  min-width: var(--col-seq-width);
  display: inline-flex;
  align-items: center;
}


/* テーブル部分 */
.timetable table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.timetable table caption {
  visibility: hidden;
}

.timetable table th,
.timetable table td {
  padding: 6px;
  text-align: center;
  border: 1px solid #ddd;
  font-size: 14px;
}

.timetable table th {
  background-color: #f4f4f4;
  color: #333;
}

/* 〇の文字を緑色に */
.timetable table td.open {
  color: #28a745;
  /* 〇の文字を緑色に */
}

#lineBadge {
  display: inline-block;
  margin-left: 1px;
  padding: 2px 6px;
  border-radius: 6px;
  font-weight: 700;
  line-height: 1;
  background: #ff9800;
  color: #fff;
  vertical-align: middle;
}

#specialBadge {
  display: inline-block;
  margin-left: 1px;
  padding: 2px 6px;
  border-radius: 6px;
  font-weight: 700;
  line-height: 1;
  background: #4caf50;
  color: #fff;
  vertical-align: middle;
}

#notifyBadge {
  display: inline-block;
  margin-left: 1px;
  padding: 2px 6px;
  border-radius: 6px;
  font-weight: 700;
  line-height: 1;
  background: #2196f3;
  color: #fff;
  vertical-align: middle;
}

/* 通知設定モーダル */
#notificationModal {
  display: none;
}

#notificationModal .modal-box {
  padding: 20px;
  background: #fff;
  border-radius: 10px;
  width: 80%;
  max-width: 400px;
  text-align: center;
}

#notificationModal input[type="checkbox"] {
  margin: 10px;
}

#notificationModal select {
  margin: 10px;
  padding: 5px;
  border-radius: 4px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-start;
}

.wrap_timetable {
  display: flex;
  /* ← これで子要素が横並び */
  justify-content: space-between;
  /* 左右に振り分けたい場合 */
  align-items: center;
  /* 縦位置そろえ */
  gap: 10px;
  /* すき間（お好みで） */
}

.info-cta-wrap {
  margin: 16px 0 0;
  text-align: center;
}

.info-line-btn {
  display: inline-block;
  min-width: 10em;
  padding: 12px 18px;
  border-radius: 999px;
  background: #06c755;
  color: #fff;
  text-decoration: none;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.info-line-btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.info-line-btn:active {
  transform: translateY(0);
}

.info-line-btn:focus-visible {
  outline: 2px solid #06c755;
  outline-offset: 3px;
}

/* ==========================================================================
   予約確認モーダル
============================================================================ */
#modalReserveInfo {
  z-index: 20;
}

.reserve-info-name {
  margin: 0 0 12px;
  font-size: 22px;
}

.reserve-info-list {
  margin: 0;
  padding: 0;
}

.reserve-info-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid #e5e5e5;
}

.reserve-info-row:last-child {
  border-bottom: 1px solid #e5e5e5;
}

.reserve-info-label {
  flex: 0 0 8.5em;
  font-weight: 700;
  color: #555;
}

.reserve-info-value {
  flex: 1 1 auto;
  min-width: 0;
  color: #333;
  word-break: break-word;
}

.reserve-info-note {
  margin-top: 12px;
  font-size: 14px;
  color: #666;
  line-height: 1.5;
}

/* ============================================================================
   予約確認モーダル
============================================================================ */
#modalReserveInfo {
  z-index: 20;
}

#modalReserveInfo .modal-box {
  max-width: 380px;
}

#reserveInfoName {
  margin: 0 0 14px;
  font-size: 20px;
  text-align: center;
}

#reserveInfoBody {
  line-height: 1.8;
  font-size: 17px;
  border-top: 1px solid #e5e5e5;
  border-bottom: 1px solid #e5e5e5;
  padding: 14px 0;
  margin-bottom: 18px;
  word-break: break-word;
}