:root {
  color-scheme: dark;
  --bg: #07090d;
  --card: #12161e;
  --card-2: #1a2030;
  --line: rgba(255, 255, 255, 0.08);
  --text: #f5f7fb;
  --muted: #93a0b5;
  --mint: #7ee0b0;
  --green: #3dd68c;
  --red: #ff6b78;
  --blue: #8eb6ff;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
body {
  font-family: Manrope, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.4;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
.app {
  max-width: 480px;
  min-height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(900px 280px at 50% -80px, rgba(126, 224, 176, 0.14), transparent 60%),
    var(--bg);
}
.view { flex: 1; overflow: auto; padding: 18px 16px 20px; }
.floor { margin: 22px 0 0; color: var(--muted); font-size: 13px; font-weight: 700; }
.back {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin: 0 0 8px;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 15px;
  font-weight: 700;
}
.nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(7, 9, 13, 0.94);
  backdrop-filter: blur(16px);
}
.nav button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: 0;
  color: var(--muted);
  border-radius: 12px;
  padding: 8px 0 6px;
  font-size: 11px;
  font-weight: 600;
}
.nav button svg { width: 22px; height: 22px; }
.nav button.on { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.hello { margin: 0; color: var(--muted); font-size: 13px; font-weight: 600; }
.total { margin: 6px 0 0; font-size: 40px; line-height: 1; letter-spacing: -0.045em; font-weight: 800; }
.muted { color: var(--muted); }
.kicker { margin: 0 0 4px; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--mint); font-weight: 700; }
h2, h3 { margin: 22px 0 10px; font-size: 16px; }
h2 { font-size: 28px; letter-spacing: -0.04em; margin-top: 4px; }
.banner {
  background: rgba(255, 196, 92, 0.1);
  color: #ffd88a;
  border: 1px solid rgba(255, 196, 92, 0.18);
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: 16px;
}
.actions, .links { display: grid; gap: 8px; margin-top: 16px; }
.actions { grid-template-columns: repeat(3, 1fr); }
.links { grid-template-columns: 1fr 1fr; }
button.btn, .actions button, .links button, .primary, .ghost {
  border: 0;
  border-radius: 14px;
  padding: 12px 10px;
  background: var(--card);
  font-weight: 700;
}
.primary { width: 100%; background: #f4f7fb; color: #101318; margin-top: 12px; }
.primary.buy { background: #dfffea; }
.primary.sell { background: #ffe4e7; }
.ghost { background: transparent; color: var(--muted); }
.row, .asset, .tx {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.asset.chain .right b { color: #8eb6ff; text-decoration: underline; text-underline-offset: 3px; }
.asset b, .row b, .tx b { display: block; font-weight: 700; }
.asset small, .row small, .tx small { color: var(--muted); }
.right { text-align: right; }
.mark {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #111;
}
.field { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; font-size: 13px; color: var(--muted); font-weight: 600; min-width: 0; }
.field .inline { width: 100%; min-width: 0; }
.field .inline input { flex: 1 1 auto; width: auto; min-width: 0; }
.field .inline .max { flex: 0 0 auto; }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 14px;
  padding: 14px;
  outline: none;
  font-size: 16px;
}
textarea { min-height: 80px; resize: vertical; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.chips button, .seg button {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 700;
}
.chips button.on, .seg button.on { background: #f4f7fb; color: #101318; border-color: transparent; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.seg button { border-radius: 12px; }
.seg button.on.buy { background: #163528; color: #b8ffd8; }
.seg button.on.sell { background: #3d1820; color: #ffc4cb; }
.card {
  background: var(--card);
  border-radius: 16px;
  padding: 14px;
  overflow-wrap: anywhere;
}
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.qr {
  display: block;
  width: 100%;
  max-width: 440px;
  height: auto;
  margin: 4px auto 14px;
  border-radius: 24px;
  background: #171b26;
}
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 4px 0 8px; }
.facts .card small, .facts .card span { display: block; color: var(--muted); font-size: 12px; }
.facts .card b { display: block; margin: 4px 0; font-size: 16px; }
.book-label { margin: 0 0 4px; color: var(--muted); font-size: 12px; font-weight: 700; }
.book { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.book button, .level {
  width: 100%;
  display: flex;
  justify-content: space-between;
  background: transparent;
  border: 0;
  padding: 4px 0;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}
.ask { color: var(--red); }
.bid { color: var(--green); }
.up { color: var(--green); }
.down { color: var(--red); }
.pair {
  border: 0;
  background: var(--card);
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 800;
}
.px { font-size: 32px; font-weight: 800; letter-spacing: -0.04em; margin: 10px 0; }
.px span { font-size: 14px; margin-left: 6px; }
.chart-range { grid-template-columns: repeat(3, 1fr); margin-top: 4px; }
.chart-box { position: relative; width: 100%; height: 260px; margin: 4px 0 8px; overflow: hidden; touch-action: pan-y; }
@media (min-width: 860px) {
  .app { max-width: 980px; }
  .chart-box { height: 440px; }
  .asset-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(260px, 0.72fr);
    gap: 28px;
    align-items: start;
  }
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 92px;
  transform: translateX(-50%);
  background: #f4f7fb;
  color: #101318;
  padding: 12px 14px;
  border-radius: 14px;
  font-weight: 700;
  z-index: 40;
  max-width: min(420px, calc(100% - 24px));
}
.pin {
  position: fixed;
  inset: 0;
  background: rgba(7, 9, 13, 0.72);
  display: grid;
  place-items: end center;
  z-index: 30;
}
.sheet {
  width: min(480px, 100%);
  background: #10141b;
  border-radius: 24px 24px 0 0;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
}
input[type="checkbox"] { width: auto; }
.modal {
  position: fixed;
  inset: 0;
  background: rgba(7, 9, 13, 0.72);
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 35;
}
.modal.locked { background: rgba(7, 9, 13, 0.94); }
.modal-card {
  width: min(460px, 100%);
  max-height: min(720px, calc(100vh - 48px));
  overflow: auto;
  background: #10141b;
  border: 1px solid var(--line);
  border-top: 3px solid var(--blue);
  border-radius: 20px;
  padding: 18px 16px;
}
.modal-card.success { border-top-color: #3ccf91; }
.modal-card.warning { border-top-color: #ffc45c; }
.modal-card.error { border-top-color: #ff5c6c; }
.modal-card p { white-space: pre-line; color: var(--muted); margin: 10px 0 16px; line-height: 1.45; }
.modal-field { display: flex; flex-direction: column; gap: 6px; margin: 0 0 12px; font-size: 13px; color: var(--muted); font-weight: 600; }
.modal-field input, .modal-field textarea { width: 100%; border: 1px solid var(--line); background: var(--card); border-radius: 14px; padding: 12px; outline: none; font: inherit; color: inherit; }
.modal-field textarea { min-height: 84px; resize: vertical; }
.seed-label { margin: 4px 0 0; font-weight: 700; }
.seed-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 8px; }
.seed-cell, .seed-cell label { min-width: 0; }
.seed-cell label { display: flex; align-items: center; gap: 6px; }
.seed-cell label span { flex: 0 0 1.6em; color: var(--muted); font-size: 12px; font-weight: 700; }
.seed-word { width: auto; flex: 1; min-width: 0; padding: 8px 10px; font-size: 14px; }
.seed-word.ok { border-color: #3ccf91; }
.seed-word.bad { border-color: #ff5c6c; }
.seed-suggest { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 12px; }
.seed-suggest[hidden] { display: none; }
.seed-suggest > span { color: var(--muted); font-size: 12px; font-weight: 700; }
.seed-suggest button { width: auto; border: 0; background: #f4f7fb; color: #101318; border-radius: 999px; padding: 4px 10px; font-size: 13px; font-weight: 700; }
.seed-hints { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 12px; }
.seed-hints i { font-style: normal; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 4px 8px; }
.seed-ok { background: rgba(61, 214, 140, 0.12); color: #3ccf91; }
.seed-bad { background: rgba(255, 92, 108, 0.12); color: #ff5c6c; display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.seed-bad button { border: 0; background: #f4f7fb; color: #101318; border-radius: 999px; padding: 2px 7px; font-size: 11px; font-weight: 800; }
.modal-card .primary { width: 100%; }
.dots { display: flex; gap: 10px; justify-content: center; margin: 18px 0; }
.dots i { width: 12px; height: 12px; border-radius: 50%; border: 1px solid var(--muted); }
.dots i.on { background: var(--text); border-color: var(--text); }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pad button { background: var(--card); border: 0; border-radius: 16px; padding: 16px; font-size: 22px; font-weight: 700; }
.gate { padding: 48px 24px; max-width: 420px; margin: 0 auto; }
.gate .seg { margin-top: 18px; }
.gate-link {
  display: block;
  width: 100%;
  margin-top: 16px;
  border: 0;
  background: transparent;
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 700;
  font-size: 14px;
  text-align: center;
}
.seed-backup {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 18px 0 8px;
  padding: 0;
  list-style: none;
  counter-reset: seed;
}
.seed-backup li {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 700;
  counter-increment: seed;
}
.seed-backup li::before {
  content: counter(seed) ". ";
  color: var(--muted);
  font-weight: 600;
}
.center { text-align: center; margin-top: 30vh; }
.empty { color: var(--muted); padding: 8px 0 16px; }
.inline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.max { border: 0; background: transparent; color: var(--blue); font-weight: 800; padding: 0; }
