:root {
  --ink: #22211f;
  --muted: #807c74;
  --cream: #f6f0e5;
  --paper: #fffdf8;
  --line: #e9e2d7;
  --coral: #ef6f52;
  --coral-dark: #db593e;
  --green: #173a31;
  --yellow: #ffdd2d;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--cream);
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

body.modal-open {
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(239, 111, 82, 0.32);
  outline-offset: 3px;
}

.site-shell {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(500px, 0.94fr);
  overflow: hidden;
}

.story-panel {
  position: relative;
  z-index: 2;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: clamp(34px, 5vw, 72px) clamp(38px, 6vw, 94px) 40px;
  background:
    radial-gradient(circle at 12% 12%, rgba(255, 255, 255, 0.82) 0 5%, transparent 18%),
    linear-gradient(145deg, #f9f4ea 0%, #efe5d5 100%);
}

.story-panel::after {
  content: "";
  position: absolute;
  width: 330px;
  height: 330px;
  right: -180px;
  bottom: 9%;
  border: 1px solid rgba(23, 58, 49, 0.12);
  border-radius: 50%;
  box-shadow: 0 0 0 44px rgba(23, 58, 49, 0.025), 0 0 0 88px rgba(23, 58, 49, 0.018);
  pointer-events: none;
}

.story-topline,
.mini-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.22em;
}

.brand-mark,
.mini-brand > span {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: #fff7e8;
  font-size: 18px;
  letter-spacing: 0;
}

.story-copy {
  width: min(580px, 100%);
  margin: auto 0;
  padding: 56px 0 44px;
}

.eyebrow,
.modal-eyebrow {
  margin: 0 0 16px;
  color: var(--coral-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.story-copy h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(56px, 7.4vw, 108px);
  font-weight: 500;
  line-height: 0.87;
  letter-spacing: -0.065em;
}

.story-lead {
  width: min(465px, 100%);
  margin: 30px 0 0;
  color: #57534d;
  font-size: 18px;
  line-height: 1.6;
}

.steps-list {
  width: min(455px, 100%);
  margin: 42px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 18px;
}

.steps-list li {
  display: grid;
  grid-template-columns: 40px 1fr;
  align-items: start;
  gap: 17px;
}

.steps-list li > span {
  padding-top: 4px;
  border-top: 1px solid rgba(34, 33, 31, 0.32);
  color: var(--coral-dark);
  font: 700 11px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.steps-list p {
  margin: 0;
  color: #767169;
  font-size: 14px;
  line-height: 1.45;
}

.steps-list strong {
  display: block;
  margin-bottom: 2px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
}

.qr-card {
  position: relative;
  width: min(438px, 100%);
  display: grid;
  grid-template-columns: 132px 1fr 28px;
  align-items: center;
  gap: 17px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 21px;
  background:
    radial-gradient(circle at 94% 12%, rgba(239, 111, 82, 0.24), transparent 25%),
    var(--green);
  color: #fff9ef;
  backdrop-filter: blur(12px);
  box-shadow: 0 16px 40px rgba(23, 58, 49, 0.16);
  overflow: hidden;
}

.qr-code-link {
  position: relative;
  z-index: 1;
  width: 132px;
  height: 132px;
  display: block;
  padding: 5px;
  border: 1px solid rgba(239, 111, 82, 0.76);
  border-radius: 16px;
  background: #fffdf8;
  box-shadow: 0 9px 24px rgba(0, 0, 0, 0.22);
  transform: rotate(-1.2deg);
  transition: transform 180ms ease;
}

.qr-code-link:hover {
  transform: rotate(0deg) scale(1.02);
}

.qr-code-link img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  image-rendering: pixelated;
}

.qr-copy {
  position: relative;
  z-index: 1;
}

.qr-kicker {
  display: flex !important;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  color: #f6b5a5 !important;
  font-size: 9px !important;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.qr-kicker i {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--coral);
  color: white;
  font-size: 11px;
  font-style: normal;
  letter-spacing: 0;
}

.qr-card strong,
.qr-card > div > span {
  display: block;
}

.qr-card strong {
  margin-bottom: 4px;
  font-size: 14px;
}

.qr-card > div > span {
  color: rgba(255, 249, 239, 0.62);
  font-size: 12px;
}

.qr-card .arrow {
  position: relative;
  z-index: 1;
  color: #f6b5a5;
  font-size: 24px;
}

.app-stage {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 30px;
  background: var(--green);
  overflow-y: auto;
}

.app-stage::before {
  content: "";
  position: fixed;
  inset: 0 0 0 50%;
  opacity: 0.15;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.38) 1px, transparent 1px);
  background-size: 22px 22px;
  pointer-events: none;
}

.ambient-shape {
  position: absolute;
  border: 1px solid rgba(255, 245, 225, 0.12);
  border-radius: 999px;
  pointer-events: none;
}

.shape-one {
  width: 280px;
  height: 560px;
  top: -240px;
  right: -50px;
  transform: rotate(35deg);
}

.shape-two {
  width: 250px;
  height: 470px;
  bottom: -260px;
  left: -70px;
  transform: rotate(-28deg);
}

.phone-card {
  position: relative;
  z-index: 2;
  width: min(448px, 100%);
  max-height: calc(100svh - 60px);
  overflow-y: auto;
  scrollbar-width: none;
  border: 7px solid rgba(255, 255, 255, 0.12);
  border-radius: 36px;
  background: var(--paper);
  box-shadow: 0 38px 100px rgba(0, 0, 0, 0.32);
}

.phone-card::-webkit-scrollbar {
  display: none;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px 15px;
  background: rgba(255, 253, 248, 0.92);
  backdrop-filter: blur(14px);
}

.mini-brand {
  color: var(--green);
  font-size: 10px;
  text-decoration: none;
}

.mini-brand > span {
  width: 26px;
  height: 26px;
  font-size: 14px;
}

.table-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #615d56;
  font-size: 11px;
  font-weight: 700;
}

.table-pill span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #47a278;
  box-shadow: 0 0 0 3px rgba(71, 162, 120, 0.12);
}

.welcome-block {
  padding: 22px 22px 24px;
  background:
    radial-gradient(circle at 88% 18%, rgba(239, 111, 82, 0.16), transparent 28%),
    linear-gradient(180deg, #fffaf1, var(--paper));
}

.welcome-block p {
  margin: 0 0 6px;
  color: var(--coral-dark);
  font-size: 12px;
  font-weight: 700;
}

.welcome-block h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 34px;
  font-weight: 500;
  letter-spacing: -0.04em;
}

.form-content {
  padding: 8px 22px 0;
}

.form-section {
  padding: 18px 0;
}

.section-heading {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 11px;
  align-items: start;
  margin-bottom: 16px;
}

.step-number {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--green);
  color: white;
  font-size: 11px;
  font-weight: 800;
}

.section-heading h3 {
  margin: 0 0 2px;
  font-size: 15px;
  line-height: 1.35;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.waiter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.waiter-card {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease, background 180ms ease;
}

.waiter-card:hover {
  transform: translateY(-2px);
  border-color: #cfc5b8;
  box-shadow: 0 8px 20px rgba(34, 33, 31, 0.07);
}

.waiter-card.selected {
  border-color: var(--coral);
  background: #fff8f5;
  box-shadow: 0 0 0 2px rgba(239, 111, 82, 0.1);
}

.avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: rgba(34, 33, 31, 0.72);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  box-shadow: inset 0 -8px 20px rgba(255, 255, 255, 0.25);
}

.avatar-lilac { background: #dcd3ef; }
.avatar-mint { background: #c8e2d8; }
.avatar-peach { background: #f1cfba; }
.avatar-sky { background: #cbdde8; }

.waiter-copy {
  min-width: 0;
}

.waiter-copy strong,
.waiter-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.waiter-copy strong {
  font-size: 13px;
}

.waiter-copy small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.checkmark {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--coral);
  color: white;
  font-size: 10px;
  font-weight: 900;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 160ms ease, transform 160ms ease;
}

.waiter-card.selected .checkmark {
  opacity: 1;
  transform: scale(1);
}

.soft-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line) 12%, var(--line) 88%, transparent);
}

.amount-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.amount-chip {
  min-height: 42px;
  padding: 7px 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: #4c4944;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
  transition: 160ms ease;
}

.amount-chip:hover,
.amount-chip.active {
  border-color: var(--green);
  background: var(--green);
  color: white;
  transform: translateY(-1px);
}

.custom-field {
  display: grid;
  grid-template-columns: 1fr 116px;
  align-items: center;
  gap: 12px;
  margin-top: 9px;
  padding: 7px 8px 7px 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.custom-field.active,
.custom-field:focus-within {
  border-color: var(--coral);
  box-shadow: 0 0 0 2px rgba(239, 111, 82, 0.08);
}

.custom-field > label {
  color: #5e5a54;
  font-size: 12px;
  font-weight: 650;
}

.input-wrap {
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr 20px;
  align-items: center;
  padding: 4px 7px 4px 10px;
  border-radius: 9px;
  background: #f5f1e9;
}

.input-wrap input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  text-align: right;
  -moz-appearance: textfield;
}

.input-wrap input::-webkit-outer-spin-button,
.input-wrap input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.input-wrap span {
  color: #6e6a64;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.field-hint {
  margin: 6px 3px 0;
  color: #a09a92;
  font-size: 9px;
  text-align: right;
}

.commission-service {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 13px;
  padding: 9px 3px 8px;
  border-bottom: 1px solid var(--line);
}

.commission-service-copy strong {
  display: block;
}

.commission-service-copy strong {
  color: #625e58;
  font-size: 10px;
  line-height: 1.3;
}

.commission-service-value {
  flex: 0 0 auto;
  color: var(--green);
  font-size: 11px;
}

.commission-checkbox {
  display: grid;
  grid-template-columns: 19px 1fr;
  align-items: start;
  gap: 9px;
  margin-top: 8px;
  padding: 2px 3px 0;
  cursor: pointer;
}

.commission-checkbox input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.checkbox-mark {
  width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  border: 1px solid #cfc7bc;
  border-radius: 6px;
  background: #fff;
  color: transparent;
  font-size: 11px;
  font-weight: 900;
  transition: 160ms ease;
}

.commission-checkbox input:checked + .checkbox-mark {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
  box-shadow: 0 0 0 3px rgba(23, 58, 49, 0.08);
}

.commission-checkbox input:focus-visible + .checkbox-mark {
  outline: 3px solid rgba(239, 111, 82, 0.32);
  outline-offset: 2px;
}

.checkbox-copy strong,
.checkbox-copy small {
  display: block;
}

.checkbox-copy strong {
  margin-bottom: 2px;
  color: #5e5a54;
  font-size: 9px;
  line-height: 1.35;
}

.checkbox-copy small {
  color: #9a948b;
  font-size: 8px;
  line-height: 1.35;
}

.checkout-area {
  position: sticky;
  bottom: 0;
  z-index: 5;
  padding: 15px 22px 20px;
  background: rgba(255, 253, 248, 0.94);
  border-top: 1px solid rgba(233, 226, 215, 0.8);
  backdrop-filter: blur(14px);
}

.checkout-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.checkout-summary span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-copy,
.summary-total {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.summary-copy small,
.summary-total small {
  overflow: hidden;
  color: #a09a92;
  font-size: 8px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-total {
  flex: 0 0 auto;
  text-align: right;
}

.checkout-summary strong {
  flex: 0 0 auto;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-weight: 600;
}

.pay-button,
.bank-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 17px;
  border: 0;
  border-radius: 14px;
  background: var(--coral);
  color: white;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 9px 24px rgba(219, 89, 62, 0.24);
  transition: transform 160ms ease, background 160ms ease, opacity 160ms ease;
}

.pay-button:hover:not(:disabled),
.bank-button:hover {
  transform: translateY(-1px);
  background: var(--coral-dark);
}

.pay-button:disabled {
  background: #d7d1c8;
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.7;
}

.pay-button span,
.bank-button span {
  font-size: 19px;
  line-height: 1;
}

.secure-note {
  margin: 8px 0 0;
  color: #989188;
  font-size: 9px;
  text-align: center;
}

.secure-note span {
  color: #e0b800;
  font-size: 8px;
}

.modal-backdrop {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(20, 29, 26, 0.74);
  backdrop-filter: blur(10px);
  animation: fade-in 180ms ease-out;
}

.checkout-modal {
  position: relative;
  width: min(420px, 100%);
  padding: 35px;
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.3);
  animation: modal-up 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #f3f1ed;
  color: #5f5b55;
  font-size: 22px;
  cursor: pointer;
}

.bank-badge {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin-bottom: 22px;
  border-radius: 16px;
  background: var(--yellow);
  color: #171717;
  font-size: 26px;
  font-weight: 900;
}

.modal-eyebrow {
  margin-bottom: 9px;
  color: #8b857e;
  font-size: 10px;
}

.checkout-modal h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 30px;
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.modal-description,
.success-state > p:not(.modal-eyebrow) {
  margin: 15px 0 22px;
  color: #6e6963;
  font-size: 13px;
  line-height: 1.6;
}

.receipt-person {
  margin: 0 0 6px;
  color: #5f5a54;
  font-size: 12px;
  font-weight: 750;
}

.receipt-breakdown {
  margin-bottom: 14px;
  padding: 15px 0;
  border-top: 1px solid #ece8e0;
  border-bottom: 1px solid #ece8e0;
}

.receipt-breakdown > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 4px 0;
}

.receipt-breakdown span {
  color: #6e6963;
  font-size: 11px;
}

.receipt-breakdown strong {
  flex: 0 0 auto;
  font-size: 12px;
}

.receipt-breakdown .receipt-total {
  margin-top: 7px;
  padding-top: 10px;
  border-top: 1px dashed #dcd5ca;
}

.receipt-total span,
.receipt-total strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
}

.bank-button {
  background: var(--yellow);
  color: #161616;
  box-shadow: none;
}

.bank-button:hover {
  background: #f3cd00;
}

.checkout-modal > small,
.checkout-modal #handoff-state > small {
  display: block;
  margin-top: 10px;
  color: #99938c;
  font-size: 9px;
  text-align: center;
}

.success-state {
  padding: 12px 0 0;
  text-align: center;
}

.success-orbit {
  position: relative;
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  margin: 0 auto 26px;
  border-radius: 50%;
  background: #e3f3eb;
  color: var(--green);
}

.success-orbit > span {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: white;
  font-size: 25px;
  box-shadow: 0 8px 24px rgba(23, 58, 49, 0.22);
}

.success-orbit i {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: var(--coral);
}

.confetti-one { top: 0; right: 5px; transform: rotate(25deg); }
.confetti-two { bottom: 3px; left: 4px; background: var(--yellow) !important; transform: rotate(-20deg); }
.confetti-three { top: 15px; left: -4px; background: #8f7cc1 !important; border-radius: 50% !important; }

.success-state .modal-eyebrow {
  margin-bottom: 8px;
  color: #3e8667;
}

.success-state > p:not(.modal-eyebrow) {
  margin-bottom: 15px;
}

.success-amount {
  margin: 0 0 22px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 32px;
}

.success-total-label {
  display: block;
  margin-bottom: 3px;
  color: #99938c;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.11em;
}

.bank-button.dark {
  justify-content: center;
  background: var(--green);
  color: white;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modal-up {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 1050px) {
  .site-shell {
    grid-template-columns: minmax(360px, 0.85fr) minmax(470px, 1fr);
  }

  .story-panel {
    padding-inline: 42px;
  }

  .story-copy h1 {
    font-size: 68px;
  }
}

@media (max-width: 820px) {
  .site-shell {
    display: block;
    overflow: visible;
  }

  .story-panel {
    display: none;
  }

  .app-stage {
    min-height: 100svh;
    display: block;
    padding: 0;
    background: var(--paper);
  }

  .app-stage::before,
  .ambient-shape {
    display: none;
  }

  .phone-card {
    width: 100%;
    min-height: 100svh;
    max-height: none;
    overflow: visible;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .app-header {
    padding-top: max(18px, env(safe-area-inset-top));
  }

  .checkout-area {
    padding-bottom: max(18px, env(safe-area-inset-bottom));
  }
}

@media (max-width: 390px) {
  .app-header,
  .welcome-block,
  .form-content,
  .checkout-area {
    padding-left: 17px;
    padding-right: 17px;
  }

  .welcome-block h2 {
    font-size: 31px;
  }

  .waiter-card {
    grid-template-columns: 38px 1fr;
    gap: 7px;
    padding: 8px;
  }

  .avatar {
    width: 38px;
    height: 38px;
  }

  .amount-chip {
    font-size: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
