/* 개인정보처리방침·이용약관 공용 스타일 */
:root {
  color-scheme: light dark;
  --bg: #fff;
  --ink: #1d1f23;
  --body: #34373d;
  --muted: #6b6e76;
  --line: #e1e3e7;
  --rule: #34373d;
  --fill: #f5f6f8;
  --link: #1f70eb;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141518;
    --ink: #f3f3f5;
    --body: #c7c9cf;
    --muted: #9b9ea6;
    --line: #2f3238;
    --rule: #9b9ea6;
    --fill: #1e2025;
    --link: #5b9bff;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font: 16px/1.8 -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  word-break: keep-all;
  overflow-wrap: break-word;
}
a { color: var(--link); text-underline-offset: 2px; }
a:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 2px; }

/* 머리 */
.site { border-bottom: 1px solid var(--line); }
.site-in {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 24px;
  max-width: 1004px; margin: 0 auto; padding: 14px 24px;
}
.logo { display: flex; align-items: center; gap: 9px; color: var(--ink); font-size: 17px; font-weight: 700; line-height: 1.2; }
.logo img { display: block; border-radius: 6px; outline: 1px solid rgba(0, 0, 0, .08); outline-offset: -1px; }
.docs { display: flex; gap: 20px; font-size: 14.5px; line-height: 1.5; }
.docs a { padding: 4px 0; color: var(--muted); text-decoration: none; }
.docs a:hover { color: var(--ink); }
.docs a[aria-current="page"] { color: var(--ink); font-weight: 600; }

/* 본문 틀: 왼쪽 목차 + 오른쪽 문서 */
main {
  display: grid; grid-template-columns: 216px minmax(0, 1fr); column-gap: 56px;
  max-width: 1004px; margin: 0 auto; padding: 56px 24px 88px;
}
.head { grid-column: 2; }
.toc { grid-column: 1; grid-row: 1 / span 2; align-self: start; position: sticky; top: 28px; }
.doc { grid-column: 2; }

.head h1 { margin: 0; color: var(--ink); font-size: 30px; font-weight: 700; line-height: 1.3; letter-spacing: -.02em; }
.meta { margin: 10px 0 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.head .lead { margin: 28px 0 0; }

.toc-title { margin: 0 0 8px; color: var(--ink); font-size: 14px; font-weight: 700; line-height: 1.6; }
.toc ol { margin: 0; padding: 0; list-style: none; }
.toc a {
  display: grid; grid-template-columns: 3.5em minmax(0, 1fr);
  padding: 5px 0; color: var(--body); font-size: 14px; line-height: 1.5; text-decoration: none;
}
.toc a span { color: var(--muted); }
.toc a:hover { color: var(--link); }

/* 조문 */
.doc section { scroll-margin-top: 24px; }
.doc h2 { margin: 52px 0 14px; color: var(--ink); font-size: 18px; font-weight: 700; line-height: 1.5; }
.doc p { margin: 0 0 14px; }
.doc ul { margin: 12px 0 16px; padding: 0; list-style: none; }
.doc li { position: relative; margin: 8px 0; padding-left: 14px; }
.doc li::before { content: "-"; position: absolute; left: 0; color: var(--muted); }
.sub { display: block; margin-top: 2px; }

.notice { margin: 24px 0 0; padding: 16px 18px; border: 1px solid var(--line); border-radius: 4px; background: var(--fill); }
.notice p { margin: 0; color: var(--ink); }
.doc .notice { margin: 16px 0; }

/* 표 */
table { width: 100%; margin: 14px 0 20px; border-collapse: collapse; border-top: 2px solid var(--rule); font-size: 14.5px; line-height: 1.65; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th + th, th + td, td + td { border-left: 1px solid var(--line); }
th { background: var(--fill); color: var(--ink); font-weight: 600; }
.fixed { table-layout: fixed; }
.info th:nth-child(1) { width: 25%; }
.info th:nth-child(2) { width: 33%; }
.trust th:nth-child(1) { width: 24%; }
.trust th:nth-child(3) { width: 26%; }
.pair tbody th { width: 28%; }
.hist th:nth-child(1) { width: 26%; }

/* 맨 아래 */
.foot { border-top: 1px solid var(--line); background: var(--fill); }
.foot-in { max-width: 1004px; margin: 0 auto; padding: 28px 24px 44px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.foot-links { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 14px; }
.foot-links a { color: var(--body); text-decoration: none; }
.foot-links a:hover { text-decoration: underline; }
.foot-links strong { color: var(--ink); font-weight: 700; }
.biz-title { margin: 18px 0 0; color: var(--ink); font-weight: 600; }
.biz { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 2px 16px; margin: 6px 0 0; }
.biz dt { font-weight: 400; }
.biz dd { margin: 0; color: var(--body); }
.biz a { color: inherit; }

/* 태블릿·폰: 목차를 문서 위로 */
@media (max-width: 900px) {
  main { display: block; padding: 32px 20px 64px; }
  .site-in { padding: 12px 20px; }
  .foot-in { padding: 24px 20px 40px; }
  .head h1 { font-size: 26px; }
  .head .lead { margin-top: 22px; }
  .toc { position: static; margin: 24px 0 0; padding: 14px 16px 12px; border: 1px solid var(--line); border-radius: 4px; }
  .doc h2 { margin-top: 44px; }
}

/* 폰: 긴 표는 칸을 나누지 않고 줄마다 쌓는다 */
@media (max-width: 640px) {
  .stack, .stack tbody, .stack tr, .stack th, .stack td { display: block; width: auto; }
  .stack thead { display: none; }
  .stack tr { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .stack th, .stack td { padding: 0; border: 0; background: none; }
  .stack td + td, .stack th + td { margin-top: 10px; border: 0; }
  .stack td:first-child, .stack tbody th { color: var(--ink); font-weight: 600; }
  .stack td:first-child .sub { color: var(--body); font-weight: 400; }
  .stack td[data-label]::before { content: attr(data-label); display: block; color: var(--muted); font-size: 13px; font-weight: 600; line-height: 1.6; }
  .stack th + td { margin-top: 4px; }
  .pair tbody th, .hist th:nth-child(1) { width: auto; }
}

@media print {
  .docs, .toc, .foot-links { display: none; }
  main { display: block; max-width: none; padding: 24px 0; }
  .foot { background: none; }
  h2 { break-after: avoid; }
  tr { break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
}
