.app-header.order-header {
  position: sticky;
  top: 0;
  z-index: 3;
}

html:has(.order-header) {
  scroll-padding-block: calc(145px + var(--app-safe-top)) calc(76px + var(--app-safe-bottom));
}

.ordering-page {
  max-width: 640px;
  margin-inline: auto;
  color: var(--customer-ink);
  font-family: Arial, Helvetica, sans-serif;
}

.ordering-page h1 {
  margin: 12px 0 10px;
  font-size: clamp(25px, 6vw, 34px);
  letter-spacing: -.025em;
}

.order-intro {
  margin: 0 0 18px;
  color: var(--customer-muted);
  font-size: .9rem;
}

.order-back {
  min-height: 44px;
  padding: 8px 10px;
  background: #fff2f2;
  color: #a60712;
  font-weight: 700;
}

.order-choices,
.pack-list,
.portion-list {
  display: grid;
  gap: 10px;
}

.order-choice,
.pack-card,
.portion-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px;
  border: 1px solid #f1e3e3;
  border-radius: 15px;
  background: #fff;
  text-align: left;
}

.order-choice {
  padding: 10px;
  color: var(--customer-on-light);
}

.order-choice strong {
  font-size: 1.08rem;
}

.order-choice > span:last-child {
  color: #bd0612;
  font-size: 1.4rem;
}

.order-choice small,
.portion-row small {
  display: block;
  margin-top: 4px;
  color: var(--customer-on-light);
  font-size: .81rem;
}

.order-photo {
  display: block;
  width: 63px;
  height: 58px;
  border-radius: 10px;
  background: #fff3f3;
  object-fit: contain;
}

.order-choice .order-photo {
  width: clamp(68px, 21vw, 104px);
  height: 72px;
}

.pack-card h2 {
  margin: 0 0 5px;
  font-size: 1rem;
}

.pack-card p {
  margin: 0 0 5px;
  color: inherit;
  font-size: .84rem;
}

.pack-card { color: var(--customer-on-light); }

.pack-card strong,
.portion-row small b {
  color: #b30813;
}

.pack-card button {
  min-height: 44px;
  padding: 7px;
  font-size: .8rem;
  font-weight: 700;
}

.pack-status {
  margin: 8px 0;
  color: var(--customer-muted);
  font-size: .85rem;
}

.pack-status:empty {
  display: none;
}

.portion-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.portion-stepper {
  display: grid;
  grid-template-columns: 36px minmax(22px, auto) 36px;
  align-items: center;
  text-align: center;
}

.portion-stepper button {
  min-height: 40px;
  padding: 0;
  border: 1px solid #f0b8bc;
  background: #fff;
  color: #b0000b;
  font-size: 1.15rem;
  font-weight: 700;
}

.portion-stepper button:last-child {
  border-color: #d00817;
  background: #d00817;
  color: #fff;
}

.portion-stepper button:disabled {
  opacity: .42;
  cursor: default;
}

.portion-stepper output {
  font-size: .9rem;
  font-weight: 700;
}

.dodo-field {
  position: relative;
  min-width: 0;
  width: 96px;
}

.dodo-field span {
  position: absolute;
  inset: 0 auto 0 9px;
  display: grid;
  place-items: center;
  color: #b0000b;
  pointer-events: none;
}

.dodo-field input {
  min-height: 44px;
  padding: 6px 5px 6px 25px;
  border-color: #ebb6b9;
  font-size: 16px;
}

.order-summary {
  margin-top: 16px;
  padding: 13px;
  border-radius: 16px;
  background: #fff0f1;
  color: var(--customer-on-light);
}

.order-summary h2 {
  margin: 0 0 8px;
  color: #a50711;
  font-size: 1.05rem;
}

.order-line,
.order-total,
.cart-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.order-line {
  padding: 4px 0;
  font-size: .88rem;
}

.order-line strong {
  white-space: nowrap;
}

.order-line small,
.order-empty {
  color: inherit;
}

.order-empty {
  margin: 6px 0;
  font-size: .88rem;
}

.order-total {
  margin: 9px 0 0;
  padding-top: 9px;
  border-top: 1px solid #eecdd0;
  font-weight: 700;
}

.order-total strong {
  color: #ae0711;
  font-size: 1.3rem;
}

.order-checkout {
  width: 100%;
  min-height: 48px;
  margin-top: 12px;
  border-radius: 999px;
  font-weight: 700;
}

.order-checkout:disabled {
  opacity: .5;
  cursor: default;
}

.cart-item {
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #f1e3e3;
}

.checkout-label {
  display: block;
  margin: 12px 0 5px;
  font-weight: 700;
}

@media (max-width: 360px) {
  .portion-row {
    gap: 6px;
  }

  .portion-row .order-photo {
    width: 44px;
    height: 45px;
  }
}

.order-choice:not(:has(.order-photo)),
.pack-card:not(:has(.order-photo)),
.portion-row:not(:has(.order-photo)) {
  grid-template-columns: minmax(0, 1fr) auto;
}

.portion-group {
  margin: 16px 0;
}

.portion-group h2 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.portion-unavailable {
  background: #f5f4f4;
  color: #645b5b;
}

.portion-unavailable .order-photo {
  filter: grayscale(1);
  opacity: .65;
}

.unavailable-label {
  color: #645b5b;
  font-size: .8rem;
  font-weight: 700;
}

.cart-review {
  margin: 0 0 12px;
  padding: 12px 15px;
  border: 1px solid #efbdc2;
  border-radius: 12px;
  background: #fff4f4;
  color: var(--customer-on-light);
}

.cart-review h2 {
  margin: 0;
  font-size: 1rem;
  color: #970913;
}

.cart-review ul {
  margin: 8px 0;
  padding-left: 22px;
}

.cart-review li + li {
  margin-top: 4px;
}

.cart-review p {
  margin: 0;
  font-size: .9rem;
}

@media (min-width: 768px) {
  html:has(#main.build-menu) {
    --build-menu-header-height: calc(84px + var(--app-safe-top));
    scroll-padding-block-start: calc(var(--build-menu-header-height) + 12px);
  }

  .app-header:has(+ #main.build-menu) {
    min-height: var(--build-menu-header-height);
    padding-block: 8px;
    border-radius: 0 0 24px 24px;
  }

  .app-header:has(+ #main.build-menu) .brand-button img {
    width: 60px;
  }

  .app-header:has(+ #main.build-menu) .notification-panel {
    inset-block-start: var(--build-menu-header-height);
  }

  #main.build-menu {
    padding-top: 14px;
  }

  .build-menu .ordering-page {
    max-width: 980px;
  }

  .build-menu .portion-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .build-menu .portion-row strong {
    overflow-wrap: anywhere;
  }
}


/* Plate-by-plate Build Your Menu flow */
.plate-count-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 22px 0;
}
.plate-count-option {
  display: grid;
  min-height: 104px;
  place-content: center;
  gap: 5px;
  border: 1px solid #f0d8da;
  border-radius: 16px;
  background: #fff;
  color: #2b1719;
}
.plate-count-option strong { color: #c90013; font-size: 2rem; }
.plate-count-option span { color: var(--customer-muted); font-size: .85rem; }
.plate-custom-label { display: block; margin: 12px 0 6px; font-weight: 700; }
.plate-custom-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.plate-custom-row button { min-width: 112px; font-weight: 700; }
.plate-progress {
  display: flex; justify-content: space-between; gap: 12px;
  margin: 12px 0 18px; padding: 10px 13px;
  border-radius: 12px; background: #fff2f3; color: #a50712;
  font-size: .84rem; font-weight: 750;
}
.plate-food-grid, .plate-soup-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.plate-food-card, .plate-soup-card {
  display: grid; grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center; gap: 9px; width: 100%; min-width: 0;
  padding: 8px; border: 1px solid #f0e0e1; border-radius: 14px;
  background: #fff; color: var(--customer-on-light); text-align: left;
}
.plate-food-card .order-photo, .plate-soup-card .order-photo {
  width: 58px; height: 54px; margin: 0;
}
.plate-food-card span:nth-child(2), .plate-soup-card span:nth-child(2) { min-width: 0; }
.plate-food-card strong, .plate-soup-card strong { display: block; overflow-wrap: anywhere; }
.plate-food-card small, .plate-soup-card small {
  display: block; margin-top: 4px; color: var(--customer-muted); font-size: .78rem;
}
.plate-select-mark, .plate-food-card > span:last-child, .plate-soup-card > span:last-child {
  color: #c90013; font-weight: 800;
}
.plate-food-card.selected, .plate-soup-card.selected {
  border-color: #d50016; background: #fff4f5;
  box-shadow: 0 0 0 1px #d5001620;
}
.plate-selected-main {
  display: grid; grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center; gap: 10px; margin: 14px 0;
  padding: 11px; border: 1px solid #f0dfe0; border-radius: 15px;
}
.plate-selected-main > .order-photo { width: 58px; height: 54px; }
.plate-selected-main > div:nth-child(2) strong,
.plate-selected-main > div:nth-child(2) small { display: block; }
.plate-selected-main small { margin-top: 4px; color: var(--customer-muted); font-size: .8rem; }
.plate-base-quantity { display: grid; gap: 5px; justify-items: end; }
.plate-base-quantity > span { color: var(--customer-muted); font-size: .75rem; }
.plate-live-total {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 18px; padding: 14px 15px; border-radius: 14px;
  background: #fff0f1; font-weight: 750;
}
.plate-live-total strong { color: #b30813; font-size: 1.35rem; white-space: nowrap; }
.plate-review-list { display: grid; gap: 12px; }
.plate-review-card { padding: 14px; border: 1px solid #f0dfe0; border-radius: 16px; background: #fff; }
.plate-review-heading { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.plate-review-heading h2 { margin: 4px 0 0; font-size: 1.05rem; }
.plate-review-heading > strong { color: #b30813; white-space: nowrap; }
.plate-review-number { color: #bd0714; font-size: .72rem; font-weight: 850; letter-spacing: .08em; }
.plate-review-card p { margin: 9px 0 12px; color: #66575a; font-size: .88rem; }
.plate-review-actions { display: flex; gap: 8px; }
.plate-review-actions button, .plate-add-another {
  min-height: 40px; padding: 8px 13px; border: 1px solid #efc6c9;
  border-radius: 10px; background: #fff5f5; color: #a80713; font-weight: 700;
}
.plate-review-actions button:last-child { color: #9b3038; }
.plate-add-another { width: 100%; margin-top: 12px; border-style: dashed; }
.cart-item-detail { display: block; margin-top: 4px; color: var(--customer-muted); font-size: .8rem; }
@media (max-width: 480px) {
  .plate-count-grid { gap: 7px; }
  .plate-count-option { min-height: 86px; }
  .plate-food-grid, .plate-soup-grid { grid-template-columns: 1fr; }
  .plate-selected-main { grid-template-columns: 48px minmax(0, 1fr); }
  .plate-selected-main > .order-photo { width: 48px; height: 46px; }
  .plate-base-quantity { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; }
}
@media (min-width: 768px) {
  .build-menu .plate-food-grid, .build-menu .plate-soup-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}


.plate-soup-card:disabled {
  opacity: .58;
  cursor: not-allowed;
  background: #f8f6f6;
}
.plate-soup-card:disabled small { color: #8a6c70; }


/* Desktop cart: spacious two-column layout, scoped so mobile stays unchanged. */
@media (min-width: 1024px) {
  #main:has(.ordering-page) {
    width: min(100% - 64px, 1240px);
    max-width: 1240px;
    margin-inline: auto;
    padding: 30px 0 60px;
  }

  .ordering-page:has(.cart-items) {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(340px, .8fr);
    column-gap: 32px;
    align-items: start;
    max-width: 1120px;
    margin-inline: auto;
  }

  .ordering-page:has(.cart-items) > .order-back,
  .ordering-page:has(.cart-items) > h1,
  .ordering-page:has(.cart-items) > .cart-review {
    grid-column: 1 / -1;
  }

  .ordering-page:has(.cart-items) > h1 {
    margin: 14px 0 22px;
    font-size: 36px;
    line-height: 1.15;
  }

  .ordering-page:has(.cart-items) > .cart-items {
    grid-column: 1;
    min-width: 0;
    display: grid;
    gap: 12px;
  }

  .ordering-page:has(.cart-items) > .order-summary {
    grid-column: 2;
    grid-row: auto;
    margin: 0;
    padding: 22px;
    border: 1px solid #f0dadd;
    box-shadow: 0 8px 24px #4d11110d;
  }

  .ordering-page:has(.cart-items) > .order-checkout {
    grid-column: 2;
    grid-row: auto;
    margin-top: 14px;
  }

  .ordering-page:has(.cart-items) .cart-item {
    min-height: 82px;
    align-items: center;
    padding: 16px 18px;
    border: 1px solid #f0dfe0;
    border-radius: 14px;
    background: #fff;
  }

  .ordering-page:has(.cart-items) .cart-item > span:first-child {
    min-width: 0;
  }
}

@media (min-width: 1440px) {
  #main:has(.ordering-page) {
    width: min(100% - 96px, 1360px);
    max-width: 1360px;
  }
  .ordering-page:has(.cart-items) {
    max-width: 1200px;
    grid-template-columns: minmax(0, 1.25fr) minmax(360px, .75fr);
    column-gap: 42px;
  }
}

/* Keep cart heading readable in dark mode; it inherits a light foreground. */
html[data-theme="dark"] .ordering-page h1 {
  color: var(--customer-ink);
}
html[data-theme="dark"] .ordering-page:has(.cart-items) .cart-item {
  background: #1c1d23;
  color: #f5eff0;
  border-color: #38343a;
}
html[data-theme="dark"] .ordering-page:has(.cart-items) .order-summary {
  background: #241b20;
  color: #f5eff0;
  border-color: #593039;
}
html[data-theme="dark"] .ordering-page:has(.cart-items) .order-summary h2,
html[data-theme="dark"] .ordering-page:has(.cart-items) .order-total strong {
  color: #ff9ca5;
}
html[data-theme="dark"] .ordering-page:has(.cart-items) .order-empty,
html[data-theme="dark"] .ordering-page:has(.cart-items) .order-line small {
  color: #c8babe;
}
html[data-theme="dark"] .ordering-page:has(.cart-items) .order-total {
  border-color: #593039;
}


/* Desktop Available Food landing page; mobile layout remains unchanged. */
@media (min-width: 1024px) {
  #main:has(.ordering-page) {
    width: min(100% - 64px, 1240px);
    max-width: 1240px;
    margin-inline: auto;
    padding: 34px 0 64px;
  }

  .ordering-page:has(.order-choices) {
    max-width: 1120px;
    margin-inline: auto;
  }

  .ordering-page:has(.order-choices) > h1 {
    margin: 4px 0 24px;
    font-size: 38px;
    line-height: 1.15;
    letter-spacing: -.03em;
  }

  .ordering-page:has(.order-choices) .order-choices {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }

  .ordering-page:has(.order-choices) .order-choice {
    min-height: 164px;
    grid-template-columns: 132px minmax(0, 1fr) auto;
    gap: 18px;
    padding: 16px;
    border-radius: 18px;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  }

  .ordering-page:has(.order-choices) .order-choice:hover {
    transform: translateY(-2px);
    border-color: #e7aeb3;
    box-shadow: 0 10px 26px #4b10120e;
  }

  .ordering-page:has(.order-choices) .order-choice .order-photo {
    width: 132px;
    height: 128px;
    border-radius: 13px;
  }

  .ordering-page:has(.order-choices) .order-choice strong {
    display: block;
    font-size: 1.25rem;
  }

  .ordering-page:has(.order-choices) .order-choice small {
    font-size: .95rem;
    line-height: 1.45;
  }

  .ordering-page:has(.order-choices) .order-choice > span:last-child {
    padding-inline: 8px;
    font-size: 1.8rem;
  }

  .ordering-page:has(.order-choices) .order-choice:not(:has(.order-photo)) {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

@media (min-width: 1440px) {
  #main:has(.ordering-page) {
    width: min(100% - 96px, 1360px);
    max-width: 1360px;
  }
  .ordering-page:has(.order-choices) {
    max-width: 1200px;
  }
}

/* Dark mode: keep the Available Food page title clearly visible. */
html[data-theme="dark"] .ordering-page:has(.order-choices) > h1 {
  color: var(--customer-ink);
}
html[data-theme="dark"] .ordering-page:has(.order-choices) .order-choice {
  background: #1c1d23;
  color: #f5eff0;
  border-color: #38343a;
}
html[data-theme="dark"] .ordering-page:has(.order-choices) .order-choice strong {
  color: #fff5f6;
}
html[data-theme="dark"] .ordering-page:has(.order-choices) .order-choice small {
  color: #c8babe;
}
html[data-theme="dark"] .ordering-page:has(.order-choices) .order-choice > span:last-child {
  color: #ff8792;
}


/* Full desktop ordering journey: count plates, choose food, customize, review and checkout.
   Rules are scoped to desktop widths; phone layout remains as currently designed. */
@media (min-width: 1024px) {
  #main:has(.ordering-page) {
    width: min(100% - 72px, 1320px);
    max-width: 1320px;
    margin-inline: auto;
    padding: 32px 0 72px;
  }

  .ordering-page:has(.plate-count-grid),
  .ordering-page:has(.plate-selected-main),
  .ordering-page:has(.plate-review-list),
  .ordering-page:has(#delivery) {
    max-width: 1160px;
    margin-inline: auto;
  }

  /* Number of plates */
  .ordering-page:has(.plate-count-grid) > h1,
  .ordering-page:has(.plate-count-grid) > .order-intro {
    max-width: 900px;
  }
  .ordering-page:has(.plate-count-grid) > h1 { font-size: 40px; margin-block: 16px 10px; }
  .ordering-page:has(.plate-count-grid) .plate-count-grid {
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    max-width: 920px;
    gap: 18px;
    margin: 28px 0 32px;
  }
  .ordering-page:has(.plate-count-grid) .plate-count-option {
    min-height: 150px;
    border-radius: 20px;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease;
  }
  .ordering-page:has(.plate-count-grid) .plate-count-option:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px #4a101218;
  }
  .ordering-page:has(.plate-count-grid) .plate-custom-label { max-width: 920px; }
  .ordering-page:has(.plate-count-grid) .plate-custom-row {
    max-width: 920px;
    grid-template-columns: minmax(0, 1fr) 170px;
    gap: 12px;
  }
  .ordering-page:has(.plate-count-grid) .plate-custom-row input,
  .ordering-page:has(.plate-count-grid) .plate-custom-row button { min-height: 54px; }

  /* Main food selection */
  .ordering-page:has(.plate-progress):not(:has(.plate-selected-main)):not(:has(.plate-review-list)) {
    max-width: 1160px;
  }
  .ordering-page:has(.plate-progress):not(:has(.plate-selected-main)):not(:has(.plate-review-list)) > h1 {
    font-size: 38px;
    margin-block: 14px 10px;
  }
  .ordering-page:has(.plate-progress):not(:has(.plate-selected-main)):not(:has(.plate-review-list)) .plate-progress {
    max-width: 100%;
    margin-block: 18px 22px;
    padding: 14px 18px;
    font-size: .95rem;
  }
  .ordering-page:has(.plate-progress):not(:has(.plate-selected-main)):not(:has(.plate-review-list)) .portion-group {
    margin-block: 22px 26px;
  }
  .ordering-page:has(.plate-progress):not(:has(.plate-selected-main)):not(:has(.plate-review-list)) .portion-group h2 {
    margin-bottom: 12px;
    font-size: 1.15rem;
  }
  .ordering-page:has(.plate-progress):not(:has(.plate-selected-main)):not(:has(.plate-review-list)) .plate-food-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
  }
  .ordering-page:has(.plate-progress):not(:has(.plate-selected-main)):not(:has(.plate-review-list)) .plate-food-card {
    min-height: 108px;
    grid-template-columns: 84px minmax(0, 1fr) auto;
    gap: 13px;
    padding: 12px;
    border-radius: 16px;
  }
  .ordering-page:has(.plate-progress):not(:has(.plate-selected-main)):not(:has(.plate-review-list)) .plate-food-card .order-photo {
    width: 84px;
    height: 80px;
    border-radius: 12px;
  }
  .ordering-page:has(.plate-progress):not(:has(.plate-selected-main)):not(:has(.plate-review-list)) .plate-food-card strong {
    font-size: 1rem;
  }
  .ordering-page:has(.plate-progress):not(:has(.plate-selected-main)):not(:has(.plate-review-list)) .plate-food-card small {
    font-size: .86rem;
  }
  .ordering-page:has(.plate-progress):not(:has(.plate-selected-main)):not(:has(.plate-review-list)) > [data-draft-next-main] {
    max-width: 360px;
    min-height: 54px;
    margin-top: 18px;
  }

  /* Customize one plate: main selection at top, soup/proteins/sides in columns. */
  .ordering-page:has(.plate-selected-main) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 24px;
    align-items: start;
  }
  .ordering-page:has(.plate-selected-main) > .order-back,
  .ordering-page:has(.plate-selected-main) > h1,
  .ordering-page:has(.plate-selected-main) > .plate-progress,
  .ordering-page:has(.plate-selected-main) > .plate-selected-main {
    grid-column: 1 / -1;
  }
  .ordering-page:has(.plate-selected-main) > h1 {
    font-size: 38px;
    margin-block: 14px 10px;
  }
  .ordering-page:has(.plate-selected-main) > .plate-progress {
    margin-block: 12px 18px;
  }
  .ordering-page:has(.plate-selected-main) > .plate-selected-main {
    grid-template-columns: 92px minmax(0, 1fr) auto;
    min-height: 112px;
    margin: 0 0 20px;
    padding: 16px 18px;
  }
  .ordering-page:has(.plate-selected-main) > .plate-selected-main > .order-photo {
    width: 92px;
    height: 84px;
    border-radius: 13px;
  }
  .ordering-page:has(.plate-selected-main) > .plate-selected-main strong { font-size: 1.15rem; }
  .ordering-page:has(.plate-selected-main) > .portion-group {
    min-width: 0;
    margin: 10px 0 22px;
  }
  .ordering-page:has(.plate-selected-main) > .portion-group h2 {
    font-size: 1.15rem;
    margin-bottom: 12px;
  }
  .ordering-page:has(.plate-selected-main) .plate-soup-grid,
  .ordering-page:has(.plate-selected-main) .portion-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .ordering-page:has(.plate-selected-main) .plate-soup-card {
    min-height: 86px;
    grid-template-columns: 62px minmax(0, 1fr) auto;
    padding: 10px;
  }
  .ordering-page:has(.plate-selected-main) .plate-soup-card .order-photo {
    width: 62px;
    height: 58px;
  }
  .ordering-page:has(.plate-selected-main) .portion-row {
    min-width: 0;
    min-height: 82px;
    grid-template-columns: 62px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 10px;
  }
  .ordering-page:has(.plate-selected-main) .portion-row .order-photo {
    width: 62px;
    height: 58px;
  }
  .ordering-page:has(.plate-selected-main) > .plate-live-total {
    grid-column: 1;
    align-self: center;
    margin: 12px 0;
    min-height: 62px;
  }
  .ordering-page:has(.plate-selected-main) > [data-save-plate] {
    grid-column: 2;
    align-self: center;
    min-height: 56px;
    margin: 12px 0;
  }

  /* Review plates */
  .ordering-page:has(.plate-review-list) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, .7fr);
    column-gap: 24px;
    align-items: start;
  }
  .ordering-page:has(.plate-review-list) > .order-back,
  .ordering-page:has(.plate-review-list) > h1,
  .ordering-page:has(.plate-review-list) > .order-intro {
    grid-column: 1 / -1;
  }
  .ordering-page:has(.plate-review-list) > h1 { font-size: 38px; margin-block: 14px 8px; }
  .ordering-page:has(.plate-review-list) > .plate-review-list {
    grid-column: 1;
    grid-row: 4 / span 3;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
  .ordering-page:has(.plate-review-list) .plate-review-card {
    min-height: 170px;
    padding: 18px;
  }
  .ordering-page:has(.plate-review-list) > .plate-add-another,
  .ordering-page:has(.plate-review-list) > .plate-live-total,
  .ordering-page:has(.plate-review-list) > [data-confirm-plates] {
    grid-column: 2;
    width: 100%;
    align-self: start;
  }
  .ordering-page:has(.plate-review-list) > .plate-add-another { grid-row: 4; margin: 0; min-height: 52px; }
  .ordering-page:has(.plate-review-list) > .plate-live-total { grid-row: 5; margin: 0; min-height: 66px; }
  .ordering-page:has(.plate-review-list) > [data-confirm-plates] { grid-row: 6; min-height: 54px; }

  /* Checkout */
  .ordering-page:has(#delivery) {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(380px, .95fr);
    column-gap: 36px;
    align-items: start;
  }
  .ordering-page:has(#delivery) > .order-back,
  .ordering-page:has(#delivery) > h1 {
    grid-column: 1 / -1;
  }
  .ordering-page:has(#delivery) > h1 {
    font-size: 38px;
    margin-block: 14px 22px;
  }
  .ordering-page:has(#delivery) > .order-summary {
    grid-column: 1;
    grid-row: 3 / span 5;
    position: sticky;
    top: 24px;
    margin: 0;
    padding: 24px;
  }
  .ordering-page:has(#delivery) > .checkout-label,
  .ordering-page:has(#delivery) > #delivery,
  .ordering-page:has(#delivery) > #address,
  .ordering-page:has(#delivery) > p,
  .ordering-page:has(#delivery) > .payment-provider-options,
  .ordering-page:has(#delivery) > [data-payment-provider],
  .ordering-page:has(#delivery) > [data-payment-status],
  .ordering-page:has(#delivery) > .checkout-details {
    grid-column: 2;
  }
  .ordering-page:has(#delivery) > .checkout-label { margin-top: 0; }
  .ordering-page:has(#delivery) > #delivery,
  .ordering-page:has(#delivery) > #address input {
    min-height: 52px;
    width: 100%;
  }
  .ordering-page:has(#delivery) > #address { margin-bottom: 14px; }
  .ordering-page:has(#delivery) > p { margin-block: 14px 8px; }
  .ordering-page:has(#delivery) > button[data-demo-payment] {
    min-height: 54px;
    margin: 6px 0;
    border: 1px solid #e9c7ca;
    border-radius: 12px;
    background: #fff;
    color: #a80713;
    font-weight: 750;
  }
  .ordering-page:has(#delivery) > .order-intro { margin-top: 8px; }
}

@media (min-width: 1440px) {
  #main:has(.ordering-page) { width: min(100% - 100px, 1440px); max-width: 1440px; }
  .ordering-page:has(.plate-count-grid),
  .ordering-page:has(.plate-selected-main),
  .ordering-page:has(.plate-review-list),
  .ordering-page:has(#delivery) { max-width: 1280px; }
  .ordering-page:has(.plate-progress):not(:has(.plate-selected-main)):not(:has(.plate-review-list)) .plate-food-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Dark-mode contrast for notification dropdown and desktop ordering headings. */
html[data-theme="dark"] .notification-panel {
  background: #1c1d23;
  color: #f5eff0;
  border: 1px solid #514047;
  box-shadow: 0 14px 36px #0008;
}
html[data-theme="dark"] .notification-panel strong,
html[data-theme="dark"] .notification-panel h2,
html[data-theme="dark"] .notification-panel p {
  color: #f5eff0;
}
html[data-theme="dark"] .ordering-page h1,
html[data-theme="dark"] .ordering-page .portion-group h2,
html[data-theme="dark"] .ordering-page .plate-custom-label {
  color: var(--customer-ink);
}
html[data-theme="dark"] .ordering-page .plate-count-option {
  background: #2b1b20;
  color: #fff0f1;
  border-color: #593039;
}
html[data-theme="dark"] .ordering-page .plate-count-option span {
  color: var(--customer-muted);
}
html[data-theme="dark"] .ordering-page :is(.plate-count-option strong, .plate-select-mark, .plate-live-total strong,
  .plate-review-heading > strong, .plate-review-number, .portion-row small b) { color: var(--customer-ink); }
html[data-theme="dark"] .ordering-page .plate-review-card {
  background: #1c1d23;
  color: #f5eff0;
  border-color: #38343a;
}
html[data-theme="dark"] .ordering-page .plate-review-card h2 {
  color: #fff5f6;
}
html[data-theme="dark"] .ordering-page:has(#delivery) > button[data-demo-payment] {
  background: #24252c;
  color: #ffdfe2;
  border-color: #70404a;
}


/* Cart row actions: keep quantity controls and an explicit delete action together. */
.cart-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}
.cart-item > span:first-child { flex: 1; min-width: 0; }
.cart-item-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  flex-shrink: 0;
}
.cart-item-delete {
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid #efc6c9;
  border-radius: 10px;
  background: #fff5f5;
  color: #a80713;
  font-weight: 700;
}
html[data-theme="dark"] .cart-item-delete {
  background: #3a2026;
  color: #ffdfe2;
  border-color: #70404a;
}
@media (max-width: 480px) {
  .cart-item { align-items: flex-start; }
  .cart-item-actions { gap: 6px; }
  .cart-item-delete { padding-inline: 9px; }
}

.ordering-page .plate-count-grid.plate-size-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.plate-size-grid .plate-count-option strong {
  font-size: clamp(20px, 5vw, 30px);
}

.order-component-list {
  margin: 4px 0 10px;
  padding-inline-start: 12px;
  list-style: none;
}

.checkout-details :is(.checkout-label small, .delivery-search-credit) {
  color: var(--customer-muted);
}

.customer-receipt {
  width: min(100%, 540px);
  margin: 0 auto;
  padding: clamp(18px, 5vw, 32px);
  border: 1px solid #b77959;
  border-radius: 24px;
  background:
    radial-gradient(ellipse at top right, #74272e 0%, transparent 58%),
    repeating-linear-gradient(139deg, #e54b4b10 0 1px, transparent 1px 9px),
    linear-gradient(150deg, #351018, #170d12 55%, #2c1118);
  box-shadow: inset 0 0 0 3px #e3ae791c, inset 0 0 0 5px #bc55421c, 0 12px 26px #2c0c1430;
  color: #fff1e8;
}

details.order-summary > .receipt-body > .customer-receipt {
  margin-top: 12px;
}

.customer-receipt-header {
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
}

.customer-receipt-header img {
  width: clamp(76px, 20vw, 108px);
  height: auto;
}

.customer-receipt-badge {
  --badge-light: #f3c597;
  --badge-shade: #bc7a50;
  display: inline-block;
  padding: 5px 13px;
  border: 1px solid var(--badge-light);
  border-radius: 999px;
  background: linear-gradient(155deg, var(--badge-light), var(--badge-shade));
  color: #261217;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.customer-receipt-badge[data-tier="silver"] { --badge-light: #ebf0fa; --badge-shade: #a7b3c6; }
.customer-receipt-badge[data-tier="gold"] { --badge-light: #ffdd88; --badge-shade: #dca64a; }
.customer-receipt-badge[data-tier="platinum"] { --badge-light: #f4f6ff; --badge-shade: #b5afd8; }
.customer-receipt-badge[data-tier="vip"] { --badge-light: #ffd1e2; --badge-shade: #ed89bb; }

.customer-receipt-header p,
.customer-receipt-verification p {
  margin: 0;
  color: #f2cfc5;
  font-size: .9rem;
}

.customer-receipt-verification {
  display: grid;
  justify-items: center;
  gap: 8px;
  margin: 17px 0;
  text-align: center;
}

.customer-receipt-qr {
  max-width: 100%;
  padding: 4px;
  overflow: hidden;
  border: 1px solid #e6ae8b;
  border-radius: 12px;
  background: #fff;
}

.customer-receipt-verification h2 {
  margin: 0;
  color: #ffe0a9;
  font-family: ui-monospace, Consolas, monospace;
  font-size: clamp(.95rem, 3.8vw, 1.2rem);
  overflow-wrap: anywhere;
}

.customer-receipt ul {
  padding: 0;
  margin: 0 0 14px;
  list-style: none;
  border-top: 1px solid #cc92775e;
}

.customer-receipt li {
  padding: 9px 0;
  border-bottom: 1px solid #cc927735;
}

.customer-receipt li p {
  margin: 5px 0 0;
  color: #efcac0;
  font-size: .85rem;
  line-height: 1.35;
}

.customer-receipt-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}

.customer-receipt-line strong {
  white-space: nowrap;
}

.customer-receipt-total {
  padding: 12px;
  border: 1px solid #bb644d;
  border-radius: 12px;
  background: linear-gradient(112deg, #711f2b, #4e121f);
  color: #ffe1ac;
  font-weight: 800;
}

.ordering-page:has([data-order-receipts] > .receipt-body) > :is(h1, [role="status"]) {
  text-align: center;
}

[data-order-receipts] > .order-checkout {
  display: block;
  max-width: 540px;
  margin-inline: auto;
}

.ordering-page #address { min-width: 0; margin-inline: 0; border: 0; padding: 0; }
.ordering-page #address [role="status"]:empty,
.delivery-suggestions:empty { display: none; }
.ordering-page #delivery-notes {
  width: 100%;
  min-height: 60px;
  padding: 10px 12px;
  border: 1px solid #efcbd0;
  border-radius: 10px;
  font: inherit;
  resize: vertical;
}
.delivery-suggestions { margin: 6px 0 0; padding: 0; list-style: none; }
.delivery-suggestions button {
  width: 100%;
  min-height: 44px;
  margin-top: 4px;
  padding: 8px 12px;
  text-align: start;
  overflow-wrap: anywhere;
}
.delivery-search-credit { font-size: .82rem; }
.delivery-search-credit a { color: inherit; }
.delivery-pin-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.delivery-pin-actions button { min-height: 44px; }
.delivery-pin-picker { margin-top: 12px; }
.delivery-pin-map { position: relative; isolation: isolate; height: 250px; border-radius: 12px; }
.delivery-pin-map::after {
  content: '';
  position: absolute;
  z-index: 500;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  border: 3px solid #fff;
  border-radius: 50% 50% 50% 0;
  background: #b60016;
  box-shadow: 0 1px 5px #0009;
  transform: translate(-50%, -100%) rotate(-45deg);
  transform-origin: bottom center;
  pointer-events: none;
}
html[data-theme="dark"] .ordering-page #delivery-notes {
  color: inherit;
  background: #24252c;
  border-color: #51484c;
}


/* Dual-authority delivery OTP confirmation */
.receipt-delivery-panel .delivery-otp-confirmation {
  display: grid;
  gap: .75rem;
  margin-block: 1rem;
  padding: 1rem;
  border: 1px solid var(--border, #dedede);
  border-radius: 1rem;
}
.receipt-delivery-panel .delivery-otp-confirmation label {
  display: grid;
  gap: .4rem;
  font-weight: 600;
}
.receipt-delivery-panel .delivery-otp-confirmation input {
  width: 100%;
  min-height: 3rem;
  padding: .7rem;
  border: 1px solid var(--border, #dedede);
  border-radius: .65rem;
  font: inherit;
  letter-spacing: .2em;
}
.receipt-delivery-panel .delivery-otp-code {
  display: inline-block;
  width: fit-content;
  padding: .6rem 1rem;
  border-radius: .65rem;
  background: var(--surface-soft, #f3f3f3);
  font-size: 1.5rem;
  letter-spacing: .25em;
}

/* Customer order history only; confirmation and checkout layouts stay unchanged. */
.customer-order-history { max-width:1100px; width:100%; padding:0 4px 28px; --history-surface:#fff; --history-border:#efdddd; --history-text:var(--customer-ink); --history-muted:var(--customer-muted); color:var(--history-text); }
.customer-order-history h1 { font-size:clamp(1.8rem,4vw,2.5rem); margin-bottom:5px; }
.history-intro { margin:0 0 20px; color:var(--history-muted); }
.history-filters { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin:0 0 18px; }
.history-filters button { display:flex; align-items:center; justify-content:center; gap:8px; border:1px solid var(--history-border); background:var(--history-surface); color:var(--history-text); border-radius:14px; min-height:52px; padding:9px; font-weight:700; }
.history-filters button[aria-pressed="true"] { background:#b50819; border-color:#b50819; color:#fff; }
.history-count { font-size:.78rem; padding:3px 7px; border-radius:20px; background:#8882; }
.history-filters button[aria-pressed="true"] .history-count { background:#ffffff30; }
.customer-order-history > [role="status"] { color:var(--history-muted); font-size:.9rem; margin:0 0 12px; }
.customer-order-history [data-order-receipts] { display:grid; grid-template-columns:minmax(0,1fr); gap:12px; align-items:start; }
.customer-order-history .history-order-card { min-width:0; margin:0; padding:0; background:var(--history-surface); border:1px solid var(--history-border); color:var(--history-text); border-radius:18px; box-shadow:0 4px 14px #31080d09; }
.history-order-card[hidden] { display:none!important; }
.history-order-card > summary { list-style:none; cursor:pointer; display:grid; grid-template-columns:auto minmax(0,1fr) auto auto; gap:10px; align-items:center; padding:15px; min-height:100px; }
.history-order-card > summary::-webkit-details-marker { display:none; }
.history-order-card > summary:focus-visible { outline:2px solid #e33347; outline-offset:2px; border-radius:16px; }
.history-order-symbol { display:grid; place-items:center; width:44px; height:44px; border-radius:13px; background:#ffe2e4; color:#ab0718; }
.history-order-symbol svg { width:23px; height:23px; }
.history-order-info,.history-order-amount { display:grid; gap:5px; min-width:0; }
.history-order-info > strong { font-size:.87rem; overflow-wrap:anywhere; }
.history-order-info small,.history-order-amount small { color:var(--history-muted); font-size:.75rem; }
.history-order-amount { text-align:right; }
.history-order-amount strong { font-size:1rem; overflow-wrap:anywhere; }
.history-order-state { display:inline-block; width:fit-content; padding:4px 8px; border-radius:20px; font-size:.75rem; font-weight:700; text-transform:capitalize; color:#865400; background:#fff0cc; }
.history-order-state[data-state="paid"] { color:#15653c; background:#dff4e6; }
.history-order-state[data-state="refund"] { color:#225da0; background:#e0edff; }
.history-order-state[data-state="failed"] { color:#a20e1d; background:#ffe1e4; }
.history-chevron { font-size:1.5rem;color:#b50819; }
.history-order-card[open] .history-chevron { transform:rotate(90deg); }
.history-order-card > :not(summary) { margin:0 12px 12px; }
.history-refunds { margin-top:15px; padding:12px; border:1px solid var(--history-border); border-radius:12px; }
.history-refunds h3 { margin:0 0 10px; }
.history-refund-row { padding:10px 0; border-top:1px solid var(--history-border); }
.history-refund-row p { margin:5px 0; }
.history-refund-row small { display:block; color:var(--history-muted); }
html[data-theme="dark"] .customer-order-history { --history-surface:#202126; --history-border:#41373e; }
@media(min-width:768px) { #main:has(.customer-order-history) { width:100%; max-width:1200px; margin-inline:auto; } .customer-order-history { padding-inline:16px; } }
@media(min-width:1000px) { .customer-order-history [data-order-receipts] { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:420px) { .history-filters button { flex-direction:column; gap:3px; font-size:.82rem; padding:7px 3px; } .history-order-card > summary { padding:11px; gap:7px; } .history-order-symbol { width:33px;height:33px; } .history-order-symbol svg { width:18px;height:18px; } .history-order-amount strong { font-size:.87rem; } }
.payment-confirmation-notice {
  position: fixed;
  z-index: 10;
  inset-inline: 12px;
  bottom: calc(84px + var(--app-safe-bottom));
  width: min(420px, calc(100% - 24px));
  margin-inline: auto;
  padding: 16px;
  border: 1px solid #b9dfc4;
  border-radius: 16px;
  background: #f0fbf3;
  color: #133a20;
  box-shadow: 0 8px 24px #10291929;
}
.payment-confirmation-notice p { margin: 6px 0 12px; }
.payment-confirmation-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.payment-confirmation-actions button { padding: 8px 12px; color: inherit; background: #d9f0df; }
@media (min-width: 768px) {
  .payment-confirmation-notice { bottom: calc(24px + var(--app-safe-bottom)); }
}

[data-checkout-details] { margin: 0; padding: 0; border: 0; min-width: 0; }
.checkout-details [data-continue-checkout] { width: 100%; margin-top: 18px; }
.checkout-payment-summary {
  max-width: 640px;
  padding: 16px;
  border: 1px solid var(--border, #eadce0);
  border-radius: 14px;
  color: inherit;
}
.checkout-payment-summary .receipt-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0;
}
.checkout-payment-summary .receipt-line:last-child {
  border-top: 1px solid var(--border, #eadce0);
  margin-top: 5px;
  padding-top: 10px;
  font-weight: 700;
}
.checkout-methods { display: grid; gap: 10px; max-width: 640px; margin-top: 16px; }
.checkout-methods > button {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
}
.checkout-methods > p { margin: 0 0 6px; }
html[data-theme="dark"] .checkout-payment-summary { border-color: #494047; }

/* Compact ordering header and readable checkout receipt in both themes. */
.app-header.order-header { min-height: calc(68px + var(--app-safe-top)); padding: calc(6px + var(--app-safe-top)) 20px 6px; align-items:center; border-radius:0 0 16px 16px; }
.app-header.order-header .brand-button img { width:60px; height:auto; max-height:64px; object-fit:contain; }
html:has(.order-header) { scroll-padding-block-start:calc(90px + var(--app-safe-top)); }
@media(min-width:768px){ .app-header.order-header { min-height:80px; padding:8px 24px; } .app-header.order-header .brand-button img { width:64px; } }
@media(min-width:1000px){ .ordering-page:has(#delivery) > .order-summary { top:96px; } }
html[data-theme="dark"] .ordering-page:has(#delivery) > .order-summary { background:#202126; color:#f5eff0; border-color:#494047; }
html[data-theme="dark"] .ordering-page:has(#delivery) :is(.order-summary h2,.order-total,.order-total strong) { color:#f5eff0; }
