/* 宠物小屋 for the parents (spec §47.16; pets/parent.js, parent-settings.js): the pet card with its still picture,
   today's four equal tiles, where the month's coins went, the settings list. On a phone (375 / 440) every side-by-side
   group is equal (spec §12): the tiles two by two, the four numbers two by two, every − / + and every choice the same
   width. Light only (spec §45). */
:root {
  --ptp-ctl-w: 172px;
  --ptp-photo: 96px;
}
.ptp-switcher { margin-top: 14px; }
.ptp-switcher[hidden] { display: none; }
.ptp-content { display: grid; gap: var(--gap); }
.ptp-empty { display: flex; align-items: center; gap: 10px; color: var(--text-2); }
.ptp-empty svg { width: 24px; height: 24px; color: var(--peach-ink); }

/* ---------- the pet ---------- */
.ptp-pet { display: grid; gap: 14px; }
.ptp-pet.skeleton { min-height: 236px; border-radius: var(--r-l); }
.ptp-pet-head { display: grid; grid-template-columns: var(--ptp-photo) minmax(0, 1fr); align-items: center; gap: 14px; }
.ptp-photo { display: grid; place-items: center; width: var(--ptp-photo); height: var(--ptp-photo); overflow: hidden; border-radius: 26px; background: radial-gradient(circle at 50% 36%, var(--surface), var(--peach-soft)); }
.ptp-photo-img { width: 94%; height: 94%; object-fit: contain; }
.ptp-photo--off .ptp-photo-img, .ptp-photo--paused .ptp-photo-img { opacity: 0.55; }
.ptp-pet-text { display: grid; gap: 4px; min-width: 0; }
.ptp-pet-name-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ptp-pet-name { min-width: 0; font-size: 24px; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ptp-stage { flex: none; padding: 2px 10px; border-radius: var(--r-pill); background: var(--peach-soft); color: var(--peach-ink); font-size: 13px; font-weight: 800; }
.ptp-pet-sub { font-size: 14px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ptp-growth { display: grid; grid-template-columns: 36px minmax(0, 1fr); align-items: center; gap: 10px; }
.ptp-growth-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: var(--peach-soft); color: var(--peach-ink); }
.ptp-growth-icon svg { width: 22px; height: 22px; }
.ptp-growth-body { display: grid; gap: 6px; min-width: 0; }
.ptp-growth-text { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 14px; font-weight: 700; line-height: 1.35; }
.ptp-bar { position: relative; display: block; height: 8px; overflow: hidden; border-radius: var(--r-pill); background: var(--pt-bar-bg); }
.ptp-bar-fill { position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(90deg, var(--pt-grow-light), var(--pt-grow)); transform-origin: left center; }
.ptp-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 8px; }
.ptp-stat { display: grid; align-content: center; gap: 6px; min-width: 0; height: 100%; padding: 10px 12px; border-radius: var(--r-s); background: var(--surface-2); }
.ptp-stat-head { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 14px; font-weight: 700; }
.ptp-stat-head svg { flex: none; width: 18px; height: 18px; color: var(--pt-food); }
.ptp-stat-label { white-space: nowrap; }
.ptp-stat-num { margin-left: auto; color: var(--text-2); }
.ptp-stat .ptp-bar-fill { background: linear-gradient(90deg, var(--pt-food-light), var(--pt-food)); }
.ptp-stat[data-stat="joy"] svg { color: var(--pt-joy); }
.ptp-stat[data-stat="joy"] .ptp-bar-fill { background: linear-gradient(90deg, var(--pt-joy-light), var(--pt-joy)); }
.ptp-stat[data-stat="energy"] svg { color: var(--pt-energy); }
.ptp-stat[data-stat="energy"] .ptp-bar-fill { background: linear-gradient(90deg, var(--pt-energy-light), var(--pt-energy)); }
.ptp-stat[data-stat="clean"] svg { color: var(--pt-clean); }
.ptp-stat[data-stat="clean"] .ptp-bar-fill { background: linear-gradient(90deg, var(--pt-clean-light), var(--pt-clean)); }
.ptp-cert-btn { margin-top: 2px; }
.ptp-cert-btn svg { color: var(--ptc-gold); }

/* ---------- 今天 ---------- */
.ptp-label { margin-top: 18px; }
.ptp-label--sub { margin-top: 22px; }
.ptp-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: var(--gap); }
.ptp-tile { display: grid; align-content: start; gap: 4px; min-width: 0; height: 100%; padding: 12px 14px; border-radius: var(--r-m); background: var(--surface); box-shadow: var(--shadow-1); }
.ptp-tile.skeleton { min-height: 96px; }
.ptp-tile-label { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 13px; font-weight: 700; color: var(--text-2); white-space: nowrap; }
.ptp-tile-label svg { flex: none; width: 18px; height: 18px; color: var(--peach-ink); }
.ptp-tile-value { display: flex; align-items: baseline; gap: 4px; min-width: 0; white-space: nowrap; overflow: hidden; }
.ptp-tile-value strong { font-family: var(--font-rounded); font-size: 26px; font-weight: 800; }
.ptp-tile-unit { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 13px; color: var(--text-3); }
.ptp-tile-sub { min-height: 1.35em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--text-3); }
.ptp-line { display: flex; align-items: center; gap: 8px; margin: 10px 4px 0; font-size: 14px; color: var(--text-2); }
.ptp-line svg { flex: none; width: 18px; height: 18px; color: var(--peach-ink); }
.ptp-line span { min-width: 0; }

/* ---------- 设置 ---------- */
.ptp-set-list + .ptp-set-list { margin-top: var(--gap); }
.ptp-set-row { min-height: 60px; }
.ptp-set-row .row-main { min-width: 0; }
.ptp-stepper { justify-content: space-between; width: var(--ptp-ctl-w); }
.ptp-stepper .stepper-value { flex: 1; min-width: 0; font-size: 16px; white-space: nowrap; }
.ptp-seg { flex: none; width: var(--ptp-ctl-w); }
.ptp-set-btn { flex: none; }
.ptp-hint { display: flex; align-items: flex-start; gap: 8px; margin: 0; padding: 0 16px 14px; font-size: 13px; line-height: 1.5; color: var(--text-2); }
.ptp-hint svg { flex: none; width: 16px; height: 16px; margin-top: 2px; color: var(--peach-ink); }
.ptp-set-sub { min-height: 52px; }
.ptp-voice-pick { display: flex; flex: 1; align-items: center; gap: 12px; min-width: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; }
.ptp-voice-pick:disabled { opacity: 1; }
.ptp-voice-dot { display: grid; flex: none; place-items: center; width: 26px; height: 26px; border: 2px solid var(--line-strong); border-radius: 50%; color: var(--surface); }
.ptp-voice-dot svg { width: 16px; height: 16px; }
.ptp-voice-pick[aria-checked="true"] .ptp-voice-dot { border-color: var(--leaf); background: var(--leaf); }
.ptp-foot { margin: 8px 0 24px; text-align: center; font-size: 12px; color: var(--text-3); }

/* The certificate in a sheet. */
.ptp-cert { display: grid; justify-items: center; padding-bottom: 8px; }
.ptp-cert .ptc-card { width: 100%; box-shadow: inset 0 0 0 6px var(--ptc-paper-1), inset 0 0 0 8px var(--ptc-gold-2); }

/* An iPad or a wide window: the four numbers in one row. */
@media (min-width: 700px) {
  .ptp-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ptp-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 380px) {
  :root { --ptp-ctl-w: 156px; --ptp-photo: 84px; }
}
