/* ===================================
   SYNAPSE Wallet Stylesheet
=================================== */

body.wallet-page {
  padding-top: 60px;
}

/* ===================================
   LAYOUT
=================================== */
.wallet-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: calc(100vh - 60px);
  gap: 0;
}

/* ===================================
   SIDEBAR
=================================== */
.wallet-sidebar {
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  padding: 1.5rem 0;
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.wallet-avatar {
  padding: 0.5rem 1.5rem 1.5rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.5rem;
}

.avatar-ring {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 2px solid var(--cyan);
  margin: 0 auto 0.7rem;
  padding: 3px;
  box-shadow: 0 0 15px rgba(0,212,255,0.3);
  animation: spin-slow 10s linear infinite;
}

.avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  animation: spin-slow 10s linear infinite reverse;
}

.wallet-addr {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.wallet-badge-row {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.wbadge {
  font-size: 0.65rem;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.wbadge.god {
  background: linear-gradient(135deg, var(--gold), #ff6b35);
  color: white;
}

.wbadge.verified {
  background: rgba(16,185,129,0.2);
  border: 1px solid rgba(16,185,129,0.4);
  color: var(--green);
}

.sidebar-menu {
  padding: 0 0.75rem;
  flex: 1;
}

.smenu-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.7rem 0.75rem;
  border-radius: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s;
  margin-bottom: 0.2rem;
}

.smenu-item i {
  width: 18px;
  text-align: center;
  color: var(--text-muted);
  transition: color 0.2s;
}

.smenu-item:hover, .smenu-item.active {
  background: rgba(0,212,255,0.08);
  color: var(--cyan);
}

.smenu-item:hover i, .smenu-item.active i {
  color: var(--cyan);
}

.chain-selector {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.chain-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.chain-current {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-primary);
  transition: all 0.2s;
}

.chain-current:hover {
  border-color: var(--border-hover);
}

.chain-current i { margin-left: auto; color: var(--text-muted); }

.chain-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-top: 0.5rem;
}

.chain-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.5rem;
  border-radius: 6px;
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.chain-item:hover, .chain-item.active {
  background: rgba(0,212,255,0.05);
  color: var(--text-secondary);
}

.chain-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.chain-dot.eth { background: #627EEA; }
.chain-dot.bnb { background: #F3BA2F; }
.chain-dot.arb { background: #28A0F0; }
.chain-dot.sol { background: #9945FF; }
.chain-dot.poly { background: #8247E5; }
.chain-dot.more { background: var(--text-muted); }

/* ===================================
   MAIN CONTENT
=================================== */
.wallet-main {
  background: var(--bg-primary);
  padding: 0;
  overflow-y: auto;
  /* Prevent content stretching on ultra-wide screens */
  min-width: 0;
}

.wallet-main-inner {
  max-width: 1280px;
  margin: 0 auto;
}

.wsection {
  padding: 2rem 2.5rem;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: 68px; /* nav height (60px) + small gap */
}

.wsection-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.wsection-header h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: white;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.wsection-header h2 i {
  color: var(--cyan);
}

.wsection-header .wtime {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.refresh-btn {
  cursor: pointer;
  color: var(--cyan);
  transition: transform 0.3s;
}

.refresh-btn:hover { transform: rotate(180deg); }

.ws-badge {
  font-size: 0.7rem;
  padding: 0.2rem 0.7rem;
  border-radius: 10px;
  background: rgba(0,212,255,0.1);
  border: 1px solid rgba(0,212,255,0.3);
  color: var(--cyan);
  font-weight: 700;
  letter-spacing: 0.05em;
}

.ws-badge.powered {
  background: rgba(124,58,237,0.1);
  border-color: rgba(124,58,237,0.3);
  color: var(--purple-light);
}

/* ===================================
   BALANCE HERO
=================================== */
.balance-hero {
  background: linear-gradient(135deg, var(--bg-card), rgba(0,212,255,0.05));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  display: grid;
  grid-template-columns: 1fr minmax(200px, 260px);
  grid-template-rows: auto auto;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  align-items: center;
}

.portfolio-chart-wrap {
  height: 110px;
  width: 100%;
  position: relative;
}

.bh-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}

.bh-value {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 900;
  color: white;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.bh-change {
  font-size: 0.9rem;
  font-weight: 600;
}

.bh-change.positive { color: var(--green); }
.bh-change.negative { color: var(--red); }

.bh-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

.bh-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

/* ===================================
   WALLET BUTTONS
=================================== */
.wbtn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: linear-gradient(135deg, var(--cyan-dark), var(--purple));
  color: white;
  border: none;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.5rem 1.2rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.05em;
  text-decoration: none;
}

.wbtn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(0,212,255,0.3);
  filter: brightness(1.1);
}

.wbtn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
  border: 1px solid var(--border);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.5rem 1.2rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.05em;
  text-decoration: none;
}

.wbtn-secondary:hover {
  border-color: var(--border-hover);
  color: var(--cyan);
  background: rgba(0,212,255,0.05);
}

/* ===================================
   ASSET TABLE
=================================== */
.asset-table {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  /* Horizontal scroll on small mains instead of column collapse */
  overflow-x: auto;
}

.at-header {
  display: grid;
  grid-template-columns: 2fr 1.2fr 1.2fr 1.2fr 1fr 120px;
  padding: 0.75rem 1.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  min-width: 640px;
}

.at-row {
  display: grid;
  grid-template-columns: 2fr 1.2fr 1.2fr 1.2fr 1fr 120px;
  padding: 1rem 1.5rem;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  transition: background 0.2s;
  min-width: 640px;
}

.at-row:hover { background: rgba(255,255,255,0.02); }
.at-row:last-child { border-bottom: none; }

.at-asset {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.at-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.9rem;
  font-family: var(--font-display);
  flex-shrink: 0;
}

.at-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.at-chain {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.at-row span {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.at-change {
  font-weight: 700;
  font-size: 0.85rem !important;
}

.positive { color: var(--green) !important; }
.negative { color: var(--red) !important; }
.danger { color: var(--red) !important; }

.at-trade-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--cyan);
  font-size: 0.75rem;
  padding: 0.3rem 0.7rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-body);
  font-weight: 600;
}

.at-trade-btn:hover {
  background: rgba(0,212,255,0.1);
  border-color: var(--cyan);
}

/* ===================================
   SWAP SECTION
=================================== */
.swap-container {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(320px, 1.3fr);
  gap: 1.5rem;
  align-items: start;
}

.swap-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
}

.swap-panel {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.2rem;
  margin-bottom: 0.3rem;
  transition: border-color 0.2s;
}

.swap-panel:focus-within {
  border-color: var(--border-hover);
}

.sp-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sp-balance { color: var(--cyan); cursor: pointer; }

.sp-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sp-input {
  flex: 1;
  background: none;
  border: none;
  color: white;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  outline: none;
  width: 100%;
  min-width: 0;
}

.sp-input::placeholder { color: rgba(255,255,255,0.15); }

.sp-token-select {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.4rem 0.9rem;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  transition: all 0.2s;
  flex-shrink: 0;
}

.sp-token-select:hover {
  border-color: var(--border-hover);
  color: var(--cyan);
}

.st-icon {
  font-weight: 900;
  color: var(--cyan);
}

.sp-usd {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-top: 0.4rem;
}

.swap-switch {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  margin: 0.5rem auto;
  color: var(--cyan);
  font-size: 0.9rem;
  transition: all 0.3s;
}

.swap-switch:hover {
  background: rgba(0,212,255,0.1);
  border-color: var(--cyan);
  transform: rotate(180deg);
}

.swap-info {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin: 0.75rem 0;
}

.si-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 0.25rem 0;
}

.si-row span:last-child {
  color: var(--text-secondary);
  font-weight: 600;
}

.si-row span.low { color: var(--green); }
.si-row span.mid { color: var(--gold); }
.si-row span.high { color: var(--red); }

.swap-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--cyan-dark), var(--purple));
  color: white;
  border: none;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 0.9rem;
  border-radius: 10px;
  cursor: pointer;
  margin-top: 0.75rem;
  transition: all 0.3s;
  text-transform: uppercase;
}

.swap-btn:hover {
  filter: brightness(1.15);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0,212,255,0.4);
}

.swap-chart-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
}

.scb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.scb-pair {
  font-family: var(--font-display);
  font-size: 1rem;
  color: white;
  font-weight: 700;
}

.scb-timeframes {
  display: flex;
  gap: 0.3rem;
}

.tf-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-mono);
}

.tf-btn:hover, .tf-btn.active {
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(0,212,255,0.1);
}

.scb-stats {
  display: flex;
  gap: 1.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.scb-stats > div {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.scb-stats span {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.scb-stats strong {
  font-family: var(--font-mono);
  color: var(--text-primary);
  font-size: 0.9rem;
}

/* ===================================
   PERPETUAL CONTRACT
=================================== */
.perp-container {
  display: grid;
  grid-template-columns: 1fr minmax(300px, 360px);
  gap: 1.5rem;
}

.perp-chart-area {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
}

.perp-pair-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.pp-selector {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0,212,255,0.08);
  border: 1px solid rgba(0,212,255,0.2);
  border-radius: 8px;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  font-weight: 700;
  color: var(--text-primary);
}

.pp-icon {
  font-family: var(--font-display);
  font-weight: 900;
  color: var(--cyan);
  font-size: 1.1rem;
}

.pp-name {
  font-family: var(--font-display);
  font-size: 0.9rem;
}

.pp-mark {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 900;
  color: white;
}

.pp-change {
  font-weight: 700;
  font-size: 0.9rem;
}

.pp-stats {
  display: flex;
  gap: 1.5rem;
  margin-left: auto;
  font-size: 0.78rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.perp-order-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.pop-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.pot-btn {
  background: none;
  border: none;
  padding: 0.6rem;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.9rem;
  transition: all 0.2s;
  font-family: var(--font-body);
}

.pot-btn.long.active { background: var(--green); color: white; }
.pot-btn.short.active { background: var(--red); color: white; }
.pot-btn:not(.active) { color: var(--text-muted); }

.perp-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.pf-row label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.pf-input-wrap {
  display: flex;
  gap: 0;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.2s;
}

.pf-input-wrap:focus-within {
  border-color: var(--border-hover);
}

.pf-input {
  flex: 1;
  background: none;
  border: none;
  color: white;
  font-family: var(--font-mono);
  font-size: 1rem;
  padding: 0.6rem 0.8rem;
  outline: none;
}

.pf-max {
  background: rgba(0,212,255,0.1);
  color: var(--cyan);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.6rem 0.8rem;
  cursor: pointer;
  border-left: 1px solid var(--border);
  letter-spacing: 0.1em;
  transition: background 0.2s;
}

.pf-max:hover { background: rgba(0,212,255,0.2); }

.leverage-slider {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.leverage-slider input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: linear-gradient(to right, var(--cyan) 0%, var(--cyan) 12.5%, rgba(255,255,255,0.1) 12.5%);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.leverage-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--cyan);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(0,212,255,0.6);
}

.lev-val {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--cyan);
  min-width: 40px;
  text-align: right;
}

.lev-marks {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.lev-marks span {
  cursor: pointer;
  transition: color 0.2s;
}

.lev-marks span:hover { color: var(--cyan); }

.perp-calc {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
}

.pc-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  padding: 0.25rem 0;
}

.pc-row span:first-child { color: var(--text-muted); }
.pc-row span:last-child { font-weight: 700; color: var(--text-secondary); }

.risk-meter {
  margin-top: 0.5rem;
}

.rm-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.rm-bar {
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.3rem;
}

.rm-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease, background 0.5s ease;
}

.rm-level {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: right;
}

.open-long-btn {
  width: 100%;
  background: linear-gradient(135deg, #059669, #10b981);
  color: white;
  border: none;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 0.8rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
}

.open-long-btn:hover {
  filter: brightness(1.15);
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(16,185,129,0.4);
}

.open-long-btn.short-mode {
  background: linear-gradient(135deg, #b91c1c, #ef4444);
}

.pf-disclaimer {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
  padding: 0.5rem;
}

.positions-list {
  margin-top: 1.5rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.pl-header {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
}

.pl-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  gap: 0.5rem;
}

.pl-pair {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-primary);
  font-weight: 600;
}

.pl-side {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  margin-left: 0.3rem;
}

.pl-side.long { background: rgba(16,185,129,0.2); color: var(--green); }
.pl-side.short { background: rgba(239,68,68,0.2); color: var(--red); }

.pl-pnl {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
}

.pl-size {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.pl-close {
  background: none;
  border: 1px solid rgba(239,68,68,0.3);
  color: var(--red);
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.pl-close:hover {
  background: rgba(239,68,68,0.1);
  border-color: var(--red);
}

/* ===================================
   DUAL TOKEN
=================================== */
.dual-token-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.dt-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  transition: all 0.3s;
}

.dt-card:hover {
  border-color: var(--border-hover);
}

.dt-card.synapse { border-top: 3px solid var(--cyan); }
.dt-card.vpoint { border-top: 3px solid var(--purple-light); }

.dt-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.dt-logo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan-dark), var(--cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--bg-primary);
  box-shadow: 0 0 15px rgba(0,212,255,0.4);
  flex-shrink: 0;
}

.dt-logo.vpt {
  background: linear-gradient(135deg, var(--purple), var(--purple-light));
  color: white;
  box-shadow: 0 0 15px rgba(124,58,237,0.4);
}

.dt-name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: white;
}

.dt-role {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.dt-price-badge {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: white;
  text-align: right;
  white-space: nowrap;
}

.dt-balance-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.dtb-item {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
  text-align: center;
}

.dtb-item span {
  display: block;
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.3rem;
}

.dtb-item strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-primary);
  word-break: break-all;
}

.dtb-item small {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.dt-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.dt-burn-info {
  font-size: 0.78rem;
  color: var(--text-muted);
  background: rgba(239,68,68,0.05);
  border: 1px solid rgba(239,68,68,0.15);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
}

.dt-burn-info strong {
  color: var(--text-secondary);
}

/* ===================================
   TOKEN FLOW VIZ
=================================== */
.token-flow-viz {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  margin-top: 1.5rem;
  overflow-x: auto;
}

.token-flow-viz h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  color: white;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.token-flow-viz h3 i { color: var(--cyan); }

.tfv-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  min-width: 540px;
}

.tfv-node {
  background: rgba(0,212,255,0.08);
  border: 1px solid rgba(0,212,255,0.3);
  border-radius: 10px;
  padding: 0.75rem 1.2rem;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
  min-width: 100px;
}

.tfv-node small {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 400;
}

.tfv-node.wallet-node { border-color: rgba(124,58,237,0.5); background: rgba(124,58,237,0.08); }
.tfv-node.vpoint-node { border-color: rgba(0,212,255,0.5); }
.tfv-node.synapse-node { border-color: rgba(16,185,129,0.5); background: rgba(16,185,129,0.05); }
.tfv-node.synapse-token { border-color: rgba(245,158,11,0.5); background: rgba(245,158,11,0.05); }

.tfv-arrow {
  text-align: center;
  color: var(--cyan);
  font-size: 1.2rem;
}

.tfv-arrow small {
  display: block;
  font-size: 0.65rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.tfv-arrow.back { color: var(--gold); }

/* ===================================
   NFT GRID
=================================== */
.nft-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 1.2rem;
}

.nft-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s;
  cursor: pointer;
}

.nft-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

.nft-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-card));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}

.nft-body {
  padding: 0.75rem;
}

.nft-name {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: white;
  margin-bottom: 0.3rem;
}

.nft-rank-badge {
  font-size: 0.65rem;
  padding: 0.1rem 0.4rem;
  border-radius: 8px;
  font-weight: 700;
  display: inline-block;
  margin-bottom: 0.5rem;
}

.nft-rank-badge.legendary { background: linear-gradient(135deg,#f59e0b,#ef4444); color:white; }
.nft-rank-badge.rare { background: rgba(124,58,237,0.3); color:var(--purple-light); border: 1px solid rgba(124,58,237,0.5); }
.nft-rank-badge.elite { background: rgba(0,212,255,0.1); color:var(--cyan); border: 1px solid rgba(0,212,255,0.3); }

.nft-value {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--gold);
  font-weight: 600;
}

.nft-income {
  font-size: 0.7rem;
  color: var(--green);
  margin-top: 0.2rem;
}

/* ===================================
   PREDICT MARKET
=================================== */
.predict-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.predict-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  transition: all 0.3s;
}

.predict-card:hover {
  border-color: var(--border-hover);
}

.pc-category {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
}

.pc-category.world { color: var(--cyan); }
.pc-category.token { color: var(--gold); }
.pc-category.agent { color: var(--purple-light); }

.pc-question {
  font-size: 0.9rem;
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.pc-options {
  margin-bottom: 0.75rem;
}

.pco {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
  position: relative;
  overflow: hidden;
}

.pco.yes { background: rgba(16,185,129,0.1); color: var(--green); }
.pco.no { background: rgba(239,68,68,0.1); color: var(--red); }

.pco-bar {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  background: currentColor;
  opacity: 0.1;
  border-radius: 6px;
  z-index: 0;
}

.pco span { position: relative; z-index: 1; }

.pc-footer {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
  margin-bottom: 0.75rem;
}

.pc-bet-row {
  display: flex;
  gap: 0.4rem;
}

.pc-input {
  flex: 1;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: white;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 0.4rem 0.6rem;
  outline: none;
  min-width: 0;
}

.pc-bet-yes, .pc-bet-no {
  border: none;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  transition: all 0.2s;
}

.pc-bet-yes { background: rgba(16,185,129,0.2); color: var(--green); }
.pc-bet-no { background: rgba(239,68,68,0.2); color: var(--red); }

.pc-bet-yes:hover { background: rgba(16,185,129,0.4); }
.pc-bet-no:hover { background: rgba(239,68,68,0.4); }

/* ===================================
   BRIDGE
=================================== */
.bridge-container {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: center;
  max-width: 700px;
  margin: 0 auto;
}

.bridge-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
}

.bp-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
}

.bp-chain-select {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.8rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
  transition: all 0.2s;
}

.bp-chain-select:hover { border-color: var(--border-hover); }

.bp-amount {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
}

.bp-input {
  flex: 1;
  background: none;
  border: none;
  color: white;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  outline: none;
  min-width: 0;
}

.bp-token {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--cyan);
  font-weight: 600;
}

.bp-bal {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.bridge-arrow {
  font-size: 1.5rem;
  color: var(--cyan);
  cursor: pointer;
  transition: transform 0.3s;
  text-align: center;
}

.bridge-arrow:hover { transform: scale(1.2); }

.bridge-info {
  display: flex;
  justify-content: center;
  gap: 2rem;
  padding: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.bridge-info > div {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.bridge-info span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.bridge-info strong {
  font-family: var(--font-mono);
  color: var(--text-primary);
}

/* ===================================
   HISTORY
=================================== */
.history-filters {
  display: flex;
  gap: 0.3rem;
  margin-left: auto;
  flex-wrap: wrap;
}

.hf-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 0.25rem 0.7rem;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font-body);
  transition: all 0.2s;
}

.hf-btn:hover, .hf-btn.active {
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(0,212,255,0.08);
}

.tx-list {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.tx-item {
  display: grid;
  grid-template-columns: 36px 1fr 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  transition: background 0.2s;
}

.tx-item:hover { background: rgba(255,255,255,0.02); }
.tx-item:last-child { border-bottom: none; }

.tx-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.tx-icon.swap { background: rgba(0,212,255,0.15); color: var(--cyan); }
.tx-icon.earn { background: rgba(16,185,129,0.15); color: var(--green); }
.tx-icon.stake { background: rgba(124,58,237,0.15); color: var(--purple-light); }
.tx-icon.buy { background: rgba(245,158,11,0.15); color: var(--gold); }

.tx-type {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.tx-detail {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
  font-family: var(--font-mono);
}

.tx-amount {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
  text-align: right;
}

.tx-time {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: right;
}

/* ===================================
   TOAST
=================================== */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.5rem;
  color: var(--text-primary);
  font-size: 0.9rem;
  z-index: 9999;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: all 0.3s;
  max-width: 300px;
  box-shadow: 0 5px 30px rgba(0,0,0,0.5);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

.toast.success { border-color: rgba(16,185,129,0.5); }
.toast.error { border-color: rgba(239,68,68,0.5); }

/* ===================================
   MODAL
=================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  backdrop-filter: blur(5px);
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-hover);
  border-radius: 16px;
  width: 90%;
  max-width: 480px;
  overflow: hidden;
  transform: scale(0.9);
  transition: transform 0.3s;
}

.modal-overlay.open .modal {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: white;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  transition: color 0.2s;
}

.modal-close:hover { color: var(--text-primary); }

.modal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.stake-apy {
  text-align: center;
  padding: 1rem;
  background: linear-gradient(135deg, rgba(0,212,255,0.1), rgba(124,58,237,0.1));
  border-radius: 12px;
  border: 1px solid var(--border);
}

.sa-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.sa-val {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--cyan);
}

.stake-tiers {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.st-item {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.9rem;
}

.st-item:hover, .st-item.active {
  border-color: var(--border-hover);
  background: rgba(0,212,255,0.05);
}

.st-item.active {
  border-color: rgba(0,212,255,0.5);
}

.stake-preview {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
}

.sp-preview-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  padding: 0.25rem 0;
}

.sp-preview-row span:first-child { color: var(--text-muted); }

/* ===================================
   CHART CANVAS WRAPPERS
=================================== */
.swap-chart-canvas-wrap {
  position: relative;
  height: 200px;
  width: 100%;
}

.perp-chart-canvas-wrap {
  position: relative;
  height: 280px;
  width: 100%;
}

.token-chart-wrap {
  position: relative;
  height: 120px;
  width: 100%;
  margin: 1rem 0;
}

.portfolio-chart-wrap {
  position: relative;
  height: 110px;
  width: 100%;
}

/* ===================================
   RESPONSIVE
=================================== */
@media (max-width: 1200px) {
  .wsection { padding: 1.75rem 2rem; }
}

@media (max-width: 1100px) {
  .perp-container { grid-template-columns: 1fr; }
  .dual-token-grid { grid-template-columns: 1fr; }
  .swap-container { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .wallet-layout { grid-template-columns: 1fr; }
  .wallet-sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
    gap: 0;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .wallet-avatar { display: none; }
  .sidebar-menu {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 0;
    gap: 0.2rem;
    flex: 1;
  }
  .smenu-item { padding: 0.4rem 0.65rem; font-size: 0.78rem; gap: 0.4rem; }
  .smenu-item i { width: auto; }
  .chain-selector { display: none; }
  .wsection { padding: 1.5rem; }
  .at-header, .at-row { grid-template-columns: 2fr 1.2fr 1.2fr 1fr; min-width: 420px; }
  /* hide Price and Action columns on tablet */
  .at-header span:nth-child(3),
  .at-row > span:nth-child(3) { display: none; }
  .at-header span:last-child,
  .at-row > span:last-child { display: none; }
}

@media (max-width: 600px) {
  .balance-hero {
    grid-template-columns: 1fr;
    padding: 1.25rem;
  }
  .bh-right { display: none; }
  .bh-value { font-size: 2rem; }
  .bh-actions { gap: 0.5rem; }
  .bh-actions button { flex: 1; min-width: 70px; justify-content: center; }
  .bridge-container { grid-template-columns: 1fr; }
  .bridge-arrow { transform: rotate(90deg); margin: 0 auto; }
  .wsection { padding: 1rem; }
  .wsection-header h2 { font-size: 1rem; }
  .dual-token-grid { gap: 1rem; }
  .dt-balance-row { grid-template-columns: 1fr 1fr; }
  .dt-balance-row .dtb-item:last-child { grid-column: 1 / -1; }
  .predict-grid { grid-template-columns: 1fr; }
  .nft-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
