/* 見守りお天気 親カード・帯グラフ（担当 B）。app.css の変数を使う */

.parent-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.parent-card-name { margin: 0; font-size: 1.5rem; }
.parent-card-values { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 20px; margin: 0 0 12px; }
.parent-card-values div { border-bottom: 1px solid var(--c-border); padding: 6px 0; }
.parent-card-values dt { font-size: .9rem; color: var(--c-muted); }
.parent-card-values dd { margin: 0; font-size: 1.25rem; font-weight: bold; }
.parent-card-alert { background: var(--c-yellow-soft); border: 2px solid var(--c-yellow); border-radius: var(--radius); padding: 10px 14px; font-weight: bold; }
.parent-card-masked { background: var(--c-gray-soft); border: 2px solid var(--c-gray); border-radius: var(--radius); padding: 14px; font-size: 1.15rem; font-weight: bold; }
.ping-note { font-size: .9rem; margin: 8px 0 0; }
.ping-notice { font-size: .95rem; font-weight: 700; color: #b3261e; margin: 6px 0 0; }
.ping-result { font-weight: bold; margin: 6px 0 0; min-height: 1.5em; }
.parent-links { margin-bottom: 20px; }
.pairing-connected { border: 2px solid var(--c-green); background: var(--c-green-soft); }

/* 帯グラフ（JS 無し・CSS だけ。24 マス × 日数。0 番目＝4 時台） */
.band { display: flex; flex-direction: column; gap: 4px; margin: 12px 0; overflow-x: auto; }
.band-row { display: flex; align-items: center; gap: 8px; min-width: 520px; }
.band-label { flex: 0 0 96px; font-size: .9rem; }
.band-cells { flex: 1; display: grid; grid-template-columns: repeat(24, 1fr); gap: 2px; }
.band-head .band-cells { grid-template-columns: repeat(6, 1fr); font-size: .8rem; color: var(--c-muted); }
.band-cell { display: inline-block; height: 22px; min-width: 10px; border-radius: 3px; background: var(--c-gray-soft); }
.band-legend .band-cell { width: 18px; height: 18px; vertical-align: middle; margin-left: 8px; }
.band-lv0 { background: #e3e8ee; }
.band-lv1 { background: #a9c8e6; }
.band-lv2 { background: #5b8fc2; }
.band-lv3 { background: var(--c-primary-dark); }
.band-lvnone { background: repeating-linear-gradient(45deg, #fff, #fff 3px, #e3e8ee 3px, #e3e8ee 6px); }

.join-request { border-bottom: 1px solid var(--c-border); padding: 8px 0 12px; }
.invite-new { background: var(--c-green-soft); border: 2px solid var(--c-green); border-radius: var(--radius); padding: 12px; margin-bottom: 12px; }
.invite-new input { width: 100%; font-size: 1rem; padding: 10px; }

/* ボタンの説明（設定・家族が何をする画面かを押す前に分かるようにする） */
.ping-result:empty { display: none; }
.ping-result { margin: 12px 0 0; padding: 10px 14px; border-radius: 10px; background: #e8f5e9; border: 1px solid #b7dfba; color: #1b5e20; font-weight: 700; }
.ping-result-ng { background: #fdf3f2; border-color: #f2c4bf; color: #b3261e; }
.button-guide { margin: 26px 0 4px; padding: 16px 18px 18px; background: #f5f8fc; border: 1px solid #dbe5f0; border-radius: 14px; }
.button-guide-title { margin: 0 0 12px; font-size: .82rem; font-weight: 700; letter-spacing: .12em; color: #5b6b7b; cursor: pointer; }
.button-guide:not([open]) .button-guide-title { margin-bottom: 0; }
.button-guide-list { margin: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.button-guide-item { padding: 12px 14px 14px; background: #fff; border-radius: 10px; border-top: 3px solid #1f4e79; box-shadow: 0 1px 2px rgba(31, 78, 121, .06); }
.button-guide-item dt { display: flex; align-items: center; gap: 8px; font-size: 1.02rem; font-weight: 700; color: #1f4e79; }
.button-guide-dot { color: #f08a24; font-size: .8rem; line-height: 1; }
.button-guide-item dd { margin: 8px 0 0; font-size: .92rem; line-height: 1.75; color: #3a4658; }
.button-guide-item dd ul { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.button-guide-item dd li { padding: 2px 10px; border-radius: 999px; background: #eef6fc; color: #1f4e79; font-size: .85rem; font-weight: 700; }
.button-guide-item dd p { margin: 8px 0 0; }

.time-range { display: flex; align-items: center; gap: 8px; }
.time-range input { flex: 1; min-width: 0; }

/* ---- スマホ幅（〜600px）の最適化 2026-11-09 ---- */
@media (max-width: 600px) {
  /* 値は 2 列に並べる（1 列だと 7 行で画面 2 枚分になる）。長い値（昨夜の充電・最後の通信）は横いっぱい */
  .parent-card-values { grid-template-columns: 1fr 1fr; gap: 0 14px; }
  .parent-card-values dt { font-size: .8rem; white-space: nowrap; }
  .parent-card-values dd { font-size: 1.12rem; overflow-wrap: anywhere; }
  .parent-card-values div:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .parent-card-head { gap: 8px; }
  /* 「いま確認する」は横いっぱい。残りの 3 つは 1 行に並べる */
  .ping-form .actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .ping-form .actions .btn { width: auto; min-height: 48px; padding: 8px 2px; font-size: .8rem; white-space: nowrap; }
  .ping-form .actions .btn-primary { grid-column: 1 / -1; min-height: 54px; font-size: 1rem; }
  .ping-note { font-size: .8rem; }
  .ping-notice { font-size: .86rem; }
  .button-guide { margin-top: 16px; padding: 12px 14px; }
  .button-guide[open] { padding-bottom: 14px; }
  .button-guide-list { grid-template-columns: 1fr; gap: 10px; }
  /* くわしく見る画面: 設定・家族を招待は横に 2 つ、戻るは横いっぱい（app.css の .actions .btn より強い指定にする） */
  .actions.parent-links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .actions.parent-links .btn { width: auto; padding: 8px 4px; font-size: .88rem; }
  .actions.parent-links .btn:last-child { grid-column: 1 / -1; }
  /* 7日間／30日間の切り替えは横に並べる */
  .actions.days-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .actions.days-switch .btn { width: auto; min-height: 44px; }
  /* 1時間ごとのマス目を、横に送らずに画面の幅に収める */
  .band { overflow-x: visible; }
  .band-row { min-width: 0; gap: 4px; }
  .band-label { flex: 0 0 62px; font-size: .68rem; white-space: nowrap; }
  .band-cells { gap: 1px; }
  .band-cell { min-width: 0; height: 20px; border-radius: 2px; }
  .band-head .band-cells { font-size: .64rem; }
}
