:root {
  --paper: #f2f4f6;
  --panel: #ffffff;
  --ink: #17212b;
  --muted: #5b6875;
  --rule: #d5dbe1;
  --steel: #8fa6bc;
  --exec: #6a4fb3;
  --goal: #b86e0b;
  --neg: #a8322d;
  --pos: #1f6f54;
  --radius: 6px;
  font-family: "IBM Plex Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-size: 16px;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
}

* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* 머리 */
.top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 24px 0;
}
.mark {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.top-link { color: var(--muted); font-size: 14px; }

main { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

.intro { padding: 40px 0 28px; max-width: 46rem; }
.intro h1 {
  font-size: clamp(30px, 4.6vw, 46px);
  line-height: 1.2;
  letter-spacing: -0.03em;
  font-weight: 700;
  margin: 0 0 14px;
  word-break: keep-all;
}
.intro p { margin: 0; color: var(--muted); word-break: keep-all; }

.presets { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.presets button {
  border: 1px solid var(--rule);
  background: var(--panel);
  border-radius: 999px;
  padding: 7px 16px;
  cursor: pointer;
  font-size: 15px;
}
.presets button:hover { border-color: var(--ink); }
.presets button[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

/* 본문 배치 */
.layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
  padding-bottom: 64px;
}

.filters { position: sticky; top: 16px; }
.filters summary {
  font-weight: 700;
  cursor: pointer;
  padding: 6px 0 10px;
  list-style: none;
}
.filters summary::-webkit-details-marker { display: none; }
.filters form { display: grid; gap: 14px; }
.field { display: grid; gap: 4px; font-size: 14px; }
.field span { color: var(--muted); }
.field input, .field select, .sort select {
  width: 100%;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 8px 10px;
  font-size: 15px;
}
.field select:disabled { opacity: 0.5; }
.clear {
  justify-self: start;
  border: 0;
  background: none;
  padding: 4px 0;
  color: var(--muted);
  text-decoration: underline;
  cursor: pointer;
  font-size: 14px;
}

/* 결과 */
.results-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: end;
  gap: 12px 24px;
  padding-bottom: 14px;
}
.summary { margin: 0; max-width: 40rem; word-break: keep-all; }
.summary strong { font-weight: 700; }
.summary .note { display: block; color: var(--muted); font-size: 14px; }
.sort { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.sort select { width: auto; color: var(--ink); }

.legend {
  margin: 0 0 8px;
  padding: 14px 16px 26px;
  overflow: hidden;
  background: var(--panel);
  border-radius: var(--radius);
}
.legend-keys { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 13px; color: var(--muted); }
.key { display: inline-flex; align-items: center; gap: 7px; }
.key i { display: inline-block; flex: none; }
.k-staff { width: 11px; height: 11px; border-radius: 50%; background: var(--ink); }
.k-range { width: 22px; height: 6px; border-radius: 3px; background: var(--steel); }
.k-exec { width: 9px; height: 9px; background: var(--exec); transform: rotate(45deg); }
.k-goal { width: 2px; height: 14px; background: var(--goal); }

.axis { position: relative; height: 1px; margin: 16px -16px 0; font-size: 12px; color: var(--muted); }
.axis span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.axis span:first-child { transform: none; }
.axis span:last-child { transform: translateX(-100%); }

.list { list-style: none; margin: 0; padding: 0; }

.co {
  padding: 22px 0 20px;
  border-bottom: 1px solid var(--rule);
}
.co-head { display: flex; justify-content: space-between; align-items: start; gap: 16px; }
.co-name { margin: 0; font-size: 20px; line-height: 1.35; letter-spacing: -0.02em; font-weight: 700; word-break: keep-all; }
.co-meta { margin: 2px 0 0; color: var(--muted); font-size: 14px; word-break: keep-all; }
.co-pay { margin: 0; text-align: right; flex: none; }
.co-pay-label { display: block; font-size: 12px; color: var(--muted); }
.co-pay strong { font-size: 24px; letter-spacing: -0.02em; font-weight: 700; white-space: nowrap; }

/* 급여 막대: 0~3억 직선 눈금 */
.ladder { position: relative; height: 26px; margin: 14px 0 10px; }
.ladder > span { position: absolute; top: 50%; }
.l-track { left: 0; right: 0; height: 2px; margin-top: -1px; background: var(--rule); }
.l-tick { width: 1px; height: 10px; margin-top: -5px; background: var(--rule); }
.l-goal { width: 2px; height: 26px; margin-top: -13px; margin-left: -1px; background: var(--goal); }
.l-range { height: 6px; margin-top: -3px; border-radius: 3px; background: var(--steel); }
.l-staff {
  width: 14px; height: 14px; margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 2px var(--paper);
}
.l-exec {
  width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px;
  background: var(--exec);
  transform: rotate(45deg);
}
.l-exec.over {
  transform: none;
  width: 0; height: 0;
  margin: -6px 0 0 -8px;
  background: none;
  border-left: 10px solid var(--exec);
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
}
.ladder [hidden] { display: none; }

.co-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 22px;
  margin: 0;
  font-size: 14px;
}
.co-facts div { display: flex; gap: 6px; }
.co-facts dt { color: var(--muted); }
.co-facts dd { margin: 0; }
.co-facts .neg { color: var(--neg); }
.co-facts .exec-val { color: var(--exec); }

.co-note { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.co-links { margin: 10px 0 0; font-size: 14px; display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); }
.co-links a { color: var(--ink); text-underline-offset: 3px; padding: 4px 0; }
.co-links .group { display: inline-flex; gap: 10px; }

.more {
  display: block;
  width: 100%;
  margin-top: 20px;
  padding: 12px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--panel);
  cursor: pointer;
}
.more:hover { border-color: var(--ink); }
.more[hidden] { display: none; }

.empty { padding: 32px 0; color: var(--muted); }
.empty button { border: 0; background: none; padding: 0; text-decoration: underline; cursor: pointer; color: var(--ink); }

/* 바닥 */
.about {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 56px;
  border-top: 1px solid var(--rule);
  font-size: 14px;
  color: var(--muted);
}
.about h2 { font-size: 16px; color: var(--ink); margin: 0 0 8px; }
.about ul { margin: 0; padding-left: 18px; max-width: 48rem; }
.about li { margin-bottom: 4px; word-break: keep-all; }
.updated { margin: 14px 0 0; }

@media (max-width: 899px) {
  .layout { grid-template-columns: 1fr; gap: 16px; }
  .filters { position: static; background: var(--panel); border-radius: var(--radius); padding: 6px 16px; }
  .filters[open] { padding-bottom: 16px; }
  .filters summary::after { content: " 펼치기"; font-weight: 400; color: var(--muted); font-size: 14px; }
  .filters[open] summary::after { content: " 접기"; }
  .filters form { grid-template-columns: 1fr 1fr; }
  .filters .field:first-child { grid-column: 1 / -1; }
}

@media (max-width: 520px) {
  .top, main, .about { padding-left: 16px; padding-right: 16px; }
  .intro { padding-top: 28px; }
  .co-head { flex-direction: column; gap: 6px; }
  .co-pay { text-align: left; }
  .co-pay-label { display: inline; margin-right: 8px; }
  .co-pay strong { font-size: 22px; }
  .results-head { align-items: start; }
}

@media (prefers-reduced-motion: no-preference) {
  .presets button { transition: background-color 0.15s, color 0.15s, border-color 0.15s; }
}
