/* Token Wallet — shared styles (used by the phone app and the admin page) */
:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #eef0f3;
  --text: #15171a;
  --muted: #5f6670;
  --border: #dde1e6;
  --accent: #0f766e;
  --accent-text: #ffffff;
  --accent-soft: #d5efec;
  --pos: #12804a;
  --neg: #c2362b;
  --warn-bg: #fff4d6;
  --warn-text: #7a5600;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 2px 8px rgba(16, 24, 40, .05);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1113;
    --surface: #181b1f;
    --surface-2: #22262b;
    --text: #eceef1;
    --muted: #9aa2ad;
    --border: #2c3137;
    --accent: #2bb3a3;
    --accent-text: #04201d;
    --accent-soft: #11332f;
    --pos: #4cc985;
    --neg: #ff7b70;
    --warn-bg: #3a2f10;
    --warn-text: #f5d07a;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.1rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.num { font-variant-numeric: tabular-nums; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }

/* -------- controls -------- */
label { display: block; font-size: .9rem; font-weight: 600; margin: 14px 0 6px; }
input, select, textarea {
  width: 100%;
  font: inherit;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 12px;
}
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.check input { width: 18px; height: 18px; }

button, .btn {
  font: inherit;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 16px;
  cursor: pointer;
  min-height: 44px;
}
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
button.danger { color: var(--neg); }
button.link { border: 0; background: none; padding: 6px 8px; min-height: 0; color: var(--accent); }
button:disabled { opacity: .55; cursor: default; }
.icon-btn {
  width: 44px; height: 44px; padding: 0;
  display: inline-grid; place-items: center;
  border-radius: 50%;
  background: transparent; border-color: transparent;
}
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn.spin svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.error { color: var(--neg); font-size: .9rem; min-height: 1.2em; margin: 10px 0 0; }
.banner {
  background: var(--warn-bg); color: var(--warn-text);
  padding: 10px 14px; border-radius: 10px; font-size: .9rem; margin: 0 0 14px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

dialog {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
  padding: 20px;
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
}
dialog::backdrop { background: rgba(0, 0, 0, .45); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }
.actions .grow { flex: 1; }

/* -------- phone app -------- */
.app { max-width: 560px; margin: 0 auto; padding: max(16px, env(safe-area-inset-top)) 16px 32px; }

.login { min-height: 90vh; display: grid; align-content: center; }
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.brand img { width: 48px; height: 48px; border-radius: 12px; }
.login form { padding: 20px; }
.login button.primary { width: 100%; margin-top: 20px; }

.topbar { display: flex; align-items: center; gap: 8px; margin: 4px 0 18px; }
.topbar .who { flex: 1; min-width: 0; }
.topbar .who h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.balances { display: grid; gap: 12px; }
.balance {
  padding: 18px 20px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 14px;
  align-items: center;
}
.balance .coin {
  grid-row: span 2;
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
  font-weight: 700; font-size: .8rem; letter-spacing: .02em;
}
.balance .label { color: var(--muted); font-size: .9rem; }
.balance .amount { font-size: 1.75rem; font-weight: 700; overflow-wrap: anywhere; }
.balance .amount small { font-size: .95rem; font-weight: 600; color: var(--muted); margin-left: 6px; }
.empty { padding: 28px 20px; text-align: center; color: var(--muted); }

.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 28px 2px 10px; }
.tx-list { list-style: none; margin: 0; padding: 0; }
.tx-list li {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 12px;
  padding: 12px 16px; border-top: 1px solid var(--border);
}
.tx-list li:first-child { border-top: 0; }
.tx-list .what { font-weight: 600; overflow-wrap: anywhere; }
.tx-list .amt { font-weight: 700; text-align: right; }
.tx-list .meta, .tx-list .after { font-size: .82rem; color: var(--muted); }
.tx-list .after { text-align: right; }
.more { display: block; margin: 12px auto 0; }
.foot { text-align: center; margin-top: 18px; font-size: .82rem; color: var(--muted); }
label.first { margin-top: 0; }
.subhead { margin-top: 18px; font-size: 1rem; }
.actions.tight { margin-top: 8px; }

/* invites & install */
.invite-hint { padding: 16px 18px; margin-bottom: 12px; }
.invite-hint p { margin: 0; }
.welcome-msg { margin: 0 0 12px; color: var(--neg); font-size: .95rem; }
.pw-toggle { margin: 4px 0 10px; }
.install-card {
  display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center;
  padding: 14px 16px; margin-bottom: 14px; border-color: var(--accent);
}
.install-text { display: grid; gap: 2px; }
.install-card .link { grid-column: 1 / -1; justify-self: start; padding: 0; color: var(--muted); font-weight: 500; }

.play-card {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center;
  padding: 12px 16px; margin-top: 12px; color: inherit; text-decoration: none;
}
.play-card img { width: 44px; height: 44px; border-radius: 10px; image-rendering: pixelated; }
.play-card > span { display: grid; }
.play-card .chev { font-size: 1.6rem; color: var(--muted); }
