:root {
  color-scheme: dark;
  --bg: #04070f;
  --bg-card: rgba(13, 22, 42, 0.92);
  --bg-inset: rgba(6, 11, 24, 0.88);
  --line: rgba(255, 255, 255, 0.09);
  --line-gold: rgba(244, 200, 106, 0.36);
  --text: #f8fafc;
  --muted: #94a3b8;
  --gold: #f4c86a;
  --gold-hi: #fde69e;
  --cyan: #38bdf8;
  --jade: #34d399;
  --rose: #fb7185;
  --amber: #fbbf24;
  --font-sans: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  min-height: 100dvh;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 90% 45% at 50% -10%, rgba(244, 200, 106, 0.14), transparent 65%),
    radial-gradient(ellipse 70% 40% at 100% 20%, rgba(56, 189, 248, 0.1), transparent 60%);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

a { color: var(--gold); text-decoration: none; }
code, .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.wallet-shell {
  width: 100%;
  max-width: 460px;
  min-height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  position: relative;
  border-left: 1px solid rgba(255, 255, 255, 0.05);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(5, 9, 20, 0.72);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 12px 16px;
  background: rgba(6, 11, 24, 0.88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.brand-pill {
  display: flex;
  align-items: center;
  gap: 9px;
}

.brand-pill img {
  width: 30px;
  height: 30px;
  border-radius: 9px;
}

.brand-name {
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.net-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(52, 211, 153, 0.14);
  border: 1px solid rgba(52, 211, 153, 0.35);
  color: #6ee7b7;
}

.net-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--jade);
  box-shadow: 0 0 8px var(--jade);
}

.app-main {
  flex: 1;
  padding: 16px 16px 86px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.popup-main {
  padding-bottom: 24px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
}

.card.is-hero {
  background: linear-gradient(155deg, rgba(22, 34, 64, 0.94), rgba(8, 14, 28, 0.96));
  border-color: var(--line-gold);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.42);
}

.muted { color: var(--muted); }
.text-xs { font-size: 11.5px; }
.text-sm { font-size: 13px; }
.text-gold { color: var(--gold-hi); }
.text-jade { color: var(--jade); }
.text-rose { color: var(--rose); }
.text-cyan { color: var(--cyan); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.badge.is-ok { background: rgba(52, 211, 153, 0.16); color: #6ee7b7; border: 1px solid rgba(52, 211, 153, 0.35); }
.badge.is-gold { background: rgba(244, 200, 106, 0.16); color: var(--gold-hi); border: 1px solid var(--line-gold); }
.badge.is-warn { background: rgba(251, 191, 36, 0.16); color: #fde68a; border: 1px solid rgba(251, 191, 36, 0.35); }
.badge.is-danger { background: rgba(251, 113, 133, 0.18); color: #fda4af; border: 1px solid rgba(251, 113, 133, 0.45); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 16px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.14s ease, opacity 0.14s ease, border-color 0.14s ease;
}

.btn:hover:not(:disabled) { transform: translateY(-1px); border-color: rgba(255, 255, 255, 0.25); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-gold {
  background: linear-gradient(135deg, #fde69e, #f4c86a 55%, #c98622);
  color: #141006;
  border-color: transparent;
}
.btn-cyan {
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(56, 189, 248, 0.42);
  color: #bae6fd;
}
.btn-danger {
  background: rgba(225, 29, 72, 0.22);
  border-color: rgba(251, 113, 133, 0.5);
  color: #fecdd3;
}
.btn-full { width: 100%; }
.btn-sm { padding: 7px 12px; font-size: 12px; border-radius: 10px; }

.input, .select, .textarea {
  width: 100%;
  padding: 11px 13px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg-inset);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 13.5px;
  outline: none;
}

.input:focus, .select:focus, .textarea:focus {
  border-color: var(--gold);
}

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 11px; }
.field label { font-size: 12px; font-weight: 600; color: var(--muted); }

/* Quick Circle Actions (Binance/OKX/Gate Style) */
.action-circles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.circle-act {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 0;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
}

.circle-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 18px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(244, 200, 106, 0.35);
  transition: transform 0.14s ease, background 0.14s ease;
}

.circle-act:hover .circle-icon {
  transform: translateY(-2px);
  background: rgba(244, 200, 106, 0.22);
}

.addr-chip-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.addr-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 11px;
  border-radius: 11px;
  background: var(--bg-inset);
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  width: 100%;
  text-align: left;
}

.balance-big {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 6px 0 2px;
  font-variant-numeric: tabular-nums;
}

/* Token / Tx Lists */
.list-rows { display: flex; flex-direction: column; gap: 8px; }
.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 14px;
  background: var(--bg-inset);
  border: 1px solid var(--line);
}

.tok-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 12px;
  background: linear-gradient(135deg, rgba(244, 200, 106, 0.3), rgba(56, 189, 248, 0.2));
  border: 1px solid var(--line-gold);
  color: var(--gold-hi);
  flex-shrink: 0;
}

/* Warning Boxes */
.alert-box {
  padding: 12px 13px;
  border-radius: 13px;
  font-size: 12.5px;
  line-height: 1.5;
  border: 1px solid var(--line);
}
.alert-danger {
  background: rgba(159, 18, 57, 0.24);
  border-color: rgba(251, 113, 133, 0.55);
  color: #fecdd3;
}
.alert-warn {
  background: rgba(180, 83, 9, 0.22);
  border-color: rgba(251, 191, 36, 0.45);
  color: #fef3c7;
}
.alert-ok {
  background: rgba(6, 95, 70, 0.24);
  border-color: rgba(52, 211, 153, 0.45);
  color: #d1fae5;
}

/* 12-Word Grid */
.seed-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.seed-chip {
  padding: 8px 9px;
  border-radius: 10px;
  background: var(--bg-inset);
  border: 1px solid var(--line-gold);
  font-family: var(--font-mono);
  font-size: 12.5px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.seed-chip span { color: var(--muted); font-size: 11px; }

.step-dots {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}
.step-dot {
  flex: 1;
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.12);
}
.step-dot.is-active { background: var(--gold); }

/* Bottom Nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 460px;
  z-index: 40;
  background: rgba(6, 11, 24, 0.94);
  backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
}

.bnav-btn {
  background: transparent;
  border: 0;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 5px 2px;
  cursor: pointer;
}

.bnav-btn.is-active { color: var(--gold-hi); }
.bnav-btn .ico { font-size: 17px; line-height: 1; }

/* Sheet / Overlay */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(3, 6, 14, 0.78);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.sheet-card {
  width: 100%;
  max-width: 460px;
  max-height: 88dvh;
  overflow-y: auto;
  background: #0c162b;
  border-top: 1px solid var(--line-gold);
  border-radius: 22px 22px 0 0;
  padding: 18px 16px 24px;
}

.toast {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  max-width: 420px;
  width: calc(100% - 32px);
  padding: 11px 14px;
  border-radius: 13px;
  background: #0f172a;
  border: 1px solid var(--line-gold);
  color: var(--text);
  font-size: 13px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
}

.is-hidden { display: none !important; }
