/* ============================================================
   v4: countdown chip, festivals, timeline, calendar, anniversaries,
   notes & journal upgrades, announcements
   ============================================================ */

/* ---------- countdown chip in the sub-HUD ---------- */
.countdown-chip {
  flex-shrink: 1;
  min-width: 0;
  max-width: 132px;
  height: 32px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 4px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .88);
  box-shadow: var(--sh-1);
  font-size: var(--fs-xs);
  font-weight: 800;
  color: #be185d;
}
.countdown-text { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.countdown-chip.is-today { background: linear-gradient(90deg, #fecdd3, #fde68a); animation: badgeWiggle 2s ease-in-out infinite; }
@media (max-width: 400px) { .room-pill-name { display: none; } }

/* ---------- festival decoration layer ---------- */
.festival-layer { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.festival-layer[data-deco=""] { display: none; }
.deco-fall {
  position: absolute;
  top: -40px;
  opacity: .75;
  animation: decoFall 12s linear infinite;
}
.festival-layer[data-deco="snow"] .deco-fall { opacity: .9; filter: drop-shadow(0 0 2px #fff); }
@keyframes decoFall {
  0% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(30px, 55vh) rotate(160deg); }
  100% { transform: translate(-20px, 110vh) rotate(320deg); }
}
.deco-garland { position: absolute; top: calc(max(6px, var(--safe-top)) + 82px); left: 0; right: 0; text-align: center; font-size: 22px; letter-spacing: 18px; animation: heartBeat 3s ease-in-out infinite; }
.deco-moon { position: absolute; top: 120px; right: 18px; width: 70px; height: 70px; border-radius: 50%; background: radial-gradient(circle at 40% 40%, #fffbe8, #fde68a 70%); box-shadow: 0 0 40px 10px rgba(253, 230, 138, .55); }
.fest-part { pointer-events: none; }
.wears-hat > .fest-hat { display: none; }
/* the halo floats above whatever hat it's worn with */
.wears-hat > #costume-cupid { transform: translateY(-34px) scale(1.18); transform-box: fill-box; transform-origin: 50% 100%; }
.festival-layer[data-deco="spooky"] .deco-fall { filter: drop-shadow(0 0 4px rgba(249, 115, 22, .55)); }

/* ---------- announcements & ban ---------- */
.announce-bar {
  position: fixed;
  left: 12px; right: 12px;
  top: calc(max(6px, var(--safe-top)) + 4px);
  z-index: 55;
  max-width: 520px;
  margin: 0 auto;
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 12px 12px 14px;
  border-radius: var(--r-lg);
  background: #fffbeb;
  box-shadow: var(--sh-2), 0 0 0 2px #fde68a;
  font-size: var(--fs-sm);
  transform: translateY(-140%);
  transition: transform .4s var(--ease-spring);
}
.announce-bar.is-in { transform: none; }
.announce-icon { font-size: 22px; }
.announce-main { flex: 1; line-height: 1.5; }
.banned-screen { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: rgba(30, 20, 40, .7); padding: 24px; }
.banned-card { background: #fff; border-radius: var(--r-xl); padding: 28px 24px; text-align: center; max-width: 340px; }
.banned-card h2 { margin: 8px 0; }
.banned-card p { color: var(--ink-2); line-height: 1.6; }

.chip-btn.is-on { background: var(--rose-soft); border-color: var(--rose-2); color: #be123c; }

/* ---------- month calendar ---------- */
.cal-card { padding: 10px 10px 8px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.cal-title { font-weight: 900; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-week { text-align: center; font-size: 11px; color: var(--ink-3); font-weight: 800; padding: 2px 0; }
.cal-cell {
  position: relative;
  aspect-ratio: 1 / 1;
  min-height: 36px;
  border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: var(--fs-sm); font-weight: 700;
  background: #fff;
}
.cal-cell.is-empty { background: transparent; }
.cal-cell.is-future { color: var(--ink-3); }
.cal-cell.is-today { box-shadow: inset 0 0 0 2px var(--rose-2); }
.cal-cell.is-selected { background: var(--rose); color: #fff; }
.cal-cell.is-pressed { transform: scale(.92); }
.cal-fest { position: absolute; top: 1px; right: 2px; font-size: 10px; }
.cal-dots { display: flex; gap: 2px; height: 5px; margin-top: 2px; }
.cal-dots i { width: 5px; height: 5px; border-radius: 50%; }
.cal-cell.is-selected .cal-dots i { box-shadow: 0 0 0 1px #fff; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 8px; font-size: 10px; color: var(--ink-3); }
.cal-legend i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 3px; }

/* ---------- timeline ---------- */
.tl-datebar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.tl-date { flex: 1; display: flex; flex-direction: column; align-items: center; }
.tl-marks { margin-bottom: 8px; justify-content: center; }
.tl-summary { background: linear-gradient(135deg, #ecfdf5, #fff7ed); border-color: #bbf7d0; }
.tl-summary-title { font-weight: 900; text-align: center; margin-bottom: 10px; }
.tl-summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tl-person { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: var(--r-md); background: #fff; font-size: var(--fs-xs); color: var(--ink-2); }
.tl-person b { font-size: var(--fs-sm); color: var(--ink); }
.tl-person.is-a b { color: #0369a1; }
.tl-person.is-b b { color: #be123c; }
.tl-filters { margin-bottom: 10px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; touch-action: pan-x; }
.tl-filters::-webkit-scrollbar { display: none; }
.tl-list { position: relative; padding-left: 4px; }
.tl-list::before { content: ""; position: absolute; left: 62px; top: 8px; bottom: 8px; width: 2px; background: var(--line-2); }
.tl-row { position: relative; display: flex; align-items: flex-start; gap: 10px; padding: 7px 0; }
.tl-time { width: 44px; flex-shrink: 0; font-size: var(--fs-xs); font-weight: 800; color: var(--ink-3); padding-top: 4px; font-variant-numeric: tabular-nums; }
.tl-dot { width: 26px; height: 26px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; background: #fff; box-shadow: 0 0 0 2px var(--line-2); font-size: 13px; z-index: 1; }
.tl-body { flex: 1; min-width: 0; padding: 6px 10px; border-radius: var(--r-md); background: #fff; border: 1px solid var(--line); }
.tl-text { font-size: var(--fs-sm); font-weight: 700; word-break: break-word; }
.tl-sub { font-size: var(--fs-xs); color: var(--ink-3); margin-top: 1px; }
.tl-row.is-visit .tl-body { background: #f0fdf4; border-color: #bbf7d0; }
.tl-row.is-poke .tl-body { background: #fff7ed; border-color: #fed7aa; }
.tl-row.is-note .tl-body { background: #fff1f2; border-color: #fecdd3; }
.tl-row.is-loc .tl-body { background: #eff6ff; border-color: #bfdbfe; }
.tl-row.is-game .tl-body { background: #f5f3ff; border-color: #ddd6fe; }
.tl-row.is-life .tl-body { background: #f0fdfa; border-color: #99f6e4; }
.tl-row.is-link { cursor: pointer; }
.tl-row.is-me .tl-body { border-style: dashed; }
.tl-row.is-live .tl-dot { animation: heartBeat 1.4s ease-in-out infinite; }

/* ---------- anniversaries ---------- */
.anv-hero { text-align: center; padding: 16px; border-radius: var(--r-xl); background: linear-gradient(135deg, #fff1f2, #fdf4ff); border: 1.5px solid #fbcfe8; margin-bottom: 12px; }
.anv-hero-days { font-size: var(--fs-md); font-weight: 700; }
.anv-hero-days b { font-size: 34px; color: var(--rose); margin: 0 4px; }
.anv-hero-since { font-size: var(--fs-xs); color: var(--ink-3); margin-top: 2px; }
.anv-hero-cat { margin-top: 10px; display: inline-flex; gap: 6px; align-items: center; padding: 6px 12px; border-radius: var(--r-pill); background: #fff; font-size: var(--fs-sm); font-weight: 700; text-align: left; }
.anv-tools { margin: 10px 0 4px; }
.anv-line { position: relative; padding-left: 18px; margin-top: 6px; }
.anv-line::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(#fda4af, #c4b5fd); border-radius: 2px; }
.anv-section { position: relative; margin: 14px 0 6px -18px; padding-left: 18px; font-weight: 900; font-size: var(--fs-sm); color: var(--ink-2); }
.anv-item { position: relative; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-md); background: #fff; border: 1.5px solid var(--line); margin-bottom: 8px; }
.anv-item::before { content: ""; position: absolute; left: -16px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; background: #fda4af; box-shadow: 0 0 0 3px var(--cream); }
.anv-item.is-festival::before { background: #c4b5fd; }
.anv-item.is-today { background: linear-gradient(90deg, #fff1f2, #fef9c3); border-color: #fda4af; }
.anv-item.is-editable { cursor: pointer; }
.anv-item.is-pressed { transform: scale(.98); }
.anv-dot { font-size: 24px; }
.anv-main { flex: 1; min-width: 0; }
.anv-title { font-weight: 800; font-size: var(--fs-sm); }
.anv-sub { font-size: var(--fs-xs); color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.anv-count { display: flex; align-items: baseline; gap: 1px; color: var(--rose); }
.anv-count b { font-size: 22px; }
.anv-count small { font-size: 11px; }
.anv-when { font-size: var(--fs-xs); color: var(--ink-3); font-weight: 700; }
.anv-wrap { margin-bottom: 8px; }
.anv-wrap .anv-item { margin-bottom: 0; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.anv-memories { padding: 8px 12px; border: 1.5px solid var(--line); border-top: 0; border-radius: 0 0 var(--r-md) var(--r-md); background: #fffaf4; display: flex; flex-direction: column; gap: 4px; }
.anv-photos { display: flex; gap: 6px; }
.anv-photos img, .anv-photos span { width: 46px; height: 58px; object-fit: cover; border-radius: 4px; background: #fff; display: grid; place-items: center; box-shadow: var(--sh-1); }
.anv-memo { font-size: var(--fs-xs); color: var(--ink-2); }
.anv-empty { padding: 4px 0 8px; }
.icon-pick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.icon-pick-btn { width: 40px; height: 40px; border-radius: 12px; background: #fff; border: 1.5px solid var(--line); font-size: 20px; }
.icon-pick-btn.is-on { border-color: var(--rose-2); background: var(--rose-soft); }

/* ---------- notes upgrades ---------- */
.notes-tools { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.notes-tools + .input { margin-bottom: 10px; }
.chat-day { text-align: center; font-size: 11px; font-weight: 800; color: var(--ink-3); margin: 12px 0 6px; }
.chat-quote { max-width: 100%; font-size: 11px; color: var(--ink-2); background: rgba(0, 0, 0, .04); border-left: 3px solid var(--rose-2); padding: 3px 8px; border-radius: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-reacts { display: flex; gap: 2px; margin-top: -6px; padding: 0 6px; }
.chat-reacts span { background: #fff; border-radius: 10px; padding: 0 5px; font-size: 13px; box-shadow: var(--sh-1); }
.chat-msg.is-pinned .chat-bubble { box-shadow: 0 0 0 2px #fde68a; }
.chat-bubble { cursor: pointer; }
.reply-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; padding: 4px 4px 4px 10px; border-radius: var(--r-md); background: #fff; font-size: var(--fs-xs); color: var(--ink-2); }
.reply-bar span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reply-bar .icon-btn { width: 28px; height: 28px; }
.typing-hint { display: flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--rose); font-weight: 700; margin-bottom: 6px; }
.typing-dots { display: inline-flex; gap: 3px; }
.typing-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--rose-2); animation: typingDot 1s infinite; }
.typing-dots i:nth-child(2) { animation-delay: .15s; }
.typing-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes typingDot { 50% { transform: translateY(-4px); opacity: .5; } }
.note-preview { padding: 12px; border-radius: var(--r-md); background: #fff1f2; line-height: 1.5; margin-bottom: 12px; word-break: break-word; }
.react-row { display: flex; justify-content: space-between; gap: 6px; }
.react-btn { flex: 1; height: 46px; border-radius: 14px; background: #fff; border: 1.5px solid var(--line); font-size: 22px; }
.react-btn.is-on { border-color: var(--rose-2); background: var(--rose-soft); }

/* ---------- journal ---------- */
.diary-dayhead { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 10px; }
.diary-cat-comment { color: var(--rose) !important; font-weight: 700; }
.journal-card { padding: 12px; border-radius: var(--r-lg); background: #fff; border: 1.5px solid var(--line); margin-bottom: 10px; }
.journal-card.is-a { border-left: 5px solid #7dd3fc; }
.journal-card.is-b { border-left: 5px solid #f9a8d4; }
.journal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.journal-mood { font-size: var(--fs-xs); font-weight: 800; color: var(--ink-2); }
.journal-text { margin: 0; line-height: 1.6; white-space: pre-wrap; word-break: break-word; color: var(--ink-2); user-select: text; -webkit-user-select: text; }
.mood-row { display: flex; gap: 4px; margin-bottom: 8px; flex-wrap: wrap; }
.mood-btn { width: 40px; height: 40px; border-radius: 12px; background: #fffaf4; border: 1.5px solid var(--line); font-size: 20px; }
.mood-btn.is-on { border-color: var(--rose-2); background: var(--rose-soft); transform: scale(1.06); }
.journal-input { margin-bottom: 8px; }
.journal-actions { display: flex; justify-content: flex-end; }
.day-photos { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; touch-action: pan-x; }
.day-photos img, .day-photos span { width: 72px; height: 92px; object-fit: cover; border-radius: 6px; flex-shrink: 0; box-shadow: var(--sh-1); background: #fff; display: grid; place-items: center; }
.diary-actions { display: flex; gap: 10px; margin-top: 14px; }
.diary-actions .btn { flex: 1; font-size: var(--fs-sm); }
.export-preview { width: 100%; border-radius: 10px; box-shadow: var(--sh-2); }

/* ---------------- 健身饮食 ---------------- */
.fit-hero { display: flex; align-items: center; gap: 12px; background: linear-gradient(135deg, #f0fdfa, #ecfeff); border-color: #99f6e4; }
.fit-hero-cat { font-size: 34px; }
.fit-hero-main { flex: 1; min-width: 0; }
.fit-hero .meter-track { margin: 6px 0 4px; height: 8px; }
.fit-people { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.fit-person { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border-radius: var(--r-lg); background: #fffaf4; border: 1.5px solid var(--line); }
.fit-person.is-me { border-color: #bae6fd; }
.fit-person-name { font-size: var(--fs-sm); font-weight: 900; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fit-ring-wrap { position: relative; width: 72px; height: 72px; }
.fit-ring { width: 100%; height: 100%; }
.fit-ring circle { transition: stroke-dasharray .5s var(--ease-out); }
.fit-ring-num { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.fit-ring-num b { font-size: var(--fs-lg); font-weight: 900; }
.fit-ring-num span { font-size: 10px; color: var(--ink-3); margin-top: 2px; }
.fit-meals { display: flex; gap: 3px; }
.fit-meal-dot { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: #f5efe9; font-size: 14px; filter: grayscale(1); opacity: .45; }
.fit-meal-dot.is-on { background: var(--amber-soft); filter: none; opacity: 1; }
.fit-water { font-size: var(--fs-xs); font-weight: 800; color: #0369a1; }
.fit-cups { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.fit-cup { font-size: 20px; filter: grayscale(1); opacity: .3; transition: opacity .3s, filter .3s; }
.fit-cup.is-on { filter: none; opacity: 1; }
.fit-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.fit-actions .btn { font-size: var(--fs-sm); padding: 0 8px; }
.fit-min-input { width: 84px; height: 32px; padding: 0 10px; }
.fit-photo-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.fit-meal-img { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; flex-shrink: 0; background: #f5efe9; }
.fit-meal-img.is-empty { display: grid; place-items: center; font-size: 28px; }
.fit-meal-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }
.fit-meal-card { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: var(--r-md); background: #fffaf4; border: 1.5px solid var(--line); }
.fit-meal-text { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: var(--fs-sm); word-break: break-word; }
.fit-meal-text > div { width: 100%; color: var(--ink-2); }
.fit-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; height: 120px; margin-top: 10px; }
.fit-week-col { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.fit-week-bars { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 3px; }
.fit-bar { width: 38%; max-width: 14px; min-height: 2px; border-radius: 4px 4px 1px 1px; transition: height .5s var(--ease-out); }
.fit-bar.is-me, .fit-key-me { background: var(--sky); color: #fff; }
.fit-bar.is-ta, .fit-key-ta { background: var(--rose-2); color: #fff; }
.fit-week-label { font-size: var(--fs-xs); color: var(--ink-3); font-weight: 800; }
.fit-chart-wrap { margin: 8px 0; padding: 8px; border-radius: var(--r-md); background: #fffaf4; border: 1.5px solid var(--line); }
.fit-chart { width: 100%; height: 110px; display: block; }
.fit-chart-legend { display: flex; justify-content: space-between; font-size: var(--fs-xs); color: var(--ink-3); font-weight: 700; }
.fit-private { background: #f0fdf4; border-color: #bbf7d0; font-size: var(--fs-sm); }
.fit-weight-row { flex-wrap: nowrap; }
.fit-weight-row .input { flex: 1; min-width: 0; }

/* 健身饮食 · 饮食 v2、记录 */
.fit-kcal { font-size: var(--fs-xs); font-weight: 800; color: #b45309; white-space: nowrap; }
.fit-pager { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.fit-pager .icon-btn:disabled { opacity: .3; }
.fit-pager-title { flex: 1; display: flex; flex-direction: column; align-items: center; line-height: 1.25; }
.fit-pager-title span { font-size: var(--fs-xs); color: var(--ink-3); font-weight: 700; }
.fit-kcal-card { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: linear-gradient(135deg, #fffbeb, #fff7ed); border-color: #fde68a; }
.fit-kcal-big { font-size: var(--fs-lg); font-weight: 900; color: #b45309; }
.fit-slot-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.fit-slot { display: flex; flex-direction: column; padding: 0; overflow: hidden; text-align: left; border-radius: var(--r-lg); background: #fffaf4; border: 1.5px solid var(--line); min-width: 0; }
.fit-slot.is-empty { border-style: dashed; background: #fffdfa; }
.fit-slot-img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; background: #f5efe9; }
.fit-slot-img.is-empty { display: grid; place-items: center; font-size: 26px; aspect-ratio: auto; height: 58px; }
.fit-slot.is-empty .fit-slot-img.is-empty { filter: grayscale(.6); opacity: .65; }
.fit-slot-main { padding: 6px 8px 8px; min-width: 0; }
.fit-slot-head { display: flex; align-items: baseline; justify-content: space-between; gap: 4px; font-size: var(--fs-sm); }
.fit-slot-sub { font-size: var(--fs-xs); color: var(--ink-3); line-height: 1.35; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-all; }
.fit-photo-strip { display: flex; gap: 6px; overflow-x: auto; touch-action: pan-x; padding-bottom: 2px; }
.fit-photo-strip img { width: 76px; height: 76px; border-radius: 10px; object-fit: cover; flex-shrink: 0; background: #f5efe9; }
.fit-photo-full { display: block; width: 100%; border-radius: 12px; margin-bottom: 8px; background: #f5efe9; }
.fit-day-person { margin-bottom: 6px; }
.fit-day-meal { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; padding: 10px; border-radius: var(--r-md); background: #fffaf4; border: 1.5px solid var(--line); }
.fit-day-meal-meta { display: flex; align-items: center; gap: 6px; }
.fit-day-items { list-style: none; margin: 0; padding: 0; font-size: var(--fs-sm); }
.fit-day-items li { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; border-bottom: 1px dashed var(--line); }
.fit-day-items li:last-child { border-bottom: 0; }
.fit-day-note { margin: 0; font-size: var(--fs-sm); color: var(--ink-2); }
.fit-edit-photos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 6px; }
.fit-edit-photo { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: #f5efe9; display: grid; place-items: center; }
.fit-edit-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fit-edit-photo.is-add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 1.5px dashed #fdba74; background: #fff7ed; font-size: var(--fs-xs); font-weight: 800; color: #c2410c; }
.fit-edit-photo.is-add span:first-child { font-size: 22px; }
.fit-edit-photo.is-loading { font-size: var(--fs-xs); color: var(--ink-3); font-weight: 800; animation: fit-pulse 1.2s ease-in-out infinite; }
@keyframes fit-pulse { 50% { opacity: .45; } }
.fit-edit-x { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff; font-size: 11px; display: grid; place-items: center; }
.fit-items { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.fit-item-row { display: flex; align-items: center; gap: 4px; }
.fit-item { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--r-md); background: #fffaf4; border: 1.5px solid var(--line); text-align: left; }
.fit-item-name { flex: 1; min-width: 0; font-weight: 800; font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fit-item-qty { font-size: var(--fs-xs); color: var(--ink-3); font-weight: 700; white-space: nowrap; }
.fit-food-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.fit-food { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-radius: var(--r-md); background: #fff; border: 1.5px solid var(--line); text-align: left; }
.fit-food.is-own { background: #fffaf4; border-style: dashed; }
.fit-food-name { font-weight: 800; font-size: var(--fs-sm); }
.fit-food-meta { font-size: var(--fs-xs); color: var(--ink-3); font-weight: 700; white-space: nowrap; }
.fit-portion-kcal { text-align: center; font-size: var(--fs-lg); font-weight: 900; color: #b45309; margin: 10px 0 0; }
.fit-own-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0; }
.fit-cal { padding: 10px; }

/* 健身饮食 · 今天 / 运动 / 记录 / 身体 */
.fit-strip { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: var(--fs-xs); font-weight: 800; color: var(--ink-2); white-space: nowrap; }
.fit-strip .meter-track { flex: 1; height: 6px; min-width: 40px; }
.fit-person-stat { display: flex; justify-content: space-between; width: 100%; padding: 0 6px; font-size: var(--fs-xs); color: var(--ink-2); font-weight: 700; }
.fit-person-stat b { font-weight: 900; color: var(--ink); }
.fit-person-water { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: var(--fs-xs); font-weight: 800; color: #0369a1; }
.fit-water-btn { width: 26px; height: 26px; border-radius: 50%; background: #e0f2fe; color: #0369a1; font-weight: 900; font-size: 15px; display: grid; place-items: center; }
.fit-water-btn.is-plus { background: #0ea5e9; color: #fff; }
.fit-water-btn:disabled { opacity: .35; }
.fit-actions { grid-template-columns: 1fr 1fr 1fr; margin: 0 0 4px; }
.fit-meal-row { width: 100%; text-align: left; }
.fit-row-img { width: 36px; height: 36px; border-radius: 10px; object-fit: cover; flex-shrink: 0; background: #f5efe9; }
.fit-row-img.is-empty { display: grid; place-items: center; font-size: 20px; }
.fit-kinds { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.fit-kind { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px; border-radius: var(--r-md); background: #fff; border: 1.5px solid var(--line); font-size: var(--fs-xs); font-weight: 800; color: var(--ink-2); }
.fit-kind-icon { font-size: 22px; line-height: 1.1; }
.fit-kind.is-on { border-color: var(--rose-2); background: var(--rose-soft); color: var(--rose); }
.fit-kcal-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.fit-kcal-main .meter-track { flex: none; height: 6px; margin-top: 2px; }
.fit-kcal-side { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: var(--fs-xs); color: var(--ink-3); font-weight: 800; white-space: nowrap; }
.fit-bars { width: 100%; height: 130px; display: block; margin-top: 8px; }
.fit-bars-label { font-size: 9px; fill: var(--ink-3); font-weight: 700; }
.fit-stat-grid { grid-template-columns: repeat(3, 1fr); }
.fit-stat-grid .stat-val { font-size: var(--fs-md, 15px); }
.fit-kind-bars { display: flex; flex-direction: column; gap: 6px; }
.fit-kind-bar { display: grid; grid-template-columns: 84px 1fr auto; align-items: center; gap: 8px; font-size: var(--fs-xs); font-weight: 800; }
.fit-kind-bar-track { display: flex; flex-direction: column; gap: 2px; }
.fit-kind-bar-track i { display: block; height: 6px; border-radius: 3px; min-width: 2px; }
.fit-kind-bar-track i.is-me { background: #38bdf8; }
.fit-kind-bar-track i.is-ta { background: #fb7185; }
.fit-kind-bar-num { color: var(--ink-3); }
.fit-range { flex-wrap: nowrap; gap: 4px; }
.fit-range .chip { height: 26px; padding: 0 8px; font-size: var(--fs-xs); }
.fit-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 8px 0 2px; }
.fit-fact { display: flex; flex-direction: column; align-items: center; padding: 6px 2px; border-radius: var(--r-md); background: #f0f9ff; }
.fit-fact b { font-size: var(--fs-lg); font-weight: 900; color: #0369a1; line-height: 1.1; }
.fit-fact span { font-size: 10px; color: var(--ink-3); font-weight: 700; text-align: center; }
.fit-mini-list { display: flex; flex-direction: column; margin: -4px 0 12px; padding: 0 4px; }
.fit-mini-row { display: flex; align-items: center; gap: 10px; font-size: var(--fs-sm); padding: 2px 0; border-bottom: 1px dashed var(--line); }
.fit-mini-row > span:first-child { color: var(--ink-3); font-size: var(--fs-xs); font-weight: 700; width: 40px; }
.fit-mini-row b { flex: 1; }
.fit-mini-text { flex: 1; font-size: var(--fs-xs); color: var(--ink-2); }
.fit-mini-row .icon-btn { width: 30px; height: 30px; font-size: 12px; }
.fit-body-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 8px; margin: 8px 0; }
.fit-body-field { display: flex; flex-direction: column; gap: 2px; font-size: var(--fs-xs); color: var(--ink-3); font-weight: 700; }
.fit-body-field .input { height: 38px; }
.fit-profile { display: flex; flex-direction: column; gap: 8px; }
.fit-profile .fit-own-row { margin: 0; }
.fit-target-line { margin: 0; padding: 8px 10px; border-radius: var(--r-md); background: #fffbeb; color: #92400e; font-size: var(--fs-sm); font-weight: 700; }
.fit-switch-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.fit-switch { position: relative; width: 46px; height: 28px; border-radius: 14px; background: #e7e0d9; flex-shrink: 0; transition: background .2s; }
.fit-switch span { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: var(--sh-1); transition: transform .2s var(--ease-out); }
.fit-switch.is-on { background: #22c55e; }
.fit-switch.is-on span { transform: translateX(18px); }

/* 健身饮食 · 视频课程 */
.fit-courses { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.fit-course { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--r-md); background: #fff; border: 1.5px solid var(--line); text-align: left; width: 100%; }
.fit-course-thumb { width: 54px; height: 54px; border-radius: 12px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; background: linear-gradient(135deg, #fb923c, #f43f5e); }
.fit-course-thumb span { font-size: 22px; line-height: 1.1; }
.fit-course-thumb b { font-size: 10px; font-weight: 900; }
.fit-course-thumb.is-abs { background: linear-gradient(135deg, #a78bfa, #7c3aed); }
.fit-course-thumb.is-dance { background: linear-gradient(135deg, #f472b6, #db2777); }
.fit-course-thumb.is-stretch { background: linear-gradient(135deg, #5eead4, #0d9488); }
.fit-course-thumb.is-mine { background: linear-gradient(135deg, #fcd34d, #f59e0b); }
.fit-course-main { flex: 1; min-width: 0; }
.fit-course-title { font-weight: 800; font-size: var(--fs-sm); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fit-course-go { color: var(--rose); font-size: 14px; padding: 0 4px; }
.fit-link { min-height: 64px; resize: none; padding-top: 10px; }
.fit-error { color: #b91c1c; font-size: var(--fs-sm); font-weight: 700; margin: 8px 0 0; }
.workout-hud.is-course { top: 6px; width: min(96%, 560px); padding: 8px; }
.course-player { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #111; margin-bottom: 6px; }
.course-player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.workout-hud.is-course .workout-hud-top span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.workout-hud.is-course .workout-hud-time { font-size: 26px; }
.workout-hud.is-course .workout-hud-reps { display: none; }
.workout-hud.is-course .meter-track { margin: 4px 0; }

/* 健身饮食 · AI 估算 */
.fit-ai-btn { background: linear-gradient(135deg, #ede9fe, #fce7f3); color: #6d28d9; }
.fit-ai-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 10px; margin-bottom: 6px; border-radius: var(--r-md); background: #fff; border: 1.5px solid var(--line); text-align: left; opacity: .55; }
.fit-ai-item.is-on { opacity: 1; border-color: #c4b5fd; background: #faf5ff; }
.fit-ai-check { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid #c4b5fd; display: grid; place-items: center; font-size: 12px; font-weight: 900; color: #7c3aed; flex-shrink: 0; }
.fit-ai-row { display: flex; align-items: center; gap: 4px; margin-bottom: 6px; }
.fit-ai-row .fit-ai-item { flex: 1; min-width: 0; margin-bottom: 0; }
.fit-ai-edited { font-size: var(--fs-xs); font-weight: 800; color: #7c3aed; background: #ede9fe; border-radius: 6px; padding: 1px 6px; white-space: nowrap; }
.fit-food-sugg { margin-top: 6px; }
.fit-food-sugg:empty { display: none; }
/* 机器人看照片：放大镜在照片上找、机器人在旁边、一句句旁白、进度条、找到的食物 */
.fit-ai-scan { position: relative; height: 170px; margin: 2px 4px 14px; }
.fit-ai-scan-photo { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: var(--r-lg); background: #f5f3ff; box-shadow: 0 4px 14px rgba(76, 29, 149, .12); }
.fit-ai-lens { position: absolute; left: 14%; top: 18%; width: 72px; height: 72px; }   /* moved by sweepLens() */
.fit-ai-lens::after { content: ''; position: absolute; left: 86%; top: 86%; width: 9px; height: 30px; border-radius: 5px; background: #7c3aed; transform-origin: top center; transform: translateX(-50%) rotate(-45deg); }
.fit-ai-glass { position: relative; width: 100%; height: 100%; box-sizing: border-box; border-radius: 50%; border: 5px solid #7c3aed; overflow: hidden; background: #f5f3ff; box-shadow: 0 6px 16px rgba(76, 29, 149, .35); }
.fit-ai-glass img { position: absolute; max-width: none; object-fit: cover; }
.fit-ai-glass::after { content: ''; position: absolute; inset: 0; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .8); background: radial-gradient(circle at 30% 26%, rgba(255, 255, 255, .55), transparent 40%); }
.fit-ai-bot { position: absolute; right: -8px; bottom: -16px; font-size: 46px; line-height: 1; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .18)); animation: aiBot 1.6s ease-in-out infinite; }
@keyframes aiBot { 50% { transform: translateY(-7px) rotate(-8deg); } }
.fit-ai-cap { min-height: 1.5em; margin: 6px 0 10px; text-align: center; font-size: var(--fs-md); font-weight: 900; color: #5b21b6; }
.fit-ai-cap.is-pop { animation: aiCap .4s var(--ease-spring); }
@keyframes aiCap { from { transform: scale(.8); opacity: 0; } }
.fit-ai-track { height: 12px; border-radius: var(--r-pill); background: #ede9fe; overflow: hidden; }
.fit-ai-fill { height: 100%; border-radius: inherit; background: repeating-linear-gradient(45deg, #a78bfa 0 10px, #8b5cf6 10px 20px); transition: width .3s ease; animation: aiStripes .8s linear infinite; }
@keyframes aiStripes { to { background-position: 28.284px 0; } }
.fit-ai-meta { display: flex; justify-content: space-between; margin-top: 6px; font-size: var(--fs-xs); font-weight: 700; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.fit-ai-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 10px; }
.fit-ai-chip { padding: 4px 10px; border-radius: var(--r-pill); background: #faf5ff; border: 1.5px solid #c4b5fd; font-size: var(--fs-xs); font-weight: 800; color: #6d28d9; animation: aiChip .4s var(--ease-spring); }
@keyframes aiChip { from { transform: scale(.6); opacity: 0; } }

/* 健身饮食 · 每周计划、挑战、个人最佳、月报 */
.fit-plan-card { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.fit-plan-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.fit-plan-day { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 5px 0; border-radius: 10px; background: #f8f4f0; font-size: var(--fs-xs); color: var(--ink-3); font-weight: 800; }
.fit-plan-day b { font-size: 16px; line-height: 1.2; color: var(--ink-2); }
.fit-plan-day.is-today { outline: 2px solid var(--rose-2); background: #fff; }
.fit-plan-day.is-done { background: #dcfce7; }
.fit-plan-day.is-done b { color: #16a34a; }
.fit-plan-day.is-missed { opacity: .55; }
.fit-plan-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.fit-plan-wd { width: 48px; flex-shrink: 0; font-size: var(--fs-sm); }
.fit-plan-items { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }
.fit-plan-items .chip { height: 30px; font-size: var(--fs-xs); }
.fit-time { width: 130px; height: 38px; }
.fit-course.is-on { border-color: var(--rose-2); background: var(--rose-soft); }
.fit-mini-strip { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; margin-bottom: 8px; border-radius: var(--r-md); background: #fff; border: 1.5px solid var(--line); font-size: var(--fs-xs); font-weight: 800; color: var(--ink-2); text-align: left; }
.fit-mini-strip > span:first-child { flex-shrink: 0; }
.fit-mini-strip .meter-track { flex: 1; height: 6px; }
.fit-mini-strip.is-due { border-color: #fdba74; background: #fff7ed; color: #c2410c; }
.fit-mini-strip-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fit-report-card { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: linear-gradient(135deg, #fdf2f8, #eff6ff); border-color: #fbcfe8; }
.fit-report-card b { font-size: var(--fs-md, 15px); }
.fit-challenge { display: flex; flex-direction: column; gap: 8px; }
.fit-challenge-pick { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; border-radius: var(--r-md); background: #fff; border: 1.5px solid var(--line); }
.fit-challenge-pick .chip-row { gap: 4px; }
.fit-challenge-pick .chip { height: 28px; font-size: var(--fs-xs); }
.fit-challenge-bar .meter-track { flex: none; height: 10px; }
.fit-best { display: grid; grid-template-columns: auto 1fr 1fr; gap: 6px 10px; align-items: center; font-size: var(--fs-sm); }
.fit-best > span { color: var(--ink-3); font-size: var(--fs-xs); font-weight: 800; }
.fit-best > b { font-weight: 900; }
.fit-best > b small { display: block; font-size: 10px; color: var(--ink-3); font-weight: 700; }
.fit-report-big { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fit-report-big > div { display: flex; flex-direction: column; align-items: center; padding: 10px 4px; border-radius: var(--r-md); background: #fff; border: 1.5px solid var(--line); }
.fit-report-big b { font-size: 22px; font-weight: 900; line-height: 1.15; }
.fit-report-big span { font-size: var(--fs-xs); color: var(--ink-3); font-weight: 700; text-align: center; }
.fit-collage { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; border-radius: 12px; overflow: hidden; }
.fit-collage img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: #f5efe9; }

/* ============================== 📚 study: pomodoro HUD + to-dos ============================== */
.study-hud .workout-hud-time { color: #c2410c; }
.study-hud.is-rest .workout-hud-time { color: #0d9488; }
.study-hud .meter-fill { background: #f97316; }
.study-hud.is-rest .meter-fill { background: #14b8a6; }
.study-hud-dots { letter-spacing: 1px; font-size: 12px; }
.study-hud-partner { font-size: var(--fs-xs); font-weight: 800; color: #db2777; min-height: 1.2em; }
.study-hud-partner:empty { display: none; }
/* away from the study: a small pill at the top that goes back there */
.study-hud.is-mini {
  top: 6px; left: auto; right: 8px; transform: none; width: auto; padding: 4px 10px;
  display: flex; align-items: center; gap: 6px; cursor: pointer; border-radius: 999px;
}
.study-hud.is-mini .workout-hud-move, .study-hud.is-mini .study-hud-partner, .study-hud.is-mini .meter-track,
.study-hud.is-mini .workout-hud-btns, .study-hud.is-mini .study-hud-dots { display: none; }
.study-hud.is-mini .workout-hud-time { font-size: var(--fs-md, 15px); }
.study-add { display: flex; flex-direction: column; gap: 8px; }
.study-add .field-row { display: flex; gap: 8px; }
.study-add .field-row .input { flex: 1; min-width: 0; }
.study-task .quest-check { flex: none; width: 26px; height: 26px; }
.study-task.is-done .list-row-title { text-decoration: line-through; color: var(--ink-3); }
.study-task-actions { display: flex; gap: 4px; flex: none; }

/* ---------- 📍 我们: location ---------- */
.partner-dist {
  position: absolute;
  left: 50%;
  bottom: -9px;
  transform: translateX(-50%);
  padding: 0 5px;
  border-radius: var(--r-pill);
  background: #fff;
  color: var(--rose);
  font-size: 10px;
  font-weight: 900;
  line-height: 15px;
  white-space: nowrap;
  box-shadow: var(--sh-1);
  pointer-events: none;
}
.loc-hero { text-align: center; padding: 8px 4px 4px; }
.loc-hero-art { font-size: 40px; letter-spacing: 4px; }
.loc-hero h3 { font-size: var(--fs-lg); font-weight: 900; margin: 6px 0 4px; }
.loc-hero p { color: var(--ink-2); font-size: var(--fs-sm); line-height: 1.6; }
.loc-points { list-style: none; margin: 14px 0; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; border-radius: var(--r-lg); background: #fffaf4; border: 1.5px solid var(--line); font-size: var(--fs-sm); color: var(--ink-2); line-height: 1.5; }
.loc-points ~ .btn + .btn { margin-top: 8px; }
.loc-ask { background: var(--rose-soft); border-color: #fecdd3; }
.loc-ask-btns { display: flex; gap: 6px; flex-shrink: 0; }
.loc-distance { display: flex; align-items: baseline; justify-content: center; flex-wrap: wrap; gap: 6px; padding: 6px 0 10px; color: var(--ink-2); font-size: var(--fs-sm); text-align: center; }
.loc-distance b { font-size: 26px; font-weight: 900; color: var(--ink); }
.loc-distance.is-together b { color: var(--rose); }
.loc-people { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.loc-person { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 8px 10px; border-radius: var(--r-md); background: #fffaf4; border: 1.5px solid var(--line); }
.loc-person .avatar { width: 32px; height: 32px; font-size: var(--fs-sm); flex-shrink: 0; }
.loc-person .list-row-sub { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
@media (max-width: 360px) { .loc-people { grid-template-columns: 1fr; } }
.loc-map { position: relative; height: min(46vh, 380px); min-height: 240px; margin-bottom: 12px; border-radius: var(--r-lg); overflow: hidden; border: 1.5px solid var(--line); background: #f3efe9; z-index: 0; touch-action: none; }
.loc-map .leaflet-control-attribution { font-size: 9px; background: rgba(255, 255, 255, .7); }
.loc-map-src { position: absolute; z-index: 500; left: 8px; top: 8px; padding: 4px 9px; border-radius: var(--r-pill); background: rgba(255, 255, 255, .92); box-shadow: var(--sh-1); font-size: var(--fs-xs); font-weight: 800; color: var(--ink-2); }
.loc-pin-wrap { background: none; border: 0; }
.loc-pin { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 900; font-size: var(--fs-md); border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); background: linear-gradient(135deg, #f9a8d4, #f43f5e); }
.loc-pin.is-a { background: linear-gradient(135deg, #7dd3fc, #3b82f6); }
.loc-pin.is-b { background: linear-gradient(135deg, #f9a8d4, #f43f5e); }
.loc-pin.is-stale { filter: grayscale(.7); opacity: .75; }
.loc-pin.is-me::after { content: ""; position: absolute; inset: -7px; border-radius: 50%; border: 2px solid rgba(59, 130, 246, .35); animation: locPulse 2s ease-out infinite; }
.loc-pin.is-b.is-me::after { border-color: rgba(244, 63, 94, .35); }
@keyframes locPulse { from { transform: scale(.8); opacity: 1; } to { transform: scale(1.4); opacity: 0; } }
.loc-emoji { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: #fff; box-shadow: 0 1px 5px rgba(0, 0, 0, .22); font-size: 16px; }
.loc-emoji.is-pending { background: var(--rose-soft); }
.loc-actions { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 8px; }
.loc-actions .btn { min-width: 0; }
.btn.is-disabled { opacity: .45; }
.loc-days { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-bottom: 10px; touch-action: pan-x; }
.loc-days::-webkit-scrollbar { display: none; }
.loc-days .chip { flex-shrink: 0; position: relative; }
.loc-days .chip.has-dot::after { content: ""; position: absolute; right: 4px; top: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--rose); }
.loc-stats { margin-bottom: 12px; }
.loc-stats .stat-val { font-size: var(--fs-md); }
.loc-legend { font-size: var(--fs-xs); color: var(--ink-3); text-align: center; margin: -4px 0 8px; }
@media (prefers-reduced-motion: reduce) { .loc-pin.is-me::after { animation: none; } }
.push-card { margin-top: 4px; }
.push-card .btn { flex-shrink: 0; }
.stamp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 10px 6px; margin-bottom: 6px; }
.stamp { text-align: center; min-width: 0; padding: 4px 2px; }
.stamp-seal { width: 54px; height: 54px; margin: 0 auto 6px; border-radius: 50%; display: grid; place-items: center; font-size: 17px; font-weight: 900; letter-spacing: 1px;
  color: var(--rose); border: 3px double currentColor; transform: rotate(-8deg); background: color-mix(in srgb, currentColor 8%, transparent); }
.stamp.is-partner .stamp-seal { color: #3b82f6; transform: rotate(7deg); }
.stamp.is-both .stamp-seal { color: #db2777; font-size: 22px; }
.stamp-name { font-size: var(--fs-sm); font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stamp-sub { font-size: 11px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.checkin-photo { display: flex; align-items: center; gap: 10px; padding: 8px; margin: 8px 0; border-radius: var(--r-md); background: #fff; box-shadow: var(--sh-1); }
.checkin-photo img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; flex-shrink: 0; }
.checkin-photo-text { flex: 1; font-size: var(--fs-sm); color: var(--ink-2); }
.postcard-preview { transform: rotate(1deg); max-width: 380px; }
.push-prefs { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line, #eadfd6); }
.push-prefs .field-label { margin-top: 6px; }
.push-prefs .list-row-sub { margin-bottom: 8px; }
.push-prefs .seg { margin-bottom: 10px; }
.push-prefs .seg-btn { padding: 0 4px; }

/* 🫶 care · 🌧️ sulking */
.care-card { padding: 14px 16px; margin-bottom: 10px; background: #fff1f2; }
.care-card.is-partner { background: #fef3c7; }
.care-title { font-size: var(--fs-lg, 18px); font-weight: 800; }
.care-text { margin-top: 4px; line-height: 1.5; user-select: text; -webkit-user-select: text; }
.care-sub { margin-top: 6px; font-size: var(--fs-xs); color: var(--ink-3); }
.care-card + .chip-row { margin-bottom: 10px; }
.care-replies { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.care-replies .chip-btn:disabled { opacity: .7; }
.sulk-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; margin-bottom: 10px; background: #eef2ff; }
.sulk-cloud { font-size: 34px; line-height: 1; }
.sulk-reason { line-height: 1.5; color: var(--ink-2); user-select: text; -webkit-user-select: text; }
.sulk-ok { margin-bottom: 12px; }
.sulk-letters { margin-bottom: 8px; }
.sulk-cancel { display: flex; justify-content: center; margin-top: 10px; }
.is-sulk #scene-bg { filter: saturate(.55) brightness(.86); }

/* 🌙 dreams */
.dream-card { position: relative; padding: 18px 18px 14px; border-radius: var(--r-lg); margin-bottom: 10px; box-shadow: var(--sh-1); overflow: hidden; }
.dream-card::after { content: '✦ · ✧ · ✦'; position: absolute; top: 10px; right: 14px; font-size: 11px; letter-spacing: 2px; color: rgba(30, 27, 75, .25); }
.dream-emojis { font-size: 30px; letter-spacing: 4px; line-height: 1.2; }
.dream-title { margin-top: 8px; font-size: var(--fs-lg, 18px); font-weight: 900; color: #3b2a4a; }
.dream-text { margin-top: 6px; line-height: 1.75; color: #3f3a4a; user-select: text; -webkit-user-select: text; }
.dream-card.is-big .dream-text { font-size: 16px; }
.dream-meta { margin-top: 10px; font-size: var(--fs-xs); color: rgba(30, 27, 75, .55); }
.dream-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.dream-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-md); background: #fff; box-shadow: var(--sh-1); text-align: left; }
.dream-row-icon { font-size: 22px; }
.dream-row-main { display: flex; flex-direction: column; min-width: 0; }
.dream-row-title { font-weight: 800; color: var(--ink-1, #2b2b33); }
.dream-row-sub { font-size: var(--fs-xs); color: var(--ink-3); }

/* 🎂 birthday cake · 📈 growth album */
.bday-cake { left: 7%; bottom: 12.5%; z-index: 4; display: flex; flex-direction: column; align-items: center; padding: 0; background: none; border: 0; cursor: pointer; animation: letterDrop .6s var(--ease-spring); }
.bday-cake .bday-icon { font-size: 52px; line-height: 1; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .2)); }
.bday-cake .bday-flames { font-size: 14px; letter-spacing: 1px; min-height: 18px; animation: flicker 1.2s ease-in-out infinite alternate; }
.bday-cake .bday-label { margin-top: 4px; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, .9); font-size: 11px; font-weight: 800; color: #be123c; white-space: nowrap; box-shadow: var(--sh-1); }
.bday-cake.is-blown .bday-label { color: var(--ink-3); }
@keyframes flicker { from { transform: translateY(0) scale(1); } to { transform: translateY(-2px) scale(1.06); } }
.growth-next { display: flex; align-items: center; gap: 10px; padding: 12px 14px; margin-bottom: 12px; background: #fff7ed; font-weight: 700; }
.growth-next-icon { font-size: 26px; }
.growth-timeline { position: relative; padding-left: 26px; }
.growth-timeline::before { content: ''; position: absolute; left: 11px; top: 6px; bottom: 6px; width: 2px; background: #fecdd3; border-radius: 2px; }
.growth-item { position: relative; margin-bottom: 14px; }
.growth-dot { position: absolute; left: -26px; top: 2px; width: 24px; height: 24px; display: grid; place-items: center; font-size: 14px; background: #fff; border-radius: 50%; box-shadow: var(--sh-1); }
.growth-card { padding: 10px; border-radius: var(--r-lg); background: #fff; box-shadow: var(--sh-1); }
.growth-img { display: block; width: 100%; border-radius: var(--r-md); background: #f5efe9; aspect-ratio: 6 / 7; object-fit: cover; }
.growth-title { margin-top: 8px; font-weight: 900; }
.growth-sub { font-size: var(--fs-xs); color: var(--ink-3); }

/* 🧳 trips */
.is-cat-away #cat-stage-wrapper, .is-cat-away #thought-bubble, .is-cat-away #speech-bubble { visibility: hidden; }
.trip-prop { bottom: 12.5%; z-index: 4; display: flex; flex-direction: column; align-items: center; padding: 0; background: none; border: 0; cursor: pointer; animation: letterDrop .6s var(--ease-spring); }
.trip-prop.is-bag { left: 7%; }
.trip-prop.is-note { left: 50%; bottom: 18%; transform: translateX(-50%); }
.trip-prop-icon { font-size: 46px; line-height: 1; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .2)); }
.trip-prop.is-note .trip-prop-icon { font-size: 40px; transform: rotate(-8deg); }
.trip-prop-label { margin-top: 4px; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, .92); font-size: 11px; font-weight: 800; color: #9a3412; white-space: nowrap; box-shadow: var(--sh-1); }
.trip-packed { margin-bottom: 12px; }
.trip-away { display: flex; gap: 12px; align-items: center; padding: 14px 16px; margin-bottom: 12px; background: #fff7ed; }
.trip-away-icon { font-size: 34px; }
.trip-card { display: flex; gap: 12px; padding: 14px; margin-bottom: 10px; border-radius: 6px; background: #fffdf5; box-shadow: var(--sh-1); border: 1px solid #f1e6d4;
  background-image: repeating-linear-gradient(135deg, #e11d48 0 10px, #fffdf5 10px 20px, #2563eb 20px 30px, #fffdf5 30px 40px); background-size: 100% 6px; background-repeat: no-repeat; background-position: top; padding-top: 18px; }
.trip-card.is-recalled { opacity: .75; }
.trip-card-side { flex: 0 0 84px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.trip-card-stamp { width: 80px; padding: 8px 4px; display: flex; flex-direction: column; align-items: center; gap: 2px; border: 2px dashed #fda4af; border-radius: 4px; background: #fff; font-size: 30px; line-height: 1.1; transform: rotate(-4deg); }
.trip-card-place { font-size: 11px; font-weight: 900; color: #be123c; text-align: center; line-height: 1.2; }
.trip-card-emojis { font-size: 18px; letter-spacing: 2px; }
.trip-card-main { flex: 1; min-width: 0; border-left: 1px dashed #e7d8c3; padding-left: 12px; }
.trip-card-text { line-height: 1.7; color: #44403c; font-family: "Kaiti SC", "STKaiti", "KaiTi", serif; font-size: 15px; user-select: text; -webkit-user-select: text; }
.trip-card-souvenir { margin-top: 8px; font-weight: 800; color: #9a3412; font-size: var(--fs-sm); }
.trip-card-meta { margin-top: 6px; font-size: var(--fs-xs); color: var(--ink-3); }
/* how it travels: three cards with when it leaves and comes home */
.trip-modes { display: grid; gap: 8px; margin-bottom: 12px; }
.trip-mode { display: block; width: 100%; text-align: left; padding: 10px 12px; border-radius: var(--r-md); background: #fff; border: 1.5px solid var(--line); color: var(--ink-1); }
.trip-mode.is-active { border-color: #fb923c; background: #fff7ed; box-shadow: 0 0 0 2px #fed7aa; }
.trip-mode.is-blocked { opacity: .55; }
.trip-mode:disabled { cursor: default; }
.trip-mode.is-active:disabled { opacity: 1; filter: none; }
.trip-mode-head { display: flex; align-items: center; gap: 6px; font-size: var(--fs-md); }
.trip-mode-icon { font-size: 20px; }
.trip-mode-tag { margin-left: auto; padding: 1px 8px; font-size: 11px; }
.trip-mode-hint { margin-top: 2px; font-size: var(--fs-xs); color: var(--ink-2); }
.trip-mode-when { margin-top: 4px; font-weight: 900; color: #c2410c; font-size: var(--fs-sm); }
.trip-mode-gift { margin-top: 2px; font-size: var(--fs-xs); color: var(--ink-3); }
.trip-hours-label { margin: 6px 0 4px; font-size: var(--fs-xs); font-weight: 800; color: var(--ink-2); }
.trip-hours { margin-bottom: 4px; }
.trip-hours .seg-btn { padding: 0 2px; font-size: var(--fs-xs); }
/* letters to it, lines from the road */
.trip-letters, .trip-notes { display: grid; gap: 6px; margin: 8px 0; }
.trip-letter { padding: 8px 10px; border-radius: var(--r-md); background: #fdf2f8; border: 1px dashed #f9a8d4; font-size: var(--fs-sm); line-height: 1.5; overflow-wrap: anywhere; }
.trip-note { display: flex; gap: 8px; padding: 8px 10px; border-radius: var(--r-md); background: #fffbeb; border: 1px solid #fde68a; font-size: var(--fs-sm); line-height: 1.5; overflow-wrap: anywhere; }
.trip-note-when { flex-shrink: 0; font-size: var(--fs-xs); color: var(--ink-3); padding-top: 2px; }
.trip-card .trip-letters, .trip-card .trip-notes { margin: 8px 0 0; }
.trip-write { display: grid; gap: 8px; margin: 8px 0 12px; }
/* souvenirs */
.souvenir-shelf { display: flex; justify-content: space-between; gap: 6px; padding: 10px 12px 14px; margin-bottom: 12px; border-radius: var(--r-md); background: linear-gradient(180deg, #fef3c7 0 78%, #b45309 78% 86%, #92400e 86%); }
.souvenir-slot { flex: 1; text-align: center; font-size: 30px; line-height: 1.3; }
.souvenir-slot.is-empty { color: #d6b98a; font-size: 22px; }
.souvenir-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-bottom: 12px; }
.souvenir-item { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px; border-radius: var(--r-md); background: #fff; border: 1.5px solid var(--line); text-align: left; font-size: var(--fs-sm); min-width: 0; }
.souvenir-item .muted { font-size: 11px; overflow-wrap: anywhere; }
.souvenir-item.is-on { border-color: #fb923c; background: #fff7ed; }
.souvenir-icon { font-size: 26px; line-height: 1.2; }
.trip-set { padding: 10px 12px; margin-bottom: 8px; border-radius: var(--r-md); background: #fff; border: 1.5px solid var(--line); }
.trip-set.is-done { border-color: #86efac; background: #f0fdf4; }
.trip-set-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 8px; margin-bottom: 6px; font-size: var(--fs-sm); }
.trip-set-head .muted { font-size: var(--fs-xs); }

/* 💞 both of you here */
.together-pill { position: absolute; top: 8px; left: 10px; z-index: 6; padding: 4px 12px; border: 0; border-radius: var(--r-pill); background: rgba(255, 255, 255, .88); color: #be123c; font-size: var(--fs-xs); font-weight: 800; box-shadow: var(--sh-1); cursor: pointer; animation: letterDrop .5s var(--ease-spring); }
.together-pill.is-same { background: linear-gradient(135deg, #fb7185, #f472b6); color: #fff; }

/* 🎙️ voice messages */
.voice-rec { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px 14px; }
.voice-rec-btn { --p: 0; width: 84px; height: 84px; border: 0; border-radius: 50%; display: grid; place-items: center; font-size: 34px; cursor: pointer;
  background: conic-gradient(#f43f5e calc(var(--p) * 360deg), #ffe4e6 0); box-shadow: var(--sh-2); }
.voice-rec-btn span { width: 70px; height: 70px; border-radius: 50%; display: grid; place-items: center; background: #fff; }
.voice-rec-btn.is-on span { color: #e11d48; font-size: 26px; animation: heartBeat 1s ease-in-out infinite; }
.voice-rec-time { font-weight: 800; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.voice-preview { width: 100%; height: 40px; }
.voice-rec-actions { display: flex; gap: 10px; width: 100%; }
.voice-rec-actions .btn-primary { flex: 1; }
.voice-list { display: flex; flex-direction: column; gap: 10px; }
.voice-row { display: flex; align-items: center; gap: 8px; }
.voice-row-main { flex: 1; min-width: 0; }
.voice-row.is-own .voice-row-main { display: flex; flex-direction: column; align-items: flex-end; }
.voice-play { position: relative; display: flex; align-items: center; gap: 8px; width: 100%; max-width: 260px; padding: 9px 12px; border: 0; border-radius: 18px 18px 18px 4px; background: #fff; box-shadow: var(--sh-1); cursor: pointer; text-align: left; }
.voice-row.is-own .voice-play { border-radius: 18px 18px 4px 18px; background: #ffe4e6; }
.voice-row.is-new .voice-play::after { content: ''; position: absolute; top: 6px; right: -4px; width: 9px; height: 9px; border-radius: 50%; background: #ef4444; }
.voice-play-icon { width: 26px; height: 26px; flex: 0 0 26px; border-radius: 50%; display: grid; place-items: center; background: #f43f5e; color: #fff; font-size: 11px; }
.voice-wave { height: 14px; border-radius: 7px; background: repeating-linear-gradient(90deg, #fda4af 0 3px, transparent 3px 6px); }
.voice-play.is-playing .voice-wave { animation: voiceWave .6s linear infinite; background-size: 12px 100%; }
@keyframes voiceWave { to { background-position: 12px 0; } }
.voice-dur { margin-left: auto; font-size: var(--fs-xs); font-weight: 800; color: var(--ink-2); }
.voice-meta { margin-top: 4px; font-size: var(--fs-xs); color: var(--ink-3); }
.voice-tools { display: flex; gap: 2px; }
.voice-icon-btn { width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; font-size: 18px; cursor: pointer; }
.voice-icon-btn.is-on { background: #fef3c7; }

/* ---------- iOS Safari: real screen height, no zoom ----------
   --app-h is measured in js/safari.js. Full-screen layers are pinned to the top
   and given that height instead of `inset: 0`, which iOS home-screen apps
   sometimes make too short (app shifted up, blank strip at the bottom). */
html { touch-action: manipulation; }
html.is-ios, html.is-ios body { height: var(--app-h, 100%); }
html.is-ios body,
html.is-ios #app-shell,
html.is-ios .sheet-backdrop,
html.is-ios .particle-layer,
html.is-ios .toy-layer,
html.is-ios .camera-flash,
html.is-ios .coach-overlay,
html.is-ios .trick-pad,
html.is-ios .fg-overlay,
html.is-ios .wh-overlay,
html.is-ios .sn-overlay,
html.is-ios .rn-overlay,
html.is-ios .ts-overlay,
html.is-ios .banned-screen {
  top: 0;
  bottom: auto;
  height: var(--app-h, 100%);
}
/* Home-screen app: paint the status-bar area too, so nothing shows through blurred. */
html.is-standalone, html.is-standalone body { background: var(--cream); }

/* 健身饮食 · 小猫减肥教练 */
.fit-coach { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; border: 2px solid #fde68a; background: #fffbeb; }
.fit-coach.is-empty { border-style: dashed; }
.fit-coach.is-pass { border-color: #c7d2fe; background: #eef2ff; }
.fit-coach-budget b { font-size: 26px; font-weight: 900; color: var(--ink); margin: 0 4px; font-variant-numeric: tabular-nums; }
.fit-coach-budget .meter-track { margin: 4px 0; }
.fit-coach-ok { margin: 0; font-size: var(--fs-sm); font-weight: 800; color: #15803d; }
.fit-coach-issue { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--r-md); background: #fff; font-size: var(--fs-sm); font-weight: 700; }
.fit-coach-issue.is-l2 { background: #fff7ed; color: #9a3412; }
.fit-coach-issue.is-l3 { background: #fef2f2; color: #b91c1c; animation: coachShake .5s ease 1; }
.fit-coach-text { flex: 1; min-width: 0; }
.fit-coach-issue .btn { flex-shrink: 0; }
@keyframes coachShake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
@media (prefers-reduced-motion: reduce) { .fit-coach-issue.is-l3 { animation: none; } }
.fit-coach-week { display: flex; flex-direction: column; gap: 4px; }
.fit-coach-dots { display: flex; gap: 4px; }
.fit-coach-dots span { flex: 1; text-align: center; padding: 3px 0; border-radius: 8px; font-size: 11px; font-weight: 900; font-variant-numeric: tabular-nums; }
.fit-coach-dots .is-good { background: #dcfce7; color: #15803d; }
.fit-coach-dots .is-mid { background: #fef3c7; color: #a16207; }
.fit-coach-dots .is-bad { background: #fee2e2; color: #b91c1c; }
.fit-coach-trend { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.fit-coach-opts { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 10px; }
.fit-coach-opts.is-row { flex-direction: row; }
.fit-coach-opts.is-row .fit-coach-opt { flex: 1; min-width: 0; }
.fit-coach-opt { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 10px; border-radius: var(--r-md); border: 2px solid var(--line); background: #fff; text-align: left; }
.fit-coach-opt span { font-size: var(--fs-xs); color: var(--ink-3); font-weight: 700; }
.fit-coach-opt.is-on { border-color: var(--rose-2); background: var(--rose-soft); }
.fit-coach-err { margin: 6px 0; padding: 8px 10px; border-radius: var(--r-md); background: #fef2f2; color: #b91c1c; font-size: var(--fs-sm); font-weight: 700; }
.fit-coach-plan { margin-top: 8px; }
.fit-coach-why { margin: 8px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-xs); color: var(--ink-2); line-height: 1.5; }

/* the egg just hatched: the two names and the cat's, over the room for a few seconds */
.hatch-banner {
  position: absolute; left: 50%; top: 24%; z-index: 30; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 22px; pointer-events: none;
  border-radius: 22px; background: rgba(255, 255, 255, .92); box-shadow: 0 10px 30px rgba(244, 63, 94, .22);
  text-align: center; white-space: nowrap; animation: hatchBannerIn .6s cubic-bezier(.2, .8, .3, 1.3) both;
  transition: opacity .5s, transform .5s;
}
.hatch-banner b { font-size: 22px; color: #e11d48; letter-spacing: .02em; }
.hatch-banner span { font-size: var(--fs-md, 16px); font-weight: 800; color: var(--ink); }
.hatch-banner small { font-size: 12px; font-weight: 700; color: var(--ink-3, #78716c); }
.hatch-banner.is-out { opacity: 0; transform: translateX(-50%) translateY(-12px); }
@keyframes hatchBannerIn { from { opacity: 0; transform: translateX(-50%) scale(.7); } }
