/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0
}

:root {
  --bg: #070b12;
  --bg2: #0d1420;
  --bg3: #111827;
  --bg4: #161f30;
  --bgi: #1a2235;
  --border: rgba(255, 255, 255, 0.07);
  --borderl: rgba(255, 255, 255, 0.12);
  --cyan: #00d4ff;
  --cyanD: rgba(0, 212, 255, 0.12);
  --cyanG: rgba(0, 212, 255, 0.25);
  --purple: #7c3aed;
  --purpleD: rgba(124, 58, 237, 0.12);
  --green: #10b981;
  --greenD: rgba(16, 185, 129, 0.12);
  --greenB: rgba(16, 185, 129, 0.25);
  --yellow: #f59e0b;
  --yellowD: rgba(245, 158, 11, 0.12);
  --red: #ef4444;
  --redD: rgba(239, 68, 68, 0.12);
  --redB: rgba(239, 68, 68, 0.25);
  --txt: #f1f5f9;
  --txt2: #94a3b8;
  --txt3: #475569;
  --txt4: #2d3748;
  --r: 8px;
  --r2: 12px;
  --r3: 16px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --font: 'Inter', sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --primary-g: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}



html {
  font-size: 14px;
  overflow-x: hidden;
}

html::-webkit-scrollbar {
  width: 6px;
}

html::-webkit-scrollbar-track {
  background: var(--bg);
}

html::-webkit-scrollbar-thumb {
  background: var(--borderl);
  border-radius: 10px;
}

html::-webkit-scrollbar-thumb:hover {
  background: var(--cyanG);
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--txt);
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse 80% 50% at 15% 0%, rgba(0, 212, 255, 0.04) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 85% 100%, rgba(124, 58, 237, 0.05) 0%, transparent 60%);
}


/* ===== HEADER ===== */
.header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  height: 54px;
  background: rgba(13, 20, 32, 0.97);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 200;
}



.header-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
}

/* Unified Header Items */
.h-item {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  background: var(--bg3);
  border: 1px solid var(--borderl);
  border-radius: 10px;
  padding: 0 14px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--txt2);
  transition: all 0.2s ease;
  user-select: none;
}

.h-item:hover {
  background: var(--bg4);
  border-color: var(--cyanG);
  color: var(--txt);
}

.settings-btn {
  cursor: pointer;
}

.settings-btn.open {
  background: var(--cyanD);
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: 0 0 15px rgba(0, 212, 255, 0.15);
}

.header-user {
  padding: 0 4px 0 14px;
  /* More padding on left for avatar/name */
  gap: 10px;
  cursor: default;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
}

.logout-btn-header {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--borderl);
  color: var(--txt3);
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.logout-btn-header:hover {
  background: var(--redD);
  border-color: var(--red);
  color: var(--red);
}

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

.logo-icon {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--cyanD), var(--purpleD));
  border: 1px solid var(--borderl);
  border-radius: 9px;
}

.logo-title {
  font-size: .95rem;
  font-weight: 700;
  background: linear-gradient(90deg, var(--cyan), #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-sub {
  font-size: .6rem;
  color: var(--txt3);
  margin-top: -1px
}

/* Search */
.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bgi);
  border: 1px solid var(--borderl);
  border-radius: var(--r2);
  flex: 1;
  min-width: 200px;
  max-width: 360px;
  transition: border-color .2s;
}

.search-wrap:focus-within {
  border-color: var(--cyanG)
}

.search-icon {
  position: absolute;
  left: 10px;
  pointer-events: none;
  flex-shrink: 0
}

.search-input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--txt);
  font-family: var(--font);
  font-size: .82rem;
  padding: 7px 30px 7px 28px;
  width: 100%;
}

.search-input::placeholder {
  color: var(--txt3)
}

.search-clear {
  position: absolute;
  right: 8px;
  cursor: pointer;
  color: var(--txt3);
  font-size: .9rem;
  display: none;
  user-select: none;
  padding: 2px 4px;
}

.search-clear.visible {
  display: block
}

/* Controls */
.header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0
}

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

.filter-lbl {
  font-size: .65rem;
  color: var(--txt3);
  white-space: nowrap
}

.filter-input {
  background: var(--bgi);
  border: 1px solid var(--border);
  color: var(--txt);
  font-family: var(--mono);
  font-size: .72rem;
  padding: 4px 8px;
  border-radius: 6px;
  outline: none;
  width: 70px;
  transition: border-color .2s;
}

.filter-input:focus {
  border-color: var(--cyanG)
}

/* Toggle */
.toggle-wrap {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 18px;
  cursor: pointer
}

.toggle-wrap input {
  opacity: 0;
  width: 0;
  height: 0
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--bg4);
  border-radius: 9px;
  transition: .2s;
  border: 1px solid var(--border);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--txt3);
  bottom: 2px;
  left: 2px;
  transition: .2s;
}

.toggle-wrap input:checked+.toggle-slider {
  background: rgba(0, 212, 255, .2);
  border-color: var(--cyan)
}

.toggle-wrap input:checked+.toggle-slider::before {
  transform: translateX(16px);
  background: var(--cyan)
}

.header-status-area {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.header-clock {
  font-family: var(--mono);
  color: var(--cyan);
  min-width: 95px;
  justify-content: center;
}

.header-connectivity {
  padding: 0 10px;
  cursor: help;
}

.signal-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
}

.signal-bars .bar {
  width: 3px;
  background: var(--bg4);
  border-radius: 1px;
  transition: all 0.3s ease;
}

.signal-bars .bar-1 {
  height: 25%;
}

.signal-bars .bar-2 {
  height: 50%;
}

.signal-bars .bar-3 {
  height: 75%;
}

.signal-bars .bar-4 {
  height: 100%;
}

.header-connectivity.sig-1 .bar-1 {
  background: var(--green);
  box-shadow: 0 0 5px var(--green);
}

.header-connectivity.sig-2 .bar-1,
.header-connectivity.sig-2 .bar-2 {
  background: var(--green);
  box-shadow: 0 0 5px var(--green);
}

.header-connectivity.sig-3 .bar-1,
.header-connectivity.sig-3 .bar-2,
.header-connectivity.sig-3 .bar-3 {
  background: var(--green);
  box-shadow: 0 0 5px var(--green);
}

.header-connectivity.sig-4 .bar {
  background: var(--green);
  box-shadow: 0 0 5px var(--green);
}

.header-connectivity.online .bar {
  background: var(--green);
  box-shadow: 0 0 5px var(--green);
}

.header-connectivity.degraded .bar-1,
.header-connectivity.degraded .bar-2 {
  background: var(--yellow);
}

.header-connectivity.offline .bar {
  background: var(--red);
}

.header-connectivity.scanning .bar {
  background: var(--cyan);
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1
  }

  50% {
    opacity: 0.4
  }
}

/* Algo Robot Icon & Badge */
.algo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: rgba(167, 139, 250, 0.15);
  color: #a78bfa;
  border: 1px solid rgba(167, 139, 250, 0.4);
  padding: 0 4px;
  height: 15px;
  box-sizing: border-box;
  border-radius: 4px;
  font-size: 0.55rem;
  font-weight: 800;
  margin-left: 5px;
  cursor: help;
  position: relative;
  animation: robot-pulse 2s infinite ease-in-out;
  vertical-align: middle;
  letter-spacing: 0.02em;
}

.algo-icon {
  font-size: 0.75rem;
  filter: drop-shadow(0 0 5px rgba(167, 139, 250, 0.5));
}

@keyframes robot-pulse {

  0%,
  100% {
    opacity: 0.8;
    transform: scale(1);
  }

  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}

/* Tooltip for algo */
.algo-badge:hover::after {
  content: attr(data-algo);
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg3);
  color: var(--txt);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 10px;
  white-space: nowrap;
  border: 1px solid var(--borderl);
  z-index: 100;
}

.ex-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: .62rem;
  font-weight: 600;
  border: 1px solid;
  white-space: nowrap;
  transition: all .2s;
}

.ex-pill.ok {
  background: rgba(16, 185, 129, .1);
  color: var(--green);
  border-color: var(--greenB)
}

.ex-pill.loading {
  background: rgba(245, 158, 11, .1);
  color: var(--yellow);
  border-color: rgba(245, 158, 11, .25)
}

.ex-pill.error {
  background: rgba(239, 68, 68, .08);
  color: #94a3b8;
  border-color: rgba(255, 255, 255, .07)
}

.ex-pill-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor
}

.ex-pill span {
  font-size: .6rem;
  opacity: .7
}

.spike-badge {
  margin-left: 4px;
  font-size: 10px;
  animation: spike-pulse 1s infinite alternate;
}

@keyframes spike-pulse {
  from {
    opacity: 0.6;
    transform: scale(0.9);
  }

  to {
    opacity: 1;
    transform: scale(1.1);
  }
}

/* ===== MAIN ===== */
.main {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 15px 18px;
  min-height: calc(100vh - 54px);
  position: relative;
}

.vol-stats-wrap {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.vol-ex-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
}

.vol-ex-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--txt2);
  margin-bottom: 8px;
}

.vol-hour-grid {
  display: flex;
  height: 40px;
  gap: 2px;
  align-items: flex-end;
}

.vol-hour-bar {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  height: 100%;
  position: relative;
  border-radius: 2px;
}

.vol-hour-bar.active {
  background: rgba(0, 212, 255, 0.1);
}

.vol-bar-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--cyan);
  border-radius: 2px;
  transition: height 0.3s;
}

.vol-hour-bar.active .vol-bar-fill {
  background: #fff;
  box-shadow: 0 0 10px var(--cyan);
}

.welcome-footer-info {
  margin-top: 15px;
  font-size: 0.8rem;
  color: var(--txt3);
  text-align: center;
}

.help-link {
  color: var(--cyan);
  cursor: pointer;
  text-decoration: underline;
}


/* ===== TOP STRIP ===== */
.top-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: linear-gradient(135deg, rgba(0, 35, 55, .8), rgba(20, 8, 45, .8));
  border: 1px solid rgba(0, 212, 255, .15);
  border-radius: var(--r2);
  overflow: hidden;
  flex-shrink: 0;
}

.ts-label {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--yellow);
  white-space: nowrap;
  flex-shrink: 0
}

.ts-items {
  display: flex;
  overflow: hidden;
  flex: 1;
  min-width: 0;
  position: relative;
  margin-left: 15px;
  /* Added spacing from label */
  /* Fade mask at edges */
  mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
}

.ts-track {
  display: flex;
  gap: 12px;
  width: max-content;
  animation: ticker 40s linear infinite;
}

.top-strip:hover .ts-track {
  animation-play-state: paused;
}

@keyframes ticker {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(-50%);
  }
}

.ts-item {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 5px 10px;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.ts-item:hover {
  background: rgba(255, 255, 255, .08);
  border-color: var(--cyanG)
}

.ts-sym {
  font-weight: 700;
  color: var(--txt);
  font-size: .8rem
}

.ts-pct {
  font-family: var(--mono);
  font-weight: 700;
  font-size: .8rem
}

.ts-pct.low {
  color: var(--cyan)
}

.ts-pct.mid {
  color: var(--yellow)
}

.ts-pct.high {
  color: var(--red)
}

.ts-route {
  font-size: .62rem;
  color: var(--txt3)
}

.ts-placeholder {
  font-size: .75rem;
  color: var(--txt3);
  font-style: italic
}

.scanner-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r3);
  box-shadow: var(--shadow);
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.scanner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.01);
  position: relative;
}

.scanner-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 15px;
  color: var(--txt);
  margin-right: auto;
}

.scanner-count {
  margin-left: 6px;
  font-size: .62rem;
  color: var(--txt3);
  font-weight: 400;
  padding: 2px 8px;
  background: var(--cyanD);
  color: var(--cyan);
  border: 1px solid rgba(0, 212, 255, .2);
  border-radius: 10px;
  font-family: var(--mono);
}

.mode-switcher {
  display: flex;
  background: rgba(255, 255, 0, 0.05);
  background: rgba(255, 255, 255, 0.03);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--border);
  gap: 2px;
  height: 34px;
  box-sizing: border-box;
  margin: 0 auto;
}

.mode-btn {
  padding: 0 16px;
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--txt3);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  border-radius: 5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: color 0.15s, background 0.15s;
  box-sizing: border-box;
}

.mode-btn:hover {
  color: var(--txt2);
  background: rgba(255, 255, 255, 0.05);
}

.mode-btn.active {
  background: var(--cyan);
  color: #000;
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}


/* Arbitrage Badges - The Classic Pill Look */
.arb-badge-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.arb-badge {
  font-size: 0.58rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  text-transform: uppercase;
  text-align: center;
  color: #fff;
  white-space: nowrap;
}


.arb-badge.buy {
  background: #10b981;
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}

.arb-badge.sell {
  background: #ef4444;
  box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
}

.arb-sep {
  color: var(--txt4);
  font-size: 0.7rem;
  font-weight: 300;
}

/* Basis Specific */
.basis-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.55rem;
  font-weight: 800;
  padding: 0 4px;
  height: 15px;
  box-sizing: border-box;
  border-radius: 4px;
  background: var(--bg3);
  color: var(--cyan);
  border: 1px solid rgba(0, 212, 255, 0.2);
  text-transform: uppercase;
  margin-left: 5px;
  letter-spacing: 0.02em;
  vertical-align: middle;
}

.basis-info-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  font-family: var(--mono);
  font-size: 0.76rem;
}

.basis-label {
  color: var(--txt3);
  font-size: 0.62rem;
  font-weight: 400;
}

.basis-val {
  color: var(--txt);
  font-weight: 700;
}

.basis-sep {
  color: var(--border);
  font-weight: 300;
}

.td-basis-info {
  background: rgba(255, 255, 255, 0.005);
  text-align: center !important;
}

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

.action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bgi);
  border: 1px solid var(--border);
  color: var(--txt2);
  font-family: var(--font);
  font-size: 12px;
  padding: 0 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all .2s;
  height: 34px;
  box-sizing: border-box;
}

.action-btn:hover {
  color: var(--txt);
  border-color: var(--borderl)
}

.sort-select {
  background: var(--bg4);
  border: 1px solid var(--borderl);
  color: var(--txt);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  padding: 0 28px 0 12px;
  border-radius: 8px;
  cursor: pointer;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16'%3E%3Cpath d='M4 6L8 10L12 6' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: all 0.2s;
  height: 34px;
  box-sizing: border-box;
  line-height: normal;
}

.sort-select:hover {
  border-color: var(--cyanG);
  background-color: var(--bgi);
}

.sort-select option {
  background: var(--bg2);
  color: var(--txt);
}

/* Table */
.table-wrap {
  overflow: auto;
  width: 100%;
  flex: 1;
  min-height: 200px;
}

.table-wrap::-webkit-scrollbar {
  width: 5px;
  height: 5px
}

.table-wrap::-webkit-scrollbar-track {
  background: transparent
}

.table-wrap::-webkit-scrollbar-thumb {
  background: var(--borderl);
  border-radius: 3px
}

.scanner-table {
  width: 1950px;
  /* Increased to accommodate wider columns */
  border-collapse: collapse;
  font-size: 0.8rem;
  table-layout: fixed;
}

.scanner-table thead {
  position: sticky;
  top: 0;
  z-index: 10
}


.th-star,
.td-star {
  width: 100px;
  /* Increased to 100px for 3 buttons: [★] [📈] [CALC] */
  min-width: 100px;
  text-align: center !important;
  vertical-align: middle;
}

.th-pair,
.td-pair {
  width: 280px;
  min-width: 280px;
  text-align: left !important;
  position: relative;
  overflow: hidden;
}

.td-pair-wrap {
  display: flex;
  align-items: center;
  width: 100%;
  height: 100%;
  gap: 6px;
  overflow: hidden;
}

.pair-main {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  white-space: nowrap;
}

.pair-badges-box {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  white-space: nowrap;
}

.th-ex,
.td-ex {
  width: 75px;
  min-width: 75px;
}

.th-spread,
.td-spread {
  width: 90px;
  min-width: 90px;
}

.th-net,
.td-net {
  width: 90px;
  min-width: 90px;
}

.th-liq,
.td-liq {
  width: 125px;
  min-width: 125px;
}

.th-abs,
.td-abs {
  width: 105px;
  min-width: 105px;
}

.th-trend,
.td-trend {
  width: 65px;
  min-width: 65px;
  text-align: center !important;
}

.th-zscore,
.td-zscore {
  width: 80px;
  min-width: 80px;
  text-align: center !important;
}

.th-proj,
.td-proj {
  width: 120px;
  min-width: 120px;
}

.th-funding,
.td-funding {
  width: 180px;
  min-width: 180px;
}

.th-action,
.td-action {
  width: 140px;
  min-width: 140px;
  text-align: center !important;
}

.td-net.pos {
  color: #10b981;
  font-weight: 700;
}

.td-net.neg {
  color: #ef4444;
}

.th-zscore {
  width: 45px;
  min-width: 45px;
  text-align: center !important;
  vertical-align: middle;
  padding: 8px 2px;
}

/* Secondary width definitions removed - use main block at top */


/* Table - Maximum Density & Clarity */
.scanner-table th {
  padding: 8px 6px;
  text-align: right;
  color: var(--txt3);
  font-weight: 750;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 2px solid var(--border);
  background: var(--bg2);
  white-space: nowrap;
}

.scanner-table th.sortable:hover {
  color: var(--txt2);
  background: rgba(255, 255, 255, 0.03);
}

.scanner-table th.active {
  color: var(--cyan);
  background: rgba(0, 212, 255, 0.05);
  border-bottom: 2px solid var(--cyan);
}

.scanner-table td {
  padding: 5px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
  vertical-align: middle;
  text-align: right;
  font-family: var(--mono);
  white-space: nowrap;
  font-size: 0.82rem;
  color: var(--txt2);
}

.scanner-table tr {
  transition: background 0.2s ease, opacity 0.3s ease;
  will-change: opacity, transform;
}

.scanner-table tr.anim-entry {
  animation: fadeInRow 0.35s ease-out forwards;
}

@keyframes fadeInRow {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.scanner-table tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.012);
}

.scanner-table tr:hover {
  background: rgba(0, 212, 255, 0.045) !important;
}

/* Ensure stable row height to prevent vertical jitter */
.scanner-table td {
  height: 38px;
  padding: 4px 8px;
}


/* Special cells */

/* Removed redundant .td-star style */

/* Consolidated .td-pair style */
.td-pair {
  font-family: var(--font);
  font-weight: 800;
  color: var(--txt);
  font-size: 0.82rem;
  letter-spacing: 0.01em;
}

.td-sym small {
  display: block;
  font-size: 0.65rem;
  color: var(--txt3);
  font-weight: 400;
  margin-top: -1px;
}

/* Liquidity Bar */
.liq-val-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.liq-bar-bg {
  width: 40px;
  height: 3px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 2px;
  overflow: hidden;
}

.liq-bar-fill {
  height: 100%;
  background: var(--cyan);
  transition: width 0.3s;
}

/* Projected Yield Badge */
.proj-yield-badge {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 800;
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.proj-yield-badge.neg {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.2);
}

.proj-yield-badge.high {
  animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
  }

  70% {
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.arb-badge-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.arb-badge {
  font-size: 0.62rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 12px;
  /* Full rounded pills */
  text-transform: uppercase;
  min-width: 44px;
  text-align: center;
  color: #fff;
  letter-spacing: 0.02em;
}

.arb-badge.buy {
  background: #10b981;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}

.arb-badge.sell {
  background: #ef4444;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.3);
}

.arb-sep {
  color: var(--txt4);
  font-size: 0.75rem;
  font-weight: 400;
}

.ap-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 5000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

#helpModal.ap-overlay {
  padding: 0;
}

.ap-panel {
  background: var(--bg1);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
  width: 100%;
  position: relative;
  overflow: hidden;
}

/* HELP MODAL SPECIAL STYLES */
.help-panel {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  border-radius: 0;
  border: none;
  display: flex;
  flex-direction: column;
}

.help-scroll {
  padding: 40px 20px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.help-scroll>* {
  max-width: 900px;
  width: 100%;
}

.help-section {
  margin-bottom: 32px;
}

.help-section h3 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--txt);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.help-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.help-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  padding: 16px;
  border-radius: 12px;
  transition: transform 0.2s, background 0.2s;
}

.help-card:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-2px);
}

.hc-icon {
  font-size: 24px;
  margin-bottom: 10px;
}

.help-card h4 {
  font-size: 1rem;
  font-size: 1.1rem;
  color: var(--cyan);
  margin-bottom: 10px;
  font-weight: 700;
}

.help-card p {
  font-size: 1rem;
  color: var(--txt3);
  line-height: 1.6;
}

.help-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.hl-item {
  display: flex;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.hl-title {
  display: block;
  font-weight: 700;
  color: var(--cyan);
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.hl-desc {
  font-size: 1rem;
  color: var(--txt3);
  line-height: 1.6;
}

.help-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.step {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.step-num {
  width: 24px;
  height: 24px;
  background: var(--cyan);
  color: #000;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
  flex-shrink: 0;
}

.step-content {
  font-size: 0.95rem;
  color: var(--txt2);
  line-height: 1.6;
}

.help-footer {
  padding: 16px 20px;
  background: rgba(0, 0, 0, 0.2);
  font-size: 11px;
  color: var(--txt3);
  text-align: center;
  border-top: 1px solid var(--border);
}

.help-tabs-info {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.help-tab-block {
  padding-left: 15px;
  border-left: 2px solid var(--cyan);
}

.help-tab-block h4 {
  font-size: 14px;
  color: var(--txt);
  margin-bottom: 5px;
}

.help-tab-block p {
  font-size: 12px;
  color: var(--txt3);
  line-height: 1.5;
}

.help-tips {
  list-style: none;
  padding: 0;
}

.help-tips li {
  font-size: 1rem;
  color: var(--txt2);
  margin-bottom: 12px;
  padding-left: 20px;
  position: relative;
}

.help-tips li::before {
  content: "💡";
  position: absolute;
  left: 0;
}

/* Z-Score - Clean Text Look */
.z-badge {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--txt3);
}

.z-badge.high {
  color: var(--yellow);
}

.z-badge.low {
  color: var(--green);
}

/* Funding Rate Badge - Micro & Clean */
.funding-badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  margin-right: 4px;
  white-space: nowrap;
  letter-spacing: -0.02em;
  border: 1px solid transparent;
}

.funding-badge.pos {
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.2);
}

.funding-badge.neg {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.2);
}

.funding-badge.neutral {
  color: var(--txt3);
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}


/* td-pair and td-ex overrides removed/consolidated */

.td-ex.best-buy {
  color: #10b981;
  font-weight: 800;
}

.td-ex.best-sell {
  color: #ef4444;
  font-weight: 800;
}

.loading-row td,
.no-data-row td {
  text-align: center;
  padding: 40px;
  color: var(--txt3);
  font-family: var(--font);
}

.loader-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: .8rem
}

.loader-spin {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg)
  }
}

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 14px;
  border-top: 1px solid var(--border);
  font-size: 0.65rem;
  color: var(--txt3);
  background: rgba(255, 255, 255, .01);
}

.ui-v {
  opacity: 0.4;
  font-size: 0.6rem;
  font-family: var(--mono);
}

/* ===== PAGINATION ===== */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
}

.page-btn {
  background: var(--bgi);
  border: 1px solid var(--border);
  color: var(--txt3);
  font-family: var(--mono);
  font-size: 0.65rem;
  padding: 3px 9px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s;
  min-width: 28px;
  text-align: center;
}

.page-btn:hover {
  border-color: var(--borderl);
  color: var(--txt2);
}

.page-btn.active {
  background: var(--cyanD);
  border-color: var(--cyanG);
  color: var(--cyan);
  font-weight: 700;
}



/* ===== CHART PANEL ===== */
.chart-panel {
  background: rgba(13, 20, 32, 0.85);
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: var(--r3);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 30px rgba(0, 212, 255, 0.05);
  backdrop-filter: blur(20px);
  margin-top: 10px;
  overflow: hidden;
}

.cp-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.cp-pair {
  font-family: var(--mono);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--txt);
  letter-spacing: -0.02em;
}

.cp-subtitle {
  font-size: .68rem;
  color: var(--txt3);
  margin-top: 2px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cp-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.exch-select {
  background: var(--bg4);
  border: 1px solid var(--borderl);
  color: var(--txt);
  font-family: var(--font);
  font-size: .75rem;
  font-weight: 600;
  padding: 6px 28px 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16'%3E%3Cpath d='M4 6L8 10L12 6' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: all 0.2s;
}

.exch-select:hover {
  border-color: var(--cyanG);
  background-color: var(--bgi);
}

.vs-label {
  font-size: .7rem;
  font-weight: 800;
  color: var(--txt3);
  text-transform: uppercase;
  opacity: 0.5;
}

.mode-toggle {
  display: flex;
  gap: 2px;
  background: rgba(0, 0, 0, 0.2);
  padding: 3px;
  border-radius: 9px;
  border: 1px solid var(--border);
}

.ctrl-btn {
  background: transparent;
  border: none;
  color: var(--txt3);
  font-family: var(--font);
  font-size: .72rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.2s;
}

.ctrl-btn:hover {
  color: var(--txt);
}

.ctrl-btn.active {
  background: var(--cyan);
  color: #000;
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

.close-btn {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--red);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-btn:hover {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}

.cp-charts {
  display: grid;
  grid-template-columns: 200px 1fr 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border-bottom: 1px solid var(--border);
}

.chart-card {
  padding: 20px;
  background: var(--bg3);
}

.chart-label {
  font-size: .7rem;
  font-weight: 700;
  color: var(--txt2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chart-label::before {
  content: '';
  width: 3px;
  height: 12px;
  background: var(--cyan);
  border-radius: 2px;
}

.cp-wrap {
  position: relative;
  height: 220px;
}

.cp-wrap-histo {
  height: 220px;
  display: flex;
  align-items: flex-end;
  padding: 10px 5px;
}

/* Side stats panel */
.cp-stats-side {
  background: var(--bg3);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.cs-item {
  padding: 15px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: background 0.2s;
}

.cs-item:hover {
  background: rgba(255, 255, 255, 0.015);
}

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

.cs-l {
  font-size: .62rem;
  color: var(--txt3);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 700;
}

.cs-v {
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 700;
  color: var(--txt);
  letter-spacing: -0.01em;
}

.cs-v.pos {
  color: var(--green);
}

.cs-v.neg {
  color: var(--red);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1250px) {

  /* Exchange columns scroll horizontally on medium screens instead of hiding */
}

@media (max-width: 1000px) {
  .header {
    height: auto;
    padding: 12px 16px;
    display: grid;
    grid-template-areas:
      "logo settings"
      "badges badges"
      "search search";
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
  }

  .logo {
    grid-area: logo;
  }

  .search-wrap {
    grid-area: search;
    max-width: none;
    width: 100%;
    margin: 0;
  }

  .header-badges {
    grid-area: badges;
    margin: 0;
    width: 100%;
    overflow-x: auto;
    justify-content: flex-start;
    padding-bottom: 2px;
  }


  .header-badges::-webkit-scrollbar {
    height: 3px;
  }

  /* Columns scroll horizontally instead of hiding */
}

@media (max-width: 650px) {
  .main {
    padding: 8px 10px;
  }

  .admin-panel {
    width: 100vw;
    right: -100vw;
  }

  .admin-panel.open {
    right: 0;
  }

  /* Hide non-essential columns on mobile using safe classes */
  .th-rank,
  .td-rank,
  .th-star,
  .td-star,
  .th-abs,
  .td-abs,
  .th-trend,
  .td-trend,
  .th-zscore,
  .td-zscore,
  .th-funding,
  .td-funding {
    display: none;
  }

  .td-sym {
    min-width: 80px;
    font-size: 0.8rem;
  }

  .scanner-table th,
  .scanner-table td {
    padding: 10px 8px;
  }

  .top-strip {
    padding: 10px;
  }

  .scanner-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .scanner-title {
    margin: 0;
    justify-content: center;
  }

  .mode-switcher {
    margin: 0;
    justify-content: center;
  }

  .ai-mini-banner {
    margin: 0;
    width: fit-content;
    align-self: center;
  }

  .scanner-actions {
    overflow-x: auto;
    padding-bottom: 4px;
  }

  /* Single-pair chart panel mobile stack */
  .cp-charts {
    grid-template-columns: 1fr !important;
  }

  .chart-card:first-child {
    border-right: none !important;
    border-bottom: 1px solid var(--border) !important;
  }

  .cp-stats-side {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0 !important;
    border-top: 1px solid var(--border) !important;
    border-left: none !important;
    order: 4 !important;
  }

  .chart-card:nth-child(2) {
    order: 1 !important;
  }

  .chart-card:nth-child(3) {
    order: 2 !important;
  }

  .chart-card:nth-child(4) {
    order: 3 !important;
  }

  .cs-item {
    padding: 8px 10px !important;
    border-right: 1px solid var(--border) !important;
    border-bottom: 1px solid var(--border) !important;
    text-align: center !important;
    align-items: center !important;
  }

  .cs-item:nth-child(3n) {
    border-right: none !important;
  }

  .cs-item:nth-child(n+4) {
    border-bottom: none !important;
  }

  .chart-panel {
    margin: 10px 0 !important;
    overflow: hidden !important;
  }

  .chart-card {
    padding: 10px 8px !important;
  }

  .cp-wrap {
    height: 160px !important;
  }

  /* Toasts on top for mobile */
  .toast-container {
    top: 10px !important;
    bottom: auto !important;
    right: 10px !important;
    left: 10px !important;
    align-items: stretch !important;
  }

  .toast {
    min-width: 0 !important;
    width: 100% !important;
  }

  .cp-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
  }

  .cp-controls {
    margin-left: 0 !important;
    width: 100% !important;
    justify-content: space-between !important;
  }

  /* Multi-chart mobile */
  .mc-card {
    margin: 10px 0 !important;
  }

  .mc-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }

  .mc-actions {
    justify-content: space-between !important;
  }

  .mc-chart-wrap {
    height: 200px !important;
    padding: 8px !important;
    grid-template-columns: 1fr !important;
  }

  .mc-stats-side {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    border-left: none !important;
    border-top: 1px solid var(--border) !important;
    order: 2 !important;
  }

  .mc-chart-wrap canvas {
    order: 1 !important;
  }

  .ms-item {
    border-bottom: none !important;
    border-right: 1px solid var(--border) !important;
    text-align: center !important;
  }

  .ms-item:nth-child(3n) {
    border-right: none !important;
  }
}

/* ===== ALERT CONTROLS BAR ===== */
.alert-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.icon-btn {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bgi);
  border: 1px solid var(--border);
  border-radius: 7px;
  cursor: pointer;
  font-size: .9rem;
  transition: all .2s;
  flex-shrink: 0;
  color: var(--txt2);
}

.icon-btn:hover {
  border-color: var(--borderl);
  background: var(--bg4);
  transform: scale(1.05)
}

.icon-btn.active {
  border-color: var(--cyanG);
  background: var(--cyanD);
  box-shadow: 0 0 10px rgba(0, 212, 255, .15)
}

.icon-btn.active-sound {
  border-color: rgba(16, 185, 129, .3);
  background: var(--greenD)
}

.icon-btn.active-notif {
  border-color: rgba(245, 158, 11, .3);
  background: var(--yellowD)
}

.icon-btn.active-watch {
  border-color: rgba(245, 158, 11, .4);
  background: var(--yellowD)
}

/* ===== STAR / WATCHLIST ===== */
.th-star {
  min-width: 40px;
  width: 40px;
  text-align: center !important;
}

.td-star {
  text-align: center !important;
  width: 28px
}

.star-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: .85rem;
  color: var(--txt4);
  padding: 0;
  transition: all .2s;
  line-height: 1;
}

.star-btn:hover {
  color: var(--yellow);
  transform: scale(1.2)
}

.star-btn.starred {
  color: var(--yellow);
  text-shadow: 0 0 8px rgba(245, 158, 11, .5)
}

/* ===== TREND ARROWS ===== */
.th-trend {
  width: 52px;
  text-align: center !important
}

.td-trend {
  text-align: center !important;
  font-size: .9rem;
  width: 52px
}

.trend-up {
  color: var(--green);
  animation: trendPop .3s ease
}

.trend-dn {
  color: var(--red);
  animation: trendPop .3s ease
}

.trend-eq {
  color: var(--txt4)
}

@keyframes trendPop {
  0% {
    transform: scale(1.4)
  }

  100% {
    transform: scale(1)
  }
}

/* ===== Z-SCORE COLUMN ===== */
/* Removed redundant z-score/funding styles */

.td-funding {
  width: 180px;
  min-width: 180px;
  font-size: .65rem;
  text-align: center !important;
  vertical-align: middle;
  padding: 4px 4px;
}

.th-funding {
  width: 180px;
  min-width: 180px;
}

.zscore-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--mono);
  font-weight: 700;
  font-size: .75rem;
}

.zscore-normal {
  color: var(--txt3)
}

.zscore-elevated {
  background: rgba(245, 158, 11, .15);
  color: var(--yellow);
  border: 1px solid rgba(245, 158, 11, .25)
}

.zscore-extreme {
  background: rgba(239, 68, 68, .15);
  color: var(--red);
  border: 1px solid rgba(239, 68, 68, .3);
  animation: zFlash .5s ease
}

@keyframes zFlash {
  0% {
    box-shadow: 0 0 10px rgba(239, 68, 68, .5)
  }

  100% {
    box-shadow: none
  }
}

/* ===== HOT / NEW BADGES ===== */
.hot-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  background: linear-gradient(135deg, #ef4444, #991b1b);
  color: #fff;
  border: 1px solid rgba(239, 68, 68, 0.4);
  margin-left: 6px;
  vertical-align: middle;
  text-transform: uppercase;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.25);
  animation: hotPulse 1.5s infinite cubic-bezier(0.4, 0, 0.2, 1);
}

.new-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.58rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  background: linear-gradient(135deg, #00d4ff, #0080ff);
  color: #fff;
  border: 1px solid rgba(0, 212, 255, 0.4);
  margin-left: 6px;
  vertical-align: middle;
  text-transform: uppercase;
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.25);
}

@keyframes hotPulse {

  0%,
  100% {
    opacity: 1
  }

  50% {
    opacity: .5
  }
}

/* ===== ROW FLASH ANIMATION (new opportunity) ===== */
.row-flash {
  animation: rowFlash .8s ease
}

@keyframes rowFlash {
  0% {
    background: rgba(0, 212, 255, .12)
  }

  50% {
    background: rgba(0, 212, 255, .06)
  }

  100% {
    background: transparent
  }
}

.row-hot td {
  background: rgba(239, 68, 68, .04) !important
}

.row-hot:hover td {
  background: rgba(239, 68, 68, .07) !important
}

/* ===== NOTIFICATION TOAST ===== */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 10001;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--bg3);
  border: 1px solid var(--borderl);
  border-radius: var(--r2);
  padding: 12px 16px;
  min-width: 260px;
  max-width: 340px;
  pointer-events: all;
  box-shadow: var(--shadow), 0 0 20px rgba(0, 212, 255, .1);
  animation: toastIn .3s ease;
  border-left: 3px solid var(--cyan);
}

.toast.alert-toast {
  border-left-color: var(--yellow);
  background: rgba(17, 24, 39, .98)
}

.toast-title {
  font-weight: 700;
  font-size: .8rem;
  color: var(--txt);
  margin-bottom: 3px
}

.toast-body {
  font-size: .72rem;
  color: var(--txt2);
  font-family: var(--mono)
}

.toast-close {
  position: absolute;
  top: 8px;
  right: 10px;
  cursor: pointer;
  color: var(--txt3);
  font-size: .75rem;
  background: none;
  border: none;
}

.toast-wrap {
  position: relative
}

@keyframes toastIn {
  from {
    transform: translateX(20px);
    opacity: 0
  }

  to {
    transform: translateX(0);
    opacity: 1
  }
}

@keyframes toastOut {
  from {
    opacity: 1
  }

  to {
    transform: translateX(20px);
    opacity: 0
  }
}

.toast.hiding {
  animation: toastOut .25s ease forwards
}

/* ═══════════════════════════════════════════
   ADMIN PANEL
═══════════════════════════════════════════ */

.ap-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  z-index: 500;
  backdrop-filter: blur(2px);
  animation: bkdIn .25s ease;
}

.ap-backdrop.visible {
  display: block;
}

@keyframes bkdIn {
  from {
    opacity: 0
  }

  to {
    opacity: 1
  }
}

.admin-panel {
  position: fixed;
  top: 0;
  right: -470px;
  width: 450px;
  height: 100vh;
  background: var(--bg2);
  border-left: 1px solid var(--borderl);
  z-index: 600;
  display: flex;
  flex-direction: column;
  transition: right .3s cubic-bezier(.4, 0, .2, 1);
  box-shadow: -8px 0 40px rgba(0, 0, 0, .5);
}

.admin-panel.open {
  right: 0;
}

.ap-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, .02);
  flex-shrink: 0;
}

.ap-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .9rem;
  font-weight: 700;
  color: var(--txt);
}

.ap-close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bgi);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  color: var(--txt3);
  font-size: .8rem;
  transition: all .2s;
}

.ap-close:hover {
  color: var(--txt);
  border-color: var(--borderl);
}

/* Tabs */
.ap-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--bg3);
  scrollbar-width: none;
  flex-wrap: wrap;
}

.ap-tabs::-webkit-scrollbar {
  display: none;
}

.ap-tab {
  flex: 1 0 auto;
  padding: 12px 10px;
  background: none;
  border: none;
  color: var(--txt3);
  font-family: var(--font);
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.ap-tab:hover {
  color: var(--txt2);
}

.ap-tab.active {
  color: var(--cyan);
  border-bottom-color: var(--cyan);
  background: rgba(0, 212, 255, .04);
}

/* Content */
.ap-content {
  display: none;
  flex-direction: column;
  gap: 0;
  padding: 16px;
  overflow-y: auto;
  flex: 1;
}

.ap-content::-webkit-scrollbar {
  width: 4px;
}

.ap-content::-webkit-scrollbar-thumb {
  background: var(--borderl);
  border-radius: 2px;
}

.ap-content.active {
  display: flex;
}

.ap-section-title {
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--txt2);
  margin: 16px 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ap-section-title:first-child {
  margin-top: 0;
}

.ap-count-badge {
  background: var(--cyanD);
  color: var(--cyan);
  border: 1px solid rgba(0, 212, 255, .2);
  padding: 1px 6px;
  border-radius: 8px;
  font-family: var(--mono);
  font-size: .65rem;
  font-weight: 500;
}

.ap-divider {
  height: 1px;
  background: var(--border);
  margin: 12px 0;
}

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

.ap-label {
  font-size: .72rem;
  color: var(--txt2);
  flex: 1;
}

.ap-hint {
  font-size: .72rem;
  color: var(--txt3);
  margin-top: -2px;
  margin-bottom: 6px;
  line-height: 1.5;
}

.ap-input-num {
  background: var(--bgi);
  border: 1px solid var(--border);
  color: var(--txt);
  font-family: var(--mono);
  font-size: .75rem;
  padding: 4px 8px;
  border-radius: 6px;
  outline: none;
  width: 74px;
  text-align: right;
  transition: border-color .2s;
}

.ap-input-num:focus {
  border-color: var(--cyanG);
}

/* Volume Stats Visualization */
.vol-stats-wrap {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 10px 0;
}

.vol-exch-row {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
}

.vol-exch-name {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--txt2);
  margin-bottom: 12px;
  letter-spacing: 0.1em;
}

.vol-bars {
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  gap: 2px;
  height: 60px;
  align-items: flex-end;
}

.vol-bar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  justify-content: flex-end;
  cursor: pointer;
}

.vol-bar {
  width: 100%;
  background: var(--borderl);
  border-radius: 2px 2px 0 0;
  min-height: 1px;
  transition: all 0.3s ease;
}

.vol-bar.peak {
  background: var(--cyan);
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

.vol-bar-wrap:hover .vol-bar {
  background: var(--txt3);
}

.vol-bar-lbl {
  font-size: 0.5rem;
  color: var(--txt3);
  font-family: var(--mono);
}

.ap-row-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ap-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 110px;
  height: 4px;
  background: var(--bgi);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.ap-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--cyan);
  cursor: pointer;
  border: 2px solid var(--bg2);
  box-shadow: 0 0 6px rgba(0, 212, 255, .4);
}

.ap-slider-val {
  font-family: var(--mono);
  font-size: .7rem;
  color: var(--cyan);
  min-width: 28px;
  text-align: right;
}

.ap-btn-sm {
  background: var(--bgi);
  border: 1px solid var(--borderl);
  color: var(--txt2);
  font-family: var(--font);
  font-size: .68rem;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}

.ap-btn-sm:hover {
  color: var(--txt);
  border-color: var(--cyan);
}

.ap-btn-danger {
  border-color: rgba(239, 68, 68, .3);
  color: var(--red);
}

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

/* Speed / size buttons */
.ap-speed-btns,
.ap-size-btns {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.speed-btn {
  background: var(--bgi);
  border: 1px solid var(--border);
  color: var(--txt3);
  font-family: var(--font);
  font-size: .65rem;
  padding: 4px 9px;
  border-radius: 5px;
  cursor: pointer;
  transition: all .2s;
}

.speed-btn:hover {
  border-color: var(--borderl);
  color: var(--txt2);
}

.speed-btn.active {
  background: var(--cyanD);
  border-color: var(--cyanG);
  color: var(--cyan);
  font-weight: 600;
}

/* Exchange list */
.ap-exchange-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Split exchange columns (Spot vs Futures) */
.ap-exchanges-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.ap-exch-column {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ap-exch-column-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--txt2);
  padding: 6px 10px;
  background: var(--bg3);
  border-radius: 6px;
  border: 1px solid var(--border);
}

.ap-exch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bgi);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color .2s;
}

.ap-exch-row:hover {
  border-color: var(--borderl);
}

.ap-exch-row.disabled {
  opacity: .45;
}

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

.ap-exch-dot.ok {
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
}

.ap-exch-dot.cors {
  background: var(--yellow);
}

.ap-exch-dot.err {
  background: var(--red);
}

.ap-exch-dot.off {
  background: var(--txt4);
}

.ap-exch-name {
  font-weight: 600;
  font-size: .75rem;
  color: var(--txt);
  flex: 1;
}

.ap-exch-stat {
  font-family: var(--mono);
  font-size: .62rem;
  color: var(--txt3);
}

.ap-exch-toggle {
  flex-shrink: 0;
}

/* Alert log */
.alert-log {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  max-height: 140px;
  overflow-y: auto;
  font-family: var(--mono);
  font-size: .65rem;
}

.alert-log::-webkit-scrollbar {
  width: 3px;
}

.alert-log::-webkit-scrollbar-thumb {
  background: var(--borderl);
}

.alert-log-empty {
  color: var(--txt4);
  text-align: center;
  padding: 8px;
}

.alert-log-item {
  padding: 3px 0;
  border-bottom: 1px solid var(--border);
  color: var(--txt2);
  display: flex;
  gap: 8px;
}

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

.alert-log-time {
  color: var(--txt3);
  flex-shrink: 0;
}

.alert-log-sym {
  color: var(--yellow);
  font-weight: 600;
}

.alert-log-pct {
  color: var(--red);
}

/* Watchlist tags */
.watchlist-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-height: 52px;
}

.watchlist-empty {
  color: var(--txt4);
  font-size: .72rem;
  width: 100%;
  text-align: center;
  padding: 8px;
}

.wl-tag {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bgi);
  border: 1px solid var(--borderl);
  padding: 3px 8px;
  border-radius: 5px;
  font-size: .7rem;
  font-family: var(--mono);
  color: var(--txt);
  transition: all .2s;
}

.wl-tag:hover {
  border-color: var(--redB);
}

.wl-remove {
  cursor: pointer;
  color: var(--txt3);
  font-size: .7rem;
  line-height: 1;
  transition: color .2s;
}

.wl-remove:hover {
  color: var(--red);
}

/* Top strip quick buttons */
.ts-quick {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
  margin-left: 8px;
}

.ts-icon-btn {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  font-size: .75rem;
  transition: all .2s;
}

.ts-icon-btn:hover {
  background: rgba(255, 255, 255, .1);
}

.ts-icon-btn.active {
  background: var(--cyanD);
  border-color: var(--cyanG);
}

/* ═══════════════════════════════════════════
   TELEGRAM SECTION
═══════════════════════════════════════════ */

.ap-tg-badge {
  background: #1a4060;
  color: #2AABEE;
  border: 1px solid rgba(42, 171, 238, .25);
  padding: 1px 7px;
  border-radius: 7px;
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-left: 4px;
}

.tg-settings {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg3);
  border-radius: 8px;
  padding: 12px;
  margin-top: 10px;
  border: 1px dashed var(--border);
}


.ap-input-tg {
  background: var(--bgi);
  border: 1px solid var(--border);
  color: var(--txt);
  font-family: var(--mono);
  font-size: .65rem;
  padding: 5px 8px;
  border-radius: 6px;
  outline: none;
  width: 160px;
  transition: border-color .2s;
}

.ap-input-tg:focus {
  border-color: #2AABEE;
}

.ap-input-tg::placeholder {
  color: var(--txt4);
}

.tg-hint-block {
  background: rgba(42, 171, 238, .05);
  border: 1px solid rgba(42, 171, 238, .15);
  border-radius: 8px;
  padding: 8px 10px;
  margin: 6px 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.tg-step {
  font-size: .62rem;
  color: var(--txt3);
  line-height: 1.5;
}

.tg-step a {
  color: #2AABEE;
  text-decoration: none;
  font-weight: 600;
}

.tg-step a:hover {
  text-decoration: underline;
}

.ap-btn-tg {
  background: rgba(42, 171, 238, .12);
  border-color: rgba(42, 171, 238, .3);
  color: #2AABEE;
  display: flex;
  align-items: center;
  gap: 5px;
}

.ap-btn-tg:hover {
  background: rgba(42, 171, 238, .2);
  border-color: #2AABEE;
  color: #fff;
}

.tg-status {
  font-family: var(--mono);
  font-size: .65rem;
  padding: 3px 8px;
  border-radius: 5px;
  display: none;
}

.tg-status.ok {
  display: inline-block;
  background: rgba(16, 185, 129, .12);
  color: var(--green);
  border: 1px solid rgba(16, 185, 129, .2);
}

.tg-status.error {
  display: inline-block;
  background: rgba(239, 68, 68, .12);
  color: var(--red);
  border: 1px solid rgba(239, 68, 68, .2);
}

.tg-status.loading {
  display: inline-block;
  background: rgba(245, 158, 11, .1);
  color: var(--yellow);
  border: 1px solid rgba(245, 158, 11, .2);
}

/* WS live badge */
.ws-badge {
  font-size: .58rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(16, 185, 129, .12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, .25);
  letter-spacing: .04em;
  margin-left: 2px;
  flex-shrink: 0;
}

.ws-badge.connecting {
  background: rgba(245, 158, 11, .1);
  color: var(--yellow);
  border-color: rgba(245, 158, 11, .2);
  animation: pulse 1.2s infinite;
}

/* ============================================================
   MULTI-PAIR CHART PANEL (PREMIUM MOD)
   ============================================================ */
.mc-card {
  background: rgba(13, 20, 32, 0.7);
  border: 1px solid rgba(167, 139, 250, 0.2);
  border-radius: var(--r3);
  margin: 0 16px 20px;
  overflow: hidden;
  display: none;
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4), 0 0 20px rgba(167, 139, 250, 0.05);
  animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
}

.mc-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .85rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: .01em;
}

.mc-title svg {
  filter: drop-shadow(0 0 5px rgba(167, 139, 250, 0.5));
}

.mc-count {
  font-size: .65rem;
  font-weight: 800;
  padding: 2px 10px;
  border-radius: 20px;
  background: rgba(167, 139, 250, 0.15);
  color: #a78bfa;
  border: 1px solid rgba(167, 139, 250, 0.3);
  margin-left: 8px;
  text-transform: uppercase;
}

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

.mc-btn {
  font-family: var(--font);
  font-size: .68rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: var(--txt2);
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}

.mc-btn:hover {
  background: rgba(167, 139, 250, 0.2);
  border-color: rgba(167, 139, 250, 0.5);
  color: #fff;
  transform: translateY(-1px);
}

.mc-btn-clear:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.5);
  color: #ff8080;
}

.mc-btn-close {
  padding: 6px 10px;
  font-size: .8rem;
  opacity: 0.7;
}

.mc-btn-close:hover {
  opacity: 1;
  background: rgba(239, 68, 68, 0.2);
}

/* Chips strip */
.mc-chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 18px;
  min-height: 44px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  background: rgba(0, 0, 0, 0.2);
}

.mc-empty {
  font-size: .7rem;
  color: var(--txt3);
  font-style: normal;
  display: flex;
  align-items: center;
  gap: 6px;
}

.mc-empty kbd {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(167, 139, 250, 0.1);
  border: 1px solid rgba(167, 139, 250, 0.3);
  font-family: inherit;
  font-size: .7rem;
  color: #a78bfa;
}

/* Individual coin chip */
.mc-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .03em;
  cursor: pointer;
  transition: all .2s;
  user-select: none;
  background: rgba(var(--chip-r), var(--chip-g), var(--chip-b), 0.1);
  border: 1px solid rgba(var(--chip-r), var(--chip-g), var(--chip-b), 0.3);
  color: rgb(var(--chip-r), var(--chip-g), var(--chip-b));
  position: relative;
  overflow: hidden;
}

.mc-chip::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.05), transparent);
  transform: translateX(-100%);
  transition: transform 0.3s;
}

.mc-chip:hover::after {
  transform: translateX(100%);
}

.mc-chip:hover {
  border-color: rgba(var(--chip-r), var(--chip-g), var(--chip-b), 0.6);
  background: rgba(var(--chip-r), var(--chip-g), var(--chip-b), 0.18);
  transform: translateY(-1px);
}

.mc-chip.hidden-line {
  opacity: .35;
  filter: grayscale(0.8);
  text-decoration: line-through;
}

.mc-chip-x {
  font-size: 1rem;
  font-weight: 300;
  opacity: .5;
  margin-left: 2px;
  line-height: 1;
  transition: all .2s;
}

.mc-chip-x:hover {
  opacity: 1;
  color: #fff;
  transform: scale(1.2);
}

/* Chart area */
.mc-chart-wrap {
  padding: 20px 18px 10px;
  height: 280px;
  position: relative;
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 1px;
  background: var(--border);
}

.mc-chart-wrap canvas {
  width: 100% !important;
  height: 100% !important;
  background: var(--bg3);
}

/* Multi-stats side panel */
.mc-stats-side {
  background: var(--bg3);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.ms-item {
  padding: 12px 15px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: background 0.2s;
}

.ms-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

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

.ms-l {
  font-size: 0.6rem;
  color: var(--txt3);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.ms-v {
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
}

.ms-v.pos {
  color: #10b981;
}

.ms-v.neg {
  color: #ef4444;
}

.ms-v.avg {
  color: #a78bfa;
}


/* Track button in table rows */
.track-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: .75rem;
  opacity: .35;
  padding: 1px 2px;
  border-radius: 3px;
  transition: all .14s;
  color: #a78bfa;
  line-height: 1;
  display: block;
  margin-top: 2px;
}

.track-btn:hover {
  opacity: 1;
  background: rgba(167, 139, 250, .12);
}

.ws-badge.connecting {
  background: rgba(245, 158, 11, .1);
  color: var(--yellow);
  border-color: rgba(245, 158, 11, .2);
  animation: pulse 1.2s infinite;
}



/* Track button in table rows */
.track-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: .75rem;
  opacity: .35;
  padding: 1px 2px;
  border-radius: 3px;
  transition: all .14s;
  color: #a78bfa;
  line-height: 1;
  display: block;
  margin-top: 2px;
}

.track-btn:hover {
  opacity: 1;
  background: rgba(167, 139, 250, .12);
}

.track-btn.tracked {
  opacity: 1;
  color: #a78bfa;
}

/* ===== RESPONSIVE (FORCED FIX) ===== */
/* Removed conflicting forced media query */

@media (max-width: 1000px) {
  .header {
    height: auto !important;
    padding: 12px 16px !important;
    display: grid !important;
    grid-template-areas:
      "logo settings"
      "badges badges"
      "search search" !important;
    grid-template-columns: 1fr auto !important;
    gap: 10px !important;
    align-items: center !important;
  }

  .logo {
    grid-area: logo !important;
    display: flex !important;
  }

  .settings-btn {
    grid-area: settings !important;
    margin: 0 !important;
  }

  .header-badges {
    grid-area: badges !important;
    margin: 0 !important;
    width: 100% !important;
    overflow-x: auto !important;
    justify-content: flex-start !important;
  }

  .search-wrap {
    grid-area: search !important;
    max-width: none !important;
    width: 100% !important;
    margin: 0 !important;
  }

  /* Columns scroll horizontally instead of hiding */
}

@media (max-width: 650px) {
  .main {
    padding: 8px 10px !important;
  }

  .admin-panel {
    width: 100vw !important;
    right: -100vw !important;
  }

  .admin-panel.open {
    right: 0 !important;
  }

  /* Hide non-essential columns on mobile using safe classes */
  .th-rank,
  .td-rank,
  .th-star,
  .td-star,
  .th-abs,
  .td-abs,
  .th-trend,
  .td-trend,
  .th-zscore,
  .td-zscore,
  .th-funding,
  .td-funding {
    display: none !important;
  }

  .td-sym {
    min-width: 60px !important;
    font-size: 0.75rem !important;
  }

  .td-spread {
    min-width: 50px !important;
  }

  .arb-badge {
    font-size: 0.55rem !important;
    padding: 1px 4px !important;
  }

  .scanner-table th,
  .scanner-table td {
    padding: 8px 6px !important;
  }

  .scanner-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .scanner-title,
  .mode-switcher {
    margin: 0 !important;
    justify-content: center;
  }

  .ai-mini-banner {
    margin: 0 auto !important;
    width: fit-content;
  }
}

/* ===== AI INSIGHT COMPONENT ===== */
.ai-insight-card {
  background: linear-gradient(135deg, rgba(13, 20, 32, 0.95), rgba(20, 8, 45, 0.95));
  border: 1px solid rgba(124, 58, 237, 0.3);
  border-radius: var(--r3);
  padding: 16px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(124, 58, 237, 0.15);
  backdrop-filter: blur(20px);
  animation: slideInDown 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  margin-bottom: 8px;
}

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

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ai-insight-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--purple), var(--cyan), transparent);
}

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

.ai-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 0.9rem;
  color: #fff;
}

.ai-icon-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--purple);
  box-shadow: 0 0 10px var(--purple);
  animation: ai-pulse 2s infinite;
}

@keyframes ai-pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.5);
    opacity: 0.5;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.ai-close-btn {
  background: none;
  border: none;
  color: var(--txt3);
  cursor: pointer;
  font-size: 1rem;
  transition: color 0.2s;
}

.ai-close-btn:hover {
  color: var(--red);
}

.ai-content-wrap {
  min-height: 60px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--r);
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.ai-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--txt2);
  font-size: 0.85rem;
  padding: 20px 0;
}

.ai-loader {
  width: 18px;
  height: 18px;
  border: 2px solid var(--purpleD);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.ai-text {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--txt);
  white-space: pre-wrap;
}

.ai-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
}

.ai-model-tag {
  font-size: 0.65rem;
  color: var(--txt3);
  font-family: var(--mono);
  background: var(--bg4);
  padding: 3px 8px;
  border-radius: 4px;
}

.ai-gen-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--purple), #6366f1);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.ai-gen-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
  filter: brightness(1.1);
}

.ai-gen-btn:active {
  transform: translateY(0);
}

.ai-spark {
  animation: ai-sparkle 1.5s infinite alternate;
}

@keyframes ai-sparkle {
  from {
    opacity: 0.6;
    transform: scale(0.9);
  }

  to {
    opacity: 1;
    transform: scale(1.1);
  }
}

.ai-mini-banner {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--purpleD);
  color: var(--purple);
  border: 1px solid rgba(124, 58, 237, 0.2);
  padding: 0 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  margin-left: auto;
  margin-right: 12px;
  height: 34px;
  box-sizing: border-box;
}

.ai-mini-banner:hover {
  background: var(--purple);
  color: #fff;
  box-shadow: 0 0 10px rgba(124, 58, 237, 0.4);
}

/* ===== COIN BADGES (HOT, NEW, DEAD) ===== */
.coin-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.55rem;
  font-weight: 800;
  padding: 2px 5px;
  height: 16px;
  border-radius: 4px;
  margin-left: 2px;
  vertical-align: middle;
  flex-shrink: 0;
  text-transform: uppercase;
  color: #fff;
}

.coin-badge.hot {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
  animation: badge-pulse 2s infinite;
}

.coin-badge.new {
  background: linear-gradient(135deg, #06b6d4, #3b82f6);
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.4);
}

.coin-badge.dead {
  background: rgba(239, 68, 68, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-style: italic;
}

@keyframes badge-pulse {

  0%,
  100% {
    opacity: 0.8;
  }

  50% {
    opacity: 1;
  }
}

/* FIX: Full width table */
.main {
  max-width: 100% !important;
  padding: 12px 18px;
}

/* ===== ARB CALCULATOR ===== */
.calc-panel {
  width: 380px !important;
  right: -400px !important;
}

.calc-panel.open {
  right: 20px !important;
}

.calc-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.calc-pair-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg3);
  padding: 12px;
  border-radius: var(--r2);
  border: 1px solid var(--border);
}

.cp-side {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cp-side small {
  font-size: 0.65rem;
  color: var(--txt3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cp-val {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--txt);
  font-family: var(--mono);
}

.cp-arrow {
  color: var(--cyan);
  font-size: 1.2rem;
  font-weight: 700;
}

.calc-input-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.calc-input-section label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--txt2);
}

.calc-input-section input {
  background: var(--bgi);
  border: 1px solid var(--borderl);
  color: var(--txt);
  padding: 12px;
  font-size: 1.2rem;
  border-radius: var(--r);
  font-family: var(--mono);
  outline: none;
  text-align: center;
}

.calc-input-section input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 10px var(--cyanD);
}

.calc-results {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cr-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cr-label {
  font-size: 0.85rem;
  color: var(--txt2);
}

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

.cr-item.main .cr-label {
  font-weight: 800;
  color: var(--txt);
  font-size: 1rem;
}

.cr-item.main .cr-val {
  font-size: 1.4rem;
  color: var(--green);
}

.calc-warning {
  background: var(--yellowD);
  color: var(--yellow);
  padding: 10px;
  border-radius: var(--r);
  font-size: 0.75rem;
  border: 1px solid rgba(245, 158, 11, 0.2);
  line-height: 1.5;
}

.calc-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 0;
}

.cs-row {
  font-size: 0.8rem;
  color: var(--txt2);
  line-height: 1.4;
}

.cs-row b {
  color: var(--txt);
}

/* Button in table */
.calc-btn {
  background: var(--bg4);
  border: 1px solid var(--borderl);
  color: var(--txt2);
  font-size: 10px;
  padding: 2px 5px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  font-weight: 800;
  vertical-align: middle;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}

.calc-btn:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

.scanner-card {
  margin: 0;
  width: 100%;
}

.scanner-table {
  min-width: 100%;
}

/* ===== HELP MODAL PROFESSIONAL STYLES ===== */
.help-section.intro {
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.05) 0%, rgba(124, 58, 237, 0.05) 100%);
  padding: 24px;
  border-radius: var(--r2);
  border: 1px solid rgba(255, 255, 255, 0.03);
  margin-bottom: 25px;
}

.intro-badge {
  display: inline-block;
  padding: 2px 10px;
  background: var(--cyanD);
  color: var(--cyan);
  border: 1px solid var(--cyanG);
  border-radius: 20px;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

.help-section h2 {
  font-size: 1.8rem;
  margin-bottom: 15px;
  color: #fff;
  letter-spacing: -0.02em;
}

.help-section.intro p {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--txt2);
}

.tips-box {
  background: rgba(245, 158, 11, 0.03);
  border-left: 3px solid var(--yellow);
  padding: 16px 20px !important;
}

.tips-box h3 {
  color: var(--yellow) !important;
}

.help-steps .step-num {
  background: var(--bg4);
  border: 1px solid var(--borderl);
  color: var(--cyan);
  font-family: var(--mono);
  font-weight: 800;
}

.help-steps .step-content b {
  color: #fff;
}

.help-section.beginner-path {
  background: rgba(16, 185, 129, 0.03);
  padding: 20px;
  border-radius: var(--r2);
  border: 1px solid rgba(16, 185, 129, 0.1);
}

.help-section.beginner-path h3 {
  color: #10b981 !important;
}

.help-section.beginner-path .hl-title {
  color: #10b981;
}

.help-section.beginner-path .hl-item {
  background: rgba(16, 185, 129, 0.05);
  border-color: rgba(16, 185, 129, 0.1);
}

/* Site Footer */
.site-footer {
  padding: 60px 20px;
  background: var(--bg2);
  border-top: 1px solid var(--borderl);
  margin-top: auto;
}

.footer-disclaimer {
  max-width: 1000px;
  margin: 0 auto;
  text-align: center;
  font-size: 0.75rem;
  color: var(--txt3);
  line-height: 1.6;
  opacity: 0.6;
}

.footer-disclaimer b {
  color: var(--txt2);
  display: block;
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ==========================================================================
   PREMIUM LANDING PAGE STYLES (One-Pager Refined)
   ========================================================================== */

.welcome-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  min-height: 100vh;
  background: #05070a;
  z-index: 999;
  font-family: 'Inter', sans-serif;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

.welcome-screen.hidden {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
  display: none !important;
}

/* Nav */
.welcome-nav {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 100;
  background: rgba(5, 7, 10, 0.6);
  backdrop-filter: blur(15px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  pointer-events: auto;
}

.welcome-screen.hidden .welcome-nav {
  pointer-events: none;
}

.welcome-nav .nav-container {
  max-width: 1200px;
  margin: 0 auto;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.welcome-nav .logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1.6rem;
  color: #fff;
  letter-spacing: -0.5px;
  filter: drop-shadow(0 0 8px rgba(0, 212, 255, 0.3));
}

.welcome-nav .nav-links {
  display: flex;
  align-items: center;
  gap: 40px;
}

.welcome-nav .nav-links a {
  color: var(--txt2);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.3s ease;
  opacity: 0.8;
}

.welcome-nav .nav-links a:hover {
  color: var(--cyan);
  opacity: 1;
}

.welcome-nav .nav-cta {
  background: var(--primary-g);
  color: white !important;
  padding: 10px 24px;
  border-radius: 50px;
  font-weight: 800 !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  opacity: 1 !important;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.welcome-nav .nav-cta:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

/* Hero Section - Full viewport height */
.hero {
  position: sticky;
  top: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 120px 0 80px;
  overflow: visible;
  z-index: 1;
  background: #05070a;
}

.features-section,
.showcase {
  position: sticky;
  top: 0;
  min-height: 100vh;
  z-index: 2;
  display: flex;
  align-items: center;
}

.features-section {
  z-index: 2;
  background: #080b12;
}

#technology {
  z-index: 3;
  background: #05070a;
}

#stability {
  z-index: 4;
  background: #030508;
}

.welcome-footer {
  position: relative;
  z-index: 10;
  background: #000;
}

.hero .container {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 80px;
  align-items: center;
  position: relative;
  z-index: 2;
  width: 100%;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* Animated Mesh Background */
.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background-color: #000000;
  background-image: url("hero-bg-final.png?v=2.1") !important;
  background-repeat: no-repeat !important;
  background-position: center bottom !important;
  background-size: cover !important;
  background-attachment: fixed !important;
  opacity: 0.4;
  display: block !important;
  image-rendering: high-quality;
  filter: brightness(0.6) contrast(1.3) saturate(0.8);
  transition: transform 0.1s ease-out, filter 0.1s ease-out;
}

.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, transparent 20%, rgba(0, 0, 0, 0.8) 100%);
  z-index: -1;
  pointer-events: none;
}


@keyframes mesh-glow {
  0% {
    opacity: 0.4;
  }

  100% {
    opacity: 0.8;
  }
}


.hero::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background: url('data:image/svg+xml,<svg width="40" height="40" viewBox="0 0 40 40" xmlns="http://www.w3.org/2000/svg"><path d="M0 40 L40 0 M-10 10 L10 -10 M30 50 L50 30" stroke="white" stroke-width="0.5" fill="none" opacity="0.03"/></svg>');
  z-index: -1;
  pointer-events: none;
}

/* Global Container for Landing Page */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
  box-sizing: border-box;
  position: relative;
  z-index: 10;
}

.hero .container {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 80px;
  align-items: center;
  position: relative;
  z-index: 2;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  background: rgba(0, 212, 255, 0.1);
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: 50px;
  color: var(--cyan);
  font-size: 0.85rem;
  font-weight: 800;
  margin-bottom: 30px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  backdrop-filter: blur(5px);
}

.welcome-title {
  font-family: 'Outfit', sans-serif !important;
  font-size: clamp(3rem, 5vw, 4.5rem) !important;
  line-height: 1 !important;
  font-weight: 800 !important;
  margin-bottom: 30px !important;
  letter-spacing: -2px !important;
  color: #fff !important;
}

.welcome-subtitle {
  font-size: 1.3rem !important;
  color: var(--txt2) !important;
  margin-bottom: 45px !important;
  max-width: 580px !important;
  line-height: 1.6 !important;
  opacity: 0.9;
}

.hero-actions {
  display: flex;
  gap: 20px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 32px;
  border-radius: 50px;
  font-weight: 800;
  font-size: 1rem;
  font-family: 'Outfit', sans-serif;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--primary-g);
  color: white;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5);
  border-color: rgba(255, 255, 255, 0.2);
}


.btn-outline {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
  color: white;
  backdrop-filter: blur(10px);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-4px);
}


/* Auth Area Styles */
.auth-card-wrap {
  perspective: 2000px;
  animation: float-hero 8s infinite ease-in-out;
  width: 100%;
  max-width: 440px;
}

@keyframes float-hero {

  0%,
  100% {
    transform: translateY(0) rotateX(1deg);
  }

  50% {
    transform: translateY(-30px) rotateX(-1deg);
  }
}

.welcome-auth-box {
  width: 100%;
  margin-bottom: 20px;
}

.auth-form-premium {
  background: rgba(13, 20, 32, 0.7);
  backdrop-filter: blur(30px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 40px;
  border-radius: 40px;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.5), 0 0 50px rgba(0, 212, 255, 0.05);
  width: 100%;
}

.auth-header {
  text-align: center;
  margin-bottom: 40px;
}

.auth-header h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 12px;
  color: #fff;
}

.auth-header p {
  color: var(--txt3);
  font-size: 0.95rem;
  line-height: 1.5;
}

.auth-input-group {
  margin-bottom: 25px;
}

.auth-input-group label {
  display: block;
  margin-bottom: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--txt2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon svg {
  position: absolute;
  left: 20px;
  color: var(--txt4);
  transition: all 0.3s ease;
}

.input-with-icon input {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 16px 20px 16px 54px;
  color: #fff;
  font-size: 1rem;
  outline: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.input-with-icon input:focus {
  border-color: var(--cyan);
  background: rgba(0, 0, 0, 0.5);
  box-shadow: 0 0 0 4px rgba(0, 212, 255, 0.15);
}

.input-with-icon input:focus+svg {
  color: var(--cyan);
}

.auth-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  /* Slightly tightened gap */
  margin-top: 30px;
}

.btn-auth-primary,
.btn-auth-outline {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 24px;
  border-radius: 18px;
  font-weight: 700;
  font-size: 0.95rem;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
  border: 1px solid transparent;
  overflow: hidden;
}

.btn-auth-primary {
  background: var(--primary-g) !important;
  color: #fff !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3) !important;
  border: 1px solid rgba(255, 255, 255, 0.1);
}



.btn-auth-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.btn-auth-primary:active {
  transform: translateY(0);
}

.btn-auth-outline {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  backdrop-filter: blur(10px);
}


.btn-auth-outline:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.btn-auth-outline:active {
  transform: translateY(0);
}

/* Logged In Box */
.welcome-logged-in-box {
  background: rgba(13, 20, 32, 0.8);
  backdrop-filter: blur(30px);
  padding: 50px;
  border-radius: 40px;
  border: 1px solid var(--cyanG);
  text-align: center;
  box-shadow: 0 0 50px rgba(0, 212, 255, 0.1);
}

.logged-in-icon {
  margin-bottom: 25px;
}

.welcome-logged-in-box h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.8rem;
  margin-bottom: 10px;
}

.welcome-logged-in-box p {
  color: var(--txt2);
  margin-bottom: 30px;
}

.welcome-logged-in-box b {
  color: var(--cyan);
}

.btn-auth-danger-link {
  background: transparent;
  border: none;
  color: var(--txt3);
  text-decoration: underline;
  cursor: pointer;
  font-size: 0.9rem;
}

/* Launch Button */
.launch-btn {
  width: 100%;
  margin-top: 20px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  border: none;
  padding: 22px;
  border-radius: 20px;
  font-weight: 900;
  font-size: 1.2rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  box-shadow: 0 15px 35px rgba(16, 185, 129, 0.3);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.launch-btn:hover {
  transform: scale(1.02) translateY(-5px);
  box-shadow: 0 20px 50px rgba(16, 185, 129, 0.5);
}

/* Reveal Animation for Sections */
.reveal-section {
  opacity: 0;
  transform: scale(0.9);
  will-change: transform, opacity;
}

.reveal-section.active {
  opacity: 1;
  transform: scale(1);
}

/* Features Section */
.features-section {
  padding: 100px 0;
  position: sticky;
  top: 0;
}

.features-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  width: 100%;
}

.section-head {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 80px;
}

.section-head h2 {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(2.5rem, 4vw, 3.5rem);
  font-weight: 800;
  margin-bottom: 20px;
  letter-spacing: -1.5px;
  line-height: 1.1;
}

.section-head p {
  font-size: 1.25rem;
  color: var(--txt2);
  line-height: 1.6;
  opacity: 0.8;
}

.gradient-text {
  background: linear-gradient(90deg, var(--cyan), #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}


.f-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 50px 40px;
  border-radius: 32px;
  transition: all 0.4s ease;
  height: 100%;
}

.f-item:hover {
  transform: translateY(-15px);
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--cyan);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
}

.f-icon {
  width: 70px;
  height: 70px;
  background: rgba(0, 212, 255, 0.1);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  margin-bottom: 30px;
  border: 1px solid rgba(0, 212, 255, 0.2);
}

.f-item h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.6rem;
  margin-bottom: 20px;
  color: #fff;
  font-weight: 700;
}

.f-item p {
  color: var(--txt3);
  line-height: 1.7;
  font-size: 1.05rem;
}

/* Showcase */
.showcase {
  padding: 100px 0;
}

.showcase-content {
  max-width: 1200px;
  margin: 0 auto 120px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.showcase-content.reverse {
  direction: rtl;
}

.showcase-content.reverse .showcase-text,
.showcase-content.reverse .showcase-img {
  direction: ltr;
}

.showcase-img {
  width: 100%;
  height: 500px;
  border-radius: 40px;
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.6);
  position: relative;
  overflow: hidden;
}

.showcase-ai {
  background-image: url('ai_trading_analysis.png?v=1.1');
}

.showcase-delta {
  background-image: url('delta_neutral_strategy.png?v=1.1');
}

.showcase-img::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(225deg, rgba(0, 212, 255, 0.1) 0%, transparent 70%);
}

.showcase-text h2 {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(2rem, 3.5vw, 3rem);
  margin-bottom: 24px;
  letter-spacing: -1px;
}

.showcase-text p {
  font-size: 1.15rem;
  color: var(--txt3);
  margin-bottom: 32px;
  line-height: 1.7;
}

.stat-grid {
  display: flex;
  gap: 48px;
  margin-top: 40px;
}

.feature-list li {
  font-size: 1.1rem;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 15px;
}

.stat-grid {
  display: flex;
  gap: 48px;
  margin-top: 30px;
}

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


.stat-val {
  font-family: 'Outfit', sans-serif;
  font-size: 3.5rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 5px;
}

.stat-label {
  color: var(--txt4);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 0.85rem;
}

/* Footer */
.welcome-footer {
  padding: 100px 0;
  background: #030508;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-bottom {
  text-align: center;
  color: var(--txt4);
  font-size: 1rem;
}

/* Responsiveness */
@media (max-width: 1100px) {
  .hero {
    padding-top: 120px;
    min-height: auto;
  }

  .hero .container {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center;
  }

  .hero-content {
    align-items: center;
  }

  .welcome-title {
    font-size: 3rem !important;
  }

  .welcome-subtitle {
    margin: 0 auto 40px !important;
  }

  .hero-actions {
    justify-content: center;
    margin-bottom: 40px;
  }

  .auth-card-wrap {
    margin: 0 auto;
  }

  .showcase-content {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 40px;
  }

  .showcase-img {
    height: 350px;
    order: 2;
  }

  .showcase-text {
    order: 1;
  }

  .feature-list li {
    justify-content: center;
  }

  .stat-grid {
    justify-content: center;
    gap: 20px;
  }

  .feature-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .section-head h2 {
    font-size: 2.2rem;
  }

  .features-section {
    padding: 80px 0;
  }

  .welcome-nav .nav-links {
    display: none;
  }
}

/* Mobile - Fix auth form visibility and scrolling */
@media (max-width: 768px) {
  .welcome-screen {
    position: fixed;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .hero {
    padding-top: 80px;
    padding-bottom: 40px;
  }

  .welcome-title {
    font-size: 1.8rem !important;
    margin-bottom: 15px !important;
  }

  .welcome-subtitle {
    font-size: 0.85rem !important;
    margin-bottom: 25px !important;
  }

  .badge {
    padding: 6px 12px;
    font-size: 0.65rem;
    margin-bottom: 15px;
  }

  .auth-form-premium {
    padding: 20px !important;
    border-radius: 20px !important;
  }

  .auth-header {
    margin-bottom: 20px;
  }

  .auth-header h2 {
    font-size: 1.4rem !important;
    margin-bottom: 8px;
  }

  .auth-header p {
    font-size: 0.8rem;
  }

  .auth-input-group {
    margin-bottom: 15px;
  }

  .auth-input-group label {
    font-size: 0.75rem;
    margin-bottom: 6px;
  }

  .input-with-icon input {
    padding: 12px 15px 12px 45px;
    font-size: 0.9rem;
  }

  .input-with-icon svg {
    left: 15px;
  }

  .btn-auth-primary,
  .btn-auth-outline {
    padding: 12px 20px;
    font-size: 0.9rem;
    border-radius: 12px;
  }

  .trust-bar {
    margin-top: 30px;
  }

  .exchange-logos {
    gap: 15px;
  }

  .exchange-logos span {
    font-size: 0.8rem;
  }

  .welcome-subtitle {
    font-size: 0.9rem !important;
  }

  .auth-card-wrap {
    max-width: 100%;
    padding: 0 16px;
  }

  .auth-form-premium {
    padding: 24px !important;
    border-radius: 24px !important;
  }

  .auth-header h2 {
    font-size: 1.6rem !important;
  }

  .auth-actions-grid {
    grid-template-columns: 1fr;
  }

  .exchange-logos {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* ===== ADMIN PANEL EXTRA STYLES ===== */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.admin-stat-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  padding: 12px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
}

.as-label {
  font-size: 0.7rem;
  color: var(--txt3);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.as-val {
  font-family: var(--mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--cyan);
}

.admin-table-wrap {
  overflow-x: auto;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.admin-user-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.admin-user-table th {
  text-align: left;
  padding: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--txt3);
  border-bottom: 1px solid var(--border);
}

.admin-user-table td {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  color: var(--txt2);
}

.status-tag {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: bold;
}

.role-admin {
  background: rgba(245, 158, 11, 0.2);
  color: var(--yellow);
}

.role-user {
  background: rgba(0, 212, 255, 0.1);
  color: var(--cyan);
}

.admin-health-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.health-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 6px;
  font-size: 0.85rem;
}

.health-tag {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--bg3);
}

.health-tag.status-ok {
  color: var(--green);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.health-tag.status-warn {
  color: var(--yellow);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Auth Steps Styles */
.input-code {
  text-align: center;
  font-family: var(--mono);
  font-size: 1.5rem !important;
  letter-spacing: 0.5rem;
  font-weight: 700;
  color: var(--cyan);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
  padding: 10px;
  border-radius: 8px;
  width: 100%;
}

.btn-link-sm {
  background: none;
  border: none;
  color: var(--txt3);
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: underline;
  transition: color 0.2s;
}

.btn-link-sm:hover {
  color: var(--cyan);
}

.auth-forgot-link {
  text-align: right;
  margin: -10px 0 15px 0;
}

/* Auth Type Toggle */
.auth-type-toggle {
  display: flex;
  background: rgba(255, 255, 255, 0.03);
  padding: 4px;
  border-radius: 8px;
  margin-bottom: 15px;
  border: 1px solid var(--border);
}

.btn-toggle {
  flex: 1;
  background: none;
  border: none;
  padding: 8px;
  color: var(--txt3);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s;
}

.btn-toggle.active {
  background: rgba(0, 212, 255, 0.1);
  color: var(--cyan);
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.1);
}

.btn-toggle:hover:not(.active) {
  background: rgba(255, 255, 255, 0.05);
  color: var(--txt);
}

/* --- PREMIUM REHAUL 2.0 --- */
#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, #0d1420 0%, #030508 100%);
}

.auth-form-premium {
  background: rgba(10, 15, 25, 0.9) !important;
  backdrop-filter: blur(20px) saturate(160%) !important;
  border: 1px solid rgba(0, 212, 255, 0.3) !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(0, 212, 255, 0.1) !important;
  animation: authReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}


@keyframes authReveal {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Trust Bar */
.trust-bar {
  margin-top: 50px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  opacity: 0.8;
  filter: grayscale(0.5);
  transition: all 0.5s;
}

.trust-bar:hover {
  opacity: 1;
  filter: grayscale(0);
}


.trust-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--txt3);
}

.exchange-logos {
  display: flex;
  gap: 30px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.exchange-logos span {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--txt);
  opacity: 0.8;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}


/* Floating Stat Cards */
.floating-elements {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 1;
}

.stat-card-floating {
  position: absolute;
  background: rgba(20, 25, 35, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 212, 255, 0.2);
  padding: 12px 18px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
  animation: float 6s ease-in-out infinite;
}


.sc-1 {
  top: 10%;
  right: -120px;
  animation-delay: 0s;
}

.sc-2 {
  bottom: 10%;
  left: -100px;
  animation-delay: 2s;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-15px);
  }
}

.stat-card-floating .sc-val {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--cyan);
  font-family: 'JetBrains Mono', monospace;
}

.stat-card-floating .sc-label {
  font-size: 0.65rem;
  color: var(--txt3);
  text-transform: uppercase;
}

/* Security Badges */
.security-indicators {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 25px;
}

.security-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.7rem;
  color: var(--txt3);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 6px 12px;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.1);
}

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

/* New Badge System */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  background: rgba(0, 212, 255, 0.15) !important;
  color: var(--cyan);
  border: 1px solid rgba(0, 212, 255, 0.4) !important;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.badge-success {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #10b981 !important;
  border-color: rgba(16, 185, 129, 0.4) !important;
}

.trust-label {
  font-size: 0.75rem !important;
  font-weight: 700 !important;
  text-transform: uppercase;
  letter-spacing: 3px !important;
  color: var(--txt);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
  padding: 5px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 25px !important;
}

/* ===== CALCULATOR MODAL ===== */
.calc-panel {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r3);
  width: 100%;
  max-width: 440px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
  transform: scale(0.95);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.calc-panel.open {
  transform: scale(1);
  opacity: 1;
}

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

.cr-val.pos {
  color: var(--green);
}

.cr-val.neg {
  color: var(--red);
}

/* --- SMOOTH PAGE LOAD --- */
body {
  transition: background 0.3s ease;
}

#welcomeScreen {
  opacity: 0;
  transition: opacity 0.5s ease-out;
}

body.loaded #welcomeScreen {
  opacity: 1;
}

.is-authenticated #welcomeScreen {
  display: none !important;
}

/* Coin Vitality Styles */
.vitality-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  vertical-align: middle;
  margin: 0 4px;
}

.vitality-dot.live {
  background: #10b981;
  box-shadow: 0 0 5px #10b981;
  animation: pulse-dot 1s infinite alternate;
}

.vitality-dot.stale {
  background: #64748b;
}

.vitality-dot.dead {
  background: #475569;
  opacity: 0.5;
}

.coin-badge.dead {
  background: rgba(239, 68, 68, 0.1);
  color: #94a3b8;
  border-color: rgba(255, 255, 255, 0.05);
  font-style: italic;
}

.spread-info {
  font-size: 0.6rem;
  color: var(--txt3);
  margin-left: 4px;
  background: rgba(255, 255, 255, 0.05);
  padding: 1px 3px;
  border-radius: 3px;
  cursor: help;
}

@keyframes pulse-dot {
  from {
    opacity: 0.5;
    transform: scale(0.8);
  }

  to {
    opacity: 1;
    transform: scale(1.1);
  }
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
  .header { padding: 0 10px; flex-wrap: wrap; height: auto; padding-bottom: 10px; }
  .logo-title { font-size: 0.8rem; }
  .search-wrap { max-width: 100%; width: 100%; margin-top: 5px; order: 3; }
  .header-status-area { margin-left: auto; order: 2; }
  .settings-btn span { display: none; }
  .hero-content h1 { font-size: 2rem; }
  .welcome-auth-box { padding: 20px; }
  .scanner-header { flex-direction: column; gap: 10px; align-items: flex-start; }
  .mode-switcher { width: 100%; justify-content: space-between; }
  .scanner-actions { width: 100%; justify-content: space-between; }
  .ts-label { display: none; }
  .table-wrap { overflow-x: auto; }
  .admin-panel { width: 100%; right: -100%; }
  .admin-panel.open { right: 0; }
}
