:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-soft: #f6f7f8;
  --ink: #111827;
  --muted: #52606d;
  --line: #d7dde5;
  --header: #111827;
  --header-hover: #1f2937;
  --accent: #0f766e;
  --proprietary: #7c3aed;
  --korean: #be185d;
  --vision: #0f766e;
  --reasoning: #b45309;
  --ok: #0f766e;
  --warn: #b91c1c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Plus Jakarta Sans", Inter, "Noto Sans KR", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

a {
  color: inherit;
}

.page-shell {
  width: min(78%, 1380px);
  margin: 0 auto;
  padding: 48px 20px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

h1 {
  margin: 0;
  text-align: center;
  font-size: 40px;
  line-height: 1.1;
  font-weight: 700;
  color: #102019;
}

.subtitle,
.intro-copy,
.results-note,
.citation-note,
.footer p {
  color: var(--muted);
}

.subtitle {
  margin: 0;
  max-width: 880px;
  text-align: center;
  font-size: 16px;
  line-height: 1.6;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.badge-row a {
  display: inline-flex;
}

.badge-row img {
  max-width: 100%;
  height: auto;
}

.intro-copy,
.meta-strip,
.plot-section,
.results-section,
.citation-section {
  width: 100%;
}

.intro-copy {
  max-width: 920px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.intro-copy p {
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
  text-align: center;
}

.meta-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.meta-pill {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  font-size: 12px;
  color: var(--muted);
  text-align: right;
}

.meta-pill strong {
  color: var(--ink);
}

.meta-pill__status {
  color: var(--ok);
  font-weight: 700;
  text-transform: uppercase;
}

.meta-pill__status.is-mismatch {
  color: var(--warn);
}

.results-section,
.plot-section,
.citation-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.plot-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  width: 100%;
  justify-content: center;
  overflow-x: auto;
  padding-bottom: 4px;
}

.plot-tab {
  flex: 0 0 auto;
  border: 1px solid #cbd5e1;
  border-right-width: 0;
  border-radius: 0;
  background: var(--surface);
  padding: 10px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: #475569;
  cursor: pointer;
  white-space: nowrap;
}

.plot-tab:first-child {
  border-radius: 8px 0 0 8px;
}

.plot-tab:last-child {
  border-right-width: 1px;
  border-radius: 0 8px 8px 0;
}

.plot-tab:hover {
  background: #f8fafc;
  color: #1e293b;
}

.plot-tab.is-active {
  border-color: #1e293b;
  background: #1e293b;
  color: #ffffff;
}

.plot-tab.is-active + .plot-tab {
  border-left-color: #1e293b;
}

.plot-tab.is-active:hover {
  background: #1e293b;
  color: #ffffff;
}

.plot-frame {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.plot-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
  text-align: left;
}

.plot-title,
.plot-subtitle {
  margin: 0;
}

.plot-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

.plot-subtitle {
  display: none;
}

.plot-surface {
  position: relative;
  width: 100%;
  height: 600px;
  overflow: hidden;
}

#chart-container {
  width: 100%;
  height: 100%;
}

#plot-filter-bar {
  position: absolute;
  top: 2px;
  left: 12px;
  display: flex;
  gap: 12px;
  z-index: 2;
  font-size: 12px;
  color: #64748b;
}

#shape-legend {
  position: absolute;
  top: 2px;
  right: 12px;
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: #64748b;
  pointer-events: none;
}

.shape-legend-symbol {
  display: inline-block;
  margin-right: 4px;
}

.shape-legend-symbol--reasoning {
  color: #475569;
}

.shape-legend-symbol--instruct {
  color: #475569;
}

.results-copy {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.controls-row {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 13px;
  color: var(--muted);
}

.legend-entry {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.legend-filter {
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.legend-filter:hover {
  color: var(--ink);
}

.legend-filter.is-active {
  color: var(--ink);
}

.legend-filter.is-active .type-pill--k {
  box-shadow: 0 0 0 1px #be185d inset;
}

.legend-filter.is-active .type-pill--p {
  box-shadow: 0 0 0 1px #7c3aed inset;
}

.legend-filter.is-active .type-pill--g {
  border-color: #596678;
  background: #596678;
  color: #f8fafc;
}

.legend-filter.is-active .type-pill--v {
  box-shadow: 0 0 0 1px #0f766e inset;
}

.legend-filter.is-active .type-pill--r {
  box-shadow: 0 0 0 1px #b45309 inset;
}

.search {
  width: min(320px, 100%);
}

.search span {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.search input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px 12px;
  font: inherit;
  color: var(--ink);
}

.section-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6a7b73;
}

.results-note {
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
  text-align: left;
}

.results-section .section-label {
  text-align: left;
}

.results-note-pill {
  margin: 0 4px 0 6px;
  vertical-align: middle;
  min-width: 28px;
  padding: 1px 8px;
  font-size: 10px;
  line-height: 1.2;
}

.results-note-sort {
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.results-note-sort .results-note-pill {
  margin-left: 0;
}

.results-note-sort:hover .results-note-pill {
  filter: brightness(0.98);
}

.results-note-sort.is-active .results-note-pill {
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.22) inset;
}

.table-scroll-wrapper {
  width: 100%;
  overflow-x: auto;
}

#lb-table {
  width: 100%;
  min-width: 1260px;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}

#lb-table thead th {
  background: #6b7280;
  color: #f5faf7;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 12px 14px;
  border: 0;
  white-space: nowrap;
  text-align: right;
  cursor: pointer;
  user-select: none;
}

#lb-table thead th:nth-child(-n + 5) {
  background: var(--header);
}

#lb-table thead th:hover {
  background: #4b5563;
}

#lb-table thead th:nth-child(-n + 5):hover {
  background: var(--header-hover);
}

#lb-table thead th:nth-child(1),
#lb-table thead th:nth-child(2) {
  text-align: left;
}

#lb-table thead th:nth-child(3) {
  text-align: right;
}

#lb-table thead th.type-header {
  text-align: center;
}

#lb-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid #eceff3;
  vertical-align: middle;
  text-align: right;
  font-size: 14px;
  white-space: nowrap;
  color: var(--ink);
}

#lb-table tbody td:nth-child(1),
#lb-table tbody td:nth-child(2) {
  text-align: left;
  color: var(--ink);
}

#lb-table tbody td.size-cell {
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

#lb-table tbody td.type-cell {
  text-align: center;
  color: var(--ink);
}

#lb-table tbody tr:hover {
  background: var(--surface-soft);
}

#lb-table tbody tr:last-child td {
  border-bottom: 0;
}

.sort-arrow {
  margin-left: 4px;
  font-size: 10px;
  opacity: 0.8;
}

.rank-cell {
  width: 52px;
  color: #708178;
  font-weight: 700;
}

.model-cell {
  min-width: 250px;
}

.model-name {
  display: block;
  font-weight: 600;
  color: var(--ink);
}

.type-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.type-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  min-width: 24px;
  padding: 2px 7px;
  border: 1px solid var(--line);
  font-size: 11px;
  font-weight: 600;
}

.type-pill--k {
  border-color: #f3c4da;
  background: #fce7f3;
  color: var(--korean);
}

.type-pill--p {
  border-color: #d8c6fb;
  background: #f3e8ff;
  color: var(--proprietary);
}

.type-pill--g {
  border-color: #cbd5e1;
  background: #e2e8f0;
  color: #94a3b8;
}

.type-pill--v {
  border-color: #9dded5;
  background: #ccfbf1;
  color: var(--vision);
}

.type-pill--r {
  border-color: #f6d28b;
  background: #fef3c7;
  color: var(--reasoning);
}

.type-pill--off {
  background: #f8fafc;
  color: #94a3b8;
}

.metric-strong {
  font-weight: 700;
}

.muted {
  color: var(--muted);
}

.citation-note {
  margin: 0;
  font-size: 13px;
}

#citation-block {
  margin: 0;
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
}

.footer {
  border-top: 1px solid var(--line);
  width: 100%;
  margin-top: 24px;
  padding: 24px 20px 36px;
  text-align: center;
}

.footer p {
  margin: 4px 0;
  font-size: 12px;
}

@media (max-width: 1200px) {
  .page-shell {
    width: min(96%, 1380px);
  }
}

@media (max-width: 720px) {
  .page-shell {
    padding: 32px 14px 20px;
    gap: 14px;
  }

  h1 {
    font-size: 30px;
  }

  .subtitle {
    font-size: 14px;
  }

  .intro-copy p,
  .plot-subtitle,
  .results-note {
    font-size: 13px;
  }

  .plot-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .plot-tab {
    flex: 0 0 auto;
  }

  .controls-row {
    align-items: stretch;
  }

  .search {
    width: 100%;
  }

  #lb-table tbody td,
  #lb-table thead th {
    padding: 10px 12px;
  }
}
