/* ==========================================================================
   LocalModelMatrix - Modern State-of-the-Art Design System
   Google Web Guidance & Apple Pro Standard
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  /* Core Color Palette - Adaptive Tokens */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Theme: Dark Mode (Default Developer Palette) */
  --bg-app: #090d16;
  --bg-surface-0: #0f172a;
  --bg-surface-1: #131d33;
  --bg-surface-2: #1b2742;
  --bg-surface-hover: #223152;
  --bg-surface-glass: rgba(15, 23, 42, 0.75);

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.14);
  --border-hover: rgba(255, 255, 255, 0.25);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #090d16;

  /* Accents */
  --accent-blue: #38bdf8;
  --accent-blue-bg: rgba(56, 189, 248, 0.12);
  --accent-blue-glow: rgba(56, 189, 248, 0.35);

  --accent-indigo: #818cf8;
  --accent-indigo-bg: rgba(129, 140, 248, 0.12);

  --accent-emerald: #34d399;
  --accent-emerald-bg: rgba(52, 211, 153, 0.12);
  --accent-emerald-glow: rgba(52, 211, 153, 0.4);

  --accent-amber: #fbbf24;
  --accent-amber-bg: rgba(251, 191, 36, 0.12);

  --accent-rose: #f87171;
  --accent-rose-bg: rgba(248, 113, 113, 0.12);

  --accent-purple: #c084fc;
  --accent-purple-bg: rgba(192, 132, 252, 0.12);

  /* Shadows & Glass */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.25);
  --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.4), 0 2px 6px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 32px -4px rgba(0, 0, 0, 0.6), 0 4px 12px -2px rgba(0, 0, 0, 0.4);
  --shadow-glow-blue: 0 0 20px -3px rgba(56, 189, 248, 0.25);
  
  --backdrop-blur: blur(16px) saturate(180%);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
}

[data-theme="light"] {
  --bg-app: #f8fafc;
  --bg-surface-0: #ffffff;
  --bg-surface-1: #f1f5f9;
  --bg-surface-2: #e2e8f0;
  --bg-surface-hover: #cbd5e1;
  --bg-surface-glass: rgba(255, 255, 255, 0.85);

  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-medium: rgba(0, 0, 0, 0.14);
  --border-hover: rgba(0, 0, 0, 0.25);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;

  --accent-blue: #0284c7;
  --accent-blue-bg: rgba(2, 132, 199, 0.1);
  --accent-blue-glow: rgba(2, 132, 199, 0.2);

  --accent-indigo: #6366f1;
  --accent-indigo-bg: rgba(99, 102, 241, 0.1);

  --accent-emerald: #059669;
  --accent-emerald-bg: rgba(5, 150, 105, 0.1);
  --accent-emerald-glow: rgba(5, 150, 105, 0.2);

  --accent-amber: #d97706;
  --accent-amber-bg: rgba(217, 119, 6, 0.1);

  --accent-rose: #dc2626;
  --accent-rose-bg: rgba(220, 38, 38, 0.1);

  --accent-purple: #9333ea;
  --accent-purple-bg: rgba(147, 51, 234, 0.1);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Base Global Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-primary);
  line-height: 1.5;
  letter-spacing: -0.012em;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* ==========================================================================
   Header & Glassmorphism Navigation Bar
   ========================================================================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-surface-glass);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.75rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.brand-logo {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-indigo) 100%);
  color: #fff;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.15rem;
  box-shadow: var(--shadow-glow-blue);
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-primary);
}

.brand-badge {
  font-size: 0.68rem;
  font-weight: 600;
  background: var(--accent-blue-bg);
  color: var(--accent-blue);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.nav-tabs {
  display: flex;
  gap: 0.25rem;
  background: var(--bg-surface-0);
  border: 1px solid var(--border-subtle);
  padding: 4px;
  border-radius: var(--radius-md);
}

.nav-tab {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font-sans);
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.nav-tab.active {
  background: var(--bg-surface-2);
  color: var(--accent-blue);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-medium);
}

.nav-right-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.theme-toggle-btn {
  background: var(--bg-surface-0);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.theme-toggle-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background: var(--bg-surface-hover);
}

.admin-auth-btn {
  background: var(--bg-surface-0);
  border: 1px solid var(--border-subtle);
  color: var(--accent-amber);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.admin-auth-btn:hover {
  color: #fde047;
  border-color: var(--accent-amber);
  background: var(--accent-amber-bg);
}

.admin-auth-btn.unlocked {
  color: var(--accent-emerald);
  border-color: rgba(52, 211, 153, 0.3);
  background: var(--accent-emerald-bg);
}

.admin-auth-btn.unlocked:hover {
  color: #6ee7b7;
  border-color: var(--accent-emerald);
}

.tab-lock-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 4px;
  color: var(--accent-amber);
  opacity: 0.85;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.nav-tab:hover .tab-lock-badge {
  opacity: 1;
  transform: scale(1.1);
}

.tab-lock-badge.unlocked {
  display: none !important;
}

.admin-modal-icon-badge {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--accent-amber-bg);
  border: 1px solid rgba(251, 191, 36, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.system-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-surface-0);
  border: 1px solid var(--border-subtle);
  padding: 4px 10px;
  border-radius: 20px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald-glow);
  position: relative;
}

.status-dot::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: 50%;
  border: 1px solid var(--accent-emerald);
  animation: pulse-ring 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.6); opacity: 0; }
  100% { transform: scale(0.95); opacity: 0; }
}

.status-dot.offline {
  background: var(--accent-rose);
  box-shadow: 0 0 8px var(--accent-rose);
}
.status-dot.offline::after { display: none; }

/* ==========================================================================
   Main Content Container
   ========================================================================== */
.main-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  width: 100%;
  flex: 1;
}

.view-section {
  display: none;
}

.view-section.active {
  display: block;
  animation: viewFadeIn 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes viewFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* Hero Titles */
.hero-header {
  margin-bottom: 2rem;
}

.hero-title {
  font-size: 2.15rem;
  font-weight: 800;
  letter-spacing: -0.035em;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.hero-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 860px;
  line-height: 1.6;
}

/* ==========================================================================
   Modern Cards & Grid Layouts
   ========================================================================== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.card {
  background: var(--bg-surface-0);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease;
  position: relative;
  overflow: hidden;
}

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

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
}

.card-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.card-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  font-family: var(--font-mono);
}

.card-value {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  margin-bottom: 0.3rem;
}

.card-subtext {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ==========================================================================
   Recommendation Matrix Cards
   ========================================================================== */
.rec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.rec-card {
  background: var(--bg-surface-0);
  border-radius: var(--radius-lg);
  padding: 1.6rem;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

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

.rec-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
}

.rec-domain {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.rec-score-pill {
  font-size: 0.82rem;
  font-weight: 700;
  font-family: var(--font-mono);
  background: var(--accent-emerald-bg);
  color: var(--accent-emerald);
  border: 1px solid rgba(52, 211, 153, 0.25);
  padding: 3px 9px;
  border-radius: 12px;
}

.rec-top-model {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--accent-blue);
  margin-bottom: 0.5rem;
}

.rec-justification {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  line-height: 1.5;
  flex: 1;
}

.rec-meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
}

/* ==========================================================================
   Action Bars & Controls
   ========================================================================== */
.action-bar {
  background: var(--bg-surface-0);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.control-group {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: flex-end;
}

.control-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 6px;
  display: block;
}

.select-control, .input-control {
  background: var(--bg-surface-1);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-family: var(--font-sans);
  font-weight: 500;
  outline: none;
  transition: all 0.2s ease;
}

.select-control:focus, .input-control:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px var(--accent-blue-glow);
  background: var(--bg-surface-0);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid transparent;
  text-decoration: none;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
  box-shadow: var(--shadow-glow-blue);
}

.btn-secondary {
  background: var(--bg-surface-1);
  color: var(--text-primary);
  border-color: var(--border-medium);
}

.btn-secondary:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-hover);
}

.btn-danger {
  background: var(--accent-rose-bg);
  color: var(--accent-rose);
  border-color: rgba(248, 113, 113, 0.3);
}

.btn-danger:hover {
  background: var(--accent-rose);
  color: #fff;
}

/* ==========================================================================
   Collapsible Sections (Model Matrix & Performance Radar)
   ========================================================================== */
.matrix-section {
  background: var(--bg-surface-0);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.matrix-section:hover {
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow-md);
}

.matrix-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem 1.5rem;
  background: var(--bg-surface-1);
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  user-select: none;
  gap: 1rem;
  transition: background-color 0.15s ease;
}

.matrix-section-header:hover {
  background-color: var(--bg-surface-hover);
}

.matrix-section.collapsed .matrix-section-header {
  border-bottom: none;
}

.section-header-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex: 1;
  min-width: 0;
}

.section-icon-badge {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--bg-surface-0);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.3;
}

.section-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 2px 0 0 0;
  line-height: 1.4;
}

.section-header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.section-collapse-btn {
  background: var(--bg-surface-0);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.section-collapse-btn:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.section-chevron {
  width: 18px;
  height: 18px;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.matrix-section.collapsed .section-chevron {
  transform: rotate(-90deg);
}

.matrix-section-body {
  padding: 1.5rem;
  transition: max-height 0.3s ease, opacity 0.25s ease;
}

.matrix-section.collapsed .matrix-section-body {
  display: none;
}

/* ==========================================================================
   Data Tables & Freezed / Sticky Headers
   ========================================================================== */
.table-container {
  background: var(--bg-surface-0);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
  overflow-y: auto;
  max-height: 560px; /* Freezes headers inside table container on vertical scroll */
  margin-bottom: 1.5rem;
  -webkit-overflow-scrolling: touch;
  position: relative;
}

.table-container::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.table-container::-webkit-scrollbar-track {
  background: var(--bg-surface-1);
  border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
  font-size: 0.88rem;
}

.domain-breakdown-table {
  min-width: 100% !important;
  width: 100% !important;
  table-layout: auto;
}

.domain-breakdown-table th {
  padding: 0.75rem 0.45rem;
  font-size: 0.7rem;
  letter-spacing: 0.02em;
}

.domain-breakdown-table td {
  padding: 0.75rem 0.45rem;
}

.text-left {
  text-align: left !important;
}

.text-center {
  text-align: center !important;
}

.data-table thead {
  position: sticky;
  top: 0;
  z-index: 15;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 15;
  background: var(--bg-surface-1);
  padding: 0.85rem 1rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border-subtle);
  white-space: nowrap;
  user-select: none;
  box-shadow: 0 1px 0 var(--border-subtle), 0 2px 4px rgba(0, 0, 0, 0.12);
}

.data-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  vertical-align: middle;
  white-space: nowrap;
}

/* ==========================================================================
   Column Resizer Handle
   ========================================================================== */
.col-resizer {
  position: absolute;
  top: 0;
  right: 0;
  width: 7px;
  bottom: 0;
  cursor: col-resize;
  user-select: none;
  z-index: 25;
  background: transparent;
  transition: background 0.15s ease, width 0.15s ease;
}

.col-resizer:hover,
.col-resizer.is-resizing {
  background: var(--accent-blue);
  width: 4px;
}

body.is-col-resizing {
  cursor: col-resize !important;
  user-select: none !important;
}

body.is-col-resizing * {
  user-select: none !important;
}

.data-table tbody tr {
  transition: background-color 0.15s ease;
}

.data-table tbody tr:hover {
  background-color: var(--bg-surface-hover);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* Status Chips & Badges */
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-mono);
  background: var(--bg-surface-1);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.status-chip.pass {
  background: var(--accent-emerald-bg);
  color: var(--accent-emerald);
  border-color: rgba(52, 211, 153, 0.3);
}

.status-chip.fail {
  background: var(--accent-rose-bg);
  color: var(--accent-rose);
  border-color: rgba(248, 113, 113, 0.3);
}

.status-chip.warn,
.status-chip.cancelled {
  background: var(--accent-amber-bg);
  color: var(--accent-amber);
  border-color: rgba(245, 158, 11, 0.3);
}

.status-chip.running {
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-blue);
  border-color: rgba(56, 189, 248, 0.4);
}

.status-chip.vram-active {
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-blue);
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

/* ==========================================================================
   Operational History & Audit Logs Table (Zero Horizontal Scroll Layout)
   ========================================================================== */
.history-table-container {
  overflow-x: hidden;
}

.history-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.history-table th {
  padding: 0.65rem 0.45rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-table td {
  padding: 0.55rem 0.45rem;
  vertical-align: middle;
  font-size: 0.8rem;
  white-space: normal;
}

/* 100% Proportional Column Widths */
.history-table .history-col-date { width: 12%; }
.history-table .history-col-model { width: 23%; }
.history-table .history-col-suite { width: 17%; }
.history-table .history-col-status { width: 11%; }
.history-table .history-col-score { width: 11%; }
.history-table .history-col-duration { width: 8%; }
.history-table .history-col-tps { width: 6%; }
.history-table .history-col-ttft { width: 6%; }
.history-table .history-col-action { width: 6%; }

.history-date-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.history-date-main {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-time-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-table .model-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.history-table .model-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.history-table .model-id-badge {
  font-size: 0.69rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  background: transparent;
  padding: 0;
  border: none;
}

.history-table .battery-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.history-table .battery-title {
  font-size: 0.79rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.history-table .battery-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  white-space: nowrap;
}

.history-table .score-cell {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

@media (max-width: 1024px) {
  .history-table-container {
    overflow-x: auto;
  }
  .history-table {
    min-width: 860px;
  }
}

/* Model Identification Tags */
.model-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.model-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.model-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.model-tag {
  font-size: 0.7rem;
  font-weight: 600;
  font-family: var(--font-mono);
  background: var(--bg-surface-1);
  color: var(--text-secondary);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
}

/* Numerical Precision in Tables */
.num-stat {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

/* ==========================================================================
   Live Benchmark Runner & Split Terminal
   ========================================================================== */
.live-runner-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

@media (max-width: 1024px) {
  .live-runner-grid {
    grid-template-columns: 1fr;
  }
}

.terminal-window {
  background: #050811;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-medium);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 520px;
}

.terminal-header {
  background: #0b1120;
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.terminal-dots {
  display: flex;
  gap: 6px;
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.dot-red { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green { background: #27c93f; }

.terminal-title {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: #64748b;
  font-weight: 600;
}

.terminal-body {
  padding: 1rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  line-height: 1.6;
  color: #94a3b8;
  overflow-y: auto;
  flex: 1;
  white-space: pre-wrap;
  word-break: break-word;
}

.terminal-body div {
  margin-bottom: 4px;
}

/* Progress Meter */
.progress-container {
  background: var(--bg-surface-1);
  border-radius: 20px;
  height: 10px;
  overflow: hidden;
  margin: 1rem 0 0.5rem 0;
  border: 1px solid var(--border-subtle);
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-blue) 0%, var(--accent-emerald) 100%);
  border-radius: 20px;
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 12px var(--accent-blue-glow);
}

/* Real-Time Assertions Table (Zero Horizontal Overflow) */
.live-assertions-table {
  width: 100% !important;
  table-layout: fixed !important;
  border-collapse: collapse;
}

.live-assertions-table th,
.live-assertions-table td {
  box-sizing: border-box;
}

.live-assertions-table tbody tr:hover {
  background: var(--bg-surface-hover);
}

/* ==========================================================================
   Analytics Charts Grid
   ========================================================================== */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(440px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.chart-card {
  background: var(--bg-surface-0);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.chart-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Spin Animation */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.spin {
  animation: spin 1s linear infinite;
}

/* ==========================================================================
   Centered App Dialog & Confirmation Modal System
   ========================================================================== */
.app-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: dialogOverlayFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.app-dialog-overlay.closing {
  animation: dialogOverlayFadeOut 0.15s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes dialogOverlayFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes dialogOverlayFadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

.app-dialog-box {
  background: var(--bg-surface-0);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg), 0 0 30px rgba(0, 0, 0, 0.5);
  width: 100%;
  max-width: 480px;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  animation: dialogBoxPopIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transform-origin: center center;
}

.app-dialog-overlay.closing .app-dialog-box {
  animation: dialogBoxPopOut 0.15s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes dialogBoxPopIn {
  from { opacity: 0; transform: scale(0.94) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes dialogBoxPopOut {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(0.94); }
}

/* Centered Fullscreen Modal Backdrops (Viewport Fixed) */
.app-modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  z-index: 99999;
  background: rgba(0, 0, 0, 0.76);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  box-sizing: border-box;
  overflow: hidden;
}

.app-modal-backdrop.active {
  display: flex !important;
}

.modal-dialog-box {
  animation: modalPopIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transform-origin: center center;
}

@keyframes modalPopIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.app-dialog-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.app-dialog-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.app-dialog-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.app-dialog-message {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.app-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding-top: 0.5rem;
}

/* ==========================================================================
   Model Deepdive - Collapsible Sections & Advanced Analytics
   ========================================================================== */
.deepdive-collapsible-section {
  background: var(--bg-surface-0);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.deepdive-collapsible-section:hover {
  border-color: var(--border-hover);
}

.deepdive-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  background: var(--bg-surface-1);
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease;
}

.deepdive-section-header:hover {
  background: var(--bg-surface-2);
}

.deepdive-section-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.deepdive-section-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--accent-blue-bg);
  color: var(--accent-blue);
}

.deepdive-section-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
}

.deepdive-section-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.deepdive-chevron {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.deepdive-collapsible-section.is-collapsed .deepdive-section-header {
  border-bottom: none;
}

.deepdive-collapsible-section.is-collapsed .deepdive-chevron {
  transform: rotate(-90deg);
}

.deepdive-collapsible-section.is-collapsed .deepdive-section-body {
  display: none;
}

.deepdive-section-body {
  padding: 1.5rem;
}

.dossier-hero {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.08) 0%, rgba(3, 105, 161, 0.03) 100%);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.dossier-role-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--accent-blue-bg);
  color: var(--accent-blue);
  border: 1px solid rgba(2, 132, 199, 0.3);
  margin-bottom: 0.5rem;
}

/* Test Suite Performance Summary Cards */
.suite-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.25rem;
}

.suite-summary-card {
  background: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.suite-summary-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
}

.suite-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 0.5rem;
}

.suite-card-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
}

.suite-card-cat {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}

.suite-card-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.suite-progress-container {
  margin-bottom: 1rem;
}

.suite-progress-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  margin-bottom: 6px;
}

.suite-progress-rate {
  font-weight: 800;
  font-family: var(--font-mono);
}

.suite-progress-bar {
  height: 7px;
  background: var(--bg-surface-2);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.suite-progress-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.5s ease;
}

.suite-progress-fill.pass {
  background: linear-gradient(90deg, #10b981, #34d399);
}

.suite-progress-fill.warn {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.suite-progress-fill.fail {
  background: linear-gradient(90deg, #ef4444, #f87171);
}

.suite-progress-fill.untested {
  background: var(--text-muted);
}

.suite-metrics-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: var(--bg-surface-0);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px;
  text-align: center;
  margin-bottom: 1rem;
}

.suite-metric-item {
  display: flex;
  flex-direction: column;
}

.suite-metric-val {
  font-size: 0.88rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-primary);
}

.suite-metric-lbl {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Detailed Test Case Explorer */
.deepdive-filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  background: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.deepdive-filter-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-pill-btn {
  background: var(--bg-surface-0);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-pill-btn:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.filter-pill-btn.active {
  background: var(--accent-blue-bg);
  border-color: rgba(56, 189, 248, 0.4);
  color: var(--accent-blue);
  font-weight: 700;
}

.deepdive-test-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.test-case-card {
  background: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all 0.15s ease;
}

.test-case-card:hover {
  border-color: var(--border-hover);
}

.test-case-card.failed-test {
  border-left: 4px solid var(--accent-rose);
}

.test-case-card.passed-test {
  border-left: 4px solid var(--accent-emerald);
}

.test-case-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  cursor: pointer;
  user-select: none;
  gap: 1rem;
  flex-wrap: wrap;
}

.test-case-header:hover {
  background: var(--bg-surface-2);
}

.test-case-title-area {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 260px;
}

.test-case-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
}

.test-case-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.test-case-body {
  display: none;
  padding: 1.25rem;
  background: var(--bg-surface-0);
  border-top: 1px solid var(--border-subtle);
}

.test-case-card.is-open .test-case-body {
  display: block;
}

.test-case-card.is-open .test-case-chevron {
  transform: rotate(180deg);
}

.test-case-chevron {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.test-box-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.test-code-box {
  background: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 280px;
  overflow-y: auto;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.diagnostic-callout-box {
  background: rgba(244, 63, 94, 0.05);
  border: 1px solid rgba(244, 63, 94, 0.25);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-top: 1rem;
}

.diagnostic-callout-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--accent-rose);
  font-size: 0.88rem;
  margin-bottom: 0.5rem;
}

.diagnostic-callout-desc {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 0.5rem;
}

.diagnostic-callout-mitigation {
  font-size: 0.82rem;
  color: var(--accent-amber);
  background: rgba(251, 191, 36, 0.08);
  border-left: 3px solid var(--accent-amber);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
}

.traffic-light-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 0;
}

@media (max-width: 900px) {
  .traffic-light-grid {
    grid-template-columns: 1fr;
  }
}

.green-flag-panel {
  background: rgba(16, 185, 129, 0.04);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.red-flag-panel {
  background: rgba(244, 63, 94, 0.04);
  border: 1px solid rgba(244, 63, 94, 0.25);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.flag-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

.green-flag-panel .flag-header {
  color: var(--accent-emerald);
}

.red-flag-panel .flag-header {
  color: var(--accent-rose);
}

.flag-item {
  background: var(--bg-surface-0);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow-sm);
}

.flag-item-title {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
}

.flag-item-desc {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.flag-item-mitigation {
  font-size: 0.8rem;
  color: var(--accent-amber);
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--border-subtle);
}

/* Stress Ladder Visual Progress Bar */
.stress-ladder-wrapper {
  background: var(--bg-surface-0);
  border-radius: var(--radius-lg);
  padding: 0;
  margin-bottom: 0;
}

.stress-steps-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.75rem;
  margin-top: 1rem;
}

@media (max-width: 768px) {
  .stress-steps-row {
    grid-template-columns: 1fr;
  }
}

.stress-step-box {
  background: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  text-align: center;
  transition: all 0.2s ease;
}

.stress-step-box.passed {
  background: var(--accent-emerald-bg);
  border-color: rgba(16, 185, 129, 0.4);
}

.stress-step-box.ceiling {
  background: var(--accent-rose-bg);
  border-color: rgba(244, 63, 94, 0.4);
}

.stress-step-lvl {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.stress-step-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
  line-height: 1.25;
}

.stress-step-rate {
  font-size: 0.95rem;
  font-weight: 800;
  font-family: var(--font-mono);
}

.wizard-result-box {
  background: var(--bg-surface-0);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-top: 1.25rem;
  box-shadow: var(--shadow-md);
}

/* 5-Factor Failure Autopsy Modal */
.autopsy-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  font-family: var(--font-mono);
}

.autopsy-badge.schema { background: var(--accent-rose-bg); color: var(--accent-rose); border: 1px solid rgba(244, 63, 94, 0.3); }
.autopsy-badge.prompt { background: var(--accent-amber-bg); color: var(--accent-amber); border: 1px solid rgba(245, 158, 11, 0.3); }
.autopsy-badge.logic { background: rgba(139, 92, 246, 0.12); color: #a78bfa; border: 1px solid rgba(139, 92, 246, 0.3); }
.autopsy-badge.drift { background: rgba(236, 72, 153, 0.12); color: #f472b6; border: 1px solid rgba(236, 72, 153, 0.3); }
.autopsy-badge.inflexible { background: var(--accent-blue-bg); color: var(--accent-blue); border: 1px solid rgba(2, 132, 199, 0.3); }

/* ==========================================================================
   Chart Model Filter Toolbar & Interactive Selection Pills
   ========================================================================== */
.chart-filter-toolbar {
  background: var(--bg-surface-0);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  box-shadow: var(--shadow-sm);
}

.chart-filter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.chart-filter-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chart-preset-group {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.chart-preset-btn {
  background: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.chart-preset-btn:hover {
  color: var(--text-primary);
  background: var(--bg-surface-hover);
  border-color: var(--border-hover);
}

.chart-preset-btn.active {
  background: var(--accent-blue-bg);
  color: var(--accent-blue);
  border-color: rgba(56, 189, 248, 0.4);
  font-weight: 700;
}

.chart-pills-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.model-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: var(--font-sans);
  background: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.model-filter-pill:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.model-filter-pill.active {
  background: var(--bg-surface-0);
  color: var(--text-primary);
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
  font-weight: 700;
}

.model-filter-pill .pill-color-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.model-filter-pill.active .pill-color-dot {
  transform: scale(1.25);
}

.model-filter-pill .pill-check {
  font-size: 0.75rem;
  opacity: 0;
  display: none;
}

.model-filter-pill.active .pill-check {
  opacity: 1;
  display: inline;
}

/* ==========================================================================
   Table Toolbars & Sortable Headers
   ========================================================================== */
.table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.table-search-box {
  display: flex;
  align-items: center;
  background: var(--bg-surface-0);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.75rem;
  gap: 0.5rem;
  min-width: 260px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.table-search-box:focus-within {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px var(--accent-blue-glow);
}

.table-search-input {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.82rem;
  font-family: var(--font-sans);
  outline: none;
  width: 100%;
}

.table-search-input::placeholder {
  color: var(--text-muted);
}

.table-filter-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.table-filter-btn {
  background: var(--bg-surface-0);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.table-filter-btn:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.table-filter-btn.active {
  background: var(--accent-blue-bg);
  color: var(--accent-blue);
  border-color: rgba(56, 189, 248, 0.4);
  font-weight: 700;
}

/* Sortable Table Headers */
.data-table th.sortable {
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s ease, color 0.15s ease;
  position: relative;
  padding-right: 1.6rem;
}

.data-table th.sortable:hover {
  background-color: var(--bg-surface-hover);
  color: var(--accent-blue);
}

.data-table th.sortable::after {
  content: '↕';
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.35;
  font-size: 0.75rem;
  font-weight: normal;
}

.data-table th.sorted-asc {
  color: var(--accent-blue);
  background-color: var(--bg-surface-hover);
}

.data-table th.sorted-asc::after {
  content: '▲';
  opacity: 1;
  color: var(--accent-blue);
}

.data-table th.sorted-desc {
  color: var(--accent-blue);
  background-color: var(--bg-surface-hover);
}

.data-table th.sorted-desc::after {
  content: '▼';
  opacity: 1;
  color: var(--accent-blue);
}

/* ==========================================================================
   Collapsible Suite Diff Sections
   ========================================================================== */
.diff-suite-section {
  background: var(--bg-surface-0);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: 1.25rem;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.diff-suite-section:hover {
  border-color: var(--border-medium);
}

.diff-suite-section[open] {
  box-shadow: var(--shadow-md);
  border-color: var(--border-medium);
}

.diff-suite-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.15rem 1.35rem;
  background: var(--bg-surface-1);
  cursor: pointer;
  user-select: none;
  list-style: none;
  font-family: var(--font-sans);
  transition: background-color 0.15s ease;
}

.diff-suite-summary::-webkit-details-marker {
  display: none;
}

.diff-suite-summary:hover {
  background: var(--bg-surface-hover);
}

.diff-suite-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.diff-suite-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.diff-suite-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.diff-suite-arrow {
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  font-size: 0.85rem;
}

.diff-suite-section[open] .diff-suite-arrow {
  transform: rotate(180deg);
}

.diff-suite-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface-0);
}

/* ==========================================================================
   Remediation Hub & Fault Cards
   ========================================================================== */
.fault-card {
  background: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--accent-rose);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.fault-card:hover {
  border-color: var(--border-medium);
  box-shadow: var(--shadow-sm);
}

.fault-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.fault-tag-zero {
  background: rgba(244, 63, 94, 0.12);
  color: var(--accent-rose);
  border: 1px solid rgba(244, 63, 94, 0.25);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.fault-tag-conn {
  background: rgba(245, 158, 11, 0.12);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.25);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.fault-prompt-box {
  background: var(--bg-surface-0);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.fault-actions-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-subtle);
}

.infra-fault-callout {
  background: rgba(244, 63, 94, 0.08);
  border: 1px dashed rgba(244, 63, 94, 0.35);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-top: 1rem;
}

@keyframes spin-anim {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.spin {
  animation: spin-anim 1s linear infinite;
  display: inline-block;
}

@keyframes pulse-dot-anim {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

.pulse-dot {
  width: 7px;
  height: 7px;
  background: var(--accent-amber);
  border-radius: 50%;
  display: inline-block;
  animation: pulse-dot-anim 1.6s infinite;
}

.badge-running-remediation {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.35);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 6px;
}

/* =========================================================================
   MODEL PARAMETER SIZE CLUSTER FILTERING & BADGES
   ========================================================================= */

.cluster-filter-container {
  background: var(--bg-surface-0);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 0.75rem 1rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.cluster-filter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.cluster-filter-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.01em;
}

.cluster-pills-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.cluster-pill {
  background: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.cluster-pill:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
  border-color: var(--border-medium);
  transform: translateY(-1px);
}

.cluster-pill:active {
  transform: translateY(0);
}

.cluster-pill.active {
  background: var(--accent-blue-bg);
  color: var(--accent-blue);
  border-color: rgba(59, 130, 246, 0.45);
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(59, 130, 246, 0.15);
}

.cluster-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
  background: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.cluster-badge[data-tier="EXTRA_SMALL"],
.cluster-badge.tier-xs {
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent-emerald);
  border-color: rgba(16, 185, 129, 0.25);
}

.cluster-badge[data-tier="SMALL"],
.cluster-badge.tier-s {
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent-blue);
  border-color: rgba(59, 130, 246, 0.25);
}

.cluster-badge[data-tier="MEDIUM"],
.cluster-badge.tier-m {
  background: rgba(168, 85, 247, 0.1);
  color: var(--accent-purple);
  border-color: rgba(168, 85, 247, 0.25);
}

.cluster-badge[data-tier="LARGE"],
.cluster-badge.tier-l {
  background: rgba(245, 158, 11, 0.1);
  color: var(--accent-amber);
  border-color: rgba(245, 158, 11, 0.25);
}

.cluster-badge[data-tier="EXTRA_LARGE"],
.cluster-badge.tier-xl {
  background: rgba(244, 63, 94, 0.1);
  color: var(--accent-rose);
  border-color: rgba(244, 63, 94, 0.25);
}

.moe-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 800;
  font-family: var(--font-mono);
  background: rgba(245, 158, 11, 0.12);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
  margin-left: 4px;
}

.matrix-cluster-sticky-bar {
  position: sticky;
  top: 70px;
  z-index: 10;
  backdrop-filter: blur(8px);
}

/* ==========================================================================
   About & User Guide Page Styles
   ========================================================================== */

.about-container {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  max-width: 1280px;
  margin: 0 auto;
  padding-bottom: 3rem;
}

.about-quicknav-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.5rem;
  background: var(--bg-surface-0);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  scrollbar-width: none;
}

.about-quicknav-bar::-webkit-scrollbar {
  display: none;
}

.about-nav-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.about-nav-pill:hover {
  color: var(--text-primary);
  background: var(--bg-surface-1);
}

.about-nav-pill.active {
  background: var(--bg-surface-2);
  color: var(--accent-blue);
  border-color: var(--border-medium);
  box-shadow: var(--shadow-sm);
}

.about-section {
  scroll-margin-top: 80px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.about-section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.about-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.about-section-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 3px;
  line-height: 1.5;
}

/* Comparison Grid (LLM Judge vs Ground Truth) */
.about-compare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
}

.about-compare-card {
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  background: var(--bg-surface-0);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.about-compare-card.truth {
  border-color: rgba(56, 189, 248, 0.3);
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.04) 0%, var(--bg-surface-0) 100%);
}

.about-compare-card.flawed {
  border-color: rgba(248, 113, 113, 0.25);
  background: linear-gradient(180deg, rgba(248, 113, 113, 0.03) 0%, var(--bg-surface-0) 100%);
}

/* Tab Tour Layout */
.about-tour-container {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.25rem;
  align-items: stretch;
}

@media (max-width: 900px) {
  .about-tour-container {
    grid-template-columns: 1fr;
  }
}

.about-tab-nav-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  background: var(--bg-surface-0);
  padding: 0.75rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
}

.about-tab-nav-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.about-tab-nav-btn:hover {
  color: var(--text-primary);
  background: var(--bg-surface-1);
}

.about-tab-nav-btn.active {
  background: var(--bg-surface-2);
  color: var(--accent-blue);
  border-color: var(--border-medium);
  box-shadow: var(--shadow-sm);
}

.about-tab-preview-box {
  background: var(--bg-surface-0);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

/* Verifier Simulator */
.about-verifier-pills-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.4rem;
  background: var(--bg-surface-0);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.about-verifier-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.about-verifier-pill:hover {
  color: var(--text-primary);
  background: var(--bg-surface-1);
}

.about-verifier-pill.active {
  background: var(--bg-surface-2);
  color: var(--accent-blue);
  border-color: var(--border-medium);
}

/* Playbook Tasks Grid */
.about-playbook-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.about-playbook-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-surface-0);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all 0.2s ease;
}

.about-playbook-btn:hover {
  color: var(--text-primary);
  background: var(--bg-surface-1);
  border-color: var(--border-hover);
}

.about-playbook-btn.active {
  background: var(--bg-surface-2);
  color: var(--accent-blue);
  border-color: var(--accent-blue);
  box-shadow: var(--shadow-sm);
}

/* FAQ Accordion */
.about-faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.about-faq-item {
  background: var(--bg-surface-0);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.about-faq-item:hover {
  border-color: var(--border-medium);
}

.about-faq-item.open {
  border-color: var(--border-hover);
}

.about-faq-header {
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
  gap: 1rem;
}

.about-faq-chevron {
  transition: transform 0.25s ease;
  color: var(--text-muted);
}

.about-faq-item.open .about-faq-chevron {
  transform: rotate(180deg);
  color: var(--accent-blue);
}

.about-faq-body {
  display: none;
  padding: 0 1.25rem 1.25rem 1.25rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.85rem;
}

.about-faq-item.open .about-faq-body {
  display: block;
}

/* ==========================================================================
   INTERACTIVE LEVEL POPOVERS (Progressive Stress Ladder Details)
   ========================================================================== */

.level-header-th {
  position: relative;
  transition: all 0.2s ease;
}

.level-header-th:hover {
  background: var(--bg-surface-hover) !important;
}

.level-info-icon {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-left: 3px;
  vertical-align: middle;
  opacity: 0.5;
  color: var(--accent-blue);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.level-header-th:hover .level-info-icon {
  opacity: 1;
  transform: scale(1.15);
}

.interactive-level-cell {
  cursor: pointer;
  display: inline-block;
  transition: all 0.15s ease;
  position: relative;
  user-select: none;
}

.interactive-level-cell:hover {
  transform: translateY(-1px) scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.interactive-level-cell:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

/* Global Dynamic Popover Container */
.stress-level-popover {
  position: fixed;
  z-index: 999999;
  width: 380px;
  max-width: calc(100vw - 32px);
  background: #002b36;
  background: linear-gradient(145deg, #073642 0%, #002b36 100%);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 12px;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.05);
  padding: 1.1rem;
  color: var(--text-primary);
  font-family: var(--font-sans);
  pointer-events: auto;
  opacity: 0;
  transform: translateY(6px) scale(0.97);
  transition: opacity 0.18s cubic-bezier(0.16, 1, 0.3, 1), transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(12px);
}

.stress-level-popover.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.popover-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.6rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.popover-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.popover-tier-badge {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 4px;
  width: fit-content;
}

.tier-badge-1 { background: rgba(56, 189, 248, 0.18); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.3); }
.tier-badge-2 { background: rgba(52, 211, 153, 0.18); color: #34d399; border: 1px solid rgba(52, 211, 153, 0.3); }
.tier-badge-3 { background: rgba(251, 191, 36, 0.18); color: #fbbf24; border: 1px solid rgba(251, 191, 36, 0.3); }
.tier-badge-4 { background: rgba(167, 139, 250, 0.18); color: #a78bfa; border: 1px solid rgba(167, 139, 250, 0.3); }
.tier-badge-5 { background: rgba(244, 114, 182, 0.18); color: #f472b6; border: 1px solid rgba(244, 114, 182, 0.3); }

.popover-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.popover-score-badge {
  font-size: 1.1rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.popover-desc {
  font-size: 0.78rem;
  color: #93a1a1;
  line-height: 1.45;
  margin-bottom: 0.75rem;
}

.popover-target-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.72rem;
  color: #839496;
  margin-bottom: 0.75rem;
}

.popover-target-box strong {
  color: #2aa198;
}

.popover-section-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #586e75;
  margin-bottom: 0.4rem;
}

.popover-benchmarks-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 0.75rem;
}

.popover-benchmark-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 0.75rem;
}

.popover-benchmark-name {
  font-weight: 600;
  color: #eee8d5;
}

.popover-benchmark-count {
  font-size: 0.7rem;
  color: #839496;
  background: rgba(0, 0, 0, 0.3);
  padding: 1px 6px;
  border-radius: 4px;
}

.popover-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 0.75rem;
}

.popover-stat-card {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  padding: 6px 8px;
}

.popover-stat-card .label {
  font-size: 0.65rem;
  color: #586e75;
  text-transform: uppercase;
}

.popover-stat-card .val {
  font-size: 0.85rem;
  font-weight: 700;
  color: #268bd2;
}

.popover-test-results-list {
  max-height: 160px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-right: 4px;
}

.popover-test-results-list::-webkit-scrollbar {
  width: 4px;
}

.popover-test-results-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.popover-test-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 0.72rem;
  background: rgba(0, 0, 0, 0.15);
  border-left: 2px solid transparent;
}

.popover-test-item.pass {
  border-left-color: var(--accent-emerald);
}

.popover-test-item.fail {
  border-left-color: var(--accent-rose);
}

.popover-test-name {
  color: #eee8d5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}

.popover-test-status {
  font-weight: 700;
  font-size: 0.68rem;
}

/* ==========================================================================
   Deepdive Level Sub-Segmentation & Level Bands
   ========================================================================== */
.level-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  padding: 8px 12px;
  background: var(--bg-surface-0);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.level-pill-btn {
  background: var(--bg-surface-1);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.level-pill-btn:hover {
  border-color: var(--border-medium);
  color: var(--text-primary);
}

.level-pill-btn.active {
  background: var(--accent-blue-bg);
  color: var(--accent-blue);
  border-color: var(--accent-blue);
  font-weight: 700;
}

.level-pill-btn.active.l1 {
  background: var(--accent-emerald-bg);
  color: var(--accent-emerald);
  border-color: var(--accent-emerald);
}

.level-pill-btn.active.l2 {
  background: var(--accent-blue-bg);
  color: var(--accent-blue);
  border-color: var(--accent-blue);
}

.level-pill-btn.active.l3 {
  background: var(--accent-indigo-bg);
  color: var(--accent-indigo);
  border-color: var(--accent-indigo);
}

.level-pill-btn.active.l4 {
  background: var(--accent-amber-bg);
  color: var(--accent-amber);
  border-color: var(--accent-amber);
}

.level-pill-btn.active.l5 {
  background: var(--accent-rose-bg);
  color: var(--accent-rose);
  border-color: var(--accent-rose);
}

.deepdive-level-band {
  background: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.deepdive-level-band:hover {
  border-color: var(--border-medium);
}

.deepdive-level-band-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  background: rgba(0, 0, 0, 0.15);
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  user-select: none;
}

.level-band-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.level-band-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.level-band-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.level-band-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.level-band-body {
  padding: 1rem 1.25rem;
}

.deepdive-level-band.is-collapsed .level-band-body {
  display: none;
}

.deepdive-level-band.is-collapsed .deepdive-chevron {
  transform: rotate(-90deg);
}

/* Level Badges */
.level-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
}

.level-badge.l1 {
  background: var(--accent-emerald-bg);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.level-badge.l2 {
  background: var(--accent-blue-bg);
  color: var(--accent-blue);
  border: 1px solid rgba(38, 139, 210, 0.3);
}

.level-badge.l3 {
  background: var(--accent-indigo-bg);
  color: var(--accent-indigo);
  border: 1px solid rgba(108, 113, 196, 0.3);
}

.level-badge.l4 {
  background: var(--accent-amber-bg);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.level-badge.l5 {
  background: var(--accent-rose-bg);
  color: var(--accent-rose);
  border: 1px solid rgba(244, 63, 94, 0.3);
}

/* Detailed Diagnostics Level Section Group */
.deepdive-level-group {
  margin-bottom: 1.5rem;
}

.deepdive-level-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  background: var(--bg-surface-0);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
  cursor: pointer;
}

.deepdive-level-group-header:hover {
  border-color: var(--border-medium);
}

.deepdive-level-group.is-collapsed .deepdive-level-group-body {
  display: none;
}

.deepdive-level-group.is-collapsed .deepdive-chevron {
  transform: rotate(-90deg);
}

/* ============================================================
   RECOMMENDATIONS SUBPAGE NAVIGATION & LEARNINGS DASHBOARD
   ============================================================ */
.subnav-segmented-container {
  display: flex;
  align-items: center;
  margin-bottom: 1.75rem;
  background: var(--bg-surface-0);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 6px;
  width: fit-content;
  max-width: 100%;
}

.subnav-segmented-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.subnav-seg-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  user-select: none;
  white-space: nowrap;
}

.subnav-seg-btn:hover {
  color: var(--text-primary);
  background: var(--bg-surface-1);
}

.subnav-seg-btn.active {
  background: var(--bg-surface-2);
  color: var(--accent-blue);
  border-color: var(--border-medium);
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.rec-subpage {
  display: none;
  animation: fadeInSubpage 0.25s ease-in-out;
}

.rec-subpage.active {
  display: block;
}

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

/* Learnings & Takeaways Specific Styles - Fully Adaptive Light & Dark */
.learnings-hero-banner {
  background: var(--bg-surface-0);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

[data-theme="dark"] .learnings-hero-banner {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.9) 100%);
}

[data-theme="light"] .learnings-hero-banner {
  background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
}

.learnings-hero-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--accent-blue) 0%, var(--accent-emerald) 100%);
}

.skill-callout-banner {
  background: var(--bg-surface-0);
  border: 1px solid var(--border-medium);
  border-left: 4px solid var(--accent-blue);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  margin-bottom: 2.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.learnings-rule-card {
  background: var(--bg-surface-0);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-sm);
}

.learnings-rule-card:hover {
  border-color: var(--border-medium);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.learnings-rule-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-mono);
  width: fit-content;
}

.learnings-chart-card {
  background: var(--bg-surface-0);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow-sm);
}

.learnings-chart-card:hover {
  border-color: var(--border-medium);
}

.learnings-chart-img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  display: block;
  margin: 1.25rem 0;
  background: #0b0f17;
}

.learnings-code-box {
  background: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.1rem;
  margin-top: 0.5rem;
}

.learnings-code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.learnings-code-content {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
  background: transparent;
  margin: 0;
}

.copy-snippet-btn {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.74rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
  user-select: none;
}

.copy-snippet-btn:hover {
  color: var(--text-primary);
  background: var(--bg-surface-hover);
  border-color: var(--border-medium);
}
