/* =============================================================
   HABIT — weekly goal card, starter mode, starter card,
   first-session card, "train with someone", onboarding steps 7-8.
   (src/js/habit.js, first-session-card.js, train-together.js)
   Built on the mx- kit, pod tokens and guide buttons (guide.css).
   ============================================================= */

.hb-sheet button,
.fs-sheet button,
.tt-sheet button,
#starterCard button,
#weeklyGoalCard button { margin: 0; }

/* Labels outside .wk-card (home.css scopes .wk-cap there) */
.fs-sheet .wk-cap,
.hb-sheet .wk-cap {
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mx-faint, var(--text-tertiary));
}

/* ── Weekly goal card (inside Home › This week .wk-card) ────── */
#weeklyGoalCard:empty { display: none; }
.hb-week {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--pod-border, var(--border-color));
}
.hb-week-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hb-goal-btn,
button.hb-goal-btn {
  width: auto;
  min-height: 0;
  padding: 4px 10px;
  border: 1px solid var(--pod-border, var(--border-color));
  border-radius: var(--radius-pill, 999px);
  background: transparent;
  box-shadow: none;
  color: var(--primary-text, var(--primary));
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.hb-week-main { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.hb-count { font-size: 30px; line-height: 1; color: var(--text-primary, var(--text-color)); font-variant-numeric: tabular-nums; }
.hb-count small { font-size: 16px; color: var(--text-tertiary, var(--secondary-text)); font-weight: 600; }
.hb-week-label { font-size: 13px; color: var(--text-secondary, var(--secondary-text)); }
.hb-streak {
  margin-left: auto;
  padding: 3px 9px;
  border-radius: var(--radius-pill, 999px);
  background: color-mix(in srgb, var(--primary) 16%, transparent);
  color: var(--primary-text, var(--primary));
  font-size: 12px;
  font-weight: 700;
}
.hb-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.hb-day {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  max-height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--pod-border, var(--border-color));
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-tertiary, var(--secondary-text));
}
.hb-day.is-planned { border-style: dashed; border-color: var(--primary); }
.hb-day.is-today { color: var(--text-primary, var(--text-color)); box-shadow: 0 0 0 2px var(--pod-bg, transparent), 0 0 0 3.5px var(--text-tertiary, #888); }
.hb-day.is-done { background: var(--primary); border-color: var(--primary); color: #fff; border-style: solid; }
.hb-day.is-future { opacity: 0.75; }
.hb-note { margin: 0; font-size: 12.5px; color: var(--text-secondary, var(--secondary-text)); }
.hb-week.is-hit .hb-note { color: var(--primary-text, var(--primary)); font-weight: 600; }

/* ── Goal sheet ─────────────────────────────────────────────── */
.hb-lead { margin: 0 0 14px; }
.hb-sub-label { margin: 16px 0 8px; }
.hb-sub-label small { text-transform: none; letter-spacing: 0; font-weight: 500; }
.hb-goal-chips,
.hb-day-chips { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.hb-chip,
button.hb-chip {
  width: 100%;
  min-height: 44px;
  padding: 0;
  border: 1.5px solid var(--pod-border, var(--border-color));
  border-radius: var(--radius-md, 12px);
  background: transparent;
  box-shadow: none;
  color: var(--text-primary, var(--text-color));
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
}
.hb-chip.is-on { background: var(--primary); border-color: var(--primary); color: #fff; }
.hb-sheet-foot { display: flex; justify-content: flex-end; margin-top: 18px; }

/* ── Starter mode: a smaller app for the first two weeks ───── */
.starter-mode #guidePathCard,
.starter-mode #guideDiscoverCard,
.starter-mode #dailyPulseCard,
.starter-mode #homeMissionTicks,
.starter-mode #homeConsistencyRow,
.starter-mode #homeBodyCard,
.starter-mode #homeDashboardContent,
.starter-mode .home-zone--modes,
.starter-mode #volumeLandmarksCard { display: none !important; }
.all-hub-tile.hb-starter-hidden { display: none !important; }
.hb-all-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 16px 12px;
  padding: 10px 14px;
  border: 1px dashed var(--pod-border, var(--border-color));
  border-radius: var(--radius-md, 12px);
  font-size: 12.5px;
  color: var(--text-secondary, var(--secondary-text));
}
.hb-all-note button { flex: 0 0 auto; }

/* ── Starter card (Home) ────────────────────────────────────── */
#starterCard:empty { display: none; }
.hb-starter { display: flex; flex-direction: column; gap: 12px; }
.hb-starter-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.hb-starter-title { margin: 2px 0 0; }
.hb-starter-left { flex: 0 0 auto; font-size: 12px; font-weight: 700; color: var(--text-tertiary, var(--secondary-text)); }
.hb-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.hb-step { display: flex; align-items: center; gap: 12px; }
.hb-step-tick {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1.5px solid var(--pod-border, var(--border-color));
  color: #fff;
}
.hb-step.is-done .hb-step-tick { background: var(--primary); border-color: var(--primary); }
.hb-step-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hb-step-label { font-weight: 700; font-size: 14.5px; color: var(--text-primary, var(--text-color)); }
.hb-step-label small { font-weight: 500; font-size: 11.5px; color: var(--text-tertiary, var(--secondary-text)); }
.hb-step.is-done .hb-step-label { color: var(--text-tertiary, var(--secondary-text)); text-decoration: line-through; }
.hb-step-sub { font-size: 12.5px; line-height: 1.35; color: var(--text-tertiary, var(--secondary-text)); }
.hb-step.is-done .hb-step-sub { display: none; }
.hb-step-go,
button.hb-step-go { padding: 7px 14px; font-size: 12.5px; }
.hb-starter-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.hb-starter-why { font-size: 11.5px; color: var(--text-tertiary, var(--secondary-text)); flex: 1 1 180px; }

/* ── First-session card ─────────────────────────────────────── */
.fs-sheet { display: flex; flex-direction: column; gap: 14px; }
.fs-sheet .mx-sheet-head { align-items: flex-start; }
.fs-sheet .mx-h3 { margin: 2px 0 0; }
.fs-lead { margin: 0; }
.fs-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.fs-stat {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 12px 6px;
  border: 1px solid var(--pod-border, var(--border-color));
  border-radius: var(--radius-md, 12px);
}
.fs-stat b { font-size: 22px; line-height: 1.1; color: var(--text-primary, var(--text-color)); font-variant-numeric: tabular-nums; }
.fs-stat b small { font-size: 12px; margin-left: 2px; font-weight: 600; }
.fs-stat span { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-tertiary, var(--secondary-text)); }
.fs-muscles { display: flex; flex-wrap: wrap; gap: 6px; }
.fs-section { display: flex; flex-direction: column; gap: 6px; }
.fs-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.fs-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--pod-border, var(--border-color));
}
.fs-row:last-child { border-bottom: 0; }
.fs-name { min-width: 0; font-size: 14px; font-weight: 600; color: var(--text-primary, var(--text-color)); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fs-val { flex: 0 0 auto; text-align: right; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; display: flex; flex-direction: column; align-items: flex-end; }
.fs-val small { font-size: 11px; font-weight: 500; color: var(--text-tertiary, var(--secondary-text)); }
.fs-val--next { color: var(--primary-text, var(--primary)); }
.fs-up {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 1px 6px;
  border-radius: var(--radius-pill, 999px);
  background: color-mix(in srgb, var(--primary) 16%, transparent);
  color: var(--primary-text, var(--primary));
  font-size: 11px;
  font-weight: 700;
}
.fs-unlock { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--text-secondary, var(--secondary-text)); }
.fs-foot { display: flex; justify-content: flex-end; align-items: center; gap: 16px; }

/* ── Train with someone (sheet + onboarding step 8) ─────────── */
.tt-body { display: flex; flex-direction: column; gap: 12px; }
.tt-option {
  display: flex; flex-direction: column; gap: 10px;
  padding: 14px 16px;
  border: 1.5px solid var(--border-color, var(--pod-border));
  border-radius: 12px;
  background: var(--surface-bg, var(--pod-bg));
}
.tt-option-text { display: flex; flex-direction: column; gap: 2px; }
.tt-option-title { font-weight: 700; font-size: 15px; color: var(--text-primary, var(--text-color)); }
.tt-option-sub { font-size: 12.5px; line-height: 1.4; color: var(--secondary-text, var(--text-tertiary)); }
.tt-code-row { display: flex; gap: 8px; }
.tt-code-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 10px 12px;
  border: 1.5px solid var(--border-color, var(--pod-border));
  border-radius: 10px;
  background: transparent;
  color: var(--text-primary, var(--text-color));
  font-size: 16px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.tt-code-btn,
.tt-share-btn,
button.tt-code-btn,
button.tt-share-btn {
  width: auto;
  margin: 0;
  padding: 10px 16px;
  border: 0;
  border-radius: 10px;
  background: var(--primary, #5fa87e);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  box-shadow: none;
}
.tt-share-btn,
button.tt-share-btn { align-self: flex-start; }
.tt-code-btn:disabled,
.tt-share-btn:disabled { opacity: 0.6; }
.tt-msg { margin: 0; font-size: 12.5px; color: var(--danger, #d9534f); }
.tt-msg.is-ok { color: var(--primary-text, var(--primary)); }

/* ── Onboarding step 7: training week ───────────────────────── */
.ob-week-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-bottom: 18px; }
.ob-week-day {
  min-height: 44px;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  background: var(--surface-bg, #141e17);
  color: var(--text-color);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  font-family: inherit;
  box-shadow: none;
  margin: 0;
  padding: 0;
}
#obWeekDays .ob-week-day.ob-active { border-color: var(--primary, #5fa87e); background: var(--primary, #5fa87e); color: #fff; }
.ob-week-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px;
  margin-bottom: 10px;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  background: var(--surface-bg, #141e17);
}
.ob-week-row-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ob-week-row-label { font-weight: 600; }
.ob-week-row-hint { font-size: 0.8rem; color: var(--secondary-text); }
.ob-goal-stepper { display: flex; align-items: center; gap: 10px; }
.ob-goal-stepper button {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--border-color);
  background: transparent;
  color: var(--text-color);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  margin: 0;
}
.ob-goal-val { min-width: 1.5em; text-align: center; font-weight: 800; font-size: 1.2rem; }
.ob-week-time {
  padding: 8px 10px;
  border: 1.5px solid var(--border-color);
  border-radius: 10px;
  background: transparent;
  color: var(--text-color);
  font-size: 16px;
  font-family: inherit;
}
.ob-week-row .reminder-toggle { flex: 0 0 auto; }
.ob-week-note { margin: 4px 0 18px; font-size: 0.8rem; color: var(--secondary-text); }

/* ── Onboarding step 8: train with someone + history ────────── */
#obTrainTogether { margin-bottom: 12px; }
.ob-history-btn {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px;
  margin: 0 0 24px;
  border: 2px dashed var(--border-color);
  border-radius: 12px;
  background: transparent;
  color: var(--text-color);
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}
.ob-history-btn.is-done { border-style: solid; border-color: var(--primary, #5fa87e); }
.ob-history-btn span:first-child { display: flex; flex-direction: column; gap: 2px; }
.ob-history-btn strong { font-size: 0.95rem; }
.ob-history-btn small { font-size: 0.8rem; color: var(--secondary-text); }
