/* ============================================================================
   AURA AETHERION SOVEREIGN v15.0 — LUXURY INSTITUTIONAL COMMAND CENTER
   Features:
   - Refined Obsidian-Slate & Subtle Gold/Cyan/Emerald Top-Edge Accents
   - Bespoke SVG Quantum Crest & High-Contrast Executive Typography
   - 100% Smooth Native Mobile & Desktop Touch Scrolling (Zero Sticky Bloat)
   - Dedicated OHLC Toolbar Above Candlestick Canvas (Zero Overlapping Text)
   ============================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  /* Deep Luxury Obsidian-Slate Palette */
  --bg-base: #080d18;
  --bg-surface: #0f172a;
  --bg-card: #131d31;
  --bg-card-grad: linear-gradient(180deg, #17233b 0%, #111a2c 100%);
  --bg-card-hover: #1b2842;
  --bg-elevated: #1e293b;
  --bg-input: #0a101d;

  /* Refined Architectural Borders */
  --border-subtle: #1f2e47;
  --border-default: #2b3f61;
  --border-highlight: rgba(56, 189, 248, 0.35);

  /* AAA High-Contrast Typography Colors */
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;

  /* Harmonious Institutional Accents */
  --bull: #10b981;
  --bull-bright: #34d399;
  --bull-bg: rgba(16, 185, 129, 0.13);
  --bull-border: rgba(52, 211, 153, 0.32);

  --bear: #f43f5e;
  --bear-bright: #f87171;
  --bear-bg: rgba(248, 113, 113, 0.13);
  --bear-border: rgba(248, 113, 113, 0.32);

  --accent-sky: #38bdf8;
  --accent-sky-bg: rgba(56, 189, 248, 0.13);
  --accent-indigo: #818cf8;
  --accent-indigo-bg: rgba(129, 140, 248, 0.14);
  --accent-amber: #f59e0b;
  --accent-amber-bg: rgba(245, 158, 11, 0.13);
  --accent-gold: #fbbf24;

  /* Compatibility Aliases */
  --neon-emerald: #34d399;
  --neon-crimson: #f87171;
  --neon-cyan: #38bdf8;
  --neon-cyan-dim: #7dd3fc;
  --neon-purple: #818cf8;
  --neon-amber: #fbbf24;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;

  --radius-sm: 7px;
  --radius-md: 11px;
  --radius-lg: 14px;
  --shadow-card: 0 8px 24px rgba(2, 6, 23, 0.55);
}

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

/* Native Mobile Scroll Guarantee */
html {
  font-size: 14px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  background-color: var(--bg-base);
  color: var(--text-primary);
}

body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-primary);
  background-color: var(--bg-base);
  min-height: 100vh;
  overflow-x: clip;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  position: relative;
}

.aura-webgl-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none !important;
  opacity: 0.22;
  transition: opacity 0.3s ease;
}

body.aura-eco-mode .aura-webgl-canvas {
  display: none !important;
}

.terminal-ready {
  display: none;
}

/* Utility Classes */
.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.bull-text { color: var(--bull-bright) !important; }
.bear-text { color: var(--bear-bright) !important; }
.neon-cyan-text { color: var(--accent-sky) !important; }
.purple-text { color: var(--accent-indigo) !important; }
.amber-text { color: var(--accent-gold) !important; }
.neutral-text { color: var(--text-primary) !important; }

@keyframes flashUpSoft {
  0% {
    border-color: rgba(52, 211, 153, 0.75);
    box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.2), 0 0 16px rgba(52, 211, 153, 0.3);
  }
  100% {
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.12), inset 0 0 0 1px rgba(255, 255, 255, 0.04), 0 8px 24px rgba(2, 6, 23, 0.55);
  }
}
@keyframes flashDownSoft {
  0% {
    border-color: rgba(248, 113, 113, 0.75);
    box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.2), 0 0 16px rgba(248, 113, 113, 0.3);
  }
  100% {
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.12), inset 0 0 0 1px rgba(255, 255, 255, 0.04), 0 8px 24px rgba(2, 6, 23, 0.55);
  }
}
.flash-up { animation: flashUpSoft 0.6s ease-out; }
.flash-down { animation: flashDownSoft 0.6s ease-out; }

/* ============================================================================
   1. LUXURY INSTITUTIONAL TOP HEADER (Relative Position — Mobile Friendly)
   ============================================================================ */
.system-bar {
  position: relative;
  z-index: 20;
  background: linear-gradient(180deg, #111a2e 0%, #0b1220 100%);
  border-bottom: 1px solid var(--border-subtle);
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.system-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-crest-wrap {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.18), rgba(129, 140, 248, 0.22));
  border: 1px solid rgba(56, 189, 248, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.15);
}

.brand-crest-svg {
  width: 26px;
  height: 26px;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  background: var(--accent-sky-bg);
  color: var(--accent-sky);
  border: 1px solid rgba(56, 189, 248, 0.28);
  white-space: nowrap;
}

.brand-title {
  font-size: 16.5px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.brand-sub-pill {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent-gold);
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.35);
  padding: 2px 9px;
  border-radius: 999px;
}

.brand-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
  font-weight: 500;
}

/* Unified Executive Ribbon inside Header */
.unified-capital-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.12),
              inset 0 0 0 1px rgba(255, 255, 255, 0.04),
              0 8px 24px rgba(2, 6, 23, 0.55);
  padding: 8px 15px;
  border-radius: var(--radius-md);
  font-size: 12.5px;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.unified-cap-divider {
  color: var(--border-default);
}

.telemetry-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.telemetry-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 6px 11px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-secondary);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--bull-bright);
  display: inline-block;
  flex-shrink: 0;
}

.pulse-purple { background: var(--accent-indigo); }
.pulse-amber { background: var(--accent-gold); }

.btn-aura-fx {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
  padding: 6px 11px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn-aura-fx:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-highlight);
}

.btn-aura-fx.active {
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent-sky);
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.15);
}

.anti-copy-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  background: rgba(245, 158, 11, 0.14);
  color: var(--accent-gold);
  border: 1px solid rgba(251, 191, 36, 0.4);
  cursor: pointer;
  white-space: nowrap;
}

.clock-display {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-input);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

/* ============================================================================
   2. SLIM STICKY WORKSPACE NAVIGATION BAR (48PX — ZERO VIEWPORT BLOCKAGE)
   ============================================================================ */
.aura-quick-nav {
  position: sticky;
  top: 0;
  z-index: 90;
  background: rgba(11, 18, 32, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 8px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.workspace-tabs-group {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  width: 100%;
}

.workspace-tabs-group::-webkit-scrollbar {
  display: none;
}

.quick-nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 15px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.quick-nav-pill:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.quick-nav-pill.active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.18), rgba(129, 140, 248, 0.18));
  color: #ffffff;
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: 0 2px 10px rgba(56, 189, 248, 0.12);
}

/* ============================================================================
   3. MAIN WORKSPACE CONTAINER
   ============================================================================ */
.main-workspace-container {
  position: relative;
  z-index: 10;
  max-width: 1620px;
  margin: 0 auto;
  padding: 18px 22px 44px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.workspace-section {
  display: block;
}

.workspace-section.hidden-by-tab {
  display: none !important;
}

/* ============================================================================
   4. MARKET TICKER STRIP (6 ASSETS)
   ============================================================================ */
.ticker-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}

.ticker-card {
  position: relative;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top: 2px solid rgba(56, 189, 248, 0.45);
  border-radius: var(--radius-md);
  padding: 13px 15px;
  box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.12),
              inset 0 0 0 1px rgba(255, 255, 255, 0.04),
              0 8px 24px rgba(2, 6, 23, 0.55);
  overflow: hidden;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.22s ease,
              border-color 0.22s ease;
}

.ticker-card:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.28);
  box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.2),
              inset 0 0 0 1px rgba(255, 255, 255, 0.06),
              0 12px 28px rgba(2, 6, 23, 0.65),
              0 0 16px rgba(56, 189, 248, 0.1);
}

.ticker-card:active {
  transform: translateY(0);
  box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.1),
              0 4px 12px rgba(2, 6, 23, 0.5);
}

.ticker-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.ticker-symbol {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.ticker-change {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.04);
}

.ticker-price {
  font-family: var(--font-mono);
  font-size: 19px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 4px 0 6px;
}

.ticker-metrics {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-muted);
}

/* ============================================================================
   5. LIVE EXECUTION STREAM BAR
   ============================================================================ */
.matrix-stream-bar {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--accent-sky);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.matrix-stream-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-sky);
  white-space: nowrap;
}

.matrix-live-feed {
  flex: 1;
  font-size: 12.5px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 220px;
}

.matrix-log-item {
  margin-right: 18px;
}

.matrix-stream-right {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ============================================================================
   6. EXECUTIVE KPI CARDS ($200 CAPITAL OVERVIEW WITH TOP ACCENT BARS)
   ============================================================================ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
}

.kpi-card {
  position: relative;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top: 3px solid var(--accent-sky);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.12),
              inset 0 0 0 1px rgba(255, 255, 255, 0.04),
              0 8px 24px rgba(2, 6, 23, 0.55);
  overflow: hidden;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.22s ease,
              border-color 0.22s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.28);
  box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.2),
              inset 0 0 0 1px rgba(255, 255, 255, 0.06),
              0 12px 28px rgba(2, 6, 23, 0.65),
              0 0 16px rgba(56, 189, 248, 0.1);
}

.kpi-card:active {
  transform: translateY(0);
  box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.1),
              0 4px 12px rgba(2, 6, 23, 0.5);
}

#card-kpi-equity,
#card-kpi-realized,
#card-kpi-unrealized,
#card-kpi-winrate {
  border-top-color: var(--bull-bright);
}

#card-kpi-cash {
  border-top-color: var(--accent-indigo);
}

.kpi-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 8px;
  line-height: 1.35;
  letter-spacing: 0.01em;
}

.kpi-value {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.kpi-sub {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.kpi-explain {
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border-subtle);
  padding-top: 8px;
  line-height: 1.45;
}

/* ============================================================================
   7. UNIVERSAL PANEL CONTAINERS & HEADERS
   ============================================================================ */
.panel-container {
  position: relative;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.12),
              inset 0 0 0 1px rgba(255, 255, 255, 0.04),
              0 8px 24px rgba(2, 6, 23, 0.55);
  overflow: hidden;
  transition: box-shadow 0.22s ease, border-color 0.22s ease;
}

.panel-container:hover {
  border-color: rgba(56, 189, 248, 0.2);
  box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.16),
              inset 0 0 0 1px rgba(255, 255, 255, 0.05),
              0 10px 28px rgba(2, 6, 23, 0.6);
}

.panel-header {
  background: rgba(15, 23, 42, 0.85);
  border-bottom: 1px solid var(--border-subtle);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.panel-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.panel-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--bull-bg);
  color: var(--bull-bright);
  border: 1px solid var(--bull-border);
}

/* ============================================================================
   8. PRIMARY CHART & ORDERBOOK GRID (DEDICATED OHLC BAR — ZERO OVERLAY)
   ============================================================================ */
.terminal-main-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 16px;
  align-items: stretch;
}

.ctrl-group {
  display: inline-flex;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 2px;
}

.btn-ctrl {
  background: transparent;
  color: var(--text-secondary);
  border: none;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-ctrl:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.btn-ctrl.active {
  background: var(--accent-sky);
  color: #080d18;
}

.chart-body {
  display: flex;
  flex-direction: column;
  padding: 12px 16px;
  background: var(--bg-input);
}

.chart-overlay-info {
  position: static !important;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 8px 12px;
  margin-bottom: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-secondary);
}

#canvas-candlestick {
  width: 100%;
  height: 360px;
  display: block;
  border-radius: var(--radius-sm);
  background: #070b14;
}

.panel-Port-explain {
  padding: 12px 18px;
  background: rgba(15, 23, 42, 0.7);
  border-top: 1px solid var(--border-subtle);
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

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

.depth-canvas-wrap {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 6px;
}

#canvas-orderbook {
  width: 100%;
  height: 130px;
  display: block;
}

.l2-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 12.5px;
}

.l2-table th {
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: right;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.l2-table td {
  padding: 5px 8px;
  text-align: right;
  position: relative;
}

.l2-row-ask td:first-child { color: var(--bear-bright); font-weight: 600; }
.l2-row-bid td:first-child { color: var(--bull-bright); font-weight: 600; }

.l2-mid-spread-row td {
  text-align: center !important;
  padding: 7px;
  background: var(--bg-surface);
  color: var(--accent-sky);
  font-weight: 700;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.l2-depth-bar {
  position: absolute;
  top: 2px;
  bottom: 2px;
  right: 0;
  opacity: 0.16;
  pointer-events: none;
}

.ask-bar { background: var(--bear); }
.bid-bar { background: var(--bull); }

/* ============================================================================
   9. PAGINATED 40-CORE SERAPHIM AI STUDIO (8 CARDS / PAGE)
   ============================================================================ */
.studio-toolbar {
  padding: 12px 18px;
  background: rgba(15, 23, 42, 0.65);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

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

.studio-page-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-page {
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-page:hover:not(:disabled) {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--accent-sky);
}

.btn-page.active {
  background: var(--accent-sky);
  color: #080d18;
  border-color: var(--accent-sky);
}

.btn-page:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.training-studio-grid {
  padding: 16px 18px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.training-card {
  position: relative;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top: 2px solid rgba(129, 140, 248, 0.45);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.12),
              inset 0 0 0 1px rgba(255, 255, 255, 0.04),
              0 8px 24px rgba(2, 6, 23, 0.55);
  overflow: hidden;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.22s ease,
              border-color 0.22s ease;
}

.training-card:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.28);
  box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.2),
              inset 0 0 0 1px rgba(255, 255, 255, 0.06),
              0 12px 28px rgba(2, 6, 23, 0.65),
              0 0 16px rgba(56, 189, 248, 0.1);
}

.training-card:active {
  transform: translateY(0);
  box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.1),
              0 4px 12px rgba(2, 6, 23, 0.5);
}

.train-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.train-model-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.train-role-vi {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-sky);
  margin-top: 4px;
  line-height: 1.4;
}

.train-arch {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.train-progress-wrap {
  background: var(--bg-input);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.train-progress-top {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.train-progress-bar {
  height: 7px;
  background: #1e293b;
  border-radius: 999px;
  overflow: hidden;
}

.train-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #818cf8, #38bdf8, #10b981);
  border-radius: 999px;
  transition: width 0.35s ease;
}

.train-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.train-metric-box {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.train-metric-label {
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 600;
}

.train-metric-box strong {
  font-family: var(--font-mono);
  font-size: 12px;
}

.train-explain-box {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  border-top: 1px solid var(--border-subtle);
  padding-top: 10px;
}

/* ============================================================================
   10. DATA TABLES & ANTI-COPYTRADE MASK PILLS
   ============================================================================ */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.data-table th {
  background: var(--bg-surface);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 700;
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-default);
  white-space: nowrap;
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.025);
}

.masked-price-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(245, 158, 11, 0.12);
  color: var(--accent-gold);
  border: 1px solid rgba(251, 191, 36, 0.3);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
}

.action-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
}

.action-buy {
  background: var(--bull-bg);
  color: var(--bull-bright);
  border: 1px solid var(--bull-border);
}

.action-sell {
  background: var(--bear-bg);
  color: var(--bear-bright);
  border: 1px solid var(--bear-border);
}

.model-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  background: var(--accent-indigo-bg);
  color: var(--accent-indigo);
  border: 1px solid rgba(129, 140, 248, 0.28);
}

.conf-bar-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12.5px;
}

.conf-bar {
  width: 64px;
  height: 6px;
  background: var(--bg-input);
  border-radius: 999px;
  overflow: hidden;
}

.conf-fill {
  height: 100%;
  background: var(--bull-bright);
}

.rationale-text {
  max-width: 340px;
  line-height: 1.45;
  color: var(--text-secondary);
}

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

.tab-btn {
  background: var(--bg-input);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.tab-btn.active {
  background: var(--accent-sky-bg);
  color: var(--accent-sky);
  border-color: rgba(56, 189, 248, 0.4);
}

.history-banner-bar {
  padding: 10px 16px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ============================================================================
   11. 6-STEP WORKFLOW, RISK GAUGES, 4-TIER FAILOVER & INFRASTRUCTURE
   ============================================================================ */
.pipeline-6-grid {
  padding: 16px 18px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.pipeline-step-card {
  position: relative;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 3px solid var(--accent-sky);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.12),
              inset 0 0 0 1px rgba(255, 255, 255, 0.04),
              0 8px 24px rgba(2, 6, 23, 0.55);
  overflow: hidden;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.22s ease,
              border-color 0.22s ease;
}

.pipeline-step-card:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.28);
  box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.2),
              inset 0 0 0 1px rgba(255, 255, 255, 0.06),
              0 12px 28px rgba(2, 6, 23, 0.65),
              0 0 16px rgba(56, 189, 248, 0.1);
}

.pipeline-step-card:active {
  transform: translateY(0);
  box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.1),
              0 4px 12px rgba(2, 6, 23, 0.5);
}

.step-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
}

.step-num {
  background: var(--accent-sky-bg);
  color: var(--accent-sky);
  padding: 2px 8px;
  border-radius: 4px;
}

.step-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.step-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.risk-grid-section {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.gauge-card {
  position: relative;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.12),
              inset 0 0 0 1px rgba(255, 255, 255, 0.04),
              0 8px 24px rgba(2, 6, 23, 0.55);
  overflow: hidden;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.22s ease,
              border-color 0.22s ease;
}

.gauge-card:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.28);
  box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.2),
              inset 0 0 0 1px rgba(255, 255, 255, 0.06),
              0 12px 28px rgba(2, 6, 23, 0.65),
              0 0 16px rgba(56, 189, 248, 0.1);
}

.gauge-card:active {
  transform: translateY(0);
  box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.1),
              0 4px 12px rgba(2, 6, 23, 0.5);
}

.gauge-svg-wrap {
  position: relative;
  width: 60px;
  height: 60px;
  flex-shrink: 0;
}

.gauge-svg {
  width: 60px;
  height: 60px;
  transform: rotate(-90deg);
}

.gauge-bg-circle {
  fill: none;
  stroke: var(--bg-elevated);
  stroke-width: 6;
}

.gauge-val-circle {
  fill: none;
  stroke: var(--bull-bright);
  stroke-width: 6;
  stroke-linecap: round;
}

.gauge-center-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
}

.gauge-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.gauge-stat {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  margin: 3px 0;
}

.gauge-subtext {
  font-size: 12px;
  color: var(--text-secondary);
}

.failover-4-grid {
  padding: 16px 18px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.failover-card {
  position: relative;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top: 2px solid var(--bull-bright);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.12),
              inset 0 0 0 1px rgba(255, 255, 255, 0.04),
              0 8px 24px rgba(2, 6, 23, 0.55);
  overflow: hidden;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.22s ease,
              border-color 0.22s ease;
}

.failover-card:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.28);
  box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.2),
              inset 0 0 0 1px rgba(255, 255, 255, 0.06),
              0 12px 28px rgba(2, 6, 23, 0.65),
              0 0 16px rgba(56, 189, 248, 0.1);
}

.failover-card:active {
  transform: translateY(0);
  box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.1),
              0 4px 12px rgba(2, 6, 23, 0.5);
}

.failover-tier {
  font-size: 11.5px;
  font-weight: 700;
  margin-bottom: 6px;
}

.failover-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.failover-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.infra-grid-section {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.infra-scroll-box {
  max-height: 280px;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cluster-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
  min-width: 0;
}

.cluster-left {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
}

.cluster-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cluster-sub {
  font-size: 11.5px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cluster-right {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.uptime-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 6px;
  background: rgba(16, 185, 129, 0.10);
  border: 1px solid rgba(16, 185, 129, 0.28);
  color: var(--bull-bright);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  letter-spacing: -0.02em;
  max-width: 165px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.uptime-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--bull-bright);
  box-shadow: 0 0 6px var(--bull-bright);
  flex-shrink: 0;
}

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

.glossary-item {
  position: relative;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.12),
              inset 0 0 0 1px rgba(255, 255, 255, 0.04),
              0 8px 24px rgba(2, 6, 23, 0.55);
  overflow: hidden;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.22s ease,
              border-color 0.22s ease;
}

.glossary-item:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.28);
  box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.2),
              inset 0 0 0 1px rgba(255, 255, 255, 0.06),
              0 12px 28px rgba(2, 6, 23, 0.65),
              0 0 16px rgba(56, 189, 248, 0.1);
}

.glossary-item:active {
  transform: translateY(0);
  box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.1),
              0 4px 12px rgba(2, 6, 23, 0.5);
}

.glossary-q {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.glossary-a {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.55;
}

.terminal-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding: 16px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* ============================================================================
   12. RESPONSIVE BREAKPOINTS (MOBILE & TABLET)
   ============================================================================ */
@media (max-width: 1360px) {
  .kpi-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .training-studio-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .failover-4-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 1080px) {
  .terminal-main-grid {
    grid-template-columns: 1fr;
  }
  .ticker-strip {
    grid-template-columns: repeat(3, 1fr);
  }
  .pipeline-6-grid,
  .infra-grid-section {
    grid-template-columns: 1fr;
  }
  .risk-grid-section {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .main-workspace-container {
    padding: 12px 12px 32px;
    gap: 14px;
  }

  .system-bar {
    padding: 12px;
    gap: 10px;
  }

  .brand-title {
    font-size: 14.5px;
  }

  .brand-subtitle {
    font-size: 11.5px;
  }

  .unified-capital-banner {
    width: 100%;
    padding: 7px 10px;
    font-size: 11.5px;
    gap: 6px;
  }

  .telemetry-strip {
    width: 100%;
    justify-content: space-between;
  }

  .aura-quick-nav {
    padding: 7px 12px;
  }

  .quick-nav-pill {
    padding: 6px 11px;
    font-size: 12.5px;
  }

  .ticker-strip {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .ticker-price {
    font-size: 16.5px;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .kpi-card {
    padding: 13px 14px;
  }

  .kpi-value {
    font-size: 20px;
  }

  .training-studio-grid,
  .failover-4-grid,
  .glossary-grid,
  .risk-grid-section {
    grid-template-columns: 1fr;
  }

  #canvas-candlestick {
    height: 260px;
  }

  .chart-overlay-info {
    font-size: 11.5px;
    gap: 10px;
  }
}

@media (max-width: 480px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================================
   MILESTONE M2: CURSOR-TRACKING RADIAL SPOTLIGHT BORDER GLOW OVERLAY
   ============================================================================ */
.kpi-card::before,
.panel-container::before,
.ticker-card::before,
.training-card::before,
.pipeline-step-card::before,
.gauge-card::before,
.failover-card::before,
.glossary-item::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(350px circle at var(--mouse-x, -999px) var(--mouse-y, -999px), rgba(56, 189, 248, 0.18), transparent 80%);
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.kpi-card:hover::before,
.panel-container:hover::before,
.ticker-card:hover::before,
.training-card:hover::before,
.pipeline-step-card:hover::before,
.gauge-card:hover::before,
.failover-card:hover::before,
.glossary-item:hover::before {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .kpi-card:hover,
  .ticker-card:hover,
  .training-card:hover,
  .pipeline-step-card:hover,
  .gauge-card:hover,
  .failover-card:hover,
  .glossary-item:hover {
    transform: none !important;
  }
}
