/* ==========================================================================
   BULLDER · cuerpo (prefijo bd-): peso y tendencia, IMC, medidas, historial,
   hojas de registro y fotos de progreso (galería y comparador antes/después).
   ========================================================================== */

/* ------------------------------------------------------------------ resumen */
.bd { display: flex; flex-direction: column; }
.bd-top { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-3); }
.bd-side { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-3); align-content: start; }
.bd-hero { display: flex; flex-direction: column; gap: var(--sp-3); }
.bd-hero-main { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.bd-big { font: 800 48px/1 var(--font-display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.bd-big small { font: 600 17px/1 var(--font); color: var(--text-2); margin-left: 6px; letter-spacing: 0; }
.bd-weigh { flex: none; }
.bd-hero-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); padding: var(--sp-3) 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.bd-hero-facts.bd-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.bd-hero-facts > div { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.bd-hero-facts span:first-child { font-size: 12px; color: var(--text-3); }
.bd-hero-facts b { font: 650 15px/1.2 var(--font); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bd-chg { display: inline-flex; align-items: center; gap: 3px; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--text-2); font-weight: 650; }
.bd-chg .ic { width: 15px; height: 15px; color: var(--text-3); }
.bd-hero-facts .bd-chg { color: var(--text); }
#bd-range.segmented button, #bd-m-range.segmented button { font-size: 12.5px; padding: 0 4px; white-space: nowrap; }
.bd-chart { min-height: 200px; }
.bd-chart-empty { height: 200px; display: grid; place-items: center; text-align: center; padding: 0 var(--sp-4); }

/* IMC y grasa */
.bd-mini { display: flex; flex-direction: column; gap: 10px; }
.bd-mini > .row-between > .ic { color: var(--text-3); }
.bd-mini-val { font: 750 30px/1.1 var(--font-display); font-variant-numeric: tabular-nums; }
.bd-mini-val small { font: 600 14px/1 var(--font); color: var(--text-2); margin-left: 3px; }
.bd-bmi { position: relative; display: flex; gap: 2px; height: 8px; border-radius: 4px; overflow: visible; }
.bd-bmi i { height: 100%; opacity: .75; }
.bd-bmi i:first-child { border-radius: 4px 0 0 4px; } .bd-bmi i:nth-child(4) { border-radius: 0 4px 4px 0; }
.bd-bmi span { position: absolute; top: -5px; width: 4px; height: 18px; margin-left: -2px; border-radius: 2px; background: var(--text); box-shadow: 0 0 0 2px var(--surface); }
.bd-bmi-ticks { position: relative; height: 14px; }
.bd-bmi-ticks span { position: absolute; transform: translateX(-50%); font-variant-numeric: tabular-nums; }
.bd-bmi-ticks span:nth-child(1) { left: 14%; } .bd-bmi-ticks span:nth-child(2) { left: 40%; } .bd-bmi-ticks span:nth-child(3) { left: 60%; }

/* medidas */
.bd-measures { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-2); }
.bd-measure { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; min-height: 104px; min-width: 0; }
.bd-m-label { font: 600 12.5px/1.2 var(--font); color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd-m-val { font: 700 22px/1.1 var(--font-display); font-variant-numeric: tabular-nums; }
.bd-m-val small { font: 600 12px/1 var(--font); color: var(--text-2); margin-left: 3px; }
.bd-m-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: auto; font-size: 12.5px; min-height: 22px; }
.bd-m-foot svg { flex: none; }
.bd-measure.is-empty { background: transparent; border-style: dashed; }
.bd-hist-val { color: var(--text); font-variant-numeric: tabular-nums; min-width: 64px; text-align: right; }
.bd-hist-delta { font-size: 12.5px; }
.bd-photos-link { display: flex; align-items: center; gap: var(--sp-3); }
.bd-photos-link b { display: block; }
.bd-photos-link > .ic { color: var(--text-3); }

/* ------------------------------------------------------------------ hoja de peso rápido */
.bd-ws { display: flex; flex-direction: column; gap: var(--sp-3); outline: none; padding-top: 4px; }
.bd-ws-top { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); }
.bd-ws-step { width: 64px; height: 64px; border-radius: 20px; background: var(--surface-2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; flex: none; transition: transform .1s; }
.bd-ws-step:active { transform: scale(.93); }
.bd-ws-step span { font: 600 11px/1 var(--font); color: var(--text-3); }
.bd-ws-val { flex: 1; text-align: center; }
.bd-ws-val b { font: 800 54px/1 var(--font-display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.bd-ws-val b.is-fresh { color: var(--text-2); }
.bd-ws-val small { font: 600 18px/1 var(--font); color: var(--text-2); margin-left: 6px; }
.bd-ws-hint { min-height: 18px; }
.bd-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.bd-pad button { height: 56px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); font: 650 22px/1 var(--font-display); display: grid; place-items: center; transition: background .1s, transform .1s; }
.bd-pad button:active { background: var(--surface-3); transform: scale(.96); }

/* ------------------------------------------------------------------ hoja de registro */
.bd-form { display: flex; flex-direction: column; gap: var(--sp-4); padding-bottom: var(--sp-2); }
.bd-form .grid-2 { gap: var(--sp-3); }
.bd-form-sec { display: flex; align-items: baseline; justify-content: space-between; padding-top: var(--sp-3); border-top: 1px solid var(--line); }
.bd-form input[type="date"] { color-scheme: inherit; }
.bd-form .banner { align-items: center; }

/* ------------------------------------------------------------------ fotos */
.bd-ph { display: flex; flex-direction: column; gap: var(--sp-4); }
.bd-private .ic { color: var(--info); }
.bd-ph-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-2); }
.bd-ph-actions > :nth-child(3) { grid-column: 1 / -1; }
.bd-file { position: relative; overflow: hidden; cursor: pointer; }
.bd-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.bd-file:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.bd-ph-filter { margin-top: calc(var(--sp-2) * -1); }
.bd-count { font-size: 11.5px; opacity: .7; margin-left: 2px; font-variant-numeric: tabular-nums; }
.bd-day .section-head { margin: var(--sp-2) 0 var(--sp-2); }
.bd-cap::first-letter { text-transform: uppercase; }
.bd-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.bd-thumb { position: relative; aspect-ratio: 3 / 4; border-radius: var(--r-sm); overflow: hidden; background: var(--surface-2); }
.bd-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s var(--ease); }
.bd-thumb:hover img { transform: scale(1.03); }
.bd-thumb-pose { position: absolute; left: 6px; bottom: 6px; padding: 3px 7px; border-radius: 7px; background: rgba(8, 10, 24, .72); color: #fff; font: 650 11px/1 var(--font); backdrop-filter: blur(6px); }
.bd-up { display: flex; flex-direction: column; gap: var(--sp-4); }
.bd-up-prev { border-radius: var(--r); overflow: hidden; background: var(--surface-2); max-height: 42vh; display: grid; place-items: center; }
.bd-up-prev img { max-height: 42vh; width: auto; object-fit: contain; }
.bd-poses { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.bd-lock { display: flex; gap: 8px; align-items: flex-start; }
.bd-lock .ic { margin-top: 2px; flex: none; }
.bd-view { border-radius: var(--r); overflow: hidden; background: var(--surface-2); display: grid; place-items: center; }
.bd-view img { max-height: 62vh; width: auto; object-fit: contain; }

/* comparador antes/después */
.bd-cmp-wrap { display: flex; flex-direction: column; gap: var(--sp-3); }
.bd-cmp-poses { margin-bottom: 0; }
.bd-cmp { --pos: 50%; position: relative; width: 100%; max-width: 480px; margin: 0 auto; aspect-ratio: 3 / 4; border-radius: var(--r); overflow: hidden; background: var(--surface-2); user-select: none; touch-action: pan-y; }
.bd-cmp img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.bd-cmp-top { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--pos)); }
.bd-cmp-line { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 6px rgba(0, 0, 0, .45); pointer-events: none; }
.bd-cmp-line span { position: absolute; top: 50%; left: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; background: #fff; color: #10131f; display: grid; place-items: center; box-shadow: 0 2px 10px rgba(0, 0, 0, .35); }
.bd-cmp-tag { position: absolute; top: 10px; padding: 5px 9px; border-radius: 8px; background: rgba(8, 10, 24, .72); color: #fff; font: 650 12px/1 var(--font); pointer-events: none; }
.bd-cmp-tag.is-a { left: 10px; } .bd-cmp-tag.is-b { right: 10px; }
.bd-cmp-range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; -webkit-appearance: none; appearance: none; }
.bd-cmp-range:focus-visible + * , .bd-cmp:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (min-width: 600px) {
  .bd-measures { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bd-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-2); }
  .bd-ph-actions { grid-template-columns: repeat(3, minmax(0, max-content)); }
  .bd-ph-actions > :nth-child(3) { grid-column: auto; }
  .bd-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 960px) {
  .bd-top { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: var(--sp-4); align-items: start; }
  .bd-side { grid-template-columns: minmax(0, 1fr); gap: var(--sp-4); }
  .bd-measures { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--sp-3); }
  .bd-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .bd-big { font-size: 56px; }
}
