:root {
  --primary: #00d4aa;
  --primary-light: #00f5c4;
  --primary-dark: #00a884;
  --primary-glow: rgba(0, 212, 170, 0.15);
  --bg: #070a0f;
  --bg-elevated: #0d1117;
  --bg-card: #111820;
  --bg-hover: #161f2e;
  --bg-input: #0a0f16;
  --border: #1e2d3d;
  --border-light: #2a3f56;
  --text: #f0f6fc;
  --text-secondary: #8b949e;
  --text-muted: #484f58;
  --success: #00d4aa;
  --warning: #f0883e;
  --error: #ff4444;
  --info: #58a6ff;
  --gradient-start: #00d4aa;
  --gradient-end: #00a884;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

body {
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  min-height: 100vh;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  background: var(--bg);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes slideDown {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@keyframes scaleIn {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.screen {
  animation: fadeIn 0.25s ease-out;
  min-height: 100vh;
  padding-bottom: 80px;
}

/* ===== METAMASK-STYLE HEADER ===== */
.mm-header {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: var(--bg-elevated);
  backdrop-filter: blur(20px);
  z-index: 100;
  border-bottom: 1px solid var(--border);
}

.mm-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mm-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mm-menu-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text);
}

.mm-menu-btn:hover {
  background: var(--bg-hover);
}

.mm-menu-btn svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

/* Account Selector (MetaMask style) */
.account-selector {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 13px;
  font-weight: 600;
}

.account-selector:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.account-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: var(--text);
}

.account-selector svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  stroke: var(--text);
}

/* Account Selector uses var(--text) for light theme */
.account-selector, .mm-header-left, .mm-menu-btn {
  color: var(--text);
}

/* Network Badge */
.network-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.network-badge svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.network-badge:hover {
  border-color: var(--primary);
}

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

/* ===== METAMASK BALANCE SECTION ===== */
.mm-balance-section {
  padding: 20px 16px 16px;
  text-align: center;
}

.mm-balance-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.mm-balance-label svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.mm-balance-amount {
  font-size: 32px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 4px;
}

.mm-balance-fiat {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.mm-balance-change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  background: rgba(0, 212, 170, 0.15);
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--success);
}

.mm-balance-change.negative {
  background: rgba(255, 68, 68, 0.15);
  color: var(--error);
}

/* ===== ACTION BUTTONS (MetaMask style row) ===== */
.mm-actions {
  display: flex;
  justify-content: center;
  gap: 48px;
  padding: 0 16px 20px;
}

.mm-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.mm-action:active {
  transform: scale(0.95);
}

.mm-action-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 212, 170, 0.25);
  transition: all 0.2s;
  color: var(--text);
}

.mm-action:hover .mm-action-circle {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 212, 170, 0.35);
}

.mm-action-circle svg {
  width: 20px;
  height: 20px;
  stroke: white;
  fill: none;
  stroke-width: 2;
}

.mm-action-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ===== TABS (MetaMask Tokens/NFT style) ===== */
.mm-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin: 0 16px;
}

.mm-tab {
  flex: 1;
  padding: 12px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.mm-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* ===== TOKEN LIST (MetaMask style) ===== */
.token-list {
  padding: 8px 16px;
}

.token-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
}

.token-item:last-child {
  border-bottom: none;
}

.token-item:hover {
  opacity: 0.8;
}

.token-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  background: linear-gradient(135deg, #1a2a3a, #2a3a4a);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.token-icon.eth { background: linear-gradient(135deg, #627eea33, #627eea66); color: #627eea; }
.token-icon.btc { background: linear-gradient(135deg, #f7931a33, #f7931a66); color: #f7931a; }
.token-icon.usdt { background: linear-gradient(135deg, #26a17b33, #26a17b66); color: #26a17b; }

.token-details {
  flex: 1;
  min-width: 0;
}

.token-name {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 2px;
}

.token-sub {
  font-size: 13px;
  color: var(--text-secondary);
}

.token-value {
  text-align: right;
  flex-shrink: 0;
}

.token-amount {
  font-weight: 700;
  font-size: 15px;
}

.token-price {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ===== ACTIVITY LIST ===== */
.activity-list {
  padding: 8px 16px;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.activity-icon.sent { background: rgba(255, 68, 68, 0.15); }
.activity-icon.sent svg { stroke: var(--error); }
.activity-icon.received { background: rgba(0, 212, 170, 0.15); }
.activity-icon.received svg { stroke: var(--success); }
.activity-icon.swap { background: rgba(88, 166, 255, 0.15); }
.activity-icon.swap svg { stroke: var(--info); }
.activity-icon.approve { background: rgba(240, 136, 62, 0.15); }
.activity-icon.approve svg { stroke: var(--warning); }

.activity-icon svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
  fill: none;
}

.activity-details {
  flex: 1;
  min-width: 0;
}

.activity-title {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 2px;
}

.activity-sub {
  font-size: 13px;
  color: var(--text-secondary);
}

.activity-status {
  text-align: right;
  flex-shrink: 0;
}

.activity-amount {
  font-weight: 700;
  font-size: 15px;
}

.activity-amount.sent { color: var(--error); }
.activity-amount.received { color: var(--success); }
.activity-amount.swap { color: var(--info); }

.activity-status-text {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.activity-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
}

.activity-status-dot.pending {
  background: var(--warning);
  animation: pulse 2s infinite;
}

/* Activity Chevron */
.activity-chevron {
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-muted);
  margin-left: 4px;
}

.activity-chevron svg {
  width: 12px;
  height: 12px;
}

/* View All Activity Button */
.view-all-activity {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  margin: 8px 16px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 600;
  font-size: 14px;
  color: var(--primary);
}

.view-all-activity:hover {
  border-color: var(--primary);
  background: var(--primary-glow);
}

.view-all-activity svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  stroke: var(--primary);
}

/* ===== BOTTOM NAV (MetaMask 3-tab style) ===== */
.mm-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: rgba(13, 17, 23, 0.95);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  z-index: 1000;
}

.mm-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 8px;
  transition: all 0.2s;
  border-radius: 12px;
  color: var(--text-secondary);
}

.mm-nav-item.active {
  color: var(--primary);
}

.mm-nav-item:hover {
  background: var(--bg-hover);
}

.mm-nav-item svg {
  width: 24px;
  height: 24px;
  stroke-width: 2;
  fill: none;
  stroke: currentColor;
}

.mm-nav-label {
  font-size: 11px;
  font-weight: 600;
}

/* ===== MODALS (MetaMask bottom sheet style) ===== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 2000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.2s ease-out;
}

.modal-sheet {
  width: 100%;
  max-width: 480px;
  background: var(--bg-elevated);
  border-radius: 24px 24px 0 0;
  padding: 20px;
  animation: slideUp 0.3s ease-out;
  max-height: 85vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
  font-size: 18px;
  transition: all 0.2s;
}

.modal-close:hover {
  background: var(--bg-hover);
}

/* Account List Modal */
.account-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.account-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.account-item:hover {
  background: var(--bg-hover);
  border-color: var(--border);
}

.account-item.active {
  border-color: var(--primary);
  background: var(--primary-glow);
}

.account-item-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  flex-shrink: 0;
}

.account-item-info {
  flex: 1;
  min-width: 0;
}

.account-item-name {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 2px;
}

.account-item-balance {
  font-size: 13px;
  color: var(--text-secondary);
}

.account-item-check {
  color: var(--primary);
  flex-shrink: 0;
}

/* Network List */
.network-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.network-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.network-item:hover {
  background: var(--bg-hover);
}

.network-item.active {
  background: var(--primary-glow);
}

.network-item-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.network-item-info {
  flex: 1;
}

.network-item-name {
  font-weight: 600;
  font-size: 14px;
}

.network-item-status {
  font-size: 12px;
  color: var(--success);
}

/* Receive List */
.receive-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.receive-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
}

.receive-item:hover {
  border-color: var(--border-light);
  background: var(--bg-hover);
}

.receive-item-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.receive-item-info {
  flex: 1;
  min-width: 0;
}

.receive-item-name {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 2px;
}

.receive-item-address {
  font-size: 13px;
  color: var(--text-secondary);
  font-family: 'SF Mono', monospace;
}

.receive-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.receive-action-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-secondary);
}

.receive-action-btn:hover {
  background: var(--primary-glow);
  border-color: var(--primary);
  color: var(--primary);
}

.receive-action-btn svg {
  width: 18px;
  height: 18px;
}

/* ===== PORTFOLIO ===== */
.portfolio-stats {
  padding: 24px 16px;
  text-align: center;
}

.portfolio-total-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.portfolio-total {
  font-size: 32px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.portfolio-change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
}

.portfolio-change.positive {
  background: rgba(0, 212, 170, 0.15);
  color: var(--success);
}

.portfolio-change.negative {
  background: rgba(255, 68, 68, 0.15);
  color: var(--error);
}

/* Portfolio Chart */
.portfolio-chart-area {
  padding: 20px 16px;
  border-bottom: 1px solid var(--border);
}

.portfolio-chart-svg {
  width: 100%;
  height: 160px;
  overflow: visible;
}

.chart-labels {
  display: flex;
  justify-content: space-between;
  padding: 8px 4px 0;
}

.chart-labels span {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 600;
}

/* Token Network Selector */
.token-network-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 13px;
  font-weight: 600;
}

.token-network-selector:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.token-network-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  flex-shrink: 0;
}

.token-network-name {
  color: var(--text);
}

.token-network-selector svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  stroke: var(--text-secondary);
}

.token-list-header {
  display: flex;
  justify-content: space-between;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}

/* Token Icon dynamic color override */
.token-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

/* Network list modal enhancements */
.network-item-info {
  flex: 1;
}

.network-item-name {
  font-weight: 600;
  font-size: 14px;
}

.token-detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 16px 8px;
}

.token-detail-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 20px;
  border: 1px solid var(--border);
}

.token-detail-name {
  font-size: 20px;
  font-weight: 700;
}

.token-detail-price {
  font-size: 32px;
  font-weight: 800;
  padding: 0 16px 4px;
  letter-spacing: -0.02em;
}

.token-detail-change {
  padding: 0 16px 16px;
  font-size: 14px;
  font-weight: 600;
}

.token-detail-change.positive {
  color: var(--success);
}

.token-detail-change.negative {
  color: var(--error);
}

.token-detail-chart-area {
  padding: 0 16px 12px;
}

.token-detail-chart-svg {
  width: 100%;
  height: 120px;
  overflow: visible;
}

.token-detail-timeframes {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 0 16px 16px;
}

.token-detail-timeframes span {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  background: var(--bg-hover);
  transition: all 0.2s;
}

.token-detail-timeframes span.active {
  background: var(--primary-glow);
  color: var(--primary);
}

/* Token Detail Actions - Main screen style */
.token-detail-actions {
  display: flex;
  justify-content: center;
  gap: 32px;
  padding: 20px 16px;
}

.token-detail-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.token-detail-action:active {
  transform: scale(0.95);
}

.token-detail-action-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 212, 170, 0.25);
  transition: all 0.2s;
  color: var(--text);
}

.token-detail-action:hover .token-detail-action-icon {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 212, 170, 0.35);
}

.token-detail-action-icon svg {
  width: 20px;
  height: 20px;
  stroke: white;
  fill: none;
  stroke-width: 2;
}

.token-detail-action-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.token-balance-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.token-balance-amount {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.token-balance-usd {
  font-size: 14px;
  color: var(--text-secondary);
}

.token-detail-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.token-detail-stat-row:last-child {
  border-bottom: none;
}

.token-detail-stat-label {
  font-size: 14px;
  color: var(--text-secondary);
}

.token-detail-stat-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.token-detail-stat-row:last-child {
  border-bottom: none;
}

.token-detail-stat-label {
  font-size: 14px;
  color: var(--text-secondary);
}

.token-detail-stat-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

/* Old bar chart styles removed - now line chart via SVG */

.portfolio-section {
  padding: 20px 16px;
  border-bottom: 1px solid var(--border);
}

.portfolio-section:last-child {
  border-bottom: none;
}

.portfolio-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.portfolio-allocation {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.allocation-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.allocation-color {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.allocation-info {
  flex: 1;
}

.allocation-name {
  font-weight: 700;
  font-size: 15px;
}

.allocation-amount {
  font-size: 13px;
  color: var(--text-secondary);
}

.allocation-value {
  text-align: right;
}

.allocation-usd {
  font-weight: 700;
  font-size: 15px;
}

.allocation-percent {
  font-size: 13px;
  color: var(--text-secondary);
}

.allocation-bar {
  height: 4px;
  background: var(--bg-hover);
  border-radius: 2px;
  overflow: hidden;
}

.allocation-fill {
  height: 100%;
  border-radius: 2px;
}

.portfolio-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
}

.portfolio-stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.portfolio-stat-value {
  font-weight: 700;
  font-size: 16px;
}

.portfolio-stat-value.positive {
  color: var(--success);
}

.portfolio-stat-value.negative {
  color: var(--error);
}

/* ===== SEND FLOW ===== */
.send-header {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.send-header-title {
  font-size: 16px;
  font-weight: 700;
}

.send-header-btn {
  padding: 8px 16px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.send-header-btn:hover {
  background: var(--bg-hover);
}

.send-section {
  padding: 16px;
}

.send-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.send-input-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
}

.send-input {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 16px;
  outline: none;
  font-family: inherit;
}

.send-input::placeholder {
  color: var(--text-muted);
}

.send-asset-select {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-input);
  border-radius: 20px;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  width: fit-content;
  margin-top: 8px;
}

.send-asset-select svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.send-amount-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}

.send-amount-input {
  font-size: 28px;
  font-weight: 700;
  background: transparent;
  border: none;
  color: var(--text);
  outline: none;
  width: 60%;
  font-family: inherit;
}

.send-amount-input::placeholder {
  color: var(--text-muted);
}

.send-amount-max {
  padding: 4px 12px;
  border-radius: 8px;
  background: var(--primary-glow);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border: none;
}

.send-balance-info {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Gas Selector */
.gas-options {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.gas-option {
  flex: 1;
  padding: 12px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.gas-option:hover {
  border-color: var(--border-light);
}

.gas-option.selected {
  border-color: var(--primary);
  background: var(--primary-glow);
}

.gas-option-name {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 4px;
}

.gas-option-time {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.gas-option-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
}

/* Confirm Button */
.confirm-btn {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  padding: 16px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--text);
  border: none;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 -4px 16px rgba(0, 212, 170, 0.3);
}

.confirm-btn:hover {
  opacity: 0.9;
}

/* ===== TRANSACTION DETAIL ===== */
.tx-detail-header {
  padding: 16px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.tx-detail-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
}

.tx-detail-status.confirmed {
  background: rgba(0, 212, 170, 0.15);
  color: var(--success);
}

.tx-detail-status.pending {
  background: rgba(240, 136, 62, 0.15);
  color: var(--warning);
}

.tx-detail-amount {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 4px;
}

.tx-detail-token {
  font-size: 16px;
  color: var(--text-secondary);
}

.tx-detail-section {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.tx-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
}

.tx-detail-label {
  font-size: 14px;
  color: var(--text-secondary);
}

.tx-detail-value {
  font-size: 14px;
  font-weight: 600;
  word-break: break-all;
  max-width: 60%;
  text-align: right;
}

.tx-detail-value.address {
  font-family: monospace;
  font-size: 12px;
}

/* ===== WELCOME SCREEN ===== */
.welcome-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 40px 24px;
  text-align: center;
  position: relative;
}

.welcome-logo {
  width: 100px;
  height: 100px;
  border-radius: 28px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  box-shadow: 0 8px 32px rgba(0, 212, 170, 0.3);
  animation: float 3s ease-in-out infinite;
}

.welcome-logo svg {
  width: 48px;
  height: 48px;
  stroke: white;
  fill: none;
  stroke-width: 2;
}

.welcome-title {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 8px;
}

.welcome-subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 40px;
  line-height: 1.5;
}

.welcome-buttons {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn {
  width: 100%;
  padding: 16px;
  border-radius: 16px;
  border: none;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--text);
  box-shadow: 0 4px 16px rgba(0, 212, 170, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 212, 170, 0.4);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
}

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

.security-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 24px;
}

.security-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

.security-badge svg {
  width: 12px;
  height: 12px;
  stroke: var(--success);
  fill: none;
  stroke-width: 2.5;
}

/* ===== SWAP SCREEN ===== */
.swap-container {
  padding: 16px;
}

.swap-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 16px;
  margin-bottom: 12px;
}

.swap-token-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.swap-token-select {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 700;
  font-size: 16px;
}

.swap-token-select svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.swap-token-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1a2a3a, #2a3a4a);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  border: 1px solid var(--border);
}

.swap-amount {
  font-size: 24px;
  font-weight: 700;
  background: transparent;
  border: none;
  color: var(--text);
  outline: none;
  text-align: right;
  width: 50%;
  font-family: inherit;
}

.swap-amount::placeholder {
  color: var(--text-muted);
}

.swap-balance {
  font-size: 12px;
  color: var(--text-secondary);
}

.swap-divider {
  display: flex;
  justify-content: center;
  margin: -20px 0;
  position: relative;
  z-index: 1;
}

.swap-switch-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.swap-switch-btn:hover {
  transform: rotate(180deg);
  border-color: var(--primary);
}

.swap-switch-btn svg {
  width: 18px;
  height: 18px;
  stroke: var(--primary);
  fill: none;
  stroke-width: 2;
}

.swap-details {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
}

.swap-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 14px;
}

.swap-detail-label {
  color: var(--text-secondary);
}

.swap-detail-value {
  font-weight: 600;
}

/* ===== SETTINGS ===== */
.settings-group {
  margin: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.settings-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
}

.settings-item:last-child {
  border-bottom: none;
}

.settings-item:hover {
  background: var(--bg-hover);
}

.settings-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--bg-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--primary);
}

.settings-icon svg {
  width: 18px;
  height: 18px;
  stroke: var(--primary);
  fill: none;
  stroke-width: 2;
}

.settings-info {
  flex: 1;
  min-width: 0;
}

.settings-title {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 2px;
}

.settings-desc {
  font-size: 13px;
  color: var(--text-secondary);
}

.settings-arrow {
  color: var(--text-muted);
  font-size: 18px;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.settings-arrow svg {
  width: 14px;
  height: 14px;
}

.toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.toggle-row:last-child {
  border-bottom: none;
}

.toggle {
  width: 48px;
  height: 28px;
  border-radius: 14px;
  background: var(--bg-hover);
  position: relative;
  cursor: pointer;
  transition: all 0.3s;
  flex-shrink: 0;
}

.toggle.active {
  background: var(--primary);
}

.toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: white;
  transition: all 0.3s;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.toggle.active .toggle-knob {
  left: 22px;
}

/* ===== NFT GRID ===== */
.nft-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 16px;
}

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

.nft-item:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: 0 8px 20px rgba(0, 212, 170, 0.15);
}

.nft-image {
  width: 100%;
  aspect-ratio: 1;
  background: linear-gradient(135deg, #1a2a3a, #2a3a4a);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
}

.nft-info {
  padding: 12px;
}

.nft-name {
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nft-collection {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ===== DAPPS ===== */
.dapp-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  margin: 0 16px 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.dapp-item:hover {
  border-color: var(--primary);
  transform: translateX(4px);
}

.dapp-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(135deg, #1a2a3a, #2a3a4a);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.dapp-info {
  flex: 1;
  min-width: 0;
}

.dapp-name {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 2px;
}

.dapp-desc {
  font-size: 13px;
  color: var(--text-secondary);
}

.mm-nav-item svg {
  width: 24px;
  height: 24px;
  stroke-width: 2;
  fill: none;
  stroke: currentColor;
}

/* ===== SVG GLOBAL FIX ===== */
svg {
  stroke-width: 2;
  fill: none;
  stroke: currentColor;
}

/* Ensure all icons are visible */
.mm-menu-btn svg,
.mm-action-circle svg,
.modal-close svg,
.settings-icon svg {
  stroke: var(--text);
  fill: none;
}

.mm-nav-item.active svg {
  stroke: var(--primary);
}

/* Fix for inline SVG icons */
.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon svg {
  width: 100%;
  height: 100%;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
  #app {
    max-width: 100%;
  }
}
/* Fix Scan/Contacts icon sizes */
.send-input-box svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Fix all small inline SVG icons */
button svg,
[onclick] svg {
  max-width: 24px;
  max-height: 24px;
}

/* Force small icon sizes for Scan/Contacts */
.send-input-box > div:last-child > div svg,
.send-input-box > div:last-child svg {
  width: 16px !important;
  height: 16px !important;
  max-width: 16px !important;
  max-height: 16px !important;
  flex-shrink: 0 !important;
}

/* Swap Chain Selector */
.swap-chain-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.swap-chain-badge:hover {
  border-color: var(--primary);
}

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

.swap-chain-badge svg {
  width: 12px;
  height: 12px;
  stroke: var(--text-secondary);
}

/* Swap Chain Selector */
.swap-chain-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.swap-chain-badge:hover {
  border-color: var(--primary);
}

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

.swap-chain-badge svg {
  width: 12px;
  height: 12px;
  stroke: var(--text-secondary);
}

/* Animations */
@keyframes scanLine {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(200px); }
}

@keyframes toastIn {
  from { transform: translateX(-50%) translateY(20px); opacity: 0; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

/* Haptic Feedback */
.btn:active,
.mm-action:active,
.token-detail-action:active,
.mm-tab:active,
.settings-item:active,
.dapp-item:active,
.gas-option:active,
.portfolio-stat-card:active,
.token-item:active,
.activity-item:active,
.receive-item:active {
  transform: scale(0.97);
  transition: transform 0.1s;
}

/* Skeleton Loaders */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton {
  background: linear-gradient(90deg, var(--bg-hover) 25%, var(--bg-card) 50%, var(--bg-hover) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}

.skeleton-text {
  height: 14px;
  margin-bottom: 8px;
}

.skeleton-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.skeleton-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
}

/* Smooth screen transitions */
.screen {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Chart line animation */
.chart-line {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: drawLine 1.5s ease forwards;
}

@keyframes drawLine {
  to { stroke-dashoffset: 0; }
}

/* Pull to refresh indicator */
.ptr-indicator {
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 24px;
  border: 2px solid var(--primary);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  opacity: 0;
  transition: opacity 0.3s;
}

.ptr-pulling .ptr-indicator {
  opacity: 1;
}

@keyframes spin {
  to { transform: translateX(-50%) rotate(360deg); }
}

/* Toggle smooth transition */
.toggle-knob {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toggle {
  transition: background 0.3s ease;
}
