.compare-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.compare-row:last-child { border-bottom: none; }
.compare-label { font-size: 11px; color: var(--ink-dim); text-transform: uppercase; letter-spacing: 0.4px; grid-column: 1 / -1; margin-bottom: 2px; }
.compare-val { font-family: var(--font-display); font-size: 18px; }
.compare-val.start { color: var(--ink-dim); text-align: left; }
.compare-val.end { color: var(--ink); text-align: right; }
.compare-arrow { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.compare-arrow svg { width: 16px; height: 16px; }

.photo-placeholder {
  aspect-ratio: 3/4;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--ink-faint);
  background: var(--bg-elevated);
}
.photo-placeholder svg { width: 26px; height: 26px; }
.photo-placeholder .lbl { font-size: 11px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase; }
.photo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.compare-group { font-size: 11px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.5px; margin: 12px 0 2px; }
.compare-group:first-child { margin-top: 0; }
.compare-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
.compare-cols .compare-group:first-child { margin-top: 0; }
.compare-cols .compare-val { font-size: 16px; }
@media (max-width: 700px) { .compare-cols { grid-template-columns: 1fr; } }

/* Before & After, demoted to a slim strip at the bottom of the page */
.ba-strip { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px; }
.ba-strip .ba-text { display: flex; align-items: center; gap: 8px; color: var(--ink-dim); font-size: 12px; min-width: 0; }
.ba-strip .ba-text svg { width: 16px; height: 16px; color: var(--forge); flex: none; }
.ba-strip .ba-text b { color: var(--ink); white-space: nowrap; }
.ba-strip .ba-slots { display: flex; align-items: center; gap: 8px; flex: none; }
.ba-strip .ba-slot { font-size: 10.5px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; color: var(--ink-faint); border: 1px dashed var(--line); border-radius: 8px; padding: 6px 10px; }
@media (max-width: 720px) { .ba-strip { flex-direction: column; align-items: flex-start; } }

/* Body composition: two columns of one-line rows, no figure */
.g-1-15 { display: grid; grid-template-columns: 1fr 1.5fr; gap: 16px; }
.body-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
.body-cols .measure-row { font-size: 12.5px; }
@media (max-width: 1000px) { .g-1-15 { grid-template-columns: 1fr; } }
@media (max-width: 720px) { .body-cols { grid-template-columns: 1fr; } }

/* Milestones Achieved list + scrollable workout history */
.milestone-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.milestone { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); color: var(--ink-faint); }
.milestone .ms-ic { width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.05); }
.milestone .ms-ic svg { width: 15px; height: 15px; }
.milestone .ms-label { font-weight: 800; font-size: 13px; color: var(--ink-dim); }
.milestone .ms-hint { font-size: 11px; color: var(--ink-faint); margin-top: 2px; }
.milestone .ms-tag { font-size: 10px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--ink-faint); }
.milestone.earned { border-color: rgba(255,194,75,0.45); background: linear-gradient(90deg, rgba(255,194,75,0.12), rgba(255,117,24,0.05)); }
.milestone.earned .ms-ic { color: var(--warn); background: rgba(255,194,75,0.15); filter: drop-shadow(0 0 8px rgba(255,194,75,0.5)); }
.milestone.earned .ms-label { color: var(--ink); }
.milestone.earned .ms-tag { color: var(--warn); }
.scroll-list { max-height: 440px; overflow-y: auto; padding-right: 6px; }
@media (max-width: 720px) { .milestone-list { grid-template-columns: 1fr; } }

/* Improvements So Far: full-width card, one thick bar per discipline */
.improve-row { padding: 20px 0; border-bottom: 1px solid var(--line-soft); }
.improve-row:last-of-type { border-bottom: none; }
.improve-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.improve-ic { width: 22px; height: 22px; display: inline-flex; }
.improve-ic svg { width: 22px; height: 22px; }
.improve-label { font-weight: 800; font-size: 17px; color: var(--ink); flex: 1; letter-spacing: 0.2px; }
.improve-val { font-family: var(--font-display); font-size: 26px; color: var(--ink); }
.improve-target { font-family: var(--font-body); font-size: 12px; color: var(--ink-faint); font-weight: 600; }
.improve-track { height: 26px; border-radius: 999px; background: rgba(255,255,255,0.06); overflow: hidden; border: 1px solid rgba(255,255,255,0.05); }
.improve-track span {
  display: flex; align-items: center; justify-content: flex-end; height: 100%; min-width: 46px;
  border-radius: 999px; box-shadow: 0 0 16px currentColor; transition: width .6s ease;
  background-image: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.22) 100%);
}
.improve-track span i { font-style: normal; font-weight: 800; font-size: 11px; color: #0B0E14; padding-right: 10px; letter-spacing: 0.3px; }
.improve-sub { font-size: 12px; color: var(--ink-faint); margin-top: 7px; }

/* Tape measurements inside the body composition card */
.tape-head { display: flex; align-items: center; gap: 6px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-soft); font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--ink-dim); }
.tape-head svg { width: 14px; height: 14px; color: var(--forge); }
.tape-head .sub { font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--ink-faint); margin-left: 4px; }
.tape-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tape-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: rgba(255,255,255,0.03); font-family: var(--font-display); font-size: 15px; color: var(--ink); }
.tape-chip b { font-family: var(--font-body); font-weight: 600; font-size: 11px; color: var(--ink-dim); }

/* Body composition rows: fixed columns so arrows and numbers line up */
.body-cols .measure-row { grid-template-columns: 18px 1fr 64px 14px 72px 74px; gap: 6px; padding: 11px 0; font-size: 12.5px; }
.body-cols .measure-row > span:nth-child(2) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.body-cols .measure-row > span:nth-child(2) { color: var(--ink-dim); font-weight: 600; }
.body-cols .measure-row .from { text-align: right; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.body-cols .measure-row .arrow { text-align: center; color: var(--ink-faint); }
.body-cols .measure-row .arrow svg { width: 12px; height: 12px; vertical-align: middle; }
.body-cols .measure-row .to { text-align: right; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.body-cols .measure-row > span:last-child { text-align: right; }
.body-cols .measure-row .delta { display: inline-flex; align-items: center; justify-content: flex-end; gap: 4px; min-width: 70px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.body-cols .measure-row .delta .d-arrow { display: inline-flex; width: 12px; height: 12px; }
.body-cols .measure-row .delta .d-arrow svg { width: 12px; height: 12px; }
.body-cols .measure-row .delta.flat { color: var(--ink-faint); }
.tape-chips { margin-bottom: 2px; }

/* Body composition as one landscape block with the weight trend inside */
.body-cols.three { grid-template-columns: 1fr 1fr 1fr; gap: 0 32px; }
.body-block .tape-head { margin-top: 10px; }
.weight-strip { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.weight-strip-head { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; flex-wrap: wrap; }
.weight-strip-head .ws-title { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--ink-dim); }
.weight-strip-head .ws-title svg { width: 14px; height: 14px; color: var(--forge); }
.weight-strip canvas { width: 100%; height: 110px; display: block; }
@media (max-width: 1000px) { .body-cols.three { grid-template-columns: 1fr 1fr; } }
@media (max-width: 720px) { .body-cols.three { grid-template-columns: 1fr; } }

/* Tight label-to-values spacing; the big gap sits between the three sections */
.body-cols .measure-row { grid-template-columns: 18px max-content 64px 14px 72px 74px; justify-content: start; column-gap: 10px; }
.body-cols .measure-row > span:nth-child(2) { min-width: 96px; }
.body-cols.three { gap: 0 20px; }
.body-cols.three > div + div { border-left: 1px solid var(--line-soft); padding-left: 24px; }

/* Milestones: three tight columns, gold earned cards with a shine sweep and glowing trophy */
.milestone-list { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.milestone { position: relative; overflow: hidden; padding: 9px 12px; gap: 10px; grid-template-columns: 32px 1fr auto; }
.milestone .ms-label { font-size: 13.5px; }
.milestone .ms-hint { font-size: 11px; line-height: 1.3; }
.milestone .ms-tag { display: inline-flex; align-items: center; gap: 4px; }
.milestone .ms-tag svg { width: 11px; height: 11px; }
.milestone.earned { border-color: rgba(255,194,75,0.55); background: linear-gradient(135deg, rgba(255,194,75,0.18) 0%, rgba(255,117,24,0.10) 45%, rgba(16,19,26,0) 100%); box-shadow: 0 0 0 1px rgba(255,194,75,0.08) inset, 0 6px 18px -10px rgba(255,160,40,0.6); animation: ms-pop .5s cubic-bezier(.2,.9,.3,1.2) both; }
.milestone.earned .ms-ic { width: 32px; height: 32px; background: radial-gradient(circle at 30% 30%, #FFE08A, #FF9A1F 70%); color: #2A1600; filter: none; box-shadow: 0 0 14px rgba(255,194,75,0.55); animation: ms-glow 2.4s ease-in-out infinite; }
.milestone.earned .ms-ic svg { width: 16px; height: 16px; }
.milestone.earned .ms-label { color: #FFE9B8; text-shadow: 0 0 10px rgba(255,194,75,0.25); }
.milestone.earned .ms-hint { color: var(--ink-dim); }
.milestone.earned .ms-tag { color: #FFD56A; }
.milestone .ms-shine { position: absolute; top: -40%; bottom: -40%; width: 46px; left: -80px; background: linear-gradient(100deg, rgba(255,255,255,0) 0%, rgba(255,240,200,0.28) 50%, rgba(255,255,255,0) 100%); transform: skewX(-18deg); animation: ms-shine 4.5s ease-in-out infinite; animation-delay: inherit; pointer-events: none; }
.milestone:not(.earned) { opacity: 0.75; border-style: dashed; }
@keyframes ms-shine { 0%, 70% { left: -80px; } 100% { left: 120%; } }
@keyframes ms-glow { 0%, 100% { box-shadow: 0 0 10px rgba(255,194,75,0.4); } 50% { box-shadow: 0 0 20px rgba(255,194,75,0.85); } }
@keyframes ms-pop { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
@media (max-width: 1000px) { .milestone-list { grid-template-columns: 1fr 1fr; } }
@media (max-width: 720px) { .milestone-list { grid-template-columns: 1fr; } }

/* ---------- Weight Trend + Body Measurements row ---------- */
.g-60-40 { display: grid; grid-template-columns: 60fr 40fr; gap: 16px; }
@media (max-width: 1000px) { .g-60-40 { grid-template-columns: 1fr; } }
.wt-card { display: flex; flex-direction: column; }
.wt-card canvas { margin-top: 10px; width: 100%; display: block; height: 300px; flex: 1 1 300px; }
.wt-big { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 2px 0 4px; }
.wt-big .stat-big { font-size: 38px; line-height: 1; }
.wt-delta { display: inline-flex; align-items: center; gap: 4px; padding-bottom: 4px; }
.wt-delta svg { width: 16px; height: 16px; }
.wt-delta b { font-family: var(--font-display); font-size: 20px; }
.wt-delta small { font-size: 11px; color: var(--ink-faint); margin-left: 4px; }
.wt-delta em { font-style: normal; font-weight: 800; font-size: 14px; margin-left: 4px; opacity: 0.9; }
.wt-delta.good { color: var(--success); }
.wt-delta.bad { color: var(--warn); }
.wt-delta.flat { color: var(--ink-faint); }

.bm-table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-top: 2px; }
.bm-table th { font-size: 10px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--ink-faint); text-align: right; padding: 4px 6px 8px; border-bottom: 1px solid var(--line); }
.bm-table th:first-child { text-align: left; }
.bm-table td { padding: 7px 6px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; font-variant-numeric: tabular-nums; }
.bm-table tbody tr:last-child td { border-bottom: none; }
.bm-table tbody tr:hover td { background: rgba(255,255,255,0.025); }
.bm-l { color: var(--ink); font-weight: 600; display: flex; align-items: center; gap: 9px; }
.bm-ic { width: 22px; height: 22px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; background: rgba(255,117,24,0.12); box-shadow: inset 0 0 0 1px rgba(255,117,24,0.22); flex-shrink: 0; }
.bm-ic svg { width: 13px; height: 13px; }
.bm-v { text-align: right; color: var(--ink-dim); }
.bm-v.now { color: var(--ink); font-weight: 800; }
.bm-v small { font-size: 10px; color: var(--ink-faint); margin-left: 2px; font-weight: 500; }
.bm-ch { text-align: right; font-weight: 800; }
.bm-ch svg { width: 12px; height: 12px; vertical-align: -2px; margin-right: 2px; }
.bm-ch small { font-size: 10px; margin-left: 2px; font-weight: 600; }
.bm-ch.good { color: var(--success); }
.bm-ch.bad { color: var(--warn); }
.bm-ch.flat { color: var(--ink-faint); font-weight: 500; }
.bm-div td { padding: 12px 6px 6px; font-size: 10px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--ink-dim); border-bottom: 1px solid var(--line); }
.bm-div svg { width: 12px; height: 12px; vertical-align: -2px; color: var(--hydro); margin-right: 4px; }

/* ---------- Weekly overview tiles: line + dots mini charts ---------- */
.wo-card { display: flex; flex-direction: column; }
.wo-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; flex: 1; }
.mini-tile { background: var(--bg-elevated); border: 1px solid var(--line-soft); border-radius: var(--radius-md); padding: 12px 12px 8px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mt-head { display: flex; align-items: center; gap: 8px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; color: var(--ink-dim); }
.mt-ic { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: color-mix(in srgb, currentColor 14%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 28%, transparent); flex-shrink: 0; }
.mt-ic svg { width: 14px; height: 14px; }
.mt-val { font-family: var(--font-display); font-size: 22px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; line-height: 1.1; }
.mt-val .unit { font-size: 11px; color: var(--ink-dim); font-family: var(--font-body); font-weight: 600; }
.mt-delta { display: inline-flex; align-items: center; gap: 2px; font-family: var(--font-body); font-weight: 800; font-size: 12px; }
.mt-delta svg { width: 12px; height: 12px; }
.mt-delta.good { color: var(--success); } .mt-delta.bad { color: var(--warn); } .mt-delta.flat { color: var(--ink-faint); }
.mt-sub { font-size: 10.5px; color: var(--ink-faint); }
.mini-tile canvas { width: 100%; height: 92px; min-height: 92px; flex: 1; display: block; margin-top: auto; }
@media (max-width: 1000px) { .wo-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .wo-grid { grid-template-columns: 1fr; } }

/* ---------- Recovery & wellness: four lines + legend ---------- */
.rw-card { display: flex; flex-direction: column; }
.rw-body { display: grid; grid-template-columns: 1fr 150px; gap: 12px; align-items: center; flex: 1; }
.rw-body canvas { width: 100%; height: 200px; display: block; }
.rw-legend { display: flex; flex-direction: column; gap: 10px; }
.rw-row { display: grid; grid-template-columns: 10px 1fr; grid-template-areas: "dot name" "dot val"; column-gap: 8px; align-items: center; font-size: 11px; }
.rw-row i { grid-area: dot; width: 10px; height: 10px; border-radius: 50%; display: block; }
.rw-name { grid-area: name; color: var(--ink-dim); font-weight: 600; }
.rw-val { grid-area: val; font-family: var(--font-display); font-size: 15px; color: var(--ink); }
.rw-delta { grid-area: val; justify-self: end; font-weight: 800; font-size: 11px; }
.rw-delta.good { color: var(--success); } .rw-delta.bad { color: var(--warn); } .rw-delta.flat { color: var(--ink-faint); }
.rw-card .note { margin-top: 8px; }
@media (max-width: 520px) { .rw-body { grid-template-columns: 1fr; } }

@media (max-width: 520px) {
  .bm-tablewrap { overflow-x: auto; }
  .bm-table { font-size: 11px; table-layout: fixed; min-width: 100%; }
  .bm-table th:first-child { width: 38%; }
  .bm-table th, .bm-table td { padding: 6px 2px; }
  .bm-l { gap: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
  .bm-l .bm-ic { vertical-align: -5px; margin-right: 5px; }
  .bm-ic { width: 18px; height: 18px; border-radius: 5px; }
  .bm-ic svg { width: 11px; height: 11px; }
  .bm-v small { display: none; }
  .bm-ch small { font-size: 9px; }
  .bm-ch svg { width: 10px; height: 10px; margin-right: 1px; }
  .bm-div td { font-size: 9px; letter-spacing: 0.6px; white-space: normal; }
  .wt-big .stat-big { font-size: 32px; }
}

/* ---------- Body measurements: glowing figure + headline chips beside the table ---------- */
.bm-wrap { display: grid; grid-template-columns: 158px 1fr; gap: 16px; align-items: start; }
.bm-side { display: flex; flex-direction: column; gap: 8px; }
.bm-figure { height: 300px; border-radius: var(--radius-md); background-size: cover; background-position: center top; position: relative; overflow: hidden; border: 1px solid rgba(255,117,24,0.2); box-shadow: inset 0 0 40px rgba(255,117,24,0.12), 0 0 24px rgba(255,117,24,0.12); }
.bm-figure::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,12,16,0) 60%, rgba(10,12,16,0.9) 100%); }
.bm-chip { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "l l" "v d"; align-items: baseline; gap: 2px 8px; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--line-soft); background: var(--bg-elevated); }
.bm-chip .bc-l { grid-area: l; font-size: 10px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; color: var(--ink-dim); }
.bm-chip .bc-v { grid-area: v; font-family: var(--font-display); font-size: 19px; color: var(--ink); }
.bm-chip .bc-v small { font-family: var(--font-body); font-size: 10px; color: var(--ink-faint); margin-left: 2px; font-weight: 600; }
.bm-chip .bc-d { grid-area: d; font-size: 11.5px; font-weight: 800; display: inline-flex; align-items: center; gap: 2px; }
.bm-chip .bc-d svg { width: 11px; height: 11px; }
.bm-chip .bc-d.good { color: var(--success); } .bm-chip .bc-d.bad { color: var(--warn); } .bm-chip .bc-d.flat { color: var(--ink-faint); }
.bm-tablewrap { min-width: 0; }
@media (max-width: 720px) {
  .bm-wrap { grid-template-columns: 1fr; }
  .bm-side { display: grid; grid-template-columns: 1fr 1fr 1fr; grid-template-areas: "f f f" "a b c"; min-width: 0; }
  .bm-side > * { min-width: 0; }
  .bm-figure { grid-area: f; height: 220px; background-size: contain; background-repeat: no-repeat; background-position: center; background-color: #0E1117; }
  .bm-chip { padding: 8px 9px; grid-template-columns: 1fr; grid-template-areas: "l" "v" "d"; }
  .bm-chip .bc-v { font-size: 17px; }
  .bm-chip .bc-d { font-size: 10.5px; }
}

/* ---------- Weekly overview: four stand-alone tiles with a faint ridge behind each ---------- */
.wo-row .mini-tile { position: relative; overflow: hidden; border-color: var(--line); padding: 14px 14px 10px; }
.wo-row .mini-tile::before { content: ""; position: absolute; inset: 0; z-index: 0; background: linear-gradient(180deg, rgba(10,12,16,0.80), rgba(10,12,16,0.95)), url('/img/bg-mountains.jpg') center/cover; }
.wo-row .mini-tile > * { position: relative; z-index: 1; }
.wo-row .mini-tile canvas { height: 110px; min-height: 110px; }
.rw-body canvas { height: 260px; }

/* ---------- Full-width variants (Progress page order from Oct 20) ---------- */
.wt-card.wide canvas { height: 320px; flex: none; }
.wt-card.wide .wt-big { align-items: baseline; }
.wt-card.wide .wt-big .note { margin: 0 0 0 auto; }
.rw-card.wide .rw-body { grid-template-columns: 1fr 200px; gap: 20px; }
.rw-card.wide .rw-body canvas { height: 300px; }
.rw-card.wide .rw-legend { gap: 14px; }
.rw-card.wide .rw-val { font-size: 17px; }
.bm-card.wide .bm-wrap { grid-template-columns: 190px 1fr; gap: 20px; }
.bm-card.wide .bm-figure { height: 340px; }
.bm-card.wide .bm-table { font-size: 13px; }
@media (max-width: 720px) {
  .wt-card.wide canvas { height: 260px; }
  .wt-card.wide .wt-big .note { margin-left: 0; width: 100%; }
  .rw-card.wide .rw-body { grid-template-columns: 1fr; }
  .rw-card.wide .rw-body canvas { height: 260px; }
  .bm-card.wide .bm-wrap { grid-template-columns: 1fr; }
  .bm-card.wide .bm-figure { height: 220px; }
}
