/* ========================================================
   OloSwap DEX — High-End Decentralized Exchange Stylesheet
   ======================================================== */

:root {
  --primary: #f0b90b;
  --primary-glow: rgba(240, 185, 11, 0.35);
  --primary-hover: #ffca28;
  --primary-subtle: rgba(240, 185, 11, 0.12);
  
  --cyan: #00f0ff;
  --cyan-glow: rgba(0, 240, 255, 0.3);
  --cyan-subtle: rgba(0, 240, 255, 0.12);

  --purple: #8a2be2;
  --purple-glow: rgba(138, 43, 226, 0.3);
  
  --bg-deep: #07090e;
  --bg-dark: #0a0e17;
  --bg-card: rgba(16, 22, 34, 0.82);
  --bg-card-hover: rgba(22, 30, 46, 0.9);
  --bg-input: rgba(10, 14, 22, 0.88);
  --bg-input-focus: rgba(12, 17, 28, 0.98);

  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.16);
  --border-focus: rgba(240, 185, 11, 0.45);
  --border-glow: rgba(0, 240, 255, 0.45);

  --text: #f0f3f6;
  --text-muted: #8b949e;
  --text-dim: #57606a;

  --accent-green: #0ecb81;
  --accent-red: #f6465d;

  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 9999px;

  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-deep);
  color: var(--text);
  font-family: var(--font-main);
  line-height: 1.5;
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
}

/* Ambient Background Lighting */
.bg-lighting {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.35;
}

.orb-primary {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
  top: -150px;
  left: 10%;
}

.orb-cyan {
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, var(--cyan-glow) 0%, transparent 70%);
  bottom: -200px;
  right: 5%;
}

.orb-purple {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--purple-glow) 0%, transparent 70%);
  top: 40%;
  left: 60%;
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 44px 44px;
}

/* ========================================================
   TOP TICKER TAPE
   ======================================================== */
.top-ticker-bar {
  background: rgba(7, 9, 14, 0.95);
  border-bottom: 1px solid var(--border);
  font-size: 0.76rem;
  padding: 6px 20px;
  position: relative;
  z-index: 101;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}
.top-ticker-bar::-webkit-scrollbar { display: none; }

.ticker-inner {
  max-width: 1360px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
}

.ticker-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
}
.ticker-dot.live {
  animation: liveBlink 1.5s infinite;
}

@keyframes liveBlink {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
  100% { opacity: 1; transform: scale(1); }
}

.ticker-separator {
  color: var(--border);
  font-weight: 300;
}

.badge-change {
  font-size: 0.7rem;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 700;
}
.badge-change.positive {
  background: rgba(14, 203, 129, 0.15);
  color: var(--accent-green);
}

.text-gold { color: var(--primary) !important; font-weight: 700; }
.text-cyan { color: var(--cyan) !important; font-weight: 700; }
.text-green { color: var(--accent-green) !important; font-weight: 700; }
.text-white { color: #fff !important; font-weight: 700; }
.text-muted { color: var(--text-muted) !important; }

/* ========================================================
   MAIN HEADER & NAVIGATION
   ======================================================== */
.dex-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  background: rgba(10, 14, 23, 0.85);
  border-bottom: 1px solid var(--border);
  height: 72px;
}

.header-inner {
  max-width: 1360px;
  margin: 0 auto;
  height: 100%;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.logo-gem-wrap {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 0 12px var(--primary-glow));
  transition: var(--transition);
}
.brand-logo:hover .logo-gem-wrap {
  transform: scale(1.05);
  filter: drop-shadow(0 0 16px var(--cyan-glow));
}

.logo-svg {
  width: 100%;
  height: 100%;
}

.brand-titles {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #fff;
}
.brand-name .accent-text {
  background: linear-gradient(135deg, var(--primary) 0%, var(--cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-tag {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--cyan);
  text-transform: uppercase;
}

/* Desktop Navigation Tabs */
.desktop-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-main);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.nav-tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab.active {
  color: var(--primary);
  background: var(--primary-subtle);
  border: 1px solid rgba(240, 185, 11, 0.25);
}

.tab-icon {
  width: 17px;
  height: 17px;
}

.faucet-free-pill {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(14, 203, 129, 0.2);
  color: var(--accent-green);
  border: 1px solid rgba(14, 203, 129, 0.4);
}

.nav-divider {
  width: 1px;
  height: 22px;
  background: var(--border);
  margin: 0 4px;
}

.nav-external {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}
.nav-external:hover {
  color: var(--cyan);
  background: rgba(0, 240, 255, 0.06);
}
.ext-icon {
  width: 14px;
  height: 14px;
  opacity: 0.7;
}

/* Header Right Buttons */
.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chain-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(14, 203, 129, 0.08);
  border: 1px solid rgba(14, 203, 129, 0.25);
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-green);
  font-family: var(--font-mono);
}

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

.btn-chain-add {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
}
.btn-chain-add:hover {
  background: rgba(0, 240, 255, 0.1);
  border-color: var(--cyan);
  color: var(--cyan);
}

.btn-wallet {
  background: linear-gradient(135deg, var(--primary) 0%, #e6a800 100%);
  color: #07090e;
  border: none;
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 15px var(--primary-glow);
  min-height: 42px;
}
.btn-wallet:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(240, 185, 11, 0.5);
}
.btn-wallet.connected {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  border: 1px solid var(--border);
  box-shadow: none;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}
.btn-wallet.connected:hover {
  border-color: var(--primary);
  background: rgba(240, 185, 11, 0.1);
}

.wallet-icon-svg {
  width: 17px;
  height: 17px;
}

.btn-mobile-toggle {
  display: none;
  background: transparent;
  border: none;
  width: 44px;
  height: 44px;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
}
.btn-mobile-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}

/* ========================================================
   MOBILE DRAWER
   ======================================================== */
.mobile-drawer {
  position: fixed;
  top: 0;
  right: -320px;
  width: 300px;
  height: 100vh;
  background: rgba(12, 16, 26, 0.98);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border-left: 1px solid var(--border);
  z-index: 250;
  transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  padding: 24px 20px;
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.8);
}
.mobile-drawer.open {
  right: 0;
}

.drawer-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}
.drawer-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.drawer-tab-btn, .drawer-ext-link {
  background: transparent;
  border: none;
  color: var(--text);
  font-family: var(--font-main);
  font-size: 1rem;
  font-weight: 600;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  text-align: left;
  cursor: pointer;
  text-decoration: none;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.drawer-tab-btn.active {
  background: var(--primary-subtle);
  color: var(--primary);
  border-left: 3px solid var(--primary);
}
.drawer-hr {
  height: 1px;
  background: var(--border);
  margin: 10px 0;
}

/* ========================================================
   MAIN APPLICATION CONTAINER
   ======================================================== */
.dex-container {
  position: relative;
  z-index: 1;
  max-width: 1360px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

.tab-pane {
  animation: fadeIn 0.25s ease-out;
}

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

/* Glass Panels */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.45);
  transition: var(--transition);
}

/* ========================================================
   SWAP WORKSPACE (SPLIT 2-COLUMN VIEW)
   ======================================================== */
.swap-workspace {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 24px;
  align-items: flex-start;
}

/* Chart Column */
.chart-column {
  min-width: 0;
}

.chart-panel {
  padding: 24px;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 14px;
}

.chart-pair-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.pair-avatars-wrap {
  display: flex;
  position: relative;
}
.avatar-coin {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}
.avatar-coin.overlay {
  margin-left: -12px;
}

.chart-pair-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.chart-badge-dex {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--cyan-subtle);
  color: var(--cyan);
  border: 1px solid rgba(0, 240, 255, 0.3);
}

.chart-price-display {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 2px;
}

.price-val {
  font-size: 1.8rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #fff;
}

.change-tag {
  font-size: 0.82rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  font-family: var(--font-mono);
}
.change-tag.positive {
  background: rgba(14, 203, 129, 0.15);
  color: var(--accent-green);
}
.change-tag.negative {
  background: rgba(246, 70, 93, 0.15);
  color: var(--accent-red);
}

.chart-timeframes {
  display: flex;
  background: rgba(10, 14, 22, 0.7);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 2px;
}

.tf-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-main);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: var(--transition);
}
.tf-btn.active, .tf-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.tf-btn.active {
  color: var(--cyan);
}

/* Canvas Chart */
.chart-canvas-wrapper {
  position: relative;
  width: 100%;
  height: 280px;
  margin: 10px 0 20px;
}

#priceCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.chart-hover-tooltip {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(10, 14, 22, 0.95);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  pointer-events: none;
  z-index: 10;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}
.tooltip-time {
  font-size: 0.7rem;
  color: var(--text-muted);
}
.tooltip-price {
  font-size: 1rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--cyan);
}

.chart-footer-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

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

.cfs-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cfs-val {
  font-size: 0.92rem;
  font-weight: 700;
  font-family: var(--font-mono);
}

/* Swap Column */
.swap-column {
  min-width: 0;
}

.swap-card {
  padding: 24px;
  position: relative;
}

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

.swap-title {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #fff;
}

.swap-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.swap-header-controls {
  display: flex;
  gap: 8px;
}

.header-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.header-icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.spin-icon {
  transition: transform 0.4s ease;
}
.header-icon-btn:hover .spin-icon {
  transform: rotate(180deg);
}

/* Slippage Settings Dropdown */
.slippage-dropdown {
  background: rgba(12, 16, 26, 0.96);
  border: 1px solid var(--border-focus);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.2s ease-out;
}

.slip-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 14px;
}
.close-x-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
}

.slip-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.slip-presets {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.slip-chip {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-main);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 8px 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  min-height: 38px;
}
.slip-chip.active, .slip-chip:hover {
  background: var(--primary-subtle);
  border-color: var(--primary);
  color: var(--primary);
}

.slip-custom-wrap {
  flex: 1.2;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 10px;
}
.slip-custom-wrap input {
  width: 100%;
  background: transparent;
  border: none;
  color: #fff;
  font-family: var(--font-main);
  font-size: 0.82rem;
  outline: none;
}

.deadline-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.deadline-input-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 0.82rem;
}
.deadline-input-wrap input {
  width: 50px;
  background: transparent;
  border: none;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-align: center;
  outline: none;
}

/* Token Input Field */
.token-field {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  transition: var(--transition);
}
.token-field:hover {
  border-color: var(--border-hover);
}
.token-field:focus-within {
  border-color: var(--border-focus);
  background: var(--bg-input-focus);
  box-shadow: 0 0 20px rgba(240, 185, 11, 0.12);
}

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

.field-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.field-balance-group {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
}

.bal-amount {
  font-family: var(--font-mono);
  font-weight: 700;
  color: #fff;
}

.percent-pills {
  display: flex;
  gap: 4px;
}

.pct-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--cyan);
  font-family: var(--font-main);
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  cursor: pointer;
  min-height: 22px;
}
.pct-btn:hover {
  background: var(--cyan-subtle);
  border-color: var(--cyan);
}
.max-btn {
  color: var(--primary);
}
.max-btn:hover {
  background: var(--primary-subtle);
  border-color: var(--primary);
}

.field-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.amount-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  font-family: var(--font-main);
  font-size: 2rem;
  font-weight: 800;
  outline: none;
  min-width: 0;
}
.amount-input::placeholder {
  color: var(--text-dim);
}

.btn-token-pick {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  color: #fff;
  font-family: var(--font-main);
  font-weight: 800;
  font-size: 1.05rem;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: var(--transition);
  white-space: nowrap;
  min-height: 44px;
}
.btn-token-pick:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.3);
}

.token-badge-svg {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}
.token-badge-svg svg {
  width: 100%;
  height: 100%;
}

.chevron-svg {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
}

.field-footer {
  margin-top: 6px;
}
.fiat-estimate {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Flip Direction Button */
.swap-flip-divider {
  display: flex;
  justify-content: center;
  margin: -12px 0;
  position: relative;
  z-index: 2;
}

.btn-flip {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 2px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
}
.btn-flip:hover {
  background: var(--primary-subtle);
  border-color: var(--primary);
  color: var(--primary);
  transform: rotate(180deg);
}

/* Quote Accordion */
.quote-accordion {
  background: rgba(10, 14, 22, 0.7);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.82rem;
}

.quote-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.qr-label {
  color: var(--text-muted);
}
.qr-val {
  font-family: var(--font-mono);
  font-weight: 600;
}

.route-pill {
  background: var(--cyan-subtle);
  color: var(--cyan);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
}

/* Primary Swap Execute Button */
.btn-swap-execute {
  width: 100%;
  margin-top: 20px;
  padding: 16px;
  border-radius: var(--radius-md);
  border: none;
  background: linear-gradient(135deg, var(--primary) 0%, #e6a800 100%);
  color: #07090e;
  font-family: var(--font-main);
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 6px 20px var(--primary-glow);
  min-height: 56px;
}
.btn-swap-execute:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(240, 185, 11, 0.55);
}
.btn-swap-execute:disabled {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.btn-spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(0, 0, 0, 0.2);
  border-top-color: #07090e;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.swap-trust-footer {
  display: flex;
  gap: 8px;
  margin-top: 18px;
  justify-content: space-between;
}
.trust-pill {
  flex: 1;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 6px 8px;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

/* ========================================================
   POOLS WORKSPACE
   ======================================================== */
.pools-workspace {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.section-hero-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.section-main-title {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #fff;
}

.section-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: 4px;
  max-width: 680px;
}

.btn-add-liquidity-action {
  background: linear-gradient(135deg, var(--cyan) 0%, #00b4d8 100%);
  color: #07090e;
  border: none;
  font-family: var(--font-main);
  font-weight: 800;
  font-size: 0.95rem;
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 15px var(--cyan-glow);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  white-space: nowrap;
}
.btn-add-liquidity-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(0, 240, 255, 0.5);
}

/* Featured Pools Highlight Cards */
.pools-highlight-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.pool-kpi-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.kpi-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.kpi-pair-title {
  font-weight: 800;
  font-size: 1.1rem;
  color: #fff;
}
.kpi-apr-badge {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(240, 185, 11, 0.15);
  color: var(--primary);
  border: 1px solid rgba(240, 185, 11, 0.3);
}

.kpi-stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
}

.btn-pool-quick-add {
  margin-top: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: #fff;
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  min-height: 40px;
}
.btn-pool-quick-add:hover {
  background: var(--primary-subtle);
  border-color: var(--primary);
  color: var(--primary);
}

/* Positions Card */
.positions-card, .table-panel {
  padding: 24px;
}

.panel-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.panel-heading {
  font-size: 1.2rem;
  font-weight: 800;
}
.panel-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.empty-state-box {
  padding: 36px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.empty-water-icon {
  font-size: 2.5rem;
  opacity: 0.6;
}
.empty-state-box h4 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}
.empty-state-box p {
  font-size: 0.88rem;
  color: var(--text-muted);
  max-width: 440px;
}

.btn-secondary-action {
  margin-top: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  color: #fff;
  font-family: var(--font-main);
  font-weight: 700;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: var(--transition);
  min-height: 40px;
}
.btn-secondary-action:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.badge-v1 {
  background: var(--cyan-subtle);
  color: var(--cyan);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid rgba(0, 240, 255, 0.3);
}

/* Professional Table */
.table-scroll-container {
  overflow-x: auto;
}
.pro-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.pro-table th {
  padding: 12px 16px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.pro-table td {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
  vertical-align: middle;
}

.pool-row-item {
  display: flex;
  align-items: center;
  gap: 12px;
}
.pool-row-badges {
  display: flex;
}
.pool-row-badges span:last-child {
  margin-left: -8px;
}
.pool-row-names strong {
  color: #fff;
}
.pool-row-names a {
  display: block;
  font-size: 0.75rem;
  color: var(--cyan);
  text-decoration: none;
}

/* ========================================================
   FAUCET WORKSPACE
   ======================================================== */
.faucet-workspace {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.faucet-hero-banner {
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
}

.hero-chip {
  display: inline-block;
  background: rgba(14, 203, 129, 0.12);
  color: var(--accent-green);
  border: 1px solid rgba(14, 203, 129, 0.3);
  padding: 4px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.faucet-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.pro-faucet-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition);
}
.pro-faucet-card:hover {
  transform: translateY(-4px);
  border-color: rgba(240, 185, 11, 0.35);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
}

.pfc-top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.pfc-logo-badge {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}
.pfc-ticker {
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
}
.pfc-fullname {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.pfc-claim-box {
  background: rgba(0, 0, 0, 0.3);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  text-align: center;
  margin-bottom: 18px;
}
.pfc-amt {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--cyan);
  font-family: var(--font-mono);
}
.pfc-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.pfc-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-claim-token {
  width: 100%;
  background: linear-gradient(135deg, var(--accent-green) 0%, #0ab06f 100%);
  color: #07090e;
  border: none;
  font-family: var(--font-main);
  font-weight: 800;
  font-size: 0.95rem;
  padding: 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  min-height: 46px;
}
.btn-claim-token:hover:not(:disabled) {
  box-shadow: 0 4px 16px rgba(14, 203, 129, 0.45);
}
.btn-claim-token:disabled {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  cursor: not-allowed;
}

.btn-add-mm {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: #fff;
  font-family: var(--font-main);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
}
.btn-add-mm:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
}

.metamask-helper-card {
  padding: 20px 24px;
}
.mm-helper-inner {
  display: flex;
  align-items: center;
  gap: 18px;
}
.mm-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
}
.mm-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* ========================================================
   ANALYTICS WORKSPACE
   ======================================================== */
.analytics-workspace {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.analytics-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.kpi-metric-box {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.metric-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}
.metric-value {
  font-size: 1.6rem;
  font-weight: 800;
  font-family: var(--font-mono);
}
.metric-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.contracts-panel {
  padding: 24px;
}
.explorer-link-btn {
  color: var(--cyan);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.88rem;
}
.contracts-items-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}
.ci-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: rgba(10, 14, 22, 0.6);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.ci-title {
  font-weight: 700;
  color: #fff;
}
.ci-link {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--cyan);
  text-decoration: none;
}

/* ========================================================
   MODALS & POPUPS
   ======================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease-out;
}

.modal-card {
  background: rgba(16, 22, 34, 0.98);
  backdrop-filter: blur(28px);
  border: 1px solid var(--border-focus);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.8);
}
.modal-card.modal-wider {
  max-width: 520px;
}

.modal-header {
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
}
.modal-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
}
.modal-close-x {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
}

.modal-search-wrap {
  padding: 16px 20px 8px;
}
.token-search-field {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: #fff;
  font-family: var(--font-main);
  font-size: 0.95rem;
  outline: none;
}
.token-search-field:focus {
  border-color: var(--primary);
}

.token-chips-wrap {
  padding: 8px 20px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.quick-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 5px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.quick-chip:hover {
  background: var(--primary-subtle);
  border-color: var(--primary);
  color: var(--primary);
}

.token-items-scroll {
  flex: 1;
  overflow-y: auto;
  max-height: 340px;
  padding: 0 12px 16px;
}

.token-row-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}
.token-row-item:hover {
  background: rgba(255, 255, 255, 0.06);
}
.token-row-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.token-row-logo {
  font-size: 1.5rem;
}
.token-row-names strong {
  color: #fff;
}
.token-row-names small {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.token-row-right {
  text-align: right;
  font-family: var(--font-mono);
  font-weight: 700;
}

/* Modal Body */
.modal-body-scroll {
  padding: 20px 24px;
  overflow-y: auto;
}
.modal-instruction {
  font-size: 0.86rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.plus-math-icon {
  text-align: center;
  font-size: 1.3rem;
  color: var(--text-muted);
  margin: 8px 0;
}

.ratio-breakdown-box {
  display: flex;
  gap: 8px;
  background: rgba(10, 14, 22, 0.6);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin: 16px 0;
  text-align: center;
}
.ratio-cell {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.rc-val {
  font-weight: 800;
  font-family: var(--font-mono);
  font-size: 0.95rem;
}
.rc-label {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Account Modal */
.account-card-box {
  background: rgba(10, 14, 22, 0.8);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
}
.ac-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.ac-status-badge {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-green);
  display: flex;
  align-items: center;
  gap: 6px;
}
.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
}
.btn-disconnect {
  background: rgba(246, 70, 93, 0.15);
  border: 1px solid rgba(246, 70, 93, 0.3);
  color: var(--accent-red);
  font-family: var(--font-main);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
}
.ac-address-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ac-addr {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: #fff;
  font-weight: 700;
}
.btn-copy-addr {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
}
.btn-copy-addr:hover { color: #fff; }
.ac-scan-link {
  font-size: 0.78rem;
  color: var(--cyan);
  text-decoration: underline;
  margin-left: auto;
}
.portfolio-title {
  font-size: 0.9rem;
  font-weight: 800;
  margin-bottom: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.portfolio-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.port-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
}

/* ========================================================
   TOAST NOTIFICATIONS
   ======================================================== */
.toast-hub {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 400px;
  width: calc(100vw - 48px);
  pointer-events: none;
}

.toast {
  background: rgba(14, 18, 28, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  pointer-events: auto;
  animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast.toast-success { border-color: rgba(14, 203, 129, 0.6); }
.toast.toast-error { border-color: rgba(246, 70, 93, 0.6); }
.toast.toast-info { border-color: rgba(0, 240, 255, 0.6); }

.toast-icon { font-size: 1.25rem; }
.toast-body { flex: 1; }
.toast-title { font-weight: 800; font-size: 0.92rem; margin-bottom: 2px; }
.toast-desc { font-size: 0.8rem; color: var(--text-muted); line-height: 1.4; word-break: break-all; }
.toast-link { color: var(--cyan); text-decoration: underline; margin-top: 4px; display: inline-block; font-size: 0.78rem; }

/* ========================================================
   RESPONSIVE DESIGN
   ======================================================== */
@media screen and (max-width: 1080px) {
  .swap-workspace {
    grid-template-columns: 1fr;
  }
  .pools-highlight-grid {
    grid-template-columns: 1fr;
  }
  .analytics-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media screen and (max-width: 900px) {
  .desktop-nav { display: none; }
  .btn-mobile-toggle { display: flex; }
  .btn-chain-add { display: none; }
  .header-inner { padding: 0 16px; }
  .dex-container { padding: 20px 14px 60px; }
  .section-hero-header { flex-direction: column; }
  .btn-add-liquidity-action { width: 100%; justify-content: center; }
}

@media screen and (max-width: 600px) {
  .chart-footer-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .swap-trust-footer {
    flex-direction: column;
    gap: 6px;
  }
  .amount-input {
    font-size: 1.5rem;
  }
  .chain-pill {
    display: none;
  }
  .analytics-kpi-grid {
    grid-template-columns: 1fr;
  }
  .ci-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}
