:root {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --text-primary: #f8fafc;
  --text-secondary: #b6c2d3;
  --text-muted: #94a3b8;
  --accent-cyan: #06b6d4;
  --accent-blue: #3b82f6;
  --accent-red: #ef4444;
  --accent-yellow: #f59e0b;
  --accent-green: #10b981;
  --border-color: #334155;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Navbar */
.navbar {
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-badge {
  background: linear-gradient(135deg, #0284c7, #06b6d4);
  color: #fff;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 15px;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 10px rgba(6, 182, 212, 0.3);
}

.nav-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: #f1f5f9;
}

.nav-subtitle {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.control-group label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.select-input {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  cursor: pointer;
  outline: none;
}

.select-input:focus {
  border-color: var(--accent-cyan);
}

.btn {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb, #0284c7);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: #475569;
}

/* Summary Bar */
.summary-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 12px;
  padding: 14px 24px;
  background-color: rgba(15, 23, 42, 0.7);
  border-bottom: 1px solid var(--border-color);
}

.stat-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  position: relative;
}

.stat-card.highlight {
  border-color: var(--accent-red);
  background: linear-gradient(145deg, #1e293b, #2b1d28);
}

.stat-card.highlight-time {
  border-left: 3px solid #22c55e;
  background: linear-gradient(145deg, #1e293b, #132e27);
}

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.stat-val {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 4px;
  font-family: Consolas, 'Cascadia Mono', 'Courier New', monospace;
}

.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  margin-top: 6px;
  background-color: var(--bg-tertiary);
  color: var(--text-secondary);
}

.badge.match {
  background-color: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid #10b981;
}

/* Main Layout - Xếp chồng dọc tự nhiên: Đồ thị 100% bề ngang ở trên, Các tab chi tiết 100% bề ngang ở dưới */
.main-layout {
  display: flex !important;
  flex-direction: column !important;
  gap: 24px;
  padding: 16px 24px 48px;
  width: 100% !important;
  max-width: 100% !important;
}

/* Graph Panel (1) - Toàn bộ 100% bề ngang */
.graph-panel {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden;
  width: 100% !important;
  max-width: 100% !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.panel-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.panel-header h2 {
  font-size: 15px;
  font-weight: 600;
}

.graph-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  color: var(--text-secondary);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.dot.normal { background-color: var(--accent-green); }
.dot.symptom { background-color: var(--accent-yellow); }
.dot.culprit { background-color: var(--accent-red); box-shadow: 0 0 8px var(--accent-red); }

.canvas-wrapper {
  position: relative;
  width: 100%;
  height: 580px;
  min-height: 520px;
  background-color: #0b1120;
}

.canvas-toolbar {
  position: absolute;
  top: 12px;
  right: 14px;
  display: flex;
  gap: 6px;
  z-index: 10;
  background-color: rgba(15, 23, 42, 0.85);
  padding: 4px 6px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(4px);
}

.canvas-tool-btn {
  background-color: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
  padding: 4px 8px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.canvas-tool-btn:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border-color);
}

.canvas-tool-btn.active {
  background-color: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.4);
}

#graphCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.canvas-overlay-hint {
  position: absolute;
  bottom: 12px;
  left: 14px;
  background-color: rgba(15, 23, 42, 0.85);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  color: var(--text-secondary);
  pointer-events: none;
  border: 1px solid var(--border-color);
}

/* Details Panel (2) - Toàn bộ 100% bề ngang ở dưới */
.details-panel {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  max-width: 100% !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.tabs-header {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  background-color: rgba(15, 23, 42, 0.65);
  overflow-x: auto;
  scrollbar-width: thin;
}

.tab-btn {
  flex: 1;
  min-width: 170px;
  padding: 15px 18px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.04);
}

.tab-btn.active {
  color: var(--accent-cyan);
  border-bottom-color: var(--accent-cyan);
  background-color: rgba(6, 182, 212, 0.1);
}

.tab-content {
  display: none;
  padding: 24px 28px;
  width: 100%;
}

.tab-content.active {
  display: block;
}

/* Lưới hiển thị Bằng chứng đa nguồn (3 cột trải đều 100% bề ngang) */
.evidence-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 14px;
  width: 100%;
}

@media (max-width: 1080px) {
  .evidence-grid {
    grid-template-columns: 1fr;
  }
}

/* Lưới hiển thị 4 Luồng Dữ liệu Input (2x2 trải đều 100% bề ngang) */
.input-streams-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 14px;
  width: 100%;
}

@media (max-width: 950px) {
  .input-streams-grid {
    grid-template-columns: 1fr;
  }
}

.evidence-box {
  background-color: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.evidence-box h4 {
  font-size: 13.5px;
  font-weight: 700;
  color: #e2e8f0;
  border-bottom: 1px solid rgba(51, 65, 85, 0.45);
  padding-bottom: 8px;
  margin-bottom: 4px;
}

.code-stream-box {
  font-size: 12px;
  font-family: Consolas, 'Cascadia Mono', 'Courier New', monospace;
  height: 250px;
  overflow-y: auto;
  background: rgba(10, 15, 29, 0.85);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(51, 65, 85, 0.5);
  color: #cbd5e1;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.card-inner h3 {
  font-size: 15px;
  font-weight: 700;
  color: #f1f5f9;
}

.section-desc {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-top: 4px;
  margin-bottom: 14px;
}

/* Data Tables */
.table-responsive {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  background-color: rgba(15, 23, 42, 0.85);
  color: var(--text-secondary);
  text-align: left;
  padding: 12px 16px;
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}

#tableTopK th:nth-child(1) { width: 80px; text-align: center; }
#tableTopK td:nth-child(1) { text-align: center; }
#tableTopK th:nth-child(2) { width: 36%; }
#tableTopK th:nth-child(3) { width: 14%; }
#tableTopK th:nth-child(4) { width: 18%; }
#tableTopK th:nth-child(5) { width: 22%; }

#tableBenchmark th:nth-child(1) { width: 30%; }
#tableBenchmark th:nth-child(2),
#tableBenchmark th:nth-child(3),
#tableBenchmark th:nth-child(4),
#tableBenchmark th:nth-child(5),
#tableBenchmark th:nth-child(6) { text-align: center; }
#tableBenchmark td:nth-child(2),
#tableBenchmark td:nth-child(3),
#tableBenchmark td:nth-child(4),
#tableBenchmark td:nth-child(5),
#tableBenchmark td:nth-child(6) { text-align: center; }

.data-table tr:hover td {
  background-color: rgba(255, 255, 255, 0.02);
  cursor: pointer;
}

.data-table tr.culprit-row td {
  background-color: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  font-weight: 600;
}

.rank-badge {
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
}

.rank-1 { background-color: var(--accent-red); color: white; }
.rank-2 { background-color: var(--accent-yellow); color: black; }
.rank-3 { background-color: #475569; color: white; }

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 24px;
  font-style: italic;
}

/* Evidence Box */
.evidence-box {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 12px;
}

.evidence-box h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.evidence-list {
  list-style: none;
  font-size: 12.5px;
}

.evidence-list li {
  padding: 4px 0;
  color: #e2e8f0;
}

.logs-list li {
  font-family: Consolas, 'Cascadia Mono', 'Courier New', monospace;
  font-size: 11.5px;
  color: #f87171;
  background-color: rgba(239, 68, 68, 0.08);
  padding: 6px 8px;
  border-radius: 4px;
  margin-bottom: 4px;
  word-break: break-all;
}

.empty-hint {
  color: var(--text-muted);
  font-style: italic;
}

/* Report Box */
.report-box {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  font-size: 13px;
  line-height: 1.65;
  color: #e2e8f0;
  white-space: pre-wrap;
  max-height: 480px;
  overflow-y: auto;
}

.report-box pre {
  background-color: #0b1120;
  border: 1px solid var(--border-color);
  padding: 12px;
  border-radius: var(--radius-sm);
  font-family: Consolas, 'Cascadia Mono', 'Courier New', monospace;
  font-size: 12px;
  margin: 10px 0;
  color: #38bdf8;
  overflow-x: auto;
}

/* Benchmark Note */
.benchmark-note {
  margin-top: 16px;
  background-color: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 12.5px;
  color: #bfdbfe;
}

.benchmark-note ul {
  margin-top: 6px;
  margin-left: 18px;
}

/* Multi-source Telemetry Pipeline Progress Bar */
.pipeline-progress-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: linear-gradient(90deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.95));
  border-bottom: 1px solid rgba(56, 189, 248, 0.3);
  font-size: 12.5px;
  animation: fadeIn 0.3s ease;
}

.pipeline-step-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #94a3b8;
  font-weight: 500;
  transition: all 0.2s ease;
}

.pipeline-step-item.active {
  color: #38bdf8;
  font-weight: 700;
  transform: scale(1.03);
}

.pipeline-step-item.done {
  color: #4ade80;
  font-weight: 600;
}

.pipeline-divider {
  color: #475569;
  font-size: 11px;
}

/* Modal Overlay & Card */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}

.modal-card {
  background: #0f172a;
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 620px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.modal-header {
  padding: 14px 20px;
  background: #1e293b;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  margin: 0;
  font-size: 15px;
  color: #f8fafc;
}

.modal-close-btn {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

.modal-close-btn:hover {
  color: #ffffff;
}

.modal-body {
  padding: 20px;
}

.connector-status-card {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Toast Notifications */
.toast {
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--accent-cyan);
  color: var(--text-primary);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  font-size: 13px;
  animation: slideInRight 0.3s ease-out forwards;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 350px;
}
.toast.success { border-left-color: var(--accent-green); }
.toast.error { border-left-color: var(--accent-red); }
.toast.warning { border-left-color: var(--accent-yellow); }
.toast.fade-out {
  animation: slideOutRight 0.3s ease-in forwards;
}
@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes slideOutRight {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}

/* Responsive CSS */
@media (max-width: 1366px) {
  .navbar {
    padding: 10px 16px;
  }
  .nav-title {
    font-size: 15px;
  }
  .canvas-wrapper {
    height: 480px;
    min-height: 400px;
  }
  .tab-btn {
    min-width: 140px;
    padding: 12px 14px;
    font-size: 12px;
  }
}

@media (max-width: 1024px) {
  .navbar {
    flex-direction: column;
    align-items: flex-start;
  }
  .nav-controls {
    flex-wrap: wrap;
  }
  .summary-bar {
    grid-template-columns: 1fr 1fr;
  }
  .main-layout {
    padding: 12px 16px;
  }
}

@media (max-width: 768px) {
  .summary-bar {
    grid-template-columns: 1fr;
  }
  .input-streams-grid, .evidence-grid {
    grid-template-columns: 1fr;
  }
  #convergenceChartContainer > div:nth-child(3) {
    grid-template-columns: 1fr !important;
  }
  .runbook-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Instant SRE Runbook Banner */
.instant-runbook-banner {
  animation: slideDownFade 0.35s ease-out;
}

@keyframes slideDownFade {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Hàng phương pháp đề xuất trong bảng kết quả: phân biệt bằng viền trái, không dùng màu đánh giá */
.data-table tr.proposed-row td {
  background: rgba(56, 189, 248, 0.06);
}
.data-table tr.proposed-row td:first-child {
  box-shadow: inset 3px 0 0 #38bdf8;
}

/* Báo cáo chẩn đoán dạng Markdown an toàn */
.report-box .md-h {
  color: #38bdf8;
  margin: 14px 0 6px;
  font-size: 14px;
}
.report-box .md-list {
  margin: 4px 0 8px 18px;
  padding: 0;
}
.report-box .md-list li {
  margin: 2px 0;
}
.report-box p {
  margin: 4px 0;
}
.report-box .md-code {
  color: #fda4af;
  background: rgba(244, 63, 94, 0.1);
  padding: 1px 4px;
  border-radius: 3px;
  word-break: break-word;
}

/* Mô tả tĩnh quy trình xử lý: cho phép xuống dòng trên màn hình hẹp */
.pipeline-progress-bar {
  flex-wrap: wrap;
  gap: 6px;
}


/* ===== Cải tiến giao diện 21/10/2026 (v6) ===== */
/* Chữ nhỏ trong style nội tuyến được nâng lên cỡ tối thiểu 12,5px để dễ đọc */
[style*="font-size: 10px"], [style*="font-size:10px"], [style*="font-size: 11px"], [style*="font-size:11px"],
[style*="font-size: 11.5px"], [style*="font-size: 12px"], [style*="font-size:12px"] { font-size: 12.5px !important; }
[style*="color: #94a3b8"], [style*="color:#94a3b8"], [style*="color:#64748b"] { color: #b6c2d3 !important; }

.nav-title { font-size: 19px; }
.nav-subtitle { font-size: 13px; }
.control-group label { color: #e2e8f0; font-weight: 700; }
.select-input { max-width: 520px; }
.btn-primary { background: #2563eb; box-shadow: none; }

/* Thanh số liệu: Top-1 nổi bật, thẻ còn lại gọn */
.summary-bar { grid-template-columns: 2.2fr repeat(4, 1fr); }
.stat-card.highlight { border-color: #ef4444; background: #2b1d28; }
.stat-card.highlight .stat-val { font-size: 20px; word-break: break-all; }
.stat-label { font-size: 12px; text-transform: none; letter-spacing: 0; }
.stat-val { font-size: 22px; }

/* Nhóm tab */
.tabs-header { align-items: stretch; }
.tab-group { align-self: center; padding: 0 14px 0 18px; font-size: 11.5px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .5px; white-space: nowrap; border-left: 1px solid var(--border-color); }
.tab-group:first-child { border-left: none; }
.tab-btn { flex: 0 0 auto; min-width: 0; padding: 14px 18px; font-size: 14px; }

/* Bảng */
.data-table th, .data-table td { padding: 10px 14px; }
.data-table th { font-size: 12.5px; }
.data-table td { font-size: 14px; font-variant-numeric: tabular-nums; }
#tableTopK.topk-collapsed .row-extra { display: none; }
.score-bar { display: block; height: 4px; margin-top: 4px; background: #334155; border-radius: 2px; max-width: 140px; }
.score-bar i { display: block; height: 100%; background: #38bdf8; border-radius: 2px; min-width: 1px; }
.culprit-row .score-bar i { background: #ef4444; }
/* MAP trùng MRR (mỗi ca đúng một nhãn): ẩn cột, ghi chú trong giao thức */
#tablePublicBench th:nth-child(7), #tablePublicBench td:nth-child(7) { display: none; }
#tablePublicBench td, #tablePublicBench th { text-align: right; }
#tablePublicBench td:first-child, #tablePublicBench th:first-child { text-align: left; }

.read-guide { margin-top: 14px; font-size: 13px; color: #cbd5e1; }
.read-guide summary { cursor: pointer; color: #38bdf8; font-weight: 600; }
.read-guide > div { margin-top: 8px; }

/* Đồ thị */
.canvas-wrapper { height: 520px; }
.canvas-overlay-hint { font-size: 12.5px; }
.graph-legend { font-size: 13px; }

/* Thẻ khuyến nghị xử lý: gọn hơn */
.instant-runbook-banner { box-shadow: none !important; background: var(--bg-secondary) !important; border: 1px solid var(--border-color) !important; }

@media (max-width: 1024px) { .summary-bar { grid-template-columns: 1fr 1fr; } }

/* In / chụp hình cho luận văn: nền trắng, bỏ phần điều khiển */
@media print {
  :root { --bg-primary:#fff; --bg-secondary:#fff; --bg-tertiary:#eee; --text-primary:#000; --text-secondary:#222; --text-muted:#444; --border-color:#999; }
  body { background:#fff !important; color:#000 !important; }
  .nav-controls, .tabs-header, .canvas-toolbar, .canvas-overlay-hint, .btn, #btnTopkMore, .modal-overlay, #toastContainer, .pipeline-progress-bar { display:none !important; }
  .navbar, .summary-bar, .graph-panel, .details-panel, .stat-card, .instant-runbook-banner, .evidence-box, .report-box, .canvas-wrapper { background:#fff !important; color:#000 !important; box-shadow:none !important; border-color:#999 !important; }
  .canvas-wrapper { filter: invert(1) hue-rotate(180deg); }
  * { color:#000 !important; text-shadow:none !important; }
  .data-table th { background:#eee !important; } .data-table td { border-color:#bbb !important; }
  .tab-content.active { display:block; } #tableTopK.topk-collapsed .row-extra { display:none; }
  .graph-panel, .data-table tr, figure { break-inside: avoid; }
}

/* ===== Vòng 2 (21/10/2026): đồ thị và Top-k cạnh nhau ===== */
.results-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 1200px) { .results-grid { grid-template-columns: 1fr; } }
.panel-card { background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 18px 20px; min-width: 0; }
.panel-card .card-inner > h3 { font-size: 16px; }
.graph-key { padding: 8px 16px; font-size: 12.5px; color: var(--text-secondary); border-bottom: 1px solid var(--border-color); line-height: 1.5; }
.results-grid .canvas-wrapper { height: 560px; min-height: 420px; }
.results-grid .graph-panel .panel-header { padding: 12px 16px; }
.results-grid .graph-legend { flex-wrap: wrap; gap: 8px 12px; }
#tableTopK th:nth-child(3), #tableTopK td:nth-child(3), #tableTopK th:nth-child(6), #tableTopK td:nth-child(6) { display: none; }
#tableTopK th:nth-child(2) { width: auto; } #tableTopK th:nth-child(4), #tableTopK th:nth-child(5) { width: auto; }
#tableTopK td { padding: 8px 10px; }
#execTimeBanner { gap: 6px 14px !important; }
#convergenceChartContainer > div:nth-child(3) { grid-template-columns: 1fr !important; }
.evidence-box { margin-bottom: 0; }
.modal-card { max-width: 760px; } .modal-body { font-size: 14px; }
@media print { .results-grid { display: block; } .panel-card { background:#fff !important; } .graph-key { color:#000 !important; } }
.results-grid { align-items: stretch; }
.results-grid .graph-panel { height: 100%; }
.results-grid .canvas-wrapper { flex: 1; min-height: 560px; height: auto; }
.results-grid { align-items: start; }
.results-grid .graph-panel { height: auto; position: sticky; top: 8px; }
.results-grid .canvas-wrapper { flex: none; height: 600px; min-height: 600px; }
#tab-bench .btn { font-size: 13px !important; padding: 6px 12px !important; }
@media print {
  .results-grid .graph-panel { position: static !important; }
  .results-grid .canvas-wrapper { height: 520px !important; min-height: 0 !important; background:#fff !important; filter: none !important; }
  #graphCanvas { filter: invert(1) hue-rotate(180deg); background:#0b1120; }
  [style*="background"], .code-stream-box, pre { background: transparent !important; }
  .stat-card.highlight { border-color:#000 !important; }
  .badge, .rank-badge { border:1px solid #000 !important; background:#fff !important; }
}
@media print { [style*="color"], .section-desc, .read-guide { color:#000 !important; } }
/* Vòng 3 */
.stat-note { font-size: 11.5px; color: var(--text-muted); margin-top: 4px; line-height: 1.35; }
.results-grid .canvas-wrapper { height: 680px; min-height: 680px; }
#graphSubNote { color: #fbbf24; }
