:root {
  --bg-main: #0a0b0e;
  --bg-card: #13141a;
  --bg-input: #1b1c24;
  --bg-input-hover: #21232d;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #f59e0b;
  --primary: #f59e0b;
  --primary-hover: #d97706;
  --primary-glow: rgba(245, 158, 11, 0.25);
  --text-main: #ffffff;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;
  --green: #10b981;
  --red: #ef4444;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 8px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

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

/* ======================================================== */
/* 🛡️ VIEW PANELS & UNIVERSAL HIDDEN UTILITIES */
/* ======================================================== */
.hidden {
  display: none !important;
}

.view-panel {
  display: block;
  animation: fadeIn 0.2s ease-in-out;
}

.view-panel.hidden {
  display: none !important;
}

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


body {
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(circle at 50% 10%, rgba(245, 158, 11, 0.07) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(59, 130, 246, 0.04) 0%, transparent 40%);
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 28px;
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(12px);
  background: rgba(10, 11, 14, 0.7);
  position: sticky;
  top: 0;
  z-index: 50;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-main);
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  box-shadow: 0 0 15px var(--primary-glow);
}

.brand-name {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.brand-accent {
  color: var(--primary);
}

.chain-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
}

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

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

.btn {
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.btn-network {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-network:hover {
  background: var(--bg-input);
  border-color: var(--border-focus);
}

.btn-primary {
  background: var(--primary);
  color: #000;
  box-shadow: 0 2px 10px var(--primary-glow);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

/* Main Content */
.main-content {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 30px 16px;
}

.swap-card {
  width: 100%;
  max-width: 480px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  position: relative;
}

/* Swap Header */
.swap-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.swap-tabs {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.tab-btn.active {
  color: var(--primary);
  font-weight: 700;
  border-bottom: 2px solid var(--primary);
  background: rgba(245, 158, 11, 0.08);
}

.tab-link {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
}

.tab-link:hover {
  color: var(--text-muted);
}

.btn-icon {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-icon:hover {
  background: var(--bg-input);
  color: var(--text-main);
}

/* Settings Panel */
.settings-panel {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 16px;
}

.settings-panel.hidden {
  display: none;
}

.settings-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.slippage-options {
  display: flex;
  gap: 8px;
}

.slippage-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  flex: 1;
  transition: all 0.2s;
}

.slippage-btn.active, .slippage-btn:hover {
  background: var(--primary);
  color: #000;
  border-color: var(--primary);
}

.slippage-custom {
  position: relative;
  flex: 1.2;
}

.slippage-custom input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 6px 20px 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  text-align: right;
  outline: none;
}

.slippage-custom input:focus {
  border-color: var(--border-focus);
}

.slippage-custom span {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: var(--text-dim);
}

/* Input Boxes */
.token-input-box {
  background: var(--bg-input);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 16px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.token-input-box:focus-within {
  border-color: var(--border-focus);
  background: var(--bg-input-hover);
}

.input-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.balance-display {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-max {
  background: rgba(245, 158, 11, 0.15);
  border: none;
  color: var(--primary);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
}

.btn-max:hover {
  background: rgba(245, 158, 11, 0.3);
}

.input-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.token-amount-input {
  background: none;
  border: none;
  outline: none;
  font-size: 28px;
  font-weight: 600;
  color: var(--text-main);
  width: 100%;
  font-family: var(--font-sans);
}

.token-amount-input::placeholder {
  color: var(--text-dim);
}

.token-select-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: 24px;
  color: var(--text-main);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.token-select-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.token-icon {
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  max-width: 28px;
  max-height: 28px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  flex-shrink: 0;
  border-radius: 50%;
  display: block;
}

.chevron {
  font-size: 10px;
  color: var(--text-dim);
}

.input-footer {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-dim);
}

/* Switch Button */
.switch-container {
  display: flex;
  justify-content: center;
  margin: -10px 0;
  position: relative;
  z-index: 10;
}

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

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

/* Swap Details */
.swap-details {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
}

.swap-details.hidden {
  display: none;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.detail-value {
  color: var(--text-main);
  font-weight: 500;
}

.detail-value.mono {
  font-family: var(--font-mono);
  font-size: 12px;
}

.text-green {
  color: var(--green);
}

/* Big Action Button */
.btn-action {
  width: 100%;
  margin-top: 16px;
  padding: 18px;
  background: var(--primary);
  color: #000;
  border-radius: var(--radius-md);
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-action:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-action:disabled {
  background: var(--bg-input);
  color: var(--text-dim);
  cursor: not-allowed;
  box-shadow: none;
}

/* Status Toast */
.status-toast {
  margin-top: 14px;
  padding: 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  text-align: center;
}

.status-toast.hidden {
  display: none;
}

.status-toast.success {
  background: rgba(16, 185, 129, 0.15);
  color: var(--green);
  border: 1px solid var(--green);
}

.status-toast.error {
  background: rgba(239, 68, 68, 0.15);
  color: var(--red);
  border: 1px solid var(--red);
}

.status-toast.info {
  background: rgba(245, 158, 11, 0.15);
  color: var(--primary);
  border: 1px solid var(--primary);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-overlay.hidden {
  display: none;
}

.modal-card {
  width: 100%;
  max-width: 440px;
  max-height: min(85vh, 720px);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  overflow: hidden;
  position: relative;
}

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

.btn-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

.token-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
  min-height: 140px;
  max-height: 52vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(245, 158, 11, 0.4) transparent;
  -webkit-overflow-scrolling: touch;
}

.token-list::-webkit-scrollbar {
  width: 5px;
}

.token-list::-webkit-scrollbar-thumb {
  background: rgba(245, 158, 11, 0.4);
  border-radius: 4px;
}

.token-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  cursor: pointer;
  transition: background 0.2s;
}

.token-row:hover {
  background: var(--bg-input-hover);
}

.token-row-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.token-row-left .token-icon {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
}

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

.token-row-name {
  font-size: 12px;
  color: var(--text-muted);
}

.token-row-balance {
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-mono);
}

/* Footer */
.app-footer {
  border-top: 1px solid var(--border-color);
  padding: 24px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text-dim);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--primary);
}

@media (max-width: 600px) {
  .navbar {
    padding: 14px 16px;
  }
  .brand-name {
    display: none;
  }
  .swap-card {
    padding: 18px 14px;
  }
  .token-amount-input {
    font-size: 24px;
  }
}

/* Rotating switch button */
.btn-switch.rotating {
  transform: rotate(180deg);
}

/* Modal Chain Filter Tabs */
.modal-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.modal-tab-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.modal-tab-btn.active, .modal-tab-btn:hover {
  background: var(--primary);
  color: #000;
  border-color: var(--primary);
}

/* Token row chain badge */
.token-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
  text-transform: uppercase;
}

.token-badge.cheese {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.token-badge.bsc {
  background: rgba(240, 185, 11, 0.2);
  color: #f0b90b;
  border: 1px solid rgba(240, 185, 11, 0.4);
}

/* Balance loading skeleton */
.balance-loading {
  opacity: 0.5;
}

/* ================= STAGE 2 ADVANCED SUITE STYLING ================= */

/* Protocol Badges Bar */
.protocol-badges-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(19, 20, 26, 0.6);
  border-bottom: 1px solid var(--border-color);
  font-size: 12px;
  color: var(--text-muted);
}

.protocol-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.03);
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.protocol-badge.clickable {
  cursor: pointer;
  transition: all 0.2s ease;
}

.protocol-badge.clickable:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.badge-dot-green { width: 6px; height: 6px; border-radius: 50%; background: #10b981; box-shadow: 0 0 6px #10b981; }
.badge-dot-blue { width: 6px; height: 6px; border-radius: 50%; background: #3b82f6; box-shadow: 0 0 6px #3b82f6; }
.badge-dot-amber { width: 6px; height: 6px; border-radius: 50%; background: #f59e0b; box-shadow: 0 0 6px #f59e0b; }
.badge-dot-purple { width: 6px; height: 6px; border-radius: 50%; background: #a855f7; box-shadow: 0 0 6px #a855f7; }

.btn-badge-paymaster {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #60a5fa;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.btn-badge-paymaster:hover {
  background: rgba(59, 130, 246, 0.25);
  border-color: #60a5fa;
}

/* Tab Tags */
.tab-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(245, 158, 11, 0.25);
  color: #f59e0b;
  margin-left: 4px;
}

.tag-purple {
  background: rgba(168, 85, 247, 0.25);
  color: #c084fc;
}

.tag-green {
  background: rgba(16, 185, 129, 0.25);
  color: #34d399;
}

/* AMM Engine Selector */
.amm-selector-container {
  margin-bottom: 12px;
}

.amm-selector-pills {
  display: flex;
  background: var(--bg-input);
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
  border: 1px solid var(--border-color);
}

.amm-pill-btn {
  flex: 1;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.amm-pill-btn.active {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

/* V3 Efficiency Banner */
.v3-info-banner {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(217, 119, 6, 0.05));
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 12px;
}

.v3-banner-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  color: #fbbf24;
  margin-bottom: 4px;
}

.v3-depth-badge {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.v3-banner-detail {
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 11px;
}

/* V4 Hook Banner */
.v4-header-badge {
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.3);
  color: #d8b4fe;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Price Presets */
.price-presets {
  display: flex;
  gap: 4px;
}

.preset-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.preset-btn.active, .preset-btn:hover {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.4);
}

.target-unit {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  padding-right: 8px;
}

/* Expiry Selector */
.expiry-selector {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding: 0 4px;
}

.expiry-options {
  display: flex;
  gap: 6px;
}

.expiry-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.expiry-btn.active, .expiry-btn:hover {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.4);
}

/* Orders / Positions Section */
.orders-section, .positions-section {
  margin-top: 18px;
  border-top: 1px solid var(--border-color);
  padding-top: 14px;
}

.orders-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.badge-count {
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 11px;
}

.orders-list, .positions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.orders-empty {
  text-align: center;
  padding: 16px;
  font-size: 12px;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-md);
}

.order-card, .pos-card {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
}

.order-card-header, .pos-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Perpetual DEX Controls */
.perp-market-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 14px;
}

.perp-market-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px 6px;
  text-align: center;
  color: var(--text-main);
  cursor: pointer;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: all 0.2s;
}

.perp-market-btn.active {
  border-color: #a855f7;
  background: rgba(168, 85, 247, 0.15);
}

.perp-price {
  font-size: 10px;
  color: var(--text-muted);
}

/* Long / Short Buttons */
.side-selector {
  display: flex;
  gap: 8px;
}

.side-btn {
  flex: 1;
  padding: 10px;
  font-size: 13px;
  font-weight: 700;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg-input);
  color: var(--text-muted);
}

.side-btn.side-long.active {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  border-color: #10b981;
}

.side-btn.side-short.active {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border-color: #ef4444;
}

.collateral-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  padding: 6px 12px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 13px;
}

/* Leverage Slider */
.leverage-container {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-top: 12px;
}

.leverage-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.leverage-display {
  font-size: 14px;
  font-weight: 700;
  color: #a855f7;
}

.leverage-slider {
  width: 100%;
  accent-color: #a855f7;
  cursor: pointer;
}

.leverage-presets {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
}

.lev-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.lev-btn.active, .lev-btn:hover {
  background: rgba(168, 85, 247, 0.25);
  color: #c084fc;
  border-color: #a855f7;
}

/* Perp Metrics Card */
.perp-metrics-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
}

.btn-long {
  background: linear-gradient(135deg, #10b981, #059669) !important;
  color: #fff !important;
}

.btn-short {
  background: linear-gradient(135deg, #ef4444, #dc2626) !important;
  color: #fff !important;
}

/* Staking Stats Grid */
.staking-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.stake-stat-card {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-label {
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 600;
}

.stat-val {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

/* Wallet Options Modal */
.wallet-options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
}

.wallet-option-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  color: var(--text-main);
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
  position: relative;
}

.wallet-option-item:hover {
  background: var(--bg-input-hover);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.wallet-opt-icon {
  font-size: 26px;
}

.wallet-opt-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wallet-opt-text strong {
  font-size: 14px;
}

.wallet-opt-text span {
  font-size: 11px;
  color: var(--text-muted);
}

.opt-tag {
  position: absolute;
  right: 12px;
  top: 12px;
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.wallet-opt-highlight {
  border-color: rgba(16, 185, 129, 0.5);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(6, 182, 212, 0.04));
}

/* ================= TIER 3: OMNICHAIN 1-CLICK SWAP STYLING ================= */

/* Scrollable Modal Tabs for 10 Networks */
.modal-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.modal-tabs::-webkit-scrollbar {
  height: 4px;
}

.modal-tabs::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.modal-tab-btn {
  white-space: nowrap;
  flex-shrink: 0;
}

/* Network Tags on Token Input Footers */
.token-net-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  text-transform: uppercase;
}

.token-net-tag.cheese { background: rgba(245, 158, 11, 0.2); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.4); }
.token-net-tag.solana { background: rgba(168, 85, 247, 0.2); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.4); }
.token-net-tag.bitcoin { background: rgba(245, 158, 11, 0.25); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.5); }
.token-net-tag.tron { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.4); }
.token-net-tag.ethereum { background: rgba(99, 102, 241, 0.2); color: #818cf8; border: 1px solid rgba(99, 102, 241, 0.4); }
.token-net-tag.bsc { background: rgba(240, 185, 11, 0.2); color: #f0b90b; border: 1px solid rgba(240, 185, 11, 0.4); }
.token-net-tag.polygon { background: rgba(139, 92, 246, 0.2); color: #a78bfa; border: 1px solid rgba(139, 92, 246, 0.4); }
.token-net-tag.arbitrum { background: rgba(59, 130, 246, 0.2); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.4); }
.token-net-tag.base { background: rgba(14, 165, 233, 0.2); color: #38bdf8; border: 1px solid rgba(14, 165, 233, 0.4); }
.token-net-tag.optimism { background: rgba(244, 63, 94, 0.2); color: #fb7185; border: 1px solid rgba(244, 63, 94, 0.4); }
.token-net-tag.avalanche { background: rgba(225, 29, 72, 0.2); color: #f43f5e; border: 1px solid rgba(225, 29, 72, 0.4); }

/* Omnichain Route Card */
.omnichain-route-card {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(168, 85, 247, 0.06));
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.omnichain-route-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.omnichain-pill {
  font-size: 11px;
  font-weight: 700;
  color: #60a5fa;
  display: flex;
  align-items: center;
  gap: 4px;
}

.omnichain-speed {
  font-size: 11px;
  font-weight: 700;
  color: #34d399;
  background: rgba(16, 185, 129, 0.15);
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.omnichain-route-flow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 4px;
}

.route-node {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
}

.route-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.route-arrow {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  margin: 0 12px;
}

.arrow-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.3), rgba(168, 85, 247, 0.3));
}

.arrow-spark {
  font-size: 10px;
  font-weight: 700;
  color: #c084fc;
  white-space: nowrap;
}

.omnichain-route-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 8px;
}

/* Omnichain Deposit Modal */
.modal-omnichain {
  max-width: 440px;
}

.omnichain-modal-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.omnichain-summary-badge {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  padding: 12px 14px;
  border-radius: var(--radius-md);
}

.summary-tokens {
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-pill {
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 8px;
  text-transform: uppercase;
}

.status-waiting {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.status-attesting {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.4);
}

.status-completed {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.omni-deposit-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.deposit-instructions {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

.qr-wrapper {
  background: #ffffff;
  padding: 8px;
  border-radius: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.qr-code {
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vault-address-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 6px 10px;
  gap: 8px;
}

.vault-address {
  font-size: 11px;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-copy {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-copy:hover {
  background: var(--primary);
  color: #000;
}

.deposit-note {
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
  width: 100%;
}

/* Stepper */
.omni-stepper {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0.4;
  transition: all 0.3s ease;
}

.step-item.active {
  opacity: 1;
}

.step-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}

.step-item.active .step-icon {
  background: var(--primary);
  border-color: var(--primary);
  color: #000;
}

.step-item.completed .step-icon {
  background: #10b981;
  border-color: #10b981;
  color: #fff;
}

.step-content {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.step-content strong {
  font-size: 12px;
}

.step-content span {
  font-size: 10px;
  color: var(--text-dim);
}

/* ========================================================== */
/* ADVANCED PHASES 2 - 5 STYLES (CLP, FARMS, BRIDGE, PASSKEY) */
/* ========================================================== */

.swap-card {
  transition: max-width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.swap-card.wide-layout {
  max-width: 860px;
}

/* Nav Session Key Badge */
.btn-badge-session {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #10b981;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-badge-session:hover {
  background: rgba(16, 185, 129, 0.2);
  border-color: #10b981;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.3);
}

.btn-badge-session.active {
  background: rgba(16, 185, 129, 0.25);
  border-color: #10b981;
  color: #34d399;
}

/* Perps TP / SL Controls */
.tpsl-container {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-top: 12px;
}

.tpsl-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tpsl-toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-main);
}

.tpsl-badge {
  font-size: 10px;
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 600;
}

.tpsl-inputs-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.tpsl-input-group label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.tpsl-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  color: #fff;
  font-size: 13px;
  font-family: var(--font-mono);
  outline: none;
}

.tpsl-input:focus {
  border-color: var(--primary);
}

/* CLP Index Liquidity Vault */
.clp-vault-section {
  background: linear-gradient(145deg, rgba(27, 28, 36, 0.8), rgba(19, 20, 26, 0.95));
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 18px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.clp-vault-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.clp-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.clp-icon {
  font-size: 24px;
}

.clp-title-group strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
}

.clp-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.clp-apr-tag {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 4px 10px;
  border-radius: 14px;
  font-size: 12px;
}

.clp-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 10px;
  border: 1px solid var(--border-color);
}

.clp-stat-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.clp-stat-lbl {
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.clp-stat-val {
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-main);
}

.clp-actions-row {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

/* Farms View & Liquidity Mining */
.farms-hero-banner {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(16, 185, 129, 0.08));
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 20px;
}

.farms-hero-header h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}

.farms-hero-header p {
  font-size: 12px;
  color: var(--text-muted);
}

.farms-stats-pill {
  display: flex;
  gap: 18px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
}

.f-stat {
  font-size: 12px;
}

.f-lbl {
  color: var(--text-muted);
}

.farm-cards-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.farm-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.farm-card:hover {
  border-color: rgba(245, 158, 11, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.farm-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.farm-token-pair {
  display: flex;
  align-items: center;
  gap: 8px;
}

.farm-pair-icons {
  display: flex;
  align-items: center;
}

.farm-pair-icons img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--bg-card);
}

.farm-pair-icons img:last-child {
  margin-left: -8px;
}

.farm-pair-name {
  font-size: 14px;
  font-weight: 700;
}

.farm-apr-badge {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #10b981;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 12px;
}

.farm-metrics-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
  padding: 10px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  font-size: 12px;
}

.farm-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.farm-actions-group {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

/* Bridge Tracker & Quorum Explorer */
.bridge-hero-banner {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(16, 185, 129, 0.08));
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 16px;
}

.bridge-hero-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}

.bridge-hero-header h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}

.bridge-hero-header p {
  font-size: 12px;
  color: var(--text-muted);
}

.bridge-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.bridge-metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.b-lbl {
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
}

.b-val {
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font-mono);
}

.validator-quorum-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 16px;
}

.quorum-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
}

.quorum-nodes-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
}

.quorum-node-pill {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}

.node-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

.bridge-feed-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
}

.feed-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 10px;
}

.feed-header span {
  font-size: 13px;
  font-weight: 700;
}

.feed-filters {
  display: flex;
  gap: 6px;
}

.feed-filter-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.feed-filter-btn.active, .feed-filter-btn:hover {
  background: var(--primary);
  color: #000;
  border-color: var(--primary);
}

.table-responsive {
  overflow-x: auto;
  max-width: 100%;
}

.bridge-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}

.bridge-table th {
  padding: 8px 10px;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-color);
}

.bridge-table td {
  padding: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.bridge-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.sig-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
}

/* Modals Body Enhancements */
.session-modal-body, .clp-modal-body, .farm-modal-body, .tpsl-modal-body {
  display: flex;
  flex-direction: column;
}

.session-hero-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 14px;
}

.session-icon {
  font-size: 26px;
}

.session-hero-badge p {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.session-feature-card {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
}

.feature-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 6px;
}

.feature-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.4;
}

.session-countdown {
  background: var(--bg-card);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  font-size: 12px;
  display: flex;
  justify-content: space-between;
}

.session-btn-row {
  display: flex;
  gap: 8px;
}

.status-waiting {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-disabled {
  background: rgba(156, 163, 175, 0.15);
  color: #9ca3af;
  border: 1px solid rgba(156, 163, 175, 0.3);
}

@media (max-width: 768px) {
  .bridge-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .quorum-nodes-list {
    grid-template-columns: repeat(2, 1fr);
  }
  .tpsl-inputs-row {
    grid-template-columns: 1fr;
  }
  .clp-stats-grid {
    grid-template-columns: 1fr;
  }
}

/* ========================================================
   🔮 THE DARK DIMENSION & 🤖 AGENTIC UNIVERSE
   ======================================================== */
.dark-hero-banner {
  background: linear-gradient(135deg, rgba(147, 51, 234, 0.15), rgba(15, 23, 42, 0.9));
  border: 1px solid rgba(168, 85, 247, 0.35);
  box-shadow: 0 0 25px rgba(168, 85, 247, 0.15);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 16px;
}

.agents-hero-banner {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(30, 41, 59, 0.9));
  border: 1px solid rgba(16, 185, 129, 0.3);
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.12);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 16px;
}

.dark-grid-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.dark-box-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 16px;
}

.dark-box-card h4 {
  margin: 0 0 12px 0;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stealth-meta-box {
  background: rgba(0, 0, 0, 0.4);
  border: 1px dashed rgba(168, 85, 247, 0.4);
  padding: 12px;
  border-radius: var(--radius-sm);
  font-family: monospace;
  font-size: 12px;
  word-break: break-all;
  color: #c084fc;
  margin: 8px 0;
}

.agent-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 14px;
}

.agent-card {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 12px;
  transition: all 0.2s ease;
}

.agent-card:hover {
  border-color: rgba(16, 185, 129, 0.4);
  transform: translateY(-2px);
}

.agent-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.agent-name {
  font-weight: 700;
  font-size: 14px;
}

.agent-strategy-tag {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.agent-stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.agent-stat-val {
  font-weight: 600;
  color: var(--text-primary);
}

.agents-terminal-box {
  background: #090d16;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 14px;
  font-family: monospace;
  font-size: 12px;
  max-height: 220px;
  overflow-y: auto;
  color: #94a3b8;
}

.terminal-line {
  margin-bottom: 4px;
  line-height: 1.4;
}

.terminal-line .t-green { color: #34d399; }
.terminal-line .t-purple { color: #c084fc; }
.terminal-line .t-amber { color: #fbbf24; }
.terminal-line .t-blue { color: #60a5fa; }

@media (max-width: 900px) {
  .dark-grid-container {
    grid-template-columns: 1fr;
  }
  .agent-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 600px) {
  .agent-cards-grid {
    grid-template-columns: 1fr;
  }
}


/* ========================================================
   📱 RESPONSIVE CONTAINMENT (FIT ALL SCREENS)
   ======================================================== */
html, body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  box-sizing: border-box;
}

*, *::before, *::after {
  box-sizing: border-box;
}

.app-container {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

.header {
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
  overflow-x: hidden;
  gap: 10px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.protocol-badges-bar {
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.protocol-badges-bar::-webkit-scrollbar {
  display: none;
}
.protocol-badge {
  flex-shrink: 0;
}

.main-content {
  width: 100%;
  max-width: 100vw;
  padding: 20px 12px;
  box-sizing: border-box;
  overflow-x: hidden;
}

.swap-card {
  width: 100%;
  max-width: 480px;
  box-sizing: border-box;
  margin: 0 auto;
  overflow: hidden;
  transition: max-width 0.3s ease;
}

.swap-card.wide-layout {
  width: 100%;
  max-width: min(980px, calc(100vw - 24px));
}

.swap-header {
  width: 100%;
  max-width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  position: relative;
  box-sizing: border-box;
}

.swap-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  max-width: calc(100% - 36px);
  white-space: nowrap;
  padding-bottom: 6px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.swap-tabs::-webkit-scrollbar {
  height: 3px;
}

.swap-tabs::-webkit-scrollbar-thumb {
  background: rgba(245, 158, 11, 0.4);
  border-radius: 4px;
}

.tab-btn, .tab-link {
  flex-shrink: 0;
  white-space: nowrap;
  font-size: 13px;
}

.table-responsive {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.dark-grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  width: 100%;
  max-width: 100%;
}

.agent-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  width: 100%;
  max-width: 100%;
}

.bridge-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  width: 100%;
  max-width: 100%;
}

.clp-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  width: 100%;
  max-width: 100%;
}

/* ========================================================
   ☀️ / 🌙 THEME TOGGLE & LIGHT MODE STYLES
   ======================================================== */
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--primary);
  cursor: pointer;
  transition: all 0.25s ease;
  padding: 0;
  flex-shrink: 0;
}

.theme-toggle-btn:hover {
  background: rgba(245, 158, 11, 0.15);
  border-color: var(--primary);
  transform: scale(1.05);
}

.theme-svg {
  transition: transform 0.3s ease;
}

.theme-toggle-btn:hover .theme-svg {
  transform: rotate(25deg);
}

/* Light Theme Variables & Overrides */
html[data-theme="light"], body.light-theme {
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-input: #f1f5f9;
  --bg-input-hover: #e2e8f0;
  --border-color: rgba(0, 0, 0, 0.08);
  --border-focus: #d97706;
  --primary: #d97706;
  --primary-hover: #b45309;
  --primary-glow: rgba(217, 119, 6, 0.2);
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;
  --green: #059669;
  --red: #dc2626;
  background-color: #f8fafc;
  background-image: 
    radial-gradient(circle at 50% 10%, rgba(245, 158, 11, 0.09) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(59, 130, 246, 0.06) 0%, transparent 40%);
  color: #0f172a;
}

html[data-theme="light"] .header {
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

html[data-theme="light"] .protocol-badges-bar {
  background: rgba(241, 245, 249, 0.9);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

html[data-theme="light"] .protocol-badge {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: #334155;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

html[data-theme="light"] .swap-card {
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.06);
}

html[data-theme="light"] .dark-box-card,
html[data-theme="light"] .agent-card,
html[data-theme="light"] .farm-card,
html[data-theme="light"] .bridge-metric-card,
html[data-theme="light"] .perp-overview-card {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

html[data-theme="light"] .token-input-box {
  background: #f1f5f9;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

html[data-theme="light"] .token-amount-input {
  color: #0f172a;
}

html[data-theme="light"] .btn-network,
html[data-theme="light"] .btn-badge-session,
html[data-theme="light"] .btn-badge-paymaster,
html[data-theme="light"] .theme-toggle-btn {
  background: #f1f5f9;
  color: #0f172a;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

html[data-theme="light"] .modal-card {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.12);
}

html[data-theme="light"] .stealth-meta-box {
  background: #f8fafc;
  color: #7c3aed;
  border-color: rgba(124, 58, 237, 0.3);
}

html[data-theme="light"] .dark-hero-banner {
  background: linear-gradient(135deg, rgba(147, 51, 234, 0.08), rgba(255, 255, 255, 0.95));
  border-color: rgba(168, 85, 247, 0.25);
}

html[data-theme="light"] .agents-hero-banner {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(255, 255, 255, 0.95));
  border-color: rgba(16, 185, 129, 0.25);
}

html[data-theme="light"] .bridge-hero-banner {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(255, 255, 255, 0.95));
  border-color: rgba(59, 130, 246, 0.25);
}

@media (max-width: 600px) {
  .header {
    padding: 10px 12px;
  }
  .brand-name {
    display: none;
  }
  .swap-card {
    padding: 16px 12px;
  }
  .token-amount-input {
    font-size: 22px;
  }
}


/* ========================================================
   🌐 NETWORK & TRUST WALLET MODAL STYLING
   ======================================================== */
.network-modal-card {
  max-width: 480px;
}

.network-modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  max-height: 70vh;
  padding-right: 4px;
  scrollbar-width: thin;
}

.current-chain-status-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.chain-status-label {
  font-size: 13px;
  color: var(--text-muted);
}

.chain-status-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(245, 158, 11, 0.15);
  color: var(--primary);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.chain-status-badge.connected-cheese {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.3);
}

.chain-status-badge.wrong-network {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.3);
}

.manual-network-card {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
}

.manual-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  margin-bottom: 6px;
  color: var(--text-main);
}

.manual-subtext {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.manual-steps-list {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
  padding-left: 20px;
  line-height: 1.6;
}

.manual-steps-list li strong {
  color: var(--text-main);
}

.network-params-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.param-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  gap: 8px;
}

.param-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  width: 90px;
}

.param-val {
  font-size: 12px;
  font-family: monospace;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.btn-copy-param {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--primary);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
}

.btn-copy-param:hover {
  background: rgba(245, 158, 11, 0.25);
  border-color: var(--primary);
}

.network-info-alert {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: var(--radius-md);
  padding: 12px;
  font-size: 12px;
  color: #93c5fd;
  line-height: 1.5;
}

.btn-network.wrong-network {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #f87171 !important;
  border-color: rgba(239, 68, 68, 0.4) !important;
  animation: pulse-warn 2s infinite ease-in-out;
}

@keyframes pulse-warn {
  0%, 100% { border-color: rgba(239, 68, 68, 0.4); }
  50% { border-color: rgba(239, 68, 68, 0.85); box-shadow: 0 0 10px rgba(239, 68, 68, 0.3); }
}

html[data-theme="light"] .network-info-alert {
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.2);
  color: #1e40af;
}

html[data-theme="light"] .current-chain-status-box,
html[data-theme="light"] .manual-network-card {
  background: #f1f5f9;
}

html[data-theme="light"] .param-row {
  background: #ffffff;
}

/* Live Synchronized NCH Price Pill */
.nch-price-pill {
  background: rgba(245, 158, 11, 0.12) !important;
  border: 1px solid rgba(245, 158, 11, 0.35) !important;
  color: #fbbf24 !important;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: -0.2px;
}
.nch-price-pill strong {
  color: #fef08a;
  font-weight: 700;
}
.pulse-amber {
  background: #f59e0b !important;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.8) !important;
}
