:root {
  --primary: #2463eb;
  --primary-soft: #edf4ff;
  --text: #14243e;
  --muted: #5c6b82;
  --border: #e3e9f2;
  --bg: #f4f7fc;
  --surface: #ffffff;
  --tbd-bg: #fff4d6;
  --tbd-text: #7a5300;
  --tbd-line: #e0b54a;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  font-size: 15px;
  line-height: 1.75;
  letter-spacing: -0.01em;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

a {
  color: var(--primary);
}

a:focus-visible {
  outline: 3px solid #87afff;
  outline-offset: 2px;
  border-radius: 2px;
}

.page {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 16px 64px;
}

.brand {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.04em;
  margin: 0 0 8px;
}

h1 {
  font-size: 26px;
  line-height: 1.35;
  margin: 0 0 8px;
  font-weight: 800;
}

.meta {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 24px;
}

.draft {
  background: var(--tbd-bg);
  border: 1px solid var(--tbd-line);
  color: var(--tbd-text);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 13px;
  margin: 0 0 24px;
}

.draft strong {
  display: block;
  margin-bottom: 4px;
}

.tbd {
  background: var(--tbd-bg);
  color: var(--tbd-text);
  border-bottom: 1px dashed var(--tbd-line);
  padding: 0 3px;
  border-radius: 3px;
  font-weight: 600;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  margin: 0 0 16px;
}

.lead {
  margin: 0;
}

nav.toc ol {
  margin: 0;
  padding-left: 22px;
  columns: 2;
  column-gap: 24px;
  font-size: 14px;
}

nav.toc li {
  break-inside: avoid;
  padding: 2px 0;
}

nav.toc h2 {
  font-size: 15px;
  margin: 0 0 8px;
}

section {
  scroll-margin-top: 16px;
}

section h2 {
  font-size: 18px;
  line-height: 1.45;
  margin: 0 0 12px;
}

section h3 {
  font-size: 15px;
  margin: 16px 0 6px;
}

section p,
section ul,
section ol {
  margin: 0 0 10px;
}

section ul,
section ol {
  padding-left: 20px;
}

section > :last-child {
  margin-bottom: 0;
}

.table-wrap {
  overflow-x: auto;
  margin: 0 0 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 520px;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--bg);
  font-weight: 700;
  white-space: nowrap;
}

tr:last-child td {
  border-bottom: 0;
}

.note {
  font-size: 13px;
  color: var(--muted);
}

.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 36px;
  margin-bottom: 10px;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 1px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.links a {
  display: block;
  min-height: 44px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-weight: 700;
  text-decoration: none;
}

footer {
  margin-top: 32px;
  font-size: 13px;
  color: var(--muted);
}

@media (max-width: 520px) {
  h1 {
    font-size: 23px;
  }

  nav.toc ol {
    columns: 1;
  }

  .card {
    padding: 16px;
  }
}

/* 좁은 화면: 머리글이 있는 표는 행마다 카드처럼 쌓고, 각 칸 앞에 머리글을 붙인다. */
@media (max-width: 560px) {
  table {
    min-width: 0;
  }

  .table-wrap:has(thead) {
    border: 0;
    border-radius: 0;
    overflow: visible;
  }

  table:has(thead) thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  table:has(thead) tr {
    display: block;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 4px 0;
    margin-bottom: 8px;
  }

  table:has(thead) td {
    display: block;
    position: relative;
    border-bottom: 0;
    padding: 6px 12px 6px calc(12px + 7em);
  }

  table:has(thead) td::before {
    content: attr(data-label);
    position: absolute;
    left: 12px;
    width: 6.5em;
    font-weight: 700;
    color: var(--muted);
    font-size: 13px;
  }

  th {
    white-space: normal;
  }
}

.nowrap {
  white-space: nowrap;
}
