/* ===== Reset & Variables ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-card: #1a2236;
  --bg-hover: #1e2a42;
  --bg-elevated: #243049;
  --border: #2a3550;
  --border-light: #334466;
  --text-primary: #e8ecf4;
  --text-secondary: #8896b0;
  --text-muted: #5a6a85;
  --accent: #3b82f6;
  --accent-light: #60a5fa;
  --accent-glow: rgba(59, 130, 246, 0.15);
  --accent-glow-strong: rgba(59, 130, 246, 0.3);
  --green: #22c55e;
  --green-light: #4ade80;
  --green-bg: rgba(34, 197, 94, 0.12);
  --green-border: rgba(34, 197, 94, 0.25);
  --red: #ef4444;
  --red-light: #f87171;
  --red-bg: rgba(239, 68, 68, 0.12);
  --red-border: rgba(239, 68, 68, 0.25);
  --yellow: #f59e0b;
  --yellow-bg: rgba(245, 158, 11, 0.12);
  --yellow-border: rgba(245, 158, 11, 0.25);
  --purple: #8b5cf6;
  --purple-bg: rgba(139, 92, 246, 0.12);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.4);
  --font: 'Inter', -apple-system, sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

html { font-size: 14px; }
body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ===== Header ===== */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: rgba(17, 24, 39, 0.85);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.header-left { display: flex; align-items: center; gap: 12px; }
.logo { display: flex; align-items: center; gap: 10px; }
.logo-icon-wrap {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  box-shadow: 0 2px 12px var(--accent-glow-strong);
}
.logo-group { display: flex; flex-direction: column; }
.logo-text { font-size: 18px; font-weight: 800; letter-spacing: -0.5px; line-height: 1.1; }
.logo-tagline { font-size: 10px; color: var(--text-muted); letter-spacing: 0.5px; text-transform: uppercase; }

.header-center { flex: 0 0 auto; }

.mode-toggle {
  display: flex;
  background: var(--bg-primary);
  border-radius: 10px;
  padding: 3px;
  border: 1px solid var(--border);
  position: relative;
}

.mode-slider {
  position: absolute;
  top: 3px;
  left: 3px;
  width: calc(50% - 3px);
  height: calc(100% - 6px);
  background: var(--accent);
  border-radius: 8px;
  transition: transform var(--transition);
  box-shadow: 0 2px 8px var(--accent-glow-strong);
  z-index: 0;
}

.mode-btn {
  padding: 7px 18px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: color var(--transition);
  display: flex;
  align-items: center;
  gap: 5px;
  position: relative;
  z-index: 1;
}

.mode-btn.active { color: white; }
.mode-btn:hover:not(.active) { color: var(--text-primary); }

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

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  transition: border-color var(--transition);
}
.search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.search-icon { font-size: 13px; margin-right: 6px; }
.search-box input {
  background: none;
  border: none;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 12px;
  padding: 7px 0;
  width: 160px;
  outline: none;
}
.search-box input::placeholder { color: var(--text-muted); }

.search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  max-height: 240px;
  overflow-y: auto;
  z-index: 200;
}
.search-dropdown.hidden { display: none; }
.search-item {
  padding: 10px 12px;
  cursor: pointer;
  transition: background var(--transition);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.search-item:hover { background: var(--bg-hover); }
.search-item-name { font-weight: 600; font-size: 13px; }
.search-item-code { font-family: var(--mono); font-size: 11px; color: var(--text-muted); }

.icon-btn {
  width: 34px; height: 34px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: var(--radius-xs);
  cursor: pointer;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.icon-btn:hover { border-color: var(--accent); background: var(--bg-hover); }

/* ===== Main Content ===== */
.main-content { padding: 16px 20px; }
.hidden { display: none !important; }

/* ===== Stats Bar ===== */
.stats-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  overflow-x: auto;
  padding-bottom: 2px;
}
.stat-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  flex-shrink: 0;
}
.stat-label { font-size: 11px; color: var(--text-muted); }
.stat-value { font-size: 14px; font-weight: 700; font-family: var(--mono); }
.stat-value.accent { color: var(--accent); }
.stat-value.green { color: var(--green); }
.stat-value.red { color: var(--red); }

/* ===== Education Layout ===== */
.edu-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 16px;
  margin-bottom: 16px;
}

/* ===== Chart Section ===== */
.chart-section, .pro-chart-section {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.stock-info { display: flex; align-items: center; gap: 10px; }
.stock-badge {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
}
.stock-info h2 { font-size: 16px; font-weight: 700; }
.price { font-family: var(--mono); font-size: 16px; font-weight: 700; }
.live-price { transition: color 0.3s; }
.change {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 5px;
}
.change.positive { color: var(--green); background: var(--green-bg); }
.change.negative { color: var(--red); background: var(--red-bg); }

.live-badge {
  font-size: 11px;
  color: var(--green);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}
.live-dot {
  width: 6px; height: 6px;
  background: var(--green);
  border-radius: 50%;
  animation: livePulse 1.5s infinite;
}
@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6); }
  70% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.chart-controls { display: flex; align-items: center; gap: 8px; }
.divider { width: 1px; height: 20px; background: var(--border); }

.indicator-btns, .timeframe-btns { display: flex; gap: 3px; }
.ind-btn, .tf-btn {
  padding: 5px 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 500;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all var(--transition);
}
.ind-btn { padding: 5px 8px; font-size: 13px; }
.ind-btn.active, .tf-btn.active { background: var(--accent); color: white; border-color: var(--accent); }
.ind-btn:hover:not(.active), .tf-btn:hover:not(.active) { border-color: var(--border-light); background: var(--bg-hover); }

.chart-container { height: 380px; position: relative; }
.pro-chart { height: 420px; }

.chart-tooltip {
  position: absolute;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 12px;
  pointer-events: none;
  z-index: 50;
  box-shadow: var(--shadow-md);
  min-width: 200px;
}
.chart-tooltip.hidden { display: none; }

/* ===== Playback Bar ===== */
.playback-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
}

.ctrl-btn {
  width: 30px; height: 30px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 11px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
}
.ctrl-btn:hover { border-color: var(--accent); color: var(--text-primary); }

.play-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--accent), #6366f1);
  color: white;
  font-size: 13px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
  box-shadow: 0 2px 12px var(--accent-glow-strong);
}
.play-btn:hover { transform: scale(1.08); }

.progress-track {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  position: relative;
  overflow: visible;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  border-radius: 3px;
  transition: width 0.15s;
  position: relative;
  z-index: 1;
}
.progress-markers {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 2;
  pointer-events: none;
}
.progress-marker {
  position: absolute;
  top: -3px;
  width: 4px; height: 12px;
  border-radius: 2px;
  transform: translateX(-50%);
}
.progress-marker.pos { background: var(--green); }
.progress-marker.neg { background: var(--red); }
.progress-marker.neu { background: var(--yellow); }
.progress-slider {
  position: absolute;
  top: -10px; left: 0;
  width: 100%; height: 26px;
  opacity: 0; cursor: pointer; z-index: 3;
}

.playback-time { flex-shrink: 0; }
.pb-date { font-family: var(--mono); font-size: 11px; color: var(--text-muted); }

.speed-control { display: flex; gap: 3px; flex-shrink: 0; }
.speed-btn {
  padding: 4px 9px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition);
}
.speed-btn.active { background: var(--accent); color: white; border-color: var(--accent); }

/* ===== Timeline Section ===== */
.timeline-section {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 500px;
}

.timeline-header {
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--border);
}
.timeline-header h3 { font-size: 13px; font-weight: 700; margin-bottom: 8px; }

.filter-pills { display: flex; gap: 4px; }
.pill {
  padding: 4px 11px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 500;
  border-radius: 20px;
  cursor: pointer;
  transition: all var(--transition);
}
.pill.active { background: var(--accent); color: white; border-color: var(--accent); }
.positive-pill.active { background: var(--green); border-color: var(--green); }
.negative-pill.active { background: var(--red); border-color: var(--red); }
.neutral-pill.active { background: var(--yellow); border-color: var(--yellow); color: #000; }

.timeline-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
}

.news-item {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  border-left: 3px solid transparent;
  margin-bottom: 3px;
  position: relative;
}
.news-item:hover { background: var(--bg-hover); }
.news-item.active {
  background: var(--bg-hover);
  border-left-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent-glow);
}
.news-item.positive { border-left-color: var(--green); }
.news-item.negative { border-left-color: var(--red); }
.news-item.neutral { border-left-color: var(--yellow); }
.news-item.played { opacity: 0.6; }
.news-item.played.active { opacity: 1; }

.news-date {
  font-size: 10px;
  color: var(--text-muted);
  font-family: var(--mono);
  display: flex;
  justify-content: space-between;
}
.news-title { font-size: 12px; font-weight: 600; margin: 3px 0; line-height: 1.4; }
.news-meta { display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.news-source { font-size: 10px; color: var(--text-muted); }
.news-sentiment {
  font-size: 9px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
}
.sentiment-positive { background: var(--green-bg); color: var(--green); border: 1px solid var(--green-border); }
.sentiment-negative { background: var(--red-bg); color: var(--red); border: 1px solid var(--red-border); }
.sentiment-neutral { background: var(--yellow-bg); color: var(--yellow); border: 1px solid var(--yellow-border); }
.news-impact-badge {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  margin-left: auto;
}

/* ===== Bottom Panels ===== */
.bottom-panels {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 16px;
}

.panel {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.panel-header h3 { font-size: 13px; font-weight: 700; }
.panel-content { padding: 16px; }

.panel-tabs { display: flex; gap: 2px; }
.panel-tab {
  padding: 4px 12px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 500;
  border-radius: 5px;
  cursor: pointer;
  transition: all var(--transition);
}
.panel-tab.active { background: var(--accent); color: white; border-color: var(--accent); }

/* Impact Placeholder */
.impact-placeholder {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}
.placeholder-anim span {
  font-size: 36px;
  display: inline-block;
  animation: bounce 2s infinite;
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.impact-placeholder p { font-size: 13px; margin-top: 12px; line-height: 1.6; }

/* Impact Grid */
.impact-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.impact-stat {
  text-align: center;
  padding: 14px 8px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.impact-stat-label { font-size: 10px; color: var(--text-muted); margin-bottom: 4px; }
.impact-stat-value { font-size: 18px; font-weight: 700; font-family: var(--mono); }
.impact-stat-value.positive { color: var(--green); }
.impact-stat-value.negative { color: var(--red); }

.impact-description {
  padding: 14px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

/* Mini price chart in impact */
.impact-mini-chart {
  height: 60px;
  margin-top: 10px;
  border-radius: var(--radius-xs);
  overflow: hidden;
}

/* Similar cases */
.similar-cases { display: flex; flex-direction: column; gap: 8px; }
.similar-case {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.similar-date { font-family: var(--mono); font-size: 11px; color: var(--text-muted); min-width: 80px; }
.similar-title { font-size: 12px; flex: 1; }
.similar-impact { font-family: var(--mono); font-size: 12px; font-weight: 600; min-width: 50px; text-align: right; }

/* ===== Heatmap ===== */
.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.heatmap-cell {
  padding: 14px 10px;
  border-radius: var(--radius-sm);
  text-align: center;
  transition: transform var(--transition);
  cursor: default;
}
.heatmap-cell:hover { transform: scale(1.03); }
.heatmap-label { font-size: 11px; font-weight: 600; margin-bottom: 4px; display: block; }
.heatmap-value { font-size: 16px; font-weight: 700; font-family: var(--mono); display: block; }
.heatmap-count { font-size: 10px; color: rgba(255,255,255,0.6); margin-top: 2px; display: block; }

/* ===== Pro Layout ===== */
.pro-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 16px;
}
.pro-main { display: flex; flex-direction: column; gap: 16px; }

/* ===== Pro News ===== */
.pro-news-section {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.pro-news-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.pro-news-header h3 { font-size: 13px; font-weight: 700; }
.news-controls { display: flex; align-items: center; gap: 10px; }
.alert-toggle { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-secondary); }

/* Toggle switch */
.switch { position: relative; width: 32px; height: 18px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; inset: 0;
  background: var(--border);
  border-radius: 18px;
  cursor: pointer;
  transition: 0.3s;
}
.slider::before {
  content: '';
  position: absolute;
  width: 14px; height: 14px;
  left: 2px; bottom: 2px;
  background: white;
  border-radius: 50%;
  transition: 0.3s;
}
input:checked + .slider { background: var(--accent); }
input:checked + .slider::before { transform: translateX(14px); }

/* Sentiment */
.sentiment-section {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.sentiment-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.sentiment-title { font-size: 11px; color: var(--text-muted); }
.sentiment-score {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 700;
}
.sentiment-score.bearish { color: var(--red); }
.sentiment-score.neutral { color: var(--yellow); }
.sentiment-score.bullish { color: var(--green); }

.sentiment-bar-wrap { margin-bottom: 6px; }
.sentiment-bar {
  height: 8px;
  background: linear-gradient(90deg, var(--red), var(--yellow) 50%, var(--green));
  border-radius: 4px;
  position: relative;
  overflow: visible;
}
.sentiment-fill {
  position: absolute;
  top: -4px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: white;
  border: 3px solid var(--bg-secondary);
  box-shadow: 0 0 8px rgba(255,255,255,0.3);
  transition: left 0.5s;
}
.sentiment-labels { display: flex; justify-content: space-between; margin-top: 4px; font-size: 10px; }
.bearish-label { color: var(--red); }
.neutral-label { color: var(--yellow); }
.bullish-label { color: var(--green); }

.sentiment-history {
  display: flex;
  gap: 2px;
  align-items: flex-end;
  height: 24px;
  margin-top: 8px;
}
.sh-bar {
  flex: 1;
  border-radius: 2px 2px 0 0;
  min-height: 3px;
  transition: height 0.3s;
}

.pro-news-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
  max-height: 320px;
}

.pro-news-item {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 3px;
  transition: all var(--transition);
  border-left: 3px solid transparent;
  cursor: pointer;
}
.pro-news-item:hover { background: var(--bg-hover); }
.pro-news-item.flash { animation: newsFlash 1s ease; }

@keyframes newsFlash {
  0% { background: var(--accent-glow); }
  100% { background: transparent; }
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}
.pro-news-item { animation: slideIn 0.3s ease; }

.pro-news-item.impact-positive { border-left-color: var(--green); }
.pro-news-item.impact-negative { border-left-color: var(--red); }
.pro-news-item.impact-neutral { border-left-color: var(--yellow); }

.pro-news-time {
  font-size: 10px;
  color: var(--accent);
  font-family: var(--mono);
  font-weight: 500;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.pro-news-title { font-size: 12px; font-weight: 600; margin: 3px 0; line-height: 1.4; }
.pro-news-bottom { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.pro-news-impact {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  font-family: var(--mono);
}
.impact-high-neg { background: var(--red-bg); color: var(--red); border: 1px solid var(--red-border); }
.impact-med-neg { background: var(--red-bg); color: var(--red); border: 1px solid var(--red-border); opacity: 0.75; }
.impact-low { background: var(--yellow-bg); color: var(--yellow); border: 1px solid var(--yellow-border); }
.impact-med-pos { background: var(--green-bg); color: var(--green); border: 1px solid var(--green-border); opacity: 0.75; }
.impact-high-pos { background: var(--green-bg); color: var(--green); border: 1px solid var(--green-border); }

.pro-news-source { font-size: 10px; color: var(--text-muted); }

/* ===== Order Flow ===== */
.orderflow-section {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-top: 16px;
}
.orderflow-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.orderflow-header h3 { font-size: 13px; font-weight: 700; }
.orderflow-grid { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.flow-item { display: flex; align-items: center; gap: 10px; }
.flow-label { font-size: 12px; font-weight: 500; min-width: 48px; color: var(--text-secondary); }
.flow-bar-wrap { flex: 1; height: 8px; background: var(--bg-card); border-radius: 4px; overflow: hidden; }
.flow-bar { height: 100%; border-radius: 4px; transition: width 1s; }
.flow-bar.buy { background: linear-gradient(90deg, var(--green), var(--green-light)); }
.flow-bar.sell { background: linear-gradient(90deg, var(--red), var(--red-light)); }
.flow-value { font-family: var(--mono); font-size: 12px; font-weight: 600; min-width: 70px; text-align: right; }
.flow-value.green { color: var(--green); }
.flow-value.red { color: var(--red); }

/* ===== AI Panel ===== */
.ai-panel {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}
.ai-title { display: flex; align-items: center; gap: 8px; }
.ai-icon-wrap {
  width: 28px; height: 28px;
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}
.ai-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 7px;
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  color: white;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.ai-confidence { display: flex; align-items: center; gap: 8px; }
.confidence-label { font-size: 10px; color: var(--text-muted); }
.confidence-bar { width: 60px; height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.confidence-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--green)); border-radius: 2px; }
.confidence-value { font-family: var(--mono); font-size: 11px; color: var(--green); font-weight: 600; }

.ai-insights {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  padding: 14px;
}
.insight-card {
  padding: 14px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.insight-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.insight-type {
  font-size: 11px;
  font-weight: 600;
}
.insight-type.warning { color: var(--yellow); }
.insight-type.info { color: var(--accent); }
.insight-type.alert { color: var(--red); }
.insight-time { font-size: 10px; color: var(--text-muted); font-family: var(--mono); }
.insight-card p { font-size: 12px; line-height: 1.6; color: var(--text-secondary); }
.insight-card .green { color: var(--green); font-weight: 600; }
.insight-card .red { color: var(--red); font-weight: 600; }

.insight-stats {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.mini-stat {
  flex: 1;
  padding: 6px;
  background: var(--bg-primary);
  border-radius: var(--radius-xs);
  text-align: center;
}
.mini-label { display: block; font-size: 9px; color: var(--text-muted); margin-bottom: 2px; }
.mini-val { display: block; font-family: var(--mono); font-size: 12px; font-weight: 600; }
.mini-val.green { color: var(--green); }
.mini-val.red { color: var(--red); }

.keyword {
  display: inline-block;
  padding: 2px 6px;
  background: var(--purple-bg);
  color: var(--purple);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  margin: 1px;
}

.warning-card { border-left: 3px solid var(--yellow); }
.info-card { border-left: 3px solid var(--accent); }
.alert-card { border-left: 3px solid var(--red); }

.insight-chart {
  height: 40px;
  margin-top: 8px;
  background: var(--bg-primary);
  border-radius: var(--radius-xs);
  overflow: hidden;
}

/* ===== Toast Notification ===== */
.toast-container {
  position: fixed;
  top: 70px;
  right: 20px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  padding: 12px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease, toastOut 0.3s ease 4s forwards;
  max-width: 320px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.toast-icon { font-size: 16px; flex-shrink: 0; }
.toast-text { font-size: 12px; line-height: 1.5; }
.toast-title { font-weight: 600; margin-bottom: 2px; }
.toast-body { color: var(--text-secondary); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
  from { opacity: 1; }
  to { opacity: 0; transform: translateX(40px); }
}

/* ===== Responsive ===== */
@media (max-width: 1200px) {
  .ai-insights { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1024px) {
  .edu-layout, .pro-layout, .bottom-panels { grid-template-columns: 1fr; }
  .ai-insights { grid-template-columns: 1fr; }
  .header { flex-wrap: wrap; gap: 8px; }
  .header-center { order: 3; width: 100%; display: flex; justify-content: center; }
}
@media (max-width: 640px) {
  .header { padding: 8px 10px; }
  .main-content { padding: 10px; }
  .logo-tagline { display: none; }
  .chart-container { height: 260px; }
  .pro-chart { height: 300px; }
  .stats-bar { gap: 6px; }
  .impact-grid { grid-template-columns: repeat(2, 1fr); }
  .heatmap-grid { grid-template-columns: repeat(2, 1fr); }
}
