/* SPDX-License-Identifier: MPL-2.0 */

:root {
  color-scheme: light;
  --mark-l-dir: 1;
  --family-openai: oklch(58% 0.13 155);
  --family-anthropic: oklch(62% 0.15 50);
  --family-google: oklch(58% 0.17 255);
  --family-xai: oklch(56% 0.08 265);
  --family-meta: oklch(61% 0.2 255);
  --family-alibaba: oklch(60% 0.15 220);
  --family-mistral: oklch(62% 0.16 75);
  --family-deepseek: oklch(55% 0.18 295);
  --family-zhipu: oklch(62% 0.12 195);
  --family-moonshot: oklch(60% 0.18 20);
  --family-minimax: oklch(62% 0.17 330);
  --family-xiaomi: oklch(65% 0.13 95);
  --family-cursor: oklch(56% 0.03 250);
  --family-other: oklch(55% 0.02 270);
  font-family: system-ui, sans-serif;
  line-height: 1.5;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  max-width: none;
  margin: 0;
}

.page-width {
  width: 100%;
  max-width: 1024px;
  margin-inline: auto;
  padding-inline: 1em;
}

.site-nav {
  border-bottom: 1px solid;
}

.nav-content {
  display: flex;
  width: 100%;
  max-width: 1024px;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-inline: auto;
  padding: 10px 1em;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.site-header {
  padding: 28px 0 0;
}

h1 {
  margin: 0 0 8px;
}

h2 {
  margin: 0 0 12px;
}

p {
  margin-top: 0;
}

.intro {
  margin-bottom: 8px;
}

main {
  padding-block: 12px 40px;
}

.status-panel {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid;
}

.status-panel p {
  margin: 4px 0 0;
}

.status-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}

.status-panel.is-error {
  padding: 12px;
  border: 1px solid;
}

.controls,
.table-section,
.provenance {
  margin-top: 28px;
}

.controls {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid;
}

.priority-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 32px;
}

.control {
  display: grid;
  align-content: start;
  gap: 4px;
}

.control > span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.control output,
.visible-count,
.chart-detail {
  color: GrayText;
}

.priority-scale {
  color: GrayText;
  font-size: 0.8rem;
}

.priority-ticks {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  height: 7px;
  padding: 0 8px;
}

.priority-ticks i {
  width: 1px;
  height: 3px;
  background: GrayText;
}

.priority-ticks i.major {
  height: 6px;
}

input[type="range"] {
  width: 100%;
}

.model-filter {
  margin-bottom: 20px;
}

.model-filter summary {
  cursor: pointer;
}

.model-filter-actions {
  display: flex;
  gap: 8px;
  margin: 10px 0;
}

.model-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 20px;
}

.model-option {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.filter-row {
  display: grid;
  justify-items: start;
  gap: 12px;
  margin-top: 20px;
}

.select-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.switch-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 2rem;
}

.visible-count {
  margin: 0;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 12px;
  padding-top: 12px;
  border-top: 1px solid;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 12px;
  margin: 8px 3.54% 0 9.58%;
  font-size: 0.85rem;
}

.chart-intro {
  max-width: 75ch;
  margin-bottom: 0;
  color: GrayText;
  font-size: 0.9rem;
}

.chart-legend .legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-marker {
  width: 10px;
  height: 10px;
  border: 2px solid CanvasText;
  background: Canvas;
  transform: rotate(45deg);
}

.legend-marker:not(.pareto-marker) {
  border-radius: 50%;
  transform: none;
}

.pareto-marker {
  background: Highlight;
}

.chart-frame {
  margin-top: 12px;
  border: 1px solid #ddd;
}

.chart-wrap {
  position: relative;
  overflow-x: auto;
}

.value-chart {
  display: block;
  width: 100%;
  height: auto;
  min-height: 280px;
}

.chart-grid,
.chart-axis {
  stroke: CanvasText;
  stroke-width: 1;
  opacity: 0.18;
  vector-effect: non-scaling-stroke;
}

.chart-tick,
.chart-axis-label,
.chart-note {
  fill: GrayText;
  font-size: 13px;
}

.chart-axis-label {
  font-weight: normal;
}

.chart-efficiency-label {
  fill: GrayText;
  font-size: 12px;
  font-style: italic;
}

.chart-link {
  fill: none;
  stroke-width: 2;
  opacity: 0.75;
  pointer-events: none;
  vector-effect: non-scaling-stroke;
}

.chart-point {
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.chart-point-pareto {
  stroke: CanvasText;
  stroke-width: 2;
}

.chart-point-group:focus-visible {
  outline: none;
}

.chart-point-group:focus-visible .chart-point {
  stroke-width: 4;
}

.chart-hit-target {
  fill: transparent;
  pointer-events: all;
}

.chart-label {
  font-size: 13px;
  font-weight: 600;
  paint-order: stroke;
  pointer-events: none;
  stroke: Canvas;
  stroke-linejoin: round;
  stroke-width: 4px;
}

.chart-effort-label {
  font-size: 9px;
  font-weight: normal;
}

.chart-series {
  transition: opacity 120ms ease;
}

.chart-series.is-muted {
  opacity: 0.16;
}

.chart-point-label {
  pointer-events: none;
  visibility: hidden;
}

.chart-point-label[data-default-visible="true"] {
  visibility: visible;
}

.value-chart.is-interacting .chart-point-label[data-default-visible="true"] {
  visibility: hidden;
}

.value-chart.is-interacting .chart-point-label.is-active {
  visibility: visible;
}

.chart-link.chart-series {
  fill: none;
  stroke: currentColor;
}

.chart-link-hit-target {
  fill: none;
  pointer-events: none;
  stroke: transparent;
  stroke-width: 24px;
}

.chart-link-hit-target.is-armed {
  pointer-events: stroke;
}

.chart-point.chart-series {
  fill: currentColor;
  stroke: currentColor;
}

.chart-point.chart-point-pareto {
  stroke: CanvasText;
  stroke-width: 2;
}

.chart-point-label .chart-label {
  fill: currentColor;
}

.chart-point-label .chart-label-connector {
  stroke: currentColor;
  stroke-width: 1;
  opacity: 0.45;
  pointer-events: none;
  vector-effect: non-scaling-stroke;
}

.chart-crosshair-line {
  stroke: #d64550;
  stroke-width: 1;
  stroke-dasharray: 5 5;
  pointer-events: none;
  vector-effect: non-scaling-stroke;
}

.chart-crosshair {
  pointer-events: none;
}

.chart-crosshair-label {
  fill: #d64550;
  font-size: 13px;
  font-weight: normal;
  paint-order: stroke;
  stroke: Canvas;
  stroke-linejoin: round;
  stroke-width: 4px;
}

.chart-detail {
  height: clamp(3rem, calc(10rem - 12.5vw), 7.5rem);
  margin: 6px 0 0;
  overflow-y: auto;
  font-size: 0.88rem;
}

.table-wrap {
  overflow-x: auto;
}

.table-wrap:focus-visible {
  outline: 2px solid Highlight;
  outline-offset: 2px;
}

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

th:first-child,
td:first-child {
  min-width: 220px;
}

th,
td {
  padding: 10px 8px;
  border-bottom: 1px solid;
  text-align: left;
  vertical-align: top;
}

th {
  font-size: 0.85rem;
}

.numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

td.numeric {
  white-space: nowrap;
}

.configuration-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.performance-ci {
  margin-left: 0.25em;
}

.relative-value-bar {
  display: block;
  width: 100%;
  height: 3px;
  margin-top: 6px;
  overflow: hidden;
  background: #e5e7eb;
}

.relative-value-bar-fill {
  display: block;
  height: 100%;
  background: var(--series-color, currentColor);
}

.compact-column-label {
  display: none;
}

.wide-column-label {
  white-space: nowrap;
}

.empty-state {
  margin-top: 16px;
}

.provenance dl {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 16px 0;
}

.provenance dl > div {
  min-width: 0;
}

.provenance dt {
  font-weight: bold;
}

.provenance dd {
  margin: 2px 0 0;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.methodology section + section {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid;
}

.methodology li + li {
  margin-top: 8px;
}

.formula {
  margin: 16px 0;
  padding: 12px;
  overflow-x: auto;
  border: 1px solid;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
  white-space: nowrap;
}

code {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

@media (max-width: 900px) {
  .priority-grid,
  .model-options,
  .provenance dl {
    grid-template-columns: 1fr;
  }

  .section-heading,
  .status-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  .chart-legend {
    margin: 8px 24px 0 58px;
  }

  .wide-column-label {
    display: none;
  }

  .compact-column-label {
    display: inline;
  }

  .nav-content {
    overflow-x: auto;
    font-size: 0.875rem;
    white-space: nowrap;
  }

  .nav-content > a,
  .nav-links {
    flex: none;
  }

  .nav-links {
    flex-wrap: nowrap;
    gap: 16px;
  }
}

@media (max-width: 900px) {
  .select-control {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}

@media (max-width: 900px) {
  .table-wrap {
    container-type: inline-size;
    overflow-x: visible;
  }

  table,
  tbody {
    display: block;
    width: 100%;
    min-width: 0;
  }

  thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
  }

  tbody tr {
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, minmax(86px, 1fr));
    gap: 8px 4px;
    padding: 10px 0;
    overflow-x: auto;
    border-bottom: 1px solid;
    scrollbar-width: none;
  }

  tbody tr::-webkit-scrollbar {
    display: none;
  }

  tbody tr:focus-visible {
    outline: 2px solid Highlight;
    outline-offset: -2px;
  }

  tbody td {
    width: auto;
    min-width: 0;
    padding: 0;
    border-bottom: 0;
    text-align: left;
    white-space: normal;
  }

  .configuration-cell {
    grid-column: 1 / -1;
    grid-row: 1;
    position: sticky;
    left: 0;
    z-index: 1;
    box-sizing: border-box;
    width: 100cqw;
    background: Canvas;
  }

  .configuration-name {
    padding-right: 5rem;
    overflow: visible;
    overflow-wrap: anywhere;
    font-size: 0.9rem;
    text-overflow: clip;
    white-space: normal;
  }

  .value-cell {
    grid-column: 4;
    grid-row: 1;
    position: sticky;
    right: 0;
    z-index: 2;
    justify-self: end;
  }

  .time-cell {
    grid-column: 1;
  }

  .cost-cell {
    grid-column: 2;
  }

  .performance-cell {
    grid-column: 3;
  }

  .persistence-cell {
    grid-column: 4;
  }

  .relative-value-bar {
    height: 5px;
    margin-top: 8px;
  }

  .cost-cell::before,
  .time-cell::before,
  .performance-cell::before,
  .persistence-cell::before {
    display: block;
    margin-bottom: 2px;
    color: GrayText;
    content: attr(data-label);
    font-size: 0.7rem;
    font-weight: normal;
  }

  .cost-cell,
  .time-cell,
  .performance-cell,
  .persistence-cell {
    text-align: center;
  }

  .cost-cell,
  .time-cell,
  .performance-value,
  .persistence-cell {
    white-space: nowrap;
  }

  .performance-ci {
    margin-left: 0.2em;
  }

  .performance-cell {
    font-size: 0.82rem;
  }
}
