/* ==========================================================================
   TERMINAL 9000 // GLOBAL MARKET INTELLIGENCE CANVAS
   Aesthetic: Bloomberg Terminal / Cyberpunk Telemetry / High-Density Grid
   Zero External Dependencies - 100% Offline Compatible
   ========================================================================== */

:root {
  /* Color Palette - Bloomberg Amber Theme (Default) */
  --bg-core: #05070a;
  --bg-panel: #0a0e17;
  --bg-panel-header: #0f1624;
  --bg-panel-hover: #141d2f;
  --bg-widget-card: #080c14;
  
  --border-subtle: #1a2333;
  --border-active: #2b3952;
  --border-glow: rgba(255, 158, 11, 0.4);
  
  --primary: #ff9e0b;
  --primary-glow: rgba(255, 158, 11, 0.25);
  --primary-dim: #9a6007;
  
  --accent-cyan: #00f0ff;
  --accent-cyan-glow: rgba(0, 240, 255, 0.25);
  
  --bull: #00ff88;
  --bull-dim: #008746;
  --bull-glow: rgba(0, 255, 136, 0.25);
  
  --bear: #ff3366;
  --bear-dim: #941734;
  --bear-glow: rgba(255, 51, 102, 0.25);
  
  --text-main: #e2e8f0;
  --text-muted: #64748b;
  --text-dim: #475569;
  --text-bright: #ffffff;
  
  /* Font Stacks */
  --font-mono: "JetBrains Mono", "Fira Code", "SF Mono", "Cascadia Code", "Consolas", "Courier New", monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  
  /* Layout Dimensions */
  --header-height: 46px;
  --ticker-height: 32px;
  --cli-height: 36px;
  --grid-gap: 12px;
  
  /* CRT scanlines */
  --scanline-opacity: 0.15;
}

/* Theme: Matrix Emerald */
body.theme-green {
  --primary: #00ff66;
  --primary-glow: rgba(0, 255, 102, 0.25);
  --primary-dim: #058537;
  --border-glow: rgba(0, 255, 102, 0.4);
}

/* Theme: Cyber Cyan */
body.theme-cyan {
  --primary: #00f0ff;
  --primary-glow: rgba(0, 240, 255, 0.25);
  --primary-dim: #027a82;
  --border-glow: rgba(0, 240, 255, 0.4);
}

/* Theme: Ice Monochrome */
body.theme-ice {
  --primary: #e2e8f0;
  --primary-glow: rgba(226, 232, 240, 0.25);
  --primary-dim: #64748b;
  --border-glow: rgba(226, 232, 240, 0.3);
}

/* ==========================================================================
   Base & Reset
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-core);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

/* CRT Scanline & Glow Overlay */
.crt-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
  background: linear-gradient(
    rgba(18, 16, 16, 0) 50%, 
    rgba(0, 0, 0, 0.25) 50%
  ), linear-gradient(
    90deg,
    rgba(255, 0, 0, 0.03),
    rgba(0, 255, 0, 0.01),
    rgba(0, 0, 255, 0.03)
  );
  background-size: 100% 3px, 4px 100%;
  opacity: var(--scanline-opacity);
  transition: opacity 0.3s ease;
}

body.no-crt .crt-overlay {
  display: none;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-core);
}
::-webkit-scrollbar-thumb {
  background: var(--border-active);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* ==========================================================================
   Main Shell Layout
   ========================================================================== */
#app-shell {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  background-color: var(--bg-core);
  position: relative;
}

/* ==========================================================================
   Header Bar (Bloomberg Top Telemetry)
   ========================================================================== */
.terminal-header {
  height: var(--header-height);
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
  flex-shrink: 0;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  font-weight: 900;
  font-size: 15px;
  letter-spacing: 2px;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
  text-shadow: 0 0 10px var(--primary-glow);
}

.brand-logo .pulse-node {
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: var(--primary);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--primary);
  animation: pulse-dot 2s infinite ease-in-out;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(0.7); }
}

.system-status-pill {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 3px;
  background: rgba(0, 255, 136, 0.1);
  color: var(--bull);
  border: 1px solid rgba(0, 255, 136, 0.3);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 5px;
}

.system-status-pill.offline {
  background: rgba(255, 51, 102, 0.1);
  color: var(--bear);
  border-color: rgba(255, 51, 102, 0.3);
}

.header-center-telemetry {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 11px;
}

.telemetry-item {
  display: flex;
  gap: 6px;
  color: var(--text-muted);
}

.telemetry-item span.val {
  color: var(--text-bright);
  font-weight: 600;
}

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

.terminal-btn {
  background: var(--bg-widget-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 5px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  border-radius: 3px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.terminal-btn:hover {
  background: var(--bg-panel-hover);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 0 8px var(--primary-glow);
}

.terminal-btn.active {
  background: var(--primary);
  color: #000000;
  border-color: var(--primary);
  font-weight: 700;
  box-shadow: 0 0 10px var(--primary-glow);
}

.terminal-btn-icon {
  padding: 5px 8px;
}

.theme-selector {
  display: flex;
  gap: 4px;
  background: var(--bg-widget-card);
  padding: 3px;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
}

.theme-swatch {
  width: 14px;
  height: 14px;
  border-radius: 2px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.15s;
}

.theme-swatch:hover {
  transform: scale(1.2);
}

.theme-swatch.active {
  border-color: #ffffff;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
}

.theme-swatch.amber { background: #ff9e0b; }
.theme-swatch.green { background: #00ff66; }
.theme-swatch.cyan  { background: #00f0ff; }
.theme-swatch.ice   { background: #e2e8f0; }

/* ==========================================================================
   Ticker Tape (Continuous Scrolling Ticker)
   ========================================================================== */
.ticker-bar {
  height: var(--ticker-height);
  background: #070a10;
  border-bottom: 1px solid var(--border-subtle);
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.ticker-track {
  display: flex;
  white-space: nowrap;
  animation: ticker-slide 45s linear infinite;
  gap: 24px;
  padding-left: 20px;
}

.ticker-bar:hover .ticker-track {
  animation-play-state: paused;
}

@keyframes ticker-slide {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  cursor: pointer;
}

.ticker-item:hover {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.05);
}

.ticker-item .sym {
  font-weight: 700;
  color: var(--text-bright);
}

.ticker-item .price {
  color: var(--text-main);
}

.ticker-item .change {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 2px;
}

.up {
  color: var(--bull) !important;
}

.down {
  color: var(--bear) !important;
}

.neutral {
  color: var(--text-muted) !important;
}

/* ==========================================================================
   Dashboard Canvas & Modular Grid System
   ========================================================================== */
.canvas-wrapper {
  flex: 1;
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--grid-gap);
  background: 
    radial-gradient(circle at 50% 50%, rgba(15, 23, 42, 0.4) 0%, rgba(5, 7, 10, 0.95) 100%),
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 100% 100%, 20px 20px, 20px 20px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: 95px;
  gap: var(--grid-gap);
  width: 100%;
  min-height: 100%;
  position: relative;
}

/* Grid Cell Sizes */
.col-12 { grid-column: span 12; }
.col-10 { grid-column: span 10; }
.col-9  { grid-column: span 9; }
.col-8  { grid-column: span 8; }
.col-7  { grid-column: span 7; }
.col-6  { grid-column: span 6; }
.col-5  { grid-column: span 5; }
.col-4  { grid-column: span 4; }
.col-3  { grid-column: span 3; }
.col-2  { grid-column: span 2; }

.row-1 { grid-row: span 1; }
.row-2 { grid-row: span 2; }
.row-3 { grid-row: span 3; }
.row-4 { grid-row: span 4; }
.row-5 { grid-row: span 5; }
.row-6 { grid-row: span 6; }
.row-7 { grid-row: span 7; }
.row-8 { grid-row: span 8; }

/* Responsive break-downs */
@media (max-width: 1400px) {
  .col-4 { grid-column: span 6; }
  .col-8 { grid-column: span 12; }
  .col-3 { grid-column: span 6; }
}

@media (max-width: 992px) {
  .col-6, .col-5, .col-7, .col-4, .col-3 { grid-column: span 12; }
}

/* ==========================================================================
   Widget Container & Chrome
   ========================================================================== */
.widget {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  transition: border-color 0.2s, box-shadow 0.2s;
  overflow: hidden;
  min-height: 180px;
}

.widget:hover {
  border-color: var(--border-active);
}

.widget.dragging {
  opacity: 0.5;
  border: 2px dashed var(--primary);
  transform: scale(0.99);
  box-shadow: 0 0 25px var(--primary-glow);
  z-index: 1000;
}

.widget.drag-over {
  border: 2px solid var(--accent-cyan);
  box-shadow: 0 0 15px var(--accent-cyan-glow);
}

.widget.maximized {
  position: fixed !important;
  top: calc(var(--header-height) + var(--ticker-height) + 10px) !important;
  left: 10px !important;
  right: 10px !important;
  bottom: calc(var(--cli-height) + 10px) !important;
  z-index: 2000 !important;
  width: auto !important;
  height: auto !important;
  grid-column: span 12 !important;
  grid-row: span 12 !important;
}

/* Widget Header */
.widget-header {
  height: 34px;
  background: var(--bg-panel-header);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: grab;
  flex-shrink: 0;
}

.widget-header:active {
  cursor: grabbing;
}

.widget-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.widget-drag-handle {
  color: var(--text-dim);
  cursor: grab;
  font-size: 11px;
}

.widget-drag-handle:hover {
  color: var(--primary);
}

.widget-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-bright);
  text-transform: uppercase;
}

.widget-tag {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 2px;
  background: rgba(255, 158, 11, 0.15);
  color: var(--primary);
  border: 1px solid rgba(255, 158, 11, 0.3);
}

.widget-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.widget-action-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 3px 5px;
  border-radius: 2px;
  font-size: 11px;
  font-family: var(--font-mono);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.1s;
}

.widget-action-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-bright);
}

.widget-action-btn.btn-close:hover {
  color: var(--bear);
  background: rgba(255, 51, 102, 0.15);
}

/* Widget Content Area */
.widget-body {
  flex: 1;
  overflow: auto;
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 10px;
  background: var(--bg-panel);
}

/* Resize Grip Handles */
.widget-resizer {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 14px;
  height: 14px;
  cursor: nwse-resize;
  z-index: 10;
  background: linear-gradient(135deg, transparent 50%, var(--border-active) 50%, var(--border-active) 65%, transparent 65%, transparent 80%, var(--border-active) 80%);
}

.widget-resizer:hover {
  background: linear-gradient(135deg, transparent 50%, var(--primary) 50%, var(--primary) 65%, transparent 65%, transparent 80%, var(--primary) 80%);
}

/* ==========================================================================
   Widget 1: Global Indices Overview & Sparklines
   ========================================================================== */
.indices-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.indices-table th {
  text-align: left;
  padding: 6px 8px;
  color: var(--text-muted);
  font-size: 9px;
  letter-spacing: 0.8px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.01);
}

.indices-table td {
  padding: 7px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.indices-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.index-name-cell {
  display: flex;
  flex-direction: column;
}

.index-name-cell .symbol {
  font-weight: 700;
  color: var(--text-bright);
}

.index-name-cell .region {
  font-size: 9px;
  color: var(--text-muted);
}

.sparkline-canvas {
  width: 80px;
  height: 24px;
  display: block;
}

.range-bar-container {
  width: 90px;
  height: 6px;
  background: var(--border-subtle);
  border-radius: 3px;
  position: relative;
  overflow: hidden;
}

.range-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
}

/* ==========================================================================
   Widget 2: AI, Energy & Financials Sector Heatmap
   ========================================================================== */
.heatmap-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 8px;
  flex-wrap: wrap;
}

.heatmap-sector-tabs {
  display: flex;
  gap: 4px;
}

.heatmap-tab-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 2px;
  cursor: pointer;
  font-family: var(--font-mono);
}

.heatmap-tab-btn.active, .heatmap-tab-btn:hover {
  background: var(--bg-panel-hover);
  border-color: var(--primary);
  color: var(--primary);
}

.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 6px;
  flex: 1;
  align-content: start;
}

.heatmap-card {
  border-radius: 3px;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 72px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.heatmap-card:hover {
  transform: translateY(-2px);
  z-index: 5;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
  border-color: #ffffff;
}

.heatmap-card .top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.heatmap-card .sym {
  font-weight: 800;
  font-size: 12px;
  color: #ffffff;
}

.heatmap-card .sec-tag {
  font-size: 8px;
  opacity: 0.8;
  color: #ffffff;
}

.heatmap-card .price {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.9);
}

.heatmap-card .change {
  font-size: 13px;
  font-weight: 800;
  text-align: right;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

/* Color scaling for Heatmap */
.heat-bull-5 { background: linear-gradient(135deg, #008746, #00ff88); color: #000; }
.heat-bull-4 { background: #007a3e; }
.heat-bull-3 { background: #006332; }
.heat-bull-2 { background: #004d27; }
.heat-bull-1 { background: #00361c; }
.heat-flat   { background: #1e293b; }
.heat-bear-1 { background: #3d0d17; }
.heat-bear-2 { background: #5c1423; }
.heat-bear-3 { background: #7a1b2f; }
.heat-bear-4 { background: #9c223c; }
.heat-bear-5 { background: linear-gradient(135deg, #a81938, #ff3366); }

/* ==========================================================================
   Widget 3: AAPL 60-Session Technical Interactive Chart Engine
   ========================================================================== */
.chart-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  flex-wrap: wrap;
  gap: 8px;
}

.chart-symbol-badge {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.chart-symbol-badge .sym-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--primary);
}

.chart-symbol-badge .sym-sub {
  font-size: 10px;
  color: var(--text-muted);
}

.chart-symbol-badge .live-price {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-bright);
}

.chart-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.chart-canvas-container {
  flex: 1;
  position: relative;
  width: 100%;
  min-height: 240px;
  background: #070a0f;
  border: 1px solid var(--border-subtle);
  border-radius: 3px;
  overflow: hidden;
}

.chart-canvas-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.chart-hud-overlay {
  position: absolute;
  top: 8px;
  left: 12px;
  pointer-events: none;
  font-size: 10px;
  display: flex;
  gap: 12px;
  background: rgba(10, 14, 23, 0.85);
  padding: 4px 8px;
  border-radius: 2px;
  border: 1px solid var(--border-subtle);
  z-index: 5;
}

.chart-hud-item span.label {
  color: var(--text-muted);
  margin-right: 4px;
}

.chart-hud-item span.val {
  color: var(--text-bright);
  font-weight: 600;
}

.indicator-toggles {
  display: flex;
  gap: 4px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.indicator-btn {
  font-size: 9px;
  padding: 2px 6px;
  background: var(--bg-widget-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  border-radius: 2px;
  cursor: pointer;
  font-family: var(--font-mono);
}

.indicator-btn.active {
  background: rgba(255, 158, 11, 0.15);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 700;
}

/* ==========================================================================
   Widget 4: Precious Metals & Global Commodities
   ========================================================================== */
.metals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
}

.metal-card {
  background: var(--bg-widget-card);
  border: 1px solid var(--border-subtle);
  border-radius: 3px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.15s;
}

.metal-card:hover {
  border-color: var(--primary);
}

.metal-card .name-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.metal-card .metal-name {
  font-weight: 700;
  font-size: 11px;
  color: var(--text-bright);
}

.metal-card .metal-code {
  font-size: 9px;
  color: var(--text-muted);
}

.metal-card .price-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.metal-card .metal-price {
  font-size: 13px;
  font-weight: 800;
}

.metal-card .spread-row {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: var(--text-dim);
  border-top: 1px dashed rgba(255, 255, 255, 0.05);
  padding-top: 3px;
  margin-top: 2px;
}

/* ==========================================================================
   Widget 5: World Session Clocks & Timeline
   ========================================================================== */
.clocks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.clock-card {
  background: var(--bg-widget-card);
  border: 1px solid var(--border-subtle);
  border-radius: 3px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  position: relative;
}

.clock-card.active-session {
  border-color: var(--bull);
  box-shadow: 0 0 10px rgba(0, 255, 136, 0.15);
}

.clock-card .city-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-bright);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.session-badge {
  font-size: 8px;
  padding: 1px 4px;
  border-radius: 2px;
  font-weight: 700;
}

.session-badge.open {
  background: rgba(0, 255, 136, 0.15);
  color: var(--bull);
  border: 1px solid rgba(0, 255, 136, 0.4);
}

.session-badge.closed {
  background: rgba(100, 116, 139, 0.15);
  color: var(--text-muted);
  border: 1px solid rgba(100, 116, 139, 0.3);
}

.session-badge.pre {
  background: rgba(255, 158, 11, 0.15);
  color: var(--primary);
  border: 1px solid rgba(255, 158, 11, 0.4);
}

.clock-card .time-display {
  font-size: 16px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 1px;
}

.clock-card .tz-info {
  font-size: 8px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

/* 24-Hour Market Timeline Overlap */
.timeline-section {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-subtle);
  border-radius: 3px;
  padding: 8px;
}

.timeline-title {
  font-size: 9px;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
}

.session-timeline-bar {
  height: 24px;
  position: relative;
  background: #040608;
  border-radius: 2px;
  display: flex;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.session-block {
  position: absolute;
  top: 2px;
  bottom: 2px;
  border-radius: 2px;
  font-size: 8px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.75;
  transition: opacity 0.2s;
}

.session-block:hover {
  opacity: 1;
}

.session-block.ny  { background: #3a86ff; color: #fff; }
.session-block.lon { background: #8338ec; color: #fff; }
.session-block.tok { background: #ff006e; color: #fff; }
.session-block.syd { background: #fb5607; color: #fff; }

.timeline-current-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #ffffff;
  box-shadow: 0 0 6px #ffffff;
  z-index: 10;
}

/* ==========================================================================
   Widget 6: Market Depth / Order Book Visualizer
   ========================================================================== */
.orderbook-container {
  display: flex;
  gap: 8px;
  flex: 1;
}

.order-column {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.order-col-header {
  font-size: 9px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 3px;
  margin-bottom: 4px;
}

.order-row {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  padding: 2px 4px;
  position: relative;
  margin-bottom: 1px;
}

.order-row .depth-bg {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  opacity: 0.15;
  pointer-events: none;
}

.order-row.bid .depth-bg {
  background: var(--bull);
}

.order-row.ask .depth-bg {
  background: var(--bear);
}

/* ==========================================================================
   Widget 7: News Wire & Breaking Telemetry
   ========================================================================== */
.news-feed {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.news-item {
  padding: 6px 8px;
  background: var(--bg-widget-card);
  border: 1px solid var(--border-subtle);
  border-radius: 3px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.news-item:hover {
  border-color: var(--border-active);
}

.news-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 9px;
}

.news-tag {
  padding: 1px 4px;
  border-radius: 2px;
  font-size: 8px;
  font-weight: 700;
}

.news-tag.breaking {
  background: rgba(255, 51, 102, 0.2);
  color: var(--bear);
  border: 1px solid var(--bear);
}

.news-tag.bullish {
  background: rgba(0, 255, 136, 0.2);
  color: var(--bull);
}

.news-tag.macro {
  background: rgba(0, 240, 255, 0.2);
  color: var(--accent-cyan);
}

.news-headline {
  font-size: 11px;
  color: var(--text-bright);
  font-weight: 600;
  line-height: 1.3;
}

/* ==========================================================================
   Command Line Interface Bar (CLI)
   ========================================================================== */
.terminal-cli-bar {
  height: var(--cli-height);
  background: #030406;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 8px;
  z-index: 100;
  flex-shrink: 0;
}

.cli-prompt {
  color: var(--primary);
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.cli-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 12px;
  outline: none;
}

.cli-input::placeholder {
  color: var(--text-dim);
}

.cli-status-feedback {
  font-size: 10px;
  color: var(--text-muted);
}

.cli-quick-hints {
  display: flex;
  gap: 6px;
}

.hint-pill {
  font-size: 9px;
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 6px;
  border-radius: 2px;
  color: var(--text-muted);
  cursor: pointer;
}

.hint-pill:hover {
  background: var(--bg-panel-hover);
  color: var(--primary);
}

/* ==========================================================================
   Modals & Popovers
   ========================================================================== */
.terminal-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 5000;
  display: none;
  align-items: center;
  justify-content: center;
}

.terminal-modal-backdrop.show {
  display: flex;
}

.terminal-modal {
  width: 90%;
  max-width: 600px;
  background: var(--bg-panel);
  border: 1px solid var(--primary);
  box-shadow: 0 0 30px var(--primary-glow);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.terminal-modal-header {
  height: 38px;
  background: var(--bg-panel-header);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.terminal-modal-title {
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
}

.terminal-modal-body {
  padding: 16px;
  max-height: 70vh;
  overflow-y: auto;
}

.modal-grid-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

.modal-option-card {
  background: var(--bg-widget-card);
  border: 1px solid var(--border-subtle);
  padding: 12px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s;
}

.modal-option-card:hover {
  border-color: var(--primary);
  background: var(--bg-panel-hover);
}

.modal-option-card .opt-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 4px;
}

.modal-option-card .opt-desc {
  font-size: 9px;
  color: var(--text-muted);
}

/* Floating Tooltip */
#floating-tooltip {
  position: fixed;
  display: none;
  background: #0b111a;
  border: 1px solid var(--primary);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.8);
  border-radius: 3px;
  padding: 8px 10px;
  font-size: 10px;
  z-index: 9000;
  pointer-events: none;
  color: #ffffff;
  max-width: 240px;
}

/* Animations */
.flash-green {
  animation: flash-green-anim 0.8s ease-out;
}

.flash-red {
  animation: flash-red-anim 0.8s ease-out;
}

@keyframes flash-green-anim {
  0% { background-color: rgba(0, 255, 136, 0.4); }
  100% { background-color: transparent; }
}

@keyframes flash-red-anim {
  0% { background-color: rgba(255, 51, 102, 0.4); }
  100% { background-color: transparent; }
}
