/* Home, habits and check-ins (screens/home.js, habits.js, checkin.js). Colours come from app.css tokens only. */

a.btn { text-decoration: none; }
.ico { flex: none; }
.row.top { align-items: flex-start; }
.card-ico, .ask-ico, .ci-ico { display: inline-flex; flex: none; color: var(--accent); }
.hbar { height: 6px; border-radius: 3px; background: var(--rule); overflow: hidden; }
.hbar-fill { height: 100%; border-radius: 3px; background: var(--accent); transition: width .4s ease; }

/* Greeting */
.home-greeting > * + * { margin-top: var(--sp-lg); }
.home-top .wordmark { display: inline-flex; align-items: center; }
.home-top .wordmark img { height: 22px; width: auto; }
.home-day { gap: var(--sp-sm); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; animation: live-pulse 2.4s ease-in-out infinite; }
.live-dot.still { animation: none; }
@keyframes live-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.home-name { font-size: 30px; font-weight: 600; line-height: 1.15; margin: var(--sp-xs) 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-name.big { font-size: 34px; font-weight: 700; }
.home-lines > * + * { margin-top: 6px; }
.home-goal { color: var(--ink2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.replied-line { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: var(--sp-xs) 0; color: var(--ink); font-size: 15px; font-weight: 600; cursor: pointer; }
.replied-line .chev::after { font-size: 18px; margin-left: 2px; }

/* Rings */
.rings { display: flex; align-items: center; gap: var(--sp-xl); }
.skel.rings-skel { height: 156px; }
.rings-dial { position: relative; width: 156px; height: 156px; flex: none; }
.rings-svg { width: 100%; height: 100%; display: block; }
.rings-centre { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.rings-closed { font-size: 26px; font-weight: 600; line-height: 1; }
.rings-of { font-size: 11px; font-weight: 500; color: var(--ink3); }
.rings-legend { flex: 1; min-width: 0; display: grid; gap: 10px; }
.ring-row { display: grid; grid-template-columns: 8px auto 1fr; align-items: center; gap: var(--sp-sm); width: 100%; padding: 2px 0; background: none; border: 0; text-align: left; cursor: pointer; }
div.ring-row { cursor: default; }
.ring-dot { width: 8px; height: 8px; border-radius: 50%; }
.ring-label { font-size: 15px; }
.ring-value { font-size: 13px; color: var(--ink2); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 400px) {
  .rings { gap: var(--sp-lg); }
  .rings-dial { width: 124px; height: 124px; }
  .ring-row { grid-template-columns: 8px 1fr; row-gap: 0; }
  .ring-value { grid-column: 2; text-align: left; }
}

/* Program */
.list > .item.day-row { color: inherit; text-decoration: none; }
.day-thumbs { display: flex; align-items: center; gap: var(--sp-xs); margin-top: 6px; }
.day-thumb { width: 30px; height: 30px; border-radius: 7px; object-fit: cover; object-position: left center; background: var(--rule); }
.day-last { color: var(--accent); margin-top: 2px; }
.play-disc { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--accent); color: var(--on-accent); }

/* Daily line and week */
.daily-line { display: flex; align-items: stretch; gap: var(--sp-md); }
.daily-bar { width: 3px; border-radius: 2px; background: var(--accent); flex: none; }
.week-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: var(--sp-sm); }
.pt-card { width: 100%; text-align: left; color: inherit; cursor: pointer; }

/* Habits */
.list.habit-active { border-color: color-mix(in srgb, var(--accent) 45%, var(--rule)); }
.list > .item.habit-row { cursor: default; align-items: flex-start; }
.list > .item.habit-row:active { background: none; }
.habit-strip { display: flex; gap: 3px; margin-top: 6px; }
.habit-strip .mark { width: 10px; height: 10px; border-radius: 3px; }
.mark.done { background: var(--accent); }
.mark.open { border: 1.5px solid var(--accent); }
.mark.missed { border: 1.5px solid var(--ink3); opacity: .55; }
.mark.off { background: var(--rule); opacity: .5; }
.habit-icons { display: flex; gap: 6px; align-self: center; color: var(--ink3); }
.habit-tick { align-self: center; background: none; border: 0; padding: 6px; margin: -6px -6px -6px 0; cursor: pointer; }
.habit-tick .check { width: 30px; height: 30px; }
.habit-tick .check.on::after { width: 12px; height: 7px; }
.catchup-row { flex-wrap: wrap; }
.catchup-row .btn.small { gap: var(--sp-xs); }
.photo-box { min-height: 180px; display: grid; place-items: center; padding: var(--sp-md); text-align: center; overflow: hidden; border: 1px dashed var(--rule); border-radius: var(--r-card); background: var(--sunken); }
.photo-box img { max-height: 320px; border-radius: 12px; object-fit: contain; }
.timer-clock { font-size: 48px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Check-in card */
.checkin-reply { border: 2px solid var(--accent); }
.ci-reply { padding: 0; justify-content: flex-start; gap: 6px; }
.ci-next-line { gap: var(--sp-sm); color: var(--ink2); }

/* Check-in flow */
.checkin-flow { min-height: 100dvh; display: flex; flex-direction: column; }
.ci-head { margin-bottom: var(--sp-lg); }
.ci-body { flex: 1; }
.ci-titles > * + * { margin-top: var(--sp-xs); }
.ci-message { margin-top: var(--sp-xxl); }
.ci-bar { position: sticky; bottom: 0; margin-top: var(--sp-xl); padding: var(--sp-md) 0; background: var(--page); border-top: 1px solid var(--rule); }
.ci-go { min-width: 96px; }
.list > .item.ci-fact { cursor: default; }
.list > .item.ci-fact:active { background: none; }
.ci-grid { display: grid; gap: var(--sp-sm); grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
.ci-grid.tight { grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); }
.ci-grid.mid { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }
.ci-grid.choice { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
.ci-grid.wide { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.ci-grid.pair { grid-template-columns: 1fr 1fr; }
.ci-chip { flex-direction: column; justify-content: center; text-align: center; gap: 2px; min-height: 56px; padding: var(--sp-xs) var(--sp-sm); font-weight: 500; }
.ci-chip[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); box-shadow: none; }
.ci-chip.last { border-color: color-mix(in srgb, var(--accent) 50%, var(--rule)); }
.ci-last { font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.ci-link { padding: 0; min-height: 32px; font-size: 13px; }
.ci-number { font-size: 22px; font-weight: 600; min-height: 56px; }

/* Announcements: a full page over the app, closed only by its buttons */
body.announce-open { overflow: hidden; }
.announce { position: fixed; inset: 0; z-index: 35; overflow-y: auto; background: var(--page); animation: rise .34s cubic-bezier(.2,.8,.2,1) both; }
.announce > .shell { padding-top: calc(env(safe-area-inset-top) + var(--sp-xxl)); }
.announce-ico { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.announce-title { font-size: 30px; font-weight: 700; }
.announce .terms-body.announce-body { max-height: none; padding: 0; border: 0; background: none; color: var(--ink); font-size: 17px; }

@media (prefers-reduced-motion: reduce) {
  .live-dot, .announce { animation: none; }
  .hbar-fill { transition: none; }
}
