/* Customer ordering surfaces. Shared palette, spacing and motion come from app.css. */
.customer-page .page { padding-top: var(--space-6); padding-bottom: var(--space-8); }
.customer-page h1 { letter-spacing: -.035em; }
.customer-page .storefront-brand small { white-space: normal; overflow-wrap: anywhere; }
.customer-page-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-5); margin-bottom: var(--space-6); }
.customer-page-head > div { min-width: 0; }
.customer-page-head h1 { font-size: var(--text-3xl); line-height: 1.15; margin: 0; }
.customer-kicker { color: var(--muted); font-size: var(--text-sm); font-weight: var(--fw-semibold); margin: 0 0 var(--space-2); overflow-wrap: anywhere; }
.customer-back { display: inline-flex; align-items: center; gap: var(--space-1); min-height: calc(var(--space-6) + var(--space-3)); margin: calc(-1 * var(--space-2)) 0 var(--space-4); color: var(--ink-soft); font-size: var(--text-sm); font-weight: var(--fw-semibold); }
.customer-back:hover { color: var(--brand-dark); text-decoration: none; }
.customer-count { display: inline-flex; flex: none; align-items: center; padding: var(--space-2) var(--space-3); border: .0625rem solid var(--line); border-radius: var(--pill); background: var(--card); color: var(--ink-soft); font-size: var(--text-sm); font-weight: var(--fw-semibold); }
.customer-page .rail-card, .customer-page .tr-card { border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.customer-page .rail-head, .customer-page .rail-foot { padding: var(--space-5); }
.customer-page .rail-head.is-row { align-items: center; flex-wrap: wrap; gap: var(--space-2); }
.customer-page .rail-head.is-row > :first-child, .customer-page .rail-title { font-size: var(--text-lg); }
.customer-page .rail-foot { background: var(--card); }
.customer-page .sum-row { margin-bottom: var(--space-3); }
.customer-page .sum-total { font-size: var(--text-xl); padding-top: var(--space-4); margin-top: var(--space-4); }
.customer-page .sum-total > :last-child { font-weight: var(--fw-bold); font-variant-numeric: var(--num); }
.customer-page .rail-cta { min-height: calc(var(--space-8) + var(--space-1)); border-radius: var(--r); margin-top: var(--space-5); }
.customer-page .rail-min { align-items: flex-start; line-height: 1.5; }
.customer-page .rail-min .ico { flex: none; margin-top: var(--space-1); }
.customer-page .qty-inline { height: calc(var(--space-6) + var(--space-3)); border-color: var(--line-strong); border-radius: var(--pill); }
.customer-page .qty-inline button { width: calc(var(--space-6) + var(--space-3)); height: calc(var(--space-6) + var(--space-3)); }
.customer-page .qty-inline .qi-n { min-width: var(--space-5); font-size: var(--text-sm); }
.customer-empty-icon { display: grid; place-items: center; width: calc(var(--space-8) * 2); height: calc(var(--space-8) * 2); margin: 0 auto var(--space-5); background: var(--bg); color: var(--ink-soft); border-radius: var(--pill); }
.customer-section-heading { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-3); }
.customer-section-heading h2 { margin: 0; font-size: var(--text-lg); line-height: 1.3; }
.customer-section-icon { display: grid; place-items: center; flex: none; width: calc(var(--space-6) + var(--space-2)); height: calc(var(--space-6) + var(--space-2)); border-radius: var(--r); background: var(--bg); color: var(--ink-soft); }

/* Storefront: restaurant identity, readable menu choices, one obvious order rail. */
.customer-storefront .r-hero { border-radius: var(--r-lg); }
.customer-storefront .r-hero .cover { height: 14rem; }
.customer-storefront .r-hero .hbody { padding: var(--space-5) var(--space-6); gap: var(--space-5); align-items: center; }
.customer-storefront .r-hero .hmain { padding: 0; }
.customer-storefront .r-hero h1 { font-size: var(--text-3xl); line-height: 1.15; overflow-wrap: anywhere; }
.customer-storefront .r-logo { width: calc(var(--space-8) * 2); height: calc(var(--space-8) * 2); margin-top: 0; border-radius: var(--r-lg); box-shadow: var(--shadow); }
.customer-storefront .r-desc { max-width: 48rem; margin-top: var(--space-2); line-height: 1.6; }
.customer-storefront .r-hero.no-cover .cover { height: var(--space-1); background: var(--brand); }
.customer-storefront .r-hero.no-cover .hbody { padding: var(--space-6); }
.customer-storefront .r-hero.no-cover .r-logo { width: calc(var(--space-8) + var(--space-6)); height: calc(var(--space-8) + var(--space-6)); box-shadow: none; background: var(--bg); }
.customer-storefront .r-facts { margin-top: 0; padding: var(--space-1) var(--space-3); background: var(--tint-row); }
.customer-storefront .r-fact { padding: var(--space-3) var(--space-4); }
.customer-storefront .r-facts-more { min-height: calc(var(--space-6) + var(--space-3)); }
.customer-storefront .catbar { top: var(--storefront-header-height, var(--bar-h)); display: flex; flex-direction: column; flex-wrap: nowrap; align-items: stretch; padding: var(--space-3) 0; gap: var(--space-3); margin: 0 0 var(--space-5); border-bottom: .0625rem solid var(--line); }
.customer-storefront .catbar-categories { display: flex; align-items: center; gap: var(--space-2); min-width: 0; width: 100%; }
.customer-storefront .catbar-prev, .customer-storefront .catbar-next { display: inline-flex; align-items: center; justify-content: center; flex: none; width: calc(var(--space-6) + var(--space-3)); height: calc(var(--space-6) + var(--space-3)); padding: 0; background: var(--card); color: var(--ink); border: .0625rem solid var(--line-strong); border-radius: var(--pill); box-shadow: var(--shadow-sm); cursor: pointer; }
.customer-storefront .catbar-prev[hidden], .customer-storefront .catbar-next[hidden] { display: none; }
.customer-storefront .catbar-prev:disabled, .customer-storefront .catbar-next:disabled { opacity: .35; box-shadow: none; cursor: default; }
.customer-storefront .catbar-prev:not(:disabled):hover, .customer-storefront .catbar-next:not(:disabled):hover { background: var(--fill-muted); border-color: var(--ink-soft); }
.customer-storefront .catbar-tabs { flex: 1; gap: var(--space-2); min-width: 0; padding-block: var(--space-1); }
.customer-storefront .catbar-tabs a { display: inline-flex; align-items: center; justify-content: center; min-height: calc(var(--space-6) + var(--space-3)); padding: var(--space-2) var(--space-4); border-radius: var(--pill); }
.customer-storefront .catbar-tabs a.active { background: var(--ink); }
.customer-storefront .ms-field { order: -1; min-height: calc(var(--space-6) + var(--space-3)); flex: none; width: 100%; border-color: var(--line); border-radius: var(--pill); padding-inline: var(--space-4); }
.customer-storefront .ms-field input { padding-block: var(--space-3); }
.customer-storefront .menu-layout { grid-template-columns: minmax(0, 1fr) var(--storefront-rail-width); gap: var(--space-6); margin-top: var(--space-5); }
.customer-storefront .menu-catalog { min-width: 0; }
.customer-storefront .menu-section { margin-bottom: var(--space-6); scroll-margin-top: calc(var(--storefront-header-height, var(--bar-h)) + var(--storefront-category-height, 8.5rem) + var(--space-4)); }
.customer-storefront .menu-section-h { margin-bottom: var(--space-4); }
.customer-storefront .menu-section-h h2 { font-size: var(--text-xl); }
.customer-storefront .menu-list { border-radius: var(--r-lg); }
.customer-storefront .menu-row { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr) auto; gap: var(--space-2) var(--space-4); padding: var(--space-5); align-items: center; min-height: 7rem; }
.customer-storefront .mr-thumb { grid-column: 1; grid-row: 1 / 3; width: 4.5rem; height: 4.5rem; border-radius: var(--r); }
.customer-storefront .mr-thumb.is-empty { background: var(--bg); color: var(--faint); }
.customer-storefront .mr-open, .customer-storefront .mr-body { grid-column: 2; grid-row: 1; align-self: end; }
.customer-storefront .mr-name { font-size: var(--text-base); font-weight: var(--fw-bold); overflow-wrap: anywhere; }
.customer-storefront .mr-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; white-space: normal; line-height: 1.45; margin-top: var(--space-1); }
.customer-storefront .mr-price { grid-column: 2; grid-row: 2; min-width: 0; text-align: left; align-self: start; pointer-events: none; }
.customer-storefront .mr-from { display: inline; margin-right: var(--space-1); }
.customer-storefront .mr-amount { font-size: var(--text-sm); }
.customer-storefront .mr-action { grid-column: 3; grid-row: 1 / 3; min-width: 0; }
.customer-storefront .mr-btn { width: calc(var(--space-6) + var(--space-3)); height: calc(var(--space-6) + var(--space-3)); min-width: calc(var(--space-6) + var(--space-3)); border-radius: var(--pill); padding: 0; font-size: var(--text-sm); border-color: var(--line-strong); }
.customer-storefront .mr-badge { grid-column: 2 / 4; grid-row: 3; justify-self: start; }
.customer-storefront .mr-action .qty-inline button { width: var(--space-6); }
.customer-storefront .order-rail { top: calc(var(--storefront-header-height, var(--bar-h)) + var(--space-4)); min-width: 0; }
/* If wrapped labels or larger text leave too little room for the fixed receipt
   header/footer, the entire card can scroll rather than clipping checkout. */
.customer-storefront .rail-card { display: flex; flex-direction: column; max-height: calc(100dvh - var(--storefront-header-height, var(--bar-h)) - var(--space-6)); overflow-y: auto; }
.customer-storefront .rail-head, .customer-storefront .rail-foot { flex: none; }
.customer-storefront .rail-lines { flex: 1 1 auto; min-height: var(--space-8); max-height: none; overflow-y: auto; overscroll-behavior-y: contain; scrollbar-width: thin; scrollbar-gutter: stable; padding-inline: var(--space-5); }
.customer-storefront .rail-lines:focus-visible { outline: .125rem solid var(--brand); outline-offset: -.125rem; }
.customer-storefront .rail-name { overflow-wrap: anywhere; }
.customer-storefront .rail-empty { padding: var(--space-8) var(--space-5); }
.customer-storefront .rail-empty-title { font-size: var(--text-base); }
.customer-storefront .rail-empty-sub { margin-top: var(--space-2); }
.customer-storefront .modal { position: relative; max-width: 44rem; box-shadow: var(--shadow-lg); min-width: 0; }
.customer-storefront .modal .m-form { min-height: 0; }
.customer-storefront .modal .m-scroll, .customer-storefront .modal .m-head, .customer-storefront .modal .m-opts, .customer-storefront .modal .m-title, .customer-storefront .modal .o-name { min-width: 0; }
.customer-storefront .modal .m-close { width: calc(var(--space-6) + var(--space-3)); height: calc(var(--space-6) + var(--space-3)); background: var(--card); }
.customer-storefront .modal .m-title { padding: var(--space-5) var(--space-5) var(--space-4); }
.customer-storefront .modal .m-title p { line-height: 1.6; }
.customer-storefront .modal .m-opts { padding: 0 var(--space-5) var(--space-5); }
.customer-storefront .modal .m-personalization { display: grid; gap: var(--space-4); margin-top: var(--space-5); padding: var(--space-5); background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); }
.customer-storefront .modal .m-personalization .form-row { min-width: 0; margin: 0; }
.customer-storefront .modal .m-personalization label { line-height: 1.5; }
.customer-storefront .modal .m-personalization :is(input, textarea) { display: block; min-width: 0; max-width: 100%; }
.customer-storefront .modal .m-personalization textarea { min-height: calc(var(--space-8) * 2); }
.customer-storefront .modal .m-foot { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--space-3); flex: none; padding: var(--space-4) var(--space-5) calc(var(--space-4) + env(safe-area-inset-bottom)); box-shadow: var(--shadow-bar); }
.customer-storefront .modal .m-ordering-notice { grid-column: 1 / -1; margin: 0; }
.customer-storefront .modal .m-add { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-2); min-width: 0; min-height: var(--space-8); padding-inline: var(--space-3); text-align: left; }
.customer-storefront .modal .m-add [data-add-label] { min-width: 0; white-space: normal; line-height: 1.35; }
.customer-storefront .modal .m-add [data-add-price] { white-space: nowrap; }
.customer-storefront .modal .opt, .customer-edit .opt { min-height: calc(var(--space-8) + var(--space-2)); padding: var(--space-3) var(--space-4); }
.customer-storefront .modal .opt .o-name, .customer-edit .opt .o-name { font-size: var(--text-base); overflow-wrap: anywhere; }
.customer-storefront .modal .opt .o-price, .customer-edit .opt .o-price { font-size: var(--text-sm); }
.customer-storefront .modal .og-list, .customer-edit .og-list { border-radius: var(--r); }
@media (min-width: 51.25rem) {
    .customer-storefront .modal-backdrop { padding: var(--space-5) var(--layout-gutter); }
    .customer-storefront .modal { max-height: calc(100dvh - var(--space-8)); }
}
@media (min-width: 57.5rem) {
    .customer-storefront .modal:has(.opt-group) { max-width: var(--dish-dialog-max); }
    .customer-storefront .modal:has(.opt-group) .m-scroll { grid-template-columns: minmax(18rem, .85fr) minmax(0, 1.65fr); }
    .customer-storefront .modal:has(.opt-group) .m-head { display: block; }
    .customer-storefront .modal:has(.opt-group) .m-cover { height: auto; aspect-ratio: 4 / 3; }
    .customer-storefront .modal:has(.opt-group) .m-title { padding: var(--space-5); }
    .customer-storefront .modal:has(.opt-group) .m-opts { padding: var(--space-5); }
}

/* Cart and selection editing: spacious line items and a legible receipt. */
.customer-cart .cart-head-row > .customer-back { flex-basis: 100%; margin-bottom: 0; }
.customer-cart-bar { display: none; }
.customer-cart .cart-layout { gap: var(--space-6); grid-template-columns: minmax(0, 1fr) clamp(22.5rem, 24vw, 25rem); }
.customer-cart .cart-list { border-radius: var(--r-lg); }
.customer-cart .cart-list-head { padding: var(--space-4) var(--space-5); background: var(--card); }
.customer-cart .cart-list-head > span { display: inline-flex; align-items: center; gap: var(--space-2); }
.customer-cart .cart-list-head .ico { color: var(--muted); }
.customer-cart .cart-row { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr) auto; gap: var(--space-3) var(--space-4); padding: var(--space-5); }
.customer-cart .cr-thumb { grid-column: 1; grid-row: 1 / 3; width: 4.5rem; height: 4.5rem; border-radius: var(--r); }
.customer-cart .cr-main { grid-column: 2; grid-row: 1; min-width: 0; }
.customer-cart .cr-name { font-weight: var(--fw-bold); line-height: 1.4; }
.customer-cart .cr-opts { margin-top: var(--space-1); line-height: 1.5; }
.customer-cart .cr-edit { display: inline-flex; align-items: center; gap: var(--space-1); min-height: var(--space-6); margin-top: var(--space-1); color: var(--ink-soft); text-decoration: underline; text-underline-offset: .18em; }
.customer-cart .cr-edit:hover { color: var(--brand-dark); }
.customer-cart .cart-row .qty-inline { grid-column: 2; grid-row: 2; justify-self: start; margin: 0; }
.customer-cart .cr-price { grid-column: 3; grid-row: 1 / 3; width: auto; margin: 0; align-self: center; }
.customer-cart .cr-total { font-size: var(--text-lg); }
.customer-cart .cr-unit { margin-top: var(--space-1); }
.customer-cart .cart-addmore { padding: var(--space-4) var(--space-5); min-height: calc(var(--space-8) + var(--space-2)); background: var(--tint-row); }
.customer-service-label { display: inline-flex; align-items: center; gap: var(--space-1); color: var(--muted); font-size: var(--text-sm); font-weight: var(--fw-medium); }
.customer-cart .cart-vendor { border-top: .0625rem solid var(--line); margin-top: var(--space-5); padding-top: var(--space-4); }
.customer-cart .cart-empty-card { max-width: 38rem; margin-top: var(--space-8); }
.customer-cart .cart-empty-card .rail-empty { padding: var(--space-8); }
.customer-cart .cart-empty-card .rail-empty-title { font-size: var(--text-xl); font-weight: var(--fw-bold); }
.customer-cart .cart-empty-card .rail-empty-sub { margin-top: var(--space-2); }
.customer-cart .cart-empty-card .btn { margin-top: var(--space-5); min-height: var(--space-8); }
.customer-edit .cart-edit-card { max-width: none; padding: var(--space-6); border-radius: var(--r-lg); }
.customer-edit .cart-edit-heading { padding-bottom: var(--space-5); border-bottom: .0625rem solid var(--line); gap: var(--space-5); }
.customer-edit .cart-edit-photo { width: 6rem; height: 6rem; border-radius: var(--r); }
.customer-edit .cart-edit-heading h2 { font-size: var(--text-xl); margin-bottom: var(--space-2); }
.customer-edit .cart-edit-heading p { margin-bottom: var(--space-2); }
.customer-edit .cart-edit-heading > div { max-width: 70ch; }
.customer-edit .opt-group { margin-block: var(--space-5); }
.customer-edit .cart-edit-total { background: var(--tint-row); border: 0; padding: var(--space-5); border-radius: var(--r); }
.customer-edit .cart-edit-actions { gap: var(--space-4); padding-top: var(--space-5); }
.customer-edit .cart-edit-actions .btn { min-height: var(--space-8); }
.customer-edit .cart-edit-actions .btn-primary { min-width: 14rem; }

/* Account history uses the same useful card on phones and larger screens. */
.customer-account-actions { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.customer-account-layout { display: grid; grid-template-columns: minmax(0, 1fr) clamp(21rem, 22vw, 25rem); gap: var(--space-6); align-items: start; }
.customer-history { min-width: 0; }
.customer-orders { display: flex; flex-direction: column; gap: var(--space-4); }
.customer-order-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--space-3) var(--space-4); padding: var(--space-5); border: .0625rem solid var(--line); border-radius: var(--r-lg); background: var(--card); box-shadow: var(--shadow-sm); transition: border-color var(--t), box-shadow var(--t); }
.customer-order-card + .customer-order-card { border-top: .0625rem solid var(--line); }
.customer-order-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); color: var(--ink); }
.customer-order-logo { grid-column: 1; grid-row: 1; display: grid; place-items: center; width: var(--space-8); height: var(--space-8); border-radius: var(--r); background: var(--bg); color: var(--muted); overflow: hidden; }
.customer-order-logo img { width: 100%; height: 100%; object-fit: cover; }
.customer-order-main { min-width: 0; align-self: center; }
.customer-order-main > strong { display: block; font-size: var(--text-lg); line-height: 1.3; overflow-wrap: anywhere; }
.customer-order-date { display: block; color: var(--muted); font-size: var(--text-sm); margin-top: var(--space-1); }
.customer-order-total { justify-self: end; align-self: center; font-variant-numeric: var(--num); white-space: nowrap; }
.customer-order-status { grid-column: 2; grid-row: 2; }
.customer-order-reference { grid-column: 1 / -1; color: var(--muted); font-size: var(--text-xs); border-top: .0625rem solid var(--line); padding-top: var(--space-3); overflow-wrap: anywhere; }
.customer-order-link { grid-column: 3; grid-row: 2; justify-self: end; align-self: center; display: inline-flex; gap: var(--space-1); align-items: center; font-size: var(--text-sm); font-weight: var(--fw-semibold); color: var(--brand-dark); }
.customer-notifications { padding: var(--space-5); border-radius: var(--r-lg); }
.customer-notifications .help { line-height: 1.6; margin-bottom: var(--space-4); }
.customer-notification-option { display: flex; align-items: flex-start; padding: var(--space-3) 0; border-top: .0625rem solid var(--line); font-size: var(--text-sm); line-height: 1.5; }
.customer-notification-option input { flex: none; margin-top: var(--space-1); }
.customer-notifications button { margin-top: var(--space-4); width: 100%; min-height: calc(var(--space-6) + var(--space-3)); }
.customer-account-empty { padding: var(--space-8); text-align: center; border-radius: var(--r-lg); }
.customer-account-empty h2 { font-size: var(--text-xl); margin-bottom: var(--space-5); }

/* Tracking: current state first, a quiet receipt and practical delivery details. */
.customer-tracking .tr-head-ref { display: flex; flex-direction: column; gap: var(--space-1); align-items: flex-end; max-width: 50%; font-size: var(--text-xs); }
.customer-tracking .tr-head-ref strong { font-weight: var(--fw-medium); }
.customer-tracking .tr-status-card { border-top: .25rem solid var(--brand); }
.customer-tracking .tr-main { padding: var(--space-6); gap: var(--space-6); }
.customer-tracking .tr-state-row { align-items: flex-start; flex-direction: column; gap: var(--space-3); }
.customer-tracking .tr-state-note { color: var(--ink); font-size: var(--text-lg); line-height: 1.4; }
.customer-tracking .tr-timeline { margin-top: var(--space-5); }
.customer-tracking .tr-foot { padding: var(--space-4) var(--space-6); }
.customer-tracking .tr-foot .btn { min-height: calc(var(--space-6) + var(--space-3)); }
.customer-tracking .tr-grid { gap: var(--space-6); margin-top: var(--space-6); }
.customer-tracking .tr-list-head { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-5); font-size: var(--text-base); }
.customer-tracking .tr-list-head .ico { color: var(--muted); flex: none; }
.customer-tracking .tr-lines { padding: var(--space-2) var(--space-5); }
.customer-tracking .tr-lines .rail-line { padding-block: var(--space-4); }
.customer-tracking .rail-qty { color: var(--ink-soft); min-width: var(--space-5); }
.customer-tracking .tr-dl { padding: var(--space-2) var(--space-5) var(--space-4); }
.customer-tracking .tr-dl .dl-row { padding-block: var(--space-3); }
.customer-tracking .tr-dl .dl-v { line-height: 1.6; }
.customer-tracking .tr-account { padding: var(--space-5); border-radius: var(--r-lg); background: var(--tint-row); }
.customer-tracking .tr-account-title { margin-bottom: var(--space-2); }
.customer-tracking .tr-total-pay { display: block; font-size: var(--text-xs); color: var(--muted); margin-top: var(--space-1); }
.customer-tracking .tr-back { min-height: var(--space-8); padding-inline: 0; }

/* Wide menus use the extra space for more dishes, without long text rows. */
@media (min-width: 100rem) {
    .customer-storefront .menu-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .customer-storefront .menu-list > .menu-row { border: 0; box-shadow: .0625rem 0 0 var(--line), 0 .0625rem 0 var(--line); }
    .customer-orders { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
    .customer-order-card:only-child { grid-column: 1 / -1; }
}

/* Wider canvases earn their space through useful columns, while receipts and
   preference controls retain a comfortable reading width. */
@media (min-width: 80rem) {
    .customer-cart .cart-row { grid-template-columns: 5rem minmax(0, 1fr) auto minmax(7rem, auto); align-items: center; gap: var(--space-5); }
    .customer-cart .cr-thumb { width: 5rem; height: 5rem; grid-row: 1; }
    .customer-cart .cr-main { grid-column: 2; grid-row: 1; }
    .customer-cart .cr-opts { max-width: 65ch; }
    .customer-cart .cart-row .qty-inline { grid-column: 3; grid-row: 1; }
    .customer-cart .cr-price { grid-column: 4; grid-row: 1; justify-self: end; }
    .customer-edit .cart-edit-card { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--space-6); align-items: start; }
    .customer-edit .cart-edit-card > * { grid-column: 1 / -1; }
    .customer-edit .cart-edit-card > .opt-group { grid-column: auto; }
    .customer-edit .cart-edit-card > .opt-group:only-of-type { grid-column: 1 / -1; }
    .customer-edit .opt-group:only-of-type .og-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .customer-edit .opt-group:only-of-type .opt { border-bottom: .0625rem solid var(--line); }
    .customer-edit .opt-group:only-of-type .opt:nth-child(odd) { border-right: .0625rem solid var(--line); }
    .customer-edit .opt-group:only-of-type .opt:last-child:nth-child(odd) { grid-column: 1 / -1; border-right: 0; }
    .customer-edit .cart-edit-card > .form-row-narrow { grid-column: 1; align-self: center; }
    .customer-edit .cart-edit-card > .cart-edit-total { grid-column: 2; align-self: center; }
}

@media (min-width: 51.25rem) and (max-height: 48rem) {
    .customer-storefront .rail-head, .customer-storefront .rail-foot { padding: var(--space-4); }
    .customer-storefront .sum-row { margin-bottom: var(--space-1); }
    .customer-storefront .sum-total { margin-top: var(--space-3); padding-top: var(--space-3); }
    .customer-storefront .rail-cta { margin-top: var(--space-3); }
}

/* Very short windows can scroll the complete receipt instead of clipping it. */
@media (min-width: 51.25rem) and (max-height: 32rem) {
    .customer-storefront .rail-card { overflow-y: auto; }
    .customer-storefront .rail-lines { flex: none; overflow-y: visible; }
}

@media (max-width: 63.9375rem) {
    .customer-storefront .menu-layout { gap: var(--space-5); grid-template-columns: minmax(0, 1fr); }
    .customer-storefront .order-rail { display: none; }
    .customer-storefront .order-bar.has-items { display: block; }
    .customer-storefront:has(.order-bar.has-items) .page { padding-bottom: calc(var(--space-8) * 3); }
    .customer-storefront .menu-row { grid-template-columns: 3.5rem minmax(0, 1fr) auto; padding: var(--space-4); gap: var(--space-2) var(--space-3); }
    .customer-storefront .mr-thumb { width: 3.5rem; height: 3.5rem; }
    .customer-storefront .mr-label { display: inline-flex; }
    .customer-cart .cart-layout { gap: var(--space-5); grid-template-columns: minmax(0, 1fr) 20rem; }
    .customer-cart .cart-row { grid-template-columns: 3.5rem minmax(0, 1fr); padding: var(--space-4); }
    .customer-cart .cr-thumb { width: 3.5rem; height: 3.5rem; grid-row: 1; }
    .customer-cart .cr-main { grid-column: 2; }
    .customer-cart .cart-row .qty-inline { grid-column: 1 / 3; }
    .customer-cart .cr-price { grid-column: 2; grid-row: 2; justify-self: end; }
    .customer-account-layout { grid-template-columns: minmax(0, 1fr) 19rem; gap: var(--space-5); }
}

@media (min-width: 40rem) and (max-width: 63.9375rem) {
    .customer-storefront .order-bar.has-items { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: center; gap: var(--space-2) var(--space-4); padding-inline: var(--space-5); }
    .customer-storefront .ob-fulfilment { margin-bottom: 0; }
    .customer-storefront .ob-note { grid-column: 1 / -1; margin: 0; }
}

@media (max-width: 51.1875rem) {
    .customer-page .page { padding-top: var(--space-5); }
    .customer-page-head { align-items: flex-start; margin-bottom: var(--space-5); gap: var(--space-3); }
    .customer-page-head h1 { font-size: var(--text-2xl); }
    .customer-kicker { margin-bottom: var(--space-1); }
    .customer-page .rail-head, .customer-page .rail-foot { padding: var(--space-5); }
    .customer-storefront .r-hero .cover { height: 8rem; }
    .customer-storefront .r-hero .hbody, .customer-storefront .r-hero.no-cover .hbody { padding: var(--space-4); gap: var(--space-3); align-items: flex-start; }
    .customer-storefront .storefront-eyebrow { display: none; }
    .customer-storefront .r-logo, .customer-storefront .r-hero.no-cover .r-logo { width: 3.5rem; height: 3.5rem; flex: none; border-radius: var(--r); }
    .customer-storefront .r-hero h1 { font-size: var(--text-2xl); }
    .customer-storefront .r-desc { font-size: var(--text-sm); }
    .customer-storefront .r-facts { padding: var(--space-3) var(--space-5); gap: var(--space-3) var(--space-4); }
    .customer-storefront .r-fact { padding: 0; font-size: var(--text-xs); gap: var(--space-1); }
    .customer-storefront .r-facts-more { padding: 0; min-height: var(--space-6); }
    .customer-storefront .catbar { top: var(--storefront-header-height, var(--bar-h)); margin-top: 0; padding-block: var(--space-3); gap: var(--space-2); }
    .customer-storefront .catbar-tabs { width: 100%; }
    .customer-storefront .catbar-tabs a { font-size: var(--text-sm); }
    .customer-storefront .ms-field { flex-basis: auto; width: 100%; }
    .customer-storefront .menu-layout { grid-template-columns: minmax(0, 1fr); margin-top: var(--space-3); }
    .customer-storefront .menu-section-h { margin-bottom: var(--space-3); }
    .customer-storefront .menu-section-h h2 { font-size: var(--text-xl); }
    .customer-storefront .menu-row { min-height: 6.5rem; }
    .customer-storefront .mr-label { display: none; }
    .customer-storefront .mr-desc { font-size: var(--text-sm); }
    .customer-storefront .mr-action .qty-inline { flex-direction: column-reverse; height: auto; border-radius: var(--pill); }
    .customer-storefront .mr-action .qty-inline button { width: calc(var(--space-6) + var(--space-3)); height: calc(var(--space-6) + var(--space-3)); }
    .customer-storefront .mr-action .qty-inline .qi-n { line-height: 1.3; }
    .customer-storefront .modal .m-foot { padding-inline: var(--space-4); }
    .customer-cart .cart-layout { grid-template-columns: minmax(0, 1fr); }
    .customer-cart .page { padding-bottom: calc(var(--space-8) * 2 + var(--space-5)); }
    .customer-cart-bar { position: fixed; inset: auto 0 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-4) var(--space-4) calc(var(--space-4) + env(safe-area-inset-bottom)); background: var(--card); border-top: .0625rem solid var(--line); box-shadow: var(--shadow-bar); }
    .customer-cart-bar > div { display: flex; flex-direction: column; gap: var(--space-1); }
    .customer-cart-bar > div > span { font-size: var(--text-xs); color: var(--muted); }
    .customer-cart-bar strong { font-size: var(--text-lg); font-variant-numeric: var(--num); white-space: nowrap; }
    .customer-cart-bar .btn { min-height: var(--space-8); flex: 1; max-width: 20rem; }
    .customer-cart .cart-row { padding: var(--space-5); }
    .customer-cart .cart-empty-card { margin-top: var(--space-5); }
    .customer-cart .cart-empty-card .rail-empty { padding: var(--space-8) var(--space-5); }
    .customer-cart .cart-empty-card .btn { width: 100%; white-space: normal; }
    .customer-edit .cart-edit-card { padding: var(--space-5); }
    .customer-edit .cart-edit-heading { gap: var(--space-4); }
    .customer-edit .cart-edit-photo { width: 4.5rem; height: 4.5rem; }
    .customer-edit .cart-edit-actions .btn-primary { min-width: 0; flex: 1; }
    .customer-account .customer-page-head { flex-wrap: wrap; }
    .customer-account-actions { width: 100%; }
    .customer-account-actions > .btn:first-child { flex: 1; }
    .customer-account-layout { grid-template-columns: minmax(0, 1fr); }
    .customer-order-card { padding: var(--space-5); gap: var(--space-3); }
    .customer-order-main > strong { font-size: var(--text-base); }
    .customer-order-date { font-size: var(--text-xs); }
    .customer-order-status { grid-column: 1 / 3; }
    .customer-order-link { font-size: var(--text-xs); }
    .customer-notifications { padding: var(--space-5); }
    .customer-tracking .tr-head { gap: var(--space-3); }
    .customer-tracking .tr-head-ref { max-width: 100%; align-items: flex-start; }
    .customer-tracking .tr-main { padding: var(--space-5); gap: 0; }
    .customer-tracking .tr-state-row { gap: var(--space-2); }
    .customer-tracking .tr-state-note { font-size: var(--text-lg); }
    .customer-tracking .tr-timeline { margin-top: var(--space-4); }
    .customer-tracking .tr-step { border-top: 0; padding-block: var(--space-3); }
    .customer-tracking .tr-bar { width: var(--space-5); height: var(--space-5); }
    .customer-tracking .tr-foot { padding: var(--space-4) var(--space-5); }
    .customer-tracking .tr-foot .btn { width: 100%; }
    .customer-tracking .tr-grid { grid-template-columns: minmax(0, 1fr); gap: var(--space-5); margin-top: var(--space-5); }
    .customer-tracking .tr-back { white-space: normal; justify-content: flex-start; text-align: left; }
}

@media (max-width: 24.375rem) {
    .customer-page .rail-head, .customer-page .rail-foot, .customer-cart .cart-row, .customer-order-card { padding: var(--space-4); }
    .customer-storefront .r-hero .hbody, .customer-storefront .r-hero.no-cover .hbody { padding: var(--space-4); }
    .customer-storefront .r-facts { padding-inline: var(--space-4); }
    .customer-storefront .mr-name { font-size: var(--text-sm); }
    .customer-edit .cart-edit-card { padding: var(--space-4); }
    .customer-edit .cart-edit-heading { flex-direction: column; }
    .customer-tracking .tr-main, .customer-tracking .tr-list-head { padding: var(--space-4); }
    .customer-tracking .tr-lines { padding-inline: var(--space-4); }
}
/* Favorites belong to their dish, without inserting extra rows into the menu grid. */
.customer-storefront .mr-price { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2); }
.customer-storefront .mr-original { color: var(--muted); font-size: var(--text-xs); }
.dish-favorite { display: inline-flex; align-items: center; gap: var(--space-2); margin: 0; pointer-events: auto; }
.favorite-button { display: inline-flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem; border: 0; border-radius: var(--pill); color: var(--muted); background: transparent; cursor: pointer; transition: color var(--t), background var(--t); }
.favorite-button:hover, .favorite-button[aria-pressed="true"] { color: var(--brand-dark); background: var(--brand-tint); }
.favorite-button[aria-pressed="true"] .ico { fill: currentColor; }
.favorite-button:disabled { opacity: .5; cursor: wait; }
.favorite-error { color: var(--danger); font-size: var(--text-xs); max-width: 22ch; }
.operator-page .card details > summary { padding-block: var(--space-3); cursor: pointer; min-height: 2.75rem; }

/* Saved items, group baskets and table tabs share the ordering surface rhythm. */
.customer-commerce .page-header h1 { margin-bottom: var(--space-2); overflow-wrap: anywhere; }
.customer-commerce .card { min-width: 0; border-radius: var(--r-lg); }
.customer-commerce .card details > summary { padding-block: var(--space-3); min-height: calc(var(--space-8) + var(--space-3)); cursor: pointer; font-weight: var(--fw-semibold); }
.customer-commerce .btn { white-space: normal; text-align: center; }
.customer-commerce :is(input, textarea, select) { min-width: 0; max-width: 100%; }

/* Restaurant delivery policies and a checked address share one readable panel. */
.delivery-pricing { margin-block: var(--space-5); }
.delivery-pricing h2 { font-size: var(--text-lg); margin: 0; }
.delivery-bands { margin-block: var(--space-4); }
.delivery-bands > summary { cursor: pointer; font-weight: var(--fw-semibold); padding-block: var(--space-2); }
.delivery-band-list { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); margin-top: var(--space-3); }
.delivery-band { display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-3) var(--space-4); background: var(--bg); border-radius: var(--r); font-size: var(--text-sm); }
.delivery-band strong { color: var(--ink); }
.delivery-address-fields { display: grid; grid-template-columns: minmax(0, 2fr) minmax(6rem, .7fr) minmax(0, 1.3fr) auto; gap: var(--space-3); align-items: end; }
.delivery-address-fields .form-row { margin: 0; min-width: 0; }
.delivery-address-fields input { min-width: 0; }
.delivery-address-fields .btn { min-height: 2.875rem; white-space: normal; }
.delivery-quote-status { margin-block: var(--space-3) 0; }
.delivery-quote-result { margin-top: var(--space-4); border-top: 1px solid var(--line); padding-top: var(--space-4); }
.delivery-quote-result > strong { overflow-wrap: anywhere; }
.delivery-quote-result dl { margin: var(--space-3) 0 0; max-width: 32rem; }
.delivery-quote-result dl > div { display: flex; justify-content: space-between; gap: var(--space-4); padding-block: var(--space-1); }
.delivery-quote-result dd { margin: 0; font-variant-numeric: tabular-nums; }
.checkout-remember { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-3); align-items: center; margin-top: var(--space-3); }
.checkout-remember > p { flex: 1 1 20rem; margin: 0; }
.checkout-remember [role="status"]:empty { display: none; }
@media (max-width: 48rem) {
    .delivery-address-fields { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
    .delivery-address-fields > :first-child, .delivery-address-fields > .btn { grid-column: 1 / -1; }
}
