.chooser-hub[data-kind="meal"] .saved-choice-grid {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.chooser-hub[data-kind="meal"] .saved-choice-grid article {
  min-height: 106px;
  border-radius: 12px;
}
.chooser-hub[data-kind="meal"] .saved-choice-grid article > img {
  display: none !important;
}
.chooser-hub[data-kind="meal"] .saved-choice-grid article > div {
  min-height: 116px;
  gap: 5px;
  justify-content: flex-end;
  padding: 13px 12px !important;
}
.chooser-hub[data-kind="meal"] .saved-choice-grid article > div:has(.custom-meal-share) {
  padding-right: 12px !important;
}
.chooser-hub[data-kind="meal"] .restaurant-logo,
.chooser-hub[data-kind="meal"] .meal-card-icon,
.chooser-hub[data-kind="meal"] .restaurant-fallback-icon {
  display: block;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  margin-bottom: 6px;
  border-radius: 8px;
  object-fit: contain;
  font-size: 1.45rem;
  line-height: 32px;
}
.chooser-hub[data-kind="meal"] .saved-choice-grid .restaurant-logo,
.chooser-hub[data-kind="meal"] .saved-choice-grid .meal-card-icon,
.chooser-hub[data-kind="meal"] .saved-choice-grid .restaurant-fallback-icon {
  margin-bottom: auto;
}
.chooser-hub[data-kind="meal"] img.meal-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 0;
}
/* Override the earlier meal rule that hides all catalog and favorite images. */
.chooser-hub[data-kind="meal"] .catalog-grid img.meal-card-icon,
.chooser-hub[data-kind="meal"] .saved-choice-grid img.meal-card-icon,
.chooser-hub[data-kind="meal"] .catalog-grid img.restaurant-fallback-icon,
.chooser-hub[data-kind="meal"] .saved-choice-grid img.restaurant-fallback-icon,
.chooser-hub[data-kind="meal"] .catalog-grid article.has-restaurant-logo img.restaurant-logo,
.chooser-hub[data-kind="meal"] .saved-choice-grid article.has-restaurant-logo img.restaurant-logo {
  display: block !important;
  width: 40px;
  height: 40px;
  aspect-ratio: 1;
  background: transparent;
  object-fit: contain;
}
.chooser-hub[data-kind="meal"] .catalog-grid article.has-restaurant-logo .restaurant-fallback-icon,
.chooser-hub[data-kind="meal"] .saved-choice-grid article.has-restaurant-logo .restaurant-fallback-icon {
  display: none !important;
}
.chooser-hub[data-kind="meal"] .saved-choice-grid strong {
  font-size: .94rem;
  line-height: 1.25;
}
.chooser-hub[data-kind="meal"] .saved-choice-grid small {
  display: block;
  width: fit-content;
  max-width: 100%;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: .7rem;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chooser-hub[data-kind="meal"] .saved-choice-grid .remove-trash-button {
  opacity: 1;
}
.chooser-hub[data-kind="meal"] .custom-meal-add,
.custom-meal-modal button[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 14px;
  border-radius: 8px;
  font-size: .875rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
}
.chooser-hub[data-kind="meal"] .saved-choice-grid article > div:has(.custom-meal-edit) {
  padding-right: 12px !important;
}
.chooser-hub[data-kind="meal"] .saved-choice-grid article > div:has(.custom-meal-edit):has(.custom-meal-share) {
  padding-right: 12px !important;
}
.chooser-hub[data-kind="meal"] .custom-meal-edit {
  position: absolute;
  top: 8px;
  right: 50px;
  z-index: 4;
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
}
.chooser-hub[data-kind="meal"] article:has(.custom-meal-share) .custom-meal-edit {
  right: 92px;
}
.chooser-hub[data-kind="meal"] .custom-meal-edit svg {
  width: 17px;
  height: 17px;
}
.custom-meal-modal {
  width: min(100% - 28px, 470px);
  max-height: calc(100dvh - 32px);
  padding: 0;
  overflow: auto;
  border: 1px solid #48515e;
  border-radius: 15px;
  background: #161b22;
  color: #fff;
  box-shadow: 0 24px 80px rgba(0,0,0,.6);
}
.custom-meal-modal::backdrop { background: rgba(3,7,14,.76); backdrop-filter: blur(3px); }
.custom-meal-modal header,
.custom-meal-modal footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; }
.custom-meal-modal header { border-bottom: 1px solid #30363d; }
.custom-meal-modal footer { justify-content: flex-end; border-top: 1px solid #30363d; }
.custom-meal-modal h2 { margin: 0; font-size: 1.25rem; }
.custom-meal-modal-body { display: grid; gap: 12px; padding: 20px; }
.custom-meal-modal label { display: grid; gap: 5px; font-weight: 700; }
.custom-meal-modal input,
.custom-meal-modal select { width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #0d1117; color: #fff; }
.custom-meal-modal input[type="file"] { font-weight: 400; }
.custom-meal-modal p { margin: 0; color: var(--muted); font-size: .8rem; }
.custom-meal-modal .custom-meal-preview { width: 80px; height: 80px; border-radius: 9px; object-fit: contain; }
.custom-meal-modal .custom-meal-close,
.custom-meal-modal .custom-meal-cancel { border: 1px solid var(--line); border-radius: 8px; background: #252d38; color: #fff; cursor: pointer; }
.custom-meal-modal .custom-meal-close { width: 34px; height: 34px; font-size: 1.3rem; }
.custom-meal-modal .custom-meal-cancel { padding: 9px 14px; }
.custom-meal-modal [hidden] { display: none !important; }
@media (max-width: 540px) {
  .chooser-hub[data-kind="meal"] .saved-choice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
