:root {
  --bg: #0b0e13;
  --card: #12161e;
  --border: #1e2633;
  --text: #e8edf5;
  --muted: #8b95a8;
  --accent: #7c6cff;
  --accent-hover: #9588ff;
  --danger: #e84c6a;
  --danger-hover: #ff6b84;
  --success: #2dd4a8;
  --warning: #f5c542;
  --radius: 14px;
  --font: 'Inter', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: #07090d;
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

.hero-bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(700px 420px at 15% 20%, rgba(124,108,255,.28), transparent 60%),
    radial-gradient(500px 320px at 80% 80%, rgba(45,212,168,.08), transparent 60%),
    #07090d;
  z-index: 0;
}

.onboard-layout {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 48px;
  align-items: center;
  max-width: 1080px;
  margin: 0 auto;
  padding: 48px 28px;
}

.onboard-copy h1 {
  font-size: 52px;
  line-height: 1.02;
  letter-spacing: -1.5px;
  margin: 12px 0 16px;
}

.onboard-copy p { color: #b7c0d0; font-size: 17px; max-width: 460px; }

.eyebrow {
  color: #c4b5fd;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.4px;
}

.feature-list {
  margin-top: 28px;
  list-style: none;
  display: grid;
  gap: 10px;
  color: #d7deea;
  font-size: 14px;
}

.feature-list li::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 10px;
  border-radius: 99px;
  background: #7c6cff;
}

.onboard-card {
  max-width: 440px;
  width: 100%;
  margin: 0;
  padding: 28px 26px;
  background: rgba(18,22,30,.86);
  border: 1px solid rgba(124,108,255,.28);
  border-radius: 22px;
  box-shadow: 0 30px 80px rgba(0,0,0,.35);
  backdrop-filter: blur(12px);
}

.screen { min-height: 100vh; }

/* ---- Onboarding / Unlock ---- */
.onboard-card {
  max-width: 440px;
  margin: 8vh auto;
  padding: 36px 32px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
}

.logo {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #a78bfa, #7c6cff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-sm {
  font-size: 18px;
  font-weight: 800;
  background: linear-gradient(135deg, #a78bfa, #7c6cff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tagline {
  color: var(--muted);
  font-size: 14px;
  margin: 6px 0 28px;
}

.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 24px;
  background: #0d1118;
  padding: 4px;
  border-radius: 10px;
}

.tab {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  border-radius: 8px;
  cursor: pointer;
  transition: .15s;
}

.tab.active {
  background: var(--accent);
  color: #fff;
}

.tab-panel label,
label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 14px;
}

input, textarea, select {
  width: 100%;
  padding: 12px 14px;
  background: #0d1118;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s;
}

.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 64px; }
.eye {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: #c4b5fd;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); }

textarea { resize: vertical; font-family: ui-monospace, monospace; font-size: 13px; }

.hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 14px;
}

.hint.warning { color: var(--warning); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 18px;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: .15s;
}

.btn.primary {
  background: var(--accent);
  color: #fff;
  width: 100%;
  margin-top: 8px;
}
.btn.primary:hover { background: var(--accent-hover); }

.btn.secondary {
  background: #1a2030;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn.secondary:hover { background: #222a3a; }

.btn.ghost {
  background: transparent;
  color: var(--muted);
  width: 100%;
  margin-top: 10px;
}
.btn.ghost:hover { color: var(--text); }

.btn.sm { padding: 7px 12px; font-size: 12px; width: auto; margin: 0; }

.btn.danger { background: var(--danger); }
.btn.danger:hover { background: var(--danger-hover); }

.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---- Main layout ---- */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: #0d1118;
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand { display: flex; align-items: center; gap: 10px; }
.badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: #1a2a1a;
  color: var(--success);
  border: 1px solid #2a4a2a;
}

.top-actions { display: flex; align-items: center; gap: 10px; }

.status-pill {
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
}
.status-pill.locked { background: #2a1a1a; color: #f5a0a0; }
.status-pill.unlocked { background: #1a2a1a; color: var(--success); }

#mainApp {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 20px 60px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 18px;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.card-head h2 { font-size: 16px; font-weight: 700; }

.main-wallet-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  margin-bottom: 16px;
  padding: 14px;
  background: #0d1118;
  border-radius: 10px;
}

.label { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.address { font-family: ui-monospace, monospace; font-size: 13px; word-break: break-all; margin-top: 4px; }
.balance { font-size: 22px; font-weight: 700; margin-top: 2px; }

.distribute-row {
  display: flex;
  gap: 12px;
  align-items: end;
  flex-wrap: wrap;
}
.distribute-row label { flex: 1; min-width: 160px; margin: 0; }
.distribute-row .btn { width: auto; }

.op-grid {
  display: grid;
  grid-template-columns: 2fr 1.2fr 0.8fr;
  gap: 12px;
  margin-bottom: 16px;
}

.quick-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
}
.quick-label { font-size: 12px; color: var(--muted); font-weight: 600; margin-right: 4px; }

.chip {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #1a2030;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: .12s;
}
.chip:hover, .chip.active { border-color: var(--accent); background: #221e3a; }
.chip.ghost { background: transparent; color: var(--muted); }

.select-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.execute-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.execute-bar .btn { width: auto; flex: 1; min-width: 140px; }

.fee-note {
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
}
.fee-note code.tiny { font-size: 11px; }

.muted { color: var(--muted); font-size: 13px; }

/* ---- Table ---- */
.table-wrap { overflow-x: auto; }

.wallets-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.wallets-table th {
  text-align: left;
  padding: 10px 12px;
  color: var(--muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .3px;
  border-bottom: 1px solid var(--border);
}

.wallets-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #181e28;
  vertical-align: middle;
}

.wallets-table tr:hover td { background: #0f131a; }

.wallets-table .addr {
  font-family: ui-monospace, monospace;
  font-size: 12px;
  color: var(--muted);
}

.wallets-table input[type="number"] {
  width: 100px;
  padding: 7px 10px;
  font-size: 13px;
}

.wallets-table .name-cell { font-weight: 600; }
.wallets-table .main-tag {
  font-size: 10px;
  background: #2a2240;
  color: #c4b5fd;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
  font-weight: 700;
}

/* ---- Banner ---- */
.banner {
  background: #1a1528;
  border: 1px solid #3b2f6b;
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 18px;
}
.banner strong { display: block; margin-bottom: 4px; }
.banner p { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.banner code {
  display: block;
  background: #0d1118;
  padding: 12px;
  border-radius: 8px;
  font-size: 13px;
  word-break: break-all;
  margin-bottom: 12px;
  line-height: 1.6;
}
.banner-actions { display: flex; gap: 8px; }

/* ---- Toast ---- */
.toast {
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 500;
}
.toast.success { background: #0f2118; border: 1px solid #285c43; color: #a7efc6; }
.toast.error { background: #21151a; border: 1px solid #63323b; color: #ffb3bc; }
.toast.info { background: #151a27; border: 1px solid #2b3645; color: #dbe3ed; }

/* ---- Modal ---- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  max-width: 480px;
  width: 100%;
}
.modal-card h3 { font-size: 18px; margin-bottom: 14px; }
.confirm-summary {
  background: #0d1118;
  border-radius: 10px;
  padding: 14px;
  font-size: 13px;
  margin-bottom: 14px;
  max-height: 220px;
  overflow-y: auto;
  white-space: pre-wrap;
}
.modal-card .warning {
  font-size: 13px;
  color: var(--warning);
  margin-bottom: 18px;
}
.modal-actions { display: flex; gap: 10px; }
.modal-actions .btn { flex: 1; }

.footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 11px;
  color: var(--muted);
  padding: 12px 4px;
  flex-wrap: wrap;
}

.hidden { display: none !important; }

pre {
  background: #0d1118;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  font-size: 12px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 720px) {
  .op-grid { grid-template-columns: 1fr; }
  .main-wallet-row { grid-template-columns: 1fr; }
  .execute-bar .btn { width: 100%; }
  .onboard-layout { grid-template-columns: 1fr; padding: 28px 16px; }
  .onboard-copy h1 { font-size: 34px; }
  .onboard-card { margin: 0; padding: 24px 18px; }
}
