/* Tesserae Pay: customer checkout + public receipt page */
:root {
  --ink: #14181f;
  --ink-2: #4a5361;
  --ink-3: #7c8594;
  --line: #e4e7ec;
  --bg: #f5f3ef;
  --card: #ffffff;
  --accent: #1f5f4f;
  --accent-ink: #ffffff;
  --accent-soft: #e5f0ec;
  --warn: #8a5a00;
  --warn-soft: #fff4dc;
  --bad: #a3271f;
  --bad-soft: #fde8e6;
  --radius: 16px;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.82em; word-break: break-all; }
a { color: var(--accent); }

.sheet { max-width: 460px; margin: 0 auto; padding: 20px 16px 40px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 650; letter-spacing: 0.01em; color: var(--ink-2); font-size: 14px; }
.brand img { width: 22px; height: 22px; }
p.brand { justify-content: center; margin-top: 28px; }

.card { background: var(--card); border-radius: var(--radius); padding: 22px 20px; margin-top: 14px; box-shadow: 0 1px 2px rgba(20, 24, 31, 0.06), 0 8px 24px rgba(20, 24, 31, 0.05); }
.pay-to { color: var(--ink-2); font-size: 14px; }
.merchant-name { font-size: 22px; font-weight: 700; margin: 4px 0 8px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.amount { font-size: 44px; font-weight: 750; letter-spacing: -0.02em; margin: 18px 0 2px; font-variant-numeric: tabular-nums; }
.amount small { font-size: 18px; font-weight: 600; color: var(--ink-2); margin-left: 4px; }
.sub { color: var(--ink-2); font-size: 14px; }

.badge { display: inline-block; font-size: 12px; font-weight: 650; padding: 3px 8px; border-radius: 999px; vertical-align: middle; }
.badge.ok { background: var(--accent-soft); color: var(--accent); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }

.facts { margin: 18px 0 0; padding: 0; border-top: 1px solid var(--line); }
.facts div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.facts dt { color: var(--ink-2); flex-shrink: 0; }
.facts dd { margin: 0; text-align: right; }

.notice { border-radius: 12px; padding: 12px 14px; font-size: 14px; line-height: 1.45; margin-top: 14px; }
.notice.warn { background: var(--warn-soft); color: #5c3d00; }
.notice.bad { background: var(--bad-soft); color: var(--bad); }
.notice.ok { background: var(--accent-soft); color: var(--accent); }

button, .button {
  display: block; width: 100%; border: 0; border-radius: 14px; padding: 16px 18px; font-size: 17px; font-weight: 650;
  background: var(--accent); color: var(--accent-ink); cursor: pointer; text-align: center; text-decoration: none; margin-top: 16px;
  font-family: inherit;
}
button.secondary, .button.secondary { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }
button:disabled { opacity: 0.45; cursor: default; }
.row-buttons { display: flex; gap: 10px; }
.row-buttons > * { flex: 1; }

.steps { list-style: none; padding: 0; margin: 16px 0 0; font-size: 14px; color: var(--ink-2); }
.steps li { padding: 6px 0 6px 26px; position: relative; }
.steps li::before { content: ''; position: absolute; left: 4px; top: 11px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--line); }
.steps li.active { color: var(--ink); font-weight: 600; }
.steps li.active::before { border-color: var(--accent); background: var(--accent-soft); }
.steps li.done::before { border-color: var(--accent); background: var(--accent); }

.spinner { width: 22px; height: 22px; border: 3px solid var(--accent-soft); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

.big-check { width: 64px; height: 64px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 34px; margin: 4px auto 10px; }
.center { text-align: center; }
.hidden { display: none !important; }

/* receipt (shared with merchant app) */
.receipt { background: var(--card); border-radius: var(--radius); padding: 22px 20px; box-shadow: 0 1px 2px rgba(20, 24, 31, 0.06), 0 8px 24px rgba(20, 24, 31, 0.05); }
.rc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.rc-merchant { font-weight: 700; font-size: 18px; }
.rc-number { color: var(--ink-3); font-size: 13px; font-variant-numeric: tabular-nums; }
.rc-amount { font-size: 36px; font-weight: 750; margin: 16px 0 2px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.rc-status { color: var(--accent); font-weight: 650; }
.rc-rows { margin: 16px 0 0; border-top: 1px solid var(--line); }
.rc-row { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.rc-row dt { color: var(--ink-2); flex-shrink: 0; }
.rc-row dd { margin: 0; text-align: right; min-width: 0; }
.rc-foot { color: var(--ink-3); font-size: 12px; margin: 14px 0 0; }
.onchain { font-size: 13px; text-align: center; margin-top: 12px; }
.onchain.ok { color: var(--accent); }
.onchain.bad { color: var(--bad); }

@media print {
  body { background: #fff; }
  .receipt { box-shadow: none; border: 1px solid #ccc; }
  .no-print { display: none !important; }
}

.mt0 { margin-top: 0; }
.mt14 { margin-top: 14px; }
.fineprint { margin: 14px 0 0; }
.paid-title { margin: 6px 0 2px; }
.wallet-option { display: flex; align-items: center; gap: 12px; }
.wallet-option img { width: 28px; height: 28px; border-radius: 6px; }

/* embedded (inside a merchant's website) */
.brand { position: relative; }
.icon-btn { position: absolute; right: -4px; top: -6px; width: 36px; height: 36px; margin: 0; padding: 0; border-radius: 50%; background: transparent; color: var(--ink-2); font-size: 26px; line-height: 1; }
.icon-btn:hover { background: rgba(20, 24, 31, 0.06); }
body.embed { background: var(--bg); }
body.embed .sheet { padding-top: 16px; }
.description { color: var(--ink); font-weight: 600; margin: 2px 0 4px; }
.phone-qr { width: min(320px, 78vw); margin: 0 auto; }
.phone-qr svg { display: block; width: 100%; height: auto; }
.phone-hint { color: var(--ink-2); font-size: 14px; margin: 10px 0 0; }
.or { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: 13px; margin: 18px 4px 0; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
