/* The Body deck — gym & health. All selectors scoped to #view-body. */

/* vitals mini sparks sitting beside stat values */
#view-body .body-stat .body-mini-spark { width: 92px; height: 30px; flex-shrink: 0; opacity: .9; }

/* ── weekly split — the centerpiece ─────────────────────────── */
#view-body .body-week {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px;
}
#view-body .body-day {
  padding: 14px 14px 16px; display: flex; flex-direction: column; gap: 12px;
  position: relative; overflow: hidden; min-height: 196px;
}
#view-body .body-day.rest { background: var(--card-2); }
#view-body .body-day.done { opacity: .82; }
#view-body .body-day.today {
  border-color: rgba(95,176,137,0.55);
  box-shadow: 0 0 0 1px rgba(95,176,137,0.18), 0 0 36px -10px rgba(95,176,137,0.45);
  background: linear-gradient(180deg, rgba(95,176,137,0.07), transparent 60%), var(--card);
}
#view-body .body-day.today::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--mint-deep), var(--mint));
}

#view-body .body-day-top { display: flex; align-items: center; justify-content: space-between; }
#view-body .body-day-name {
  font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--text-faint);
}
#view-body .body-day.today .body-day-name { color: var(--mint); }
#view-body .body-day-check {
  width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  background: var(--green-dim); color: var(--green); border: 1px solid rgba(0,200,5,.4);
}
#view-body .body-day-dot { margin-right: 2px; }

#view-body .body-day-type { display: flex; align-items: center; gap: 9px; }
#view-body .body-day-icon {
  width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
  font-size: 13px; padding: 0; flex-shrink: 0;
}
#view-body .body-day.rest .body-day-icon { color: var(--text-faint); border-color: var(--border); background: rgba(255,255,255,.04); }
#view-body .body-day-label { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; color: var(--text); }
#view-body .body-day.rest .body-day-label { color: var(--text-muted); }

#view-body .body-day-lifts { list-style: none; display: flex; flex-direction: column; gap: 5px; margin-top: 2px; }
#view-body .body-day-lifts li {
  font-size: 11px; color: var(--text-muted); line-height: 1.35; padding-left: 11px; position: relative;
}
#view-body .body-day-lifts li::before {
  content: ""; position: absolute; left: 0; top: 7px; width: 4px; height: 4px; border-radius: 50%;
  background: var(--mint-deep);
}
#view-body .body-day.rest .body-day-lifts li::before { background: var(--border-light); }

/* ── The Figure — mannequin centerpiece framed by focus cards ── */
#view-body .body-figure-panel { padding: 22px; overflow: visible; }
#view-body .body-figure-grid {
  display: grid; grid-template-columns: 1fr minmax(240px, 360px) 1fr;
  gap: 22px; align-items: stretch; justify-items: stretch;
}
#view-body .body-focus-col { display: flex; flex-direction: column; gap: 14px; justify-content: center; }
#view-body .body-focus-card {
  background: var(--card-2); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 16px 18px; position: relative;
}
#view-body .body-focus-eyebrow {
  font-family: var(--font-mono); font-size: 10px; color: var(--mint);
  letter-spacing: .18em; text-transform: uppercase; margin-bottom: 7px;
}
#view-body .body-focus-title {
  font-family: var(--font-display); font-weight: 700; font-size: 1.05rem;
  color: var(--text); margin-bottom: 7px; line-height: 1.2;
}
#view-body .body-focus-body { font-size: 12.5px; color: var(--text-muted); line-height: 1.55; }

/* ── the stage (centered figure) ────────────────────────────── */
#view-body .mannequin-stage {
  position: relative; border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%);
  padding: 22px 14px 14px; overflow: hidden;
  display: flex; flex-direction: column; align-items: center;
}
/* gold Celtic corner brackets */
#view-body .mannequin-stage > .mc-tl,
#view-body .mannequin-stage > .mc-br {
  position: absolute; width: 14px; height: 14px; border-color: var(--gold);
}
#view-body .mannequin-stage > .mc-tl { top: 8px; left: 8px; border-top: 1.5px solid; border-left: 1.5px solid; }
#view-body .mannequin-stage > .mc-br { bottom: 8px; right: 8px; border-bottom: 1.5px solid; border-right: 1.5px solid; }
#view-body .mannequin-eyebrow {
  font-family: var(--font-mono); font-size: 9px; color: var(--text-faint);
  letter-spacing: .18em; text-transform: uppercase; text-align: center; margin-bottom: 6px;
}
#view-body .mannequin-figure { width: 100%; display: flex; justify-content: center; }
#view-body .mannequin-svg { display: block; width: 100%; max-height: 520px; margin: 0 auto; }
#view-body .muscle path { transition: opacity .2s, filter .2s; cursor: pointer; opacity: .92; }
#view-body .muscle[data-state="worked"] path {
  fill: rgba(95,176,137,0.50); stroke: var(--mint); stroke-width: 1;
  filter: drop-shadow(0 0 6px rgba(95,176,137,0.55));
}
#view-body .muscle[data-state="nextup"] path {
  fill: rgba(245,184,66,0.45); stroke: var(--gold); stroke-width: 1;
  filter: drop-shadow(0 0 6px rgba(245,184,66,0.5));
}
#view-body .muscle[data-state="scheduled"] path {
  fill: rgba(154,143,208,0.38); stroke: var(--violet); stroke-width: 1;
  filter: drop-shadow(0 0 6px rgba(154,143,208,0.4));
}
#view-body .muscle[data-state="idle"] path {
  fill: rgba(139,148,158,0.10); stroke: var(--text-faint); stroke-width: .6; filter: none;
}
#view-body .muscle:hover path { opacity: 1; stroke-width: 2; }

#view-body .mannequin-tooltip {
  position: absolute; left: 14px; top: 28px; z-index: 10; min-width: 220px;
  background: var(--bg); border: 1px solid var(--gold); border-radius: var(--radius-lg);
  padding: 10px 12px; pointer-events: none; box-shadow: 0 0 22px rgba(245,184,66,0.25);
}
#view-body .mannequin-tooltip[hidden] { display: none; }
#view-body .mt-status {
  display: flex; align-items: center; gap: 6px; font-family: var(--font-mono);
  font-size: 9px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); margin-bottom: 4px;
}
#view-body .mt-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 6px var(--gold); }
#view-body .mt-name { font-family: var(--font-display); font-size: 17px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
#view-body .mt-when { font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); margin-bottom: 4px; }
#view-body .mt-note { font-size: 12px; color: var(--text-muted); line-height: 1.4; }

#view-body .mannequin-legend {
  display: flex; justify-content: center; gap: 16px; margin-top: 8px; flex-wrap: wrap;
}
#view-body .legend-pip {
  display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono);
  font-size: 9.5px; color: var(--text-muted); letter-spacing: .12em; text-transform: uppercase;
}
#view-body .lp-dot { width: 8px; height: 8px; border-radius: 50%; }
#view-body .lp-dot.worked { background: var(--mint); box-shadow: 0 0 6px rgba(95,176,137,0.6); }
#view-body .lp-dot.nextup { background: var(--gold); box-shadow: 0 0 6px rgba(245,184,66,0.6); }
#view-body .lp-dot.scheduled { background: var(--violet); }
#view-body .lp-dot.idle { background: var(--text-faint); }

/* ── current block panel ────────────────────────────────────── */
#view-body .body-block-name { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; color: var(--text); line-height: 1.2; }
#view-body .body-block-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 7px 0; font-size: 13px; border-bottom: 1px dashed var(--border);
}
#view-body .body-block-row:last-of-type { border-bottom: none; }
#view-body .body-block-row > span:last-child { color: var(--text); font-weight: 500; text-align: right; }

/* ── body metrics ───────────────────────────────────────────── */
#view-body .body-metrics { display: flex; flex-direction: column; gap: 18px; }
#view-body .body-metric:not(:last-child) { padding-bottom: 18px; border-bottom: 1px solid var(--border); }
#view-body .body-metric-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
#view-body .body-metric-label { font-size: 12.5px; font-weight: 600; color: var(--text-muted); }
#view-body .body-metric-val { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; color: var(--mint); }
#view-body .body-metric-spark { width: 100%; height: 34px; margin-top: 6px; display: block; }
#view-body .body-metric-sub { font-size: 11.5px; margin-top: 6px; }

/* ── roadmap rows ───────────────────────────────────────────── */
#view-body .body-road-glyph { color: var(--mint); display: inline-flex; flex-shrink: 0; }
#view-body .body-road-title { font-family: var(--font-display); font-weight: 600; font-size: 13.5px; color: var(--text); }
#view-body .xrow.open .body-road-title { color: var(--mint); }
#view-body .xrow-body-inner { padding-left: 44px; }
#view-body .xrow-body-inner p { font-size: 13px; }

/* ── responsive ─────────────────────────────────────────────── */
@media (max-width: 1100px){
  #view-body .body-week { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 920px){
  /* stack the framing cards above/below the centered figure */
  #view-body .body-figure-grid { grid-template-columns: 1fr; }
  #view-body .mannequin-stage { order: -1; }
  #view-body .body-focus-col { flex-direction: row; flex-wrap: wrap; }
  #view-body .body-focus-card { flex: 1 1 240px; }
  #view-body .mannequin-svg { max-height: 460px; }
}
@media (max-width: 520px){
  #view-body .body-focus-col { flex-direction: column; }
}
@media (max-width: 860px){
  #view-body .grid[style*="320px"],
  #view-body .grid[style*="1.1fr"] { grid-template-columns: 1fr !important; }
}
@media (max-width: 680px){
  #view-body .body-week { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 420px){
  #view-body .body-week { grid-template-columns: 1fr; }
}

/* ── Sparkline containment: bound the canvas so Chart.js (responsive) can't
   feedback-grow it into an endlessly tall chart. Fixed-height relative box,
   canvas pinned to fill it. ─────────────────────────────────────────────── */
#view-body .spark-box { position: relative; width: 100%; height: 36px; margin-top: 6px; }
#view-body .spark-box.spark-box-mini { width: 92px; height: 30px; margin-top: 0; flex-shrink: 0; }
#view-body .spark-box canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; display: block; }
