:root {
	/* Deulli color system — light semantic layer */
	color-scheme: light;
	--background-base: #ffffff;
	--surface-subtle: #f8fafc;
	--surface-muted: #f1f4f8;
	--text-primary: #041225;
	--text-secondary: #4c5d72;
	--text-tertiary: #718196;
	--border-subtle: #e3e9f0;
	--action-primary: #0150e5;
	--action-primary-hover: #0640b9;
	--action-primary-subtle: #eff5ff;
	--warning-subtle: #fff8e6;
	--warning-text: #8a4f00;
	--danger-subtle: #fff0f0;
	--danger-text: #b4232a;
	--content-width: 46rem;
	--site-width: 72rem;
}

* {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
	scroll-padding-top: 6rem;
}

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

a {
	color: var(--action-primary);
	text-underline-offset: 0.18em;
	text-decoration-thickness: 1px;
}

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

a:focus-visible,
summary:focus-visible {
	outline: 3px solid #bbd6ff;
	outline-offset: 3px;
	border-radius: 4px;
}

.skip-link {
	position: fixed;
	z-index: 100;
	top: 0.75rem;
	left: 0.75rem;
	padding: 0.625rem 0.875rem;
	background: var(--text-primary);
	color: #ffffff;
	text-decoration: none;
	transform: translateY(-150%);
}

.skip-link:focus {
	transform: translateY(0);
}

/* 상단 브랜드 및 문서 탭 */
.site-header {
	position: sticky;
	z-index: 20;
	top: 0;
	border-bottom: 1px solid var(--border-subtle);
	background: rgba(255, 255, 255, 0.96);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
}

.site-header-inner {
	display: flex;
	align-items: stretch;
	justify-content: space-between;
	width: min(100%, var(--site-width));
	min-height: 4.25rem;
	margin: 0 auto;
	padding: 0 1.5rem;
	gap: 2rem;
}

.brand {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	align-self: center;
	gap: 0.625rem;
	color: var(--text-primary);
	font-size: 1.0625rem;
	font-weight: 750;
	letter-spacing: -0.03em;
	text-decoration: none;
}

.brand-logo {
	display: block;
	flex: 0 0 auto;
	width: 2rem;
	height: 2rem;
}

.brand > span {
	display: inline-flex;
	align-items: baseline;
	gap: 0.4rem;
}

.brand small {
	color: var(--text-tertiary);
	font-size: 0.6875rem;
	font-weight: 650;
	letter-spacing: 0.02em;
}

.policy-tabs {
	display: flex;
	align-items: stretch;
	gap: 1.5rem;
	white-space: nowrap;
}

.policy-tabs a {
	display: inline-flex;
	align-items: center;
	border-bottom: 2px solid transparent;
	color: var(--text-secondary);
	font-size: 0.9rem;
	font-weight: 600;
	text-decoration: none;
}

.policy-tabs a:hover {
	color: var(--text-primary);
}

.policy-tabs a[aria-current="page"] {
	border-bottom-color: var(--action-primary);
	color: var(--action-primary);
	font-weight: 700;
}

.wrap {
	width: min(100%, var(--site-width));
	margin: 0 auto;
	padding: 4.5rem 1.5rem 6rem;
}

header.doc {
	max-width: var(--content-width);
	margin-bottom: 3.75rem;
}

.wrap:not(.has-toc) > header.doc {
	margin-inline: auto;
}

.has-toc > header.doc {
	margin-left: 16.5rem;
}

.eyebrow {
	margin: 0 0 0.75rem;
	color: var(--action-primary);
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.04em;
}

h1 {
	margin: 0 0 0.875rem;
	font-size: clamp(2rem, 5vw, 2.625rem);
	font-weight: 760;
	line-height: 1.25;
	letter-spacing: -0.04em;
}

h2 {
	margin: 4rem 0 1.125rem;
	padding-top: 0.25rem;
	font-size: 1.375rem;
	line-height: 1.45;
	letter-spacing: -0.025em;
	scroll-margin-top: 6rem;
}

h3 {
	margin: 2.5rem 0 0.875rem;
	font-size: 1.0625rem;
	line-height: 1.55;
	letter-spacing: -0.015em;
}

p,
ul,
ol {
	margin: 0 0 1.125rem;
}

ul,
ol {
	padding-left: 1.35rem;
}

li {
	margin-bottom: 0.45rem;
}

strong {
	font-weight: 700;
}

.meta {
	margin: 0;
	color: var(--text-tertiary);
	font-size: 0.875rem;
}

.lead {
	color: var(--text-secondary);
	font-size: 1.0625rem;
	line-height: 1.75;
}

hr {
	margin: 3.5rem 0;
	border: 0;
	border-top: 1px solid var(--border-subtle);
}

.document-shell {
	display: grid;
	grid-template-columns: 13.5rem minmax(0, var(--content-width));
	align-items: start;
	gap: 3rem;
}

.document-body {
	min-width: 0;
	max-width: var(--content-width);
}

.document-body > :first-child {
	margin-top: 0;
}

.standalone {
	margin: 0 auto;
}

/* 긴 문서의 목차 */
.toc-column {
	min-width: 0;
	position: sticky;
	top: 6rem;
	max-height: calc(100vh - 7.5rem);
	overflow-y: auto;
	scrollbar-width: thin;
}

nav.toc {
	padding-right: 0.75rem;
}

nav.toc h2 {
	margin: 0 0 0.875rem;
	padding: 0;
	color: var(--text-primary);
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.02em;
}

nav.toc ol {
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 0.8125rem;
	line-height: 1.55;
}

nav.toc li {
	margin: 0;
}

nav.toc a {
	display: block;
	padding: 0.35rem 0;
	color: var(--text-tertiary);
	text-decoration: none;
}

nav.toc a:hover {
	color: var(--action-primary);
}

/* 조문 항 번호 */
.clause {
	margin: 0 0 0.9375rem;
}

/* 표 */
.table-scroll {
	margin: 0 0 1.5rem;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

table {
	width: 100%;
	min-width: 30rem;
	border-collapse: collapse;
	border-top: 1px solid var(--text-tertiary);
	border-bottom: 1px solid var(--border-subtle);
	font-size: 0.9rem;
	line-height: 1.65;
}

th,
td {
	padding: 0.75rem 0.875rem;
	border: 0;
	border-bottom: 1px solid var(--border-subtle);
	text-align: left;
	vertical-align: top;
}

th {
	background: var(--surface-subtle);
	color: var(--text-secondary);
	font-weight: 700;
	white-space: nowrap;
}

/* 안내 및 주의 */
.note,
.warn {
	margin: 1.75rem 0;
	padding: 1.125rem 1.25rem;
	border-radius: 12px;
	font-size: 0.9375rem;
}

.note {
	background: var(--action-primary-subtle);
	color: var(--text-secondary);
}

.warn {
	background: var(--warning-subtle);
	color: var(--warning-text);
}

.note p:last-child,
.warn p:last-child,
.note ul:last-child,
.warn ul:last-child {
	margin-bottom: 0;
}

/* 배포 전 채워야 할 값 */
.todo {
	padding: 0.0625rem 0.375rem;
	border-radius: 4px;
	background: var(--danger-subtle);
	color: var(--danger-text);
	font-size: 0.9em;
	font-weight: 700;
}

footer.doc {
	max-width: var(--content-width);
	margin-top: 5rem;
	margin-left: auto;
	margin-right: auto;
	padding-top: 1.5rem;
	border-top: 1px solid var(--border-subtle);
	color: var(--text-tertiary);
	font-size: 0.8125rem;
}

.has-toc > footer.doc {
	margin-left: 16.5rem;
	margin-right: 0;
}

footer.doc p {
	margin-bottom: 0.4rem;
}

footer.doc a {
	color: var(--text-secondary);
}

.redirect {
	display: grid;
	min-height: 100vh;
	place-items: center;
	padding: 1.5rem;
	text-align: center;
}

.redirect p {
	color: var(--text-secondary);
}

@media (max-width: 760px) {
	html {
		scroll-padding-top: 8.75rem;
	}

	.site-header-inner {
		display: block;
		min-height: auto;
		padding: 0.75rem 1rem 0;
	}

	.brand {
		min-height: 1.75rem;
	}

	.policy-tabs {
		gap: 1.25rem;
		margin: 0.5rem -1rem 0;
		padding: 0 1rem;
		overflow-x: auto;
		scrollbar-width: none;
	}

	.policy-tabs::-webkit-scrollbar {
		display: none;
	}

	.policy-tabs a {
		min-height: 2.75rem;
		font-size: 0.875rem;
	}

	.wrap {
		padding: 3.25rem 1.25rem 4.5rem;
	}

	header.doc,
	.has-toc > header.doc,
	.has-toc > footer.doc {
		margin-left: 0;
		margin-right: 0;
	}

	.wrap:not(.has-toc) > header.doc,
	.wrap:not(.has-toc) > footer.doc {
		margin-left: auto;
		margin-right: auto;
	}

	.has-toc > header.doc {
		margin-bottom: 2.75rem;
	}

	h1 {
		font-size: 2rem;
	}

	h2 {
		margin-top: 3.5rem;
		font-size: 1.25rem;
		scroll-margin-top: 8.75rem;
	}

	.document-shell {
		display: block;
	}

	.toc-column {
		position: static;
		max-height: none;
		margin-bottom: 3rem;
		overflow: visible;
	}

	nav.toc {
		position: static;
		max-height: 15rem;
		padding: 1rem 1.125rem;
		border-radius: 12px;
		background: var(--surface-subtle);
	}

	nav.toc h2 {
		margin-bottom: 0.5rem;
	}

	nav.toc a {
		padding: 0.4rem 0;
	}

	th,
	td {
		padding: 0.6875rem 0.75rem;
	}
}

@media print {
	.site-header,
	.toc-column {
		display: none;
	}

	.wrap {
		width: auto;
		padding: 0;
	}

	.has-toc > header.doc,
	.has-toc > footer.doc {
		margin-left: 0;
		margin-right: 0;
	}

	.document-shell {
		display: block;
	}

	a {
		color: inherit;
	}
}
