.takeaway-settings {
  max-width: 40rem;
  margin: 0 auto;
  /* No top padding: the sticky header bar owns that edge, and padding here
     would leave a gap the page scrolls through behind it. */
  padding: 0 1.25rem 3rem;
}
/* Dark top bar, matching /restaurant-setup so the two read as one product.
   Sticky on the header element itself — a direct child of the scrolling body,
   so no wrapper can break it. Full-bleed past the page's own side padding. */
.ts-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 0 -1.25rem;
  padding: 0.85rem 1.25rem;
  padding-top: max(0.85rem, env(safe-area-inset-top));
  background: var(--zy-emerald-dark, #0b3d35);
  color: var(--zy-ivory, #fbfaf5);
  box-shadow: 0 2px 10px rgb(0 0 0 / 12%);
}

/* Hairline between the way out and the page's own identity. */
.ts-topbar-sep {
  flex: none;
  width: 1px;
  align-self: stretch;
  min-height: 1.75rem;
  background: rgb(255 255 255 / 22%);
}

.ts-topbar-logo {
  flex: none;
  height: 1.4rem;
  width: auto;
  display: block;
}

/* A real control, not a bare link the eye slides past. */
.ts-topbar-back {
  flex: none;
  display: inline-flex;
  align-items: center;
  min-height: 2.25rem;
  padding: 0 0.75rem;
  border: 1px solid rgb(255 255 255 / 45%);
  border-radius: 999px;
  color: var(--zy-ivory, #fbfaf5);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}

.ts-topbar-back:hover {
  background: rgb(255 255 255 / 14%);
}

.ts-topbar-title {
  flex: 1 1 12rem;
  margin: 0;
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

/* On a phone the logo and title stack under the back button rather than
   squeezing all three onto one line. */
@media (max-width: 30rem) {
  .ts-topbar {
    gap: 0.6rem 0.75rem;
  }

  .ts-topbar-sep {
    display: none;
  }

  .ts-topbar-title {
    flex: 1 1 100%;
    font-size: 1.1rem;
  }
}

.ts-lead {
  margin: 1rem 0 0;
}

.ts-card {
  border: 1px solid var(--zy-border);
  border-radius: 12px;
  padding: 1rem;
  margin: 1rem 0;
  background: var(--zy-white);
  display: grid;
  gap: 0.75rem;
}
.ts-card label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.9rem;
}
.ts-card label.check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.ts-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.code {
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--zy-ivory);
  padding: 0.75rem;
  border-radius: 8px;
  font-size: 0.8rem;
}
.error {
  color: #991b1b;
  background: #fef2f2;
  padding: 0.75rem;
  border-radius: 8px;
}
.ok {
  color: #065f46;
  background: #ecfdf5;
  padding: 0.75rem;
  border-radius: 8px;
}

/* Upload-your-QR notice. An owner who confirmed their UPI but skipped the QR
   has customers with nothing to scan — that has to look like something to act
   on, not another muted hint. */
.ts-qr-warning[hidden] {
  display: none;
}

.ts-qr-warning {
  margin: 0.5rem 0 0;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--zy-amber-500, #f59e0b);
  border-radius: 8px;
  background: var(--zy-amber-50, #fffbeb);
  color: var(--zy-amber-900, #78350f);
  font-size: 0.9rem;
}

/* Floating save/error confirmation — the page-top banners are unreadable from
   the bottom of a long settings form. */
.ts-toast {
  position: fixed;
  left: 50%;
  top: max(1rem, env(safe-area-inset-top));
  transform: translate(-50%, -160%);
  z-index: 80;
  max-width: min(30rem, calc(100vw - 2rem));
  padding: 0.7rem 1rem;
  border-radius: 8px;
  background: #1f231d;
  color: #fff;
  font-size: 0.9rem;
  line-height: 1.4;
  box-shadow: 0 10px 30px rgb(0 0 0 / 18%);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
  pointer-events: none;
}

.ts-toast.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

.ts-toast.is-success {
  background: var(--zy-success, #15803d);
}

.ts-toast.is-error {
  background: var(--zy-error, #b91c1c);
}

@media (prefers-reduced-motion: reduce) {
  .ts-toast {
    transition: opacity 0.2s ease;
  }
}

/* ── Restaurant UPI: two numbered steps ──────────────────────────────── */
.ts-step + .ts-step {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--zy-slate-200, #e2e8f0);
}

.ts-step-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

.ts-step-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  flex: none;
  border-radius: 50%;
  background: var(--zy-emerald, #0f766e);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
}

/* The paste-a-link shortcut. Collapsed by default so the normal path (type the
   VPA) is what the card leads with. */
.ts-hint {
  margin: 0.5rem 0;
  padding: 0.5rem 0.75rem;
  border: 1px dashed var(--zy-slate-300, #cbd5e1);
  border-radius: 8px;
}

.ts-hint > summary {
  cursor: pointer;
  font-size: 0.9rem;
}

.ts-hint[open] > summary {
  margin-bottom: 0.5rem;
}

/* Dismissable toast — message plus its own close control. */
.ts-toast {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  pointer-events: none;
}

.ts-toast.is-visible {
  pointer-events: auto;
}

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

.ts-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;
}

.ts-toast-close:hover {
  background: rgb(255 255 255 / 32%);
}

/* Uploaded QR preview. An owner uploads a full-resolution phone screenshot, so
   without a cap the image ran off the card and gave the page a horizontal
   scrollbar. Boxed, capped, and removable in place. */
.ts-qr-preview[hidden] {
  display: none;
}

.ts-qr-preview {
  position: relative;
  display: inline-block;
  max-width: 240px;
  margin: 0.75rem 0 0;
  padding: 0.5rem;
  border: 1px solid var(--zy-slate-200, #e2e8f0);
  border-radius: 8px;
  background: #fff;
  text-align: center;
}

.ts-qr-preview img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 240px;
  object-fit: contain;
  border-radius: 4px;
}

.ts-qr-preview figcaption {
  margin-top: 0.4rem;
}

.ts-qr-remove {
  position: absolute;
  top: -0.6rem;
  right: -0.6rem;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: 1px solid var(--zy-slate-300, #cbd5e1);
  border-radius: 50%;
  background: #fff;
  color: var(--zy-error, #b91c1c);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 6px rgb(0 0 0 / 12%);
}

.ts-qr-remove:hover {
  background: var(--zy-error, #b91c1c);
  color: #fff;
}

/* One Save for the whole page — every card here is written by a single PATCH.
   Sticky so it is reachable from any card without scrolling to an end. */
/* Its own surface: on the cream page ground the bar was invisible and the
   button looked as though it floated over the last card. */
.ts-savebar {
  position: sticky;
  bottom: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 1rem -1.25rem 0;
  padding: 0.85rem 1.25rem;
  padding-bottom: max(0.85rem, env(safe-area-inset-bottom));
  background: var(--zy-white, #fff);
  border-top: 2px solid var(--zy-emerald-dark, #0b3d35);
  box-shadow: 0 -6px 20px rgb(11 61 53 / 12%);
}

.ts-savebar-note {
  flex: 1 1 14rem;
  font-size: 0.85rem;
  color: var(--zy-text-muted, #64748b);
}

.ts-savebar .btn {
  flex: none;
  min-width: 10rem;
}

/* Card headings were the same weight as body copy, so six stacked cards read
   as one long column with no landmarks. */
.ts-card h2 {
  margin: 0;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--zy-slate-200, #e2e8f0);
  font-size: 1.05rem;
  font-weight: 600;
}

/* Checkbox rows are targets, not text — give them a row's worth of height. */
.ts-card label.check {
  min-height: 2.25rem;
  cursor: pointer;
}

.ts-card label.check input {
  width: 1.05rem;
  height: 1.05rem;
  flex: none;
  accent-color: var(--zy-emerald-dark, #0b3d35);
}

/* Inputs inherited the browser default, which is a size smaller than the
   labels above them and triggers zoom-on-focus at 16px on iOS. */
.ts-card input:not([type='checkbox']):not([type='file']),
.ts-card select,
.ts-card textarea {
  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;
}

.ts-card textarea {
  min-height: 4.5rem;
  resize: vertical;
}

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