/* Quantized Local LLM Benchmark — 웹 글꼴 없이 시스템 글꼴만 씁니다.
   종이 같은 바탕, 잉크색 글, 헤어라인 선. 강조색은 하나(번트 오렌지)이고 아주 조금만 씁니다. */
:root {
  color-scheme: light dark;
  --bg: #fbfaf7;
  --bg-soft: #f3f1ec;
  --text: #16181a;
  --muted: #62666b;         /* 종이색 대비 약 5.4:1, 옅은 면 위에서도 4.5:1 이상 */
  --line: #e2dfd8;          /* 헤어라인 */
  --field-line: #8c8a84;    /* 입력칸 테두리(비텍스트 대비 3:1 이상을 위해 헤어라인보다 진함) */
  --accent: #b4410f;        /* 종이색 대비 약 5.4:1 */
  --accent-text: #fbfaf7;
  --ok-bg: #eef3ec;   --ok-fg: #2e6b3e;   --ok-bd: #b9cfbc;
  --warn-bg: #f6efde; --warn-fg: #7a5000; --warn-bd: #dccb9f;
  --bad-bg: #f6e8e4;  --bad-fg: #922c22;  --bad-bd: #e0b9b0;
  --est-bg: #f3f1ec;  --est-fg: #62666b;
  --font: system-ui, -apple-system, "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "D2Coding", monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131313;
    --bg-soft: #1b1a18;
    --text: #ebe7df;
    --muted: #a19d95;
    --line: #2c2a27;
    --field-line: #77746d;
    --accent: #f0874a;      /* 어두운 바탕 대비 약 7:1 */
    --accent-text: #131313;
    --ok-bg: #1b251d;   --ok-fg: #9fcaa9;   --ok-bd: #34503b;
    --warn-bg: #292212; --warn-fg: #dcb86a; --warn-bd: #55461f;
    --bad-bg: #2b1a17;  --bad-fg: #eaa596;  --bad-bd: #623830;
    --est-bg: #1b1a18;  --est-fg: #a19d95;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 1rem; line-height: 1.65; word-break: keep-all; overflow-wrap: break-word;
}
a { color: var(--text); text-decoration: underline; text-decoration-color: var(--muted); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--accent); text-decoration-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 0.5rem; top: -4rem; background: var(--text); color: var(--bg); padding: 0.5rem 0.9rem; border-radius: 0 0 3px 3px; z-index: 10; }
.skip:focus { top: 0; }
.mono { font-family: var(--mono); font-size: 0.86em; }

.wrap { max-width: 72rem; margin: 0 auto; padding: 0 1.25rem; }

/* 머리말: 얇은 막대 하나 */
header.site { border-bottom: 1px solid var(--line); background: var(--bg); }
header.site .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 0 1.75rem; padding-top: 0.15rem; padding-bottom: 0.15rem; }
.brand { font-weight: 700; font-size: 1rem; letter-spacing: -0.01em; color: var(--text); text-decoration: none; display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.55rem 0; }
.brand:hover { color: var(--text); }
.brand svg { width: 1rem; height: 1rem; flex: none; }
nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 1.1rem; }
nav a { display: inline-block; padding: 0.55rem 0 0.4rem; border-bottom: 2px solid transparent; color: var(--text); text-decoration: none; font-size: 0.92rem; }
nav a:hover { color: var(--accent); }
nav a[aria-current="page"] { border-bottom-color: var(--accent); font-weight: 650; }
header.site nav.lang { margin-left: auto; }
header.site nav.lang ul { gap: 0; }
header.site nav.lang li + li::before { content: "·" / ""; color: var(--muted); padding: 0 0.45rem; }
header.site nav.lang li { display: flex; align-items: center; }
header.site nav.lang a { color: var(--muted); font-size: 0.85rem; letter-spacing: 0.04em; border-bottom: 0; padding: 0.55rem 0; }
header.site nav.lang a:hover { color: var(--accent); }
header.site nav.lang a[aria-current="true"] { color: var(--text); font-weight: 700; }
@media (max-width: 48rem) {
  header.site .wrap { gap: 0 1rem; }
  header.site nav.lang { order: 2; }
  header.site nav:not(.lang) { order: 3; flex-basis: 100%; }
  nav ul { gap: 0 0.95rem; }
}

main { padding: 1.75rem 0 3rem; }
h1, h2, h3 { letter-spacing: -0.01em; }
h1 { font-size: 1.9rem; line-height: 1.3; font-weight: 700; margin: 0.2rem 0 0.7rem; }
h2 { font-size: 1.3rem; line-height: 1.4; font-weight: 650; margin: 2.4rem 0 0.5rem; }
h3 { font-size: 1.05rem; line-height: 1.45; font-weight: 650; margin: 1.6rem 0 0.4rem; }
@media (max-width: 40rem) { h1 { font-size: 1.55rem; } h2 { font-size: 1.2rem; } }
p, ul, ol { margin: 0.6rem 0; }
main :is(p, ul, ol, h1, h2, h3, h4, pre, details, .box, dl, .empty, .hint) { max-width: 44rem; }
main :is(td, th, .table-wrap) :is(p, ul, ol, dl) { max-width: none; }
.lead { font-size: 1.1rem; color: var(--muted); margin-top: 0; }
code, kbd { font-family: var(--mono); font-size: 0.88em; background: var(--bg-soft); padding: 0.08em 0.3em; border-radius: 2px; }
pre { background: var(--bg-soft); padding: 0.8rem 1rem; border-radius: 3px; overflow-x: auto; line-height: 1.5; font-family: var(--mono); font-size: 0.88rem; border: 1px solid var(--line); }
pre code { background: none; padding: 0; }
.box { border-top: 1px solid var(--text); padding: 0.5rem 0 0; margin: 1.5rem 0; }
.box h2, .box h3 { font-size: 0.95rem; font-weight: 700; margin: 0 0 0.3rem; }
.note { color: var(--muted); font-size: 0.93rem; }
.blank { background: var(--warn-bg); color: var(--warn-fg); padding: 0 0.3em; border-radius: 2px; font-family: var(--mono); font-size: 0.9em; }

/* 접이식: 작은 삼각형 */
details > summary { cursor: pointer; font-weight: 700; font-size: 0.95rem; padding: 0.15rem 0; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: "\25B8"; display: inline-block; width: 1.1em; color: var(--muted); }
details[open] > summary::before { content: "\25BE"; }

/* 폼: 바탕 없이 위아래 선만 */
form.calc { display: grid; gap: 1rem; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 1.1rem 0; margin: 1rem 0; max-width: 56rem; }
.field { display: grid; gap: 0.25rem; }
.field label, fieldset legend { font-weight: 650; font-size: 0.92rem; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.row { display: grid; gap: 1rem; grid-template-columns: 1fr; }
input[type="text"], input[type="search"], input[type="number"], select {
  font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--field-line); border-radius: 4px; padding: 0.45rem 0.6rem; width: 100%; min-height: 2.75rem;
}
input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
input:disabled { opacity: 0.55; }
.inline { display: flex; flex-wrap: wrap; gap: 0.3rem 1.4rem; }
.inline label { font-weight: 400; display: inline-flex; align-items: center; gap: 0.4rem; min-height: 2.25rem; }
input[type="checkbox"], input[type="radio"] { width: 1.1rem; height: 1.1rem; accent-color: var(--accent); }
.hint { color: var(--muted); font-size: 0.88rem; }
@media (min-width: 40rem) { .row.cols-3 { grid-template-columns: 2fr 1fr 1fr; } .row.cols-2 { grid-template-columns: 1fr 1fr; } }

/* 결과 표 */
#summary { font-weight: 650; margin: 1rem 0 0.5rem; }
.table-wrap { overflow-x: auto; position: relative; }
.table-wrap:focus-visible { outline-offset: 0; }
table { font-variant-numeric: tabular-nums; }
table.rank { border-collapse: collapse; width: 100%; font-size: 0.93rem; }
table.rank th, table.rank td { text-align: left; vertical-align: top; padding: 0.55rem 0.6rem; border-bottom: 1px solid var(--line); }
table.rank thead th { background: var(--bg); position: sticky; top: 0; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.02em; color: var(--muted); border-bottom: 1px solid var(--text); vertical-align: bottom; white-space: nowrap; }
table.rank tbody tr:hover > * { background: var(--bg-soft); }
table.rank tbody th { font-weight: 400; min-width: 12rem; }
table.rank th.num, table.rank td.num { text-align: right; }
table.rank td.rank-n { font-size: 1.25rem; line-height: 1.3; color: var(--muted); font-weight: 400; width: 3rem; }
.model-name { font-weight: 650; }
.sub { color: var(--muted); font-size: 0.85rem; line-height: 1.45; }
.sub-cond { color: var(--muted); font-size: 0.78rem; line-height: 1.4; margin-top: 0.15rem; }
.links a { white-space: nowrap; }

/* 작은 글자 표지: 사탕 알약이 아니라 편집 태그 */
.badge { display: inline-block; font-size: 0.78rem; line-height: 1.35; padding: 0 0.4rem; border-radius: 3px; border: 1px solid var(--line); font-weight: 600; background: transparent; color: var(--muted); white-space: nowrap; vertical-align: 0.04em; }
.badge-st-full, .badge-com-yes, .badge-st-cpu { color: var(--ok-fg); border-color: var(--ok-bd); }
.badge-st-partial, .badge-com-conditional { color: var(--warn-fg); border-color: var(--warn-bd); }
.badge-st-none, .badge-com-no { color: var(--bad-fg); border-color: var(--bad-bd); }
.badge-est { color: var(--est-fg); border-color: var(--line); }
.badge-meas { color: var(--text); border-color: var(--text); font-weight: 700; }
.badge-api { color: var(--est-fg); border-color: var(--muted); border-style: dashed; }
.badge-warn { color: var(--warn-fg); border-color: var(--warn-bd); }
.badge-tag { color: var(--warn-fg); border-color: var(--warn-bd); font-size: 0.7rem; padding: 0 0.3rem; }
.badge-arena { color: var(--text); border-color: var(--field-line); }

/* 막대: 점수·속도 아래 얇은 선 */
.meter { display: block; height: 4px; max-width: 6.5rem; margin: 0.3rem 0 0; background: var(--line); }
.meter > i { display: block; height: 100%; background: var(--accent); }
.meter.partial > i { background: transparent; border: 1px dashed var(--muted); }
.num .meter { margin-left: auto; }
.hit { color: var(--accent); font-size: 0.7em; margin-right: 0.3em; vertical-align: 0.12em; }
.val { white-space: nowrap; }
.val strong { font-weight: 650; }
.val.partial { color: var(--muted); }

.empty { padding: 0.8rem 1rem; border: 1px dashed var(--field-line); border-radius: 3px; color: var(--muted); }
.empty p { margin: 0 0 0.6rem; }
.tier-jumps { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tier-jump { font: inherit; font-size: 0.92rem; min-height: 2.75rem; padding: 0.3rem 0.9rem; border: 1px solid var(--field-line); background: transparent; color: var(--text); border-radius: 4px; cursor: pointer; }
.tier-jump:hover { color: var(--accent); border-color: var(--accent); }
.error { color: var(--bad-fg); background: var(--bad-bg); padding: 0.55rem 0.8rem; border-radius: 3px; }

/* 속도 열(문맥 깊이별) */
table.rank th.group { text-align: left; border-bottom: 1px solid var(--line); padding-bottom: 0.2rem; }
table.rank tr.depth-head th { border-bottom: 1px solid var(--text); padding-top: 0.2rem; }
table.rank td.depth, table.rank tr.depth-head th { min-width: 3.9rem; padding-left: 0.35rem; padding-right: 0.35rem; }
table.rank td.depth .meter { max-width: 3.2rem; }
table.rank td.depth.over .val { color: var(--muted); }
table.rank td.depth.over .meter > i { background: var(--muted); }
.dash { color: var(--muted); }
.dash.fail { color: var(--bad-fg); font-weight: 700; }
table.rank td.swe { min-width: 12.5rem; }
.swe-line { white-space: nowrap; }
.legend { max-width: 56rem; margin-top: 0.7rem; }

/* 좁은 화면: 표를 줄마다 한 장씩 */
@media (max-width: 44rem) {
  .table-wrap { overflow: visible; }
  table.rank thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.rank, table.rank tbody, table.rank tr, table.rank th, table.rank td { display: block; }
  table.rank tbody tr { border-top: 1px solid var(--text); padding: 0.4rem 0 0.6rem; }
  table.rank tbody tr:hover > * { background: none; }
  table.rank th, table.rank td { border: 0 !important; padding: 0.25rem 0; text-align: left !important; }
  table.rank tbody th { min-width: 0; }
  table.rank td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: 0.78rem; letter-spacing: 0.02em; display: block; }
  table.rank td.rank-n { width: auto; font-size: 1.1rem; }
  .num .meter { margin-left: 0; }
  table.rank td.depth { display: inline-block; width: 48%; vertical-align: top; min-width: 0; padding-right: 0.5rem; }
  table.rank td.depth.none { display: none; }
  table.rank td.depth::before { display: inline-block; min-width: 2.6rem; }
  table.rank td.depth .val, table.rank td.depth .dash { display: inline; }
  table.rank td.depth .val::after { content: " t/s"; color: var(--muted); font-size: 0.78rem; }
  table.rank td.depth .meter { max-width: 6rem; }
  .swe-line { white-space: normal; }
}

footer.site { border-top: 1px solid var(--line); padding: 1rem 0 1.75rem; font-size: 0.85rem; color: var(--muted); }
footer.site p { margin: 0.3rem 0; max-width: 56rem; }
.guide-list { list-style: none; padding: 0; display: grid; gap: 0; max-width: 44rem; }
.guide-list li { border-top: 1px solid var(--line); padding: 0.7rem 0; }
.guide-list li:last-child { border-bottom: 1px solid var(--line); }
.guide-list a { font-weight: 650; font-size: 1.05rem; }
.prose table { border-collapse: collapse; width: 100%; font-size: 0.93rem; display: block; overflow-x: auto; }
.prose th, .prose td { border: 0; border-bottom: 1px solid var(--line); padding: 0.55rem 0.6rem; text-align: left; vertical-align: top; }
.prose thead th { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.02em; color: var(--muted); border-bottom: 1px solid var(--text); }
.prose tbody tr:hover > * { background: var(--bg-soft); }

/* 등급 탭: 밑줄로 현재 위치 표시 */
.tabs { display: flex; flex-wrap: wrap; gap: 0 1.1rem; margin: 1.25rem 0 0.4rem; border-bottom: 1px solid var(--line); }
.tabs [role="tab"] { font: inherit; min-height: 2.75rem; padding: 0.4rem 0.1rem; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: transparent; color: var(--muted); cursor: pointer; }
.tabs [role="tab"]:hover { color: var(--accent); }
.tabs [role="tab"][aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); font-weight: 700; }

/* 나란히 비교 표 */
.cmp { margin: 1.5rem 0; }
.cmp h3 { margin-bottom: 0.4rem; }
table.cmp-table { border-collapse: collapse; width: 100%; font-size: 0.9rem; min-width: 32rem; }
table.cmp-table th, table.cmp-table td { text-align: left; vertical-align: top; padding: 0.55rem 0.6rem; border-bottom: 1px solid var(--line); }
table.cmp-table thead th { background: var(--bg); position: sticky; top: 0; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.02em; color: var(--muted); border-bottom: 1px solid var(--text); }
table.cmp-table tbody th { font-weight: 600; background: var(--bg); position: sticky; left: 0; min-width: 11rem; }
table.cmp-table tbody tr:hover > * { background: var(--bg-soft); }
table.cmp-table td.best { color: var(--ok-fg); font-weight: 700; }
.cloud-note { background: var(--warn-bg); color: var(--warn-fg); border-radius: 3px; padding: 0.15rem 0.45rem; font-size: 0.8rem; margin: 0.2rem 0; }
.variants { margin-top: 0.3rem; }
.variant-list { margin: 0.4rem 0 0.2rem; padding-left: 1.1rem; line-height: 1.6; }
.variant-list li { margin: 0.2rem 0; }

@media (max-width: 44rem) { .table-wrap:has(> table.cmp-table) { overflow-x: auto; } }
[hidden] { display: none !important; }

/* 레이아웃 보강 */
.row.cols-4, .row.cols-3b { display: grid; gap: 1rem; grid-template-columns: 1fr; margin: 0.5rem 0 0.5rem; }
@media (min-width: 40rem) { .row.cols-4 { grid-template-columns: repeat(4, 1fr); } .row.cols-3b { grid-template-columns: repeat(3, 1fr); } }
.lang-choice { list-style: none; padding: 0; display: flex; gap: 1.2rem; }
.lang-choice a { display: inline-block; padding: 0.5rem 0; font-weight: 650; }

/* 리더보드 / 참조 출처 */
tr.row-api > * { color: var(--muted); }
tr.row-api .model-name { font-style: italic; font-weight: 400; }
.ref-meta { display: grid; grid-template-columns: max-content 1fr; gap: 0.3rem 1rem; margin: 0.5rem 0; }
.ref-meta dt { font-weight: 650; color: var(--muted); }
.ref-meta dd { margin: 0; overflow-wrap: anywhere; }
.attribution { font-size: 0.93rem; }
.date-cell { white-space: nowrap; }
.fits { color: var(--text); }

/* 메인 순위표: 넓은 화면에서는 본문보다 넓게 펼친다 */
@media (min-width: 64rem) {
  body.page-index :is(main, header.site, footer.site) .wrap { max-width: 100rem; }
  body.page-index main .wrap > :is(h1, p, details, form, .tabs, .hint, .note) { max-width: 72rem; }
}
#best16 td.eng { min-width: 8.5rem; }
#best16 td.swe { min-width: 13rem; }
#best16 tbody td:last-child { min-width: 16rem; }
@media (max-width: 44rem) { #best16 td.no-note { display: none; } }
#best16 .pp[title] { cursor: help; }
