/* ═══════════════════════════════════════════════════════════════════════════════
   RISKOS PORTFOLIO PREDICTION & QUANT OPTIMIZER STYLESHEET
   Black Cinematic Aesthetic (#000000), Streamlined Top Bar, Animated Gliding Marquee,
   Beast Glowing KPI Cards, and Seamless Currency Transition
   ═══════════════════════════════════════════════════════════════════════════════ */

body.portfolio-page {
  background-color: #000000 !important;
  color: #ffffff !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  min-height: 100vh;
  overflow-x: hidden !important;
  max-width: 100vw !important;
}

.portfolio-page .obs-container {
  width: 100% !important;
  max-width: 1400px !important;
  margin: 0 auto !important;
  padding: 24px 20px 80px 20px !important;
  box-sizing: border-box !important;
  overflow-x: hidden !important;
}

.portfolio-page .obs-hero-section {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  padding: 24px 0 8px 0 !important;
}

/* ── Streamlined Universal Header ───────────────────────────────────────────── */
.header--streamlined {
  height: 52px;
  background: rgba(8, 10, 15, 0.95);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 0;
  z-index: 200;
}

.header--streamlined .header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.header-search-icon-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #a1a1aa;
  padding: 5px 10px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  cursor: pointer;
  transition: all 0.2s ease;
}

.header-search-icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(34, 211, 238, 0.4);
  color: #fff;
}

.search-hint-text {
  font-size: 0.75rem;
  color: #71717a;
}

.nav-pill--clean {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 9999px;
  padding: 3px 6px;
}

.nav-pill--clean .nav-link {
  font-size: 0.76rem;
  padding: 4px 10px;
  color: #a1a1aa;
  text-decoration: none;
  border-radius: 9999px;
  transition: all 0.15s;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  white-space: nowrap;
}

.nav-pill--clean .nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.nav-pill--clean .nav-link.active {
  color: #000;
  background: #22d3ee;
  font-weight: 700;
}

.header-right--clean {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* ── Interactive Currency Switcher (INR / USD) ──────────────────────────────── */
.currency-toggle-pill {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(34, 211, 238, 0.3);
  border-radius: 9999px;
  padding: 2px;
  gap: 2px;
}

.curr-btn {
  background: transparent;
  border: none;
  color: #a1a1aa;
  font-size: 0.72rem;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.curr-btn:hover {
  color: #ffffff;
}

.curr-btn.active {
  background: #22d3ee;
  color: #000000;
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.4);
}

/* Currency Flip Transition Animation */
.value-rolling {
  display: inline-block;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
}

.currency-flipping {
  transform: translateY(-4px) scale(0.98);
  opacity: 0.3;
}

/* ── Beast Marquee Ribbon (Infinite Continuous Gliding Stream) ────────────────── */
.beast-marquee-wrapper {
  width: 100%;
  height: 38px;
  background: #080b12;
  border: 1px solid rgba(34, 211, 238, 0.25);
  border-radius: 8px;
  display: flex;
  align-items: center;
  overflow: hidden;
  position: relative;
  margin-top: 16px;
  mask-image: linear-gradient(to right, transparent, black 4%, black 96%, transparent);
}

.marquee-tag {
  background: rgba(34, 211, 238, 0.15);
  color: #22d3ee;
  font-size: 0.68rem;
  font-weight: 800;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  letter-spacing: 0.08em;
  padding: 0 12px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 10;
  flex-shrink: 0;
  border-right: 1px solid rgba(34, 211, 238, 0.25);
}

.marquee-track {
  display: flex;
  align-items: center;
  gap: 20px;
  white-space: nowrap;
  animation: continuousMarqueeGlide 35s linear infinite;
}

.beast-marquee-wrapper:hover .marquee-track {
  animation-play-state: paused;
}

@keyframes continuousMarqueeGlide {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.marquee-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  transition: all 0.15s ease;
}

.marquee-item:hover {
  background: rgba(34, 211, 238, 0.08);
  border-color: rgba(34, 211, 238, 0.3);
}

.marquee-ticker {
  font-weight: 700;
  color: #e4e4e7;
}

.marquee-price {
  color: #ffffff;
  font-weight: 800;
}

.marquee-chg {
  font-weight: 700;
  font-size: 0.7rem;
}

/* ── Beast KPI Cards with Glow & Odometer Meters ────────────────────────────── */
.beast-kpi-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 16px;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

@media (max-width: 1200px) {
  .beast-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 640px) {
  .beast-kpi-grid {
    grid-template-columns: 1fr !important;
  }
}

.beast-kpi-card {
  position: relative;
  background: rgba(12, 14, 20, 0.8) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 12px !important;
  padding: 16px 18px !important;
  overflow: hidden;
  min-width: 0 !important;
  box-sizing: border-box !important;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.beast-kpi-card:hover {
  transform: translateY(-2px);
  border-color: rgba(34, 211, 238, 0.35) !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.7), 0 0 16px rgba(34, 211, 238, 0.1);
}

.beast-kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #22d3ee, transparent);
  opacity: 0.6;
}

.card-ambient-glow {
  position: absolute;
  top: -40px;
  right: -40px;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.kpi-mini-gauge-wrap {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  overflow: hidden;
  margin: 8px 0;
}

.kpi-mini-gauge-fill {
  height: 100%;
  background: linear-gradient(90deg, #059669, #10b981);
  border-radius: 2px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Card flash pulses on micro-tick */
.kpi-tick-up {
  animation: cardFlashUp 0.6s ease;
}

.kpi-tick-down {
  animation: cardFlashDown 0.6s ease;
}

@keyframes cardFlashUp {
  0% { box-shadow: 0 0 24px rgba(16, 185, 129, 0.5); border-color: #10b981 !important; }
  100% { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4); border-color: rgba(255, 255, 255, 0.08) !important; }
}

@keyframes cardFlashDown {
  0% { box-shadow: 0 0 24px rgba(239, 68, 68, 0.5); border-color: #ef4444 !important; }
  100% { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4); border-color: rgba(255, 255, 255, 0.08) !important; }
}

/* ── 2-Column Responsive Layout Grid ────────────────────────────────────────── */
.obs-layout-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 24px;
  align-items: start;
  width: 100%;
  max-width: 100%;
}

.obs-layout-grid > * {
  min-width: 0;
  max-width: 100%;
}

.obs-main-section, .obs-stream-card {
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 1180px) {
  .obs-layout-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* Portfolio Table Toolbar */
.portfolio-table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding: 10px 16px;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 100%;
}

.toolbar-left, .toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  max-width: 100%;
}

.btn-tool {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #d1d5db;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-tool:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-tool.primary {
  background: rgba(34, 211, 238, 0.15);
  border-color: rgba(34, 211, 238, 0.4);
  color: #22d3ee;
}

.btn-tool.primary:hover {
  background: rgba(34, 211, 238, 0.28);
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.2);
}

.btn-tool.secondary {
  color: #a1a1aa;
}

/* Table Styling */
.table-responsive {
  overflow-x: auto;
  width: 100%;
}

.obs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
}

.obs-table th {
  background: rgba(0, 0, 0, 0.4);
  color: #71717a;
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-weight: 700;
  letter-spacing: 0.05em;
  font-size: 0.7rem;
  text-transform: uppercase;
}

.obs-table td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: #e4e4e7;
  vertical-align: middle;
}

.obs-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

/* Quantity Stepper */
.qty-stepper {
  display: inline-flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.qty-btn {
  background: transparent;
  border: none;
  color: #a1a1aa;
  padding: 2px 8px;
  cursor: pointer;
  font-weight: 700;
  transition: all 0.1s;
}

.qty-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.qty-val {
  padding: 2px 8px;
  color: #fff;
  font-weight: 600;
  min-width: 48px;
  text-align: center;
}

/* Weight progress bar */
.weight-bar-wrap {
  width: 100%;
  max-width: 90px;
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 4px;
}

.weight-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #22d3ee);
  border-radius: 3px;
}

/* News Stream Shelf */
.news-stream-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 4px;
}

.news-card-cinematic {
  background: rgba(18, 18, 24, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.news-card-cinematic:hover {
  border-color: rgba(34, 211, 238, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

.news-card-cinematic.bullish { border-left: 3px solid #10b981; }
.news-card-cinematic.bearish { border-left: 3px solid #ef4444; }
.news-card-cinematic.neutral { border-left: 3px solid #38bdf8; }

.news-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.news-title-text {
  font-size: 0.85rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.35;
}

.news-summary-text {
  font-size: 0.75rem;
  color: #a1a1aa;
  line-height: 1.4;
}

.news-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.68rem;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  color: #71717a;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding-top: 6px;
}

.btn-inject-view {
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.25);
  color: #22d3ee;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-inject-view:hover {
  background: rgba(34, 211, 238, 0.25);
  color: #fff;
}

/* Macro Simulator Hub */
.macro-simulator-hub {
  background: rgba(10, 12, 18, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px 20px;
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sim-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 8px;
}

.sim-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: #22d3ee;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sim-desc { font-size: 0.72rem; color: #71717a; }

.sim-slider-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.sim-slider-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sim-slider-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
}

.sim-slider-label { color: #a1a1aa; font-weight: 600; }
.sim-slider-val { color: #ffffff; font-weight: 700; }

.obs-range {
  width: 100%;
  accent-color: #22d3ee;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.1);
  height: 4px;
  border-radius: 2px;
}

.sim-slider-impact {
  font-size: 0.68rem;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  color: #22d3ee;
  text-align: right;
}

/* Optimizer Sandbox Model Cards */
.model-select-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.model-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 12px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.model-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(34, 211, 238, 0.3);
}

.model-card.active {
  background: rgba(34, 211, 238, 0.12);
  border-color: #22d3ee;
  box-shadow: 0 0 16px rgba(34, 211, 238, 0.15);
}

.model-card-badge {
  font-size: 0.62rem;
  font-weight: 800;
  color: #22d3ee;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  letter-spacing: 0.06em;
}

.model-card-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.model-card-desc {
  font-size: 0.68rem;
  color: #a1a1aa;
  line-height: 1.35;
}

/* Optimizer Parameter Sliders */
.opt-params-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  background: rgba(0, 0, 0, 0.3);
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 12px;
}

.opt-param-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.param-top {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
}

.param-label { color: #a1a1aa; }
.param-val { color: #22d3ee; font-weight: 700; }

.btn-execute-opt {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 50%, #0284c7 100%);
  border: 1px solid rgba(34, 211, 238, 0.4);
  color: #ffffff;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.3);
}

.btn-execute-opt:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 50%, #0369a1 100%);
  box-shadow: 0 0 24px rgba(34, 211, 238, 0.4);
  transform: translateY(-1px);
}

.opt-metrics-strip {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 10px 16px;
  border-radius: 8px;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 0.78rem;
}

/* 1-Click Rebalance Blotter */
.btn-rebalance-dispatch {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  border: 1px solid rgba(52, 211, 153, 0.5);
  color: #ffffff;
  padding: 7px 16px;
  border-radius: 6px;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.25);
}

.btn-rebalance-dispatch:hover {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

.rebalance-telemetry-banner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  background: rgba(0, 0, 0, 0.4);
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.reb-stat-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
}

.reb-stat-lbl { font-size: 0.68rem; color: #71717a; }
.reb-stat-num { font-size: 0.88rem; color: #ffffff; }

/* Institutional Memorandum Display */
.memo-wrapper {
  background: #090d16;
  border-radius: 10px;
  padding: 24px 30px;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 0.82rem;
  line-height: 1.6;
  color: #e4e4e7;
  max-height: 520px;
  overflow-y: auto;
}

.memo-wrapper h1, .memo-wrapper h2, .memo-wrapper h3 {
  color: #ffffff;
  margin: 18px 0 10px 0;
  font-family: 'Inter', sans-serif;
}

.memo-wrapper hr {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin: 16px 0;
}

.memo-wrapper table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
}

.memo-wrapper th {
  background: rgba(255, 255, 255, 0.04);
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  text-align: left;
}

.memo-wrapper td {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

/* Slide-Over Drawer Overlays */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 25000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.drawer-overlay.active { opacity: 1; pointer-events: auto; }

.drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 540px;
  height: 100%;
  background: #090d16;
  border-left: 1px solid rgba(34, 211, 238, 0.25);
  box-shadow: -16px 0 48px rgba(0, 0, 0, 0.8);
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.drawer-overlay.active .drawer-panel { transform: translateX(0); }

.drawer-header {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.drawer-symbol {
  font-size: 1.5rem;
  font-weight: 800;
  color: #ffffff;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  margin: 4px 0 2px 0;
}

.drawer-company { font-size: 0.8rem; color: #a1a1aa; }

.drawer-close-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #a1a1aa;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.drawer-close-btn:hover { color: #fff; background: rgba(255, 255, 255, 0.12); }

.drawer-content {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.drawer-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #22d3ee;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.drawer-kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.drawer-kpi-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
}

.drawer-kpi-label { font-size: 0.65rem; color: #71717a; font-family: var(--font-mono, 'JetBrains Mono', monospace); }
.drawer-kpi-value { font-size: 1.15rem; font-weight: 800; color: #fff; font-family: var(--font-mono, 'JetBrains Mono', monospace); }
.drawer-kpi-sub { font-size: 0.68rem; font-family: var(--font-mono, 'JetBrains Mono', monospace); }

.drawer-math-box {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 14px;
  font-size: 0.85rem;
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 30000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active { display: flex; }

.modal-panel {
  background: #090d16;
  border: 1px solid rgba(34, 211, 238, 0.3);
  border-radius: 14px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.9);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 90vh;
  overflow-y: auto;
  box-sizing: border-box;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 12px;
}

.modal-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
}

.modal-search-box {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 10px 14px;
  color: #fff;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 0.85rem;
  outline: none;
}

.modal-search-box:focus { border-color: #22d3ee; }

.modal-quick-picks {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.chip-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #22d3ee;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  cursor: pointer;
  transition: all 0.15s;
}

.chip-btn:hover { background: rgba(34, 211, 238, 0.2); color: #fff; }

.modal-inputs-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.modal-num-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 8px 10px;
  color: #fff;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 0.85rem;
  margin-top: 4px;
}

/* ═══════════════════════ MACRO CATALYST COUNTDOWN RIBBON ═══════════════════════ */
.macro-countdown-ribbon {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(10, 15, 29, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 8px 12px;
  margin-top: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.macro-ribbon-tag {
  position: sticky;
  left: 0;
  background: rgba(10, 15, 29, 0.98);
  backdrop-filter: blur(8px);
  z-index: 5;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-weight: 800;
  color: #f59e0b;
  white-space: nowrap;
  letter-spacing: 0.05em;
  padding-right: 14px;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.macro-events-track {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: max-content;
}

.macro-event-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  padding: 6px 12px;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.macro-event-item:hover {
  background: rgba(34, 211, 238, 0.06);
  border-color: rgba(34, 211, 238, 0.25);
}

.macro-event-name {
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
}

.macro-countdown-pill {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(34, 211, 238, 0.12);
  color: #22d3ee;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid rgba(34, 211, 238, 0.25);
}

.macro-risk-pill {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.risk-high { background: rgba(244, 63, 94, 0.2); color: #f43f5e; border: 1px solid rgba(244, 63, 94, 0.4); }
.risk-med { background: rgba(245, 158, 11, 0.2); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.4); }
.risk-low { background: rgba(16, 185, 129, 0.2); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.4); }

/* ═══════════════════════ TRADE JOURNAL CALENDAR HEATMAP ═══════════════════════ */
.journal-modal-panel {
  max-width: 960px !important;
  width: 95vw;
}

.journal-kpi-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.journal-kpi-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px 14px;
}

.journal-kpi-lbl {
  font-size: 0.68rem;
  color: var(--text-muted, #71717a);
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  text-transform: uppercase;
}

.journal-kpi-val {
  font-size: 1.15rem;
  font-weight: 800;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  color: #fff;
  margin-top: 4px;
}

.calendar-heatmap-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}

.calendar-header-day {
  font-size: 0.7rem;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  color: var(--text-muted, #71717a);
  text-align: center;
  font-weight: 700;
  padding: 4px 0;
}

.cal-day-cell {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 8px 6px;
  min-height: 54px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.15s ease;
}

.cal-day-cell:hover {
  border-color: #22d3ee;
  transform: translateY(-1px);
  background: rgba(34, 211, 238, 0.05);
}

.cal-day-cell.selected {
  border-color: #22d3ee;
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.3);
  background: rgba(34, 211, 238, 0.08);
}

.cal-day-num {
  font-size: 0.72rem;
  font-weight: 700;
  color: #94a3b8;
}

.cal-day-pnl {
  font-size: 0.7rem;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-weight: 700;
}

.pnl-pos { color: #10b981; }
.pnl-neg { color: #f43f5e; }
.pnl-zero { color: #64748b; }

.cal-day-cell.pos-day {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.25);
}

.cal-day-cell.neg-day {
  background: rgba(244, 63, 94, 0.08);
  border-color: rgba(244, 63, 94, 0.25);
}

.day-trades-list {
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
}

/* ═══════════════════════ TAX-LOSS HARVESTING MODAL ═══════════════════════ */
.tax-harvest-banner {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  background: rgba(16, 185, 129, 0.05);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 16px;
}

.tax-banner-stat {
  display: flex;
  flex-direction: column;
}

.tax-banner-lbl {
  font-size: 0.68rem;
  color: #94a3b8;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
}

.tax-banner-val {
  font-size: 1.25rem;
  font-weight: 800;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  color: #10b981;
  margin-top: 4px;
}

/* ═══════════════════════ PRICE & ANOMALY ALERTS ═══════════════════════ */
.alert-input-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1.5fr auto;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 12px;
  border-radius: 8px;
}

.alert-toast-container {
  position: fixed;
  top: 70px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.alert-toast {
  pointer-events: auto;
  background: rgba(10, 15, 30, 0.96);
  border: 1px solid #22d3ee;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7), 0 0 16px rgba(34, 211, 238, 0.3);
  border-radius: 8px;
  padding: 12px 16px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 320px;
  max-width: 440px;
  animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(8px);
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.alert-toast.warning {
  border-color: #f59e0b;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7), 0 0 16px rgba(245, 158, 11, 0.3);
}

.alert-toast-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
}

.alert-toast-desc {
  font-size: 0.72rem;
  color: #cbd5e1;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
}

/* ═══════════════════════ 6x6 CORRELATION MATRIX & DIVIDEND PROJECTOR ═══════════════════════ */
.corr-matrix-wrapper {
  overflow-x: auto;
}

.corr-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 0.75rem;
}

.corr-table th, .corr-table td {
  padding: 8px 10px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.corr-table th {
  background: rgba(255, 255, 255, 0.03);
  color: #94a3b8;
  font-weight: 700;
}

.corr-cell {
  font-weight: 700;
  border-radius: 3px;
  transition: transform 0.1s;
}

.corr-cell:hover {
  transform: scale(1.08);
  outline: 1px solid #22d3ee;
}

.corr-legend-bar {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.7rem;
  color: #94a3b8;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.legend-box {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 4px;
  vertical-align: middle;
}

.corr-neg { background: #f43f5e; }
.corr-zero { background: #334155; }
.corr-pos { background: #059669; }
.corr-high { background: #eab308; }

.dividend-stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.div-stat-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px;
}

.div-stat-lbl {
  font-size: 0.68rem;
  color: var(--text-muted, #71717a);
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  text-transform: uppercase;
}

.div-stat-val {
  font-size: 1.15rem;
  font-weight: 800;
  color: #a78bfa;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  margin-top: 4px;
}

/* OCO Bracket Controls */
.oco-bracket-wrap {
  display: flex;
  gap: 6px;
  align-items: center;
}

.oco-input {
  width: 70px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  padding: 4px 6px;
  color: #fff;
  font-size: 0.72rem;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
}

/* ═══════════════════════ MID-LEVEL FEATURES CSS EXTENSION ═══════════════════════ */

/* 1. Quantitative Factor Radar & Barra Style Decomposition */
.factor-radar-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 20px;
  align-items: center;
}

@media (max-width: 900px) {
  .factor-radar-grid {
    grid-template-columns: 1fr;
  }
}

.factor-metrics-panel {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

@media (max-width: 650px) {
  .factor-metrics-panel {
    grid-template-columns: repeat(2, 1fr);
  }
}

.factor-metric-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
}

.factor-metric-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.68rem;
  color: #94a3b8;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
}

.factor-metric-val {
  font-size: 1.1rem;
  font-weight: 800;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  margin: 4px 0 2px 0;
}

.factor-metric-desc {
  font-size: 0.65rem;
  color: #64748b;
  line-height: 1.3;
}

/* 2. Drift Band Badges in Holdings Table */
.badge-drift-normal {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge-drift-warn {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.35);
  animation: pulse-warn 1.8s infinite ease-in-out;
}

@keyframes pulse-warn {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* 3. Crisis Stress-Testing Studio */
.stress-presets-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

@media (max-width: 800px) {
  .stress-presets-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.stress-preset-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  text-align: left;
  transition: all 0.15s;
}

.stress-preset-btn:hover {
  background: rgba(244, 63, 94, 0.08);
  border-color: rgba(244, 63, 94, 0.3);
}

.stress-preset-btn.active {
  background: rgba(244, 63, 94, 0.15);
  border-color: #f43f5e;
  box-shadow: 0 0 16px rgba(244, 63, 94, 0.2);
}

.stress-preset-btn .preset-name {
  font-size: 0.78rem;
  font-weight: 800;
  color: #fff;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
}

.stress-preset-btn .preset-tag {
  font-size: 0.62rem;
  color: #94a3b8;
  margin-top: 3px;
  line-height: 1.2;
}

.stress-slider-wrap {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 14px;
}

.stress-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

@media (max-width: 700px) {
  .stress-kpi-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

.stress-kpi-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
}

.stress-kpi-lbl {
  font-size: 0.65rem;
  color: #94a3b8;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  text-transform: uppercase;
}

.stress-kpi-val {
  font-size: 1.2rem;
  font-weight: 800;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  margin-top: 4px;
}

/* 4. Options Greeks & Payoff Studio */
.options-controls-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 14px;
}

@media (max-width: 750px) {
  .options-controls-grid {
    grid-template-columns: 1fr;
  }
}

.greeks-stat-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

@media (max-width: 800px) {
  .greeks-stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.greek-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 8px 10px;
  text-align: center;
}

.greek-lbl {
  font-size: 0.65rem;
  color: #94a3b8;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
}

.greek-val {
  font-size: 1.05rem;
  font-weight: 800;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  margin-top: 3px;
  color: #fff;
}

/* 5. Smart-DCA Autopilot */
.dca-config-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 12px;
}

@media (max-width: 750px) {
  .dca-config-grid {
    grid-template-columns: 1fr;
  }
}

/* 6. Smart Order Routing (SOR) */
.sor-telemetry-banner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  background: rgba(167, 139, 250, 0.05);
  border: 1px solid rgba(167, 139, 250, 0.2);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 12px;
}

@media (max-width: 700px) {
  .sor-telemetry-banner {
    grid-template-columns: 1fr;
  }
}

.sor-stat-box {
  display: flex;
  flex-direction: column;
}

.sor-stat-lbl {
  font-size: 0.65rem;
  color: #94a3b8;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
}

.sor-stat-val {
  font-size: 1.05rem;
  font-weight: 800;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  margin-top: 3px;
}

/* 7. Wealth Survival Engine */
.survival-input-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 14px;
}

@media (max-width: 750px) {
  .survival-input-grid {
    grid-template-columns: 1fr;
  }
}

.survival-summary-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

@media (max-width: 700px) {
  .survival-summary-bar {
    grid-template-columns: repeat(2, 1fr);
  }
}

.survival-kpi-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
}

.survival-kpi-lbl {
  font-size: 0.65rem;
  color: #94a3b8;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
}

.survival-kpi-val {
  font-size: 1.15rem;
  font-weight: 800;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  margin-top: 3px;
}


/* ── Institutional Front-Office Workbench Strip ───────────────────────────── */
.institutional-workbench-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.65);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.institutional-strip-label {
  font-size: 0.72rem;
  font-weight: 800;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  color: #94a3b8;
  margin-right: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.5px;
}

.btn-tool-inst {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  font-size: 0.74rem;
  font-weight: 700;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  color: #e2e8f0;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-tool-inst:hover {
  background: rgba(51, 65, 85, 0.9);
  border-color: rgba(34, 211, 238, 0.4);
  color: #38bdf8;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.text-yellow { color: #facc15 !important; }
.text-rose { color: #f43f5e !important; }
.text-amber { color: #f59e0b !important; }
.text-emerald { color: #10b981 !important; }
.text-sky { color: #38bdf8 !important; }
.text-indigo { color: #818cf8 !important; }
