/* design.md 요약
   - 감도 출처: INDEX SEONGSU(index-seongsu.com/ko/popup-analysis) 리포트 화면.
     흰 바탕 + 검정 잉크, 상단 바(워드마크·검정 버튼), 왼쪽 목차 사이드바(활성 항목 검정 알약),
     '한눈에' 작은 라벨 + 제목 옆 기준일, 세로 선으로 나눈 지표 4칸, 검정 알약 필터, 1px 선 + 8px 둥근 카드,
     작은 회색 자료 출처 줄. 정보 밀도는 높게, 글자는 14~16px 중심.
   - 감도 출처: 박소은 시안(att-amber·meldy-site). 작은 글자 메뉴, 장식 없이 큰 제목 한 줄.
   - 강조색은 실리콘 녹색 하나(사실 번호·링크). 경고 갈색은 주의 표시에만. 그림자 없음. */
:root {
  --bg: #ffffff;
  --soft: #f6f7f7;
  --ink: #111413;
  --muted: #5f6664;
  --faint: #8a908e;
  --rule: #e3e6e5;
  --rule-strong: #cfd4d2;
  --accent: #0d6b5a;
  --accent-soft: #e6f2ee;
  --warn: #9a4417;
  --warn-soft: #fbf1ea;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --bar: 64px;
}
* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--bar) + 16px); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.6 "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  word-break: keep-all; overflow-wrap: anywhere;
}
a { color: var(--accent); text-underline-offset: 2px; }
.mono { font-family: var(--mono); font-size: .86em; white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* 상단 바 */
.bar { position: sticky; top: 0; z-index: 10; height: var(--bar); display: flex; align-items: center; gap: 24px; padding: 0 32px 0 48px; background: var(--bg); border-bottom: 1px solid var(--rule); }
.wordmark { font-size: 22px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); text-decoration: none; white-space: nowrap; }
.wordmark span { font-size: 14px; font-weight: 500; color: var(--muted); margin-left: 8px; letter-spacing: 0; }
.bar-meta { display: flex; gap: 14px; margin: 0 0 0 auto; font-size: 13px; color: var(--muted); }
.bar-meta span + span::before { content: "·"; margin-right: 14px; color: var(--faint); }
.btn { display: inline-flex; align-items: center; justify-content: center; height: 40px; padding: 0 16px; border-radius: 6px; background: var(--ink); color: #fff; font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.btn:hover { background: #2b302e; }
.btn.block { display: flex; width: 100%; height: 44px; }

/* 왼쪽 사이드바 + 본문 */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); }
.side { position: sticky; top: var(--bar); align-self: start; height: calc(100vh - var(--bar)); padding: 32px 16px; border-right: 1px solid var(--rule); overflow-y: auto; }
.side-title { margin: 0 8px 16px; font-size: 15px; font-weight: 700; }
.toc { display: flex; flex-direction: column; gap: 2px; }
.toc a { padding: 9px 14px; border-radius: 8px; font-size: 15px; color: #2e3432; text-decoration: none; }
.toc a:hover { background: var(--soft); }
.toc a[aria-current="true"] { background: var(--ink); color: #fff; font-weight: 600; }
.side-meta { margin: 24px 8px 12px; padding-top: 20px; border-top: 1px solid var(--rule); font-size: 13px; color: var(--muted); }
main { padding: 0 48px; max-width: 1360px; }

section { padding-top: 72px; }
section.first { padding-top: 28px; }
.eyebrow { margin: 0 0 4px; font-size: 13px; color: var(--muted); }
h1 { margin: 0 0 12px; font-size: 30px; font-weight: 600; letter-spacing: -.02em; line-height: 1.3; }
.h1-meta { margin-left: 12px; font-size: 13px; font-weight: 400; color: var(--muted); letter-spacing: 0; vertical-align: middle; }
.h1-meta a { color: var(--ink); }
.lede { max-width: 760px; margin: 0 0 20px; color: #2e3432; font-size: 15px; }
h2 { margin: 0 0 6px; font-size: 24px; font-weight: 650; letter-spacing: -.02em; line-height: 1.3; }
h3 { margin: 36px 0 10px; font-size: 17px; font-weight: 650; }
.intro { max-width: 760px; margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.intro em { font-style: normal; color: var(--warn); font-weight: 600; }

/* 지표 4칸 (세로 선으로 나눔) */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin: 0 0 16px; }
.kpi { padding: 18px 20px 18px 0; }
.kpi + .kpi { padding-left: 20px; border-left: 1px solid var(--rule); }
.kpi p { margin: 0; }
.kpi-label { font-size: 13px; color: var(--muted); }
.kpi-value { margin: 4px 0 !important; font-size: 22px; font-weight: 650; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.kpi-note { font-size: 13px; color: var(--muted); margin-bottom: 6px !important; }

.notice { margin: 0 0 8px; padding: 12px 16px; border-radius: 8px; background: var(--warn-soft); font-size: 14px; color: #3d2a1f; }
.notice strong { color: var(--warn); }

.glance { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 32px; margin: 8px 0 0; }
.glance .nw { white-space: nowrap; }
.glance .g { display: grid; grid-template-columns: 104px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.glance dt { font-size: 13px; color: var(--muted); padding-top: 2px; }
.glance dd { margin: 0; }
.glance strong { font-weight: 600; font-variant-numeric: tabular-nums; }
.glance .sub { display: block; font-size: 13px; color: var(--muted); }
/* 출처 칩은 칸마다 설명 아래 별도 줄에 둔다(설명 없는 칸도 같게) */
.glance dd .refs { display: block; margin-top: 6px; }

/* 사실 번호 */
.refs { white-space: nowrap; }
.refs a { font-family: var(--mono); font-size: 11.5px; padding: 1px 6px; margin-right: 3px; border-radius: 999px; text-decoration: none; color: var(--accent); background: var(--accent-soft); }
.refs a:hover { background: var(--accent); color: #fff; }

/* 표 = 1px 선 카드 */
.tw { overflow-x: auto; border: 1px solid var(--rule); border-radius: 8px; background: var(--bg); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; vertical-align: top; padding: 11px 16px; border-bottom: 1px solid var(--rule); }
thead th { font-size: 12.5px; font-weight: 500; color: var(--muted); background: var(--soft); white-space: nowrap; }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
.price th[scope="rowgroup"] { font-weight: 600; border-right: 1px solid var(--rule); max-width: 210px; }
.tl td:first-child { width: 120px; }

.pc { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pc > div { border: 1px solid var(--rule); border-radius: 8px; padding: 16px 20px; }
.pc h3 { margin: 0 0 6px; }
.pc ul { margin: 0; padding: 0; list-style: none; }
.pc li { padding: 10px 0; border-bottom: 1px solid var(--rule); font-size: 14px; }
.pc li:last-child { border-bottom: 0; }
.pc > div:last-child h3 { color: var(--warn); }

/* 필터: 검정 알약 */
.filters { position: sticky; top: var(--bar); z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; padding: 12px 0; background: var(--bg); border-bottom: 1px solid var(--rule); }
.filters input, .filters select { font: inherit; font-size: 14px; height: 40px; padding: 0 14px; border: 1px solid var(--rule-strong); border-radius: 999px; background: var(--bg); color: var(--ink); }
.filters .q input { width: min(300px, 80vw); }
.filters input:focus-visible, .filters select:focus-visible, .seg button:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { font: inherit; font-size: 14px; height: 40px; padding: 0 16px; border: 1px solid var(--rule-strong); border-radius: 999px; background: var(--bg); color: var(--ink); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 600; }
.count { margin: 0 0 0 auto; font-size: 13px; color: var(--muted); }

.facts td { font-size: 14px; }
.facts .k { color: var(--muted); }
.facts .fact { min-width: 320px; }
.facts .src { min-width: 200px; max-width: 280px; }
.facts .source { display: block; }
.host { display: block; font-family: var(--mono); font-size: 11.5px; color: var(--faint); }
.tag { display: inline-block; font-size: 12px; padding: 1px 8px; margin: 0 4px 4px 0; border-radius: 999px; border: 1px solid var(--rule-strong); color: var(--ink); white-space: nowrap; }
.tag.c { border-color: transparent; background: var(--soft); color: var(--muted); }
details summary { cursor: pointer; font-size: 12.5px; color: var(--muted); margin-top: 4px; }
details q { display: block; margin-top: 4px; padding-left: 10px; border-left: 2px solid var(--rule-strong); color: var(--muted); font-size: 13px; }
tr:target td { background: var(--accent-soft); }
.facts tr[hidden] { display: none; }
.empty { color: var(--muted); }

.caution { padding-left: 20px; max-width: 800px; }
.caution li { padding: 5px 0; }
.missing { max-width: 800px; padding-left: 20px; color: var(--muted); }
.sources ul { columns: 2; column-gap: 32px; padding-left: 18px; font-size: 13.5px; }
.sources li { break-inside: avoid; margin-bottom: 6px; }
.stamp { margin-top: 24px; color: var(--muted); font-size: 13px; }
.foot { margin-top: 72px; padding: 20px 0 40px; border-top: 1px solid var(--rule); color: var(--muted); font-size: 12.5px; }
.foot p { margin: 0; }

@media (max-width: 1100px) {
  .shell { display: block; }
  .side { position: sticky; top: var(--bar); z-index: 8; height: auto; padding: 8px 16px; border-right: 0; border-bottom: 1px solid var(--rule); background: var(--bg); }
  .side-title, .side-meta, .side .btn { display: none; }
  .toc { flex-direction: row; overflow-x: auto; scrollbar-width: none; }
  .toc a { flex: none; padding: 7px 12px; font-size: 14px; }
  main { padding: 0 24px; }
  .glance { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters { top: calc(var(--bar) + 51px); }
  html { scroll-padding-top: calc(var(--bar) + 64px); }
}
@media (max-width: 720px) {
  .bar { padding: 0 16px; gap: 12px; }
  .bar-meta { display: none; }
  .wordmark { font-size: 18px; }
  .wordmark span { display: none; }
  .bar .btn { margin-left: auto; height: 36px; padding: 0 12px; font-size: 13px; }
  main { padding: 0 16px; }
  h1 { font-size: 24px; }
  .h1-meta { display: block; margin: 4px 0 0; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi { padding: 14px 12px 14px 0; }
  .kpi + .kpi { padding-left: 12px; }
  .kpi:nth-child(3) { padding-left: 0; border-left: 0; border-top: 1px solid var(--rule); }
  .kpi:nth-child(4) { border-top: 1px solid var(--rule); }
  .kpi-value { font-size: 18px; }
  .glance { grid-template-columns: 1fr; }
  .glance .g { grid-template-columns: 1fr; gap: 2px; }
  .pc { grid-template-columns: 1fr; }
  .filters { position: static; }
  .count { margin-left: 0; width: 100%; }
  .sources ul { columns: 1; }
  th, td { padding: 9px 10px; }
  /* 좁은 화면: 사실 표를 카드처럼 쌓는다 */
  .facts thead { display: none; }
  .facts, .facts tbody, .facts tr, .facts td { display: block; width: 100%; }
  .facts tr { padding: 12px 14px; border-bottom: 1px solid var(--rule); }
  .facts td { padding: 2px 0; border: 0; min-width: 0; max-width: none; }
  .facts .k { float: right; }
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
