/* Home (templates/index.html). Built on ippo.css tokens and components; the
   reference is the Home mockup on /dev/styles. Tokens only, no !important. */

/* ───────── Hero: name, streak, week, today ───────── */
.hero {
  background: var(--hero-bg); color: var(--ink);
  border-radius: calc(var(--r-lg) + 4px); border: 1px solid var(--hero-line); box-shadow: var(--sh-1);
  padding: 18px var(--s4) var(--s4);
}
.hero-top { display: flex; align-items: center; gap: 14px; }
.hero-top .av { object-position: 50% 15%; }
.hero-id { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hero-hi { font-size: var(--fs-small); color: var(--ink-2); font-weight: 500; }
.hero-name {
  font-size: 1.625rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hero-top .chip { align-self: flex-start; }
.hero-top .chip::after { inset: -6px -2px; } /* 44 px hit area */
.hero-streak { display: flex; align-items: flex-end; gap: 6px; margin: var(--s4) 0 18px; }
.hero-flame { color: var(--accent); margin-bottom: 4px; display: grid; }
/* Ippo's mood for the week (home.py week_mood); a whole figure, 140 x 150 */
.hero-ippo { flex: none; width: 92px; height: auto; aspect-ratio: 140 / 150; margin: -20px -4px -10px auto; }
.hero-streak .t-display { font-size: 3.25rem; line-height: 0.95; }
.hero-unit { font-size: var(--fs-body); font-weight: 700; line-height: 1.2; padding-bottom: 2px; margin-left: 4px; }
.hero-unit small { font-size: 0.8125rem; color: var(--ink-2); font-weight: 600; }
.hero-msg {
  display: flex; align-items: center; gap: var(--s2); margin-top: var(--s3);
  padding: 10px var(--s3); border-radius: var(--r-md); background: var(--hero-note);
  font-size: var(--fs-small); color: var(--ink-2); font-weight: 500;
}
.hero-msg .ic { flex: none; color: var(--accent); }

/* Week view (shared styles in ippo.css): the today ring gap matches the hero note */
.hero { --day-gap: var(--hero-note); }
.day-dot.is-igniting { animation: ignite 0.7s ease-out; }
@keyframes ignite {
  0% { transform: scale(0.6); filter: saturate(0.2); }
  55% { transform: scale(1.18); }
  100% { transform: scale(1); filter: none; }
}

/* Today's steps */
.hero-steps {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 6px 10px;
  margin-top: var(--s3); padding: 10px var(--s3); border-radius: var(--r-md); background: var(--hero-note);
}
.hero-steps-ic { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--steps-soft); color: var(--steps); }
.hero-steps-t { font-size: var(--fs-small); color: var(--ink-2); font-weight: 500; }
.hero-steps-t b { color: var(--ink); font-weight: 800; }
.hero-steps-left { font-size: var(--fs-cap); font-weight: 700; color: var(--ink-2); }
.hero-steps .bar { grid-column: 1 / -1; background: var(--line); }
.hero-steps .bar > i { background: var(--steps); }

/* ───────── Plan card ───────── */
.plan { display: flex; flex-direction: column; gap: var(--s2); }
.plan-main { display: flex; align-items: center; gap: 14px; }
.plan-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.plan-cap { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); }
.plan-cap h2 { margin: 0; }
.plan-t { font-size: var(--fs-body); font-weight: 750; line-height: 1.3; }
.plan-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: calc(-1 * var(--s2)); border-top: 1px solid var(--line); }
.plan-foot .link { flex: none; }

/* ───────── Friends strip ───────── */
.fstrip {
  display: flex; gap: var(--s2); overflow-x: auto; scrollbar-width: none;
  margin: 0 calc(-1 * var(--s4)); padding: 2px var(--s4) 4px; scroll-padding: 0 var(--s4);
}
.fstrip::-webkit-scrollbar { display: none; }
.fchip {
  flex: none; width: 84px; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding-bottom: 2px; border-radius: var(--r-md); text-decoration: none; color: var(--ink); text-align: center;
}
.fchip-av { position: relative; width: 60px; height: 60px; display: grid; place-items: center; margin-bottom: 10px; }
.fchip-av .av { --av: 52px; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--line); }
.fchip-n {
  position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 2px; height: 20px; padding: 0 7px; border-radius: 999px;
  font-size: var(--fs-cap); font-weight: 800; white-space: nowrap; box-shadow: 0 0 0 2px var(--bg);
}
.fchip-name { width: 100%; font-size: 0.8125rem; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Status stays inside its own item: wraps to at most two lines, never into a neighbour */
.fchip-st {
  width: 100%; font-size: var(--fs-cap); font-weight: 600; line-height: 1.25; color: var(--ink-2);
  overflow: hidden; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
}
.st-ok { background: var(--accent-soft); color: var(--accent-soft-ink); }
.st-due { background: var(--warn-soft); color: var(--warn); }
.st-new { background: var(--surface-2); color: var(--ink-2); }
.fchip-st.st-ok { background: none; color: var(--accent-ink); }
.fchip-st.st-due { background: none; color: var(--warn); }
.fchip-st.st-new { background: none; }
.fchip-add {
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  border: 2px dashed var(--line-strong); color: var(--ink-2);
}

/* ───────── Your groups (group_engage.home_groups) ───────── */
.hg-help {
  display: flex; align-items: flex-start; gap: var(--s2); margin: 0 0 var(--s2); padding: 10px var(--s3);
  border-radius: var(--r-md); background: var(--accent-soft); color: var(--accent-soft-ink);
  font-size: var(--fs-small); font-weight: 600; line-height: 1.35;
}
.hg-help .ic { flex: none; margin-top: 1px; }
.hg-row { align-items: center; gap: var(--s3); padding-top: 10px; padding-bottom: 10px; }
.hg-t { display: flex; align-items: center; gap: 6px; min-width: 0; }
.hg-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hg-t .pill { flex: none; }
.hg-s { white-space: normal; line-height: 1.35; }
.hg-you { color: var(--ink-3); font-size: var(--fs-cap); font-weight: 600; }
.hg-prog { flex: none; width: 76px; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 4px; }
.hg-prog b { font-size: var(--fs-small); font-weight: 800; }
.hg-ok { display: inline-grid; color: var(--success); }
.hg-ok .ic { stroke-width: 2.6; }
.hg-bar {
  display: block; width: 100%; height: 8px; border-radius: 999px; overflow: hidden;
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line);
}
.hg-bar svg { display: block; }
.hg-bar rect { fill: var(--mc, var(--accent)); }
.hg-bar .mc-o { --mc: color-mix(in srgb, var(--member-others) 50%, var(--surface)); }

/* ───────── Freezes sheet ───────── */
.freeze-sum { display: flex; align-items: center; gap: var(--s3); font-weight: 600; color: var(--ink-2); }
.freeze-sum b { color: var(--ink); margin-right: 2px; }
.freeze-why { margin: 0; padding: 10px var(--s3); border-radius: var(--r-md); background: var(--surface-2); color: var(--ink-2); }

/* ───────── Logged out ───────── */
.welcome { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--s3); padding: var(--s6) var(--s5); }

@media (prefers-reduced-motion: reduce) {
  .day-dot.is-igniting { animation: none; }
}
