/* Body Fat Percentage Calculator — page-specific presentation.

   Shared shell, panels, hero (.rp-hero), FAQ, related cards and Cozy's pick come from styles.css
   and results.css. This file adds the two-method form, the composition split, the optional mass
   cards, the fixed-scale comparison and the tape-sensitivity chart. Scoped to .bodyfat-page. */

.bodyfat-page .bf-scope {
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--muted);
}

/* ---------------------------------------------------------------- The form */

.bodyfat-page .bf-example-note {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-left: 3px solid var(--highlight);
  border-radius: 8px;
  background: var(--accent);
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 600;
}
.bodyfat-page .bf-control { margin-bottom: 18px; }
.bodyfat-page .bf-control-label {
  display: block;
  margin-bottom: 5px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}
.bodyfat-page .bf-method-switch { flex-wrap: wrap; }
.bodyfat-page .segmented button:focus-visible,
.bodyfat-page .chips .chip:focus-visible,
.bodyfat-page .bf-guide summary:focus-visible,
.bodyfat-page .bf-method-note summary:focus-visible {
  outline: 2px solid var(--highlight);
  outline-offset: 2px;
}
.bodyfat-page .bf-input-unit { display: flex; align-items: stretch; min-width: 0; }
.bodyfat-page .bf-input-unit input {
  flex: 1;
  min-width: 0;
  border-radius: 10px 0 0 10px;
}
.bodyfat-page .bf-unit {
  display: flex;
  align-items: center;
  flex: none;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-left: 0;
  border-radius: 0 10px 10px 0;
  background: var(--accent);
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
}
.bodyfat-page .bf-field-label { display: block; margin-bottom: 6px; font-size: 0.85rem; font-weight: 600; }
.bodyfat-page .bf-height-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.bodyfat-page .bf-height-part label { margin-bottom: 4px; font-size: 0.78rem; }
.bodyfat-page .bf-guide {
  margin: 20px 0;
  padding: 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.bodyfat-page .bf-guide summary {
  cursor: pointer;
  padding: 12px 0;
  font-size: 0.9rem;
  font-weight: 600;
}
.bodyfat-page .bf-guide p,
.bodyfat-page .bf-guide li { color: var(--muted); font-size: 0.84rem; line-height: 1.55; }
.bodyfat-page .bf-guide p { margin: 0 0 10px; }
.bodyfat-page .bf-guide ul { margin: 0 0 10px; padding-left: 18px; }
.bodyfat-page .bf-guide li { margin-bottom: 7px; }
.bodyfat-page .bf-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 4px;
}
.bodyfat-page .bf-actions .btn-secondary { width: 100%; margin-top: 0; }

/* ---------------------------------------------------------------- The result */

.bodyfat-page .bf-hero .value { font-size: clamp(2.4rem, 7vw, 4rem); line-height: 1.05; }
.bodyfat-page .bf-hero .label { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.bodyfat-page .bf-method-badge {
  display: inline-block;
  margin: 0 0 10px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 600;
}
.bodyfat-page .bf-result-example { margin: 0 0 18px; color: var(--muted); font-size: 0.8rem; }
.bodyfat-page .bf-split {
  margin: 12px 0 0;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--accent);
}
.bodyfat-page .bf-split-bar {
  display: flex;
  width: 100%;
  height: 30px;
  overflow: hidden;
  border-radius: 15px;
  background: var(--border);
}
.bodyfat-page .bf-split-fat { display: block; width: 17%; background: var(--primary); }
.bodyfat-page .bf-split-free { display: block; width: 83%; background: var(--fees); }
.bodyfat-page .bf-split-labels { display: grid; gap: 8px; margin-top: 12px; }
.bodyfat-page .bf-split-labels > div {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 9px;
  font-size: 0.84rem;
}
.bodyfat-page .bf-split-labels strong { flex: 1; min-width: 0; }
.bodyfat-page .bf-split-labels span:last-child { font-weight: 700; }
.bodyfat-page .bf-dot { width: 10px; height: 10px; border-radius: 3px; flex: none; align-self: center; }
.bodyfat-page .bf-dot-fat { background: var(--primary); }
.bodyfat-page .bf-dot-free { background: var(--fees); }
.bodyfat-page .bf-split-note { margin: 12px 0 0; color: var(--muted); font-size: 0.8rem; line-height: 1.5; }
.bodyfat-page .bf-split-caption { margin: 8px 0 0; color: var(--muted); font-size: 0.8rem; line-height: 1.5; }
.bodyfat-page .bf-mass-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.bodyfat-page .bf-mass-grid article {
  padding: 12px;
  border-radius: 11px;
  background: var(--card);
  border: 1px solid var(--border);
}
.bodyfat-page .bf-mass-label { display: block; color: var(--muted); font-size: 0.76rem; }
.bodyfat-page .bf-mass-grid strong { display: block; margin-top: 4px; font-size: 1.12rem; }
.bodyfat-page .bf-mass-detail { display: block; margin-top: 3px; color: var(--muted); font-size: 0.7rem; line-height: 1.4; }
.bodyfat-page .bf-mass-note { margin: 12px 0 0; color: var(--muted); font-size: 0.8rem; line-height: 1.5; }
.bodyfat-page .bf-fine { margin: 8px 0 0; color: var(--muted); font-size: 0.76rem; line-height: 1.45; }

/* ---------------------------------------------------------------- Sensitivity explorer */

.bodyfat-page .bf-sens-buttons { margin-bottom: 10px; }
.bodyfat-page .bf-sens-chart {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: end;
  gap: 8px;
  min-height: 205px;
  padding: 12px 8px 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--accent);
}
.bodyfat-page .bf-sens-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 0;
}
.bodyfat-page .bf-sens-value { font-size: 0.72rem; font-weight: 600; text-align: center; }
.bodyfat-page .bf-sens-track {
  display: flex;
  align-items: flex-end;
  width: 100%;
  max-width: 34px;
  height: 125px;
  overflow: hidden;
  border-radius: 6px;
  background: var(--card);
}
.bodyfat-page .bf-sens-fill {
  width: 100%;
  border-radius: 6px 6px 0 0;
  background: var(--primary);
  opacity: 0.82;
  transition: height 180ms ease;
}
.bodyfat-page .bf-sens-label { font-size: 0.67rem; text-align: center; overflow-wrap: anywhere; color: var(--muted); }
.bodyfat-page .bf-sens-col.is-selected .bf-sens-track { outline: 2px solid var(--highlight); outline-offset: 2px; }
.bodyfat-page .bf-sens-col.is-selected .bf-sens-value { color: var(--primary); }
.bodyfat-page .bf-sens-empty { grid-column: 1 / -1; align-self: center; margin: 0; color: var(--muted); font-size: 0.84rem; text-align: center; }
.bodyfat-page .bf-sens-text { margin: 10px 0 0; font-size: 0.84rem; line-height: 1.5; }
.bodyfat-page .bf-sens-scale { margin: 4px 0 0; color: var(--muted); font-size: 0.74rem; line-height: 1.4; }
.bodyfat-page .bf-sens-warning {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--accent);
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

/* ---------------------------------------------------------------- Same weight comparison */

.bodyfat-page .bf-compare-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.bodyfat-page .bf-compare-grid article {
  min-width: 0;
  padding: 14px;
  border-radius: 12px;
  background: var(--accent);
}
.bodyfat-page .bf-compare-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 7px; }
.bodyfat-page .bf-compare-head strong { font-size: 1.1rem; }
.bodyfat-page .bf-compare-head span { color: var(--muted); font-size: 0.78rem; }
.bodyfat-page .bf-mini-bar {
  display: flex;
  height: 14px;
  margin: 10px 0;
  overflow: hidden;
  border-radius: 7px;
  background: var(--border);
}
.bodyfat-page .bf-mini-fat { background: var(--primary); }
.bodyfat-page .bf-mini-free { background: var(--fees); }
.bodyfat-page .bf-compare-grid dl { display: grid; gap: 4px; margin: 0; }
.bodyfat-page .bf-compare-grid dl > div { display: flex; justify-content: space-between; gap: 8px; font-size: 0.8rem; }
.bodyfat-page .bf-compare-grid dt { color: var(--muted); }
.bodyfat-page .bf-compare-grid dd { margin: 0; font-weight: 600; }
.bodyfat-page .bf-method-note {
  margin-top: 18px;
  padding: 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.bodyfat-page .bf-method-note summary { cursor: pointer; padding: 12px 0; font-size: 0.86rem; font-weight: 600; }
.bodyfat-page .bf-method-note p { margin: 0 0 10px; color: var(--muted); font-size: 0.82rem; line-height: 1.55; }
.bodyfat-page .bf-method-note p:last-child { margin-bottom: 12px; }

/* ---------------------------------------------------------------- Fun facts and article */

.bodyfat-page .fact-list {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.bodyfat-page .fact {
  grid-column: span 3;
  min-width: 0;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--accent);
}
.bodyfat-page .fact:nth-child(-n+3) { grid-column: span 2; }
.bodyfat-page .fact h3 {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 6px;
  font-size: 0.95rem;
  line-height: 1.35;
}
.bodyfat-page .fact-emoji { flex: none; line-height: 1.3; }
.bodyfat-page .fact p { margin: 0; font-size: 0.88rem; line-height: 1.6; }
.bodyfat-page .formula { white-space: normal; overflow-wrap: anywhere; }
.bodyfat-page .bf-source-list { overflow-wrap: anywhere; }

@media (max-width: 900px) {
  .bodyfat-page .fact-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bodyfat-page .fact,
  .bodyfat-page .fact:nth-child(-n+3) { grid-column: auto; }
  .bodyfat-page .fact:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  .bodyfat-page .bf-compare-grid { grid-template-columns: minmax(0, 1fr); }
  .bodyfat-page .fact-list { grid-template-columns: minmax(0, 1fr); }
  .bodyfat-page .fact:last-child:nth-child(odd) { grid-column: auto; }
}

@media (max-width: 520px) {
  .bodyfat-page .bf-method-switch button { flex: 1 1 100%; }
  .bodyfat-page .bf-actions { grid-template-columns: minmax(0, 1fr); }
  .bodyfat-page .bf-mass-grid { grid-template-columns: minmax(0, 1fr); }
  .bodyfat-page .bf-height-pair { grid-template-columns: minmax(0, 1fr); }
  .bodyfat-page .bf-sens-chart { gap: 5px; padding-inline: 5px; }
  .bodyfat-page .bf-sens-value { font-size: 0.64rem; }
  .bodyfat-page .bf-sens-label { font-size: 0.6rem; }
  .bodyfat-page .bf-split-labels strong { flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .bodyfat-page .bf-sens-fill { transition: none; }
}


