:root {
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --line: #d2d2d7;
  --bg: #f5f5f7;
  --card: #ffffff;
  --accent: #0a66c2;
  --accent-soft: #e8f0fb;
  --ok: #1b7f3b;
  --radius: 14px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }
h1, h2, p { margin: 0; }
.muted { color: var(--muted); }

.fact { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 15px; }
.fact svg { flex: none; width: 18px; height: 18px; }

.proto { font-size: 12px; color: var(--muted); letter-spacing: .02em; }

.primary {
  width: 100%; border: 0; border-radius: var(--radius); padding: 16px;
  background: var(--accent); color: #fff; font-size: 17px; font-weight: 600;
}
.primary:disabled { background: var(--line); color: var(--muted); cursor: default; }
.secondary {
  width: 100%; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px;
  background: var(--card); font-size: 16px; font-weight: 600;
}
.secondary:disabled { color: var(--muted); cursor: default; }

.check {
  width: 56px; height: 56px; border-radius: 50%; background: var(--ok); color: #fff;
  display: grid; place-items: center;
}
.check svg { width: 30px; height: 30px; }

/* Phone tip page */
.tip { max-width: 430px; margin: 0 auto; min-height: 100vh; padding: 24px 20px 120px; display: flex; flex-direction: column; gap: 22px; background: var(--card); }
.shop { border-bottom: 1px solid var(--line); padding-bottom: 16px; }
.shop-name { font-weight: 700; font-size: 20px; }
.shop .order { margin-top: 4px; font-size: 16px; }
.shop .paid { margin-top: 2px; color: var(--muted); font-size: 15px; }
.tip h1 { font-size: 26px; }
.tip .sub { margin-top: 4px; color: var(--muted); }
.amounts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.amt, .other {
  border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--card);
  padding: 16px 12px; text-align: center; font-size: 24px; font-weight: 700;
  display: flex; flex-direction: column; gap: 4px; align-items: center;
}
.amt span, .other .total { font-size: 14px; font-weight: 500; color: var(--muted); }
.amt[aria-checked="true"], .other[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset; }
.other-link { margin-top: 12px; border: 0; background: none; color: var(--accent); font-size: 16px; padding: 4px 0; }
.other { margin-top: 12px; }
.stepper { display: flex; align-items: center; gap: 18px; }
.stepper button { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); font-size: 22px; }
.facts { display: grid; gap: 10px; }
.receipt { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 8px; font-size: 16px; }
.receipt div { display: flex; justify-content: space-between; }
.receipt .total { border-top: 1px solid var(--line); padding-top: 8px; font-weight: 700; }
.done { display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.done h1 { font-size: 28px; }
.done .receipt { width: 100%; }
.foot { text-align: center; color: var(--muted); font-size: 14px; display: grid; gap: 6px; }
.bar { position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.96); border-top: 1px solid var(--line); }
.bar .primary { max-width: 390px; margin: 0 auto; display: block; }

/* Counter screen */
.counter-bg { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #2b2b2e; }
.terminal-wrap { width: min(1000px, 100%); }
.terminal { width: 100%; aspect-ratio: 16 / 10; background: var(--card); border-radius: 28px; border: 14px solid #111; overflow: hidden; }
.screen { height: 100%; display: grid; grid-template-columns: 1fr 1fr; }
.screen.center { grid-template-columns: 1fr; place-items: center; align-content: center; gap: 16px; }
.items { padding: 44px; display: flex; flex-direction: column; gap: 14px; border-right: 1px solid var(--line); font-size: 22px; }
.items .line { display: flex; justify-content: space-between; }
.items .line.total { margin-top: auto; border-top: 1px solid var(--line); padding-top: 16px; font-size: 30px; font-weight: 700; }
.reader { border: 0; background: var(--accent-soft); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; font-size: 28px; }
.reader svg { width: 96px; height: 96px; color: var(--accent); }
.reader span { color: var(--muted); font-size: 22px; }
.paid-left { padding: 44px; display: flex; flex-direction: column; gap: 14px; justify-content: center; border-right: 1px solid var(--line); }
.paid-left h1 { font-size: 40px; }
.paid-left p { font-size: 20px; }
.paid-right { padding: 32px 40px; display: flex; flex-direction: column; gap: 12px; justify-content: center; align-items: center; text-align: center; }
.paid-right h2 { font-size: 24px; }
.paid-right p { font-size: 17px; }
.qr { width: 190px; height: 190px; }
.qr a { display: block; width: 100%; height: 100%; }
.qr svg { width: 100%; height: 100%; display: block; }
.row { display: flex; gap: 12px; width: 100%; margin-top: 6px; }
.row .secondary { padding: 12px; font-size: 15px; }
.spinner { width: 48px; height: 48px; border-radius: 50%; border: 5px solid var(--line); border-top-color: var(--accent); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.proto-controls { margin-top: 16px; display: flex; gap: 16px; align-items: center; justify-content: center; color: #bbb; font-size: 13px; }
.proto-controls button { background: none; border: 1px solid #555; color: #ddd; border-radius: 8px; padding: 6px 12px; font-size: 13px; }
.toast { position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 15px; }

/* Cup stickers */
.sheet { max-width: 8.5in; margin: 0 auto; padding: .4in; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .3in; background: #fff; }
.sticker {
  aspect-ratio: 1; min-width: 0; overflow: hidden; border: 1.5px dashed #999; border-radius: 50%; padding: 11%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 4px;
}
.sticker .sname { font-weight: 700; font-size: 13px; }
.sticker .sorder { font-size: 12px; color: var(--muted); }
.sticker .qr { width: 52%; height: auto; aspect-ratio: 1; margin: 4px 0; }
.sticker .scta { font-weight: 700; font-size: 12px; }
.sticker .snote { font-size: 10px; color: var(--muted); }
.print-bar { max-width: 8.5in; margin: 16px auto; display: flex; gap: 12px; align-items: center; padding: 0 .4in; }
.print-bar .primary { width: auto; padding: 10px 18px; font-size: 15px; }
.print-note { display: none; grid-column: 1 / -1; font-size: 11px; color: var(--muted); }
@media print {
  @page { size: A4; margin: 12mm; }
  .print-bar { display: none; }
  body { background: #fff; }
  .sheet { max-width: none; padding: 0; gap: 8mm; grid-template-columns: repeat(3, 54mm); justify-content: center; }
  .sticker { width: 54mm; height: 54mm; aspect-ratio: auto; padding: 6mm; gap: .8mm; }
  .sticker .sname { font-size: 9pt; }
  .sticker .sorder { font-size: 8pt; }
  .sticker .qr { width: 24mm; height: 24mm; margin: 1mm 0; }
  .sticker .scta { font-size: 7.5pt; }
  .sticker .snote { font-size: 6.5pt; }
  .print-note { display: block; }
}

/* Reminder text */
.lock { min-height: 100vh; max-width: 430px; margin: 0 auto; background: linear-gradient(160deg, #3a4a6b, #1d2433); color: #fff; padding: 64px 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.lock .time { font-size: 72px; font-weight: 300; }
.lock .date { font-size: 18px; opacity: .85; margin-bottom: 32px; }
.note { width: 100%; background: rgba(255,255,255,.88); color: var(--ink); border-radius: 20px; padding: 14px 16px; display: grid; gap: 4px; text-decoration: none; }
.note .meta { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.note .who { font-weight: 700; font-size: 16px; }
.note .msg { font-size: 16px; }
.note .link { color: var(--accent); font-size: 15px; word-break: break-all; }

/* Index */
.index { max-width: 640px; margin: 0 auto; padding: 40px 20px; display: grid; gap: 14px; }
.index a { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; color: var(--ink); text-decoration: none; }
.index a strong { display: block; font-size: 18px; }
.index a span { color: var(--muted); }
