/* ==========================================================================
   RISKOS — HIGH-FREQUENCY TRADING & MARKET MICROSTRUCTURE TERMINAL (hft.css)
   Institutional Bloomberg/Optiver dark glassmorphism, LetterGlitch background,
   microsecond telemetry typography, and high-performance canvas styling.
   ========================================================================== */

:root {
  --hft-bg: #030712;
  --hft-surface: #0b1329;
  --hft-surface-card: rgba(15, 23, 42, 0.82);
  --hft-border: rgba(56, 189, 248, 0.18);
  --hft-border-glow: rgba(56, 189, 248, 0.45);
  --hft-cyan: #22d3ee;
  --hft-emerald: #10b981;
  --hft-amber: #f59e0b;
  --hft-crimson: #ef4444;
  --hft-purple: #a855f7;
  --hft-text-bright: #f8fafc;
  --hft-text-muted: #94a3b8;
  --hft-font-mono: 'JetBrains Mono', 'Fira Code', 'Roboto Mono', monospace;
  --hft-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Page Layout */
body.hft-page {
  background-color: var(--hft-bg);
  color: var(--hft-text-bright);
  font-family: var(--hft-font-sans);
  min-height: 100vh;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  position: relative;
}

/* ── React Bits LetterGlitch Matrix Background ────────────────────────────── */
.hft-letter-glitch-wrap {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  opacity: 0.28;
  overflow: hidden;
  background: var(--hft-bg);
}

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

.hft-outer-vignette {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(3, 7, 18, 0) 45%, rgba(3, 7, 18, 0.95) 100%);
}

.hft-center-vignette {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(3, 7, 18, 0.82) 0%, rgba(3, 7, 18, 0) 65%);
}

/* ── Institutional Sticky Header Architecture ────────────────────────────── */
header.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(3, 7, 18, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(56, 189, 248, 0.16);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
  padding: 8px 0;
}

/* Main Container */
.hft-main-container {
  position: relative;
  z-index: 1;
  max-width: 1720px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

/* ── Top Telemetry & Universal Ticker Search Strip ───────────────────────── */
.hft-telemetry-banner {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.92) 0%, rgba(11, 19, 41, 0.96) 100%);
  border: 1px solid var(--hft-border);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(34, 211, 238, 0.06);
  backdrop-filter: blur(14px);
}

.hft-banner-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* Universal Ticker Input Group */
.hft-ticker-search-group {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(3, 7, 18, 0.85);
  border: 1px solid var(--hft-border-glow);
  padding: 4px 8px;
  border-radius: 8px;
}

.hft-ticker-input {
  background: transparent;
  border: none;
  color: #fff;
  font-family: var(--hft-font-mono);
  font-weight: 700;
  font-size: 0.88rem;
  width: 140px;
  outline: none;
  text-transform: uppercase;
}

.hft-ticker-input::placeholder {
  color: #64748b;
  font-size: 0.78rem;
}

.hft-quote-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(3, 7, 18, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 7px 14px;
  border-radius: 20px;
  font-family: var(--hft-font-mono);
  font-size: 0.82rem;
}

.hft-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--hft-emerald);
  box-shadow: 0 0 8px var(--hft-emerald);
  animation: hftPulse 1.8s infinite;
}

@keyframes hftPulse {
  0% { transform: scale(0.9); opacity: 0.8; box-shadow: 0 0 4px var(--hft-emerald); }
  50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 12px var(--hft-emerald); }
  100% { transform: scale(0.9); opacity: 0.8; box-shadow: 0 0 4px var(--hft-emerald); }
}

.hft-speedometer-group {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.hft-stat-badge {
  display: flex;
  flex-direction: column;
  background: rgba(3, 7, 18, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 6px 12px;
  border-radius: 6px;
  min-width: 90px;
}

.hft-stat-label {
  font-size: 0.65rem;
  color: var(--hft-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hft-stat-val {
  font-family: var(--hft-font-mono);
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
}

.hft-btn {
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid var(--hft-cyan);
  color: var(--hft-cyan);
  font-family: var(--hft-font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.hft-btn:hover {
  background: rgba(34, 211, 238, 0.22);
  box-shadow: 0 0 14px rgba(34, 211, 238, 0.35);
  transform: translateY(-1px);
}

.hft-btn.btn-emerald {
  border-color: var(--hft-emerald);
  color: var(--hft-emerald);
  background: rgba(16, 185, 129, 0.1);
}
.hft-btn.btn-emerald:hover {
  background: rgba(16, 185, 129, 0.22);
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.35);
}

/* ── 4-Module Workstation Grid ────────────────────────────────────────────── */
.hft-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 32px;
}

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

/* Card Container */
.hft-card {
  background: var(--hft-surface-card);
  border: 1px solid var(--hft-border);
  border-radius: 12px;
  padding: 22px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  gap: 16px;
  backdrop-filter: blur(14px);
  position: relative;
  overflow: hidden;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.hft-card:hover {
  border-color: var(--hft-border-glow);
  box-shadow: 0 14px 45px rgba(0, 0, 0, 0.65), 0 0 25px rgba(34, 211, 238, 0.1);
}

/* Card Header */
.hft-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 12px;
}

.hft-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.96rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
}

.hft-card-tag {
  font-family: var(--hft-font-mono);
  font-size: 0.65rem;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(34, 211, 238, 0.12);
  color: var(--hft-cyan);
  border: 1px solid rgba(34, 211, 238, 0.25);
  text-transform: uppercase;
}

/* ── KaTeX Mathematical Formula Box & Pro Mode Collapsible Drawer ──────── */
.katex-mathml {
  position: absolute !important;
  clip: rect(1px, 1px, 1px, 1px) !important;
  padding: 0 !important;
  border: 0 !important;
  height: 1px !important;
  width: 1px !important;
  overflow: hidden !important;
  user-select: none !important;
  -webkit-user-select: none !important;
}

.hft-math-box {
  background: rgba(3, 7, 18, 0.75);
  border: 1px solid rgba(56, 189, 248, 0.16);
  border-left: 3px solid var(--hft-cyan);
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 8px;
  transition: all 0.2s ease;
}

.hft-math-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--hft-cyan);
  letter-spacing: 0.05em;
  user-select: none;
}

.hft-math-toggle-btn {
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: var(--hft-cyan);
  font-family: var(--hft-font-mono);
  font-size: 0.62rem;
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.hft-math-toggle-btn:hover {
  background: rgba(56, 189, 248, 0.25);
  color: #fff;
  border-color: #22d3ee;
}

.hft-formula-render {
  overflow-x: auto;
  padding: 4px 0;
  color: #f1f5f9;
  text-align: center;
  font-size: 0.92rem;
}

/* By default, in Pro HFT Desk mode, hide the verbose layman essays to eliminate AI slop */
body.hft-page:not(.hft-theory-mode) .hft-layman-box {
  display: none;
}

/* In Theory mode or when card is specifically expanded, show the intuition */
body.hft-theory-mode .hft-layman-box,
.hft-math-box.is-open .hft-layman-box {
  display: block;
  animation: fadeInHft 0.2s ease-in;
}

.hft-layman-box {
  background: rgba(15, 23, 42, 0.65);
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
  padding: 8px 10px;
  margin-top: 6px;
  font-size: 0.74rem;
  line-height: 1.45;
  color: #cbd5e1;
  border-radius: 4px;
}

.hft-layman-box strong {
  color: #fbbf24;
}

@keyframes fadeInHft {
  from { opacity: 0; transform: translateY(-3px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Pro Mode Switcher in Jump Bar */
.hft-mode-switcher {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
}

.hft-mode-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  font-family: var(--hft-font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.hft-mode-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.hft-mode-btn.active {
  background: rgba(34, 211, 238, 0.18);
  border-color: #22d3ee;
  color: #22d3ee;
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.35);
}

/* ── Realistic Institutional L3 Order Book DOM Ladder ────────────────────── */
.hft-l3-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  background: #020617;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 12px;
  position: relative;
}

@media (max-width: 900px) {
  .hft-l3-container {
    grid-template-columns: 1fr;
  }
}

/* DOM Ladder Table */
.hft-dom-ladder {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: var(--hft-font-mono);
  font-size: 0.73rem;
  max-height: 330px;
  overflow-y: auto;
}

.hft-dom-row {
  display: grid;
  grid-template-columns: 65px 70px 1fr 70px 65px;
  align-items: center;
  padding: 3px 6px;
  border-radius: 3px;
  background: rgba(15, 23, 42, 0.4);
  position: relative;
  overflow: hidden;
}

.hft-dom-row:hover {
  background: rgba(30, 41, 59, 0.8);
}

.hft-dom-row.is-bbo {
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.3);
}

.hft-dom-depth-bar-bid {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: rgba(16, 185, 129, 0.18);
  pointer-events: none;
  z-index: 0;
  transition: width 0.15s ease;
}

.hft-dom-depth-bar-ask {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  background: rgba(239, 68, 68, 0.18);
  pointer-events: none;
  z-index: 0;
  transition: width 0.15s ease;
}

.hft-dom-cell {
  position: relative;
  z-index: 1;
}

/* Realistic Bookmap Microstructure Waterfall Canvas */
.hft-canvas-wrap {
  position: relative;
  width: 100%;
  height: 330px;
  background: #020617;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  overflow: hidden;
}

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

.hft-canvas-hud {
  position: absolute;
  top: 8px;
  right: 10px;
  display: flex;
  gap: 8px;
  pointer-events: none;
  z-index: 5;
}

.hft-iceberg-alert {
  background: rgba(239, 68, 68, 0.92);
  color: #fff;
  font-family: var(--hft-font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.6);
  animation: hftFlash 0.8s infinite alternate;
  display: none;
}

@keyframes hftFlash {
  from { opacity: 0.6; }
  to { opacity: 1; }
}

/* ── Module 2: Avellaneda-Stoikov Sliders & PnL ────────────────────────────── */
.hft-slider-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hft-slider-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.hft-slider-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.76rem;
  color: var(--hft-text-muted);
}

.hft-slider-val {
  font-family: var(--hft-font-mono);
  font-weight: 700;
  color: #fff;
}

.hft-range {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #1e293b;
  outline: none;
}

.hft-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--hft-cyan);
  cursor: pointer;
  box-shadow: 0 0 8px var(--hft-cyan);
}

.hft-pnl-breakdown {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  background: rgba(3, 7, 18, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 12px;
}

/* ── Module 3: OFI & VPIN Toxicity Radar ──────────────────────────────────── */
.hft-radar-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.hft-meter-box {
  background: rgba(3, 7, 18, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}

.hft-meter-val {
  font-family: var(--hft-font-mono);
  font-size: 1.4rem;
  font-weight: 800;
}

.hft-vpin-bar {
  width: 100%;
  height: 10px;
  background: #1e293b;
  border-radius: 5px;
  overflow: hidden;
  position: relative;
}

.hft-vpin-fill {
  height: 100%;
  width: 25%;
  background: linear-gradient(90deg, #10b981 0%, #f59e0b 60%, #ef4444 100%);
  transition: width 0.3s ease;
}

/* ── Module 4: Queue Position & RAW FIX 4.4 Stream ────────────────────────── */
.hft-queue-card {
  background: rgba(3, 7, 18, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hft-fix-terminal {
  background: #020617;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  height: 180px;
  overflow-y: auto;
  padding: 10px;
  font-family: var(--hft-font-mono);
  font-size: 0.72rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fix-line {
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.4;
}

.fix-tag-35-d { color: #38bdf8; } /* New Order */
.fix-tag-35-8 { color: #10b981; } /* Execution Report */
.fix-tag-35-g { color: #f59e0b; } /* Cancel/Replace */
/* ── 1-Click DOM Quick Order Bar ─────────────────────────────────────────── */
.hft-dom-quick-order-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 8px;
  padding: 8px 12px;
  margin-top: 10px;
}

.hft-select-compact {
  background: rgba(2, 6, 23, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  border-radius: 6px;
  padding: 4px 8px;
  font-family: var(--hft-font-mono);
  font-size: 0.72rem;
  cursor: pointer;
}

.hft-btn-dom {
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--hft-font-mono);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.hft-btn-dom-buy {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid #10b981;
  color: #10b981;
}

.hft-btn-dom-buy:hover {
  background: #10b981;
  color: #000;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.5);
}

.hft-btn-dom-sell {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid #ef4444;
  color: #ef4444;
}

.hft-btn-dom-sell:hover {
  background: #ef4444;
  color: #fff;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.5);
}

.hft-btn-dom-cancel {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid #f59e0b;
  color: #fbbf24;
}

.hft-btn-dom-cancel:hover {
  background: #f59e0b;
  color: #000;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.5);
}

.hft-btn-dom-flatten {
  background: rgba(148, 163, 184, 0.15);
  border: 1px solid #64748b;
  color: #cbd5e1;
}

.hft-btn-dom-flatten:hover {
  background: #64748b;
  color: #fff;
  box-shadow: 0 0 12px rgba(148, 163, 184, 0.5);
}

/* ── Module 5: Time & Sales Tape & CVD Absorption ────────────────────────── */
.hft-cvd-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.hft-cvd-stat-box {
  background: rgba(3, 7, 18, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hft-cvd-label {
  font-size: 0.65rem;
  color: var(--hft-text-muted);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.hft-cvd-val {
  font-family: var(--hft-font-mono);
  font-size: 1.05rem;
  font-weight: 800;
}

.hft-tape-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.hft-filter-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--hft-text-muted);
  font-size: 0.72rem;
  font-family: var(--hft-font-mono);
  padding: 3px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.hft-filter-btn.active, .hft-filter-btn:hover {
  background: rgba(34, 211, 238, 0.15);
  border-color: var(--hft-cyan);
  color: var(--hft-cyan);
}

.hft-tape-table-wrap {
  background: #020617;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  max-height: 240px;
  overflow-y: auto;
}

.hft-tape-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--hft-font-mono);
  font-size: 0.72rem;
  text-align: left;
}

.hft-tape-table th {
  position: sticky;
  top: 0;
  background: #0b1329;
  color: var(--hft-text-muted);
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  z-index: 2;
}

.hft-tape-table td {
  padding: 6px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  white-space: nowrap;
}

.hft-tape-table tr.tape-row-new {
  animation: tapeHighlight 0.6s ease-out;
}

@keyframes tapeHighlight {
  0% { background: rgba(34, 211, 238, 0.3); }
  100% { background: transparent; }
}

/* ── Module 6: Latency Arbitrage & Co-Location ───────────────────────────── */
.hft-route-strip {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
  background: rgba(3, 7, 18, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 12px 16px;
}

.hft-latency-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.hft-latency-card {
  background: rgba(11, 19, 41, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hft-latency-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
}

.hft-latency-badge {
  font-size: 0.62rem;
  font-weight: 700;
  font-family: var(--hft-font-mono);
  padding: 2px 6px;
  border-radius: 4px;
}

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

.hft-latency-desc {
  font-size: 0.7rem;
  color: var(--hft-text-muted);
  line-height: 1.35;
}

.hft-latency-meter {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 4px;
}

.hft-latency-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}

.hft-latency-race-log {
  background: #020617;
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-radius: 8px;
  padding: 12px 16px;
  font-family: var(--hft-font-mono);
  font-size: 0.75rem;
  line-height: 1.6;
  color: #f8fafc;
}

/* ── Module 7: Algorithmic Execution Slicer (TWAP/VWAP/POV) ──────────────── */
.hft-slicer-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.hft-slicer-progress-wrap {
  background: rgba(3, 7, 18, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.hft-progress-bar-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.hft-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #10b981);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.hft-slice-table-wrap {
  background: #020617;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  max-height: 220px;
  overflow-y: auto;
}

/* ── Workstation Jump Navigator Bar ──────────────────────────────────────── */
.hft-jump-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(3, 7, 18, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  backdrop-filter: blur(12px);
  margin-bottom: 20px;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: thin;
}

.hft-jump-label {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--hft-text-muted);
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 4px;
  flex-shrink: 0;
}

.hft-jump-link {
  font-family: var(--hft-font-mono);
  font-size: 0.7rem;
  color: #94a3b8;
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.hft-jump-link:hover {
  color: var(--hft-cyan);
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.3);
}

.hft-jump-link.highlight {
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.08);
  font-weight: 700;
}

/* Scroll margin so sticky header does not obscure section titles */
.hft-card {
  scroll-margin-top: 85px;
}

/* ── Workstation 8: WebAssembly / C++ Matching Engine Core ───────────────── */
.hft-wasm-telemetry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.hft-wasm-stat-card {
  background: rgba(3, 7, 18, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hft-badge-wasm {
  background: rgba(56, 189, 248, 0.15);
  color: var(--hft-cyan);
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-family: var(--hft-font-mono);
  font-weight: 700;
  display: inline-block;
}

.hft-wasm-bench-controls {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.hft-wasm-order-form {
  background: rgba(3, 7, 18, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.hft-wasm-depth-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

.hft-wasm-book-col {
  background: #020617;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px 12px;
}

/* ── Workstation 9: Cross-Exchange Basis & Funding Rate Radar ─────────────── */
.hft-basis-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.hft-basis-venue-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--hft-font-mono);
  font-size: 0.75rem;
}

.hft-basis-venue-table th {
  padding: 8px 10px;
  text-align: left;
  background: rgba(255, 255, 255, 0.04);
  color: var(--hft-text-muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.hft-basis-venue-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.hft-sim-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 16px;
  margin-top: 14px;
}

/* ── Workstation 10: Hawkes Process & Flash Crash Radar ──────────────────── */
.hft-hawkes-telemetry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.hft-hawkes-controls {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

/* ── Workstation 11: Order Flow Footprint Chart ──────────────────────────── */
.hft-footprint-toolbar {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.hft-footprint-btn-group {
  display: inline-flex;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.hft-fp-btn {
  background: rgba(3, 7, 18, 0.8);
  border: none;
  color: #94a3b8;
  font-family: var(--hft-font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 5px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.hft-fp-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.hft-fp-btn.active {
  background: var(--hft-cyan);
  color: #000;
  font-weight: 800;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .hft-telemetry-banner {
    flex-direction: column;
    align-items: flex-start;
  }
  .hft-radar-grid {
    grid-template-columns: 1fr;
  }
  .hft-pnl-breakdown {
    grid-template-columns: 1fr;
  }
  .hft-wasm-depth-layout {
    grid-template-columns: 1fr;
  }
  .hft-sim-grid {
    grid-template-columns: 1fr;
  }
}
