.receipt-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 and /takeaway-settings so the setup
   pages read as one product. Sticky on the header element itself — a direct
   child of the scrolling body, so no wrapper can break it. */
.rs-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%);
}

/* A real control, not a bare link the eye slides past. */
.rs-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;
}

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

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

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

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

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

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

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

  .rs-topbar-title {
    flex: 1 1 100%;
    font-size: 1.1rem;
  }
}
.rs-card {
  border: 1px solid var(--zy-border);
  border-radius: 12px;
  padding: 1rem;
  margin: 1rem 0;
  background: var(--zy-white);
  display: grid;
  gap: 0.75rem;
}
.rs-card label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.9rem;
}
.rs-card label.check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.rs-card label.file input[type='file'] {
  font-size: 0.85rem;
}
.rs-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.format-group {
  border: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}
.logo-preview-wrap {
  text-align: center;
}
.logo-preview {
  max-width: 160px;
  max-height: 80px;
  object-fit: contain;
}
.receipt-preview {
  width: 100%;
  min-height: 280px;
  border: 1px dashed var(--zy-border);
  border-radius: 8px;
  background: #fafafa;
}

/* Card headings were the same weight as body copy, so the stacked cards read
   as one long column with no landmarks. */
.rs-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 and radio rows are targets, not text. */
.rs-card label.check {
  min-height: 2.25rem;
  cursor: pointer;
}

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

/* Inputs inherited the browser default: a size smaller than their own labels,
   and under 16px iOS zooms the page in on focus. */
.rs-card input:not([type='checkbox']):not([type='radio']):not([type='file']),
.rs-card select,
.rs-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;
}

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

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

/* One Save for the whole page — every card here is written by a single save.
   Its own surface, because on the cream page ground a bar with no fill is
   invisible and the button looks as though it floats over the last card. */
.rs-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%);
}

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

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

/* Floating save/error confirmation, dismissable — the page-top banners are
   unreadable from the bottom of a long settings form. */
.rs-toast {
  position: fixed;
  left: 50%;
  top: max(1rem, env(safe-area-inset-top));
  transform: translate(-50%, -160%);
  z-index: 80;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  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;
}

.rs-toast.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
  pointer-events: auto;
}

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

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

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

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

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