/* Protein Intake Calculator — page-specific presentation.

   Shared shell, panels, hero (.rp-hero), stat tiles (.rp-tiles), FAQ, related cards and Cozy's
   pick come from styles.css and results.css. This file adds the weight presets, the range bar,
   the meal illustration, the source comparison, the label mini-tool and the neutral progress bar.
   Everything is scoped to .protein-page and uses the site's existing colour tokens, so both themes
   and the shared spacing system come for free. */

.protein-page .protein-scope {
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--muted);
}

/* ---------------------------------------------------------------- The form */

.protein-page .protein-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -4px 0 18px;
}

.protein-page .protein-chip {
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  min-height: 44px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--accent);
  color: var(--text);
  cursor: pointer;
}

.protein-page .protein-chip:hover,
.protein-page .protein-chip:focus-visible {
  border-color: var(--highlight);
  color: var(--primary);
}

.protein-page .protein-chip:focus-visible {
  outline: 2px solid var(--highlight);
  outline-offset: 2px;
}

.protein-page .protein-custom {
  margin: 0 0 18px;
  padding: 14px;
  border: 1px solid var(--border);
  border-inline-start: 3px solid var(--highlight);
  border-radius: 12px;
  background: var(--accent);
}

.protein-page .protein-custom > .row { margin-top: 2px; }
.protein-page .protein-custom .field:last-of-type { margin-bottom: 4px; }
.protein-page .protein-custom-label {
  margin: 0 0 12px;
  font-weight: 700;
  font-size: 0.9rem;
}
.protein-page .protein-custom .hint { margin-bottom: 0; }

/* ---------------------------------------------------------------- The hero and range */

.protein-page .protein-hero .label { font-weight: 600; }
.protein-page .protein-hero .rp-hero-split strong { color: inherit; }
.protein-page .protein-stats { margin-top: 18px; }
.protein-page .protein-stats .stat .value { font-size: 1.05rem; }

.protein-page .protein-range { margin: 20px 0 4px; }
.protein-page .protein-range-track {
  position: relative;
  height: 26px;
  border-radius: 13px;
  background: var(--accent);
  border: 1px solid var(--border);
}
.protein-page .protein-range-fill {
  position: absolute;
  top: 8px;
  height: 10px;
  border-radius: 5px;
  background: var(--primary);
  transition: left 180ms ease, width 180ms ease;
}
.protein-page .protein-range-marker {
  position: absolute;
  top: 3px;
  width: 3px;
  height: 20px;
  margin-left: -1.5px;
  border-radius: 2px;
  background: var(--highlight);
  transition: left 180ms ease;
}
.protein-page .protein-range-marker > span {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 5px);
  width: 9px;
  height: 9px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: var(--highlight);
  border: 2px solid var(--card);
}
.protein-page .protein-range-labels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--muted);
}
.protein-page .protein-range-labels span:nth-child(2) { text-align: center; }
.protein-page .protein-range-labels span:last-child { text-align: right; }

/* EFSA and a custom single value are one figure, not a made-up interval. */
.protein-page .protein-range.is-single .protein-range-fill { width: 3px; border-radius: 2px; }
.protein-page .protein-range.is-single .protein-range-labels { grid-template-columns: minmax(0, 1fr); text-align: center; }
.protein-page .protein-range.is-single .protein-range-labels span { text-align: center; }

/* ---------------------------------------------------------------- The meal illustration */

.protein-page .protein-meals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  gap: 10px;
  margin: 14px 0 10px;
}
.protein-page .protein-meal-card {
  min-width: 0;
  padding: 12px;
  border-radius: 12px;
  border-top: 3px solid var(--highlight);
  background: var(--accent);
}
.protein-page .protein-meal-name {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 3px;
}
.protein-page .protein-meal-card strong { font-size: 1.15rem; }

.protein-page .protein-meal-bar {
  display: flex;
  height: 16px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--border);
}
.protein-page .protein-meal-seg {
  min-width: 2px;
  border-right: 2px solid var(--card);
}
.protein-page .protein-meal-seg:last-child { border-right: 0; }
.protein-page .protein-meal-seg:nth-child(odd) { background: var(--primary); }
.protein-page .protein-meal-seg:nth-child(even) { background: var(--highlight); }

/* ---------------------------------------------------------------- The three-source comparison */

.protein-page .protein-compare { display: grid; gap: 10px; margin-top: 12px; }
.protein-page .protein-compare-row {
  min-width: 0;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}
.protein-page .protein-compare-row:first-child { border-top: 0; }
.protein-page .protein-compare-row.is-selected {
  padding: 12px;
  border: 1px solid var(--border);
  border-inline-start: 3px solid var(--highlight);
  border-radius: 12px;
  background: var(--accent);
}
.protein-page .protein-compare-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px 14px;
}
.protein-page .protein-compare-head a {
  font-weight: 600;
  font-size: 0.9rem;
  text-underline-offset: 2px;
}
.protein-page .protein-compare-head strong { font-size: 0.92rem; white-space: nowrap; }
.protein-page .protein-compare-track {
  position: relative;
  height: 22px;
  margin: 9px 0 5px;
  border-radius: 6px;
  background: var(--accent);
}
.protein-page .is-selected .protein-compare-track { background: var(--card); }
.protein-page .protein-compare-span {
  position: absolute;
  top: 7px;
  height: 8px;
  border-radius: 4px;
  background: var(--primary);
  opacity: 0.55;
}
.protein-page .is-selected .protein-compare-span { opacity: 1; }
.protein-page .protein-compare-dot {
  position: absolute;
  top: 5px;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  border-radius: 50%;
  background: var(--highlight);
  border: 2px solid var(--card);
}
.protein-page .protein-compare-note {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--muted);
}

/* ---------------------------------------------------------------- The label mini-tool */

.protein-page .protein-label-tool {
  margin: 14px 0 0;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--accent);
}
.protein-page .protein-label-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.protein-page .protein-label-grid .field { margin-bottom: 10px; }
.protein-page .protein-label-out {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 14px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.protein-page .protein-label-out strong {
  font-size: 1.25rem;
  color: var(--primary);
}
.protein-page .protein-label-out span { font-size: 0.85rem; color: var(--muted); }
.protein-page .protein-label-tool .rp-caption { margin-top: 8px; }

/* ---------------------------------------------------------------- Recorded day, kept neutral */

.protein-page .protein-progress-block {
  margin: 18px 0 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.protein-page .protein-progress-block .rp-heading { margin-top: 0; }
.protein-page .protein-progress-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px 14px;
}
.protein-page .protein-progress-head strong { font-size: 1.15rem; }
.protein-page .protein-progress-head span { font-size: 0.82rem; color: var(--muted); }
.protein-page .protein-progress-bar {
  height: 14px;
  margin: 10px 0 0;
  overflow: hidden;
  border-radius: 7px;
  background: var(--accent);
}
.protein-page .protein-progress-bar > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 7px;
  background: var(--primary);
  transition: width 180ms ease;
}

/* ---------------------------------------------------------------- Formula details and prose */

.protein-page .protein-method p { margin: 0 0 10px; font-size: 0.88rem; line-height: 1.6; }
.protein-page .protein-method p:last-child { margin-bottom: 0; }
.protein-page .protein-method a,
.protein-page .protein-source-list a { overflow-wrap: anywhere; }

.protein-page .fact-list {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}
.protein-page .fact {
  grid-column: span 3;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--accent);
}
/* Five cards read as a deliberate 3 + 2 block: three short cards across the first row and
   the two longer ones sharing the second. */
.protein-page .fact:nth-child(-n+3) { grid-column: span 2; }
.protein-page .fact h3 {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 6px;
  font-size: 0.95rem;
}
.protein-page .fact-emoji {
  flex: none;
  font-size: 1.05rem;
  line-height: 1.25;
}
.protein-page .fact p { margin: 0; font-size: 0.88rem; line-height: 1.6; }
.protein-page #how-it-works h3 { margin: 22px 0 8px; font-size: 1rem; }

/* ---------------------------------------------------------------- Narrow screens */

@media (max-width: 900px) {
  .protein-page .fact-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .protein-page .fact,
  .protein-page .fact:nth-child(-n+3) { grid-column: auto; }
  .protein-page .fact:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  .protein-page .protein-stats { grid-template-columns: minmax(0, 1fr); }
  .protein-page .fact-list { grid-template-columns: minmax(0, 1fr); }
  .protein-page .fact:last-child:nth-child(odd) { grid-column: auto; }
}

@media (max-width: 520px) {
  .protein-page .protein-label-grid { grid-template-columns: minmax(0, 1fr); }
  .protein-page .protein-custom .row { grid-template-columns: minmax(0, 1fr); }
  .protein-page .protein-meals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .protein-page .protein-range-labels { font-size: 0.72rem; }
  .protein-page .protein-compare-head strong { white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
  .protein-page .protein-range-fill,
  .protein-page .protein-range-marker,
  .protein-page .protein-progress-bar > span { transition: none; }
}



