/* CSS Variables for consistent theming */
:root {
  /* Vortex Brand Colors */
  --vortex-black: #101010;
  --vortex-gray: #ECECEC;
  --vortex-green: #CEE562;
  --vortex-blue: #5971FD;
  --vortex-pink: #EEB3E1;
  
  /* Theme Colors */
  --primary-color: var(--vortex-blue);
  --primary-hover: #4A5FE5;
  --accent-color: var(--vortex-green);
  --bg-color: #ffffff;
  --bg-secondary: #FAFAFA;
  --text-color: var(--vortex-black);
  --text-secondary: #666666;
  --border-color: var(--vortex-gray);
  
  /* Layout */
  --header-height: 72px;
  --sidebar-width: 280px;
  --chart-spacing: 24px;
  --mobile-breakpoint: 768px;
  --tablet-breakpoint: 1024px;
  
  /* Shadows - softer for modern look */
  --shadow-sm: 0 1px 3px rgba(16,16,16,0.08);
  --shadow-md: 0 4px 8px rgba(16,16,16,0.08);
  --shadow-lg: 0 12px 24px rgba(16,16,16,0.12);
  
  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

/* Reset and base styles */
* {
  box-sizing: border-box;
}

html {
  font-family: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", "SF Pro Display", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--bg-color);
  font-size: 16px;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  color: var(--text-color);
  margin: 0;
  padding: 0;
  font-size: 1em;
  font-weight: 400;
  padding-top: var(--header-height);
  line-height: 1.6;
  letter-spacing: -0.01em;
  overflow-x: hidden;
  position: relative;
}

/* Sticky Header */
.sticky-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.95);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  z-index: 1000;
  display: flex;
  align-items: center;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 32px;
  width: 100%;
}

/* Match padding with main content */
@media (min-width: 1600px) {
  .header-content {
    padding: 0 60px;
  }
}

@media (min-width: 1920px) {
  .header-content {
    padding: 0 80px;
  }
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.menu-toggle {
  display: block;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  color: var(--text-color);
}

.menu-toggle:hover {
  background-color: var(--bg-secondary);
}

.logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  transition: opacity 0.2s;
}

.logo-link:hover {
  opacity: 0.8;
}

.site-logo {
  height: 48px;
  width: auto;
  display: block;
}

.site-title {
  font-family: "Funnel Display", sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
  margin-left: calc(var(--sidebar-width) - 180px); /* Moved left by ~100px */
  color: var(--text-color);
  display: none;
  white-space: nowrap;
}

/* Show title on desktop screens */
@media (min-width: 1400px) {
  .site-title {
    display: block;
  }
}

.header-center {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 0 20px;
}

.filter-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.control-btn, .view-btn {
  font-family: "Geist", sans-serif;
  padding: 8px 20px;
  border: 1px solid var(--border-color);
  background: var(--bg-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  white-space: nowrap;
}

.control-btn:hover, .view-btn:hover {
  background-color: var(--bg-secondary);
  border-color: var(--primary-color);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.view-btn.active {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.category-filter, .search-filter {
  font-family: "Geist", sans-serif;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  background: var(--bg-color);
  transition: border-color 0.2s;
}

.category-filter:focus, .search-filter:focus {
  outline: none;
  border-color: var(--primary-color);
}

.search-filter {
  width: 200px;
}

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

.view-controls {
  display: flex;
  gap: 4px;
}

.repo-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-color);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  padding: 8px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all 0.2s;
}

.github-logo {
  flex-shrink: 0;
}

.repo-link:hover {
  background-color: var(--bg-secondary);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

/* Main Container */
.main-container {
  display: flex;
  min-height: calc(100vh - var(--header-height));
  overflow-x: hidden;
  width: 100%;
}

/* Sidebar Navigation */
.sidebar {
  width: var(--sidebar-width);
  background: rgba(250, 250, 250, 0.98);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-right: 1px solid var(--border-color);
  position: fixed;
  top: var(--header-height);
  left: 0;
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  transition: transform 0.3s ease;
  z-index: 998;
  transform: translateX(-100%); /* Start collapsed by default */
}

/* Desktop: sidebar overlay styling */
@media (min-width: 1200px) {
  .sidebar {
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15);
  }
  
  .sidebar.collapsed {
    transform: translateX(-100%);
  }
  
  .sidebar:not(.collapsed) {
    transform: translateX(0);
  }
  
  /* Remove margin from main content - sidebar is now overlay */
  .main-content {
    margin-left: 0;
    width: 100%;
  }
}

/* Hide sidebar on tablets and mobile by default */
@media (max-width: 1199px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15);
  }
  
  .sidebar.active {
    transform: translateX(0);
  }
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  height: 100%;
}

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

.sidebar-header h2 {
  font-family: "Funnel Display", sans-serif;
  margin: 0;
  font-size: 1.2rem;
  color: var(--text-color);
  font-weight: 600;
}

.sidebar-close {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

/* Show close button on tablets and mobile */
@media (max-width: 1199px) {
  .sidebar-close {
    display: block;
  }
}

.clear-filter-btn {
  font-family: "Geist", sans-serif;
  width: calc(100% - 40px);
  margin: 16px 20px;
  padding: 10px 16px;
  background-color: var(--primary-color);
  color: white;
  border: 1px solid var(--primary-color);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.clear-filter-btn:hover {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 1;
  overflow-y: auto;
}

.toc-list li {
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.toc-list a {
  display: block;
  padding: 12px 20px;
  color: var(--text-color);
  text-decoration: none;
  transition: all 0.2s;
  position: relative;
}

.toc-list a:hover {
  background-color: rgba(89, 113, 253, 0.08);
  color: var(--primary-color);
  padding-left: 24px;
}

.toc-list a.active {
  background-color: rgba(89, 113, 253, 0.12);
  color: var(--primary-color);
  font-weight: 600;
}

.toc-list a.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background-color: var(--primary-color);
}

.sidebar-footer {
  padding: 20px;
  border-top: 1px solid var(--border-color);
}

.download-btn {
  display: block;
  width: 100%;
  padding: 10px 16px;
  background-color: transparent;
  color: var(--text-secondary);
  text-align: center;
  text-decoration: none;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
}

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

/* Main Content */
.main-content {
  flex: 1;
  padding: 32px;
  width: 100%;
  position: relative;
}

/* Larger padding on wide screens */
@media (min-width: 1600px) {
  .main-content {
    padding: 40px 60px;
  }
}

@media (min-width: 1920px) {
  .main-content {
    padding: 48px 80px;
  }
}

/* Adjust padding on smaller screens */
@media (max-width: 768px) {
  .main-content {
    padding: 16px;
  }
}

/* Loading Indicator */
.loading-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  gap: 16px;
}

.loading-indicator p {
  font-family: "Geist", sans-serif;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border-color);
  border-top: 3px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Benchmark Sections */
.benchmark-set {
  margin-bottom: 48px;
  background: var(--bg-color);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow: visible; /* Changed from hidden to allow sticky headers */
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
}

/* Remove top margin from first benchmark set */
.benchmark-set:first-child {
  margin-top: 0;
}

/* Prevent layout shift when first section expands */
.benchmark-set:first-child:not(.collapsed) {
  margin-top: 0;
  padding-top: 0;
}

/* Style for benchmark groups with no data */
.benchmark-set.no-data {
  opacity: 0.5;
}

.benchmark-set.no-data .benchmark-header {
  cursor: not-allowed;
}

.benchmark-set.no-data .benchmark-title {
  color: var(--text-secondary);
}

.benchmark-set.no-data .collapse-icon {
  visibility: hidden;
}

/* Reduce margin on mobile */
@media (max-width: 768px) {
  .benchmark-set {
    margin-bottom: 24px;
    border-radius: var(--radius-md);
  }
}

.benchmark-set.collapsed .benchmark-graphs {
  display: none;
}

.benchmark-set.collapsed .engine-filter-container {
  display: none;
}

/* Wrapper to maintain space when header becomes sticky */
.sticky-header-wrapper {
  position: relative;
}

/* Headers are not sticky when collapsed */
.sticky-header-container {
  position: relative;
  z-index: 50;
  background: var(--bg-secondary);
  /* Maintain border radius at top */
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  margin: 0;
  padding: 0;
}

/* Sticky headers only on desktop to avoid mobile layout issues */
@media (min-width: 769px) {
  .benchmark-set:not(.collapsed) .sticky-header-container {
    position: sticky;
    top: calc(var(--header-height) - 1px);
    /* Add shadow when stuck */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0);
    transition: box-shadow 0.2s ease;
  }

  /* Add shadow when the header is stuck (only for expanded groups) */
  .benchmark-set:not(.collapsed) .sticky-header-container.is-stuck {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }
}


.benchmark-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  transition: background-color 0.2s;
}

/* Adjust padding on smaller screens */
@media (max-width: 1200px) {
  .benchmark-header {
    padding: 14px 24px;
  }
}

@media (max-width: 768px) {
  .benchmark-header {
    padding: 12px 16px;
  }
}

.benchmark-header:hover {
  background: #F5F5F5;
}

.title-wrapper {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
}

.benchmark-title {
  font-family: "Funnel Display", sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
  color: var(--text-color);
  display: flex;
  align-items: center;
  gap: 12px;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.group-link-btn {
  font-size: 18px;
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.5;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  color: var(--text-secondary);
}

.benchmark-header:hover .group-link-btn {
  opacity: 1;
}

.group-link-btn:hover {
  background-color: var(--bg-secondary);
  color: var(--primary-color);
}

.group-link-btn.copied {
  color: var(--accent-color);
  opacity: 1;
}

.collapse-icon {
  font-size: 1rem;
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.benchmark-set.collapsed .collapse-icon {
  transform: rotate(-90deg);
}

.benchmark-secondary-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.benchmark-meta {
  font-family: "Geist Mono", monospace;
  display: flex;
  gap: 16px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  flex-shrink: 0;
  line-height: 1;
}

/* Info icon with tooltip */
.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 16px;
  cursor: help;
  position: relative;
  transition: all 0.2s;
  flex-shrink: 0;
}

.info-icon:hover {
  background: var(--primary-color);
  color: white;
}

.info-icon::after {
  content: attr(data-tooltip);
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 8px;
  padding: 8px 12px;
  background: rgba(16, 16, 16, 0.9);
  color: white;
  font-size: 13px;
  line-height: 1.4;
  border-radius: var(--radius-sm);
  white-space: normal;
  width: 300px;
  max-width: 90vw;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s;
  pointer-events: none;
  z-index: 100;
  font-weight: normal;
}

.info-icon:hover::after {
  opacity: 1;
  visibility: visible;
}

/* Engine Filter Controls */
.engine-filter-container {
  padding: 12px 32px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Adjust padding on smaller screens */
@media (max-width: 768px) {
  .engine-filter-container {
    padding: 12px 16px;
  }
}

.engine-filter-label {
  font-family: "Geist", sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

.engine-filter-btn {
  font-family: "Geist", sans-serif;
  padding: 6px 14px;
  border: 1px solid var(--border-color);
  background: var(--bg-color);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-color);
  cursor: pointer;
  transition: all 0.2s;
}

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

.engine-filter-btn.active {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.engine-filter-btn.active:hover {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
}

.filter-separator {
  margin: 0 12px;
  color: var(--border-color);
  font-weight: 300;
}

.reset-zoom-btn {
  font-family: "Geist", sans-serif;
  padding: 6px 14px;
  border: 1px solid var(--border-color);
  background: var(--bg-color);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.reset-zoom-btn:hover {
  background-color: var(--bg-secondary);
  border-color: var(--primary-color);
  color: var(--text-color);
}

/* Chart Grid */
.benchmark-graphs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  padding: 20px;
  /* Maintain border radius at bottom */
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  background: var(--bg-color);
}

/* Two columns on larger screens */
@media (min-width: 1200px) {
  .benchmark-graphs {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    padding: 24px;
  }
  
  /* Single chart groups should use full width */
  .benchmark-graphs.single-chart {
    grid-template-columns: 1fr;
    max-width: 1400px;
    margin: 0 auto;
  }
}

/* Use more space on wider screens */
@media (min-width: 1600px) {
  .benchmark-graphs {
    padding: 28px 32px;
  }
  
  .benchmark-graphs.single-chart {
    max-width: 1600px;
  }
}

@media (min-width: 1920px) {
  .benchmark-graphs.single-chart {
    max-width: 1800px;
  }
}

/* Single column up to 1200px for better readability */
@media (max-width: 1199px) {
  .benchmark-graphs {
    grid-template-columns: 1fr;
    max-width: 900px;
    margin: 0 auto;
  }
}

.benchmark-graphs.list-view {
  grid-template-columns: 1fr;
  max-width: 1200px;
  margin: 0 auto;
}

@media (min-width: 1600px) {
  .benchmark-graphs.list-view {
    max-width: 1400px;
  }
}

.chart-container {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  position: relative;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

/* Larger padding on bigger screens */
@media (min-width: 1600px) {
  .chart-container {
    padding: 24px;
  }
}

.chart-container:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--primary-color);
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.chart-title {
  font-family: "Funnel Display", sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-color);
  letter-spacing: -0.01em;
}

.chart-actions {
  display: flex;
  gap: 8px;
}

.chart-action-btn {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s;
}

.chart-action-btn:hover {
  background-color: #f5f5f5;
  border-color: var(--primary-color);
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 48px;
  height: 48px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(89, 113, 253, 0.3);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 999;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background-color: var(--primary-hover);
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(89, 113, 253, 0.4);
}

/* Chart Modal */
.chart-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 2000;
}

.chart-modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: var(--bg-color);
  padding: 32px;
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 1200px;
  height: 80vh;
  position: relative;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 32px;
  cursor: pointer;
  color: #666;
  padding: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
}

.modal-close:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: #333;
}

.modal-chart-container {
  width: 100%;
  height: calc(100% - 48px);
  position: relative;
}

/* Sidebar hover zone - disabled */
.sidebar-hover-zone {
  display: none;
}

/* Sidebar overlay for all screen sizes */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 997;
}

/* Lighter overlay on desktop for better UX */
@media (min-width: 1200px) {
  .sidebar-overlay {
    background: rgba(0, 0, 0, 0.3);
  }
}

/* Show overlay only when sidebar has explicit 'open' class */
.sidebar.open ~ .sidebar-overlay {
  display: block;
}

/* For mobile - show overlay when active class is present */
@media (max-width: 1199px) {
  .sidebar.active ~ .sidebar-overlay {
    display: block;
  }
  
  /* On mobile, don't use the 'open' class rule */
  .sidebar.open ~ .sidebar-overlay {
    display: none;
  }
  
  /* Re-enable for mobile active state */
  .sidebar.active ~ .sidebar-overlay {
    display: block;
  }
}

/* Site title visibility handled in the .site-title section above */

/* Tablet styles */
@media (min-width: 769px) and (max-width: 1199px) {
  .header-center {
    display: flex;
  }
  
  .search-filter {
    width: 150px;
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 56px;
  }
  
  body {
    padding-top: var(--header-height);
  }

  .header-content {
    padding: 0 8px;
    gap: 8px;
  }

  .header-left {
    gap: 8px;
  }

  .header-right {
    gap: 8px;
  }

  .site-logo {
    height: 32px;
  }
  
  .site-title {
    display: none;
  }

  .view-controls {
    display: none;
  }

  .repo-link {
    padding: 6px 10px;
    font-size: 12px;
  }

  .repo-link span {
    display: none;
  }

  .header-center {
    display: none;
  }

  /* Menu toggle and sidebar are handled in their respective sections above */

  .main-content {
    padding: 16px;
  }

  .benchmark-set {
    margin-bottom: 24px;
  }

  .benchmark-header {
    padding: 16px;
    flex-wrap: wrap;
    gap: 12px;
  }
  
  /* Sticky header handled in the sticky-header-container section above */

  .benchmark-title {
    font-size: 1.25rem;
    flex: 1 1 100%;
  }
  
  .title-wrapper {
    flex-wrap: wrap;
    flex: 1 1 100%;
  }
  
  .benchmark-secondary-info {
    flex: 1 1 100%;
    margin-top: 8px;
  }

  .benchmark-graphs {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 16px;
  }
  
  .benchmark-set {
    border-radius: 0;
    margin-bottom: 16px;
  }

  .chart-container {
    padding: 12px;
    will-change: auto; /* Prevent unnecessary GPU layers */
  }
  
  .chart-container canvas {
    max-height: 350px; /* Smaller charts on mobile */
    min-height: 250px; /* Ensure minimum height */
  }
  
  /* Disable hover effects on mobile */
  .chart-container:hover {
    transform: none;
    box-shadow: none;
  }
  
  /* Hide fullscreen button on mobile */
  .chart-action-btn {
    display: none;
  }
  
  /* Hide engine filters on mobile to save space */
  .engine-filter-container {
    padding: 12px 16px;
    flex-wrap: wrap;
  }
  
  .filter-separator {
    display: none;
  }
  
  /* Hide reset zoom button on mobile since X-axis scrolling is disabled */
  .reset-zoom-btn {
    display: none;
  }
  
  /* Hide empty control containers on mobile */
  .engine-filter-container:not(:has(.engine-filter-btn)) {
    display: none;
  }

  .back-to-top {
    bottom: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    font-size: 16px;
  }

  .modal-content {
    padding: 16px;
    height: 90vh;
  }
}

/* Additional brand styling */
.header-content {
  gap: 24px;
}

.filter-controls {
  max-width: 600px;
}

/* Typography hierarchy */
h1, h2, h3, h4, h5, h6 {
  font-family: "Funnel Display", sans-serif;
  font-weight: 600;
  letter-spacing: -0.02em;
}

code, pre {
  font-family: "Geist Mono", monospace;
  font-size: 0.9em;
}

/* Utility Classes */
.hidden {
  display: none !important;
}

.fade-in {
  animation: fadeIn 0.3s ease;
}

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

/* Chart specific improvements - handled in main .chart-container section above */

.chart-container canvas {
  max-height: 450px;
  min-height: 320px;
  width: 100% !important;
  height: auto !important;
  display: block;
}

.benchmark-graphs.list-view .chart-container canvas {
  max-height: 600px;
  min-height: 400px;
}

/* Larger charts on wide screens */
@media (min-width: 1600px) {
  .chart-container canvas {
    max-height: 520px;
    min-height: 360px;
  }
  
  .benchmark-graphs.list-view .chart-container canvas {
    max-height: 620px;
    min-height: 450px;
  }
}


/* Wide screen optimizations - keep 2 columns but add more spacing */
@media (min-width: 1920px) {
  .benchmark-graphs {
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
    padding: 32px 48px;
  }
  
  .chart-container canvas {
    max-height: 580px;
    min-height: 400px;
  }
  
  .benchmark-graphs.list-view .chart-container canvas {
    max-height: 680px;
    min-height: 480px;
  }
}

/* Ultra-wide screens - still 2 columns but even more padding */
@media (min-width: 2400px) {
  .benchmark-graphs {
    grid-template-columns: repeat(2, 1fr);
    gap: 36px;
    padding: 36px 60px;
  }
}

@media (max-width: 480px) {
  .site-title {
    font-size: 1rem;
  }
  
  .benchmark-title {
    font-size: 1.2rem;
  }
  
  .chart-title {
    font-size: 14px;
  }
}

/* Benchmark Scores Summary */
.benchmark-scores-summary {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 32px;
  margin: 0;
  /* Ensure no top margin when following sticky container */
  margin-top: 0 !important;
}

@media (max-width: 768px) {
  .benchmark-scores-summary {
    padding: 8px 16px;
  }
  
  .benchmark-scores-summary .scores-list {
    display: flex;
    flex-direction: column;
    column-count: 1;
    gap: 6px;
  }
  
  .benchmark-scores-summary .scores-title {
    font-size: 11px;
    margin-bottom: 6px;
  }
  
  .benchmark-scores-summary .score-item {
    padding: 8px 10px;
    margin-bottom: 6px;
    font-size: 12px;
  }
  
  .benchmark-scores-summary .score-rank {
    font-size: 13px;
    min-width: 28px;
  }
  
  .benchmark-scores-summary .score-series {
    font-size: 13px;
    margin: 0 6px;
  }
  
  .benchmark-scores-summary .score-value {
    font-size: 12px;
    padding: 2px 8px;
  }
  
  .benchmark-scores-summary .score-runtime,
  .benchmark-scores-summary .score-label {
    font-size: 11px;
  }
  
  .benchmark-scores-summary .scores-explanation {
    font-size: 11px;
    margin-top: 6px;
  }
}

.scores-title {
  font-size: 12px;
  font-weight: 600;
  margin: 0 0 8px 0;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.scores-list {
  column-count: 2;
  column-gap: 20px;
}

/* Single item should use full width */
.scores-list:has(.score-item:only-child) {
  column-count: 1;
}

/* Single column for smaller screens */
@media (max-width: 780px) {
  .scores-list {
    column-count: 1;
  }
}

.score-item {
  display: flex;
  align-items: center;
  background: var(--bg-color);
  padding: 10px 12px;
  margin-bottom: 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
  font-size: 13px;
  break-inside: avoid;
}

.score-item:hover {
  border-color: var(--primary-color);
  background: var(--bg-secondary);
}

.score-rank {
  font-weight: 600;
  color: var(--primary-color);
  min-width: 30px;
  font-size: 14px;
}

.score-series {
  flex: 1;
  font-weight: 500;
  color: var(--text-color);
  margin: 0 8px;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.score-metrics {
  display: flex;
  gap: 6px;
  align-items: center;
}

.score-value {
  font-family: 'Geist Mono', monospace;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.score-runtime {
  font-family: 'Geist Mono', monospace;
  font-weight: 600;
  color: var(--primary-color);
  background: rgba(89, 113, 253, 0.1);
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.scores-explanation {
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-secondary);
  font-style: italic;
  text-align: center;
}

.score-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0 2px;
}

/* Responsive - consolidated with above mobile styles */
@media (max-width: 768px) {
  .score-item {
    min-width: 0;
    width: 100%;
  }
  
  .score-series {
    flex: 1;
    min-width: 0;
  }
}

