:root {
  --bg: #0b0d10;
  --card: #151a20;
  --line: #262d36;
  --text: #f2f4f7;
  --muted: #9aa5b1;
  --go: #3ddc97;
  --go-text: #04130c;
  --warn: #ffcf70;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
#box {
  min-height: 100dvh;
  max-width: 560px;
  margin: 0 auto;
  padding: 0 16px calc(16px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}
.testnet {
  margin: 0 -16px;
  padding: 6px 16px;
  background: #2a2110;
  color: var(--warn);
  font-size: 13px;
  text-align: center;
}
main { flex: 1; display: flex; flex-direction: column; gap: 14px; padding: 16px 0; min-width: 0; }
main.center { align-items: center; justify-content: center; text-align: center; }
main.narrow { align-items: stretch; text-align: left; justify-content: flex-start; padding-top: 32px; }
main.narrow h1 { margin-bottom: 0; }
h1 { font-size: 26px; line-height: 1.2; margin: 0; }
h2 { font-size: 15px; font-weight: 600; color: var(--muted); margin: 0; }
h3 { font-size: 14px; color: var(--muted); margin: 16px 0 0; font-weight: 600; }
p { margin: 0; overflow-wrap: anywhere; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.note { color: var(--warn); }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 14px; }
.amount { font-size: 56px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; text-align: center; }
.amount small { font-size: 20px; font-weight: 600; color: var(--muted); }
button {
  font: inherit;
  color: inherit;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 14px;
  padding: 12px 16px;
  min-height: 48px;
  cursor: pointer;
  touch-action: manipulation;
}
button:disabled { opacity: 0.4; cursor: default; }
button.primary { background: var(--go); border-color: var(--go); color: var(--go-text); font-weight: 700; }
button.ghost { background: transparent; }
button.big { min-height: 64px; font-size: 20px; width: 100%; }
button.link { border: 0; background: none; padding: 0; min-height: 0; color: var(--muted); text-decoration: underline; }
.row { display: flex; gap: 10px; }
.row button { flex: 1; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field span { font-size: 14px; color: var(--muted); }
input, textarea {
  font: inherit;
  color: inherit;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  width: 100%;
  resize: none;
}
textarea { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 14px; }
.tabs { display: flex; gap: 8px; padding-top: 12px; }
.tabs button { flex: 1; min-height: 44px; padding: 8px; }
.tabs button[aria-pressed="true"] { border-color: var(--text); }
.sell { justify-content: flex-end; }
.sell .amount { margin-top: auto; }
.sell > p:nth-child(2) { text-align: center; min-height: 2.9em; }
.pad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.pad button { min-height: 68px; font-size: 26px; font-weight: 600; }
.qr { background: #fff; border-radius: 16px; padding: 6px; width: min(100%, 52dvh, 440px); }
.qr.small { width: min(70%, 260px); align-self: center; }
.qr svg { display: block; width: 100%; height: auto; }
.paid { align-items: center; justify-content: center; text-align: center; background: var(--go); color: var(--go-text); margin: 0 -16px; padding: 24px 16px; }
.paid h1 { font-size: 44px; }
.paid .amount small { color: inherit; }
.paid button.primary { background: var(--go-text); border-color: var(--go-text); color: var(--go); max-width: 420px; margin-top: 24px; }
.tick { font-size: 96px; line-height: 1; font-weight: 700; }
.day section { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.day section.small { background: none; border: 0; padding: 0 4px; }
.day .amount { font-size: 40px; text-align: left; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.list em { color: var(--warn); font-style: normal; font-size: 13px; }
.toast { position: fixed; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); background: var(--go); color: var(--go-text); font-weight: 600; border-radius: 14px; padding: 14px 16px; text-align: center; }
.spin { width: 44px; height: 44px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--go); animation: spin 1s linear infinite; }
.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: 0.45; } }
@media (prefers-reduced-motion: reduce) { .spin, .pulse { animation-duration: 4s; } }
.seg { display: flex; gap: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 4px; width: 100%; }
.seg button { flex: 1; min-height: 44px; border: 0; background: transparent; padding: 8px; font-size: 15px; }
.seg button[aria-pressed="true"] { background: var(--text); color: var(--bg); font-weight: 600; }
.code { gap: 10px; }
.code .amount { font-size: 44px; }
.code .seg { max-width: 440px; }
.ask { font-size: 20px; font-weight: 600; }
.via { color: var(--muted) !important; font-size: 13px; font-style: normal; }
.row-wait { display: flex; align-items: center; gap: 12px; }
.row-wait .spin { width: 28px; height: 28px; border-width: 3px; flex: none; }
.day section h3 { margin: 6px 0 0; }
/* The code screen holds the amount, the switch, the code and Back within a phone's height. */
.code .qr { width: min(100%, 44dvh, 400px); }
