.week-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-top: 15px;
}

.week-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 0;
  padding: 12px 5px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--bg);
}

.week-day span {
  color: var(--muted);
  font-size: 11px;
  text-transform: capitalize;
}

.week-day b { font-size: 18px; }
.week-day small { color: var(--muted); font-size: 9px; white-space: nowrap; }
.week-day.trained { border-color: var(--accent); background: var(--accent2); }
.week-day.trained small { color: var(--accent); font-weight: 700; }
.week-day.today { box-shadow: inset 0 0 0 1px var(--accent); }

/* Agencement commun : rangées régulières, cartes alignées et actions équilibrées. */
.hero-grid,
.card-grid { align-items: stretch; }

.card.half { grid-column: span 6; }

.card-grid > .card:not(.full) {
  display: flex;
  min-height: 138px;
  flex-direction: column;
  justify-content: space-between;
}

.card .actions { margin-top: 16px; }
.page-head > .actions { justify-content: flex-end; }
.metric-line > h2,
.metric-line > h3 { min-width: 0; }

.meal-journal { padding-bottom: 12px; }
.meal-slots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.meal-slot { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); }
.meal-slot-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px; }
.meal-slot-head h3 { font-size: 15px; }
.meal-slot-head span { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.slot-macros { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.slot-macros span { padding: 8px 10px; border-left: 1px solid var(--line); color: var(--muted); font-size: 10px; text-align: center; }
.slot-macros span:first-child { border-left: 0; }
.slot-macros b { display: block; margin-top: 2px; color: var(--ink); font-size: 12px; }
.meal-foods { padding: 0 14px; }
.meal-food { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.meal-food:first-child { border-top: 0; }
.meal-food > div { min-width: 0; }
.meal-food b { display: block; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.meal-food small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.meal-food > span { flex: 0 0 auto; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.icon-delete { margin-left: 4px; padding: 3px 7px; border: 0; }
.meal-empty { padding: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; text-align: center; }
.library-actions { margin-top: 0 !important; justify-content: flex-end; }
.food-online-button { width: 100%; margin-top: 14px; border-style: dashed; color: var(--accent); }
.form-hint { margin: 14px 0 0; line-height: 1.5; }

@media (max-width: 760px) {
  .card.half { grid-column: 1 / -1; }
  .card-grid > .card:not(.full) { min-height: 0; }
  .page-head { align-items: flex-start; }
  .page-head > .actions { max-width: 58%; }
  .meal-slots { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .week-strip { gap: 4px; }
  .week-day { padding: 10px 2px; }
  .week-day b { font-size: 16px; }
  .week-day small { font-size: 0; }
  .week-day small::after { content: '•'; font-size: 13px; }
  .week-day:not(.trained) small::after { content: '—'; }
  .page-head { flex-direction: column; }
  .page-head > .actions { width: 100%; max-width: none; }
  .page-head > .actions button { flex: 1; }
  .metric-line:has(.library-actions) { align-items: flex-start; flex-direction: column; }
  .library-actions { width: 100%; }
  .library-actions button { flex: 1; }
}
