:root {
  --eggshell: #fdfcfc;
  --taupe: #f5f3f1;
  --stone: #ebe8e4;
  --control-border: #e5e5e5;
  --ink: #000;
  --graphite: #44403b;
  --smoke: #777169;
  --ash: #a59f97;
  /* 회갈색 상자 위의 작은 안내 글자용. --smoke는 그 바탕에서 대비가 4.5:1에 못 미친다. */
  --smoke-deep: #615c55;
  /* 심각도 색. 낮을수록 옅은 노랑, 높을수록 진한 빨강으로 이어지는 열 지도다. 글자색은 바탕과 대비 4.5:1 이상으로 고른다. */
  --sev-critical: #7f1d1d;
  --sev-high: #dc2626;
  --sev-medium: #f59e0b;
  --sev-low: #fde68a;
  --on-dark: #fff;
  --on-light: #1c1917;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
* { box-sizing: border-box; }
body {
  margin: 0 auto;
  max-width: 1040px;
  padding: 0 24px 64px;
  background: var(--eggshell);
  color: var(--ink);
  font: 400 16px/1.5 var(--sans);
  letter-spacing: 0.01em;
}
a { color: var(--ink); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 24px; min-height: 50px; padding: 12px 0; border-bottom: 1px solid var(--stone); }
h1 { margin: 0; font-size: 16px; font-weight: 600; }
h1 a { text-decoration: none; }
#stats { margin: 0; color: var(--smoke); font-size: 13px; }
#stats a { color: var(--ink); font-weight: 500; }

#filters { display: grid; gap: 16px; margin-top: 24px; padding: 24px; background: var(--taupe); border-radius: 20px; font-size: 14px; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; border: 0; }
.tabs legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.tabs label { position: relative; }
.tabs input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.tabs span, .pill-link, button {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  background: var(--eggshell);
  color: var(--ink);
  border: 1px solid var(--control-border);
  border-radius: 9999px;
  font: 500 14px/1 var(--sans);
  text-decoration: none;
  cursor: pointer;
}
.tabs input:checked + span { background: var(--ink); color: var(--eggshell); border-color: var(--ink); }
.tabs input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
button:disabled { color: var(--ash); cursor: default; }

.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px 16px; align-items: end; }
.fields .wide { grid-column: span 2; }
.fields label { display: grid; gap: 4px; color: var(--graphite); font-size: 13px; }
.fields .check { display: flex; align-items: center; gap: 8px; min-height: 36px; font-size: 14px; }
input[type="search"], input[type="text"], select {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  background: var(--eggshell);
  color: var(--ink);
  border: 1px solid var(--control-border);
  border-radius: 4px;
  font: 400 14px/1 var(--sans);
}
input::placeholder { color: var(--ash); }
.subscribe { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--smoke); font-size: 13px; }

#list-state { margin: 32px 0 8px; color: var(--smoke); font-size: 13px; }
#items { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--stone); }
#items > li { border-bottom: 1px solid var(--stone); }
#items summary { display: grid; gap: 8px; padding: 20px 4px; cursor: pointer; list-style: none; }
#items summary::-webkit-details-marker { display: none; }
#items summary:hover .title { text-decoration: underline; text-underline-offset: 3px; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 0 10px;
  border: 1px solid var(--control-border);
  border-radius: 9999px;
  color: var(--smoke);
  font-size: 12px;
  font-weight: 500;
}
.badge .score { font-family: var(--mono); font-weight: 400; }
.sev-critical { background: var(--sev-critical); border-color: var(--sev-critical); color: var(--on-dark); }
.sev-high { background: var(--sev-high); border-color: var(--sev-high); color: var(--on-dark); }
.sev-medium { background: var(--sev-medium); border-color: var(--sev-medium); color: var(--on-light); }
.sev-low { background: var(--sev-low); border-color: var(--sev-low); color: var(--on-light); }
.sev-unknown { border-style: dashed; color: var(--smoke); }
.kev { color: var(--ink); }
.kev::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ink); }
.title { font-size: 17px; font-weight: 500; line-height: 1.4; overflow-wrap: anywhere; }
.meta { color: var(--smoke); font-size: 13px; overflow-wrap: anywhere; }
.cves { margin: 0 4px 16px; font: 400 13px/1.69 var(--mono); overflow-wrap: anywhere; }
.cves a { color: var(--graphite); }

.detail { margin: 0 0 24px; padding: 24px 32px; background: var(--taupe); border-radius: 20px; font-size: 15px; overflow-wrap: anywhere; }
.detail section { margin-top: 28px; }
.detail h3 { margin: 0 0 8px; color: var(--ink); font-size: 14px; font-weight: 600; }
.detail p { margin: 0 0 8px; white-space: pre-line; }
.detail ul { margin: 0 0 8px; padding-left: 20px; }
.detail li { margin: 2px 0; white-space: pre-line; }
.detail details summary { display: block; padding: 4px 0; color: var(--graphite); font-size: 13px; }
.reason { font-size: 18px; line-height: 1.6; }
.machine { color: var(--smoke-deep); font-size: 12px; }
.detail .meta { color: var(--smoke-deep); }
.mono { font-family: var(--mono); font-size: 13px; }
.nowrap { white-space: nowrap; }

/* 이름과 값이 짝을 이루는 정보. 한눈에 훑도록 칸으로 나눈다. */
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; margin: 12px 0 0; }
.facts + .facts { margin-top: 8px; }
.facts > div { padding: 10px 14px; background: var(--eggshell); border: 1px solid var(--stone); border-radius: 10px; }
.facts dt { color: var(--smoke); font-size: 12px; }
.facts dd { margin: 2px 0 0; font-size: 14px; font-weight: 500; }

.detail .table-wrap { margin: 0 0 8px; background: var(--eggshell); border: 1px solid var(--stone); border-radius: 10px; }
.detail table { font-size: 14px; }
/* 표의 칸은 낱말 단위로만 끊는다. 상자 전체의 "어디서든 끊기"를 그대로 두면 표가 짧은 칸을 한두 글자 폭으로 줄인다. 긴 값(벡터, 근거, 주소)만 어디서든 끊는다. */
.detail td { overflow-wrap: normal; word-break: keep-all; }
.detail td .mono, .detail td .meta, .detail td a { overflow-wrap: anywhere; word-break: normal; }
.detail th { color: var(--smoke); font-size: 12px; white-space: nowrap; }
.detail tr:last-child td { border-bottom: 0; }
.tag { display: inline-block; margin-left: 6px; padding: 0 8px; background: var(--eggshell); border: 1px solid var(--control-border); border-radius: 9999px; color: var(--smoke); font-size: 12px; line-height: 20px; white-space: nowrap; }
.chips { margin: 0; }
/* 약점 유형은 번호가 없으면 긴 설명 글이다. 상자 밖으로 나가지 않게 줄을 바꾼다. */
.chips .tag { margin: 0 6px 6px 0; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 28px 0 0 !important; padding-top: 16px; border-top: 1px solid var(--stone); }

#pager { display: flex; justify-content: center; align-items: center; gap: 16px; padding: 32px 0 0; color: var(--smoke); font-size: 13px; }
#sources { margin-top: 64px; padding-top: 24px; border-top: 1px solid var(--stone); font-size: 13px; }
#sources > summary { cursor: pointer; color: var(--graphite); font-size: 14px; font-weight: 500; }
#sources-state { color: var(--smoke); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { color: var(--graphite); font-weight: 500; }
th, td { padding: 8px; border-bottom: 1px solid var(--stone); text-align: left; vertical-align: top; }
.num { text-align: right; font-family: var(--mono); }
.status-error td:nth-child(2) { color: var(--ink); font-weight: 600; }
.status-disabled { color: var(--ash); }
footer { margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--stone); color: var(--smoke); font-size: 13px; }
footer p { margin: 4px 0; }
code { font: 400 13px/1.69 var(--mono); }
[hidden] { display: none !important; }

@media (max-width: 640px) {
  body { padding: 0 16px 48px; }
  #filters { padding: 20px 16px; }
  .fields .wide { grid-column: auto; }
  .detail { padding: 20px 16px; }
}
