/* Разбор питания за неделю: карточки нутриентов, план и источники.
   Столбики дней рисуются div'ами, а не canvas: их восемь на карточку и они
   статичные, а canvas на каждый нутриент означал бы восемь контекстов и
   перерисовку при каждом открытии. */

.rp { display: flex; flex-direction: column; gap: 18px; padding-bottom: 24px; }

.rp-head { display: flex; flex-direction: column; gap: 8px; }
.rp-period { font-size: 13px; color: var(--text-muted); }
.rp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rp-chip {
  font-size: 12px; padding: 4px 10px; border-radius: 999px;
  background: var(--card-2, rgba(127,127,127,.12)); color: var(--text);
}

.rp-block { display: flex; flex-direction: column; gap: 10px; }
.rp-block h3 { font-size: 15px; margin: 0; }
.rp-until { font-size: 12px; color: var(--text-muted); margin: -4px 0 0; }
.rp-empty { font-size: 14px; color: var(--text-muted); margin: 0; }

/* --- План --- */
.rp-action {
  display: grid; grid-template-columns: 26px 1fr; gap: 10px;
  padding: 12px; border-radius: 12px;
  background: var(--card, rgba(127,127,127,.08));
}
.rp-action-num {
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
  background: var(--accent, #34c759); color: #fff;
}
.rp-action-body { display: flex; flex-direction: column; gap: 4px; }
.rp-action-body h4 { margin: 0; font-size: 14px; }
.rp-action-what { margin: 0; font-size: 14px; }
.rp-action-why, .rp-action-effect {
  margin: 0; font-size: 12.5px; color: var(--text-muted);
}

/* --- Цели --- */
.rp-goal-row { display: flex; flex-direction: column; gap: 5px; }
.rp-goal-head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 13px;
}
.rp-goal-head b { font-variant-numeric: tabular-nums; }
.rp-goal-track {
  height: 6px; border-radius: 999px; overflow: hidden;
  background: var(--fill-track, rgba(127,127,127,.2));
}
.rp-goal-fill { height: 100%; background: var(--accent, #34c759); }

/* --- Источники --- */
.rp-source {
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 12px; border-radius: 12px;
  background: var(--card, rgba(127,127,127,.08));
}
.rp-source-head {
  display: flex; justify-content: space-between; gap: 10px; font-size: 14px;
}
.rp-source-head b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.rp-source-names { font-size: 12px; color: var(--text-muted); }

/* --- Нутриенты --- */
.rp-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
.rp-card {
  padding: 12px; border-radius: 12px;
  background: var(--card, rgba(127,127,127,.08));
  display: flex; flex-direction: column; gap: 8px;
}
.rp-card h4 { margin: 0; font-size: 13px; color: var(--text-muted); }
.rp-value {
  font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums;
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
}
.rp-goal { font-size: 12px; font-weight: 400; color: var(--text-muted); }
.rp-nodata { font-size: 12.5px; color: var(--text-muted); }

.rp-bars {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 4px; align-items: end;
}
.rp-bar-col { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.rp-bar-track { height: 64px; display: flex; align-items: flex-end; }
.rp-bar {
  width: 12px; border-radius: 3px 3px 0 0;
  background: var(--accent, #34c759);
}
.rp-bar-empty { background: var(--fill-track, rgba(127,127,127,.25)); }
.rp-bar-day, .rp-bar-val { font-size: 10px; color: var(--text-muted); }
.rp-bar-val { font-variant-numeric: tabular-nums; }
.rp-bars-unit { font-size: 11px; color: var(--text-muted); text-align: right; }

/* --- Ожидание --- */
.rp-wait { gap: 12px; }
.rp-wait-title { margin: 0; font-size: 15px; font-weight: 600; }
.rp-wait-note { margin: 0; font-size: 13.5px; color: var(--text-muted); }

/* --- Цель действия и итоги прошлой недели --- */
.rp-measure {
  margin-top: 6px; padding-top: 8px;
  border-top: 1px dashed var(--line, rgba(127,127,127,.25));
  display: flex; flex-direction: column; gap: 5px;
}
.rp-measure-head {
  display: flex; justify-content: space-between; gap: 8px;
  font-size: 12.5px; color: var(--text-muted);
}
.rp-measure-head b { color: var(--text); font-variant-numeric: tabular-nums; }
.rp-measure-now { font-size: 11.5px; color: var(--text-muted); }

.rp-done {
  display: flex; flex-direction: column; gap: 5px;
  padding: 10px 12px; border-radius: 12px;
  background: var(--card, rgba(127,127,127,.08));
}
.rp-done-head {
  display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px;
}
.rp-done-head b { font-variant-numeric: tabular-nums; }
.rp-done-note { font-size: 11.5px; color: var(--text-muted); }
.rp-done-ok .rp-goal-fill { background: var(--accent, #34c759); }
.rp-done-up .rp-goal-fill { background: var(--warn, #ff9f0a); }
.rp-done-flat .rp-goal-fill { background: var(--fill-track, rgba(127,127,127,.3)); }
