@import url("https://fonts.googleapis.com/css2?family=Newsreader:opsz,wght@6..72,300;6..72,400;6..72,500&family=Public+Sans:wght@400;500;600&display=swap");

:root {
  --field: #aec7cb;      /* powder blue: the till surface */
  --field-deep: #93b2b7;
  --paper: #fbf6ee;
  --cream: #f7eee1;
  --stone: #e7e5db;
  --line: #d9cfbf;
  --ink: #4c3b2a;
  --ink-soft: #6b5c4c;
  --umber: #2e241a;
  --umber-2: #3d3024;
  --on-umber: #f7eee1;
  --on-umber-soft: #d9cdbb;
  --bronze: #9a744f;
  --bronze-light: #c79f72;
  --bronze-deep: #6e5034;
  --bronze-ink: #7a5a3a;
  --alert: #8a3b2a;
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r-sm: 6px;
  --r-md: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--bronze-ink); }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.sim {
  background: var(--umber);
  color: var(--on-umber-soft);
  font-size: 14px;
  padding: 8px 16px;
  text-align: center;
}
.sim strong { color: var(--on-umber); font-weight: 600; }

.top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px 24px;
}
.wordmark { font-family: var(--serif); font-weight: 500; font-size: 22px; text-decoration: none; color: var(--ink); }
.top nav { display: flex; gap: 18px; flex-wrap: wrap; font-size: 15px; }
.top nav a, .linkbtn { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; background: none; border: 0; padding: 0; cursor: pointer; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 22px;
  border-radius: var(--r-sm); border: 1px solid var(--ink);
  background: var(--ink); color: var(--cream);
  font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--umber); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.quiet { background: transparent; color: var(--ink); }
.btn.quiet:hover { background: rgba(76, 59, 42, .08); }
.btn.wide { width: 100%; }

.amount {
  font-family: var(--serif);
  font-weight: 300;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: lining-nums tabular-nums;
}

.muted { color: var(--ink-soft); }
.small { font-size: 14px; }
.hidden { display: none !important; }

/* The paid seal: the one orchestrated moment. */
.seal {
  width: 120px; height: 120px; border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, var(--bronze-light), var(--bronze) 45%, var(--bronze-deep));
  box-shadow: inset 0 1px 0 rgba(255,240,215,.35), inset 0 -2px 3px rgba(46,36,26,.35), 0 14px 28px rgba(46,36,26,.28);
  color: #140d07; font-family: var(--serif); font-size: 26px; font-weight: 500;
}
.seal span { border: 1.5px solid rgba(20,13,7,.5); border-radius: 50%; width: 96px; height: 96px; display: grid; place-items: center; }
.stamp { animation: stamp 420ms cubic-bezier(.2,.9,.3,1.2) both; }
@keyframes stamp {
  from { transform: scale(1.35) rotate(-8deg); opacity: 0; box-shadow: 0 40px 60px rgba(46,36,26,0); }
  to   { transform: scale(1) rotate(0); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .stamp { animation: none; } }

/* ---------- Till ---------- */
.till-body { background: var(--field); min-height: 100vh; }
.till-grid {
  display: grid; grid-template-columns: minmax(300px, 420px) 1fr; gap: 24px;
  padding: 0 24px 24px; align-items: start;
}
@media (max-width: 880px) { .till-grid { grid-template-columns: 1fr; } }
.panel { background: var(--paper); border-radius: var(--r-md); padding: 24px; }
.panel h2 { font-family: var(--serif); font-weight: 400; font-size: 26px; margin: 0 0 4px; letter-spacing: -0.01em; }
.till-name { font-family: var(--serif); font-weight: 300; font-size: 34px; margin: 0; letter-spacing: -0.02em; }

.amount-field {
  display: flex; align-items: baseline; gap: 6px;
  border-bottom: 2px solid var(--ink); padding: 8px 0; margin: 18px 0 14px;
}
.amount-field .cur { font-family: var(--serif); font-size: 44px; font-weight: 300; }
.amount-field input {
  border: 0; background: transparent; width: 100%;
  font-family: var(--serif); font-weight: 300; font-size: 64px; letter-spacing: -0.03em; line-height: 1;
  padding: 0; outline: none;
}
.amount-field:focus-within { border-bottom-color: var(--bronze); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip { border: 1px solid var(--line); background: var(--cream); border-radius: 999px; padding: 6px 14px; cursor: pointer; font-size: 15px; }
.chip:hover { border-color: var(--ink); }
label.field { display: block; font-size: 14px; color: var(--ink-soft); margin-bottom: 18px; }
label.field input { display: block; width: 100%; margin-top: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; }
.error { color: var(--alert); font-size: 15px; min-height: 22px; margin: 8px 0 0; }

.customer-side { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center; }
@media (max-width: 640px) { .customer-side { grid-template-columns: 1fr; } }
.qr-frame { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px; width: min(300px, 100%); }
.qr-frame img { display: block; width: 100%; height: auto; aspect-ratio: 1; }
.big-amount { font-size: clamp(56px, 7vw, 96px); margin: 4px 0 10px; }
.ways { margin: 0 0 18px; padding: 0; list-style: none; display: grid; gap: 8px; }
.ways li { display: flex; gap: 10px; align-items: flex-start; }
.ways svg { flex: none; margin-top: 2px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }

.status { display: flex; align-items: center; gap: 12px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); min-height: 56px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--bronze); flex: none; }
.dot.live { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .dot.live { animation: none; } }

.paid-view { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }

.idle { padding: 24px 0; max-width: 46ch; }
.idle p { margin: 0 0 10px; }

table.list { width: 100%; border-collapse: collapse; font-size: 15px; }
table.list th { text-align: left; font-weight: 500; color: var(--ink-soft); padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line); }
table.list td { padding: 10px 10px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list td.num { font-family: var(--serif); font-size: 19px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.empty { color: var(--ink-soft); padding: 12px 0; }

.behind { margin-top: 24px; }
.behind-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.timeline { list-style: none; margin: 16px 0 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 72px 150px 1fr 190px; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); align-items: start; }
@media (max-width: 760px) { .timeline li { grid-template-columns: 64px 1fr; } .timeline .who { grid-column: 2; } .timeline .what { grid-column: 1 / -1; } .timeline .funds { grid-column: 1 / -1; } }
.timeline time { font-variant-numeric: tabular-nums; color: var(--ink-soft); font-size: 14px; padding-top: 2px; }
.who { font-weight: 600; font-size: 15px; }
.who.merchant { color: var(--ink); }
.who.customer { color: var(--bronze-ink); }
.who.nocta { color: #3f5f63; }
.who.partner { color: var(--ink-soft); }
.funds { font-size: 14px; background: var(--stone); border-radius: var(--r-sm); padding: 4px 10px; justify-self: start; }
.funds.merchant { background: #e6d8c4; }
.never { margin-top: 14px; padding: 14px 16px; background: var(--stone); border-radius: var(--r-sm); font-size: 15px; }

/* ---------- Customer pay page ---------- */
.pay-body { background: var(--paper); min-height: 100vh; }
.pay-wrap { max-width: 460px; margin: 0 auto; padding: 8px 20px 40px; }
.merchant-line { font-family: var(--serif); font-size: 24px; font-weight: 400; margin: 18px 0 0; }
.pay-amount { font-size: clamp(64px, 18vw, 96px); margin: 6px 0 24px; }
.methods { display: grid; gap: 10px; margin: 0 0 20px; border: 0; padding: 0; }
.methods legend { font-weight: 600; margin-bottom: 8px; }
.method { display: flex; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px; background: #fff; cursor: pointer; }
.method:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.method input { accent-color: var(--ink); width: 20px; height: 20px; }
.method small { display: block; color: var(--ink-soft); }
.note { font-size: 14px; color: var(--ink-soft); margin-top: 18px; }
.receipt { display: grid; gap: 14px; justify-items: start; }
.receipt dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; }
.receipt dt { color: var(--ink-soft); }
.receipt dd { margin: 0; }

/* ---------- Simulated wallet app ---------- */
.wallet-body { background: var(--umber); color: var(--on-umber); min-height: 100vh; }
.wallet-body .sim { background: #1c1610; }
.wallet-wrap { max-width: 420px; margin: 0 auto; padding: 20px; }
.wallet-app { font-family: var(--sans); font-weight: 600; font-size: 17px; display: flex; justify-content: space-between; align-items: center; padding: 6px 0 18px; border-bottom: 1px solid #5a4a3a; }
.wallet-app small { font-weight: 400; color: var(--on-umber-soft); }
.wallet-card { background: var(--umber-2); border-radius: 18px; padding: 24px; margin-top: 22px; }
.wallet-card .amount { font-size: 64px; color: var(--on-umber); margin: 6px 0 14px; }
.wallet-card dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0 0 22px; color: var(--on-umber-soft); }
.wallet-card dd { margin: 0; color: var(--on-umber); }
.btn.approve { background: var(--cream); color: var(--umber); border-color: var(--cream); }
.btn.approve:hover { background: #fff; }
.btn.decline { background: transparent; color: var(--on-umber); border-color: #8a7864; }
.wallet-note { font-size: 14px; color: var(--on-umber-soft); margin-top: 18px; }

/* ---------- Sticker ---------- */
.sticker-body { background: var(--stone); min-height: 100vh; }
.sticker-wrap { max-width: 980px; margin: 0 auto; padding: 0 24px 40px; display: grid; grid-template-columns: 380px 1fr; gap: 32px; align-items: start; }
@media (max-width: 820px) { .sticker-wrap { grid-template-columns: 1fr; } }
.sticker {
  background: var(--field); border-radius: 18px; padding: 26px; width: 100%; max-width: 380px;
  display: grid; gap: 14px; justify-items: center; text-align: center;
}
.sticker .wordmark { font-size: 20px; }
.sticker h1 { font-family: var(--serif); font-weight: 300; font-size: 40px; line-height: 1; margin: 0; letter-spacing: -0.03em; }
.sticker .qr-frame { width: 240px; }
.sticker p { margin: 0; }
.code { font-family: ui-monospace, Menlo, monospace; font-size: 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 10px; word-break: break-all; }

/* ---------- Landing ---------- */
.land { max-width: 1040px; margin: 0 auto; padding: 0 24px 64px; }
.land h1 { font-family: var(--serif); font-weight: 300; font-size: clamp(44px, 6.4vw, 84px); line-height: 1; letter-spacing: -0.035em; margin: 32px 0 18px; max-width: 14ch; }
.lede { font-size: 19px; max-width: 58ch; color: var(--ink-soft); margin: 0 0 32px; }
.tills { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin: 0 0 40px; }
.till-link { display: block; background: var(--field); border-radius: var(--r-md); padding: 18px 20px; text-decoration: none; color: var(--ink); }
.till-link:hover { background: var(--field-deep); }
.till-link strong { display: block; font-family: var(--serif); font-weight: 400; font-size: 24px; }
.till-link span { font-size: 14px; color: var(--ink); }
.till-link.fresh { background: var(--cream); border: 1px dashed var(--ink-soft); }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 28px; padding: 0; margin: 0; list-style: none; counter-reset: s; }
.steps li { counter-increment: s; }
.steps li::before { content: counter(s); font-family: var(--serif); font-size: 40px; font-weight: 300; display: block; color: var(--bronze-ink); line-height: 1; margin-bottom: 8px; }
.land h2 { font-family: var(--serif); font-weight: 400; font-size: 30px; margin: 48px 0 16px; }
.limits { max-width: 70ch; }
.limits li { margin-bottom: 8px; }

@media print {
  .sim, .top, .controls { display: none !important; }
  .sticker-body { background: #fff; }
  .sticker-wrap { display: block; padding: 0; }
  .sticker { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
