/* PerpVault Pro - High-Tech Trading Terminal Theme */
/* Mandatory Standard Rules */
input, select, textarea {
  min-width: 0;
}
.lang-switcher {
  flex-shrink: 0;
}
.brand {
  min-width: 0;
}
.brand-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Base Terminal Variables */
:root {
  --bg-dark: #070a12;
  --bg-card: #0d1322;
  --bg-card-hover: #121a2e;
  --bg-subtle: #151e34;
  --border-dim: #1e293b;
  --border-glow: #2a3958;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --accent-cyan: #00f2fe;
  --accent-blue: #3b82f6;
  --accent-purple: #8b5cf6;
  --accent-green: #10b981;
  --accent-gold: #f59e0b;
  --accent-red: #ef4444;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-glow: 0 0 25px rgba(0, 242, 254, 0.15);
  --shadow-card: 0 8px 30px rgba(0, 0, 0, 0.4);
}

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

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

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 600px;
  background: radial-gradient(circle at 50% -15%, rgba(59, 130, 246, 0.18), transparent 70%),
              radial-gradient(circle at 10% 20%, rgba(139, 92, 246, 0.12), transparent 50%),
              radial-gradient(circle at 90% 15%, rgba(0, 242, 254, 0.12), transparent 50%);
  pointer-events: none;
  z-index: 0;
}

.terminal-container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 20px 24px 60px 24px;
  position: relative;
  z-index: 1;
}

/* Header */
.terminal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-dim);
  margin-bottom: 24px;
}

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

.logo-badge {
  position: relative;
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 1px solid rgba(0, 242, 254, 0.4);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.2);
  flex-shrink: 0;
}

.logo-pulse {
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  border: 1px solid var(--accent-cyan);
  opacity: 0.5;
  animation: pulseGlow 2.5s infinite;
}

@keyframes pulseGlow {
  0%, 100% { transform: scale(1); opacity: 0.4; }
  50% { transform: scale(1.08); opacity: 0.8; }
}

.logo-icon {
  font-size: 1.4rem;
}

.brand-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-version {
  font-size: 0.68rem;
  font-family: var(--font-mono);
  background: rgba(0, 242, 254, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 242, 254, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.brand-net {
  font-size: 0.65rem;
  font-family: var(--font-mono);
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-green);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
}

.brand-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 2px;
}

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

.feed-status {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-dim);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

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

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

.btn-icon {
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-icon:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
  border-color: var(--accent-blue);
}

.lang-switcher {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: 20px;
  padding: 2px;
}

.lang-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.lang-btn.active {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

/* Dual-Engine Affiliate Hero Section */
.affiliate-hero-section {
  position: relative;
  background: linear-gradient(135deg, rgba(13, 19, 34, 0.95), rgba(9, 14, 25, 0.98));
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  padding: 28px 30px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.affiliate-hero-glow {
  position: absolute;
  top: -50px;
  right: -50px;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(0, 242, 254, 0.15), transparent 70%);
  pointer-events: none;
}

.affiliate-hero-header {
  margin-bottom: 22px;
}

.aff-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 242, 254, 0.1);
  border: 1px solid rgba(0, 242, 254, 0.3);
  color: var(--accent-cyan);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 10px;
  font-family: var(--font-mono);
}

.aff-hero-title {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #ffffff, #c7d2fe, #93c5fd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}

.aff-hero-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  max-width: 900px;
}

.affiliate-dual-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.aff-card {
  position: relative;
  background: rgba(18, 25, 45, 0.85);
  border-radius: var(--radius-md);
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--border-dim);
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.aff-card.hl-card {
  border-color: rgba(0, 242, 254, 0.3);
}

.aff-card.hl-card:hover {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.2);
  transform: translateY(-2px);
}

.aff-card.bybit-card {
  border-color: rgba(245, 158, 11, 0.3);
}

.aff-card.bybit-card:hover {
  border-color: var(--accent-gold);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.2);
  transform: translateY(-2px);
}

.aff-card-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 0.65rem;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.04em;
}

.hl-badge {
  background: rgba(0, 242, 254, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 242, 254, 0.35);
}

.bybit-badge {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-gold);
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.aff-venue-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.venue-logo {
  font-size: 1.3rem;
}

.venue-name {
  font-size: 1.15rem;
  font-weight: 700;
}

.venue-perk {
  font-size: 0.72rem;
  color: var(--accent-cyan);
  background: rgba(0, 242, 254, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.aff-card.bybit-card .venue-perk {
  color: var(--accent-gold);
  background: rgba(245, 158, 11, 0.1);
}

.aff-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: #fff;
}

.aff-card-text {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 18px;
}

.aff-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
}

.code-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-dim);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
}

.code-label {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.code-string {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--accent-cyan);
}

.aff-card.bybit-card .code-string {
  color: var(--accent-gold);
}

.btn-copy-mini {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 2px;
  transition: transform 0.15s;
}

.btn-copy-mini:hover {
  transform: scale(1.15);
  color: #fff;
}

.btn-aff-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.84rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.hl-cta {
  background: linear-gradient(135deg, #00f2fe, #0284c7);
  color: #070a12;
}

.hl-cta:hover {
  box-shadow: 0 0 16px rgba(0, 242, 254, 0.4);
  transform: translateY(-1px);
}

.bybit-cta {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #070a12;
}

.bybit-cta:hover {
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.4);
  transform: translateY(-1px);
}

/* Clock HUD Section */
.clock-hud-section {
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
}

.section-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.section-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-icon {
  font-size: 1.3rem;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.clock-time-sync {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.utc-clock {
  background: rgba(0, 242, 254, 0.08);
  border: 1px solid rgba(0, 242, 254, 0.25);
  color: var(--accent-cyan);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.local-clock {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-dim);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
}

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

.clock-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-md);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s;
}

.clock-card.near-harvest {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 25px rgba(0, 242, 254, 0.3);
  animation: harvestPulse 2s infinite ease-in-out;
}

@keyframes harvestPulse {
  0%, 100% { border-color: rgba(0, 242, 254, 0.4); }
  50% { border-color: rgba(0, 242, 254, 1); }
}

.clock-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.clock-venue-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.95rem;
}

.hl-tag {
  color: var(--accent-cyan);
}

.cex-tag {
  color: var(--accent-gold);
}

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

.dot-live.cex {
  background: var(--accent-gold);
  box-shadow: 0 0 8px var(--accent-gold);
}

.clock-cycle-badge {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-dim);
  padding: 3px 8px;
  border-radius: 4px;
  color: var(--text-muted);
}

.clock-timer-wrap {
  text-align: center;
  margin: 12px 0 16px 0;
}

.timer-countdown {
  font-family: var(--font-mono);
  font-size: 3.2rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #fff;
  text-shadow: 0 0 20px rgba(0, 242, 254, 0.3);
  line-height: 1;
}

.cex-clock-card .timer-countdown {
  font-size: 2.8rem;
  text-shadow: 0 0 20px rgba(245, 158, 11, 0.3);
}

.timer-units {
  display: flex;
  justify-content: center;
  gap: 60px;
  font-size: 0.65rem;
  font-family: var(--font-mono);
  color: var(--text-dim);
  margin-top: 6px;
  letter-spacing: 0.1em;
}

.timer-units.cex-units {
  gap: 40px;
}

.clock-progress-container {
  height: 6px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 14px;
}

.clock-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #0284c7, #00f2fe);
  border-radius: 3px;
  transition: width 0.5s ease;
}

.cex-progress-bar {
  background: linear-gradient(90deg, #d97706, #f59e0b);
}

.clock-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.substat-label {
  color: var(--text-dim);
}

.substat-val {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-main);
  margin-left: 6px;
}

.clock-status-pill {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(0, 242, 254, 0.1);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 242, 254, 0.25);
}

.clock-status-pill.cex-status {
  background: rgba(245, 158, 11, 0.1);
  color: var(--accent-gold);
  border-color: rgba(245, 158, 11, 0.25);
}

/* HUD Metrics Ticker */
.metrics-hud {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.metric-hud-item {
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
}

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

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

.m-val.highlight-green {
  color: var(--accent-green);
  text-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.m-val.highlight-cyan {
  color: var(--accent-cyan);
  text-shadow: 0 0 10px rgba(0, 242, 254, 0.3);
}

.m-val.highlight-gold {
  color: var(--accent-gold);
}

.m-sub {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 4px;
  font-family: var(--font-mono);
}

/* Spread Table Section */
.spread-table-section {
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-card);
}

.table-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.table-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.table-icon {
  font-size: 1.4rem;
}

.table-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

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

.table-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.filter-tabs {
  display: flex;
  background: var(--bg-subtle);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 4px;
}

.filter-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.filter-tab.active {
  background: var(--accent-blue);
  color: #fff;
}

.refresh-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-refresh {
  background: var(--bg-subtle);
  border: 1px solid var(--border-dim);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

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

.refresh-spinner.spin {
  animation: spin 0.8s linear infinite;
}

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

.last-updated {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

/* Responsive Table */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-md);
  background: rgba(10, 15, 26, 0.6);
}

.spread-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  text-align: left;
}

.spread-table th {
  background: rgba(15, 23, 42, 0.95);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-dim);
  white-space: nowrap;
}

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

.spread-table tbody tr {
  transition: background-color 0.2s;
  cursor: pointer;
}

.spread-table tbody tr:hover {
  background-color: rgba(30, 41, 59, 0.4);
}

/* Table Cell Formatting */
.asset-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.token-icon {
  font-size: 1.3rem;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-dim);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.token-info {
  display: flex;
  flex-direction: column;
}

.token-symbol {
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.token-cat {
  font-size: 0.65rem;
  font-family: var(--font-mono);
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(139, 92, 246, 0.15);
  color: var(--accent-purple);
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.token-name {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.price-cell {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-main);
}

.rate-cell {
  font-family: var(--font-mono);
}

.rate-main {
  font-weight: 700;
  font-size: 0.88rem;
}

.rate-sub {
  font-size: 0.7rem;
  color: var(--text-dim);
  display: block;
}

.rate-negative {
  color: var(--accent-green); /* Negative funding means Long earns yield! */
}

.rate-positive {
  color: var(--accent-cyan);
}

.strategy-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.strategy-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.strat-green {
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-green);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.strat-gold {
  background: rgba(245, 158, 11, 0.12);
  color: var(--accent-gold);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.signal-pill {
  font-size: 0.65rem;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-muted);
}

.apr-cell {
  font-family: var(--font-mono);
}

.apr-val {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--accent-green);
  text-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.action-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-calc-row {
  background: rgba(0, 242, 254, 0.12);
  border: 1px solid rgba(0, 242, 254, 0.3);
  color: var(--accent-cyan);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.btn-calc-row:hover {
  background: var(--accent-cyan);
  color: #070a12;
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.3);
}

.btn-trade-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.72rem;
  padding: 4px 6px;
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-trade-link:hover {
  color: #fff;
  border-color: var(--accent-blue);
}

.table-footer-legend {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 14px;
  font-size: 0.74rem;
  color: var(--text-dim);
  flex-wrap: wrap;
}

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

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.legend-dot.green { background: var(--accent-green); }
.legend-dot.cyan { background: var(--accent-cyan); }
.legend-dot.gold { background: var(--accent-gold); }

/* Calculator Section */
.calculator-section {
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-lg);
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: var(--shadow-card);
}

.calc-header {
  margin-bottom: 24px;
}

.calc-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.3);
  color: var(--accent-purple);
  font-size: 0.72rem;
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 8px;
}

.calc-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}

.calc-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  max-width: 800px;
}

.calc-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 24px;
}

.calc-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-md);
  padding: 24px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
}

.card-chip {
  font-size: 0.68rem;
  font-family: var(--font-mono);
  color: var(--accent-green);
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 2px 6px;
  border-radius: 4px;
}

.badge-neutral {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent-cyan);
  background: rgba(0, 242, 254, 0.1);
  border: 1px solid rgba(0, 242, 254, 0.3);
  padding: 3px 8px;
  border-radius: 4px;
}

/* Forms */
.form-group {
  margin-bottom: 18px;
}

.form-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.input-currency {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--text-dim);
}

.input-with-addons {
  display: flex;
  align-items: center;
  background: var(--bg-dark);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color 0.2s;
}

.input-with-addons:focus-within {
  border-color: var(--accent-blue);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.25);
}

.input-prefix, .input-suffix {
  padding: 0 12px;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.02);
}

.terminal-input {
  width: 100%;
  background: transparent;
  border: none;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  padding: 10px 12px;
  outline: none;
}

.preset-chips {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.chip-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-dim);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.chip-btn:hover {
  border-color: var(--accent-cyan);
  color: #fff;
}

.chip-btn.active {
  background: rgba(0, 242, 254, 0.12);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  font-weight: 700;
}

.terminal-select {
  width: 100%;
  background: var(--bg-dark);
  border: 1px solid var(--border-dim);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  outline: none;
  cursor: pointer;
}

.terminal-select:focus {
  border-color: var(--accent-blue);
}

.rates-input-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 18px;
}

.rate-field label {
  display: block;
  margin-bottom: 6px;
}

.input-helper {
  display: block;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--accent-green);
  margin-top: 4px;
}

.slider-val {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-cyan);
}

.terminal-slider {
  width: 100%;
  accent-color: var(--accent-cyan);
  cursor: pointer;
}

.slider-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  font-family: var(--font-mono);
  color: var(--text-dim);
  margin-top: 4px;
}

.switch-group {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-sm);
  margin-bottom: 0;
}

.switch-container {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 22px;
  flex-shrink: 0;
}

.switch-container input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #334155;
  transition: .3s;
  border-radius: 20px;
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

.switch-container input:checked + .switch-slider {
  background-color: var(--accent-green);
}

.switch-container input:checked + .switch-slider:before {
  transform: translateX(20px);
}

.switch-title {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
}

.switch-sub {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Outputs Hero */
.hero-yield-box {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(6, 78, 59, 0.2));
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  margin-bottom: 20px;
}

.hero-yield-label {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent-green);
  margin-bottom: 6px;
}

.hero-yield-num {
  font-family: var(--font-mono);
  font-size: 2.8rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
  line-height: 1.1;
  margin-bottom: 10px;
}

.hero-yield-rate {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.badge-apr {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent-green);
  border: 1px solid rgba(16, 185, 129, 0.4);
  padding: 3px 10px;
  border-radius: 20px;
}

.badge-apy {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  background: rgba(0, 242, 254, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 242, 254, 0.35);
  padding: 3px 10px;
  border-radius: 20px;
}

/* Payout Grid */
.payout-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.payout-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.payout-tag {
  font-size: 0.68rem;
  font-family: var(--font-mono);
  color: var(--text-dim);
  display: block;
}

.payout-num {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin: 3px 0;
  display: block;
}

.payout-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
  display: block;
}

/* Diagnostics */
.diagnostics-box {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 20px;
}

.diag-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}

.diag-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

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

.diag-k {
  color: var(--text-dim);
}

.diag-v {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-main);
}

.diag-v.highlight-green {
  color: var(--accent-green);
}

.diag-v.highlight-cyan {
  color: var(--accent-cyan);
}

.calc-cta-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.btn-calc-launch {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  text-align: center;
  transition: all 0.2s;
}

.btn-calc-launch.hl {
  background: rgba(0, 242, 254, 0.12);
  border: 1px solid rgba(0, 242, 254, 0.4);
  color: var(--accent-cyan);
}

.btn-calc-launch.hl:hover {
  background: var(--accent-cyan);
  color: #070a12;
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.3);
}

.btn-calc-launch.bybit {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: var(--accent-gold);
}

.btn-calc-launch.bybit:hover {
  background: var(--accent-gold);
  color: #070a12;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.3);
}

/* Strategy Blueprint Section */
.strategy-blueprint-section {
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-lg);
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: var(--shadow-card);
}

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

.blueprint-pill {
  display: inline-block;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.08em;
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-blue);
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 8px;
}

.blueprint-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.blueprint-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.blueprint-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 36px;
}

.bp-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-md);
  padding: 22px;
  position: relative;
  transition: border-color 0.2s, transform 0.2s;
}

.bp-card:hover {
  border-color: var(--accent-blue);
  transform: translateY(-2px);
}

.bp-step {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--accent-cyan);
  background: rgba(0, 242, 254, 0.1);
  border: 1px solid rgba(0, 242, 254, 0.25);
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  margin-bottom: 12px;
}

.bp-icon {
  font-size: 1.8rem;
  margin-bottom: 12px;
}

.bp-card-h {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: #fff;
}

.bp-card-p {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* FAQ Accordion */
.faq-section {
  border-top: 1px solid var(--border-dim);
  padding-top: 24px;
}

.faq-heading {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: #fff;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color 0.2s;
}

.faq-item[open] {
  border-color: var(--border-glow);
}

.faq-q {
  font-size: 0.88rem;
  font-weight: 600;
  padding: 14px 18px;
  cursor: pointer;
  color: #e2e8f0;
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.faq-q::-webkit-details-marker {
  display: none;
}

.faq-q::after {
  content: "+";
  font-size: 1.1rem;
  color: var(--accent-cyan);
  transition: transform 0.2s;
}

.faq-item[open] .faq-q::after {
  content: "−";
}

.faq-a {
  padding: 0 18px 16px 18px;
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Bottom VIP Partner Card */
.partner-card {
  position: relative;
  background: linear-gradient(135deg, #0e1628, #0a0e1c);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  margin-bottom: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.partner-glow {
  position: absolute;
  bottom: -40px;
  left: 30%;
  width: 400px;
  height: 200px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.15), transparent 70%);
  pointer-events: none;
}

.partner-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  position: relative;
  z-index: 1;
}

.partner-left {
  max-width: 650px;
}

.partner-badges {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.p-badge {
  font-size: 0.68rem;
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
}

.p-badge.hl {
  background: rgba(0, 242, 254, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 242, 254, 0.3);
}

.p-badge.bybit {
  background: rgba(245, 158, 11, 0.12);
  color: var(--accent-gold);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.partner-title {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 8px;
  color: #fff;
}

.partner-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.partner-right {
  flex-shrink: 0;
}

.dual-ref-boxes {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ref-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-dim);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
}

.ref-name {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.ref-code {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.92rem;
  color: #fff;
}

.btn-ref-link {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-gold);
  text-decoration: none;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 4px 10px;
  border-radius: 4px;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-ref-link:hover {
  background: var(--accent-gold);
  color: #070a12;
}

.btn-ref-link.hl {
  color: var(--accent-cyan);
  background: rgba(0, 242, 254, 0.15);
  border-color: rgba(0, 242, 254, 0.3);
}

.btn-ref-link.hl:hover {
  background: var(--accent-cyan);
  color: #070a12;
}

/* Portal Backlink & Legal Disclaimer */
.portal-backlink-wrap {
  text-align: center;
  margin-bottom: 14px;
  font-size: 0.85rem;
}

.portal-backlink {
  color: var(--accent-cyan);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.15s;
}

.portal-backlink:hover {
  color: #fff;
  text-decoration: underline;
}

.portal-sub {
  color: var(--text-dim);
  margin-left: 8px;
  font-size: 0.78rem;
}

.portal-disclaimer {
  max-width: 900px;
  margin: 0 auto;
  font-size: 0.74rem;
  color: var(--text-dim);
  line-height: 1.5;
  text-align: center;
  padding: 14px 20px;
  background: rgba(14, 19, 31, 0.6);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-sm);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  color: var(--accent-cyan);
  border: 1px solid var(--accent-cyan);
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.3);
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  font-weight: 600;
  font-family: var(--font-mono);
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 9999;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
  .affiliate-dual-cards {
    grid-template-columns: 1fr;
  }
  .clocks-grid {
    grid-template-columns: 1fr;
  }
  .calc-grid {
    grid-template-columns: 1fr;
  }
  .metrics-hud {
    grid-template-columns: repeat(2, 1fr);
  }
  .blueprint-cards {
    grid-template-columns: 1fr;
  }
  .partner-content {
    flex-direction: column;
    align-items: flex-start;
  }
  .partner-right {
    width: 100%;
  }
  .dual-ref-boxes {
    width: 100%;
  }
  .ref-row {
    justify-content: space-between;
  }
}

@media (max-width: 640px) {
  .terminal-container {
    padding: 14px 12px 50px 12px;
  }
  .terminal-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .header-right {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }
  .timer-countdown {
    font-size: 2.3rem;
  }
  .cex-clock-card .timer-countdown {
    font-size: 2.1rem;
  }
  .rates-input-grid {
    grid-template-columns: 1fr;
  }
  .payout-grid {
    grid-template-columns: 1fr;
  }
  .calc-cta-row {
    grid-template-columns: 1fr;
  }
  .metrics-hud {
    grid-template-columns: 1fr;
  }
}
