/*
 * 라잇웨잇 약관 및 운영정책
 *
 * 이 사이트가 하는 일은 하나다 — 필요한 조항을 빠르게 찾아 정확히 읽게 하는 것.
 * 그래서 조문 번호를 참조 좌표처럼 전면에 세우고(목차·본문 양쪽에서 같은 자리),
 * 나머지는 조용하게 둔다. 브랜드 주황은 "지금 읽는 위치"와 링크에만 쓴다.
 */

/* ── 토큰 ─────────────────────────────────────────────────────────────── */
:root {
  --ink: #16181d;
  --ink-2: #464c59;
  --ink-3: #79808f;
  --paper: #ffffff;
  --paper-2: #f7f8fa;
  --rule: #e5e8ed;
  --rule-strong: #cbd0da;
  --accent: #e56a00;
  --accent-ink: #ff7701;
  --accent-soft: rgba(255, 119, 1, 0.1);

  --font: "Pretendard JP Variable", "Pretendard JP", -apple-system,
    BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, "Apple SD Gothic Neo",
    "Noto Sans KR", sans-serif;

  --masthead-h: 64px; /* 홈페이지 헤더 h-16 */

  /* 상단바·본문·푸터가 공유하는 콘텐츠 영역.
     목차(228) + 간격(72) + 본문(688) + 좌우 여백(64) = 1052 에 맞춘 값이라
     본문 오른쪽 끝이 상단바·푸터의 오른쪽 끝과 정확히 떨어진다. */
  --shell: 1200px; /* 홈페이지 --container-content */
  --shell-pad: 32px;
  --toc-w: 180px;
  --toc-gap: 40px;
  /* 목차가 콘텐츠 영역 바깥에 들어갈 만한 화면 폭:
     shell(1052) + (목차 180 + 간격 40 + 최소 여백) × 2 */
  --toc-breakpoint: 1500px;
  --radius: 8px;

  --shadow-sm: 0 1px 2px rgba(16, 18, 22, 0.06);
  --shadow-md: 0 4px 16px rgba(16, 18, 22, 0.08);
}

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

html {
  -webkit-text-size-adjust: 100%;
  overflow-y: scroll; /* 짧은 페이지에도 스크롤바 트랙을 항상 그려 페이지 이동 시 가로 흔들림 방지 */
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--masthead-h) + 24px);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column; /* 내용이 짧아도 푸터가 화면 하단에 붙는다 */
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
}

:where(a, button, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--accent-ink);
  outline-offset: 3px;
  border-radius: 3px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 60;
  padding: 10px 16px;
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  font-size: 14px;
  text-decoration: none;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 12px;
}

/* ── 상단 바 ──────────────────────────────────────────────────────────── */
.masthead {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--paper);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1); /* 문서 제목 밑줄·목록 최상단 스트록과 동일 */
}

.masthead-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: var(--shell);
  min-height: var(--masthead-h);
  margin: 0 auto;
  padding: 0 var(--shell-pad);
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto; /* 나머지(내비·언어·메뉴)를 오른쪽으로 민다 */
  text-decoration: none;
  white-space: nowrap;
}

/* 홈페이지(lightweight.run) 헤더와 같은 로고 SVG (데스크탑 28px / 모바일 24px) */
.wordmark-logo {
  display: block;
  height: 28px;
  width: auto;
}

.wordmark-title {
  font-size: 13px;
  color: var(--ink-3);
}

.masthead-end {
  display: flex;
  align-items: center;
  gap: 24px;
}

/* 내비 — 홈페이지(lightweight.run) 상단바 버튼 규칙: 높이 36·모서리 8·좌우 12px,
   글자색·굵기는 전 항목 동일하고 강조(현재 페이지)는 배경 틴트(검정 4%)로만.
   호버 4% / 누름 8%, 200ms 전환. */
.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  background: rgba(0, 0, 0, 0.04);
}

.site-nav a:active {
  background: rgba(0, 0, 0, 0.08);
}

/* 드롭다운(언어 전환·판 선택) — 홈페이지(lightweight.run) 헤더의 지구본 버튼 + 메뉴 규칙.
   버튼 높이 36px·모서리 8px·호버 틴트 검정 4% 는 홈페이지 상단바 버튼 규칙 그대로. */
.masthead-tools {
  display: flex;
  align-items: center;
  gap: 4px;
}

.masthead-tools::before {
  content: "";
  width: 1px;
  height: 14px;
  /* 왼쪽 간격 = 컨테이너 gap 8 + margin 4 = 12. 오른쪽도 12가 되도록 margin 8 + tools gap 4 */
  margin: 0 8px 0 4px;
  background: var(--ink);
  opacity: 0.2;
}

.dropdown {
  position: relative;
}

.dropdown-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.2s ease;
}

.dropdown-toggle svg {
  display: block;
}

.dropdown-toggle:hover,
.dropdown.is-open .dropdown-toggle {
  background: rgba(0, 0, 0, 0.04);
}

.dropdown-toggle:active {
  background: rgba(0, 0, 0, 0.08);
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0; /* 버튼이 상단바 끝에 있으므로 오른쪽 끝을 맞춰 편다 */
  z-index: 50;
  margin-top: 8px;
  min-width: 8.5rem;
  padding: 6px;
  flex-direction: column;
  gap: 4px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03), 0 36px 72px -24px rgba(0, 0, 0, 0.08);
}

.dropdown.is-open .dropdown-menu {
  display: flex;
}

.dropdown-menu a {
  display: flex;
  align-items: center;
  height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  transition: background 0.15s ease;
}

.dropdown-menu a:hover,
.dropdown-menu a[aria-current="true"] {
  background: rgba(0, 0, 0, 0.04);
}

.dropdown-menu a:active {
  background: rgba(0, 0, 0, 0.08);
}

/* 판 선택 — 문서 머리의 "시행 2025.07.15"가 눌리는 버튼임이 보이도록 테두리를 두른다.
   판이 하나뿐이어도 열린다(메뉴에 현행 한 줄). */
.version-toggle {
  height: 36px;
  min-width: 200px; /* 셀렉트처럼 여유 있는 폭 — 텍스트는 왼쪽, 화살표는 오른쪽 끝 */
  justify-content: space-between;
  padding: 0 12px 0 14px;
  gap: 8px;
  font-size: 15px;
  color: var(--ink-2);
  background: var(--paper);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.version-toggle time {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.version-toggle svg {
  color: var(--ink-3);
}

.version-menu {
  left: 0;
  right: auto;
  width: 100%; /* 펼친 메뉴는 버튼과 같은 너비 */
  min-width: 0;
}

.version-menu a {
  gap: 14px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.version-status {
  margin-left: auto;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink-3);
}

.version-menu a[aria-current="true"] .version-status {
  color: var(--accent);
}

/* 문서 배너 — 판 선택 드롭다운 아래·제목 밑줄(구분선) 위, 즉 doc-head 안.
   전부 안내(info) 성격이라 파란 계열 하나로 통일 (2026-08-24 사용자 지시 — 주황 금지).
   공지에는 배너를 쓰지 않는다 — 관련 약관은 본문 말미 텍스트 링크(.related-docs). */
.doc-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  margin: 24px 0 0;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
}

/* info = 안내(시행 예정·이전 판) — 연한 파랑 / warn = 경고(현행 약관이 곧 개정됨) — 연한 빨강.
   현행 페이지와 예정판 페이지를 오갈 때 색으로 구분되게 한다. */
.doc-banner.is-info {
  background: #eef5ff;
  color: #2563eb;
}

.doc-banner.is-info a {
  color: #2563eb;
}

.doc-banner.is-warn {
  background: #fef2f2;
  color: #dc2626;
}

.doc-banner.is-warn a {
  color: #dc2626;
}

.doc-banner p {
  margin: 0;
}

.doc-banner a {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.doc-banner a svg {
  display: block;
}

.doc-banner a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* 좁은 화면 메뉴 버튼 — 지구본과 같은 알약(36px·모서리 8·틴트). 닫힘=햄버거, 열림=X */
.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 11px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.2s ease;
}

.menu-toggle:hover,
.menu-toggle[aria-expanded="true"] {
  background: rgba(0, 0, 0, 0.04);
}

.menu-toggle:active {
  background: rgba(0, 0, 0, 0.08);
}

.menu-toggle svg {
  display: block;
}

.menu-toggle .icon-close,
.menu-toggle[aria-expanded="true"] .icon-menu {
  display: none;
}

.menu-toggle[aria-expanded="true"] .icon-close {
  display: block;
}

/* 메뉴가 열린 동안 나머지 화면을 덮는 스크림(검정 80%). 마스트헤드(z 40) 아래, 본문 위. */
.scrim {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(0, 0, 0, 0.8);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

html.is-menu-open .scrim {
  opacity: 1;
  pointer-events: auto;
}

/* 열린 동안 페이지 스크롤 잠금. 사라지는 스크롤바 폭은 site.js 가 padding-right 로 보정한다. */
html.is-menu-open {
  overflow: hidden;
}

/* ── 레이아웃 ─────────────────────────────────────────────────────────── */
.layout {
  display: grid;
  flex: 1 0 auto;
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 var(--shell-pad) 96px;
  gap: var(--toc-gap);
}

/* 본문은 어느 페이지에서나 콘텐츠 영역을 그대로 쓴다. 목차는 폭 0 컬럼에
   넣어 콘텐츠 영역 오른쪽 바깥으로 넘치게 그린다(아래 .toc 참고). */
.layout.has-toc,
.layout.no-toc {
  grid-template-columns: minmax(0, 1fr);
}

/* ── 목차 ─────────────────────────────────────────────────────────────── */
/* 목차 3단 배치 — 상단바가 모바일로 바뀌는 분기(900px)와 함께 사라진다.
   ≤900px: 없음 · 901~1679px: 콘텐츠 안 오른쪽 컬럼 · ≥1680px: 콘텐츠 영역 바깥에 부유
   (1680 = 셸 1200 + 간격 40 + 목차 180 이 스크롤바 포함으로 들어가는 폭).
   sticky 라서 본문(.layout) 범위 안에서만 따라오고 푸터 위로는 내려가지 않는다. */
.toc {
  display: none;
}

@media (min-width: 901px) {
  .layout.has-toc {
    grid-template-columns: minmax(0, 1fr) var(--toc-w);
    column-gap: var(--toc-gap);
  }

  .toc {
    display: block;
    position: sticky;
    top: calc(var(--masthead-h) + 48px);
    align-self: start;
    margin-top: 47px; /* sticky 로 붙었을 때의 y(top) 와 같도록: 48px − 마스트헤드 경계선 1px */
    max-height: calc(100vh - var(--masthead-h) - 96px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--rule-strong) transparent;
  }
}

/* 충분히 넓으면 목차를 콘텐츠 영역 바깥 오른쪽 여백으로 내보내 본문이 셸 전체를 쓴다.
   폭 0 컬럼에서 오른쪽으로 넘치게 그리는 방식이라 sticky·푸터 경계는 그대로 동작한다. */
@media (min-width: 1680px) {
  .layout.has-toc {
    grid-template-columns: minmax(0, 1fr) 0;
    column-gap: 0;
  }

  .toc {
    width: var(--toc-w);
    margin-left: calc(var(--shell-pad) + var(--toc-gap)); /* 본문 텍스트 끝에서 72px = 셸 밖 40px */
  }
}

.toc-heading {
  margin: 0 0 14px;
  padding-left: 13px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  text-transform: uppercase;
  list-style: none;
  cursor: default;
}

.toc-heading::-webkit-details-marker {
  display: none;
}

.toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--rule);
}

.toc-list a {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: baseline;
  gap: 6px;
  padding: 4px 6px 4px 12px;
  margin-left: -1px;
  border-left: 2px solid transparent;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-3);
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.toc-list a:hover {
  color: var(--ink);
}

.toc-num {
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.toc-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toc-list a.is-current {
  color: var(--ink);
  border-left-color: var(--accent-ink);
  font-weight: 600;
}

.toc-list a.is-current .toc-num {
  color: var(--accent);
}

/* ── 문서 머리 ────────────────────────────────────────────────────────── */
.doc {
  min-width: 0;
  padding-top: 56px;
}

.doc-head {
  padding-bottom: 24px;
}

/* 시행일·게시일 메타가 있는 문서 페이지만 제목 아래 구분선 (목록 최상단 스트록과 같은 12%) */
.doc-head.has-rule {
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* 구분선과 본문 첫 요소 사이 간격 — 조문 제목으로 시작하든 문단으로 시작하든
   (개인정보처리방침처럼) 같은 간격이 되도록 통일 */
.doc-head.has-rule + .prose > :first-child {
  margin-top: 52px;
}

.doc-head h1 {
  margin: 0;
  font-size: clamp(24px, 1.4rem + 1vw, 30px);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.doc-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 14px;
  font-size: 15px;
  color: var(--ink-2);
}

.effective {
  display: inline-flex;
  align-items: center;
}

.effective time {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

/* ── 본문 ─────────────────────────────────────────────────────────────── */
.prose > :first-child {
  margin-top: 0;
}

/* 조문 제목 — 번호를 위에 작게, 제목을 아래에.
   원문 텍스트는 그대로이고 번호 부분에만 별도 스타일을 준다. */
.prose h2.article {
  position: relative;
  margin: 52px 0 14px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: -0.01em;
  /* 앵커 착지 오프셋은 html 의 scroll-padding-top 하나로만 정한다 —
     scroll-margin 을 함께 쓰면 둘이 합산돼 착지점과 목차 현재 판정이 어긋난다 */
}

/* 번호와 제목은 원문 그대로 한 줄로 읽히게 두고, 번호에만 색을 준다.
   ("제1조 (약관의 목적)" 을 두 줄로 끊으면 괄호만 남아 어색해진다.) */
.prose h2.article .art-num {
  margin-right: 7px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.prose h2.article .art-name {
  color: var(--ink);
}

.prose h3 {
  margin: 32px 0 10px;
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.5;
}

.prose h4 {
  margin: 24px 0 8px;
  font-size: 14.5px;
  font-weight: 600;
}

.prose p {
  margin: 0 0 16px;
}

.prose ol,
.prose ul {
  margin: 0 0 16px;
  padding-left: 26px;
}

.prose li {
  margin-bottom: 6px;
  padding-left: 4px;
}

.prose li::marker {
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.prose li > ol,
.prose li > ul {
  margin: 8px 0 12px;
}

/* 공지 목록 페이지네이션 — 버튼 규격은 상단바 알약과 동일(36px·모서리 8·틴트) */
.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 16px;
}

.pager button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.pager button:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.04);
}

.pager button:active:not(:disabled) {
  background: rgba(0, 0, 0, 0.08);
}

.pager button[aria-current="page"] {
  background: rgba(0, 0, 0, 0.04);
  color: var(--ink);
}

/* 갈 곳 없는 이전/다음 — 자리는 유지하고 흐리게 */
.pager button:disabled {
  color: var(--ink-3);
  opacity: 0.45;
  cursor: default;
}

.pager .pager-arrow {
  padding: 0 12px;
}

/* 공지 본문 말미의 관련 약관 링크 목록 */
.prose .related-docs {
  margin: 40px 0 0;
}

.prose a {
  color: var(--accent);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.prose blockquote {
  margin: 0 0 16px;
  padding: 2px 0 2px 16px;
  border-left: 2px solid var(--rule-strong);
  color: var(--ink-2);
}

.prose table {
  width: 100%;
  margin: 8px 0 20px;
  border-collapse: collapse;
  font-size: 14.5px;
}

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

.prose th {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  text-transform: uppercase;
  border-bottom-color: var(--rule-strong);
}

.prose hr {
  margin: 40px 0;
  border: 0;
  border-top: 1px solid var(--rule);
}

/* ── 랜딩: 문서 목록 ──────────────────────────────────────────────────── */
/* 랜딩의 섹션 제목(공지사항)은 리스트 묶음의 제목이라 문서 조문 제목보다
   한 단계 큰 중제목 — 홈페이지 title-2 토큰(24px/600, 모바일 22px). */
.is-landing .prose h2.article {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* .prose 안에 놓이므로 .prose ul / .prose li 의 들여쓰기 규칙을 우선순위로 이긴다 */
.prose .doc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04); /* 목록 최하단 스트록 */
}

/* 행 위 구분선 — 최상단(첫 행, 블록 페이지네이션에선 .is-first)만 블랙 10%,
   그 외(내부·최하단)는 블랙 4% */
.prose .doc-list li {
  margin: 0;
  padding: 0;
  border-top: 1px solid rgba(0, 0, 0, 0.04);
}

.prose .doc-list li:first-child,
.prose .doc-list li.is-first {
  border-top-color: rgba(0, 0, 0, 0.1);
}

.doc-row {
  display: flex;
  text-decoration: none;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding: 15px 0;
  text-decoration: none;
  transition: color 0.15s ease;
}

a.doc-row:hover .doc-name {
  color: var(--accent);
}

/* 공지 목록의 빈 항목 — 칸 수 고정용(공지만의 예외 규칙). 빈 상태 문구는 흐리게 */
.doc-list .empty .doc-name {
  color: var(--ink-3);
}

.doc-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  transition: color 0.15s ease;
}

.doc-date {
  flex: none;
  font-size: 13px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

/* ── 푸터 ─────────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--paper-2);
}

.footer-inner {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 48px var(--shell-pad) 56px;
}

.footer-cols {
  display: flex;
  flex-wrap: wrap;
  gap: 56px;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.footer-col h2 {
  margin: 0 0 3px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  text-transform: uppercase;
}

.footer-col a {
  font-size: 13px; /* 홈페이지 text-caption */
  color: var(--ink-2);
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-col a:hover {
  color: var(--ink);
}

.footer-legal {
  margin-top: 44px;
  padding-top: 20px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.company,
.copyright {
  margin: 0;
  font-size: 13px; /* 홈페이지 text-caption */
  line-height: 1.7;
  color: var(--ink-3);
}

.copyright {
  margin-top: 8px;
}

/* ── 반응형 ───────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  :root {
    --masthead-h: 48px; /* 홈페이지 모바일 헤더 h-12 */
  }

  .menu-toggle {
    display: flex;
  }

  .masthead-inner {
    padding: 4px 16px;
    gap: 12px;
  }

  .wordmark-logo {
    height: 24px; /* 홈페이지 모바일 h-6 */
  }

  /* 홈페이지 모바일 아이콘 버튼 h-10 w-10 */
  .lang-toggle,
  .menu-toggle {
    width: 40px;
    height: 40px;
    padding: 0;
  }

  /* 메뉴 패널 — 마스트헤드 바로 아래에 겹쳐 뜨고(본문을 밀지 않음), 나머지는 .scrim 이 덮는다 */
  .masthead-end {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    padding: 8px 16px 16px;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
  }

  .masthead-inner.is-open .masthead-end {
    display: flex;
    animation: menu-in 0.2s ease;
  }

  @keyframes menu-in {
    from {
      opacity: 0;
      transform: translateY(-6px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }

  .masthead-tools::before {
    display: none;
  }

  .site-nav {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    margin: 0 -12px; /* 항목 패딩만큼 당겨 글자를 워드마크와 같은 선에 맞춘다 */
  }

  .site-nav a {
    height: 56px; /* 홈페이지 모바일 메뉴 행 h-14 */
    font-size: 16px;
  }

  .is-landing .prose h2.article {
    font-size: 22px; /* 홈페이지 모바일 title-2 */
  }

  .layout.has-toc,
  .layout.no-toc {
    grid-template-columns: minmax(0, 1fr);
    padding: 0 16px 72px;
    gap: 0;
  }


  .toc-list a {
    border-left: 0;
    padding-left: 0;
    margin-left: 0;
  }

  .toc-list a.is-current {
    border-left: 0;
  }

  .doc {
    padding-top: 32px;
  }

  .footer-inner {
    padding: 36px 20px 44px;
  }

  .footer-cols {
    gap: 32px;
  }
}

/* ── 접근성·동작 설정 ─────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── 인쇄 ─────────────────────────────────────────────────────────────── */
@media print {
  .masthead,
  .toc,
  .site-footer,
  .skip-link {
    display: none !important;
  }

  body {
    display: block;
    min-height: 0;
    font-size: 10.5pt;
    line-height: 1.6;
    color: #000;
    background: #fff;
  }

  .layout.has-toc,
  .layout.no-toc {
    display: block;
    max-width: none;
    padding: 0;
  }

  .doc {
    padding-top: 0;
  }

  .prose,
  .doc-head {
    max-width: none;
  }

  .prose h2.article {
    margin-top: 24px;
    break-after: avoid;
  }

  .prose h2.article .art-num {
    color: #000;
  }

  .prose li,
  .prose p {
    break-inside: avoid;
  }
}
