/* ============================================
   CSS Variables (Light Theme - Bloomberg Lite)
   ============================================ */
:root {
  /* BACKGROUNDS */
  --fd-bg-primary: #ffffff;
  --fd-bg-secondary: #f8fafc;
  /* Slate-50 */
  --fd-bg-tertiary: #f1f5f9;
  /* Slate-100 */
  --fd-bg-card: #ffffff;
  --fd-bg-hover: #f1f5f9;

  /* TEXT */
  --fd-text-primary: #0f172a;
  /* Slate-900 */
  --fd-text-secondary: #475569;
  /* Slate-600 */
  --fd-text-muted: #64748b;
  /* Slate-400 */

  /* BORDERS */
  --fd-border: #e2e8f0;
  /* Slate-200 */
  --fd-border-accent: #cbd5e1;
  /* Slate-300 */

  /* ACCENTS (Financial) */
  --fd-accent-primary: #2563eb;
  /* Blue-600 */
  --fd-accent-secondary: #4f46e5;
  /* Indigo-600 */

  --fd-green: #16a34a;
  /* Green-600 */
  --fd-green-dim: #dcfce7;
  /* Green-100 */
  --fd-red: #dc2626;
  /* Red-600 */
  --fd-red-dim: #fee2e2;
  /* Red-100 */
  --fd-yellow: #ca8a04;
  /* Yellow-600 */
  --fd-yellow-dim: #fef9c3;
  /* Yellow-100 */

  /* SHADOWS & RADIUS */
  --fd-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --fd-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --fd-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

  /* FONTS */
  --fd-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --fd-font-mono: 'Roboto Mono', 'Monaco', 'Courier New', monospace;

  /* Spacing */
  --fd-radius-sm: 6px;
  --fd-radius-md: 8px;
  --fd-radius-lg: 12px;

  /* Transitions */
  --fd-transition-fast: 0.15s ease;
  --fd-transition-normal: 0.25s ease;
}

/* ============================================
   Base Styles
   ============================================ */
.bpay-flowdesk-hl {
  font-family: var(--fd-font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--fd-text-primary);
  background: var(--fd-bg-primary);
  border-radius: var(--fd-radius-lg);
  overflow: hidden;
  box-shadow: var(--fd-shadow-lg);
  min-height: 600px;
  border: 1px solid var(--fd-border);
  /* Added border definition */
  position: relative;
}

.bpay-flowdesk-hl * {
  box-sizing: border-box;
}

/* ============================================
   Header
   ============================================ */
.flowdesk-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 24px;
  background: var(--fd-bg-primary);
  /* Changed to primary (white) for cleaner look */
  border-bottom: 1px solid var(--fd-border);
}

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

.header-brand h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--fd-text-primary);
  /* Removed gradient text */
}

.brand-tag {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  background: var(--fd-accent-primary);
  color: white;
  border-radius: 4px;
}

.header-symbol-selector {
  display: flex;
  align-items: center;
  gap: 12px;
}

.symbol-select {
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  background: var(--fd-bg-secondary);
  /* Keep light gray bg for inputs */
  color: var(--fd-text-primary);
  border: 1px solid var(--fd-border);
  border-radius: var(--fd-radius-sm);
  cursor: pointer;
  transition: all var(--fd-transition-fast);
}

.symbol-select:hover {
  border-color: var(--fd-border-accent);
  background: var(--fd-bg-tertiary);
}

.symbol-select:focus {
  outline: none;
  border-color: var(--fd-accent-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  /* Adjusted shadow color */
}

.current-price {
  font-size: 18px;
  font-weight: 700;
  font-family: var(--fd-font-mono);
  color: var(--fd-text-primary);
}

.price-change {
  font-size: 13px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
}

.price-change.positive {
  color: var(--fd-green);
  background: var(--fd-green-dim);
}

.price-change.negative {
  color: var(--fd-red);
  background: var(--fd-red-dim);
}

.header-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--fd-text-muted);
  font-size: 12px;
}

/* Info Button */
.info-toggle-btn {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  margin-right: 8px;
  opacity: 0.7;
  transition: opacity 0.2s;
  color: var(--fd-text-secondary);
  /* Ensure it's visible */
}

.info-toggle-btn:hover {
  opacity: 1;
  color: var(--fd-accent-primary);
}

.status-indicator {
  font-size: 8px;
  animation: pulse 2s infinite;
}

.status-indicator.connected {
  color: var(--fd-green);
}

.status-indicator.disconnected {
  color: var(--fd-red);
  animation: none;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

/* ============================================
   Tabs
   ============================================ */
.flowdesk-tabs {
  display: flex;
  gap: 4px;
  padding: 0 24px;
  /* Removed vertical padding */
  background: var(--fd-bg-primary);
  /* White bg */
  border-bottom: 1px solid var(--fd-border);
  overflow-x: auto;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 4px;
  /* Taller touch targets */
  margin-right: 24px;
  /* Spacing between tabs */
  font-size: 13px;
  font-weight: 500;
  color: var(--fd-text-secondary);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  /* Prepare for active border */
  border-radius: 0;
  /* Remove radius */
  cursor: pointer;
  transition: all var(--fd-transition-fast);
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--fd-text-primary);
  background: transparent;
  /* No bg hover */
  border-bottom-color: var(--fd-border-accent);
}

.tab-btn.active {
  color: var(--fd-accent-primary);
  /* Brand blue */
  background: transparent;
  border-bottom-color: var(--fd-accent-primary);
  box-shadow: none;
  /* Removed shadow */
  font-weight: 600;
}

.tab-icon {
  font-size: 16px;
}

/* ============================================
   Content Panels
   ============================================ */
.flowdesk-content {
  padding: 24px;
  /* Increased padding */
  background: var(--fd-bg-secondary);
  /* Light gray background for content area */
  min-height: 450px;
}

.tab-panel {
  display: none;
  animation: fadeIn 0.2s ease;
}

.tab-panel.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

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

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

.panel-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--fd-text-primary);
}

.panel-controls {
  display: flex;
  gap: 10px;
}

.sort-select,
.period-select,
.search-input {
  padding: 6px 12px;
  font-size: 12px;
  background: var(--fd-bg-primary);
  /* White input */
  color: var(--fd-text-primary);
  border: 1px solid var(--fd-border);
  border-radius: var(--fd-radius-sm);
  box-shadow: var(--fd-shadow-sm);
}

.search-input {
  min-width: 200px;
}

/* ============================================
   Data Table (Overview)
   ============================================ */
.data-table {
  width: 100%;
  overflow-x: auto;
  background: var(--fd-bg-card);
  /* White table card */
  border-radius: var(--fd-radius-md);
  border: 1px solid var(--fd-border);
  box-shadow: var(--fd-shadow-sm);
}

.data-table table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  /* Required for sticky headers/cols */
}

.data-table th,
.data-table td {
  padding: 12px 16px;
  /* Comfortable padding */
  text-align: left;
  border-bottom: 1px solid var(--fd-border);
}

.data-table th {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--fd-text-secondary);
  background: var(--fd-bg-secondary);
  /* Gray header */
  white-space: nowrap;
  position: sticky;
  /* Sticky Header */
  top: 0;
  z-index: 10;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: var(--fd-bg-hover);
}

/* Sticky First Column for Mobile */
.data-table .symbol-cell {
  position: sticky;
  left: 0;
  background: var(--fd-bg-card);
  /* Match table bg */
  z-index: 11;
  /* Higher than header? No, header is 10. Cell needs to be higher? */
  border-right: 1px solid var(--fd-border);
}

.data-table th:first-child {
  z-index: 20;
  /* Corner header stays on top */
  left: 0;
}

.data-table tr:hover .symbol-cell {
  background: var(--fd-bg-hover);
}

.data-table .symbol-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  min-width: 120px;
  color: var(--fd-text-primary);
}

.data-table .symbol-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--fd-accent-primary);
  color: white;
  /* Ensure text is visible */
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
}

.data-table .price-cell {
  font-family: var(--fd-font-mono);
  font-weight: 500;
  color: var(--fd-text-primary);
}

.data-table .change-cell {
  font-weight: 600;
}

.data-table .volume-cell {
  font-family: var(--fd-font-mono);
  color: var(--fd-text-secondary);
}

/* Net Vol Styles */
.net-vol {
  font-family: var(--fd-font-mono);
  font-weight: 600;
}

.net-vol.positive {
  color: var(--fd-green);
}

.net-vol.negative {
  color: var(--fd-red);
}


/* FlowScore badge */
.flowscore-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 6px;
}

.flowscore-badge.score-high {
  background: var(--fd-green-dim);
  color: var(--fd-green);
}

.flowscore-badge.score-medium {
  background: var(--fd-yellow-dim);
  color: var(--fd-yellow);
}

.flowscore-badge.score-low {
  background: var(--fd-red-dim);
  color: var(--fd-red);
}

.signal-badge {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 3px 8px;
  border-radius: 4px;
}

.signal-badge.strong_buy {
  background: var(--fd-green);
  color: white;
}

.signal-badge.buy {
  background: var(--fd-green-dim);
  color: var(--fd-green);
}

.signal-badge.neutral {
  background: var(--fd-bg-tertiary);
  color: var(--fd-text-muted);
}

.signal-badge.sell {
  background: var(--fd-red-dim);
  color: var(--fd-red);
}

.signal-badge.strong_sell {
  background: var(--fd-red);
  color: white;
}

/* Buy Pressure Bar */
.pressure-bar {
  width: 80px;
  height: 6px;
  background: var(--fd-red-dim);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.pressure-bar .fill {
  height: 100%;
  background: var(--fd-green);
  border-radius: 3px;
  transition: width var(--fd-transition-normal);
}

/* ============================================
   Tape Feed
   ============================================ */
.panel-stats {
  display: flex;
  gap: 16px;
}

.panel-stats .stat {
  font-size: 12px;
  font-weight: 600;
  color: var(--fd-text-secondary);
}

.panel-stats .stat.buy {
  color: var(--fd-green);
}

.panel-stats .stat.sell {
  color: var(--fd-red);
}

.tape-feed {
  max-height: 400px;
  overflow-y: auto;
}

.tape-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background: var(--fd-bg-card);
  /* White card */
  border: 1px solid var(--fd-border);
  border-radius: var(--fd-radius-sm);
  margin-bottom: 8px;
  animation: slideIn 0.3s ease;
  box-shadow: var(--fd-shadow-sm);
}

@keyframes slideIn {
  from {
    transform: translateX(-10px);
    opacity: 0;
  }

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

.tape-item.buy {
  border-left: 4px solid var(--fd-green);
}

.tape-item.sell {
  border-left: 4px solid var(--fd-red);
}

.tape-item .side-indicator {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 700;
  font-size: 12px;
}

.tape-item.buy .side-indicator {
  background: var(--fd-green-dim);
  color: var(--fd-green);
}

.tape-item.sell .side-indicator {
  background: var(--fd-red-dim);
  color: var(--fd-red);
}

.tape-item .details {
  flex: 1;
}

.tape-item .symbol {
  font-weight: 600;
  margin-right: 8px;
  color: var(--fd-text-primary);
}

.tape-item .price {
  font-family: var(--fd-font-mono);
  color: var(--fd-text-primary);
  /* Dark text for readability */
  font-weight: 500;
}

.tape-item .size {
  font-size: 12px;
  color: var(--fd-text-secondary);
}

.tape-item .notional {
  font-size: 16px;
  font-weight: 700;
  font-family: var(--fd-font-mono);
  color: var(--fd-text-primary);
}

.tape-item .time {
  font-size: 11px;
  color: var(--fd-text-muted);
}

/* ============================================
   Metrics Cards
   ============================================ */
.liquidity-grid,
.funding-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.liquidity-card,
.funding-card {
  background: var(--fd-bg-card);
  border: 1px solid var(--fd-border);
  border-radius: var(--fd-radius-md);
  padding: 20px;
  box-shadow: var(--fd-shadow-sm);
}

.liquidity-card h3,
.funding-card h3 {
  margin: 0 0 16px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--fd-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

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

.metric-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--fd-text-muted);
}

.metric-value {
  font-size: 18px;
  font-weight: 700;
  font-family: var(--fd-font-mono);
  color: var(--fd-text-primary);
}

.metric-value.positive {
  color: var(--fd-green);
}

.metric-value.negative {
  color: var(--fd-red);
}

/* ============================================
   Chart Containers
   ============================================ */
.chart-container {
  min-height: 250px;
  background: var(--fd-bg-card);
  /* White chart bg */
  border: 1px solid var(--fd-border);
  border-radius: var(--fd-radius-md);
  padding: 16px;
  position: relative;
  box-shadow: var(--fd-shadow-sm);
}

.funding-chart-container h3 {
  margin: 0 0 12px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--fd-text-secondary);
}

/* Simple chart bars */
.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 200px;
  padding-top: 20px;
  border-bottom: 1px solid var(--fd-border);
  /* Axis line */
}

.chart-bar {
  flex: 1;
  background: var(--fd-accent-primary);
  opacity: 0.8;
  border-radius: 2px 2px 0 0;
  min-height: 2px;
  transition: all var(--fd-transition-fast);
}

.chart-bar:hover {
  background: var(--fd-accent-secondary);
  opacity: 1;
}

/* ============================================
   Whale Watch
   ============================================ */
.whale-positions {
  margin-bottom: 24px;
}

#whale-chart-container {
  margin: 10px 0 18px;
}

#whale-chart-container .chart-head {
  margin-bottom: 10px;
}

#whale-chart-container .chart-bars {
  height: 160px;
}

.whale-chart-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 11px;
  color: var(--fd-text-secondary);
}

.whale-chart-meta span {
  border: 1px solid #d9e4f4;
  border-radius: 999px;
  padding: 3px 9px;
  background: #ffffff;
}

.whale-net-chart {
  position: relative;
  height: 220px;
  border: 1px solid #d9e4f4;
  border-radius: 10px;
  padding: 8px 10px;
  overflow: hidden;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.whale-net-grid {
  position: absolute;
  top: 8px;
  right: 10px;
  bottom: 8px;
  left: 10px;
  background: repeating-linear-gradient(to top,
      rgba(148, 163, 184, 0.15) 0,
      rgba(148, 163, 184, 0.15) 1px,
      transparent 1px,
      transparent 24px);
  pointer-events: none;
}

.whale-net-axis {
  position: absolute;
  top: 50%;
  right: 10px;
  left: 10px;
  height: 1px;
  background: #94a3b8;
  opacity: 0.8;
  z-index: 2;
}

.whale-net-cols {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: stretch;
  gap: 2px;
  height: 100%;
}

.whale-net-col {
  position: relative;
  flex: 1;
  min-width: 3px;
}

.whale-net-col .vol,
.whale-net-col .net {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.whale-net-col .vol {
  width: 68%;
  min-width: 2px;
  background: rgba(37, 99, 235, 0.22);
  border-radius: 2px 2px 0 0;
  bottom: 50%;
  z-index: 1;
}

.whale-net-col .net {
  width: 82%;
  min-width: 2px;
  border-radius: 2px;
  z-index: 2;
}

.whale-net-col .net.pos {
  background: linear-gradient(180deg, #4ade80 0%, #16a34a 100%);
}

.whale-net-col .net.neg {
  background: linear-gradient(180deg, #f87171 0%, #dc2626 100%);
}

.whale-net-col .net.flat {
  background: #94a3b8;
}

.whale-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--fd-bg-secondary);
  border-radius: var(--fd-radius-md);
  margin-bottom: 12px;
}

.whale-item .whale-icon {
  font-size: 28px;
}

.whale-item .wallet-info {
  flex: 1;
}

.whale-item .wallet-label {
  font-weight: 600;
  margin-bottom: 2px;
}

.whale-item .wallet-address {
  font-size: 11px;
  font-family: var(--fd-font-mono);
  color: var(--fd-text-muted);
  word-break: break-all;
}

.whale-item .position-info {
  text-align: right;
}

.whale-item .position-symbol {
  font-weight: 600;
}

.whale-item .position-side {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.whale-item .position-side.long {
  color: var(--fd-green);
}

.whale-item .position-side.short {
  color: var(--fd-red);
}

.whale-item .position-value {
  font-size: 16px;
  font-weight: 700;
  font-family: var(--fd-font-mono);
}

.whale-item .pnl {
  font-size: 12px;
  font-weight: 600;
}

.whale-item .pnl.positive {
  color: var(--fd-green);
}

.whale-item .pnl.negative {
  color: var(--fd-red);
}

.whale-alerts {
  background: linear-gradient(180deg, #fbfdff 0%, #f7fbff 100%);
  border: 1px solid #dbe7f5;
  border-radius: var(--fd-radius-md);
  padding: 16px;
}

.whale-alerts h3 {
  margin: 0 0 10px 0;
  font-size: 14px;
  font-weight: 700;
}

.alerts-list .no-alerts {
  color: var(--fd-text-muted);
  font-size: 13px;
  text-align: center;
  padding: 20px;
}

/* ============================================
   Overlays (Universal)
   ============================================ */
.news-overlay,
.info-overlay {
  position: absolute;
  /* Changed to absolute to stay within container */
  right: 0;
  top: 0;
  bottom: 0;
  width: 320px;
  /* Slightly narrower */
  background: var(--fd-bg-secondary);
  border-left: 1px solid var(--fd-border);
  box-shadow: -5px 0 20px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  transform: translateX(100%);
  transition: transform var(--fd-transition-normal);
  display: flex;
  flex-direction: column;
}

.news-overlay.visible,
.info-overlay.visible {
  transform: translateX(0);
}

.news-overlay.hidden,
.info-overlay.hidden {
  transform: translateX(100%);
}

.overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--fd-border);
  background: var(--fd-bg-tertiary);
}

.overlay-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

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

.close-btn:hover {
  color: var(--fd-text-primary);
}

.overlay-content {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.info-group {
  margin-bottom: 24px;
  border-bottom: 1px solid var(--fd-border);
  padding-bottom: 12px;
}

.info-group:last-child {
  border-bottom: none;
}

.info-group h4 {
  margin: 0 0 8px 0;
  color: var(--fd-accent-secondary);
  font-size: 14px;
}

.info-group p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--fd-text-secondary);
}

/* Footer layout */
.flowdesk-footer {
  display: flex;
  justify-content: space-between;
  padding: 12px 24px;
  background: var(--fd-bg-secondary);
  border-top: 1px solid var(--fd-border);
}

/* ============================================
   Mobile Responsiveness (Max Width 768px)
   ============================================ */
@media screen and (max-width: 768px) {
  .flowdesk-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .header-brand {
    width: 100%;
    justify-content: space-between;
  }

  .header-symbol-selector {
    width: 100%;
    justify-content: space-between;
  }

  .flowdesk-tabs {
    padding: 0 16px;
  }

  .tab-btn {
    padding: 12px 4px;
    font-size: 12px;
  }

  .flowdesk-content {
    padding: 16px;
  }

  .panel-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .panel-controls {
    width: 100%;
    flex-wrap: wrap;
  }

  .search-input {
    width: 100%;
    min-width: unset;
  }

  /* Sticky Columns on Mobile Tables */
  .data-table th,
  .data-table td {
    padding: 10px 8px;
    /* Compact padding */
    font-size: 12px;
  }

  .data-table .symbol-cell {
    position: sticky;
    left: 0;
    z-index: 15;
    /* Ensure above scrolling content */
    background: var(--fd-bg-card);
    border-right: 1px solid var(--fd-border);
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.05);
    /* Shadow to indicate scroll */
  }

  .data-table th:first-child {
    z-index: 20;
    left: 0;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.05);
  }

  /* Hide non-critical columns on very small screens if needed, 
     but horizontal scroll is handled by overflow-x */

  .liquidity-grid,
  .funding-grid,
  .metric-grid {
    grid-template-columns: 1fr;
    /* Stack cards */
  }

  /* Footer */
  .flowdesk-footer {
    flex-direction: column;
    gap: 10px;
    align-items: center;
  }

  /* Force hide any residual footer text if it exists */
  .flowdesk-footer span:not(.footer-spacer):not(.news-toggle-btn) {
    display: none;
  }
}
/* ============================================
   v1.2.0 Product UI Extensions
   ============================================ */
.timeframe-select {
  padding: 6px 12px;
  font-size: 12px;
  background: var(--fd-bg-primary);
  color: var(--fd-text-primary);
  border: 1px solid var(--fd-border);
  border-radius: var(--fd-radius-sm);
  box-shadow: var(--fd-shadow-sm);
}

.panel-controls {
  align-items: center;
  flex-wrap: wrap;
}

.panel-controls select,
.panel-controls input {
  min-height: 34px;
}

.whale-controls #whale-min-notional:disabled {
  opacity: 0.72;
  cursor: not-allowed;
  background: #eef2f7;
}

.insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.insight-card {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid #dde7f5;
  border-radius: var(--fd-radius-md);
  padding: 12px 14px;
  box-shadow: var(--fd-shadow-sm);
}

.insight-card h3 {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--fd-text-muted);
}

.insight-card .insight-value {
  margin: 6px 0 4px;
  font-size: 19px;
  line-height: 1.2;
  font-family: var(--fd-font-mono);
  font-weight: 700;
  color: var(--fd-text-primary);
}

.insight-card .insight-value.positive {
  color: var(--fd-green);
}

.insight-card .insight-value.negative {
  color: var(--fd-red);
}

.insight-card .insight-sub {
  margin: 0;
  font-size: 12px;
  color: var(--fd-text-secondary);
}

.symbol-summary-panel {
  background: linear-gradient(155deg, #f8fbff 0%, #f3f7ff 55%, #f8faff 100%);
  border: 1px solid #d8e3f2;
  border-radius: var(--fd-radius-md);
  margin-bottom: 14px;
  padding: 14px;
  box-shadow: var(--fd-shadow-sm);
}

.summary-headline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.summary-headline h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--fd-text-primary);
}

.summary-headline p {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--fd-text-secondary);
}

.summary-signal {
  display: flex;
  align-items: center;
  gap: 8px;
}

.timeframe-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.summary-item {
  padding: 8px 10px;
  border: 1px solid #d9e4f4;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.8);
}

.summary-item label {
  display: block;
  margin-bottom: 3px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--fd-text-muted);
  font-weight: 700;
}

.summary-item span {
  font-size: 15px;
  font-weight: 700;
  font-family: var(--fd-font-mono);
  color: var(--fd-text-primary);
}

.summary-item small {
  display: block;
  margin-top: 4px;
  font-size: 11px;
}

.summary-item .positive,
.summary-item small.positive {
  color: var(--fd-green);
}

.summary-item .negative,
.summary-item small.negative {
  color: var(--fd-red);
}

.model-signal-block {
  margin-top: 12px;
  border: 1px solid #d9e4f4;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  padding: 10px;
}

.model-signal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.model-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--fd-text-muted);
  font-weight: 700;
}

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

.model-action,
.model-confidence,
.model-risk {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
}

.model-action.long {
  background: var(--fd-green-dim);
  color: var(--fd-green);
}

.model-action.short {
  background: var(--fd-red-dim);
  color: var(--fd-red);
}

.model-action.no_trade {
  background: #e2e8f0;
  color: var(--fd-text-secondary);
}

.model-confidence {
  background: #dbeafe;
  color: #1d4ed8;
}

.model-risk.low {
  background: #dcfce7;
  color: #15803d;
}

.model-risk.medium {
  background: #fef3c7;
  color: #b45309;
}

.model-risk.high {
  background: #fee2e2;
  color: #b91c1c;
}

.model-signal-meta {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
}

.model-name {
  font-weight: 700;
  color: var(--fd-text-primary);
}

.model-reason {
  color: var(--fd-text-secondary);
  text-transform: capitalize;
}

.model-signal-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
}

.model-signal-grid-context .summary-item span {
  font-size: 13px;
}

.signal-mini-history {
  margin-top: 10px;
  border: 1px solid #d9e4f4;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  padding: 8px;
}

.signal-mini-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 11px;
  color: var(--fd-text-secondary);
}

.signal-mini-head span:first-child {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--fd-text-muted);
}

.signal-mini-chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 54px;
}

.signal-mini-bar {
  flex: 1;
  min-width: 3px;
  border-radius: 3px 3px 0 0;
  opacity: 0.9;
}

.signal-mini-bar.long {
  background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
}

.signal-mini-bar.short {
  background: linear-gradient(180deg, #f87171 0%, #dc2626 100%);
}

.mini-progress {
  margin-top: 6px;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.mini-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #16a34a 0%, #22c55e 100%);
}

.data-table .whale-col {
  text-align: center;
  font-weight: 700;
}

.tape-bar {
  margin-top: 6px;
  height: 4px;
  border-radius: 99px;
  background: #e2e8f0;
  overflow: hidden;
}

.tape-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1d4ed8 0%, #3b82f6 100%);
}

.chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.chart-head h3 {
  margin: 0;
  font-size: 14px;
  color: var(--fd-text-secondary);
}

.chart-note {
  font-size: 11px;
  color: var(--fd-text-muted);
}

.section-title {
  margin: 8px 0 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--fd-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.auto-whale-list {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.auto-whale-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--fd-border);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}

.auto-whale-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.auto-whale-main .symbol {
  font-weight: 700;
  color: var(--fd-text-primary);
}

.auto-whale-main .signal {
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 8px;
  background: #e2e8f0;
  color: var(--fd-text-secondary);
}

.auto-whale-main .signal.positive {
  background: var(--fd-green-dim);
  color: var(--fd-green);
}

.auto-whale-main .signal.negative {
  background: var(--fd-red-dim);
  color: var(--fd-red);
}

.auto-whale-main .price {
  font-size: 12px;
  font-family: var(--fd-font-mono);
  color: var(--fd-text-secondary);
  white-space: normal;
  word-break: break-word;
}

.auto-whale-meta {
  text-align: right;
  white-space: nowrap;
}

.auto-whale-meta .notional {
  display: block;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--fd-font-mono);
  color: var(--fd-text-primary);
}

.auto-whale-meta .time {
  font-size: 11px;
  color: var(--fd-text-muted);
}

.auto-whale-meta .time.positive {
  color: var(--fd-green);
}

.auto-whale-meta .time.negative {
  color: var(--fd-red);
}

.wallet-addr-block {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  max-width: 100%;
  vertical-align: middle;
}

.wallet-addr-text {
  font-size: 11px;
  color: var(--fd-text-secondary);
  font-family: var(--fd-font-mono);
  line-height: 1.3;
}

.wallet-addr-text.full {
  word-break: break-all;
}

.copy-wallet-btn,
.wallet-explorer-link {
  border: 1px solid #d0dbe9;
  background: #f8fbff;
  color: #1d4ed8;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.copy-wallet-btn:hover,
.wallet-explorer-link:hover {
  border-color: #93c5fd;
  background: #eff6ff;
}

.alerts-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.alerts-chip {
  border: 1px solid #d7e2f2;
  border-radius: 999px;
  padding: 3px 9px;
  background: #fff;
  font-size: 11px;
  font-weight: 700;
  color: var(--fd-text-secondary);
}

.alerts-chip.long {
  border-color: #bbf7d0;
  color: #15803d;
  background: #f0fdf4;
}

.alerts-chip.short {
  border-color: #fecaca;
  color: #b91c1c;
  background: #fef2f2;
}

.alerts-chip.warn {
  border-color: #fde68a;
  color: #a16207;
  background: #fffbeb;
}

.alerts-chip.danger {
  border-color: #fecaca;
  color: #b91c1c;
  background: #fef2f2;
}

.alerts-chip.adapt {
  border-color: #bfdbfe;
  color: #1d4ed8;
  background: #eff6ff;
}

.alert-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid var(--fd-border);
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff;
  margin-bottom: 8px;
}

.alert-item.long {
  border-left: 3px solid #16a34a;
}

.alert-item.short {
  border-left: 3px solid #dc2626;
}

.alert-item.high {
  border-color: #fecaca;
  background: #fff7f7;
}

.alert-item.medium {
  border-color: #fde68a;
  background: #fffcf5;
}

.alert-item.low {
  border-color: #dbeafe;
  background: #f8fbff;
}

.alert-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e2e8f0;
  color: #334155;
  font-size: 11px;
  font-weight: 700;
  margin-top: 1px;
}

.alert-item.long .alert-icon {
  background: #dcfce7;
  color: #15803d;
}

.alert-item.short .alert-icon {
  background: #fee2e2;
  color: #b91c1c;
}

.alert-main {
  flex: 1;
  min-width: 0;
}

.alert-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.alert-symbol {
  font-size: 12px;
  font-weight: 800;
  color: var(--fd-text-primary);
}

.alert-side {
  font-size: 10px;
  font-weight: 800;
  border-radius: 999px;
  padding: 1px 7px;
  letter-spacing: 0.3px;
}

.alert-side.long {
  background: #dcfce7;
  color: #15803d;
}

.alert-side.short {
  background: #fee2e2;
  color: #b91c1c;
}

.alert-notional {
  font-size: 12px;
  font-weight: 700;
  color: var(--fd-text-primary);
  font-family: var(--fd-font-mono);
}

.alert-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.alert-source {
  font-size: 10px;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 7px;
  text-transform: uppercase;
  letter-spacing: 0.35px;
}

.alert-source.source-auto {
  background: #eef2ff;
  color: #3730a3;
}

.alert-source.source-wallet {
  background: #e0f2fe;
  color: #075985;
}

.alert-wallet {
  min-width: 0;
}

.alert-wallet .wallet-addr-block {
  gap: 4px;
}

.alert-wallet .wallet-addr-text {
  font-size: 10px;
}

.alert-wallet .copy-wallet-btn {
  padding: 1px 6px;
  font-size: 9px;
}

.alert-time {
  font-size: 11px;
  color: var(--fd-text-muted);
  white-space: nowrap;
  margin-left: 6px;
}

.whale-item .whale-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  background: #dbeafe;
  color: #1d4ed8;
}

.no-data {
  text-align: center;
  color: var(--fd-text-muted);
  font-size: 13px;
  padding: 16px;
}

.loading-spinner {
  color: var(--fd-text-muted);
  font-size: 13px;
  padding: 14px;
}

.flowdesk-seo-content {
  max-width: 1200px;
  margin: 22px auto 0;
  padding: 18px;
  border: 1px solid var(--fd-border);
  border-radius: var(--fd-radius-lg);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: var(--fd-shadow-sm);
}

.flowdesk-seo-content .seo-header h2 {
  margin: 0 0 8px;
  font-size: 26px;
  line-height: 1.25;
  color: var(--fd-text-primary);
}

.flowdesk-seo-content .seo-header p {
  margin: 0 0 14px;
  color: var(--fd-text-secondary);
  font-size: 15px;
  line-height: 1.6;
}

.flowdesk-seo-content .flowdesk-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.flowdesk-seo-content .seo-card {
  border: 1px solid var(--fd-border);
  border-radius: var(--fd-radius-md);
  padding: 12px;
  background: #fff;
}

.flowdesk-seo-content .seo-card h3 {
  margin: 0 0 6px;
  font-size: 14px;
  color: #1e40af;
}

.flowdesk-seo-content .seo-card p {
  margin: 0;
  font-size: 13px;
  color: var(--fd-text-secondary);
  line-height: 1.5;
}

.flowdesk-seo-content details {
  margin-top: 8px;
  border: 1px solid var(--fd-border);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
}

.flowdesk-seo-content summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--fd-text-primary);
}

.flowdesk-seo-content details ul,
.flowdesk-seo-content details p {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--fd-text-secondary);
}

@media screen and (max-width: 980px) {
  .panel-controls {
    gap: 8px;
  }

  .panel-controls select,
  .panel-controls input {
    flex: 1 1 150px;
  }

  .summary-headline {
    flex-direction: column;
  }

  .summary-signal {
    width: 100%;
    justify-content: flex-start;
  }
}

@media screen and (max-width: 768px) {
  .insights-grid {
    grid-template-columns: 1fr;
  }

  .summary-grid {
    grid-template-columns: 1fr 1fr;
  }

  .auto-whale-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .auto-whale-meta {
    text-align: left;
  }

  .whale-net-chart {
    height: 190px;
  }

  .whale-chart-meta {
    gap: 6px;
  }

  .wallet-addr-text {
    font-size: 10px;
  }

  .alert-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .alert-time {
    margin-left: 0;
  }

  .flowdesk-seo-content {
    margin-top: 14px;
    padding: 14px;
  }

  .flowdesk-seo-content .seo-header h2 {
    font-size: 21px;
  }
}

@media screen and (max-width: 520px) {
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .panel-controls select,
  .panel-controls input {
    flex: 1 1 100%;
  }
}
