:root {
  /* Base Colors */
  --bg: #0f1117;
  --bg-card: #161b22;
  --bg-card-hover: #1c2128;
  --border: #30363d;
  --border-hover: #8b949e;
  
  /* Text Colors */
  --text-primary: #f0f6fc;
  --text-secondary: #8b949e;
  --text-tertiary: #484f58;

  /* Accents */
  --accent: #58a6ff;
  --accent-glow: rgba(88, 166, 255, 0.15);
  
  /* Status Colors */
  --success-bg: rgba(46, 160, 67, 0.15);
  --success-text: #3fb950;
  --warning-bg: rgba(210, 153, 34, 0.15);
  --warning-text: #d29922;
  --danger-bg: rgba(248, 81, 73, 0.15);
  --danger-text: #f85149;
  --neutral-bg: rgba(110, 118, 129, 0.15);
  --neutral-text: #8b949e;

  /* Layout */
  --radius: 6px;
  --radius-lg: 12px;
  --header-height: 64px;
  
  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background-color: var(--bg);
  background:
    radial-gradient(circle at 15% 0%, rgba(88, 166, 255, 0.1), transparent 40%),
    radial-gradient(circle at 85% 0%, rgba(163, 113, 247, 0.1), transparent 40%),
    var(--bg);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  text-decoration: underline;
}

/* Layout Utilities */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 16px;
  padding: 12px 24px;
  background: var(--accent);
  color: white;
  border-radius: var(--radius);
  z-index: 100;
  text-decoration: none;
}

.skip:focus {
  left: 16px;
}

/* Header */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 17, 23, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  height: 72px;
}

.topbarInner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 32px;
  align-items: center;
  height: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 32px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none !important;
  padding-right: 24px;
  border-right: 1px solid var(--border);
}

.logo {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent), #a371f7);
  border-radius: 10px;
  box-shadow: 0 0 20px var(--accent-glow);
  position: relative;
}

.logo::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(255,255,255,0.2);
}

/* Ensure header logo image fills the logo container */
.logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
}

.brandText {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brandText strong {
  color: var(--text-primary);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.brandText span {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Navigation */
.nav {
  display: flex;
  gap: 6px;
  justify-self: start;
  align-items: center;
}

.nav a {
  display: inline-flex;
  align-items: center;
  height: 40px;
  box-sizing: border-box;
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none !important;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
  border: 1px solid transparent;
}

.nav a:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

/* Ensure header clips any accidental overflow from tall hover states */
.topbar {
  overflow: hidden;
}

/* Controls */
.controls {
  display: flex;
  gap: 16px;
  align-items: center;
}

.input {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 8px 16px;
  width: 260px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.input:focus-within {
  background: var(--bg-card);
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
  width: 320px;
}

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

/* Hide native search cancel (cross) to avoid duplicate controls
   Keep the explicit Clear button for consistent accessibility and behavior */
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
  display: none;
}

input[type="search"]::-ms-clear,
input[type="search"]::-ms-reveal {
  display: none;
  width: 0;
  height: 0;
}

/* Firefox pseudo-elements */
input[type="search"]::-moz-search-decoration,
input[type="search"]::-moz-search-clear {
  display: none;
}

.input kbd {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 4px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 6px;
  margin-left: 8px;
  white-space: nowrap;
}

.btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn:hover {
  color: var(--text-primary);
  border-color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
}

/* Hero Section */
.hero {
  padding: 48px 0;
}

.heroGrid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 32px;
}

.heroMain {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.title {
  font-size: 48px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 0 0 16px;
  background: linear-gradient(135deg, #fff 0%, #a5b4fc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  font-size: 18px;
  color: var(--text-secondary);
  margin: 0 0 32px;
  max-width: 600px;
}

.disclaimer {
  margin: 16px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
  max-width: 720px;
}

.heroMeta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 13px;
  color: var(--text-secondary);
}

.pill strong {
  color: var(--text-primary);
  margin-left: 4px;
}

/* Model List Sidebar */
.heroSide {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s;
}

.heroSide:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.15);
}

.h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 16px;
}

.modelList {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.modelList li {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.02);
  font-size: 14px;
}

.modelList .tag {
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: 12px;
}

/* Sections */
.section {
  padding: 40px 0;
  border-top: 1px solid var(--border);
}

.section:first-of-type {
  border-top: none;
}

.sectionHeader {
  margin-bottom: 24px;
}

.sectionHeader h2 {
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 8px;
}

.sectionHeader p {
  color: var(--text-secondary);
  margin: 0;
  font-size: 16px;
}

.callout {
  display: inline-block;
  margin-top: 16px;
  padding: 8px 16px;
  background: var(--accent-glow);
  border: 1px solid rgba(88, 166, 255, 0.3);
  border-radius: var(--radius);
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
}

/* Compare */
.compareCard {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.compareControls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  align-items: center;
  margin-top: 12px;
}

.compareSelect {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-primary);
  padding: 10px 40px 10px 12px;
  font-size: 14px;
  font-weight: 600;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8'><path fill='%238b949e' d='M6 8L0 0h12z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.compareSelect:focus,
.compareSelect:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.compareActions {
  display: flex;
  gap: 8px;
}

.compareResults {
  margin-top: 16px;
  display: grid;
  gap: 16px;
}

.compareSection {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.compareSectionHeader h3 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 600;
}

.compareSectionHeader p {
  margin: 0 0 10px;
  color: var(--text-secondary);
  font-size: 13px;
}

.compareEmpty {
  color: var(--text-secondary);
  font-size: 14px;
}

.metricCell {
  font-weight: 600;
  color: var(--text-primary);
}

.compareDiff td {
  background: rgba(88, 166, 255, 0.06);
}

/* Tables */
.tableCard {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s;
}

.tableCard:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.15);
}

.tableWrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}

    th {
  text-align: left;
  padding: 16px 24px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: sticky;
  top: 0;
      z-index: 4;
  overflow: visible;
  min-width: 120px;
}

.thContent {
  position: relative;
  display: block;
  width: 100%;
  padding-right: 32px;
}

.thLabel {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  display: block;
  white-space: normal;
  line-height: 1.2;
}

.sortToggle {
  background: transparent;
  border: none;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 999px;
  color: var(--text-secondary);
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  transition: background 0.2s ease, color 0.2s ease;
}

.sortToggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.sortToggle::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  transition: background 0.2s ease;
}

.sortChevron {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid currentColor;
  transition: transform 0.2s ease;
}

.sortToggle.is-active .sortChevron {
  transform: rotate(180deg);
}

.sortToggle:hover {
  color: var(--text-primary);
}

.sortToggle:hover::before {
  background: rgba(255, 255, 255, 0.12);
}

    .sortMenu {
      position: absolute;
      top: 100%;
      right: 4px;
      margin-top: 10px;
      background: var(--bg-card);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
      z-index: 20;
      min-width: 140px;
      max-width: 260px;
      box-sizing: border-box;
  display: flex;
  flex-direction: column;
  padding: 6px 0;
}

.sortMenu[hidden] {
  display: none !important;
}

    .sortOption {
      background: transparent;
      border: none;
      color: var(--text-secondary);
      text-align: left;
      padding: 6px 12px;
      font-size: 13px;
      font-weight: 500;
      cursor: pointer;
      width: auto;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

.sortOption:hover,
.sortOption:focus-visible {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.sortOption:focus-visible {
  outline: none;
}

td {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-secondary);
}

/* Sticky first column for mobile scrolling */
    td:first-child, th:first-child {
      position: sticky;
      left: 0;
      z-index: 6;
      background: var(--bg-card);
      border-right: 1px solid var(--border);
      overflow: visible;
    }

/* Zebra striping for easier reading */
tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.01);
}

/* Ensure sticky column matches zebra striping */
tbody tr:nth-child(even) td:first-child {
  background: #191e26; /* Manually matched to bg-card + 1% white opacity approx */
}

tr:last-child td {
  border-bottom: none;
}

/* Stronger hover */
tr:hover td {
  background: rgba(88, 166, 255, 0.08) !important;
}

.modelCell {
  color: var(--text-primary);
  font-weight: 600;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.02em;
}

.badge.vh, .badge.h, .badge.vr, .badge.r {
  background: rgba(46, 160, 67, 0.2);
  color: #56ff75;
  border: 1px solid rgba(46, 160, 67, 0.3);
}

.badge.m, .badge.s {
  background: rgba(210, 153, 34, 0.2);
  color: #ffc557;
  border: 1px solid rgba(210, 153, 34, 0.3);
}

.badge.l, .badge.o, .badge.vo {
  background: rgba(248, 81, 73, 0.2);
  color: #ff7b72;
  border: 1px solid rgba(248, 81, 73, 0.3);
}

/* Search Highlighting */
.rowHighlight td {
  background: rgba(88, 166, 255, 0.05);
  color: var(--text-primary);
}

.rowDim td {
  opacity: 0.3;
}

/* Footer */
.footer {
  margin-top: 64px;
  padding: 48px 0;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 14px;
}

.footerInner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
}

.footerCopy {
  max-width: 720px;
}

.footerTitle {
  color: var(--text-primary);
  font-weight: 700;
  margin-bottom: 8px;
}

.fineprint {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.6;
}

.smallLinks {
  display: flex;
  gap: 24px;
}

/* Responsive */
@media (max-width: 768px) {
  .heroGrid {
    grid-template-columns: 1fr;
  }
  
  .nav {
    display: none;
  }
  
  .input {
    width: auto;
    min-width: 0;
  }
  
  .input kbd {
    display: none;
  }
  
  .title {
    font-size: 32px;
  }

  .footerInner {
    flex-direction: column;
    align-items: stretch;
  }
}