.takeaway-app {
  max-width: 52rem;
  margin: 0 auto;
  padding: 1rem;
}
/* The real mark, matching the Hub's other screens. */
.tw-brand-logo {
  display: block;
  height: 1.35rem;
  width: auto;
  /* Centred: the mark is the page's masthead, not a corner label. */
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 0.5rem;
}
.tw-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}
.tw-list li {
  border: 1px solid var(--zy-border);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  background: var(--zy-white);
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
}
.tw-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.cart {
  margin-top: 1.5rem;
  border: 1px solid var(--zy-border);
  border-radius: 12px;
  padding: 1rem;
  background: var(--zy-white);
}
.cart-lines {
  list-style: none;
  padding: 0;
}
.status-card {
  border: 1px solid var(--zy-border);
  border-radius: 12px;
  padding: 1.25rem;
  background: var(--zy-white);
}
.pickup-status {
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--zy-border);
}
.pickup-order-no {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.pickup-token-no {
  margin: 0;
  font-size: clamp(1.75rem, 8vw, 2.5rem);
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  color: var(--zy-emerald, #0f6b5c);
}
.status-pill {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: var(--zy-gold-soft);
  font-weight: 600;
  font-size: 0.85rem;
}
.btn.wide[hidden] {
  display: none;
}
.btn.wide {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 0.5rem;
}
.error {
  color: #991b1b;
  background: #fef2f2;
  padding: 0.75rem;
  border-radius: 8px;
}
.menu {
  display: grid;
  gap: 0.75rem;
}
/* Card surface, matching order.css — a hairline-separated row left the name,
   price and stepper merging into the ivory page ground. */
.menu-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: var(--zy-space-3);
  background: var(--zy-white);
  border: 1px solid var(--zy-border);
  border-radius: var(--zy-radius-md);
  box-shadow: var(--zy-shadow-sm);
}
.menu-item .qty {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
/* Inverted against the card: white-on-white had no visible edge. */
.menu-item .qty button {
  min-width: 2.25rem;
  min-height: 2.25rem;
  padding: 0;
  background: var(--zy-ivory);
  border: 1px solid var(--zy-border);
  border-radius: var(--zy-radius-md);
  font-size: var(--zy-text-lg);
  font-weight: var(--zy-weight-semibold);
  line-height: 1;
}
.menu-item .qty button:not([disabled]):active {
  background: var(--zy-emerald-soft);
}
.menu-item .qty span {
  min-width: 1.25rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.mode-actions {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}
.mode-actions .btn {
  text-align: left;
  padding: 1rem 1.1rem;
}
.mode-actions .btn strong {
  display: block;
}
.mode-actions .btn span {
  display: block;
  font-size: 0.85rem;
  opacity: 0.8;
  font-weight: 400;
}
.delivery-fields[hidden] {
  display: none;
}
.delivery-fields {
  border: 1px solid var(--zy-border);
  border-radius: 12px;
  padding: 0.85rem;
  margin-bottom: 1rem;
  display: grid;
  gap: 0.5rem;
  background: var(--zy-white);
}
.pay-evidence[hidden] {
  display: none;
}
.pay-evidence {
  display: grid;
  gap: 0.5rem;
  margin: 0.75rem 0;
}
#pay-upi-qr-image[hidden] {
  display: none;
}
#pay-upi-qr-image {
  display: block;
  max-width: 220px;
  margin: 0.75rem auto;
  border: 1px solid var(--zy-slate-200, #e2e8f0);
  border-radius: 8px;
  background: #fff;
  padding: 0.5rem;
}

/* The no-UPI-app route, matching the dine-in /order screen so the two read as
   one flow. A real button, not fine print — it is the whole payment path on a
   phone with no UPI app. Hidden until the guest asks for it. */
.pay-qr-toggle {
  display: block;
  width: 100%;
  margin: 0.5rem 0 0;
  padding: 0.65rem 1rem;
  min-height: 2.75rem;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--zy-emerald, #0f766e);
  color: var(--zy-emerald, #0f766e);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.pay-qr-toggle[hidden] {
  display: none;
}

.pay-upi-qr-block[hidden] {
  display: none;
}

.pay-upi-qr-block {
  display: grid;
  gap: 0.5rem;
  justify-items: center;
  margin-top: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--zy-slate-200, #e2e8f0);
  border-radius: 8px;
  background: #fff;
  text-align: center;
}

.pay-upi-id[hidden] {
  display: none;
}

.pay-upi-id {
  display: grid;
  gap: 4px;
  justify-items: center;
  margin: 0;
}

.pay-upi-id-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.pay-upi-id-row strong {
  word-break: break-all;
}

.pay-upi-copy {
  flex: none;
  min-height: 2rem;
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--zy-emerald, #0f766e);
  border-radius: 6px;
  background: #fff;
  color: var(--zy-emerald, #0f766e);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.track-steps {
  padding-left: 1.25rem;
  margin: 0.75rem 0;
}
.track-steps li.done {
  color: #065f46;
}
.track-steps li.current {
  font-weight: 600;
}

/* Sticky reachable cart while browsing the menu — mirrors order.css. */
.cart-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--zy-space-3);
  padding: var(--zy-space-3) var(--zy-space-4);
  padding-bottom: max(var(--zy-space-3), env(safe-area-inset-bottom));
  background: var(--zy-white);
  border-top: 1px solid var(--zy-border);
  box-shadow: 0 -4px 16px rgb(0 0 0 / 8%);
}

.cart-bar[hidden] {
  display: none;
}

.cart-bar-info {
  display: flex;
  flex-direction: column;
  line-height: var(--zy-leading-tight);
  font-size: var(--zy-text-sm);
}

.cart-bar-info strong {
  font-size: var(--zy-text-md);
}

/* Room for the fixed bar so it never covers the last dish. */
#view-menu {
  padding-bottom: max(7rem, env(safe-area-inset-bottom));
}

/* Back controls: emerald on white, same as the order page's "Change order
   type". The shared `.btn.ghost` is transparent with a hairline border, which
   merged into the ivory page ground exactly like the menu rows did. */
#btn-back-list,
#btn-back-home,
#btn-back-home-2,
#btn-back-pay {
  display: inline-flex;
  align-items: center;
  gap: var(--zy-space-1);
  margin: var(--zy-space-2) 0 var(--zy-space-4);
  padding: var(--zy-space-2) var(--zy-space-3);
  min-height: 2.5rem;
  background: var(--zy-emerald);
  border: 1px solid var(--zy-emerald);
  border-radius: var(--zy-radius-md);
  color: var(--zy-white);
  font-size: var(--zy-text-sm);
  font-weight: var(--zy-weight-semibold);
  white-space: nowrap;
}

#btn-back-list:active,
#btn-back-home:active,
#btn-back-home-2:active,
#btn-back-pay:active {
  background: var(--zy-emerald-deep);
  border-color: var(--zy-emerald-deep);
}

/* Cart lines with steppers + Remove — mirrors order.css. */
.cart-lines li.cart-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--zy-space-1) var(--zy-space-3);
  align-items: center;
  padding: var(--zy-space-2) 0;
  border-bottom: 1px solid var(--zy-border);
}

.cart-line-name {
  font-weight: var(--zy-weight-medium);
}

.cart-line-price {
  text-align: right;
  white-space: nowrap;
}

.cart-line-qty {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: var(--zy-space-2);
}

.cart-line-qty button {
  border: 1px solid var(--zy-border);
  background: var(--zy-white);
  min-width: 2.25rem;
  min-height: 2.25rem;
  border-radius: var(--zy-radius-md);
  font: inherit;
  color: var(--zy-charcoal);
  cursor: pointer;
}

.cart-line-qty .link-remove {
  border: 0;
  background: none;
  min-width: 0;
  margin-left: auto;
  padding: 0.25rem;
  color: var(--zy-error);
  font-size: var(--zy-text-xs);
  text-decoration: underline;
}

.cart-lines .cart-empty {
  color: var(--zy-text-muted);
}

/* Reserve form — say plainly which fields the restaurant needs. */

/* The booking form is one task, so it gets one card. Without a border it ran
   edge to edge and read as loose fields floating on the page. */
.tw-reserve-card {
  border: 1px solid rgba(15, 61, 58, 0.16);
  border-radius: 16px;
  background: #fff;
  padding: 16px 14px 14px;
  margin-top: 12px;
  box-shadow: 0 1px 2px rgba(15, 61, 58, 0.05);
}

.tw-reserve-card > label:last-of-type {
  margin-bottom: 0.5rem;
}

/* The host styles bare `label` as a grid, so a loose <span> inside became its
   own row and pushed the asterisk under the label text. Keeping the text and
   its marker in one span keeps them on one line. */
.tw-label {
  display: block;
  margin-bottom: 0.35rem;
}

.tw-time-parts {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tw-time-parts select {
  flex: 0 1 auto;
  width: auto;
  min-width: 0;
}

.tw-time-sep {
  font-weight: 700;
  opacity: 0.55;
}

.tw-ampm {
  display: inline-flex;
  margin-left: 2px;
  border: 1px solid var(--line, rgba(15, 61, 58, 0.28));
  border-radius: 12px;
  overflow: hidden;
  flex: 0 0 auto;
}

.tw-ampm-btn {
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 0 12px;
  min-height: 46px;
  border: 0;
  background: #fff;
  color: inherit;
  cursor: pointer;
}

.tw-ampm-btn + .tw-ampm-btn {
  border-left: 1px solid var(--line, rgba(15, 61, 58, 0.28));
}

.tw-ampm-btn.is-on {
  background: #0f3d3a;
  color: #fff;
}

.tw-when-summary {
  margin: -0.5rem 0 0.9rem;
  font-size: 12px;
  font-weight: 600;
  opacity: 0.75;
}

.tw-when-summary.bad {
  color: #a02020;
  opacity: 1;
}

.tw-req,
.tw-opt {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-left: 4px;
}

.tw-req {
  color: #a02020;
  font-weight: 700;
}

/* Key to the asterisks — an unexplained * is not an accessible label. */
.tw-req-note {
  margin: -0.3rem 0 0.9rem;
  font-size: 12px;
  opacity: 0.7;
}

.tw-opt {
  color: inherit;
  font-weight: 500;
  opacity: 0.65;
}

#reserve-msg.bad {
  color: #a02020;
  font-weight: 600;
}

/* Guest-page toast — floats above the fold so a form error is never missed. */
#tw-toast-host {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(92vw, 420px);
  /* The host spans the width of the screen and must not swallow taps meant for
     the page behind it — but the toast itself has a dismiss button, and with
     pointer-events off on the host and never restored anywhere, every click on
     that X went straight through to whatever was underneath. The rectangle that
     is actually a toast takes its events back below. */
  pointer-events: none;
}

.tw-toast-text {
  flex: 1 1 auto;
}

.tw-toast-close {
  flex: none;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgb(255 255 255 / 18%);
  color: inherit;
  font: inherit;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.tw-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: #0f3d3a;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  animation: tw-toast-in 160ms ease-out;
}

.tw-toast.bad {
  background: #a02020;
}

@keyframes tw-toast-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
}

/* The offending field, marked and focused when validation fails. */
#view-reserve .is-invalid {
  border-color: #a02020 !important;
  box-shadow: 0 0 0 2px rgba(160, 32, 32, 0.16);
}

/* Guest-facing fields were browser-default: smaller than the labels above them,
   and under 16px iOS zooms the whole page in on focus. */
.takeaway-app input:not([type='checkbox']):not([type='file']),
.takeaway-app textarea,
.takeaway-app select {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--zy-slate-300, #cbd5e1);
  border-radius: 8px;
  background: #fff;
  font: inherit;
  font-size: 1rem;
}

.takeaway-app input:focus-visible,
.takeaway-app textarea:focus-visible,
.takeaway-app select:focus-visible {
  outline: 2px solid var(--zy-emerald, #0f766e);
  outline-offset: 1px;
}

/* The reservation time picker sizes its selects to their content and sits them
   in a row; the blanket full-width rule above would stretch each to the row. */
.takeaway-app .tw-time-parts select {
  flex: 0 1 auto;
  width: auto;
  min-width: 0;
}

/* The guest's own booking, above the form. A pending one is waiting on the
   restaurant, so it reads as something in progress rather than a receipt. */
.rv-customer-status {
  margin-bottom: 1rem;
}

.rv-customer-status.needs-attention {
  border-color: var(--zy-amber-500, #f59e0b);
  background: var(--zy-amber-50, #fffbeb);
}

.rv-status-next {
  margin: 0.35rem 0 0.25rem;
  font-weight: 600;
}

#reserve-status-msg {
  margin: 0 0 0.5rem;
  white-space: pre-line;
  color: var(--zy-text-muted, #64748b);
  font-size: 0.9rem;
}

/*
 * Reserve before availability has been checked for the slot now in the form.
 * Reads as unavailable, but stays clickable on purpose — the click is what
 * tells the guest to check first. A `disabled` button would swallow it.
 */
#btn-reserve.is-unarmed {
  opacity: 0.55;
  cursor: not-allowed;
}

/* The phone field's own message, under the input it belongs to. */
.phone-error {
  display: block;
  margin-top: 0.25rem;
  color: var(--danger, #c0392b);
  font-size: 0.8rem;
}
input.is-invalid {
  border-color: var(--danger, #c0392b);
}

/* Country selector beside the phone input — see ui/phone-field.js. */
.phone-country {
  max-width: 11rem;
  margin-bottom: 0.25rem;
}

/* What the restaurant took off this order, and what came back. Reads as a
   record, not an error: the guest has already been dealt with. */
.tw-adjust-list {
  list-style: none;
  margin: var(--zy-space-2) 0 0;
  padding: 0;
  display: grid;
  gap: var(--zy-space-1);
  font-size: var(--zy-text-sm);
}
