/* ============================================================
   공통 바탕 — 전 화면 같은 리셋 · 타이포 계단 · 이동 바 · 고지 문구
   가로 구분선(hr, 구분용 border-top)은 쓰지 않는다.
   구역은 여백과 제목 크기로만 나눈다.
   ============================================================ */

*, *::before, *::after{ box-sizing: border-box; }

html{ -webkit-text-size-adjust: 100%; }

body{
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: var(--fs-base)/1.6 var(--sans);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

h1, h2, h3, h4, p, ul, ol, figure, table{ margin: 0; }
ul, ol{ padding: 0; list-style: none; }
button, input, select, textarea{ font: inherit; color: inherit; }
img, svg{ display: block; max-width: 100%; }
table{ border-collapse: collapse; width: 100%; }
a{ color: inherit; }

/* 수치는 전 화면에서 자리를 고정한다 */
.num, td.num, th.num, [data-count]{ font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

/* 초점 — 전 화면 공통 */
:where(a, button, input, select, summary, [tabindex]):focus-visible{
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r1);
}
html[data-screen="field"] :where(a, button, input, select, [tabindex]):focus-visible{
  outline-color: var(--ink);
}
html[data-screen="field"] .panel :where(a, button, input, select, [tabindex]):focus-visible{
  outline-color: var(--accent2);
}
/* 입력 요소는 :focus-visible 이 안 걸리는 경우가 있다(date 입력의 내부 필드 등).
   폼 요소는 언제 눌러 들어오든 테두리를 보여 준다 */
input:focus, input:focus-within, select:focus, textarea:focus{
  outline: 2px solid var(--accent); outline-offset: 2px;
}

.sr{
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

/* ---------- 바깥 폭 ---------- */
.wrap{ width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 var(--s5); }
@media (max-width: 460px){ .wrap{ padding: 0 var(--s4); } }

/* ---------- 화면 사이 이동 ---------- */
.topbar{
  display: flex; align-items: center; gap: var(--s4);
  flex-wrap: wrap;
  padding: var(--s5) 0 var(--s4);
}
.topbar .mark{
  font-size: var(--fs-sm); font-weight: 700; letter-spacing: -.01em;
  white-space: nowrap;
}
.topbar .mark span{ color: var(--muted); font-weight: 500; }
.nav{ display: flex; gap: var(--s1); flex-wrap: wrap; }
.nav a{
  display: inline-block;
  font-size: var(--fs-xs); font-weight: 600; text-decoration: none;
  padding: 8px 12px; border-radius: var(--rp);
  border: 1px solid var(--line);
  color: var(--muted);
  transition: color var(--d1) var(--ease), border-color var(--d1) var(--ease);
}
.nav a:hover{ color: var(--ink); border-color: var(--line2); }
.nav a[aria-current="page"]{
  color: var(--bg); background: var(--ink); border-color: var(--ink);
}
html[data-screen="field"] .nav a[aria-current="page"]{ color: var(--bg); background: var(--ink); }

/* ---------- 고지 ---------- */
.notice{
  font-size: var(--fs-cap); line-height: 1.5; color: var(--muted);
  letter-spacing: .01em;
}
.notice b{ font-weight: 700; color: var(--ink); }
.foot{ padding: var(--s7) 0 var(--s7); }

/* ---------- 눌러서 바꾸는 것 ---------- */
.btn{
  -webkit-appearance: none; appearance: none;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  border: 1px solid var(--line2); background: transparent; color: var(--ink);
  padding: 12px 16px; border-radius: var(--r2);
  font-size: var(--fs-sm); font-weight: 600; cursor: pointer;
  transition: background var(--d1) var(--ease), border-color var(--d1) var(--ease),
              color var(--d1) var(--ease);
}
.btn:hover{ border-color: var(--ink); }
.btn-solid{ background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn-solid:hover{ opacity: .88; }
.btn-accent{ background: var(--accent); border-color: var(--accent); color: #fff; }
.btn:disabled{ opacity: .45; cursor: not-allowed; }

/* 출처 배지 — 항목마다 어디서 온 값인지 */
.src{
  display: inline-flex; align-items: center; gap: 4px;
  font-size: var(--fs-cap); font-weight: 600; letter-spacing: .01em;
  padding: 2px 8px; border-radius: var(--r1);
  border: 1px solid var(--line2); color: var(--muted);
  white-space: nowrap;
}
.src::before{
  content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: currentColor; flex: none;
}
.src[data-kind="public"]{ color: var(--accent); border-color: currentColor; }
.src[data-kind="report"]{ color: var(--accent2); border-color: currentColor; }
.src[data-kind="guess"]{ border-style: dashed; }

/* 표 — 가로 줄을 쓰지 않는다. 줄무늬 배경과 세로 구분으로만 읽힌다 */
.tbl{ font-size: var(--fs-sm); }
.tbl th{
  text-align: left; font-size: var(--fs-cap); font-weight: 700;
  letter-spacing: .04em; color: var(--muted);
  padding: 0 var(--s3) var(--s2); white-space: nowrap;
}
.tbl td{ padding: 12px var(--s3); vertical-align: middle; }
.tbl tbody tr:nth-child(odd){ background: var(--surface); }
.tbl tbody tr{ transition: background var(--d1) var(--ease); }
.tbl td.num, .tbl th.num{ text-align: right; }
.tbl-scroll{ overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl-scroll > table{ min-width: 560px; }

/* 값이 막 바뀐 자리를 한 번 알려준다 */
@keyframes tick-once{ from{ background-color: var(--accent); } to{ background-color: transparent; } }
.ticked{ animation: tick-once .7s ease-out 1; }

/* 제목 계단 */
.eyebrow{
  font-size: var(--fs-cap); font-weight: 700; letter-spacing: .14em;
  color: var(--muted); text-transform: uppercase;
}
.h-sec{ font-size: var(--fs-lg); font-weight: 800; letter-spacing: -.02em; line-height: 1.3; }
.h-sub{ font-size: var(--fs-md); font-weight: 700; letter-spacing: -.015em; }
.lead{ font-size: var(--fs-base); color: var(--muted); }
