.lab-page {
  --lab-astra: #f4f4f4;
  --lab-sol: #ffbd66;
  --lab-terra: #60d7bd;
  --lab-luna: #91adff;
  --lab-gpt55: #f47eaa;
  background: #050505;
}

.lab-page .nav a.is-current {
  color: var(--text);
  font-weight: 600;
}

.lab-hero {
  min-height: min(720px, calc(100vh - 85px));
  display: flex;
  align-items: end;
  padding: 118px 0 72px;
  border-bottom: 1px solid var(--border);
  background: #0d0d0d url('lazy-vibe-coder-hero.jpg') center center / cover no-repeat;
}

.lab-hero-inner {
  display: grid;
  gap: 64px;
}

.lab-hero-copy {
  max-width: 700px;
}

.lab-kicker {
  color: #dadada;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 18px;
}

.lab-hero h1 {
  max-width: 700px;
  font-size: clamp(3rem, 6vw, 5.6rem);
  line-height: 0.98;
  font-weight: 700;
  margin-bottom: 28px;
}

.lab-lead {
  max-width: 620px;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.4rem);
  line-height: 1.55;
}

.lab-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 760px;
  border-top: 1px solid var(--border);
}

.lab-facts div {
  padding: 22px 24px 0 0;
}

.lab-facts dt {
  color: #858585;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
}

.lab-facts dd {
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  font-weight: 600;
}

.lab-section {
  padding: 104px 0;
  border-bottom: 1px solid var(--border);
}

.lab-section h2 {
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.08;
}

.lab-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 44px;
}

.chart-controls {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.metric-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, auto);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  overflow: hidden;
}

.metric-switch button {
  min-height: 44px;
  padding: 10px 16px;
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.18);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.metric-switch button:last-child {
  border-right: 0;
}

.metric-switch button[aria-pressed="true"] {
  background: #f2f2f2;
  color: #050505;
}

.metric-switch button:focus-visible,
.config-toggle:focus-visible,
.config-panel button:focus-visible,
.config-panel input:focus-visible,
.chart-legend button:focus-visible,
.results-table button:focus-visible,
.table-filters select:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.config-filter {
  position: relative;
}

.config-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 46px;
  padding: 10px 15px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.config-count {
  color: #8f8f8f;
  font-weight: 500;
}

.config-chevron {
  width: 8px;
  height: 8px;
  margin-left: 2px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.16s ease;
}

.config-toggle[aria-expanded="true"] .config-chevron {
  transform: translateY(2px) rotate(225deg);
}

.config-panel {
  position: absolute;
  z-index: 8;
  top: calc(100% + 10px);
  right: 0;
  width: min(430px, calc(100vw - 38px));
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: #111;
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.58);
  overflow: hidden;
}

.config-panel[hidden] {
  display: none;
}

.config-list {
  max-height: 430px;
  padding: 7px 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.config-model-group {
  padding: 15px 0 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.config-model-group:last-child {
  border-bottom: 0;
}

.config-model-header,
.config-model-label {
  display: flex;
  align-items: center;
}

.config-model-header {
  justify-content: space-between;
  gap: 14px;
}

.config-model-label {
  gap: 9px;
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
}

.config-model-label input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #f2f2f2;
  cursor: pointer;
}

.config-model-swatch {
  width: 16px;
  height: 3px;
  background: var(--series-color);
}

.config-model-count {
  color: #858585;
  font-size: 0.74rem;
}

.config-efforts {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 11px 0 0 45px;
}

.config-effort {
  position: relative;
  cursor: pointer;
}

.config-effort input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.config-effort span {
  display: block;
  min-width: 48px;
  padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #7f7f7f;
  font-size: 0.65rem;
  font-weight: 600;
  text-align: center;
  text-transform: uppercase;
}

.config-effort input:checked + span {
  border-color: rgba(255, 255, 255, 0.58);
  background: rgba(255, 255, 255, 0.1);
  color: #f2f2f2;
}

.config-effort input:focus-visible + span {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.config-effort.is-unavailable {
  cursor: not-allowed;
}

.config-effort.is-unavailable span {
  color: #555;
  text-decoration: line-through;
}

.config-actions {
  display: flex;
  gap: 9px;
  padding: 13px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.13);
  background: #0b0b0b;
}

.config-actions button {
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 5px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.73rem;
  font-weight: 600;
  cursor: pointer;
}

.config-actions button:hover {
  background: #f2f2f2;
  color: #050505;
}

.benchmark-figure {
  margin: 0;
}

.chart-shell {
  position: relative;
  height: clamp(430px, 58vw, 650px);
  min-height: 430px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: #0c0c0c;
  overflow: hidden;
}

#benchmarkChart {
  width: 100%;
  height: 100%;
  display: block;
}

.chart-grid-line {
  stroke: rgba(255, 255, 255, 0.09);
  stroke-width: 1;
}

.chart-axis-line {
  stroke: rgba(255, 255, 255, 0.25);
  stroke-width: 1;
}

.chart-axis-label,
.chart-tick-label {
  fill: #a9a9a9;
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
}

.chart-axis-label {
  fill: #d8d8d8;
  font-size: 12px;
  font-weight: 600;
}

.chart-efficiency-note {
  fill: #a9a9a9;
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  font-style: italic;
  font-weight: 500;
  letter-spacing: 0.025em;
}

.chart-line {
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.chart-point {
  stroke: #0c0c0c;
  stroke-width: 3;
  cursor: pointer;
  pointer-events: all;
  transition: r 0.15s ease, opacity 0.2s ease;
}

.chart-hover-layer {
  pointer-events: none;
}

.chart-hover-ray {
  stroke: rgba(255, 255, 255, 0.62);
  stroke-width: 1;
  stroke-dasharray: 4 5;
  vector-effect: non-scaling-stroke;
}

.chart-hover-label-bg {
  fill: #f2f2f2;
}

.chart-hover-axis-label {
  fill: #050505;
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  font-weight: 700;
}

.chart-empty-label {
  fill: #8f8f8f;
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
}

.chart-point:hover,
.chart-point:focus {
  r: 8;
  outline: none;
}

.chart-series.is-hidden {
  opacity: 0.08;
}

.chart-tooltip {
  position: absolute;
  z-index: 2;
  width: max-content;
  max-width: 260px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  background: rgba(7, 7, 7, 0.96);
  color: var(--text);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  font-size: 0.78rem;
  line-height: 1.5;
}

.chart-tooltip strong,
.chart-tooltip span {
  display: block;
}

.chart-tooltip span {
  color: #b8b8b8;
}

.benchmark-figure figcaption {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: #909090;
  font-size: 0.76rem;
  padding-top: 12px;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 22px;
  margin-top: 24px;
}

.chart-legend button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}

.chart-legend button[aria-pressed="false"] {
  opacity: 0.38;
}

.chart-legend button.is-partial {
  opacity: 0.68;
}

.legend-swatch {
  width: 22px;
  height: 3px;
  background: var(--series-color);
}

.methodology-section {
  background: #0b0b0b;
}

.methodology-grid,
.quota-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(48px, 8vw, 112px);
  align-items: start;
}

.methodology-intro {
  position: sticky;
  top: 130px;
}

.methodology-intro > p:last-child {
  color: var(--muted);
  margin-top: 24px;
  max-width: 52ch;
}

.method-steps {
  list-style: none;
}

.method-steps li {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 22px;
  padding: 28px 0;
  border-top: 1px solid var(--border);
}

.method-steps li:last-child {
  border-bottom: 1px solid var(--border);
}

.method-steps > li > span {
  color: #777;
  font-size: 0.76rem;
  font-weight: 600;
}

.method-steps h3 {
  font-size: 1.05rem;
  margin-bottom: 8px;
}

.method-steps p,
.quota-copy p {
  color: var(--muted);
}

.quota-section {
  background: #f0f0f0;
  color: #090909;
}

.quota-section .lab-kicker {
  color: #555;
}

.quota-copy {
  display: grid;
  gap: 22px;
  font-size: 1.04rem;
}

.quota-copy p {
  color: #3c3c3c;
}

.table-heading {
  align-items: end;
}

.table-filters {
  display: flex;
  gap: 12px;
}

.table-filters label {
  display: grid;
  gap: 6px;
}

.table-filters label span {
  color: #8d8d8d;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.table-filters select {
  min-width: 150px;
  height: 42px;
  padding: 0 34px 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  background: #101010;
  color: var(--text);
  font: inherit;
  font-size: 0.78rem;
}

.results-table-wrap {
  overflow-x: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
}

.results-table {
  width: 100%;
  min-width: 940px;
  border-collapse: collapse;
}

.results-table th,
.results-table td {
  padding: 16px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  text-align: right;
  white-space: nowrap;
}

.results-table th:first-child,
.results-table td:first-child,
.results-table th:nth-child(2),
.results-table td:nth-child(2) {
  text-align: left;
}

.results-table th:first-child,
.results-table td:first-child {
  padding-left: 0;
}

.results-table th:last-child,
.results-table td:last-child {
  padding-right: 0;
}

.results-table tbody tr:last-child td {
  border-bottom: 0;
}

.results-table th {
  color: #8f8f8f;
  font-size: 0.68rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.results-table th button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}

.results-table th button:hover {
  color: #fff;
}

.results-table td {
  color: #d5d5d5;
  font-size: 0.82rem;
}

.results-table td:first-child {
  color: #fff;
  font-weight: 600;
}

.effort-label {
  color: #b1b1b1;
  text-transform: capitalize;
}

.missing-value {
  color: #777;
}

.table-footer {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 32px;
  padding-top: 22px;
}

.table-footer p {
  max-width: 780px;
  color: #8f8f8f;
  font-size: 0.76rem;
}

.table-footer strong {
  color: #cfcfcf;
}

.table-footer a,
.footer-inner a {
  color: #d8d8d8;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
  white-space: nowrap;
}

@media (max-width: 920px) {
  .lab-section-heading,
  .table-heading {
    align-items: start;
    flex-direction: column;
  }

  .methodology-grid,
  .quota-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .methodology-intro {
    position: static;
  }
}

@media (max-width: 768px) {
  .lab-hero {
    min-height: auto;
    padding: 96px 0 56px;
  }

  .lab-hero-inner {
    gap: 48px;
  }

  .lab-hero h1 {
    font-size: clamp(2.8rem, 13vw, 4.6rem);
  }

  .lab-facts {
    grid-template-columns: 1fr;
  }

  .lab-facts div {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
  }

  .lab-section {
    padding: 76px 0;
  }

  .metric-switch {
    width: auto;
    flex: 1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chart-controls {
    width: 100%;
  }

  .config-toggle {
    min-height: 44px;
  }

  .metric-switch button {
    padding: 10px 8px;
  }

  .chart-shell {
    min-height: 420px;
    height: 112vw;
    max-height: 510px;
  }

  .chart-efficiency-note {
    font-size: 10px;
  }

  .benchmark-figure figcaption {
    flex-direction: column;
    gap: 4px;
  }

  .chart-legend {
    gap: 12px 18px;
  }

  .method-steps li {
    grid-template-columns: 42px 1fr;
  }

  .table-filters {
    width: 100%;
  }

  .table-filters label {
    flex: 1;
  }

  .table-filters select {
    width: 100%;
    min-width: 0;
  }

  .table-footer {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .lab-hero {
    background-position: center;
    background-size: 100% auto;
  }

  .lab-hero h1 {
    font-size: clamp(2.55rem, 13vw, 3.35rem);
  }

  .lab-lead {
    font-size: 1rem;
  }

  .metric-switch {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chart-controls {
    gap: 8px;
  }

  .config-toggle {
    padding-inline: 11px;
  }

  .config-list {
    max-height: min(430px, 58vh);
    padding-inline: 15px;
  }

  .config-efforts {
    padding-left: 27px;
  }

  .metric-switch button {
    border-bottom: 0;
  }

  .table-filters {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .chart-line,
  .chart-point {
    transition: none;
  }
}
