/* S096 · Hub cliente → Nutrición: pauta activa arriba, rango 7/14/30, metas por día,
   estimados por revisar, adherencia semanal y actividad de la app.
   Solo tokens del portal; marca vía --tenant-primary. Prefijo .mcn-* (mismo módulo que mc-nutri-docs.css). */

.mc-hub-nutri { --mcn-pend: color-mix(in srgb, var(--mcn-warn, #f59e0b) 70%, var(--text)); }

.mcn-sub-h {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--muted);
}
.mcn-muted { color: var(--muted); font-weight: 500; }

/* ── Pauta activa ──────────────────────────────────────────────────── */
.mcn-active {
  container: mcna / inline-size;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px 20px;
  border: 1px solid color-mix(in srgb, var(--tenant-primary) 26%, var(--hairline));
  border-radius: var(--radius);
  background: linear-gradient(
    160deg,
    color-mix(in srgb, var(--tenant-primary) 6%, var(--surface)) 0%,
    var(--surface) 55%
  );
}
.mcn-active:empty { display: none; }
.mcn-active .mcn-skel { margin: -2px 0; }
.mcn-active-main {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 20px;
}
.mcn-active-copy { min-width: 0; flex: 1 1 320px; display: flex; flex-direction: column; gap: 4px; }
.mcn-active-kicker { font-size: 12px; font-weight: 600; color: var(--tenant-primary); letter-spacing: 0.01em; }
.mcn-active-kicker::first-letter { text-transform: uppercase; }
.mcn-active-name {
  margin: 0;
  font-size: 20px;
  line-height: 1.25;
  font-weight: 650;
  letter-spacing: -0.015em;
  color: var(--text);
  text-wrap: balance;
}
.mcn-active-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--muted);
}
.mcn-active-main.is-empty .mcn-active-kicker { color: var(--muted); }
.mcn-active-main.is-empty .mcn-active-meta { display: block; max-width: 56ch; }
.mcn-active-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.mc-hub-nutri .mcn-active-actions .ghost.sm,
.mc-hub-nutri .mcn-active-actions .btn-primary.sm { min-height: 36px; }
.mcn-active-warn {
  margin: -4px 0 0;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--mcn-warn);
  background: color-mix(in srgb, var(--mcn-warn) 9%, var(--surface));
  font-size: 13px;
  color: var(--text);
}

/* Consumo de hoy vs meta */
.mcn-today-goal { padding-top: 14px; border-top: 1px solid var(--hairline); }
.mcn-tm-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.mcn-tm {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 8px;
  align-items: baseline;
  outline: none;
  border-radius: 6px;
}
.mcn-tm:focus-visible { box-shadow: 0 0 0 2px var(--tenant-primary); }
.mcn-tm-name { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.mcn-tm-val { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.mcn-tm-val strong { font-size: 16px; font-weight: 650; color: var(--text); }
.mcn-tm-track {
  grid-column: 1 / -1;
  position: relative;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: color-mix(in srgb, var(--text) 7%, transparent);
}
.mcn-tm-track i,
.mcn-tm-track b {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 999px;
}
.mcn-tm-track i { left: 0; width: var(--w); background: var(--tenant-primary); transition: width 400ms cubic-bezier(0.22, 1, 0.36, 1); }
.mcn-tm-track b {
  left: var(--l);
  width: var(--w);
  background: repeating-linear-gradient(
    -45deg,
    color-mix(in srgb, var(--mcn-pend) 70%, transparent) 0 3px,
    color-mix(in srgb, var(--mcn-pend) 28%, transparent) 3px 6px
  );
}
.mcn-tm--p .mcn-tm-track i { background: var(--mcn-p); }
.mcn-tm--c .mcn-tm-track i { background: var(--mcn-c); }
.mcn-tm--g .mcn-tm-track i { background: var(--mcn-g); }
.mcn-tm.is-high .mcn-tm-val strong { color: color-mix(in srgb, var(--mcn-warn) 70%, var(--text)); }

/* Próximas pautas */
.mcn-active-next { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.mcn-active-next .mcn-sub-h { margin: 0; }
.mcn-active-next ul { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; padding: 0; list-style: none; }
.mcn-active-next li { display: inline-flex; align-items: baseline; gap: 6px; font-size: 13px; color: var(--muted); min-width: 0; }
.mcn-active-next li strong { font-weight: 600; color: var(--text); max-width: 32ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* ── Seguimiento: rango con 3 opciones ─────────────────────────────── */
.mcn-head-plan { max-width: 62ch; }

/* Adherencia por semana */
.mcn-weeks { margin-top: 18px; }
.mcn-week-list { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.mcn-week {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr) 76px;
  align-items: center;
  gap: 12px;
  min-height: 26px;
  border-radius: 6px;
  outline: none;
}
.mcn-week:hover .mcn-week-bar,
.mcn-week:focus-visible .mcn-week-bar { box-shadow: 0 0 0 1.5px var(--text); }
.mcn-week-lbl { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.mcn-week-bar {
  position: relative;
  height: 10px;
  border-radius: 3px;
  background: var(--mcn-cell-empty);
  overflow: hidden;
}
.mcn-week-bar i {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--w);
  border-radius: 3px;
  background: var(--tenant-primary);
  transform-origin: 0 50%;
}
.mcn-week.is-mid .mcn-week-bar i { background: var(--mcn-soft); }
.mcn-week.is-low .mcn-week-bar i { background: var(--mcn-warn); }
.mcn-week-val { font-size: 13px; font-weight: 600; color: var(--text); text-align: right; white-space: nowrap; }
.mcn-week-val small { margin-left: 6px; font-size: 11.5px; font-weight: 500; color: var(--muted); }
.mcn-track.is-anim .mcn-week-bar i { animation: mcn-grow-x 320ms cubic-bezier(0.22, 1, 0.36, 1) both; }

/* Tooltip: en celular la frase completa no cabe en una línea */
.mc-hub-nutri .mcn-tip { white-space: normal; width: max-content; max-width: min(300px, 100%); }

/* Calorías: estimado por revisar (trama) y meta escalonada */
.mcn-hatch-bg { fill: color-mix(in srgb, var(--mcn-pend) 22%, transparent); }
.mcn-hatch-ln { stroke: color-mix(in srgb, var(--mcn-pend) 75%, transparent); stroke-width: 2.2; }
.mcn-bar.mcn-bar-pend { fill: url(#mcn-hatch); }
.mcn-goal { fill: none; }
.mcn-legend i.is-pend {
  background: repeating-linear-gradient(
    -45deg,
    color-mix(in srgb, var(--mcn-pend) 75%, transparent) 0 2px,
    color-mix(in srgb, var(--mcn-pend) 22%, transparent) 2px 4px
  );
}
.mcn-legend i.is-goal {
  width: 14px;
  height: 0;
  border-radius: 0;
  background: none;
  border-top: 1.5px dashed var(--text);
  opacity: 0.75;
}

/* Macros: barras de media vs meta */
.mcn-bullets { margin-bottom: 18px; }
.mcn-bl-list { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.mcn-bl {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) 150px;
  align-items: center;
  gap: 12px;
  min-height: 28px;
  border-radius: 6px;
  outline: none;
}
.mcn-bl:focus-visible { box-shadow: 0 0 0 2px var(--tenant-primary); }
.mcn-bl-name { font-size: 13px; font-weight: 600; color: var(--text); }
.mcn-bl-track {
  position: relative;
  height: 10px;
  border-radius: 3px;
  background: var(--mcn-cell-empty);
  overflow: hidden;
}
.mcn-bl-track::after {
  content: "";
  position: absolute;
  top: -2px;
  bottom: -2px;
  left: 76.9%;
  width: 2px;
  background: var(--text);
  opacity: 0.75;
}
.mcn-bl-track i {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--w);
  border-radius: 3px;
  background: var(--tenant-primary);
  transform-origin: 0 50%;
}
.mcn-bl--p .mcn-bl-track i { background: var(--mcn-p); }
.mcn-bl--c .mcn-bl-track i { background: var(--mcn-c); }
.mcn-bl--g .mcn-bl-track i { background: var(--mcn-g); }
.mcn-bl.is-high .mcn-bl-track i { background: var(--mcn-warn); }
.mcn-bl-val { font-size: 12.5px; color: var(--muted); text-align: right; white-space: nowrap; }
.mcn-bl-val strong { font-size: 14px; font-weight: 650; color: var(--text); }
.mcn-bl-val small { margin-left: 6px; font-weight: 600; color: var(--text); }
.mcn-bl.is-low .mcn-bl-val small,
.mcn-bl.is-high .mcn-bl-val small { color: color-mix(in srgb, var(--mcn-warn) 66%, var(--text)); }
.mcn-track.is-anim .mcn-bl-track i { animation: mcn-grow-x 320ms cubic-bezier(0.22, 1, 0.36, 1) both; }
.mcn-mx-cell.is-pend .mcn-mx-val { margin-top: 0; color: var(--mcn-pend); font-style: italic; }

/* Actividad de la app sin registrar */
.mcn-act .mcn-log-photo { width: 40px; height: 40px; margin-left: 16px; border-radius: 50%; cursor: default; }
.mcn-act .mcn-log-photo .mcn-ico { width: 18px; height: 18px; flex-basis: 18px; }
.mcn-act-line {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 2px 0 0;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--text);
}
.mcn-act-line .mcn-ico { width: 14px; height: 14px; flex: 0 0 14px; margin-top: 3px; color: var(--muted); }

/* Encabezado de la lista de pautas */
.mcn-plans-title { margin: 4px 0 -4px; font-size: 16px; }

html[data-theme="dark"] .mcn-active {
  background: linear-gradient(160deg, color-mix(in srgb, var(--tenant-primary) 12%, var(--surface)) 0%, var(--surface) 60%);
}
html[data-theme="dark"] .mcn-active-kicker { color: color-mix(in srgb, var(--tenant-primary) 45%, #fff); }

/* ── Responsive ────────────────────────────────────────────────────── */
@container mcna (max-width: 640px) {
  .mcn-tm-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mcn-active-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .mcn-active-actions .btn-primary { grid-column: 1 / -1; grid-row: 1; justify-content: center; }
  .mcn-active-actions .ghost { justify-content: center; }
}
@container mcn (max-width: 520px) {
  .mcn-week { grid-template-columns: 96px minmax(0, 1fr) 64px; gap: 8px; }
  .mcn-week-val small { display: none; }
  .mcn-bl { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 8px; }
  .mcn-bl-track { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 640px) {
  .mcn-active { padding: 14px; gap: 14px; }
  .mcn-active-name { font-size: 18px; }
  .mc-hub-nutri .mcn-active-actions .ghost.sm,
  .mc-hub-nutri .mcn-active-actions .btn-primary.sm { min-height: 44px; }
  .mcn-tm-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
  .mcn-week,
  .mcn-bl { min-height: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  .mcn-tm-track i { transition: none; }
  .mcn-track.is-anim .mcn-week-bar i,
  .mcn-track.is-anim .mcn-bl-track i { animation: none; }
}
