/* ============================================
   LLM Speed Benchmark - Modern Dashboard
   ============================================ */

:root {
  --font: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  
  /* Primary palette */
  --blue-50: #eff6ff;
  --blue-100: #dbeafe;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;
  
  /* Status colors */
  --green-400: #4ade80;
  --green-500: #22c55e;
  --green-600: #16a34a;
  --yellow-400: #facc15;
  --yellow-500: #eab308;
  --yellow-600: #ca8a04;
  --red-400: #f87171;
  --red-500: #ef4444;
  --red-600: #dc2626;
  
  /* Speed tier */
  --speed-fast: #22c55e;
  --speed-fast-bg: #f0fdf4;
  --speed-medium: #eab308;
  --speed-medium-bg: #fefce8;
  --speed-slow: #ef4444;
  --speed-slow-bg: #fef2f2;
  
  /* Neutrals */
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  
  /* Layout */
  --sidebar-w: 260px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
  
  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font);
  background: var(--gray-50);
  color: var(--gray-900);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ============================================
   App Layout
   ============================================ */

.app {
  display: flex;
  min-height: 100vh;
}

/* ============================================
   Sidebar
   ============================================ */

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  color: white;
  display: flex;
  flex-direction: column;
  z-index: 100;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.brand-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--blue-500), #8b5cf6);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-tag {
  font-size: 11px;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  color: var(--gray-400);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 150ms var(--ease);
}

.nav-link:hover {
  background: rgba(255,255,255,0.08);
  color: white;
}

.nav-link.active {
  background: linear-gradient(135deg, var(--blue-600), var(--blue-700));
  color: white;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.nav-link svg {
  opacity: 0.7;
}

.nav-link.active svg {
  opacity: 1;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.update-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--gray-400);
}

/* ============================================
   Main Content
   ============================================ */

.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
}

/* ============================================
   Top Bar
   ============================================ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gray-200);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.topbar-filters {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

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

.filter-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.filter-label svg {
  color: var(--gray-400);
}

.filter-select {
  padding: 8px 32px 8px 12px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  background: white;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-700);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease);
}

.filter-select:hover {
  border-color: var(--gray-300);
}

.filter-select:focus {
  outline: none;
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px var(--blue-100);
}

.segmented {
  display: flex;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  overflow: hidden;
  background: white;
}

.segmented button {
  padding: 8px 16px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  background: transparent;
  color: var(--gray-600);
  border: none;
  cursor: pointer;
  transition: all 150ms var(--ease);
  border-right: 1px solid var(--gray-200);
}

.segmented button:last-child {
  border-right: none;
}

.segmented button:hover {
  background: var(--gray-50);
}

.segmented button.active {
  background: var(--blue-600);
  color: white;
}

.segmented button:focus-visible {
  outline: 2px solid var(--blue-500);
  outline-offset: -2px;
}

.topbar-stats {
  flex-shrink: 0;
}

.record-count {
  font-size: 13px;
  color: var(--gray-500);
}

.record-count strong {
  color: var(--gray-900);
  font-weight: 700;
}

/* ============================================
   Content
   ============================================ */

.content {
  padding: 32px;
}

.section {
  margin-bottom: 48px;
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
}

.section-title h2 {
  font-size: 24px;
  font-weight: 800;
  color: var(--gray-900);
  letter-spacing: -0.02em;
}

.section-desc {
  font-size: 13px;
  color: var(--gray-500);
}

/* ============================================
   Stats Cards
   ============================================ */

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

@media (max-width: 1200px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .stats-row { grid-template-columns: 1fr; }
}

.stat-card {
  background: white;
  border-radius: 16px;
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  transition: transform 200ms var(--ease), box-shadow 200ms var(--ease);
}

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

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-blue .stat-icon { background: linear-gradient(135deg, #3b82f6, #2563eb); color: white; }
.stat-purple .stat-icon { background: linear-gradient(135deg, #8b5cf6, #7c3aed); color: white; }
.stat-amber .stat-icon { background: linear-gradient(135deg, #f59e0b, #d97706); color: white; }
.stat-green .stat-icon { background: linear-gradient(135deg, #22c55e, #16a34a); color: white; }

.stat-body {
  flex: 1;
  min-width: 0;
}

.stat-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--gray-900);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.stat-card.stat-amber .stat-value {
  font-size: 20px;
  white-space: normal;
  line-height: 1.2;
}

.stat-label {
  font-size: 13px;
  color: var(--gray-500);
  margin-top: 4px;
  font-weight: 500;
}

/* ============================================
   Provider Cards
   ============================================ */

.provider-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 20px;
}

@media (max-width: 640px) {
  .provider-grid { grid-template-columns: 1fr; }
}

.provider-card {
  background: white;
  border-radius: 16px;
  padding: 24px;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: transform 200ms var(--ease), box-shadow 200ms var(--ease);
}

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

.provider-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}

.provider-card.tier-fast::before { background: var(--speed-fast); }
.provider-card.tier-medium::before { background: var(--speed-medium); }
.provider-card.tier-slow::before { background: var(--speed-slow); }

.provider-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.provider-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-900);
}

.provider-meta {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 2px;
}

.rank-badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.rank-1 { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: white; }
.rank-2 { background: linear-gradient(135deg, #94a3b8, #64748b); color: white; }
.rank-3 { background: linear-gradient(135deg, #fb923c, #ea580c); color: white; }
.rank-other { background: var(--gray-100); color: var(--gray-600); }

.provider-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.metric {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.metric-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.metric-value {
  font-size: 24px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.metric-value.fast { color: var(--speed-fast); }
.metric-value.medium { color: var(--speed-medium); }
.metric-value.slow { color: var(--speed-slow); }

.metric-unit {
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-500);
  margin-left: 4px;
}

/* Progress bars */
.progress-section {
  margin-bottom: 12px;
}

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

.progress-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-600);
}

.progress-value {
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.progress-bar {
  height: 8px;
  background: var(--gray-100);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 600ms var(--ease);
}

.progress-fill.green, .progress-fill.fast { background: linear-gradient(90deg, #22c55e, #16a34a); }
.progress-fill.yellow, .progress-fill.medium { background: linear-gradient(90deg, #eab308, #ca8a04); }
.progress-fill.red, .progress-fill.slow { background: linear-gradient(90deg, #ef4444, #dc2626); }

/* Speed badge */
.speed-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.speed-badge.fast { background: var(--speed-fast-bg); color: var(--speed-fast); }
.speed-badge.medium { background: var(--speed-medium-bg); color: var(--speed-medium); }
.speed-badge.slow { background: var(--speed-slow-bg); color: var(--speed-slow); }

/* Model tags */
.model-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--gray-100);
}

.model-tag {
  padding: 4px 10px;
  background: var(--gray-100);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--gray-600);
}

/* ============================================
   Provider Stats Grid
   ============================================ */

.provider-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.provider-stats-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s, box-shadow 0.2s;
}

.provider-stats-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.provider-stats-header {
  padding-left: 12px;
  margin-bottom: 16px;
}

.provider-stats-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-900);
}

.provider-stats-models {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 4px;
}

.provider-stats-body {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  text-align: center;
  margin-bottom: 16px;
}

.provider-stat {
  padding: 8px 4px;
  background: var(--gray-50);
  border-radius: 8px;
}

.stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--gray-900);
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 11px;
  color: var(--gray-500);
  margin-top: 2px;
}

.provider-stats-footer {
  padding-top: 12px;
  border-top: 1px solid var(--gray-100);
}

.rate-bar {
  height: 6px;
  background: var(--gray-100);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}

.rate-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.rate-text {
  font-size: 12px;
  color: var(--gray-600);
  text-align: center;
}

/* ============================================
   Ranking Panel
   ============================================ */

.ranking-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

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

.ranking-panel {
  background: white;
  border-radius: 16px;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-100);
  background: var(--gray-50);
}

.panel-header svg {
  color: var(--blue-600);
}

.panel-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--gray-900);
}

.ranking-list {
  padding: 16px 24px;
}

.ranking-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
}

.ranking-item + .ranking-item {
  border-top: 1px solid var(--gray-100);
}

.ranking-pos {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
}

.ranking-pos.gold { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: white; }
.ranking-pos.silver { background: linear-gradient(135deg, #94a3b8, #64748b); color: white; }
.ranking-pos.bronze { background: linear-gradient(135deg, #fb923c, #ea580c); color: white; }
.ranking-pos.fail { background: linear-gradient(135deg, #ef4444, #dc2626); color: white; }
.ranking-pos.normal { background: var(--gray-100); color: var(--gray-600); }

.ranking-info {
  flex: 1;
  min-width: 0;
}

.ranking-model {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ranking-sub {
  font-size: 12px;
  color: var(--gray-500);
}

.ranking-bar-wrap {
  width: 120px;
  flex-shrink: 0;
}

.ranking-bar {
  height: 6px;
  background: var(--gray-100);
  border-radius: 3px;
  overflow: hidden;
}

.ranking-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 600ms var(--ease);
}

.ranking-bar-fill.fast { background: var(--speed-fast); }
.ranking-bar-fill.medium { background: var(--speed-medium); }
.ranking-bar-fill.slow { background: var(--speed-slow); }
.ranking-bar-fill.fail { background: #ef4444; }

.ranking-value {
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--gray-900);
  min-width: 70px;
  text-align: right;
}

/* ============================================
   ECharts
   ============================================ */

.chart-container {
  background: white;
  border-radius: 16px;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  padding: 24px;
}

.echarts-box {
  width: 100%;
  height: 500px;
}

.time-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 16px 24px;
  margin-top: 12px;
  background: white;
  border-radius: 12px;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
}

.time-filters {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  padding: 16px 24px;
  background: white;
  border-radius: 12px;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
}

.time-filters .filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.time-filters .filter-label {
  font-size: 13px;
  color: var(--gray-500);
  white-space: nowrap;
}

.time-filters .filter-select {
  padding: 6px 12px;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  font-size: 13px;
  background: white;
  cursor: pointer;
}

.time-filters .filter-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--gray-600);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-square {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 10px;
  font-weight: bold;
  flex-shrink: 0;
}

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

.legend-title {
  font-size: 12px;
  color: var(--gray-400);
  margin-right: 4px;
}

/* ============================================
   Table
   ============================================ */

.table-container {
  background: white;
  border-radius: 16px;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  max-height: 520px;
  transition: max-height 400ms var(--ease);
}

.table-container.collapsed {
  max-height: 420px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  padding: 14px 20px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  cursor: pointer;
  user-select: none;
  transition: color 150ms var(--ease);
}

.data-table th:hover {
  color: var(--gray-900);
}

.data-table th.sorted {
  color: var(--blue-600);
}

.data-table td {
  padding: 14px 20px;
  font-size: 13px;
  color: var(--gray-700);
  border-bottom: 1px solid var(--gray-100);
  font-variant-numeric: tabular-nums;
}

.data-table tbody tr:hover {
  background: var(--gray-50);
}

.data-table td.model-cell {
  font-weight: 600;
  color: var(--gray-900);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.status-pill.ok { background: var(--speed-fast-bg); color: var(--speed-fast); }
.status-pill.failed { background: var(--speed-slow-bg); color: var(--speed-slow); }

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.status-dot.ok { background: var(--speed-fast); }
.status-dot.failed { background: var(--speed-slow); }

.speed-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.speed-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.speed-dot.fast { background: var(--speed-fast); }
.speed-dot.medium { background: var(--speed-medium); }
.speed-dot.slow { background: var(--speed-slow); }

.fail-reason {
  font-size: 11px;
  color: var(--red-500);
  margin-top: 4px;
  max-width: 200px;
  word-break: break-word;
}

/* ============================================
   Model Grid
   ============================================ */

.data-table td.mi-name {
  font-weight: 700;
  color: var(--gray-900);
  white-space: nowrap;
}

.data-table td.mi-params {
  font-family: var(--font-mono);
  font-size: 12px;
}

.data-table td.mi-note {
  font-size: 12px;
  color: var(--gray-500);
  max-width: 260px;
}

/* ============================================
   Toggle Button
   ============================================ */

.btn-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  background: white;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-600);
  cursor: pointer;
  transition: all 150ms var(--ease);
}

.btn-toggle:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
}

.btn-toggle:focus-visible {
  outline: 2px solid var(--blue-500);
  outline-offset: 2px;
}

.btn-toggle.expanded svg {
  transform: rotate(180deg);
}

/* ============================================
   Empty State
   ============================================ */

.empty-state {
  padding: 48px 24px;
  text-align: center;
  color: var(--gray-500);
  font-size: 14px;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 900px) {
  .sidebar {
    display: none;
  }
  
  .main {
    margin-left: 0;
  }
  
  .content {
    padding: 24px 16px;
  }
  
  .topbar {
    padding: 12px 16px;
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ============================================
   Scrollbar
   ============================================ */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}

/* ============================================
   Reduced Motion
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  html {
    scroll-behavior: auto;
  }
}

/* ============================================
   Token Speed Demo
   ============================================ */

.ts-container {
  background: #1a1a2e;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
}

.ts-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.ts-rate-display {
  display: flex;
  align-items: baseline;
  gap: 4px;
  min-width: 100px;
}

.ts-rate-num {
  font-size: 32px;
  font-weight: 700;
  color: #fbbf24;
  font-variant-numeric: tabular-nums;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}

.ts-rate-unit {
  font-size: 14px;
  color: #94a3b8;
}

.ts-slider {
  flex: 1;
  min-width: 150px;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: #334155;
  border-radius: 3px;
  outline: none;
}

.ts-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: #fbbf24;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.4);
}

.ts-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: #fbbf24;
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.4);
}

.ts-presets {
  display: flex;
  gap: 6px;
}

.ts-preset {
  padding: 6px 12px;
  background: #334155;
  border: 1px solid #475569;
  border-radius: 6px;
  color: #e2e8f0;
  font-size: 12px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  cursor: pointer;
  transition: all 0.15s;
}

.ts-preset:hover {
  background: #475569;
  border-color: #64748b;
}

.ts-preset.active {
  background: #fbbf24;
  color: #1a1a2e;
  border-color: #fbbf24;
}

.ts-mode-row {
  display: flex;
  gap: 6px;
}

.ts-mode {
  padding: 6px 14px;
  background: transparent;
  border: 1px solid #475569;
  border-radius: 6px;
  color: #94a3b8;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}

.ts-mode:hover {
  border-color: #64748b;
  color: #e2e8f0;
}

.ts-mode.active {
  background: rgba(251, 191, 36, 0.15);
  border-color: #fbbf24;
  color: #fbbf24;
}

.ts-output-wrap {
  background: #0f172a;
  border-radius: 12px;
  overflow: hidden;
}

.ts-output {
  height: 320px;
  overflow-y: auto;
  padding: 20px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 14px;
  line-height: 1.7;
  color: #e2e8f0;
  white-space: pre-wrap;
  word-break: break-all;
  scrollbar-width: thin;
  scrollbar-color: #334155 transparent;
}

.ts-output::-webkit-scrollbar {
  width: 6px;
}

.ts-output::-webkit-scrollbar-track {
  background: transparent;
}

.ts-output::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 3px;
}

.ts-cursor {
  color: #fbbf24;
  animation: ts-blink 1s steps(2) infinite;
  font-weight: 300;
}

@keyframes ts-blink {
  0%, 50% { opacity: 1; }
  50.01%, 100% { opacity: 0; }
}

.ts-footer {
  display: flex;
  justify-content: space-between;
  padding: 10px 20px;
  background: #0f172a;
  border-top: 1px solid #1e293b;
  font-size: 12px;
  color: #64748b;
  font-variant-numeric: tabular-nums;
}

.ts-real-tps {
  color: #fbbf24;
  font-weight: 600;
}

/* Syntax highlighting for code mode */
.ts-kw { color: #c678dd; font-weight: 600; }
.ts-fn { color: #61afef; }
.ts-str { color: #98c379; }
.ts-num { color: #d19a66; }
.ts-cmt { color: #5c6370; font-style: italic; }
.ts-type { color: #e5c07b; }
.ts-op { color: #56b6c2; }
.ts-think { color: #64748b; font-style: italic; }
