/* ── Design System v2 — Trading Terminal ──────────────────────────── */
/* Color philosophy: Green/Red/Orange = TREND only (regime, score, move, COT, RR).
   Cyan #38bdf8 / Magenta #c084fc = VOL state (CHEAP/RICH, IV gauge, CVOL chg).
   Gold #f1c40f = WARNING (WASDE, staleness, priority). Gray #6c757d = NEUTRAL. */
:root {
  /* Base surfaces */
  --bg-base: #0a0a0f;
  --bg-panel: rgba(255,255,255,0.04);
  --bg-card: rgba(255,255,255,0.06);
  --bg-hover: rgba(255,255,255,0.09);
  --bg-glass: rgba(255,255,255,0.03);
  --bg-input: rgba(255,255,255,0.08);
  --border-subtle: rgba(255,255,255,0.08);
  --border-medium: rgba(255,255,255,0.12);
  --border-accent: rgba(255,255,255,0.18);
  --border-hover: rgba(255,255,255,0.15);

  /* Semantic colors */
  --c-bull: #00bc8c;
  --c-bear: #e74c3c;
  --c-warn: #f39c12;
  --c-info: #3498db;
  --c-muted: #6c757d;
  --c-purple: #8e44ad;
  --c-gold: #f1c40f;
  --c-accent: #38bdf8;       /* Cyan — primary UI accent */
  --c-accent-dim: rgba(56,189,248,0.12);
  --c-accent-glow: rgba(56,189,248,0.25);

  /* Legacy aliases (used by Python code referencing old names) */
  --clr-success: #00bc8c;
  --clr-danger: #e74c3c;
  --clr-warning: #f39c12;
  --clr-info: #3498db;
  --clr-muted: #6c757d;
  --clr-purple: #8e44ad;
  --bg-page: #0a0a0f;

  /* Text */
  --c-text: #e0e0e0;
  --c-text-dim: #8a8a8a;
  --text-primary: rgba(255,255,255,0.92);
  --text-secondary: rgba(255,255,255,0.6);
  --text-muted: rgba(255,255,255,0.4);
  --text-dim: rgba(255,255,255,0.25);

  /* Commodity accents */
  --c-zs: #2ecc71;
  --c-zc: #e67e22;
  --c-zw: #f1c40f;

  /* Typography */
  --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
  --fs-display: 1.3rem;
  --fs-title: 1.0rem;
  --fs-body: 0.85rem;
  --fs-small: 0.75rem;
  --fs-micro: 0.65rem;
  --fs-floor: 0.6rem;

  /* Spacing */
  --sp-xs: 4px;
  --sp-sm: 8px;
  --sp-md: 16px;
  --sp-lg: 24px;
  --sp-xl: 32px;
  /* Legacy aliases */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;

  /* Radii */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --radius-xl: 16px;

  /* Shadows */
  --shadow-panel: 0 2px 8px rgba(0,0,0,0.25);
  --shadow-card: 0 1px 4px rgba(0,0,0,0.2);
  --shadow-glass: 0 4px 30px rgba(0,0,0,0.3);
  --shadow-glow: 0 0 20px rgba(46,204,113,0.15);

  /* Sidebar */
  --sidebar-collapsed: 64px;
  --sidebar-expanded: 220px;
  --topbar-height: 48px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-med: 250ms ease;
}

/* ── Global Reset ─────────────────────────────────────────────────── */
body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--c-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Glassmorphism Panels ─────────────────────────────────────────── */
.glass-panel {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-glass);
  padding: var(--sp-md);
  transition: border-color var(--transition-med), box-shadow var(--transition-med);
}

.glass-panel:hover {
  border-color: var(--border-hover);
}

/* ── Utility Classes ──────────────────────────────────────────────── */
.soy-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-panel);
  padding: var(--sp-3);
  margin-bottom: var(--sp-2);
}

.soy-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: var(--sp-2) var(--sp-3);
}

.soy-section-title {
  font-size: var(--fs-title);
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: var(--sp-2);
  padding-bottom: var(--sp-1);
  border-bottom: 1px solid var(--border-subtle);
}

/* ── Sidebar ──────────────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-collapsed);
  background:
    linear-gradient(to bottom, rgba(10,10,15,0.82) 0%, rgba(10,10,15,0.65) 40%, rgba(10,10,15,0.75) 100%),
    url('/assets/sidebar-bg.png') center / cover no-repeat;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-right: 1px solid var(--border-subtle);
  z-index: 1200;
  overflow: hidden;
  transition: width var(--transition-med);
  display: flex;
  flex-direction: column;
}

.sidebar:hover {
  width: var(--sidebar-expanded);
}

.sidebar-logo {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  padding: 0 var(--sp-md);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-logo-icon {
  font-size: 1.4rem;
  min-width: 32px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-logo-text {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--c-accent);
  margin-left: var(--sp-sm);
  opacity: 0;
  transition: opacity var(--transition-med);
  white-space: nowrap;
}

.sidebar:hover .sidebar-logo-text {
  opacity: 1;
}

.sidebar-nav {
  flex: 1;
  padding: var(--sp-sm) 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  padding: 10px var(--sp-md);
  color: var(--text-secondary);
  text-decoration: none;
  transition: background var(--transition-fast), color var(--transition-fast);
  position: relative;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
}

.sidebar-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  text-decoration: none;
}

.sidebar-item.active {
  color: var(--c-accent);
  background: var(--c-accent-dim);
}

.sidebar-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 3px;
  background: var(--c-accent);
  border-radius: 0 2px 2px 0;
}

/* Nav icons (SVG images replacing emojis) */
.nav-icon {
  width: 20px;
  height: 20px;
  min-width: 20px;
  margin: 0 6px;
  opacity: 0.7;
  transition: opacity var(--transition-med), filter var(--transition-med);
  flex-shrink: 0;
}

.sidebar-item:hover .nav-icon {
  opacity: 1;
  filter: drop-shadow(0 0 4px var(--c-accent-glow));
}

.sidebar-item.active .nav-icon {
  opacity: 1;
  filter: drop-shadow(0 0 6px var(--c-accent-glow)) brightness(1.1);
}

.sidebar-item-label {
  font-size: var(--fs-body);
  font-weight: 500;
  margin-left: var(--sp-sm);
  opacity: 0;
  transition: opacity var(--transition-med);
}

/* Desktop: show full labels on hover, hide short labels */
.sidebar-label-short {
  display: none;
}

.sidebar:hover .sidebar-item-label {
  opacity: 1;
}

.sidebar-footer {
  padding: var(--sp-sm) var(--sp-md);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-footer-icon {
  font-size: 1.1rem;
  min-width: 32px;
  text-align: center;
  flex-shrink: 0;
  opacity: 0.5;
}

.sidebar-footer-text {
  font-size: var(--fs-micro);
  color: var(--text-muted);
  margin-left: var(--sp-sm);
  opacity: 0;
  transition: opacity var(--transition-med);
}

.sidebar:hover .sidebar-footer-text {
  opacity: 1;
}

/* ── Main Content Area ────────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-collapsed);
  width: calc(100% - var(--sidebar-collapsed));
  max-width: calc(100vw - var(--sidebar-collapsed));
  min-height: 100vh;
  overflow-x: hidden;
  box-sizing: border-box;
  transition: margin-left var(--transition-med);
}

/* ── Page Banner (static, same image, flush to top) ──────────────── */
.page-banner {
  position: relative;
  height: 220px;
  overflow: visible;
  margin: 0;
  flex-shrink: 0;
}

.page-banner-img {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 60%;
  display: block;
}

.page-banner-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(
    to bottom,
    rgba(10, 10, 15, 0.05) 0%,
    rgba(10, 10, 15, 0.25) 35%,
    rgba(10, 10, 15, 0.7) 70%,
    rgba(10, 10, 15, 0.95) 100%
  );
  pointer-events: none;
}

.page-banner-content {
  position: absolute;
  bottom: 14px;
  left: 24px;
  right: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 1;
}

.banner-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: white;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.6);
}

.banner-pills {
  display: flex;
  gap: 6px;
}

/* Keep topbar classes for backward compat but hide */
.topbar {
  display: none;
}

.topbar-title {
  font-size: var(--fs-title);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.topbar-center {
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
}

/* Product pills in topbar */
.product-pill {
  padding: 4px 14px;
  border-radius: 20px;
  border: 1px solid var(--border-medium);
  background: transparent;
  color: var(--text-secondary);
  font-size: var(--fs-small);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  letter-spacing: 0.5px;
}

.product-pill:hover {
  border-color: var(--border-accent);
  color: var(--text-primary);
  background: var(--bg-hover);
}

.product-pill.active {
  border-color: var(--c-accent);
  background: var(--c-accent-dim);
  color: var(--c-accent);
  font-weight: 700;
}

/* Data freshness dots */
.data-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.data-dot.fresh { background: var(--c-bull); }
.data-dot.stale { background: var(--c-warn); }
.data-dot.offline { background: var(--c-bear); }

/* ── Bento Grid ───────────────────────────────────────────────────── */
.bento-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-md);
  margin-bottom: var(--sp-md);
}

.bento-full {
  grid-column: 1 / -1;
}

.bento-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--sp-md);
  transition: border-color var(--transition-med);
}

.bento-panel:hover {
  border-color: var(--border-hover);
}

.bento-panel-title {
  font-size: var(--fs-small);
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: var(--sp-sm);
}

/* ── Chart Quadrant Grid ──────────────────────────────────────────── */
.chart-quadrant {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: var(--sp-md);
}

.quadrant-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--sp-md);
  min-height: 380px;
}

.quadrant-panel-title {
  font-size: var(--fs-small);
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: var(--sp-xs);
}

.quadrant-tabs {
  display: flex;
  gap: var(--sp-xs);
  margin-bottom: var(--sp-sm);
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: var(--sp-xs);
}

.quadrant-tab {
  font-size: var(--fs-micro);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
  background: none;
}

.quadrant-tab:hover {
  color: var(--text-secondary);
  background: var(--bg-hover);
}

.quadrant-tab.active {
  color: var(--c-accent);
  background: var(--c-accent-dim);
}

/* ── Metric Strip ─────────────────────────────────────────────────── */
.metric-strip {
  display: flex;
  gap: var(--sp-sm);
  overflow-x: auto;
  padding: var(--sp-sm) 0;
  margin-bottom: var(--sp-md);
  scrollbar-width: none;
}

.metric-strip::-webkit-scrollbar {
  display: none;
}

.metric-strip-item {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--sp-sm) var(--sp-md);
  text-align: center;
  min-width: 100px;
  flex-shrink: 0;
  transition: border-color var(--transition-fast);
}

.metric-strip-item:hover {
  border-color: var(--border-hover);
}

.metric-strip-value {
  font-size: 1.1rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--c-info);
}

.metric-strip-label {
  font-size: var(--fs-micro);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

/* ── Insight Text ─────────────────────────────────────────────────── */
.insight-text {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.78);
  line-height: 1.65;
  padding: 0;
  background: none;
  border: none;
}

.insight-label {
  font-size: var(--fs-micro);
  font-weight: 700;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 2px;
}

/* ── Header 3-Column Layout ──────────────────────────────────────── */
.header-3col {
  min-height: 60px;
  padding-top: 4px;
}

.header-3col-cell {
  padding: 6px 18px 8px;
  position: relative;
}

/* First column flush left */
.header-3col > .col-lg-4:first-child {
  padding-left: 4px;
}

/* Vertical separator — gradient fade for elegance */
.header-3col > .col-lg-4:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 12px;
  bottom: 8px;
  right: 0;
  width: 1px;
  background: linear-gradient(
    to bottom,
    rgba(255,255,255,0.0) 0%,
    rgba(255,255,255,0.10) 25%,
    rgba(255,255,255,0.10) 75%,
    rgba(255,255,255,0.0) 100%
  );
}

/* Section micro-label with subtle underline */
.header-section-label {
  font-size: 0.6rem;
  font-weight: 700;
  color: rgba(255,255,255,0.38);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 8px;
  padding-bottom: 5px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.header-metric-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  line-height: 1.5;
}

/* Metric label styling */
.header-metric-label {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.4);
  min-width: 52px;
  flex-shrink: 0;
}

/* Metric value styling */
.header-metric-value {
  font-weight: 600;
  font-size: 0.8rem;
}

@media (max-width: 768px) {
  .header-3col > .col-lg-4:not(:last-child)::after {
    display: none;
  }
  .header-3col > .col-lg-4 {
    padding: 10px 4px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
  }
  .header-3col > .col-lg-4:first-child {
    padding-left: 4px;
  }
  .header-3col > .col-lg-4:last-child {
    border-bottom: none;
  }
}

/* ── Chart Subtitle ───────────────────────────────────────────────── */
.chart-subtitle {
  font-size: var(--fs-micro);
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: var(--sp-sm);
  padding-left: var(--sp-xs);
}

/* ── Strategy Cards ───────────────────────────────────────────────── */
.strategy-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--sp-md);
  margin-bottom: var(--sp-md);
}

.strategy-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--sp-md);
  cursor: pointer;
  transition: all var(--transition-med);
}

.strategy-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.strategy-card.selected {
  border-color: var(--c-accent);
  background: rgba(56, 189, 248, 0.06);
}

.strategy-card-name {
  font-size: var(--fs-body);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--sp-xs);
}

.strategy-card-metric {
  font-size: var(--fs-small);
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

/* ── Detail Panel ─────────────────────────────────────────────────── */
.detail-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--sp-lg);
  margin-top: var(--sp-md);
}

.detail-panel-tabs {
  display: flex;
  gap: var(--sp-sm);
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: var(--sp-sm);
  margin-bottom: var(--sp-md);
}

.detail-panel-tab {
  font-size: var(--fs-small);
  padding: 6px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
  background: none;
  font-weight: 500;
}

.detail-panel-tab:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.detail-panel-tab.active {
  color: var(--c-accent);
  background: var(--c-accent-dim);
  font-weight: 600;
}

/* ── Skeleton Loader ──────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg,
    var(--bg-panel) 25%,
    rgba(255,255,255,0.06) 50%,
    var(--bg-panel) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton-pulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-line {
  height: 14px;
  margin-bottom: 8px;
  border-radius: var(--radius-sm);
}

.skeleton-line.short { width: 60%; }
.skeleton-line.medium { width: 80%; }
.skeleton-line.full { width: 100%; }

/* ── Smooth tab transitions ──────────────────────────────────────── */
.nav-tabs .nav-link {
  transition: color 0.2s ease, border-color 0.2s ease;
}

/* Trade card hover */
.trade-card-item:hover {
  border-color: rgba(255,255,255,0.2) !important;
  background-color: var(--bg-hover) !important;
}

/* ── Page load fade-in ───────────────────────────────────────────── */
#page-content {
  animation: fadeIn 0.3s ease 0.15s both;
  padding: var(--sp-md);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Prevent visible content flicker ──────────────────────────────── */
#header-container,
#layer-tabs-container,
#trade-cards-container,
#detail-container,
#spread-page-content,
#option-lab-content {
  transition: opacity 0.15s ease;
  min-height: 20px;
}

/* ── Screenshot buttons ───────────────────────────────────────────── */
button[id*="screenshot-btn"] {
  opacity: 0.25 !important;
  transition: opacity 0.2s ease !important;
}
button[id*="screenshot-btn"]:hover {
  opacity: 0.85 !important;
  border-color: rgba(255,255,255,0.3) !important;
  color: rgba(255,255,255,0.8) !important;
}

/* ── Commodity selector (merged from option_lab.css) ──────────────── */
.commo-selector {
  display: flex !important;
  gap: 8px;
}
.commo-selector input[type="radio"] {
  display: none;
}
.commo-selector label {
  padding: 6px 16px;
  border-radius: 8px;
  border: 1px solid var(--border-medium);
  background-color: var(--bg-glass);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}
.commo-selector label:hover {
  border-color: rgba(56, 189, 248, 0.4);
  color: rgba(255,255,255,0.85);
}
.commo-selector input[type="radio"]:checked + label {
  border-color: var(--c-accent) !important;
  background-color: var(--c-accent-dim) !important;
  color: var(--c-accent) !important;
  font-weight: 700 !important;
}
/* Dash 4.0 renders <input> inside <label>, so also target via :has() */
.commo-selector label:has(input[type="radio"]:checked) {
  border-color: var(--c-accent) !important;
  background-color: var(--c-accent-dim) !important;
  color: var(--c-accent) !important;
  font-weight: 700 !important;
}

/* ── Hero Section ────────────────────────────────────────────────── */
.hero-section {
  position: relative;
  height: 160px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: var(--sp-md);
}

.hero-section img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 60%;
  display: block;
}

.hero-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(
    to bottom,
    rgba(10, 10, 15, 0.3) 0%,
    rgba(10, 10, 15, 0.6) 60%,
    rgba(10, 10, 15, 0.95) 100%
  );
  pointer-events: none;
}

.hero-content {
  position: absolute;
  bottom: var(--sp-md);
  left: var(--sp-lg);
  z-index: 1;
}

.hero-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: white;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.hero-subtitle {
  font-size: var(--fs-small);
  color: rgba(255,255,255,0.5);
  letter-spacing: 1px;
  margin-top: 2px;
}

/* Hero particle overlay — subtle radial gradients */
.hero-particles {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 20% 80%, rgba(56,189,248,0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(139,92,246,0.06) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(46,204,113,0.04) 0%, transparent 40%);
  animation: particles-float 20s ease-in-out infinite;
}

@keyframes particles-float {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.02); }
}

/* ── Badge Styling ───────────────────────────────────────────────── */
.badge-regime {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.badge-regime svg,
.badge-regime img {
  width: 10px;
  height: 10px;
}

.badge-regime-bullish {
  background: rgba(0,188,140,0.12);
  color: var(--c-bull);
  border: 1px solid rgba(0,188,140,0.2);
}

.badge-regime-bearish {
  background: rgba(231,76,60,0.12);
  color: var(--c-bear);
  border: 1px solid rgba(231,76,60,0.2);
}

.badge-regime-neutral {
  background: rgba(108,117,125,0.12);
  color: var(--c-muted);
  border: 1px solid rgba(108,117,125,0.2);
}

.badge-regime-vol {
  background: rgba(56,189,248,0.12);
  color: var(--c-accent);
  border: 1px solid rgba(56,189,248,0.2);
}

/* ── Two-Zone Layout (Spread Shop) ────────────────────────────────── */
.two-zone {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: var(--sp-md);
}

.two-zone-full {
  grid-column: 1 / -1;
}

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 1200px) {
  .bento-grid { grid-template-columns: 1fr; }
  .chart-quadrant { grid-template-columns: 1fr; }
  .two-zone { grid-template-columns: 1fr; }
  .strategy-card-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
}

@media (max-width: 768px) {
  /* ── Mobile: sidebar becomes bottom tab bar ── */
  .sidebar {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100% !important;
    height: 60px;
    flex-direction: row;
    border-right: none;
    border-top: 1px solid var(--border-subtle);
    z-index: 1200;
    overflow: visible;
    background:
      linear-gradient(to top, rgba(10,10,15,0.95) 0%, rgba(10,10,15,0.88) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
  .sidebar:hover {
    width: 100% !important;
  }

  /* Hide logo & footer on mobile */
  .sidebar-logo,
  .sidebar-footer {
    display: none;
  }

  /* Nav becomes horizontal row */
  .sidebar-nav {
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    width: 100%;
    padding: 0;
    gap: 0;
  }

  /* Each nav item: vertical icon + short label */
  .sidebar-item {
    flex-direction: column;
    padding: 6px 4px;
    gap: 2px;
    flex: 1;
    justify-content: center;
    align-items: center;
    overflow: visible;
    white-space: nowrap;
  }

  .sidebar-item.active::before {
    /* Move accent bar to top instead of left */
    left: 20%;
    right: 20%;
    top: 0;
    bottom: auto;
    width: auto;
    height: 2px;
    border-radius: 0 0 2px 2px;
  }

  /* Mobile: show short labels, hide full labels */
  .sidebar-label-full {
    display: none !important;
  }
  .sidebar-label-short {
    display: inline !important;
  }
  .sidebar-item-label {
    opacity: 1 !important;
    font-size: 0.55rem;
    margin-left: 0;
    text-align: center;
    letter-spacing: 0.3px;
  }

  .nav-icon {
    width: 18px;
    height: 18px;
    min-width: 18px;
    margin: 0;
  }

  /* Main content: no left margin, bottom padding for tab bar */
  .main-content {
    margin-left: 0;
    width: 100%;
    max-width: 100vw;
    padding-bottom: 68px;
  }

  .topbar {
    padding: 0 var(--sp-sm);
  }
  .metric-strip {
    gap: var(--sp-xs);
  }
  .metric-strip-item {
    min-width: 80px;
    padding: var(--sp-xs) var(--sp-sm);
  }
}

/* ── Nexus Rotator — 3D Commodity Selector (inside banner) ────────── */
.nexus-container {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  align-items: flex-end;
  width: 700px;
  height: 100%;
  perspective: 800px;
  z-index: 2;
  pointer-events: none;
}

.nexus-track {
  position: relative;
  width: 200px;
  height: 100%;
  transform-style: preserve-3d;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.nexus-card {
  position: absolute;
  bottom: 4px;
  left: 50%;
  margin-left: -100px;
  width: 200px;
  height: 140px;
  border-radius: 14px;
  background: transparent;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  cursor: pointer;
  user-select: none;
  pointer-events: auto;
  overflow: hidden;
  transition:
    transform 500ms cubic-bezier(0.4, 0, 0.2, 1),
    opacity 400ms ease;
}

/* Card image — fills the card, cover to avoid gaps */
.nexus-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
}

/* Price strip inside card bottom */
.nexus-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 8px;
  background: linear-gradient(to top, rgba(5,5,10,0.92) 40%, rgba(5,5,10,0.5) 80%, transparent 100%);
  pointer-events: none;
  z-index: 1;
}

/* ── Positions ── */
.nexus-active {
  transform: translateZ(40px) scale(1.08);
  opacity: 1;
  z-index: 3;
}

.nexus-left {
  transform: translateX(-200px) rotateY(28deg) scale(0.78);
  opacity: 0.5;
  z-index: 1;
}

.nexus-right {
  transform: translateX(200px) rotateY(-28deg) scale(0.78);
  opacity: 0.5;
  z-index: 1;
}

/* Hover on inactive cards */
.nexus-left:hover {
  opacity: 0.75;
  transform: translateX(-200px) rotateY(28deg) scale(0.83);
}
.nexus-right:hover {
  opacity: 0.75;
  transform: translateX(200px) rotateY(-28deg) scale(0.83);
}

/* ── Card text elements ── */
.nexus-name {
  display: none; /* name already baked into card images */
}

.nexus-price {
  font-size: 0.8rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--card-accent, var(--c-accent));
  text-shadow: 0 1px 6px rgba(0,0,0,0.9);
}

.nexus-change {
  font-size: var(--fs-floor);
  font-weight: 600;
  font-family: var(--font-mono);
}

/* ── Per-commodity accent colors ── */
.nexus-card[data-commodity="ZS"] {
  --card-accent: var(--c-zs);
}
.nexus-card[data-commodity="ZC"] {
  --card-accent: var(--c-zc);
}
.nexus-card[data-commodity="ZW"] {
  --card-accent: var(--c-zw);
}

/* ── Chart Expand Button ─────────────────────────────────────────── */
.expand-chart-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 4px;
  color: rgba(255,255,255,0.2);
  font-size: 0.7rem;
  padding: 2px 5px;
  cursor: pointer;
  position: absolute;
  top: 4px;
  right: 32px;  /* offset from screenshot button at right:4px */
  z-index: 10;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.chart-card-wrapper:hover .expand-chart-btn {
  opacity: 0.5;
}

.expand-chart-btn:hover {
  opacity: 1 !important;
  border-color: rgba(255,255,255,0.3);
  color: rgba(255,255,255,0.8);
  background: rgba(255,255,255,0.05);
}

/* ── Chart Expand Modal ──────────────────────────────────────────── */
.chart-expand-modal .modal-content {
  background-color: #0c0c14;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-lg);
}

.chart-expand-modal .modal-dialog {
  max-width: 95vw;
}

.chart-expand-modal-header {
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding: 10px 16px;
}

.chart-expand-modal-header .modal-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: rgba(255,255,255,0.85);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.chart-expand-modal-header .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
  opacity: 0.5;
}

.chart-expand-modal-header .btn-close:hover {
  opacity: 1;
}

.chart-expand-modal-body {
  padding: 8px;
  background: #0c0c14;
}

.chart-expand-modal-body .js-plotly-plot {
  width: 100% !important;
}

/* ── Global dark dropdown styling — Dash 4.x ────────────────────── */
/* Target by specific component IDs + class for Spread Shop dropdowns */
#screener-sort-dropdown .dash-dropdown-trigger,
#screener-product-filter .dash-dropdown-trigger {
  background-color: #1e1e2e !important;
  border: 1px solid rgba(255,255,255,0.10) !important;
  border-radius: 4px !important;
}
#screener-sort-dropdown .dash-dropdown-value,
#screener-sort-dropdown .dash-dropdown-value-item,
#screener-product-filter .dash-dropdown-value,
#screener-product-filter .dash-dropdown-value-item {
  color: rgba(255,255,255,0.85) !important;
}
#screener-sort-dropdown .dash-dropdown-content,
#screener-product-filter .dash-dropdown-content {
  background-color: #1e1e2e !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
}
#screener-sort-dropdown .dash-dropdown-option,
#screener-product-filter .dash-dropdown-option {
  background-color: #1e1e2e !important;
  color: rgba(255,255,255,0.8) !important;
}
#screener-sort-dropdown .dash-dropdown-option:hover,
#screener-product-filter .dash-dropdown-option:hover {
  background-color: rgba(255,255,255,0.10) !important;
}
/* Structure Pricer dropdown — dark theme (Dash 4.x React Select) */
#b76-structure-selector .Select-control,
#b76-structure-selector .dash-dropdown-trigger {
  background-color: #1e1e2e !important;
  border: 1px solid rgba(255,255,255,0.10) !important;
  border-radius: 4px !important;
  color: rgba(255,255,255,0.85) !important;
}
#b76-structure-selector .Select-value-label,
#b76-structure-selector .Select-placeholder,
#b76-structure-selector .Select-input > input,
#b76-structure-selector .dash-dropdown-value,
#b76-structure-selector .dash-dropdown-value-item {
  color: rgba(255,255,255,0.85) !important;
}
#b76-structure-selector .Select-arrow-zone .Select-arrow {
  border-top-color: rgba(255,255,255,0.5) !important;
}
#b76-structure-selector .Select-menu-outer,
#b76-structure-selector .dash-dropdown-content {
  background-color: #1e1e2e !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
}
#b76-structure-selector .Select-menu {
  background-color: #1e1e2e !important;
}
#b76-structure-selector .VirtualizedSelectOption,
#b76-structure-selector .Select-option,
#b76-structure-selector .dash-dropdown-option {
  background-color: #1e1e2e !important;
  color: rgba(255,255,255,0.8) !important;
}
#b76-structure-selector .VirtualizedSelectOption:hover,
#b76-structure-selector .Select-option:hover,
#b76-structure-selector .Select-option.is-focused,
#b76-structure-selector .dash-dropdown-option:hover {
  background-color: rgba(255,255,255,0.10) !important;
}
#b76-structure-selector .VirtualizedSelectOption.is-disabled,
#b76-structure-selector .Select-option.is-disabled,
#b76-structure-selector .dash-dropdown-option[aria-disabled="true"] {
  color: rgba(255,255,255,0.3) !important;
  font-size: 0.7rem;
  letter-spacing: 1px;
}
#b76-structure-selector .Select-clear-zone {
  color: rgba(255,255,255,0.4) !important;
}
/* Also cover Bootstrap/dbc selects */
.form-select, select.form-control {
  background-color: #1e1e2e !important;
  border-color: rgba(255,255,255,0.10) !important;
  color: rgba(255,255,255,0.85) !important;
}

/* ── World Clocks (Banner) ────────────────────────────────────────── */
.banner-clocks {
  position: absolute;
  top: 14px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  z-index: 2;
}
.banner-clock-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}
.banner-clock-time {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255,255,255,0.88);
  letter-spacing: 1.5px;
  text-shadow: 0 1px 6px rgba(0,0,0,0.5);
}
.banner-clock-city {
  font-family: var(--font-mono);
  font-size: 0.54rem;
  font-weight: 500;
  color: rgba(255,255,255,0.35);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.banner-clock-sep {
  width: 1px;
  height: 26px;
  background: rgba(255,255,255,0.1);
}
@media (max-width: 768px) {
  .banner-clocks { display: none; }
}

/* ══════════════════════════════════════════════════════════════════════════
   TRADING OFFICE (VTO) — Immersive 3-Agent Trading Floor
   ══════════════════════════════════════════════════════════════════════════ */

.vto-root {
  padding: 0 4px;
  --vto-analyst: #3498db;
  --vto-trader: #00bc8c;
  --vto-manager: #f39c12;
}

/* ── Animations ─────────────────────────────────────────────────────────── */

@keyframes vto-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.3); }
}

@keyframes vto-bounce {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-4px); }
}

@keyframes vto-card-enter {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes vto-slide-in {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes vto-flow {
  0% { transform: translateX(-8px); opacity: 0; }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { transform: translateX(48px); opacity: 0; }
}

@keyframes vto-flash-approve {
  0% { background: radial-gradient(circle at 50% 50%, rgba(0,188,140,0.08) 0%, transparent 70%); }
  100% { background: transparent; }
}
@keyframes vto-flash-reject {
  0% { background: radial-gradient(circle at 50% 50%, rgba(231,76,60,0.08) 0%, transparent 70%); }
  100% { background: transparent; }
}
@keyframes vto-flash-modify {
  0% { background: radial-gradient(circle at 50% 50%, rgba(243,156,18,0.08) 0%, transparent 70%); }
  100% { background: transparent; }
}

/* ── Decision Flash Overlay ─────────────────────────────────────────────── */

.vto-decision-flash {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
}
.vto-decision-flash.vto-flash-approve { animation: vto-flash-approve 1s ease-out; }
.vto-decision-flash.vto-flash-reject { animation: vto-flash-reject 1s ease-out; }
.vto-decision-flash.vto-flash-modify { animation: vto-flash-modify 1s ease-out; }

/* ── Command Bar ────────────────────────────────────────────────────────── */

.vto-command-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: linear-gradient(135deg, rgba(12,14,20,0.8), rgba(18,20,28,0.75));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.07);
  margin-bottom: 8px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.04);
}

.vto-cb-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.vto-logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, #3498db, #00bc8c);
  font-size: 0.72rem;
  font-weight: 800;
  color: #0a0a0f;
  letter-spacing: 1px;
}

.vto-cb-center {
  display: flex;
  align-items: center;
  gap: 10px;
}

.vto-cb-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Pipeline progress dots */
.vto-pipeline-dots {
  display: flex;
  align-items: center;
  gap: 4px;
}

.vto-pip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  transition: all 0.3s ease;
}

.vto-pip-active {
  background: #3498db;
  animation: vto-pulse 1.5s ease-in-out infinite;
}

.vto-pip-done {
  background: #00bc8c;
}

/* ── Market Feed ────────────────────────────────────────────────────────── */

.vto-market-feed {
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding: 6px 0;
  margin-bottom: 8px;
  overflow-x: auto;
}

.vto-mf-card {
  flex: 1;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 12px;
  background: linear-gradient(145deg, rgba(12,14,20,0.55), rgba(16,18,26,0.45));
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.04);
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
}

.vto-mf-card:hover {
  border-color: rgba(255,255,255,0.1);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.vto-mf-badges {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.vto-mf-badge {
  font-size: 0.52rem;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.3px;
}

.vto-mf-wasde {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  background: rgba(12, 14, 20, 0.5);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.04);
  min-width: 70px;
}

/* ── Trading Floor (3 workstations + connectors) ────────────────────────── */

.vto-trading-floor {
  display: flex;
  align-items: flex-start;
  gap: 0;
  margin-bottom: 10px;
}

/* ── Workstation ────────────────────────────────────────────────────────── */

.vto-workstation {
  flex: 1;
  min-width: 260px;
  background: rgba(12, 14, 20, 0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.06);
  overflow: hidden;
  transition: box-shadow 0.4s ease, transform 0.3s ease, border-color 0.4s ease;
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}

.vto-workstation:hover {
  transform: perspective(1200px) rotateY(1deg) translateY(-2px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.35);
  border-color: rgba(255,255,255,0.10);
}

/* Active desk glow — pulsing border + deeper shadow */
@keyframes vto-desk-pulse-analyst {
  0%, 100% { box-shadow: 0 0 20px rgba(52,152,219,0.08), 0 4px 16px rgba(0,0,0,0.3); }
  50% { box-shadow: 0 0 35px rgba(52,152,219,0.15), 0 4px 16px rgba(0,0,0,0.3); }
}
@keyframes vto-desk-pulse-trader {
  0%, 100% { box-shadow: 0 0 20px rgba(0,188,140,0.08), 0 4px 16px rgba(0,0,0,0.3); }
  50% { box-shadow: 0 0 35px rgba(0,188,140,0.15), 0 4px 16px rgba(0,0,0,0.3); }
}
@keyframes vto-desk-pulse-manager {
  0%, 100% { box-shadow: 0 0 20px rgba(243,156,18,0.08), 0 4px 16px rgba(0,0,0,0.3); }
  50% { box-shadow: 0 0 35px rgba(243,156,18,0.15), 0 4px 16px rgba(0,0,0,0.3); }
}
.vto-desk-active-analyst {
  animation: vto-desk-pulse-analyst 2s ease-in-out infinite !important;
  border-color: rgba(52, 152, 219, 0.2) !important;
}
.vto-desk-active-trader {
  animation: vto-desk-pulse-trader 2s ease-in-out infinite !important;
  border-color: rgba(0, 188, 140, 0.2) !important;
}
.vto-desk-active-manager {
  animation: vto-desk-pulse-manager 2s ease-in-out infinite !important;
  border-color: rgba(243, 156, 18, 0.2) !important;
}

.vto-ws-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.vto-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  position: relative;
  overflow: hidden;
}
.vto-avatar::after {
  content: '';
  position: absolute;
  top: 0;
  left: -50%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
  transform: skewX(-20deg);
  animation: vto-avatar-sheen 4s ease-in-out infinite;
}
@keyframes vto-avatar-sheen {
  0%, 80%, 100% { left: -50%; }
  40% { left: 150%; }
}

.vto-ws-name-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.vto-status-lamp {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  display: inline-block;
}

.vto-monitor {
  padding: 10px 14px;
  min-height: 160px;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.8);
  animation: vto-card-enter 0.3s ease-out;
  position: relative;
}
/* CRT scanline overlay for terminal feel */
.vto-monitor::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0,0,0,0) 0px,
    rgba(0,0,0,0) 2px,
    rgba(0,0,0,0.03) 2px,
    rgba(0,0,0,0.03) 4px
  );
  pointer-events: none;
  border-radius: inherit;
}

.vto-ws-footer {
  display: flex;
  justify-content: space-between;
  padding: 6px 14px;
  border-top: 1px solid rgba(255,255,255,0.04);
}

/* Monitor elements */
.vto-mon-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.vto-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.vto-flags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
}

.vto-flag-tag {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(231,76,60,0.1);
  color: #e74c3c;
  font-size: 0.58rem;
}

.vto-conviction-bar {
  margin-bottom: 8px;
}

.vto-bar-track {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
  margin: 4px 0;
}

.vto-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}

.vto-edge-quote {
  padding: 6px 8px;
  background: rgba(0,188,140,0.05);
  border-radius: 4px;
  border-left: 3px solid rgba(0,188,140,0.25);
  margin-bottom: 8px;
  font-size: 0.65rem;
  color: rgba(255,255,255,0.65);
  line-height: 1.4;
}

.vto-verdict-quote {
  padding: 8px 10px;
  background: rgba(255,255,255,0.03);
  border-radius: 4px;
  margin-bottom: 8px;
  font-size: 0.68rem;
  color: rgba(255,255,255,0.65);
  font-style: italic;
  line-height: 1.4;
}

.vto-scenario-row {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
}

.vto-impact-row {
  display: flex;
  gap: 12px;
  margin-top: 6px;
}

.vto-risk-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.vto-mini-metric {
  margin-bottom: 3px;
}

/* Decision badge flash */
.vto-decision-approve {
  animation: vto-flash-approve 0.6s ease-out;
}
.vto-decision-reject {
  animation: vto-flash-reject 0.6s ease-out;
}
.vto-decision-modify {
  animation: vto-flash-modify 0.6s ease-out;
}

/* ── Chat Panel ─────────────────────────────────────────────────────────── */

.vto-chat-panel {
  padding: 6px 14px;
  max-height: 150px;
  overflow-y: auto;
  border-top: 1px solid rgba(255,255,255,0.04);
}

.vto-chat-bubble {
  padding: 5px 8px;
  margin-bottom: 4px;
  border-left: 3px solid rgba(255,255,255,0.1);
  font-size: 0.62rem;
  color: rgba(255,255,255,0.55);
  line-height: 1.35;
  animation: vto-slide-in 0.2s ease-out both;
}

/* Typing indicator */
.vto-typing-dots {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 6px 0;
}

.vto-typing-dots span {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  margin: 0 2px;
  animation: vto-bounce 1.4s ease-in-out infinite;
}
.vto-typing-dots span:nth-child(2) { animation-delay: 0.16s; }
.vto-typing-dots span:nth-child(3) { animation-delay: 0.32s; }

/* ── Pipeline Connectors ────────────────────────────────────────────────── */

.vto-connector {
  width: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 60px;
  flex-shrink: 0;
  position: relative;
}

.vto-connector-line {
  width: 100%;
  height: 2px;
  background: rgba(255,255,255,0.06);
  transition: background 0.4s ease;
}

.vto-connector-chevron {
  font-size: 1.2rem;
  color: rgba(255,255,255,0.1);
  margin-top: 2px;
  transition: color 0.4s ease;
}

.vto-connector-particles {
  display: none;
  position: absolute;
  top: 58px;
  left: 0;
  width: 100%;
  height: 6px;
}

.vto-particle {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #3498db;
  animation: vto-flow 1.2s ease-in-out infinite;
}
.vto-particle:nth-child(2) { animation-delay: 0.4s; }
.vto-particle:nth-child(3) { animation-delay: 0.8s; }

/* Flowing state — animated gradient */
@keyframes vto-data-flow {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}
.vto-connector-flowing .vto-connector-line {
  background: linear-gradient(90deg, rgba(52,152,219,0.1), rgba(52,152,219,0.4), rgba(0,188,140,0.4), rgba(52,152,219,0.1));
  background-size: 200% 100%;
  animation: vto-data-flow 1.5s linear infinite;
}
.vto-connector-flowing .vto-connector-chevron {
  color: rgba(52, 152, 219, 0.6);
}
.vto-connector-flowing .vto-connector-particles {
  display: block;
}

/* Idle state */
.vto-connector-idle .vto-connector-line {
  background: rgba(255,255,255,0.04);
}

/* ── Bottom Split: Logbook + Portfolio ──────────────────────────────────── */

.vto-bottom-split {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

/* Logbook */
.vto-logbook {
  flex: 3;
  min-width: 300px;
  background: rgba(12, 14, 20, 0.55);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.05);
  overflow: hidden;
}

.vto-logbook-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.vto-logbook-scroll {
  max-height: 320px;
  overflow-y: auto;
  padding: 6px;
}

.vto-logbook-row {
  padding: 6px 10px;
  margin-bottom: 3px;
  border-left: 3px solid rgba(255,255,255,0.1);
  border-radius: 0 6px 6px 0;
  background: rgba(255,255,255,0.02);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, border-color 0.3s ease;
  animation: vto-slide-in 0.2s ease-out both;
}

.vto-logbook-row:hover {
  background: rgba(255,255,255,0.05);
  transform: translateX(2px);
  border-left-color: rgba(255,255,255,0.2);
}

.vto-lb-row-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}

.vto-lb-agents {
  display: flex;
  gap: 8px;
  font-size: 0.55rem;
  font-family: "JetBrains Mono", monospace;
  margin-top: 2px;
}

/* Portfolio */
.vto-portfolio {
  flex: 2;
  min-width: 240px;
  background: rgba(12, 14, 20, 0.55);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.05);
  overflow: hidden;
}

.vto-portfolio-header {
  padding: 8px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.vto-portfolio-body {
  padding: 8px 14px;
}

.vto-port-summary {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.vto-port-greeks {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 6px 0;
  border-top: 1px solid rgba(255,255,255,0.04);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  margin-bottom: 6px;
}

.vto-port-pos {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

.vto-port-pos-info {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.vto-close-btn {
  font-size: 0.65rem !important;
  padding: 1px 6px !important;
  opacity: 0.4;
  transition: opacity 0.2s ease-out;
}
.vto-close-btn:hover {
  opacity: 1;
}

/* ── Detail Modal ───────────────────────────────────────────────────────── */

.vto-detail-modal .modal-content {
  background: rgba(12, 14, 20, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
}

.vto-detail-modal-header {
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.vto-detail-modal-body {
  padding: 16px;
}

.vto-modal-columns {
  display: flex;
  gap: 14px;
}

.vto-modal-col {
  flex: 1;
  padding: 10px;
  background: rgba(255,255,255,0.02);
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.04);
}

.vto-modal-col-title {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  margin-bottom: 8px;
}

.vto-modal-timing {
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

/* ── Concept Explanation Section ────────────────────────────────────────── */

.vto-concept {
  background: rgba(12, 14, 20, 0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 8px;
  overflow: hidden;
}

.vto-concept-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s ease;
}

.vto-concept-header:hover {
  background: rgba(255,255,255,0.02);
}

.vto-concept-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.vto-concept-title h3 {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: rgba(255,255,255,0.85);
}

.vto-concept-title span {
  font-size: 0.58rem;
  color: rgba(255,255,255,0.3);
  font-style: italic;
}

.vto-concept-chevron {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.25);
  transition: transform 0.3s ease;
}

.vto-concept-body {
  padding: 0 16px 14px;
  border-top: 1px solid rgba(255,255,255,0.04);
}

.vto-concept-intro {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.5);
  line-height: 1.6;
  margin: 10px 0;
  max-width: 800px;
}

.vto-concept-agents {
  display: flex;
  gap: 10px;
  margin: 12px 0;
}

.vto-concept-agent-card {
  flex: 1;
  padding: 10px 12px;
  background: rgba(255,255,255,0.02);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.04);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.vto-concept-agent-card:hover {
  border-color: rgba(255,255,255,0.08);
}

.vto-concept-agent-card h4 {
  margin: 0 0 4px;
  font-size: 0.72rem;
  font-weight: 700;
}

.vto-concept-agent-card .vto-concept-provider {
  font-size: 0.52rem;
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 600;
  letter-spacing: 0.5px;
  display: inline-block;
  margin-bottom: 6px;
}

.vto-concept-agent-card ul {
  margin: 0;
  padding: 0 0 0 14px;
  font-size: 0.6rem;
  color: rgba(255,255,255,0.45);
  line-height: 1.6;
}

.vto-concept-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 12px 0 8px;
  font-size: 0.65rem;
  color: rgba(255,255,255,0.35);
  font-family: "JetBrains Mono", monospace;
}

.vto-concept-flow-arrow {
  color: rgba(255,255,255,0.15);
}

.vto-concept-stats {
  display: flex;
  gap: 16px;
  padding: 6px 0;
  border-top: 1px solid rgba(255,255,255,0.04);
  font-size: 0.58rem;
  color: rgba(255,255,255,0.25);
  font-family: "JetBrains Mono", monospace;
}

/* ── 3D Scene (full width, stacked above desks) ────────────────────────── */

.vto-scene-container {
  width: 100%;
  min-height: 420px;
  max-height: 520px;
  margin-bottom: 10px;
  background: rgba(8, 10, 16, 0.5);
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.06);
  overflow: hidden;
  position: relative;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.03);
}

.vto-scene-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ── Agent Desks Row (3 side-by-side below scene) ──────────────────────── */

.vto-desks-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  align-items: stretch;
}

.vto-desks-row .vto-workstation {
  flex: 1;
  min-width: 0;
}

.vto-desks-row .vto-monitor {
  min-height: 150px;
  max-height: 280px;
  overflow-y: auto;
}

.vto-desks-row .vto-chat-panel {
  max-height: 120px;
}

/* Progress dots between workstations (horizontal in row) */
.vto-stage-progress-horizontal {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-shrink: 0;
  width: 20px;
}

/* Hide connectors in the new layout (kept in DOM for callback compat) */
.vto-connectors-hidden {
  display: none;
}

/* Legacy class kept for backward compat */
.vto-main-split {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  align-items: stretch;
}
.vto-desks-column {
  width: 380px;
  min-width: 320px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ══════════════════════════════════════════════════════════════════════════
   VTO ENHANCEMENTS — Animations, States & Micro-interactions
   ══════════════════════════════════════════════════════════════════════════ */

/* ── P1: Active Agent Card Dramatic Glow ──────────────────────────────── */

@property --vto-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}
@keyframes vto-border-rotate {
  from { --vto-angle: 0deg; }
  to { --vto-angle: 360deg; }
}

.vto-workstation.vto-active {
  position: relative;
  border-color: transparent !important;
}
.vto-workstation.vto-active::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 15px;
  padding: 1px;
  background: conic-gradient(from var(--vto-angle), var(--vto-agent-color, #3498db), transparent 40%, var(--vto-agent-color, #3498db));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: vto-border-rotate 3s linear infinite;
  pointer-events: none;
  z-index: 1;
}
/* Doubled glow intensity on active desk */
.vto-desk-active-analyst.vto-active {
  box-shadow: 0 0 40px rgba(52,152,219,0.16), 0 0 80px rgba(52,152,219,0.08), 0 4px 16px rgba(0,0,0,0.3) !important;
}
.vto-desk-active-trader.vto-active {
  box-shadow: 0 0 40px rgba(0,188,140,0.16), 0 0 80px rgba(0,188,140,0.08), 0 4px 16px rgba(0,0,0,0.3) !important;
}
.vto-desk-active-manager.vto-active {
  box-shadow: 0 0 40px rgba(243,156,18,0.16), 0 0 80px rgba(243,156,18,0.08), 0 4px 16px rgba(0,0,0,0.3) !important;
}
/* Fallback for browsers without @property (Firefox <128, older Safari).
   @supports (syntax:...) is invalid outside @property — use an animation
   property probe: if the browser can animate a registered custom property
   via @property the conic border works; otherwise fall back to static glow. */
@supports not (animation-timeline: auto) {
  /* Most browsers that lack @property also lack animation-timeline.
     This is an imperfect proxy but covers Firefox <128, Safari <15.4. */
  .vto-workstation.vto-active::before { display: none; }
  .vto-workstation.vto-active {
    box-shadow: 0 0 30px rgba(var(--vto-agent-rgb, 52,152,219), 0.15),
                0 0 60px rgba(var(--vto-agent-rgb, 52,152,219), 0.08) !important;
    border-color: rgba(var(--vto-agent-rgb, 52,152,219), 0.25) !important;
    transition: border-color 0.6s ease-out, box-shadow 0.6s ease-out;
  }
}
/* Additional safety: hide ::before on Firefox (lacks @property until v128) */
@-moz-document url-prefix() {
  .vto-workstation.vto-active::before { display: none; }
  .vto-workstation.vto-active {
    border-color: rgba(var(--vto-agent-rgb, 52,152,219), 0.25) !important;
  }
}

/* ── P1: Chat Bubble Reveal Animation ─────────────────────────────────── */

@keyframes vto-reveal {
  from { clip-path: inset(0 100% 0 0); opacity: 0.5; }
  to { clip-path: inset(0 0% 0 0); opacity: 1; }
}
.vto-chat-bubble {
  animation: vto-reveal 0.8s ease-out forwards !important;
  border-left: 3px solid var(--vto-bubble-color, rgba(255,255,255,0.1)) !important;
}

/* ── P1: Monitor Panel Activation Effect ──────────────────────────────── */

@keyframes vto-monitor-activate {
  from { opacity: 0.3; transform: scale(0.97); filter: brightness(0.5); }
  to { opacity: 1; transform: scale(1); filter: brightness(1); }
}
.vto-active .vto-monitor {
  animation: vto-monitor-activate 0.5s ease-out forwards;
}
@keyframes vto-scanlines {
  0% { transform: translateY(0); }
  100% { transform: translateY(4px); }
}
.vto-active .vto-monitor::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent 0px,
    transparent 2px,
    rgba(255,255,255,0.015) 2px,
    rgba(255,255,255,0.015) 4px
  );
  pointer-events: none;
  border-radius: inherit;
  animation: vto-scanlines 8s linear infinite;
}

/* ── P1: Pipeline Connector Upgrade ───────────────────────────────────── */

.vto-connector-flowing .vto-connector-line {
  background: linear-gradient(90deg, rgba(52,152,219,0.15), rgba(52,152,219,0.5), rgba(0,188,140,0.5), rgba(52,152,219,0.15)) !important;
  height: 3px;
}
@keyframes vto-node-pulse {
  0%, 100% { width: 6px; height: 6px; opacity: 0.6; }
  50% { width: 10px; height: 10px; opacity: 1; }
}
.vto-connector-node {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3498db;
  position: absolute;
  top: 55px;
  animation: vto-node-pulse 1.5s ease-in-out infinite;
}
.vto-connector-node-start { left: -4px; }
.vto-connector-node-end { right: -4px; }
.vto-connector-flowing .vto-connector-node {
  display: block;
}
.vto-connector-idle .vto-connector-node {
  display: none;
}

/* ── P2: Agent Status Badge Visual States ─────────────────────────────── */

@keyframes vto-status-breathing {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.7; }
}
@keyframes vto-status-scanning {
  from { border-color: transparent; border-top-color: currentColor; transform: rotate(0deg); }
  to { border-color: transparent; border-top-color: currentColor; transform: rotate(360deg); }
}

.vto-status-active .vto-status-lamp {
  background: #00bc8c !important;
  box-shadow: 0 0 6px rgba(0,188,140,0.5);
  animation: vto-pulse 2s ease-in-out infinite;
}
.vto-status-idle .vto-status-lamp {
  background: rgba(255,255,255,0.12);
  opacity: 0.6;
  animation: vto-status-breathing 3s ease-in-out infinite;
}
.vto-status-scanning .vto-status-lamp {
  background: #3498db !important;
  box-shadow: 0 0 6px rgba(52,152,219,0.4);
  width: 9px;
  height: 9px;
  border: 2px solid transparent;
  border-top-color: #3498db;
  animation: vto-status-scanning 1.5s linear infinite;
}

/* ── P2: Enhanced Decision Flash ──────────────────────────────────────── */

@keyframes vto-sparkle-rise {
  0% { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(-40px) scale(0); opacity: 0; }
}
.vto-decision-flash.vto-flash-approve::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  background: #00bc8c;
  border-radius: 50%;
  box-shadow:
    -20px 10px 0 #00bc8c,
    15px -5px 0 #00bc8c,
    -10px -15px 0 #00bc8c,
    25px 8px 0 #00bc8c,
    -30px -8px 0 #00bc8c;
  animation: vto-sparkle-rise 1s ease-out forwards;
}

@keyframes vto-shake {
  0%, 100% { transform: translateX(0); }
  10%, 50%, 90% { transform: translateX(-2px); }
  30%, 70% { transform: translateX(2px); }
}
.vto-decision-flash.vto-flash-reject {
  animation: vto-flash-reject 1s ease-out, vto-shake 0.4s ease-out !important;
}

@keyframes vto-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.vto-decision-flash.vto-flash-modify {
  animation: vto-flash-modify 1s ease-out !important;
  background-image: linear-gradient(90deg, transparent, rgba(243,156,18,0.1), transparent) !important;
  background-size: 200% 100%;
  animation: vto-flash-modify 1s ease-out, vto-shimmer 1.2s ease-out !important;
}

/* ── P2: Countdown Timer Urgency ──────────────────────────────────────── */

@keyframes vto-countdown-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
.vto-countdown-warning {
  color: #f0ad4e !important;
  animation: vto-countdown-pulse 1.5s ease-in-out infinite;
}
.vto-countdown-critical {
  color: #e74c3c !important;
  animation: vto-countdown-pulse 0.5s ease-in-out infinite;
  transform: scale(1.05);
}
.vto-countdown-bar {
  height: 2px;
  border-radius: 1px;
  background: linear-gradient(90deg, var(--vto-accent, #3498db), transparent);
  transition: width 1s linear;
  margin-top: 4px;
}

/* ── P3: Position Card P&L Styling ────────────────────────────────────── */

@keyframes vto-pnl-flash {
  0% { transform: scale(1.1); text-shadow: 0 0 8px currentColor; }
  100% { transform: scale(1); text-shadow: none; }
}
.vto-position-profit {
  border-left: 3px solid #00bc8c !important;
  background: rgba(0,188,140,0.03) !important;
}
.vto-position-loss {
  border-left: 3px solid #e74c3c !important;
  background: rgba(231,76,60,0.03) !important;
}
.vto-pnl-changed {
  animation: vto-pnl-flash 0.3s ease-out;
}

/* ── P3: Logbook Entry Animations ─────────────────────────────────────── */

@keyframes vto-log-enter {
  0% { transform: translateX(20px); opacity: 0; }
  60% { transform: translateX(-3px); }
  100% { transform: translateX(0); opacity: 1; }
}
.vto-logbook-row {
  animation: vto-log-enter 0.4s ease-out both !important;
}
.vto-logbook-row:nth-child(1) { animation-delay: 0s; }
.vto-logbook-row:nth-child(2) { animation-delay: 0.05s; }
.vto-logbook-row:nth-child(3) { animation-delay: 0.1s; }
.vto-logbook-row:nth-child(4) { animation-delay: 0.15s; }
.vto-logbook-row:nth-child(5) { animation-delay: 0.2s; }
.vto-log-approve { border-left-color: #00bc8c !important; }
.vto-log-reject { border-left-color: #e74c3c !important; }
.vto-log-modify { border-left-color: #f39c12 !important; }

/* ── P3: Attribution Table Styling ────────────────────────────────────── */

.vto-attribution table {
  width: 100%;
  border-collapse: collapse;
}
.vto-attribution table thead th {
  position: sticky;
  top: 0;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: rgba(26,28,38,0.9);
  z-index: 2;
  padding: 6px 8px;
  font-size: 0.6rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.vto-attribution table tbody tr:nth-child(odd) {
  background: rgba(255,255,255,0.02);
}
.vto-attribution table tbody tr.vto-correct {
  background: rgba(0,188,140,0.05);
}
.vto-attribution table tbody tr.vto-incorrect {
  background: rgba(231,76,60,0.05);
}

/* ── P4: Hover Effects Throughout ─────────────────────────────────────── */

.vto-workstation:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4) !important;
}
.vto-avatar:hover::after {
  animation: vto-avatar-sheen 0.6s ease-in-out !important;
}
.vto-command-bar .btn:hover,
.vto-close-btn:hover {
  transform: scale(1.02);
  transition: transform 0.2s ease-out, opacity 0.2s;
}

/* ── P4: Loading Skeleton States ──────────────────────────────────────── */

@keyframes vto-skeleton-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.vto-skeleton {
  background: linear-gradient(90deg, #1a1c26 25%, #2a2d38 50%, #1a1c26 75%);
  background-size: 200% 100%;
  animation: vto-skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: 4px;
  color: transparent !important;
}

/* ── P4: Smooth Section Transitions ───────────────────────────────────── */

.vto-concept-body {
  overflow: hidden;
  transition: max-height 0.3s ease-out, opacity 0.3s ease-out, padding 0.3s ease-out;
}
.vto-chat-panel {
  transition: max-height 0.3s ease-out;
}

/* ══════════════════════════════════════════════════════════════════════════
   VTO ROUND 2 — Time-of-day, Timeline, Thinking, Gauges, Toasts, PnL
   ══════════════════════════════════════════════════════════════════════════ */

/* ── R2-4: Time-of-Day UI Theme ─────────────────────────────────────────── */

.vto-root {
  --vto-accent: #3498db;
  --vto-accent-glow: rgba(52,152,219,0.15);
}
.vto-root[data-market-hours="rth"] {
  --vto-accent: #f0ad4e;
  --vto-accent-glow: rgba(240,173,78,0.15);
}
.vto-root[data-market-hours="eth"] {
  --vto-accent: #3498db;
  --vto-accent-glow: rgba(52,152,219,0.15);
}
.vto-root[data-market-hours="closed"] {
  --vto-accent: #6c757d;
  --vto-accent-glow: rgba(108,117,125,0.1);
}
/* Apply accent to command bar top border */
.vto-command-bar {
  border-top: 2px solid var(--vto-accent) !important;
}
/* Apply accent to pipeline connector lines */
.vto-connector-flowing .vto-connector-line {
  background: linear-gradient(90deg, transparent, var(--vto-accent-glow), var(--vto-accent), var(--vto-accent-glow), transparent) !important;
}
/* Apply accent to countdown text */
.vto-countdown-bar {
  background: linear-gradient(90deg, var(--vto-accent), transparent) !important;
}

/* ── R2-5: Agent Activity Timeline ──────────────────────────────────────── */

.vto-timeline {
  height: 3px;
  background: #1a1c26;
  border-radius: 2px;
  overflow: hidden;
  display: flex;
  width: 100%;
  margin: 0 8px;
}
.vto-timeline-segment {
  height: 100%;
  display: inline-block;
  transition: width 0.5s ease-out;
  min-width: 0;
}
.vto-timeline-analyst { background: #3498db; }
.vto-timeline-trader { background: #00bc8c; }
.vto-timeline-manager { background: #f39c12; }
.vto-timeline-idle { background: rgba(255,255,255,0.04); }

/* ── R2-6: Agent "Thinking" Indicator ───────────────────────────────────── */

.vto-thinking {
  display: none;
  gap: 3px;
  padding: 4px 8px;
  align-items: center;
  justify-content: center;
}
.vto-active .vto-thinking {
  display: flex;
}
.vto-thinking-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--vto-agent-color, #3498db);
  animation: vto-think-bounce 1.4s ease-in-out infinite;
}
.vto-thinking-dot:nth-child(2) { animation-delay: 0.2s; }
.vto-thinking-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes vto-think-bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.3; }
  40% { transform: scale(1); opacity: 1; }
}

/* ── R2-7: Portfolio Gauge Meters ───────────────────────────────────────── */

.vto-gauge {
  height: 4px;
  border-radius: 2px;
  background: #2a2d38;
  overflow: hidden;
  margin-top: 3px;
}
.vto-gauge-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.8s ease-out;
}
.vto-gauge-high { background: linear-gradient(90deg, #00bc8c, #10d898); }
.vto-gauge-medium { background: linear-gradient(90deg, #f0ad4e, #ffc107); }
.vto-gauge-low { background: linear-gradient(90deg, #e74c3c, #ff6b6b); }

/* ── R2-8: Enhanced Chat Bubble Styling ─────────────────────────────────── */

/* Agent analysis bubbles: left-aligned with colored accent + tail */
.vto-chat-bubble {
  position: relative;
  margin-left: 10px;
}
.vto-chat-bubble::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 12px;
  border: 6px solid transparent;
  border-right-color: var(--vto-bubble-color, #2a2d38);
}
/* System / pipeline bubbles */
.vto-chat-bubble-system {
  text-align: center;
  border-left: none !important;
  font-size: 0.6rem;
  color: rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.02);
  margin-left: 0;
  padding: 4px 12px;
}
.vto-chat-bubble-system::before { display: none; }
/* Decision bubbles */
.vto-chat-bubble-decision {
  text-align: right;
  margin-left: auto;
  margin-right: 4px;
  font-weight: 700;
  font-size: 0.78rem;
  border-left: none !important;
  border-right: 3px solid var(--vto-bubble-color, #00bc8c);
}
.vto-chat-bubble-decision::before { display: none; }

/* ── R2-10: P&L Badge ──────────────────────────────────────────────────── */

.vto-pnl-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  font-family: "JetBrains Mono", monospace;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 5;
  pointer-events: none;
}
.vto-pnl-badge-positive {
  background: rgba(0,188,140,0.15);
  color: #00bc8c;
  border: 1px solid rgba(0,188,140,0.3);
}
.vto-pnl-badge-negative {
  background: rgba(231,76,60,0.15);
  color: #e74c3c;
  border: 1px solid rgba(231,76,60,0.3);
}
.vto-pnl-badge-neutral {
  background: rgba(108,117,125,0.1);
  color: rgba(255,255,255,0.4);
  border: 1px solid rgba(108,117,125,0.2);
}

/* ── R2-11: Toast Notifications ─────────────────────────────────────────── */

.vto-toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.vto-toast {
  padding: 12px 20px;
  border-radius: 8px;
  background: rgba(26,28,38,0.95);
  border-left: 3px solid;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: vto-toast-in 0.4s ease-out;
  pointer-events: auto;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.8);
  max-width: 300px;
}
@keyframes vto-toast-in {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes vto-toast-out {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}
.vto-toast-dismiss {
  animation: vto-toast-out 0.3s ease-in forwards;
}
.vto-toast-approve { border-color: #00bc8c; }
.vto-toast-reject { border-color: #e74c3c; }
.vto-toast-modify { border-color: #f39c12; }

/* ── R2-12: Dark Scrollbars for VTO Panels ──────────────────────────────── */

.vto-root ::-webkit-scrollbar { width: 6px; height: 6px; }
.vto-root ::-webkit-scrollbar-track { background: transparent; }
.vto-root ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
.vto-root ::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }
/* Firefox scrollbar styling */
.vto-root * {
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 1400px) {
  .vto-scene-container {
    min-height: 300px;
    max-height: 400px;
  }
}

@media (max-width: 1100px) {
  .vto-desks-row {
    flex-wrap: wrap;
  }
  .vto-desks-row .vto-workstation {
    min-width: 280px;
  }
  .vto-stage-progress-horizontal {
    display: none;
  }
  .vto-trading-floor {
    flex-wrap: wrap;
  }
  .vto-connector {
    display: none;
  }
  .vto-bottom-split {
    flex-direction: column;
  }
  .vto-modal-columns {
    flex-direction: column;
  }
}

@media (max-width: 768px) {
  .vto-command-bar {
    flex-direction: column;
    gap: 6px;
  }
  .vto-cb-left, .vto-cb-center, .vto-cb-right {
    width: 100%;
    justify-content: center;
  }
  .vto-market-feed {
    flex-direction: column;
  }
  .vto-scene-container {
    min-height: 250px;
    max-height: 300px;
  }
  .vto-desks-row {
    flex-direction: column;
  }
  .vto-desks-row .vto-workstation {
    min-width: unset;
  }
  .vto-concept-agents {
    flex-direction: column;
  }
  .vto-toast-container {
    right: 10px;
    left: 10px;
  }
  .vto-toast { max-width: 100%; }
  .vto-pnl-badge { position: static; margin-bottom: 4px; display: inline-block; }
}

/* ══════════════════════════════════════════════════════════════════════════
   VTO ROUND 3 — Agent Personality, Data Micro-Elements, Polish
   ══════════════════════════════════════════════════════════════════════════ */

/* ── R3-A1: Agent-Specific Card Themes ──────────────────────────────────── */

/* Analyst (blue) — data-oriented, monospace numbers, matrix background */
.vto-workstation-analyst .vto-monitor {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
}
.vto-workstation-analyst .vto-monitor::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 18px, rgba(52,152,219,0.02) 18px, rgba(52,152,219,0.02) 19px),
    repeating-linear-gradient(90deg, transparent, transparent 18px, rgba(52,152,219,0.015) 18px, rgba(52,152,219,0.015) 19px);
  pointer-events: none;
  border-radius: inherit;
  opacity: 0.6;
}

/* Trader (green) — action-oriented, bolder borders, stronger active glow */
.vto-workstation-trader {
  border-width: 1.5px;
}
.vto-workstation-trader .vto-badge {
  font-weight: 800;
  letter-spacing: 1.5px;
}
.vto-workstation-trader .vto-ws-header {
  border-bottom-width: 2px;
  border-bottom-color: rgba(0,188,140,0.1);
}
.vto-workstation-trader.vto-active {
  box-shadow: 0 0 50px rgba(0,188,140,0.2), 0 0 100px rgba(0,188,140,0.1), 0 4px 16px rgba(0,0,0,0.3) !important;
}

/* Manager (gold) — executive, wider card, thinner borders, refined type */
.vto-workstation-manager {
  border-width: 0.5px;
  border-color: rgba(243,156,18,0.08);
}
.vto-desks-column .vto-workstation-manager,
.vto-desks-row .vto-workstation-manager {
  flex-grow: 1.1;
}
.vto-workstation-manager .vto-ws-header {
  letter-spacing: 0.5px;
}
.vto-workstation-manager .vto-verdict-quote {
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.2px;
}

/* ── R3-A2: Agent Avatar Enhancement ────────────────────────────────────── */

/* Pulsing ring when active (uses agent color from inline style) */
.vto-active .vto-avatar {
  animation: vto-avatar-ring-pulse 2s ease-in-out infinite;
}
@keyframes vto-avatar-ring-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(255,255,255,0.05), 0 2px 8px rgba(0,0,0,0.3); }
  50% { box-shadow: 0 0 0 6px rgba(255,255,255,0.08), 0 0 16px rgba(255,255,255,0.06), 0 2px 8px rgba(0,0,0,0.3); }
}
.vto-workstation-analyst.vto-active .vto-avatar {
  animation: vto-avatar-ring-analyst 2s ease-in-out infinite;
  background: radial-gradient(circle, rgba(52,152,219,0.12) 0%, transparent 70%);
}
@keyframes vto-avatar-ring-analyst {
  0%, 100% { box-shadow: 0 0 0 3px rgba(52,152,219,0.15), 0 2px 8px rgba(0,0,0,0.3); }
  50% { box-shadow: 0 0 0 6px rgba(52,152,219,0.25), 0 0 16px rgba(52,152,219,0.1), 0 2px 8px rgba(0,0,0,0.3); }
}
.vto-workstation-trader.vto-active .vto-avatar {
  animation: vto-avatar-ring-trader 2s ease-in-out infinite;
  background: radial-gradient(circle, rgba(0,188,140,0.12) 0%, transparent 70%);
}
@keyframes vto-avatar-ring-trader {
  0%, 100% { box-shadow: 0 0 0 3px rgba(0,188,140,0.15), 0 2px 8px rgba(0,0,0,0.3); }
  50% { box-shadow: 0 0 0 6px rgba(0,188,140,0.25), 0 0 16px rgba(0,188,140,0.1), 0 2px 8px rgba(0,0,0,0.3); }
}
.vto-workstation-manager.vto-active .vto-avatar {
  animation: vto-avatar-ring-manager 2s ease-in-out infinite;
  background: radial-gradient(circle, rgba(243,156,18,0.12) 0%, transparent 70%);
}
@keyframes vto-avatar-ring-manager {
  0%, 100% { box-shadow: 0 0 0 3px rgba(243,156,18,0.15), 0 2px 8px rgba(0,0,0,0.3); }
  50% { box-shadow: 0 0 0 6px rgba(243,156,18,0.25), 0 0 16px rgba(243,156,18,0.1), 0 2px 8px rgba(0,0,0,0.3); }
}

/* Checkmark overlay on stage complete */
.vto-workstation.vto-stage-done .vto-avatar::before {
  content: "\2713";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,188,140,0.7);
  color: white;
  font-size: 1rem;
  font-weight: 800;
  border-radius: 50%;
  animation: vto-check-flash 0.5s ease-out forwards;
  z-index: 2;
}
@keyframes vto-check-flash {
  0% { opacity: 0; transform: scale(0.5); }
  40% { opacity: 1; transform: scale(1.15); }
  100% { opacity: 0; transform: scale(1); }
}

/* ── R3-A3: Agent Confidence Meter ──────────────────────────────────────── */

.vto-confidence-meter {
  width: 24px;
  height: 12px;
  border-radius: 12px 12px 0 0;
  position: relative;
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
  margin-left: 4px;
}
.vto-confidence-meter::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.06);
  border-radius: inherit;
}
.vto-confidence-meter::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: conic-gradient(var(--meter-color, #6c757d) var(--meter-pct, 0%), transparent var(--meter-pct, 0%));
  transform: rotate(-90deg);
  transform-origin: center center;
}
.vto-confidence-low { --meter-color: #e74c3c; }
.vto-confidence-medium { --meter-color: #f0ad4e; }
.vto-confidence-high { --meter-color: #00bc8c; }

/* ── R3-B4: CSS-Only Sparkline for Position Cards ───────────────────────── */

.vto-sparkline {
  width: 60px;
  height: 16px;
  display: inline-block;
  vertical-align: middle;
  margin-left: auto;
  clip-path: polygon(0% 80%, 10% 60%, 20% 70%, 30% 40%, 40% 50%, 50% 20%, 60% 30%, 70% 10%, 80% 25%, 90% 15%, 100% 5%, 100% 100%, 0% 100%);
  opacity: 0.4;
}
.vto-sparkline-profit {
  background: linear-gradient(to right, transparent 0%, #00bc8c 100%);
}
.vto-sparkline-loss {
  background: linear-gradient(to right, transparent 0%, #e74c3c 100%);
}

/* ── R3-B5: Risk Heat Indicator ─────────────────────────────────────────── */

.vto-risk-heat {
  height: 3px;
  border-radius: 2px;
  margin: 4px 0 0;
  background: linear-gradient(90deg, #00bc8c, #f0ad4e, #e74c3c);
  opacity: 0.5;
  position: relative;
  overflow: hidden;
}
.vto-risk-heat::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  background: rgba(12,14,20,0.9);
  width: var(--risk-empty, 60%);
  transition: width 0.8s ease-out;
}

/* ── R3-B6: Pipeline Stage Progress Dots ────────────────────────────────── */

.vto-stage-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px 0;
}
.vto-progress-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  transition: background 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}
.vto-progress-dot.vto-dot-filled {
  transform: scale(1.2);
}
.vto-progress-dot.vto-dot-analyst { background: #3498db; box-shadow: 0 0 4px rgba(52,152,219,0.4); }
.vto-progress-dot.vto-dot-trader { background: #00bc8c; box-shadow: 0 0 4px rgba(0,188,140,0.4); }
.vto-progress-dot.vto-dot-manager { background: #f39c12; box-shadow: 0 0 4px rgba(243,156,18,0.4); }

/* ── R3-C7: Market Status Indicator ─────────────────────────────────────── */

.vto-market-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}
.vto-market-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}
.vto-market-status-open {
  background: rgba(0,188,140,0.12);
  color: #00bc8c;
  border: 1px solid rgba(0,188,140,0.2);
}
.vto-market-status-open .vto-market-status-dot {
  background: #00bc8c;
  animation: vto-pulse 2s ease-in-out infinite;
}
.vto-market-status-closed {
  background: rgba(108,117,125,0.1);
  color: rgba(255,255,255,0.35);
  border: 1px solid rgba(108,117,125,0.15);
}
.vto-market-status-closed .vto-market-status-dot {
  background: rgba(255,255,255,0.2);
}
.vto-market-status-pre {
  background: rgba(243,156,18,0.1);
  color: #f0ad4e;
  border: 1px solid rgba(243,156,18,0.2);
}
.vto-market-status-pre .vto-market-status-dot {
  background: #f0ad4e;
  animation: vto-pulse 3s ease-in-out infinite;
}

/* ── R3-C8: Keyboard Shortcut Hints ─────────────────────────────────────── */

.vto-kbd {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 3px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.52rem;
  color: rgba(255,255,255,0.3);
  line-height: 1.4;
  vertical-align: middle;
  margin-left: 4px;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.vto-command-bar:hover .vto-kbd {
  opacity: 1;
}

/* ── R3-C9: Empty State for Panels ──────────────────────────────────────── */

.vto-empty-state {
  text-align: center;
  padding: 24px;
  color: rgba(255,255,255,0.3);
  font-style: italic;
  font-size: 0.72rem;
}
.vto-empty-state::before {
  content: "";
  display: block;
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  border: 2px dashed rgba(255,255,255,0.1);
  border-radius: 50%;
}

/* ── R3-C10: Smooth Number Transitions ──────────────────────────────────── */

.vto-tabular-nums {
  font-variant-numeric: tabular-nums;
  transition: color 0.3s ease;
}
.vto-port-summary .vto-mini-metric,
.vto-port-greeks .vto-mini-metric,
.vto-port-pos span[style*="fontFamily"] {
  font-variant-numeric: tabular-nums;
}
@keyframes vto-num-flash {
  0% { filter: brightness(1.4); }
  100% { filter: brightness(1); }
}
.vto-num-changed {
  animation: vto-num-flash 0.4s ease-out;
}

/* ── R4-6: Pipeline Arrival Card Flash ──────────────────────────────────── */

.vto-workstation.vto-stage-complete {
  animation: vto-arrival-flash 0.4s ease-out;
}
@keyframes vto-arrival-flash {
  0% { border-color: var(--vto-agent-color, rgba(255,255,255,0.2)); box-shadow: 0 0 20px var(--vto-agent-color, rgba(255,255,255,0.1)); }
  100% { border-color: rgba(255,255,255,0.06); box-shadow: none; }
}

/* ── R3-E15: Reduced Motion ─────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .vto-root,
  .vto-root *,
  .vto-root *::before,
  .vto-root *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── R3-E16: Focus-Visible Accessibility ────────────────────────────────── */

.vto-root *:focus-visible {
  outline: 2px solid var(--vto-accent, #3498db);
  outline-offset: 2px;
  border-radius: 4px;
}
.vto-workstation-analyst *:focus-visible { outline-color: var(--vto-analyst); }
.vto-workstation-trader *:focus-visible { outline-color: var(--vto-trader); }
.vto-workstation-manager *:focus-visible { outline-color: var(--vto-manager); }
