:root {
  --bg: #f1f2f6;
  --surface: #ffffff;
  --border: #e6e8ee;
  --text: #14161a;
  --muted: #8a8f98;
  --accent: #2f6fee;
  --accent-soft: #eaf1ff;
  --danger: #e2483d;
  --success: #1fa971;
  --warn-bg: #fff6e0;
  --warn-text: #93650a;
  --tron-color: #eb0029;
  --bsc-color: #a87900;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101216; --surface: #1a1d23; --border: #2a2e37; --text: #eef0f3; --muted: #9299a6;
    --accent-soft: #1b2b4d; --warn-bg: #2a1f14; --warn-text: #e0b25a;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); min-height: 100vh; }
.screen { padding: 16px; max-width: 480px; margin: 0 auto; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 20px; margin-top: 24px;
}
h1 { font-size: 22px; margin: 0 0 8px; }
h2 { font-size: 18px; margin: 0 0 12px; }
.muted { color: var(--muted); font-size: 14px; line-height: 1.5; }
label { display: block; font-size: 13px; color: var(--muted); margin: 14px 0 6px; }
input, select {
  width: 100%; padding: 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: 16px;
}
.pin-input {
  margin-top: 14px; letter-spacing: 4px; text-align: center;
  -webkit-text-security: disc; text-security: disc; /* masks input without type="password",
    which on Safari/Chrome triggers the OS password manager to offer/autofill a saved
    login instead of the numeric PIN the user actually typed — see LEARNINGS 2026-09-09 */
}
.btn {
  display: block; width: auto; padding: 12px 18px; border-radius: 10px; border: none;
  font-size: 15px; font-weight: 600; cursor: pointer; margin-top: 14px;
}
.btn-block { width: 100%; text-align: center; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn-sm { padding: 6px 12px; font-size: 13px; margin-top: 0; }
.btn-danger { background: var(--danger); color: #fff; }
.error { color: var(--danger); font-size: 13px; margin-top: 10px; }
#resetAppBtn { display: block; margin: 18px auto 0; }

/* ── Top bar ─────────────────────────────────────────────────────────── */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 4px 0 16px; font-weight: 700; font-size: 18px;
}

/* ── Market price ticker ─────────────────────────────────────────────── */
.ticker { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px; }
.ticker-chip {
  flex: 0 0 auto; background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 8px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 84px;
}
.ticker-symbol { font-size: 12px; font-weight: 700; color: var(--muted); }
.ticker-price { font-size: 14px; font-weight: 600; }
.ticker-change { font-size: 11.5px; }
.ticker-change.up { color: var(--success); }
.ticker-change.down { color: var(--danger); }

/* ── Network filter tabs ─────────────────────────────────────────────── */
.chain-tabs { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 14px; }
.chain-tab {
  flex: 0 0 auto; display: flex; align-items: center; gap: 6px; padding: 8px 14px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font-size: 13.5px; font-weight: 600; cursor: pointer;
}
.chain-tab.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.chain-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.chain-dot.tron { background: var(--tron-color); }
.chain-dot.bsc { background: var(--bsc-color); }
.chain-dot.all { background: var(--accent); }

/* ── Wallet list ─────────────────────────────────────────────────────── */
.wallet-list { display: flex; flex-direction: column; gap: 10px; }
.wallet-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px;
}
.wallet-card .row1 { display: flex; justify-content: space-between; align-items: center; }
.wallet-chain-badge {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 700;
  padding: 3px 8px; border-radius: 6px; display: inline-flex; align-items: center; gap: 5px;
  background: var(--accent-soft); color: var(--accent);
}
.wallet-label { font-weight: 600; margin-top: 6px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; word-break: break-all; }
.wallet-address { color: var(--muted); margin-top: 4px; cursor: pointer; }
.wallet-balance { margin-top: 10px; font-size: 15px; }
.wallet-balance .sec { color: var(--muted); font-size: 13px; margin-left: 8px; }

.warn {
  background: var(--warn-bg); color: var(--warn-text); border-radius: 10px; padding: 12px;
  font-size: 13.5px; line-height: 1.5; margin: 10px 0 16px;
}
.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); margin: 16px 0 0; }
.checkbox-row input { width: auto; }

/* ── Numbered seed-phrase grid ───────────────────────────────────────── */
.mnemonic-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 12px;
  user-select: all;
}
.mnemonic-word {
  display: flex; align-items: baseline; gap: 6px; background: var(--surface);
  border-radius: 8px; padding: 8px 10px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.mnemonic-index { color: var(--muted); font-size: 12px; min-width: 16px; }
.mnemonic-text { font-size: 14px; font-weight: 600; }

/* ── Seed verification quiz ──────────────────────────────────────────── */
.verify-question { margin-bottom: 18px; }
.verify-question-label { font-weight: 600; margin-bottom: 8px; }
.verify-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.verify-option {
  padding: 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px;
  cursor: pointer; text-align: center;
}
.verify-option.selected { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
