/* Client My Path adjustments, scoped to the agreed daily blocks and agenda. */
.my-day-design .md-calendar-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 44px;
  height: 44px;
  margin-left: auto;
  color: #316653;
  border-radius: 8px;
  text-decoration: none;
}
.my-day-design .md-calendar-icon:hover {
  background: #edf5ef;
}
.my-day-design .md-calendar-icon svg {
  width: 24px;
  height: 24px;
}
.my-day-design .md-shared-calendar {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #316653;
  min-height: 44px;
  text-decoration: none;
  font-size: var(--ui-control);
}
.my-day-design .md-heading-left {
  flex-wrap: wrap;
}
.my-day-design .md-heading-left .md-date-picker {
  margin-left: auto;
}
.my-day-design .mi .mi-take,
.my-day-design .vitamin-block .mi .mi-take {
  grid-template-columns: auto minmax(0, 1fr);
  padding-right: 94px;
  min-height: 52px;
}
.my-day-design .mi .mi-time {
  max-width: none;
}
.my-day-design .mi .mi-name,
.my-day-design .mi .mi-comment {
  white-space: normal;
  text-overflow: clip;
  overflow: visible;
  overflow-wrap: anywhere;
  -webkit-line-clamp: unset;
}
.my-day-design .mi .mi-time > span:not(.ac-symbol) {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}
.mi .mi-tile:has(.assignment-author) .mi-take {
  padding-right: 94px;
}
.mi .assignment-author {
  position: static;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  color: inherit;
}
.mi .assignment-author > summary {
  position: absolute;
  top: 4px;
  right: 46px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  list-style: none;
  padding: 0;
  border: 0;
  background: transparent;
}
.mi .assignment-author > summary::-webkit-details-marker {
  display: none;
}
.mi .assignment-author > summary:after {
  display: none;
}
.mi .assignment-author svg {
  width: 32px;
  height: 32px;
}
.mi .assignment-author-name {
  padding: 7px 10px;
  border-top: 1px solid #ffffff40;
  font-size: var(--ui-caption);
  overflow-wrap: anywhere;
}
.mi .mi-tile:has(.assignment-author) .mi-info {
  top: 4px;
  right: 2px;
  transform: none;
  width: 44px;
  height: 44px;
}
body.ui-readable.client-view .my-day-design .meal-block .md-compact-meal .md-controls {
  justify-content: flex-end;
  flex-wrap: wrap;
  width: 100%;
  gap: 5px;
}
body.ui-readable.client-view .my-day-design .meal-block .md-compact-meal .md-meal-result {
  margin-left: 96px;
  align-items: stretch;
}
body.ui-readable.client-view .my-day-design .meal-block .md-compact-meal .md-meal-answer {
  background: #ad414c;
  color: #fff;
  border-color: #ad414c;
  opacity: 1;
  min-height: 44px;
}
body.ui-readable.client-view .my-day-design .meal-block .md-compact-meal .md-meal-answer.accepted {
  background: #3c6753;
  border-color: #3c6753;
  color: #fff;
}
body.ui-readable.client-view .my-day-design .meal-block .md-compact-meal .md-meal-answer:disabled {
  cursor: default;
}
body.ui-readable.client-view .my-day-design .meal-block .md-compact-meal .md-meal-state:empty {
  display: none;
}
@container (min-width:740px) {
  body.ui-readable.client-view .my-day-design .meal-block .md-compact-meal {
    position: relative;
    padding-right: 350px;
    min-height: 112px;
  }
  body.ui-readable.client-view .my-day-design .meal-block .md-compact-meal .md-controls {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 330px;
    align-items: flex-start;
  }
}
@container (max-width:420px) {
  body.ui-readable.client-view .my-day-design .meal-block .md-compact-meal .md-meal-result {
    margin-left: 0;
  }
}
.day-agenda {
  width: 100%;
  max-width: none;
}
.agenda-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.agenda-heading h1 {
  font-size: var(--ui-section);
  margin: 0;
}
.agenda-heading label {
  display: flex;
  align-items: center;
  gap: 8px;
}
.agenda-heading input {
  max-width: 180px;
  min-width: 0;
}
.agenda-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 14px 0;
}
.agenda-filters a {
  border: 1px solid #dce5dc;
  border-radius: 7px;
  padding: 9px;
  min-height: 44px;
  text-decoration: none;
  font-size: var(--ui-control);
  color: #316653;
  background: white;
}
.agenda-filters a[aria-current] {
  background: #e6f1e9;
  border-color: #316653;
}
.day-agenda .mi-calendar {
  max-width: 760px;
}
.agenda-time {
  margin: 14px 0;
}
.agenda-time > h3 {
  font-size: var(--ui-card);
  margin: 0 0 7px;
  padding-bottom: 5px;
  border-bottom: 1px solid #dce5dc;
}
.agenda-day {
  font-size: var(--ui-card);
  margin: 12px 0;
}
.day-agenda .meal-block {
  background: white;
  border-radius: 10px;
}
.day-agenda .mi-grid {
  gap: 7px;
}
/* Agenda wrappers contain one meal, not the full dashboard meal panel. */
.day-agenda.my-day-design .agenda-time .meal-block {
  min-height: 0;
}
.day-agenda .mi-tile .mi-name,
.day-agenda .mi-tile .mi-comment {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
}
@media (max-width: 600px) {
  .my-day-design .md-block > header {
    flex-wrap: wrap;
  }
  .my-day-design .md-block > header > div {
    min-width: 0;
    flex: 1;
  }
  .my-day-design .md-add {
    order: 3;
  }
  .my-day-design .mi .mi-take,
  .my-day-design .vitamin-block .mi .mi-take {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 3px;
  }
  .my-day-design .mi .mi-name {
    grid-column: 1;
    grid-row: 2;
  }
  .my-day-design .mi .mi-time {
    grid-row: 1;
    grid-column: 1;
  }
  .my-day-design .mi .mi-comment {
    grid-row: auto;
  }
  .agenda-heading {
    align-items: flex-start;
  }
}
@media (max-width: 600px) {
  body.ui-readable.client-view .my-day-design .personal-block > header {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) 44px;
    gap: 6px;
  }
  body.ui-readable.client-view .my-day-design .personal-block > header > .md-add {
    grid-column: 1/-1;
    grid-row: 2;
    justify-self: end;
    width: auto;
    margin: 0;
  }
  body.ui-readable.client-view .my-day-design .personal-block > header > .md-calendar-icon {
    grid-column: 3;
    grid-row: 1;
  }
}

/* Saved meals: the button itself carries the result, without a duplicate status row. */
body.ui-readable.client-view .my-day-design .meal-block .md-compact-meal.md-meal-recorded {
  row-gap: 2px;
}
body.ui-readable.client-view .my-day-design .meal-block .md-meal-recorded .md-meal-result {
  margin-left: 0;
  padding: 0;
  gap: 0;
  min-height: 0;
}
body.ui-readable.client-view .my-day-design .meal-block .md-meal-recorded .md-controls {
  margin: 0;
  padding: 0;
  gap: 0;
  min-height: 0;
}
body.ui-readable.client-view .my-day-design .meal-block .md-meal-recorded .md-meal-answer {
  margin: 0;
  padding: 7px 12px;
  max-width: 100%;
  white-space: normal;
  line-height: 1.2;
  font-size: var(--ui-control);
}
body.ui-readable.client-view .my-day-design .meal-block .md-meal-recorded .md-meal-reports {
  margin-top: 0;
  margin-bottom: 0;
}
body.ui-readable.client-view .my-day-design .meal-block .md-meal-recorded .md-meal-title {
  margin-top: 1px;
  line-height: 1.25;
}

/* Creation stays next to the selected day without changing the meal/procedure tabs. */
.day-agenda .agenda-calendar-row {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
}
.day-agenda .agenda-calendar-row > .mi-calendar {
  flex: 1 1 560px;
  min-width: 0;
  width: 100%;
}
.day-agenda .agenda-add-action {
  font: 500 var(--ui-control)/1.25 var(--ui-font);
  flex: none;
  min-height: 44px;
  margin-top: 14px;
  white-space: normal;
}
.agenda-add-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.agenda-add-options > button {
  font: 500 var(--ui-control)/1.25 var(--ui-font);
  min-height: 44px;
  white-space: normal;
}
@media (max-width: 900px) {
  .day-agenda .agenda-calendar-row {
    gap: 0;
  }
  .day-agenda .agenda-add-action {
    margin: 0 0 10px;
  }
}

/* Keep the calendar header compact and the task grid responsive. */
.dc-calendar {
  container-type: inline-size;
}
.dc-calendar .mi-calendar-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0 12px;
}
.dc-calendar .dc-month {
  font-size: var(--ui-caption);
  line-height: 1.2;
  color: var(--mi-muted);
  min-width: 0;
}
.dc-calendar .mi-dates {
  margin-top: 0;
  row-gap: 0;
}
.dc-calendar .mi-calendar-tools {
  justify-self: end;
}
.day-agenda.mi .agenda-time > .mi-grid {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}
@media (min-width: 1001px) {
  .day-agenda.mi .agenda-time > .mi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 12px;
  }
  .day-agenda.mi .agenda-time > .mi-grid > .meal-block,
  .day-agenda.mi .agenda-time > .mi-grid > .ws-panel {
    grid-column: 1/-1;
  }
}
@container (max-width:480px) {
  .dc-calendar .mi-calendar-head {
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 8px;
  }
  .dc-calendar .mi-calendar-head > .dc-month {
    justify-self: end;
  }
  .dc-calendar .mi-calendar-head > .mi-today {
    justify-self: start;
  }
}
/* Calendar dragging uses its own handle so scrolling and completion stay separate. */
.day-agenda .agenda-drag-handle {
  position: absolute;
  top: 3px;
  left: 0;
  width: 40px;
  height: 44px;
  min-height: 44px;
  z-index: 2;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: 24px/1 var(--ui-font);
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.day-agenda .mi-tile[data-agenda-item] .mi-take {
  padding-left: 40px;
}
.day-agenda .agenda-dragging {
  opacity: 0.55;
}
.day-agenda .agenda-drop-before {
  box-shadow: inset 4px 0 #e4bb4b;
}
.day-agenda .agenda-drop-after {
  box-shadow: inset -4px 0 #e4bb4b;
}
.agenda-drag-ghost {
  position: fixed;
  z-index: 10000;
  width: 250px;
  max-width: calc(100vw - 8px);
  padding: 8px 10px;
  background: #365f4d;
  color: white;
  border-radius: 8px;
  pointer-events: none;
  font: 500 17px/1.25 var(--ui-font);
  box-shadow: 0 4px 14px #0003;
}
@media (max-width: 1000px) {
  .day-agenda .agenda-drop-before {
    box-shadow: inset 0 4px #e4bb4b;
  }
  .day-agenda .agenda-drop-after {
    box-shadow: inset 0 -4px #e4bb4b;
  }
}
@media (min-width: 1001px) {
  .day-agenda.mi .agenda-time > .mi-grid > .meal-block {
    grid-column: 1;
  }
}
body.ui-readable.client-view .day-agenda .meal-block .agenda-meal {
  cursor: pointer;
  padding: 8px 10px;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr);
}
body.ui-readable.client-view .day-agenda .meal-block .agenda-meal .md-meal-link {
  grid-template-columns: 84px minmax(0, 1fr);
}
body.ui-readable.client-view .day-agenda .meal-block .agenda-meal .md-meal-result {
  margin: 0;
  min-width: 0;
}
body.ui-readable.client-view .day-agenda .meal-block .agenda-meal .md-controls {
  position: static;
  width: auto;
  margin: 0;
  padding: 0;
  gap: 6px;
  order: -1;
  justify-content: flex-end;
  align-items: center;
}
body.ui-readable.client-view .day-agenda .meal-block .agenda-meal .md-meal-reports {
  grid-column: 1/-1;
  margin: 0;
}
body.ui-readable.client-view .day-agenda .meal-block .agenda-meal .agenda-recipe-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 6px;
  border: 0;
  border-radius: 8px;
  background: #edf4ef;
  color: #285541;
}
body.ui-readable.client-view .day-agenda .meal-block .agenda-meal .agenda-recipe-open svg {
  width: 28px;
  height: 28px;
  stroke-width: 3;
}
@container (min-width:540px) {
  body.ui-readable.client-view .day-agenda .meal-block .agenda-meal {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  body.ui-readable.client-view .day-agenda .meal-block .agenda-meal .md-meal-link {
    grid-column: 1;
    grid-row: 1;
  }
  body.ui-readable.client-view .day-agenda .meal-block .agenda-meal .md-meal-result {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
    max-width: 220px;
  }
  body.ui-readable.client-view .day-agenda .meal-block .agenda-meal .md-controls {
    max-width: 220px;
  }
}

body.ui-readable.client-view .day-agenda .meal-block .agenda-meal .md-controls {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  width: fit-content;
  max-width: 100%;
  justify-self: end;
  align-self: flex-end;
}
body.ui-readable.client-view .day-agenda .meal-block .agenda-meal .md-meal-answer {
  min-width: 0;
  width: auto;
}
body.ui-readable.client-view .day-agenda .meal-block .agenda-meal .md-report {
  grid-column: 1/-1;
  justify-self: end;
  max-width: 100%;
  white-space: normal;
}
