/* Body Stats page — Composition (Measurement is a Coming-soon placeholder
   this pass). Reuses exercise.css/ui.css shared classes (.xl-hero, .xl-card,
   .xl-tabbar/.xl-tabbtn, .cp-sheet*, .xl-empty, .xl-sheet-actions/-save) —
   only the genuinely Body-Stats-specific bits get a bcx- rule here, recut to
   tokens (--bg, --border, --ink, --slate, --muted, --blue, --blue-dark). */

/* Tab bar: Body Stats now uses the SHARED <TabBar> component (BodyStatsTabBar
   in BodyStatsTab.tsx), so it inherits the exact .xl-tabbar/.xl-tabbtn styling
   from shell.css — no bcx- tab overrides needed. */

/* ── Hero content (sits inside the shared .xl-hero white card) ─────────────
   Semicircle stacked-arc gauge (Lean / Muscle / Body Fat proportional to kg)
   with body weight centred, then one row per stat. Trend deltas are NOT shown
   here — they live in the chart + records below. */
.bcx-hero-topbar { display: flex; align-items: center; }
.bcx-hero-title { font-size: var(--fs-md); font-weight: var(--fw-bold); color: var(--ink); }
.bcx-hero-range { display: block; margin-top: 2px; font-size: var(--fs-base); font-weight: var(--fw-semibold); color: var(--muted); }

/* Semicircle gauge */
.bcx-gauge {
  position: relative;
  display: flex;
  justify-content: center;
  margin-top: 4px;
}
.bcx-gauge svg { width: 100%; max-width: 300px; height: auto; }
.bcx-gauge path { transition: stroke-dashoffset .7s ease-out; }
@media (prefers-reduced-motion: reduce) {
  .bcx-gauge path { transition: none; }
}
.bcx-gauge-center {
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.bcx-gauge-val {
  display: flex;
  align-items: baseline;
  gap: 3px;
  font-size: var(--fs-display);
  font-weight: var(--fw-extrabold);
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.bcx-gauge-val span { font-size: var(--fs-base); font-weight: var(--fw-bold); color: var(--muted); }
.bcx-gauge-cap {
  margin-top: 4px;
  font-size: var(--fs-2xs);
  font-weight: var(--fw-regular);
  text-transform: capitalize;
  color: var(--muted);
}

/* Per-stat rows: dot + label · kg + % */
.bcx-hero-rows { display: flex; flex-direction: column; margin-top: 12px; }
.bcx-hero-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 0;
}
.bcx-hero-row-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.bcx-hero-dot { flex: 0 0 auto; width: 11px; height: 11px; border-radius: 50%; }
.bcx-hero-row-label { font-size: var(--fs-base); font-weight: var(--fw-regular); color: var(--slate); }
.bcx-hero-row-right {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-variant-numeric: tabular-nums;
}
.bcx-hero-row-kg { font-size: var(--fs-base); font-weight: var(--fw-regular); color: var(--slate); }
.bcx-hero-row-pct {
  /* Reserves the widest 1dp percentage ("100.0%") so the kg column stays
     aligned across rows. */
  min-width: 52px;
  text-align: right;
  font-size: var(--fs-base);
  font-weight: var(--fw-regular);
  color: var(--muted);
}

/* ── Cards (sit inside the shared .xl-card shell) ─────────────────────────── */
/* Floats like the hero (natural-shadows skill, Level 2) — a page-level summary
   section, not a repeated row, so it drops .xl-card's border for the shadow. */
.bcx-card {
  padding: 16px;
  border-color: transparent;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 4px 10px rgba(15, 23, 42, 0.05),
    0 12px 28px rgba(15, 23, 42, 0.07);
}
/* This card shares .xl-card but is a static summary section, not an
   interactive row — keep its border transparent in every state. (The blue
   hover border this used to fight was deleted from exercise.css.) */
.bcx-card.xl-card { border-color: transparent; }
/* .xl-card's own margin-bottom (exercise.css) is 6px — smaller than the
   16px gap .xl-hero uses below itself. Applied to the Weekly Trend card so
   the gap before Entry Log matches the gap after the hero. */
.bcx-card-gap { margin-bottom: 16px; }

.bcx-card h3 {
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
  color: var(--ink);
  margin: 0 0 12px;
}

/* ── Metric pills ────────────────────────────────────────────────────────── */
.bcx-pills {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 6px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.bcx-pills::-webkit-scrollbar { display: none; }
/* Base pill recipe (radius/padding/font/selected-color) lives in shell.css's
   shared .sa-chip — only the horizontal-scroll-row layout is specific here. */
.bcx-pill { flex: 0 0 auto; }

/* ── Unit-mode toggle (Log/Edit sheet, kg/%) ────────────────────────────────
   NOT .bcx-pills — that's a horizontal-SCROLL row (overflow-x, plus its own
   padding-bottom/margin-bottom to clear a hidden scrollbar), which threw off
   the sheet's vertical rhythm for a plain 2-item toggle that never scrolls.
   Both chips share one min-width (fits "kg" + padding) so a single-char "%"
   doesn't render as a near-circle next to it. */
.bcx-unit-toggle { display: flex; gap: 8px; }
.bcx-unit-toggle .sa-chip { min-width: 52px; text-align: center; }

/* ── Chart ───────────────────────────────────────────────────────────────── */
.bcx-chart-wrap { position: relative; width: 100%; height: 180px; }

/* ── Sheet status line (Log/Goal sheets) ──────────────────────────────────── */
.bcx-status {
  display: block;
  font-size: var(--fs-base);
  color: var(--muted);
  margin-top: 8px;
}
.bcx-status.success { color: #0f6e56; }
.bcx-status.error { color: #c0392b; }

/* Delete entry — only shown while editing an existing row (Log sheet). */

/* ── Entry table card ─────────────────────────────────────────────────────
   Each row is a plain white 6-col grid (Date wider, 5 equal number cols)
   rendered as a <button> — tap to select (single-select, tap again to
   deselect), then the card-header "Edit" ghost button opens that row in the
   log sheet. No swipe gesture. Only the HEADER row scrolls horizontally,
   exactly like the Weekly Trend card's .bcx-pills chip row (overflow-x
   auto, scrollbar hidden, momentum scroll) — .bcx-tbl-scroll wraps just
   .bcx-tbl-head with a min-width wide enough to need it, giving full-length
   column labels without the row grid trying to make room for them.
   Base text is --fs-base/--fw-regular (not the card's usual --fs-md/bold h3
   body copy) per the design ask; every column (incl. Date) is colored
   --slate to match the hero's "Lean Mass" row text. */
.bcx-table-card { padding: 16px; }

.bcx-tbl-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.bcx-tbl-head-row h3 { margin: 0; }
.bcx-tbl-head-row .sa-btn-ghost:disabled { opacity: .4; }

.bcx-tbl-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.bcx-tbl-scroll::-webkit-scrollbar { display: none; }
/* Header + rows share ONE min-width track so they scroll together and stay
   column-aligned; the date column can't wrap because the track is wider than
   the viewport. */
.bcx-tbl-track { min-width: 420px; }

.bcx-tbl-head,
.bcx-tbl-row {
  display: grid;
  grid-template-columns: 1.4fr repeat(5, 1fr);
  align-items: center;
  gap: 6px;
}
.bcx-tbl-head {
  padding: 0 0 8px;
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  color: var(--slate);
}
.bcx-tbl-head > span:not(.bcx-tbl-c-date),
.bcx-tbl-row > span:not(.bcx-tbl-c-date) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.bcx-tbl-row {
  width: 100%;
  font-family: var(--font);
  font-size: var(--fs-base);
  font-weight: var(--fw-regular);
  color: var(--slate);
  background: var(--white);
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
  margin: 0;
  text-align: left;
}
.bcx-tbl-row:last-child { border-bottom: none; }
.bcx-tbl-row:disabled { cursor: default; }
.bcx-tbl-row.pickable { cursor: pointer; }
/* No hover tint — touch-first surface, same as the exercise/session cards. */
.bcx-tbl-c-date { color: var(--slate); white-space: nowrap; }

.bcx-tbl-empty {
  font-size: var(--fs-base);
  font-weight: var(--fw-regular);
  color: var(--muted);
  padding: 8px 0;
}

/* Pagination footer */
.bcx-tbl-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding-top: 12px;
  margin-top: 4px;
}
.bcx-tbl-pg {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  font-size: var(--fs-md);
  line-height: 1;
  cursor: pointer;
}
.bcx-tbl-pg:disabled { opacity: .4; cursor: default; }
.bcx-tbl-pg-info {
  font-size: var(--fs-base);
  font-weight: var(--fw-regular);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  min-width: 44px;
  text-align: center;
}

