:root {
  color-scheme: dark;
  font: 14px/1.45 "Segoe UI", system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  --canvas: #0d1118;
  --surface: #141b25;
  --raised: #1b2533;
  --control: #101721;
  --edge: #2d3b4d;
  --field-edge: #455971;
  --rule: #243140;
  --text: #f0f4fa;
  --muted: #a4b3c7;
  --mint: #83e4bf;
  --ice: #9cbdff;
  --amber: #f4ca8b;
  --coral: #ff9a91;
  --bar-good: #2bb88a;
  --bar-mid: #d4a23b;
  --bar-poor: #d4556a;
  --openai: #34ba92;
  --google: #5b8ed6;
  --anthropic: #d6885b;
  background: var(--canvas);
  color: var(--text);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
main { width: min(100% - 32px, 1360px); margin: 14px auto; }
header { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
h1 { margin: 0; font-size: 25px; font-weight: 600; line-height: 1.08; letter-spacing: -.025em; }
p { margin: 0; }
#status { margin-top: 3px; color: var(--muted); font-size: 11px; }

button, input, select {
  font: inherit;
  color: inherit;
  background: var(--control);
  border: 1px solid var(--field-edge);
  border-radius: 6px;
  min-width: 0;
  min-height: 34px;
  padding: 4px 8px;
}
button, select, summary, input[type="checkbox"] { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--ice); outline-offset: 2px; }
.primary { font-weight: 600; color: var(--mint); background: #132820; border-color: #346654; padding-inline: 12px; }
.primary::before { content: "↻"; display: inline-block; margin-inline-end: 6px; font-size: 17px; line-height: 1; }
.primary:disabled { opacity: .6; cursor: wait; }

.leaders { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 8px; }
.leader {
  --signal: var(--mint);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 2px 10px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--edge);
  border-radius: 8px;
  text-align: start;
}
.leader[aria-pressed="true"] { border-color: var(--signal); background: var(--raised); }
.leader-score { --signal: var(--ice); }
.leader-time { --signal: var(--amber); }
.leader-label { font-size: 12px; color: var(--muted); }
.leader strong { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-size: 27px; line-height: 1; font-weight: 600; letter-spacing: -.04em; color: var(--signal); }
.leader-model { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }

#filters { background: var(--surface); border: 1px solid var(--edge); border-radius: 8px; padding: 8px 12px; }
.filter-row, .settings, .providers, .checks { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.filter-scope { justify-content: space-between; }
.filter-values { margin-top: 8px; }
.filter-row label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.filter-row :is(input, select) { color: var(--text); font-size: 13px; }
.settings { gap: 8px 12px; }
.settings select { max-width: 164px; }
.providers button { display: flex; align-items: center; gap: 6px; border-color: transparent; background: transparent; min-height: 32px; padding-inline: 8px; font-size: 13px; }
.providers button[aria-pressed="true"] { background: var(--raised); border-color: var(--field-edge); }
.provider-count { color: var(--muted); font-size: 11px; }
[data-provider] { --provider: var(--muted); }
[data-provider="OpenAI"] { --provider: var(--openai); }
[data-provider="Google AI Pro"] { --provider: var(--google); }
[data-provider="Anthropic"] { --provider: var(--anthropic); }
.providers button[data-provider]:not([data-provider=""])::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: var(--provider);
}
.search { flex: 1 1 150px; min-width: 0; }
.search input { width: 100%; }
#min-value { width: 74px; }
#max-time { width: 104px; }
input::placeholder { color: var(--muted); }
input[aria-invalid="true"], input:invalid { border-color: var(--coral); }
.checks { gap: 4px 8px; }
.checks label { min-height: 34px; padding-inline: 4px; cursor: pointer; }
input[type="checkbox"] { min-height: 0; width: 15px; height: 15px; margin: 0; accent-color: var(--mint); }
.checks label:has(:checked) { color: var(--text); }
#reset { font-size: 12px; background: transparent; border-color: transparent; color: var(--muted); }

.table-meta, footer, .sources { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 14px; }
.table-meta { margin: 9px 0 6px; color: var(--muted); font-size: 12px; }
#count { color: var(--text); font-weight: 600; }
.metric-note { margin-inline-start: auto; }
.extras { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: 6px; }
.extras details { border: 1px solid var(--edge); border-radius: 6px; padding: 4px 12px; background: var(--surface); }
.extras details[open] { grid-column: 1 / -1; }
.extras summary { font-size: 12px; font-weight: 600; color: var(--ice); }
.extras p { color: var(--muted); font-size: 12px; padding-block: 6px; }
.extras table th, .extras table td { padding: 4px 6px; }
.extras table th:first-child { width: 29%; }
.color-note { white-space: nowrap; }
.color-note i { display: inline-block; width: 6px; height: 6px; margin-inline: 3px 1px; border-radius: 50%; background: var(--bar-good); vertical-align: 1px; }
.color-note i:last-of-type { background: var(--bar-poor); }
.table-wrap { border: 1px solid var(--edge); border-radius: 8px; background: var(--surface); }
table { border-collapse: separate; border-spacing: 0; table-layout: fixed; width: 100%; }
.col-score, .col-time, .col-value { width: 13.5%; }
.col-rank { width: 30px; }
.col-quota { width: 15%; }
.col-limit { width: 8%; }
.col-action { width: 30px; }
th, td { padding: 0 8px; text-align: start; }
thead th {
  position: sticky;
  z-index: 1;
  inset-block-start: 0;
  background: var(--raised);
  color: var(--muted);
  border-bottom: 1px solid var(--edge);
  font-size: 12px;
  font-weight: 600;
}
thead th:first-child { padding-inline-start: 12px; border-start-start-radius: 7px; }
thead th:last-child { border-start-end-radius: 7px; }
thead button { background: transparent; border: 0; color: inherit; padding: 2px 0; white-space: nowrap; }
thead [aria-sort] button { color: var(--text); }
thead [data-sort="value"] { color: var(--mint); }
thead button span { color: var(--mint); }
thead button .unit { color: var(--muted); font-weight: 400; }
tbody tr + tr > * { border-top: 1px solid var(--rule); }
tbody tr:nth-child(even) { background: #171f2b; }
tbody tr:focus-within { background: var(--raised); }
.rank { padding-inline: 4px; text-align: center; color: var(--muted); font-size: 12px; }
tbody tr:nth-child(-n + 3) .rank { color: var(--amber); }
.model { padding-block: 4px; font-size: 13px; font-weight: 600; }
.identity, .model-meta { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 3px 6px; }
.identity .model-provider {
  color: var(--provider);
  background: color-mix(in srgb, var(--provider) 13%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--provider) 39%, var(--surface));
  border-radius: 4px;
  padding: 0 4px 1px;
  font-size: 11px;
  line-height: 1.2;
}
.model-name { min-width: 0; overflow-wrap: anywhere; color: inherit; text-decoration: none; }
.effort, .model-meta small, .mobile-limit { font: 11px/1.25 "Segoe UI", system-ui, sans-serif; color: var(--muted); }
.effort { background: #263244; padding: 1px 5px 2px; border-radius: 4px; }
.effort[data-effort="low"] { color: #71e3d3; background: #14403e; }
.effort[data-effort="medium"] { color: #92c7ff; background: #21395a; }
.effort[data-effort="high"] { color: #ffca61; background: #483512; }
.effort[data-effort="xhigh"] { color: #ffa26e; background: #502a1b; }
.effort[data-effort="max"] { color: #ff8da8; background: #502238; }
.effort[data-effort="max ultra"] { color: #ffa9c6; background: #502238; }
.model-meta .plan-tier { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 2px 4px; padding: 1px 4px; background: #233143; border-radius: 4px; color: #c2d0e3; }
.plan-tier .plan-price { color: var(--text); font-weight: 600; }
.model-meta .plan-tier.premium { background: #392b22; color: #f1cea5; }
.plan-tier.premium .plan-price { color: var(--amber); }
.estimate, .model-meta .estimate { color: var(--amber); border: 1px solid #705739; border-radius: 4px; padding: 0 4px 1px; }
tbody tr.is-estimated { background: #201d1d; }
tbody tr.is-api { background: #142430; }
.is-api td.quota { color: #8cddf7; }
.api-badge { border: 1px solid #3c7186; border-radius: 9px; color: #a1e7fb !important; background: #183642; padding: 0 5px; }
.api-price { font-weight: 600; }
.quota small:not(.mobile-limit) { color: var(--muted); }
.estimated-choice, .api-choice, .bench-choice { font-weight: 600; }
table:not(.has-external) .ext-col,
table:not(.has-external) .col-coding,
table:not(.has-external) .col-finish { display: none; }
.model-meta button.estimate { min-height: 0; background: #34281c; font: inherit; font-size: 11px; line-height: 1.25; }
#range-dialog { max-width: min(470px, 90vw); background: var(--surface); color: var(--text); border: 1px solid var(--edge); border-radius: 8px; }
#range-dialog::backdrop { background: #000a; }
#range-dialog h2 { margin: 0; font-size: 17px; }
#range-dialog dl { display: grid; grid-template-columns: 1fr auto; gap: 6px; }
#range-dialog dd { margin: 0; }
#range-dialog p { color: var(--muted); margin-bottom: 12px; }

td.metric, td.limit { font-size: 12px; font-weight: 600; white-space: nowrap; }
.reading { display: grid; grid-template-columns: 43px minmax(0, 1fr); align-items: center; gap: 6px; }
.number { text-align: start; }
.score .reading { --bar-color: var(--provider) !important; }
.track { position: relative; height: 7px; border-radius: 4px; background: #283446; overflow: hidden; }
.bar {
  position: absolute;
  inset: 0;
  clip-path: inset(0 calc(100% - var(--fill)) 0 0 round 4px);
  background: var(--bar-color);
}
td.limit { color: var(--muted); }
td.at-limit, .mobile-limit.at-limit { color: var(--coral); }
.value .number, .quota .number, .coding .number, .finish .number { color: var(--bar-color); }
.conf-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-inline-end: 4px;
  vertical-align: 1px;
}
.conf-high { background: var(--bar-good); }
.conf-mid { background: var(--google); }
.conf-low { background: var(--bar-mid); }
.value .number {
  font-weight: 700;
  text-align: center;
}
@media (min-width: 711px) {
  .leader { display: flex; align-items: center; gap: 8px; padding: 4px 8px; min-height: 34px; }
  .leader-label { flex-shrink: 0; white-space: nowrap; font-size: 11px; }
  .leader strong { order: -1; flex-shrink: 0; font-size: 19px; }
  .leader-model { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
  #filters { padding: 5px 8px; }
  .filter-row :is(input, select, button), .checks label { min-height: 28px; }
  .filter-row input[type="checkbox"] { min-height: 0; }
  .filter-values { margin-top: 4px; }
  .col-model { width: 24%; }
  .col-score, .col-value, .col-time { width: auto; }
  .col-quota { width: 14.5%; }
  .col-limit { width: 6%; }
  .col-rank, .col-action { width: 26px; }
  table.has-external .col-model { width: 25%; }
  table.has-external .col-quota, table.has-external .col-finish { width: 10.5%; }
  table.has-external .col-coding, table.has-external .col-score, table.has-external .col-value, table.has-external .col-time { width: auto; }
  table.has-external .col-limit { width: 5.5%; }
  table.has-external .reading { grid-template-columns: 42px minmax(0, 1fr); gap: 4px; }
  table.has-external .identity .model-provider { width: 54px; }
  .table-wrap :is(th, td).limit { text-align: center; }
  .table-wrap th, .table-wrap td { padding-inline: 5px; }
  .table-wrap thead button { min-height: 29px; }
  .table-wrap tbody tr:first-child > * { border-top: 1px solid transparent; }
  .table-wrap .model { padding-block: 1px; }
  .identity { display: flex; flex-wrap: nowrap; gap: 5px; white-space: nowrap; }
  .identity .model-name { overflow: hidden; text-overflow: ellipsis; }
  .identity .model-meta { flex: none; flex-wrap: nowrap; gap: 4px; margin: 0; }
  .identity .plan-tier { flex-wrap: nowrap; }
  .effort, .model-provider { flex: none; }
  .identity .model-provider { width: 61px; text-align: center; overflow: hidden; text-overflow: ellipsis; }
  .table-wrap .hide { min-height: 23px; }
  .table-wrap .reading { grid-template-columns: 37px minmax(0, 1fr); gap: 5px; }
  .table-wrap .track { height: 7.5px; border-radius: 4px; }
  .table-wrap .number { text-align: center; }
  .table-wrap td.metric, .table-wrap td.limit { font-size: 13px; }
}
.mobile-limit { display: none; }
.action { padding-inline: 4px; }
.hide { width: 100%; min-height: 30px; color: var(--muted); padding: 0; background: transparent; border-color: transparent; font-size: 17px; line-height: 1; }
#empty { padding: 16px 12px; }
#hidden { position: relative; }
.hidden-panel { position: absolute; z-index: 2; inset-inline-end: 0; top: 100%; min-width: 220px; max-height: 260px; overflow: auto; overscroll-behavior: contain; background: var(--surface); border: 1px solid var(--edge); border-radius: 8px; padding: 8px; }
.hidden-panel ul { padding: 0; margin: 8px 0 0; list-style: none; }
.hidden-panel li + li { margin-top: 4px; }
footer { margin-top: 14px; justify-content: space-between; align-items: start; color: var(--muted); font-size: 12px; }
footer a { color: var(--ice); text-underline-offset: 3px; }
footer details { flex: 1 1 260px; max-width: 70ch; }
footer details p { margin-top: 8px; }

@media (hover: hover) {
  button:not(:disabled):hover { border-color: var(--ice); }
  .primary:not(:disabled):hover { background: #1b382c; }
  .providers button:hover, #reset:hover, .hide:hover { color: var(--text); background: var(--raised); }
  thead button:hover { color: var(--ice); }
  tbody tr:hover { background: var(--raised); }
  .model-name[href]:hover { text-decoration: underline; text-underline-offset: 3px; }
}
@media (max-width: 970px) {
  .value .number { justify-self: start; }
}
@media (max-width: 710px) {
  .reading { grid-template-columns: 1fr; gap: 2px; }
  .track { height: 4px; }
  main { width: calc(100% - 24px); margin-block: 16px; }
  .filter-scope { gap: 8px 18px; }
  .col-limit, .limit, .col-rank, .rank, .unit { display: none; }
  .mobile-limit { display: block; margin-top: 2px; }
  .col-score, .col-time, .col-value { width: 14%; }
  .col-quota { width: 18%; }
  .model, th, td { padding-inline: 5px; }
  .model, thead th:first-child { padding-inline-start: 8px; }
}
@media (max-width: 500px) {
  main { width: calc(100% - 16px); }
  header { margin-bottom: 12px; }
  .leaders { gap: 4px; }
  .leader { grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 8px; }
  .leader strong { grid-row: auto; grid-column: auto; font-size: 20px; }
  .leader-model, .leader-label { font-size: 11px; }
  #filters { padding-inline: 8px; }
  .providers { gap: 2px; }
  .providers button { min-height: 40px; gap: 4px; padding-inline: 5px; font-size: 12px; }
  .settings { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); flex: 1 1 100%; gap: 4px 8px; }
  .settings label { display: grid; grid-template-columns: auto minmax(0, 1fr); }
  .settings select { width: 100%; max-width: none; }
  .filter-values { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .filter-values > label { white-space: normal; }
  .filter-values .search { grid-column: 1 / -1; }
  #min-value, #max-time { width: 100%; }
  #reset { grid-column: 2; grid-row: 3; justify-self: end; align-self: center; }
  .checks { grid-column: 1 / -1; grid-row: 3; justify-self: start; padding-inline-end: 64px; }
  .checks label, #reset { min-height: 40px; }
  .metric-note { flex-basis: 100%; margin-inline-start: 0; }
  .color-note { display: block; }
  #hidden { margin-inline-start: auto; }
  .col-quota { width: 20%; }
  .col-action { width: 27px; }
  .model, td.metric, thead th { font-size: 11px; }
  .effort, .model-meta small, .mobile-limit { font-size: 10px; }
  .model-meta { margin-inline-start: 0; }
  .number { padding-inline: 3px; }
  .hide { min-height: 40px; }
}

