/* Optional breakfast and bake/dessert slots. Keep every selector inside Plan;
   these controls reuse the planner's own handlers and independent portions. */
/* Dinner's two controls now share one row. Do not retain the legacy card's
   explicit second grid row after its other actions move into the day toolbar. */
html body #app.bbnext-plan .bbnext-day .bbnext-day-content > .day > .planned.bb14-meal-card .bb172-planner-controls {
  grid-template-rows: auto !important;
  grid-auto-rows: auto !important;
}
html body #app.bbnext-plan .bbnext-day .bb-plan-extra {
  --bb-extra-ink: #214e39;
  --bb-extra-muted: #617362;
  --bb-extra-line: #d4dfd1;
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  margin: 10px 0 0 !important;
  padding: 0 !important;
  border: 1px solid var(--bb-extra-line) !important;
  border-radius: 15px !important;
  background: #fffdf7 !important;
  color: var(--bb-extra-ink) !important;
  box-shadow: 0 2px 7px #214e3905 !important;
  overflow: hidden;
}
html body #app.bbnext-plan .bbnext-day .bb-plan-extra--breakfast {
  background: #fcf9ee !important;
  border-color: #e0d9bd !important;
}
html body #app.bbnext-plan .bbnext-day .bb-plan-extra-summary {
  display: grid !important;
  grid-template-columns: 68px minmax(0, 1fr) 16px !important;
  align-items: center !important;
  gap: 11px !important;
  min-width: 0 !important;
  min-height: 92px !important;
  margin: 0 !important;
  padding: 11px !important;
  list-style: none !important;
  cursor: pointer;
  border-radius: 14px;
  color: var(--bb-extra-ink) !important;
  -webkit-tap-highlight-color: transparent;
}
html body #app.bbnext-plan .bbnext-day .bb-plan-extra-summary::-webkit-details-marker {
  display: none;
}
html body #app.bbnext-plan .bbnext-day .bb-plan-extra-summary::marker {
  content: '';
}
html body #app.bbnext-plan .bbnext-day .bb-plan-extra-thumb {
  display: block !important;
  grid-column: 1 !important;
  grid-row: 1 !important;
  width: 68px !important;
  height: 68px !important;
  min-width: 0 !important;
  max-width: 68px !important;
  max-height: 68px !important;
  margin: 0 !important;
  border-radius: 11px !important;
  aspect-ratio: 1 !important;
  object-fit: cover !important;
  background: #eaf0e3;
}
html body #app.bbnext-plan .bbnext-day .bb-plan-extra-copy {
  display: grid !important;
  grid-column: 2 !important;
  grid-row: 1 !important;
  align-content: center !important;
  gap: 4px !important;
  min-width: 0 !important;
  margin: 0 !important;
  text-align: left !important;
}
html body #app.bbnext-plan .bbnext-day .bb-plan-extra-label {
  display: block !important;
  font-size: 10px !important;
  font-weight: 800 !important;
  line-height: 1.25 !important;
  letter-spacing: .09em !important;
  text-transform: uppercase !important;
  color: #6b7049 !important;
}
html body #app.bbnext-plan .bbnext-day .bb-plan-extra-copy > strong {
  display: block !important;
  margin: 0 !important;
  font-size: 15px !important;
  font-weight: 750 !important;
  line-height: 1.3 !important;
  letter-spacing: -.015em !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  color: var(--bb-extra-ink) !important;
}
html body #app.bbnext-plan .bbnext-day .bb-plan-extra-meta {
  display: block !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  line-height: 1.35 !important;
  color: var(--bb-extra-muted) !important;
  overflow-wrap: anywhere;
}
html body #app.bbnext-plan .bbnext-day .bb-plan-extra-caret {
  display: block;
  grid-column: 3;
  grid-row: 1;
  width: 7px;
  height: 7px;
  justify-self: center;
  align-self: center;
  border-right: 1.8px solid #62826a;
  border-bottom: 1.8px solid #62826a;
  transform: rotate(45deg);
  transition: transform .15s ease;
}
html body #app.bbnext-plan .bbnext-day .bb-plan-extra[open] > .bb-plan-extra-summary .bb-plan-extra-caret {
  transform: rotate(225deg);
}
html body #app.bbnext-plan .bbnext-day .bb-plan-extra-details {
  display: grid !important;
  gap: 10px !important;
  min-width: 0 !important;
  padding: 11px !important;
  border-top: 1px solid var(--bb-extra-line) !important;
  background: #fffef9 !important;
}
html body #app.bbnext-plan .bbnext-day .bb-plan-extra:not([open]) > .bb-plan-extra-details,
html body #app.bbnext-plan .bbnext-day .bb-plan-extra[hidden],
html body #app.bbnext-plan .bbnext-day .bb-plan-extra [hidden],
html body #app.bbnext-plan .bbnext-day .bb-plan-extra-additions [hidden],
html body #app.bbnext-plan .bbnext-day .bb-plan-day-actions [hidden] {
  display: none !important;
}
html body #app.bbnext-plan .bbnext-day .bb-plan-extra-portions {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  min-width: 0 !important;
  font-size: 12px !important;
  font-weight: 650 !important;
  color: var(--bb-extra-muted) !important;
}
html body #app.bbnext-plan .bbnext-day .bb-plan-extra-portions .bbfeed-control {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 2px !important;
  min-width: 0 !important;
  min-height: 44px !important;
  margin: 0 !important;
  padding: 2px !important;
  border: 1px solid #d3decd !important;
  border-radius: 25px !important;
  background: #fffef9 !important;
  color: var(--bb-extra-ink) !important;
}
html body #app.bbnext-plan .bbnext-day .bb-plan-extra-portions .bbfeed-control button {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: #f0f5e9 !important;
  color: #275c3f !important;
  font-size: 22px !important;
  line-height: 1 !important;
}
html body #app.bbnext-plan .bbnext-day .bb-plan-extra-portions .bbfeed-value,
html body #app.bbnext-plan .bbnext-day .bb-plan-extra-portions .bbfeed-control > output {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  min-width: 38px !important;
  margin: 0 !important;
  padding: 0 !important;
  font-size: 14px !important;
  font-weight: 750 !important;
  color: var(--bb-extra-ink) !important;
  line-height: 1.35 !important;
  text-align: center !important;
}
html body #app.bbnext-plan .bbnext-day .bb-plan-extra-portions .bbfeed-value svg {
  width: 16px !important;
  height: 16px !important;
}
html body #app.bbnext-plan .bbnext-day .bb-plan-extra-actions,
html body #app.bbnext-plan .bbnext-day .bb-plan-extra-additions,
html body #app.bbnext-plan .bbnext-day .bb-plan-day-actions {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px !important;
  align-items: stretch !important;
  min-width: 0 !important;
  width: 100% !important;
}
html body #app.bbnext-plan .bbnext-day .bb-plan-extra-additions {
  margin-top: 10px !important;
}
html body #app.bbnext-plan .bbnext-day .bb-plan-day-actions {
  margin-top: 12px !important;
  padding-top: 12px !important;
  border-top: 1px solid #e2e8dc !important;
}
html body #app.bbnext-plan .bbnext-day .bb-plan-extra-actions > select {
  grid-column: 1 / -1 !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 44px !important;
  margin: 0 !important;
  padding: 10px 12px !important;
  border: 1px solid #cad8c7 !important;
  border-radius: 11px !important;
  background: #fffef9 !important;
  color: #24533b !important;
  font: inherit !important;
  font-size: 16px !important;
}
html body #app.bbnext-plan .bbnext-day .bb-plan-extra-actions > button,
html body #app.bbnext-plan .bbnext-day .bb-plan-extra-additions > button,
html body #app.bbnext-plan .bbnext-day .bb-plan-day-actions > button,
html body #app.bbnext-plan .bbnext-day .bb-plan-day-actions .bb-evening-pivot-open,
html body #app.bbnext-plan .bbnext-day-content > .bb-plan-move-button,
html body #app.bbnext-plan .bbnext-day-content > .bb-manual-batch-btn,
html body #app.bbnext-plan .bbnext-day-content > .bb-day-done-trigger {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 46px !important;
  margin: 0 !important;
  padding: 10px 9px !important;
  border: 1px solid #c9d8c5 !important;
  border-radius: 12px !important;
  background: #f5f8ee !important;
  color: #255b3f !important;
  -webkit-text-fill-color: #255b3f !important;
  box-shadow: 0 1px 2px #214e3905 !important;
  font: inherit !important;
  font-size: 12px !important;
  font-weight: 750 !important;
  line-height: 1.35 !important;
  text-align: center !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}
html body #app.bbnext-plan .bbnext-day-content > .bb-plan-move-button,
html body #app.bbnext-plan .bbnext-day-content > .bb-manual-batch-btn,
html body #app.bbnext-plan .bbnext-day-content > .bb-day-done-trigger {
  margin-top: 10px !important;
}
html body #app.bbnext-plan .bbnext-day .bb-plan-extra-additions > button {
  background: #fffdf6 !important;
  border-style: solid !important;
  border-color: #d9d9be !important;
}
html body #app.bbnext-plan .bbnext-day .bb-plan-extra-actions > button[data-breakfast-cook],
html body #app.bbnext-plan .bbnext-day .bb-plan-extra-actions > button[data-dessert-cook],
html body #app.bbnext-plan .bbnext-day .bb-plan-extra-actions > button[data-extra-cook],
html body #app.bbnext-plan .bbnext-day .bb-plan-extra-actions > button[data-plan-extra-cook] {
  border-color: #216546 !important;
  background: #216546 !important;
  color: #fffdf6 !important;
  -webkit-text-fill-color: #fffdf6 !important;
}
html body #app.bbnext-plan .bbnext-day .bb-plan-extra-actions > button[data-breakfast-remove],
html body #app.bbnext-plan .bbnext-day .bb-plan-extra-actions > button[data-dessert-remove],
html body #app.bbnext-plan .bbnext-day .bb-plan-extra-actions > button[data-extra-remove],
html body #app.bbnext-plan .bbnext-day .bb-plan-extra-actions > button[data-plan-extra-remove] {
  border-color: #e3d5c8 !important;
  background: #fcf7ef !important;
  color: #8a503d !important;
  -webkit-text-fill-color: #8a503d !important;
}
html body #app.bbnext-plan .bbnext-day .bb-plan-day-actions > .bb-evening-pivot,
html body #app.bbnext-plan .bbnext-day .bb-plan-day-actions > .bb-plan-leftovers,
html body #app.bbnext-plan .bbnext-day .bb-plan-day-actions > .bb-day-done-trigger {
  grid-column: 1 / -1 !important;
  min-width: 0 !important;
  width: 100% !important;
  margin: 0 !important;
}
html body #app.bbnext-plan .bbnext-day .bb-plan-day-actions .bb-evening-pivot-open,
html body #app.bbnext-plan .bbnext-day .bb-plan-day-actions > .bb-plan-leftovers {
  border-color: #bed5bd !important;
  background: #eaf4e8 !important;
}
html body #app.bbnext-plan .bbnext-day .bb-plan-day-actions > .bb-day-done-trigger {
  background: #edf3e7 !important;
  border-color: #c7d7bc !important;
}
html body #app.bbnext-plan .bbnext-day .bb-plan-extra-summary:focus-visible,
html body #app.bbnext-plan .bbnext-day .bb-plan-extra button:focus-visible,
html body #app.bbnext-plan .bbnext-day .bb-plan-extra select:focus-visible,
html body #app.bbnext-plan .bbnext-day .bb-plan-extra-additions button:focus-visible,
html body #app.bbnext-plan .bbnext-day .bb-plan-day-actions button:focus-visible {
  outline: 3px solid #99722c !important;
  outline-offset: -3px !important;
}
html body #app.bbnext-plan .bbnext-day .bb-plan-extra button:disabled,
html body #app.bbnext-plan .bbnext-day .bb-plan-extra-additions button:disabled,
html body #app.bbnext-plan .bbnext-day .bb-plan-day-actions button:disabled {
  opacity: .5;
  cursor: default;
}
@media (hover: hover) {
  html body #app.bbnext-plan .bbnext-day .bb-plan-extra-summary:hover {
    background: #eef3e440;
  }
  html body #app.bbnext-plan .bbnext-day .bb-plan-extra-additions > button:hover,
  html body #app.bbnext-plan .bbnext-day .bb-plan-day-actions > button:hover {
    border-color: #9eb793 !important;
    background: #eaf2e1 !important;
  }
}
@media (max-width: 375px) {
  html body #app.bbnext-plan .bbnext-day .bb-plan-extra-summary {
    grid-template-columns: 56px minmax(0, 1fr) 12px !important;
    gap: 8px !important;
    min-height: 82px !important;
    padding: 10px !important;
  }
  html body #app.bbnext-plan .bbnext-day .bb-plan-extra-thumb {
    width: 56px !important;
    height: 56px !important;
    max-width: 56px !important;
    max-height: 56px !important;
  }
  html body #app.bbnext-plan .bbnext-day .bb-plan-extra-copy > strong {
    font-size: 14px !important;
  }
}
@media (prefers-reduced-motion: reduce) {
  html body #app.bbnext-plan .bbnext-day .bb-plan-extra-caret,
  html body #app.bbnext-plan .bbnext-day .bb-plan-extra-additions > button,
  html body #app.bbnext-plan .bbnext-day .bb-plan-day-actions > button {
    transition: none !important;
  }
}

/* Optional meal pickers stay above the Plan, with independently scrolling choices. */
dialog.bb-plan-meal-picker {
  box-sizing: border-box;
  width: min(520px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  position: fixed;
  inset: auto;
  left: 50%;
  top: var(--bb-plan-picker-top, 50%);
  transform: translate(-50%, -50%);
  height: min(680px, calc(var(--bb-plan-picker-height, 100dvh) - 32px));
  max-height: calc(var(--bb-plan-picker-height, 100dvh) - 32px);
  margin: 0;
  padding: 18px;
  border: 1px solid #c7d6bd;
  border-radius: 20px;
  background: #fffdf6;
  color: #214e39;
  box-shadow: 0 20px 70px #122c2340;
  overflow: hidden;
  font-family: inherit;
}
dialog.bb-plan-meal-picker[open] {
  display: grid;
  grid-template-rows: auto auto auto auto minmax(0, 1fr);
  gap: 10px;
}
dialog.bb-plan-meal-picker::backdrop {
  background: #132b1c70;
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
dialog.bb-plan-meal-picker .bb-plan-picker-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin: 0;
  color: #214e39;
  font-size: 22px;
  font-weight: 750;
  line-height: 1.25;
  letter-spacing: -.025em;
}
dialog.bb-plan-meal-picker .bb-plan-picker-heading h2 {
  margin: 0;
  font: inherit;
}
dialog.bb-plan-meal-picker .bb-plan-picker-intro {
  margin: 0;
  color: #617362;
  font-size: 13px;
  font-weight: 450;
  line-height: 1.5;
  letter-spacing: normal;
}
dialog.bb-plan-meal-picker .bb-plan-picker-search,
dialog.bb-plan-meal-picker .bb-plan-picker-search input {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 46px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #ccd9c2;
  border-radius: 12px;
  background: #fffef9;
  color: #214e39;
  font: inherit;
  font-size: 16px;
  line-height: 1.4;
}
dialog.bb-plan-meal-picker .bb-plan-picker-list {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 3px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scroll-padding: 5px;
}
dialog.bb-plan-meal-picker .bb-plan-picker-choice {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 84px;
  margin: 0;
  padding: 10px;
  border: 1px solid #d7dfcc;
  border-radius: 13px;
  background: #fffef9;
  color: #214e39;
  font: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
dialog.bb-plan-meal-picker .bb-plan-picker-choice img {
  display: block;
  width: 62px;
  height: 62px;
  max-width: 62px;
  margin: 0;
  border-radius: 9px;
  background: #edf2e5;
  object-fit: cover;
}
dialog.bb-plan-meal-picker .bb-plan-picker-choice:not(:has(img)) {
  grid-template-columns: minmax(0, 1fr);
}
dialog.bb-plan-meal-picker .bb-plan-picker-choice > span {
  display: grid;
  gap: 5px;
  min-width: 0;
}
dialog.bb-plan-meal-picker .bb-plan-picker-choice strong {
  color: #214e39;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
}
dialog.bb-plan-meal-picker .bb-plan-picker-choice small {
  color: #617362;
  font-size: 12px;
  font-weight: 450;
  line-height: 1.4;
}
dialog.bb-plan-meal-picker .bb-plan-picker-choice:hover {
  border-color: #a1b995;
  background: #f2f6e9;
}
dialog.bb-plan-meal-picker .bb-plan-picker-empty {
  margin: 0;
  padding: 0;
  color: #617362;
  font-size: 14px;
  line-height: 1.5;
  text-align: left;
}
dialog.bb-plan-meal-picker .bb-plan-picker-close {
  width: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 44px;
  margin: 0;
  padding: 9px 14px;
  border: 1px solid #c7d6bd;
  border-radius: 12px;
  background: #edf3e5;
  color: #255b3f;
  font: inherit;
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
}
dialog.bb-plan-meal-picker :is(button, input):focus-visible {
  outline: 3px solid #99722c;
  outline-offset: -3px;
}
dialog.bb-plan-meal-picker [hidden] {
  display: none !important;
}
dialog.bb-plan-meal-picker button:disabled {
  opacity: .5;
  cursor: default;
}
@media (max-width: 375px) {
  dialog.bb-plan-meal-picker {
    padding: 15px;
    border-radius: 17px;
  }
  dialog.bb-plan-meal-picker .bb-plan-picker-heading {
    font-size: 20px;
  }
}
