/* まるっとヘルスラボ — きょう（route 'home'）。クラスは home- ではじめる */
.home { display: flex; flex-direction: column; gap: 12px; }

/* ---------- あたま ---------- */
.home-head { display: flex; flex-direction: column; gap: 10px; padding: 2px 2px 0; }
.home-head-row { display: flex; align-items: center; gap: 12px; }
.home-head-main { flex: 1; min-width: 0; }
.home-date { font-size: 16px; font-weight: 700; color: var(--ink-2); line-height: 1.4; }
.home-name { font-size: 24px; font-weight: 800; line-height: 1.35; }
.home-weekno { margin-top: 2px; }
.home-streak {
  flex: 0 0 auto; display: grid; grid-template-columns: auto auto; align-items: baseline; justify-items: center;
  min-width: 92px; padding: 8px 12px 6px; border-radius: var(--radius); background: var(--paper); border: 2px solid var(--fumi-soft);
  box-shadow: var(--shadow); text-align: center;
}
.home-streak-num { font-size: 30px; font-weight: 800; line-height: 1; color: var(--fumi); justify-self: end; }
.home-streak-unit { font-size: 15px; font-weight: 800; color: var(--fumi); justify-self: start; padding-left: 2px; }
.home-streak-label { grid-column: 1 / -1; font-size: 13px; font-weight: 700; color: var(--ink-2); line-height: 1.4; margin-top: 2px; }
.home-head-say .say { animation: dl-up .3s ease; }

/* ---------- 日曜のひとこと ---------- */
.home-weekly { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; background: linear-gradient(180deg, var(--paper) 0%, var(--paper-2) 100%); }
.home-weekly-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.home-weekly-num { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.home-weekly-big { font-size: 30px; font-weight: 800; line-height: 1.1; }

/* ---------- 体重の知らせ ---------- */
.home-body { display: flex; flex-direction: column; gap: 12px; border-color: var(--miso-soft); }
.home-body-row { display: flex; align-items: center; gap: 12px; }
.home-body-chr { flex: 0 0 64px; width: 64px; }
.home-body-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.home-body-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.home-body-actions .btn-primary { flex: 1 1 200px; }
.home-body-actions .btn-small { min-height: 44px; }

/* ---------- きょうのメニュー ---------- */
.home-menu { display: flex; flex-direction: column; gap: 8px; padding: 14px 12px; }
.home-menu-min { font-weight: 700; white-space: nowrap; }
.home-menu-right { display: flex; align-items: center; gap: 4px; }
.home-menu-title { font-size: 16px; font-weight: 700; color: var(--ink-2); margin-top: -4px; }
.home-menu-note { margin-top: -6px; }
/* 済んだもの：棒と数を1行に */
.home-menu-prog { display: flex; align-items: center; gap: 10px; }
.home-menu-prog .progress { flex: 1; min-width: 0; }
.home-menu-prog:empty { display: none; }
.home-prog-text { flex: 0 0 auto; display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.home-prog-num { font-size: 17px; font-weight: 800; }
.home-sub { font-size: 15px; font-weight: 800; color: var(--ink-2); margin-top: 2px; padding-top: 8px; border-top: 1px dashed var(--line); }
.home-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.home-item { border-radius: var(--radius-s); background: var(--paper); border: 1px solid var(--line); padding: 6px 10px; transition: background .2s, border-color .2s; }
.home-item.is-done { background: var(--ok-soft); border-color: transparent; }
.home-item-row { display: flex; align-items: center; gap: 10px; min-height: 48px; }
.home-check { flex: 0 0 48px; width: 48px; height: 48px; font-size: 24px; }
.home-check:not(.is-on):hover { border-color: var(--ok); }
.home-item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.home-item-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; line-height: 1.4; }
.home-item-amount { font-size: 15px; font-weight: 700; color: var(--ink-2); }
.home-item-name { font-size: 16px; font-weight: 800; line-height: 1.45; }
.home-item-link {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 44px;
  padding: 2px 0; border: 0; background: transparent; text-align: left; color: inherit; font: inherit;
}
/* 運動の行：種類・量・名前をまとめた1つのボタン */
.home-item-open { flex-direction: column; align-items: stretch; justify-content: center; gap: 1px; }
.home-item-open .home-item-how { margin-left: auto; }
.home-item-name-text { min-width: 0; }
.home-item-how { flex: 0 0 auto; font-size: 13px; font-weight: 700; color: var(--miso); white-space: nowrap; }
.home-item.is-done .home-item-name-text { color: var(--ink-2); }
.home-item-note { font-size: 14px; color: var(--ink-2); line-height: 1.55; }
/* 習慣：名前だけの1行（説明は「詳しく」の窓） */
.home-item.is-habit { padding: 2px 10px; }
.home-item.is-habit .home-item-row { min-height: 48px; }
.home-item.is-habit .home-item-name { font-size: 15px; }
.home-item.is-habit .home-item-how { font-size: 13px; }
.home-habit-note { margin: 0; line-height: 1.7; }
.home-menu-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }

/* 運動前の安全の確認で「はい」があった人 */
.home-safety { display: flex; flex-direction: column; gap: 4px; }
.home-safety p { margin: 0; }
.home-safety-title { font-size: 16px; font-weight: 800; line-height: 1.5; }
.home-safety-sub { font-size: 14px; }
.home-hold { border-radius: var(--radius-s); border: 1px dashed var(--line); background: var(--paper); }
.home-hold-sum {
  display: flex; align-items: center; min-height: 48px; padding: 6px 12px; cursor: pointer;
  font-size: 16px; font-weight: 800; color: var(--ink-2); list-style: none;
}
.home-hold-sum::-webkit-details-marker { display: none; }
.home-hold-sum::before { content: '›'; display: inline-block; width: 1.2em; font-size: 20px; line-height: 1; transition: transform .2s; }
.home-hold[open] > .home-hold-sum::before { transform: rotate(90deg); }
.home-hold > .home-list { padding: 0 8px 8px; }
.home-hold-title { margin: 0 12px 8px; }

/* お休みの日 */
.home-rest { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-s); background: var(--miso-soft); }
.home-rest-chr { flex: 0 0 64px; width: 64px; }

/* 褒め言葉（その行の下に） */
.home-praise-slot:empty { display: none; }
.home-praise { position: relative; margin: 8px 0 2px; }
.home-praise.is-new .say { animation: dl-pop .38s ease; transform-origin: 30% 80%; }
.home-praise.is-new .say-chr { animation: home-hop .6s ease .1s; }

/* 全部済んだ */
.home-alldone {
  position: relative; display: flex; flex-direction: column; gap: 10px; margin-top: 4px; padding: 14px 12px;
  border-radius: var(--radius); background: var(--ok-soft); border: 2px solid var(--ok);
}
.home-alldone-title { font-size: 19px; font-weight: 800; color: #1f5c38; text-align: center; line-height: 1.4; }
.home-alldone .bubble { background: var(--paper); }
.home-alldone .bubble::before { border-right-color: var(--paper); }
.home-alldone .bubble-text { font-size: 18px; }
.home-alldone.is-new { animation: dl-pop .45s ease; }

/* 小さな演出（きらきら） */
.home-sparks { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.home-spark { position: absolute; font-size: 16px; line-height: 1; opacity: 0; animation: home-spark 1.1s ease-out forwards; }
.home-spark-1 { left: 52px; top: 4px; color: var(--fumi); }
.home-spark-2 { left: 18px; top: 26px; color: var(--keika); animation-delay: .12s; font-size: 12px; }
.home-spark-3 { right: 18px; top: 6px; color: var(--miso); animation-delay: .22s; }
.home-spark-4 { right: 42px; bottom: 6px; color: var(--ok); animation-delay: .3s; font-size: 12px; }
@keyframes home-spark {
  0% { opacity: 0; transform: translateY(6px) scale(.4); }
  35% { opacity: 1; transform: translateY(-4px) scale(1.15); }
  100% { opacity: 0; transform: translateY(-16px) scale(.8); }
}
@keyframes home-hop {
  0%, 100% { transform: translateY(0); }
  40% { transform: translateY(-8px); }
  70% { transform: translateY(1px); }
}

/* ---------- きょうの食事 ---------- */
.home-meals { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; }
.home-bars { display: flex; flex-direction: column; gap: 8px; }
.home-bar-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.home-bar-label { font-size: 16px; font-weight: 800; }
.home-bar-val { font-size: 15px; color: var(--ink-2); white-space: nowrap; }
.home-bar-val b { font-size: 18px; color: var(--ink); }
.home-bar-track { height: 12px; border-radius: 999px; background: var(--paper-2); overflow: hidden; margin-top: 2px; }
.home-bar-fill { height: 100%; border-radius: 999px; background: var(--fumi); transition: width .4s ease; }
.home-bar-protein .home-bar-fill { background: var(--keika); }
.home-bar-carb .home-bar-fill { background: var(--miso); }
.home-bar.is-over .home-bar-fill { background: var(--ink-2); opacity: .55; }
.home-bar-over { font-size: 14px; font-weight: 700; color: var(--ink-2); margin-top: 2px; }
.home-bar-reach { font-size: 14px; font-weight: 700; color: #1f5c38; margin-top: 2px; }
.home-meals-note { margin-top: -2px; }
.home-slots { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.home-slot-top { display: flex; align-items: baseline; justify-content: space-between; gap: 4px; width: 100%; }
.home-slot-top .home-slot-label { flex: 0 0 auto; white-space: nowrap; }
.home-slot-top .home-slot-goal { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.home-meals-right { display: flex; align-items: center; gap: 4px; }
.home-meals-hint { font-size: 13px; white-space: nowrap; }
.home-slot {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0; min-height: 60px; padding: 8px 10px; text-align: left;
  border-radius: var(--radius-s); border: 2px solid var(--line); background: var(--paper); line-height: 1.4;
}
.home-slot:active { transform: scale(.98); }
.home-slot.is-rec { border-color: var(--fumi-soft); background: #fffaf2; }
.home-slot-label { font-size: 16px; font-weight: 800; }
.home-slot-val { font-size: 15px; font-weight: 700; }
.home-slot-val.is-empty { color: var(--fumi); }
.home-slot-goal { font-size: 13px; white-space: nowrap; }

/* ---------- 今週の進みぐあい ---------- */
.home-week { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; }
.home-week-sum { font-size: 15px; font-weight: 800; color: var(--ink-2); white-space: nowrap; }
.home-dots { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.home-dot { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.home-dot-ring {
  position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--paper-2);
}
.home-dot-in {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--paper);
  font-size: 16px; font-weight: 900; color: var(--ok); line-height: 1;
}
.home-dot.is-full .home-dot-ring { background: var(--ok); }
.home-dot.is-full .home-dot-in { background: var(--ok); color: #fff; }
.home-dot.is-future .home-dot-ring { background: transparent; border: 2px dashed var(--line); }
.home-dot.is-future .home-dot-in { background: transparent; }
.home-dot.is-today .home-dot-ring { box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--fumi); }
.home-dot-day { font-size: 14px; font-weight: 700; color: var(--ink-2); }
.home-dot.is-today .home-dot-day { color: var(--fumi); font-weight: 800; }
.home-week-note { font-size: 13px; }

/* ---------- 安全の注意 ---------- */
.home-foot { padding: 0 4px; }
.home-foot-line { margin: 0 0 6px; font-size: 14px; color: var(--ink-2); line-height: 1.6; }
.home-foot-guard { padding: 8px 12px; border-radius: var(--radius-s); background: var(--warn-soft); color: #7a3d10; }

/* やり方の窓（train の画面が無いとき） */
.home-how { margin: 0; padding-left: 1.4em; display: flex; flex-direction: column; gap: 4px; }

/* ---------- 幅 ---------- */
@media (max-width: 370px) {
  .home-name { font-size: 22px; }
  .home-streak { min-width: 84px; padding: 6px 8px 4px; }
  .home-streak-num { font-size: 26px; }
  .home-dot-ring { width: 36px; height: 36px; }
  .home-dot-in { width: 26px; height: 26px; }
  .home-slot { padding: 8px 10px; }
}
