:root {
	--g50: #f1faf4;
	--g100: #e0f4e7;
	--g200: #c3e9d0;
	--g300: #97d8ae;
	--g400: #5fc285;
	--g500: #36a866;
	--g600: #248a50;
	--g700: #1d6e41;
	--g800: #155232;
	--ink: #1f3a2b;
	--muted: #6b8577;
	--line: #dcece2;
	--bg: #f6fbf7;
	--shadow-rgb: 29, 110, 65;
	/* ตัวอักษรบนพื้นสีหลัก และปลายสีไล่ระดับ (สีพาสเทลจะเปลี่ยนเป็นตัวอักษรสีเข้ม) */
	--on-accent: #fff;
	--accent-end: #1d6e41;
	--code-end: #248a50;
}

html {
	scroll-behavior: smooth;
	scroll-padding-top: 130px;
}

body {
	font-family: 'Sarabun', sans-serif;
	color: var(--ink);
	background: var(--bg);
	font-size: 16px;
}

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

/* ---------- header ---------- */
.sar-header {
	position: sticky;
	top: 0;
	z-index: 20;
	background: rgba(255, 255, 255, .95);
	backdrop-filter: saturate(160%) blur(8px);
	border-bottom: 1px solid var(--line);
	box-shadow: 0 4px 18px -12px rgba(var(--shadow-rgb), .35);
}

.sar-header-inner {
	display: flex;
	align-items: center;
	gap: 16px;
	padding-top: 10px;
	padding-bottom: 10px;
}

.sar-brand {
	display: flex;
	align-items: center;
	gap: 12px;
	text-decoration: none;
	color: var(--ink);
	min-width: 0;
}

.sar-brand img {
	width: 46px;
	height: 46px;
	flex: 0 0 46px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 2px 8px rgba(var(--shadow-rgb), .25);
}

.sar-brand b {
	display: block;
	font-size: 1.15rem;
	color: var(--g700);
	line-height: 1.25;
}

.sar-brand small {
	display: block;
	color: var(--muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.sar-year {
	margin-left: auto;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 12px;
	border-radius: 999px;
	background: var(--g50);
	border: 1px solid var(--line);
	color: var(--g600);
}

.sar-year select {
	border: 0;
	background: transparent;
	font-weight: 600;
	color: var(--g700);
	outline: none;
	cursor: pointer;
}

.sar-nav {
	border-top: 1px solid var(--line);
}

.sar-nav .container {
	display: flex;
	gap: 4px;
	overflow-x: auto;
	scrollbar-width: none;
}

.sar-nav .container::-webkit-scrollbar {
	display: none;
}

.sar-nav a {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 14px;
	white-space: nowrap;
	text-decoration: none;
	color: var(--muted);
	font-weight: 600;
	border-bottom: 3px solid transparent;
	transition: color .15s, border-color .15s;
}

.sar-nav a:hover {
	color: var(--g700);
}

.sar-nav a.active {
	color: var(--g700);
	border-bottom-color: var(--g500);
}

/* ---------- หน้าแรก ---------- */
.sar-hero {
	padding: 56px 0 96px;
	color: var(--on-accent);
	background:
		radial-gradient(circle at 85% 20%, rgba(255, 255, 255, .16) 0, rgba(255, 255, 255, 0) 40%),
		radial-gradient(circle at 10% 90%, rgba(255, 255, 255, .12) 0, rgba(255, 255, 255, 0) 35%),
		linear-gradient(135deg, var(--g400) 0%, var(--g500) 45%, var(--accent-end) 100%);
}

.sar-chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 5px 14px;
	border-radius: 999px;
	font-size: .9rem;
	font-weight: 600;
	background: rgba(255, 255, 255, .18);
	border: 1px solid rgba(255, 255, 255, .3);
}

.sar-hero h1 {
	margin: 16px 0 8px;
	font-size: clamp(1.8rem, 4vw, 2.6rem);
	font-weight: 700;
	line-height: 1.3;
}

.sar-hero p {
	font-size: 1.1rem;
	opacity: .92;
	margin-bottom: 28px;
}

.sar-stats {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 12px;
	max-width: 760px;
}

.sar-stats div {
	padding: 14px 16px;
	border-radius: 14px;
	background: rgba(255, 255, 255, .14);
	border: 1px solid rgba(255, 255, 255, .22);
}

.sar-stats b {
	display: block;
	font-size: 1.8rem;
	line-height: 1.1;
}

.sar-stats span {
	font-size: .9rem;
	opacity: .9;
}

.sar-cards {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 20px;
	margin-top: -60px;
	margin-bottom: 48px;
	position: relative;
}

.sar-card {
	display: flex;
	flex-direction: column;
	padding: 24px;
	border-radius: 18px;
	background: #fff;
	border: 1px solid var(--line);
	box-shadow: 0 14px 34px -18px rgba(var(--shadow-rgb), .35);
	text-decoration: none;
	color: var(--ink);
	transition: transform .15s, box-shadow .15s;
}

.sar-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 20px 40px -18px rgba(var(--shadow-rgb), .45);
	color: var(--ink);
}

.sar-card-icon {
	width: 52px;
	height: 52px;
	border-radius: 14px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.4rem;
	color: var(--g600);
	background: var(--g100);
}

.sar-card h2 {
	margin: 16px 0 10px;
	font-size: 1.2rem;
	font-weight: 700;
	color: var(--g800);
}

.sar-card ul {
	padding-left: 18px;
	margin-bottom: 18px;
	color: var(--muted);
	font-size: .95rem;
}

.sar-card-progress {
	margin-top: auto;
	font-size: .9rem;
	color: var(--muted);
}

.sar-card-progress b {
	color: var(--g700);
}

.sar-bar {
	height: 8px;
	margin-top: 6px;
	border-radius: 99px;
	background: var(--g100);
	overflow: hidden;
}

.sar-bar span {
	display: block;
	height: 100%;
	border-radius: 99px;
	background: linear-gradient(90deg, var(--g400), var(--g600));
}

.sar-card-more {
	margin-top: 16px;
	font-weight: 600;
	color: var(--g600);
}

/* ---------- หน้ารายละเอียด ---------- */
.sar-page-head {
	padding: 32px 0 28px;
	color: var(--on-accent);
	background: linear-gradient(135deg, var(--g400) 0%, var(--g500) 50%, var(--accent-end) 100%);
}

.sar-page-head h1 {
	margin: 12px 0 0;
	font-size: clamp(1.5rem, 3vw, 2.1rem);
	font-weight: 700;
}

.sar-detail {
	display: grid;
	grid-template-columns: 280px minmax(0, 1fr);
	gap: 28px;
	padding-top: 28px;
	padding-bottom: 48px;
}

.sar-toc-inner {
	position: sticky;
	top: 130px;
	max-height: calc(100vh - 150px);
	overflow-y: auto;
	padding: 16px;
	border-radius: 16px;
	background: #fff;
	border: 1px solid var(--line);
}

.sar-toc-title {
	font-weight: 700;
	color: var(--g700);
	margin-bottom: 6px;
}

.sar-toc-aspect {
	margin: 12px 0 4px;
	font-size: .82rem;
	font-weight: 700;
	letter-spacing: .4px;
	color: var(--muted);
	text-transform: uppercase;
}

.sar-toc a {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	padding: 6px 8px;
	border-radius: 8px;
	text-decoration: none;
	color: var(--ink);
	font-size: .92rem;
	line-height: 1.4;
}

.sar-toc a:hover {
	background: var(--g50);
}

.sar-toc .code {
	flex: 0 0 auto;
	font-weight: 700;
	color: var(--g600);
}

.sar-toc .txt {
	flex: 1 1 auto;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.sar-toc .ok {
	color: var(--g500);
	margin-top: 3px;
}

.sar-aspect {
	margin: 8px 0 16px;
	padding-left: 14px;
	border-left: 5px solid var(--g500);
	font-size: 1.35rem;
	font-weight: 700;
	color: var(--g800);
}

.sar-ind {
	margin-bottom: 20px;
	padding: 22px 24px;
	border-radius: 18px;
	background: #fff;
	border: 1px solid var(--line);
	box-shadow: 0 8px 24px -18px rgba(var(--shadow-rgb), .35);
}

.sar-ind+.sar-aspect {
	margin-top: 36px;
}

.sar-ind>header {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	padding-bottom: 14px;
	border-bottom: 1px dashed var(--line);
}

.sar-code {
	flex: 0 0 auto;
	min-width: 52px;
	padding: 4px 10px;
	border-radius: 10px;
	text-align: center;
	font-weight: 700;
	font-size: 1.05rem;
	color: var(--on-accent);
	background: linear-gradient(135deg, var(--g500), var(--code-end));
}

.sar-ind h3 {
	margin: 2px 0 0;
	font-size: 1.12rem;
	font-weight: 600;
	line-height: 1.55;
}

.sar-sec {
	margin-top: 18px;
}

.sar-sec h4 {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 10px;
	font-size: 1rem;
	font-weight: 700;
	color: var(--g700);
}

.sar-sec h4>span {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: .8rem;
	color: var(--on-accent);
	background: var(--g500);
}

.sar-sec h4 small {
	margin-left: 4px;
	font-weight: 500;
	color: var(--muted);
}

.sar-text {
	line-height: 1.75;
	/* แสดงตามที่พิมพ์: คงการขึ้นบรรทัด ช่องว่าง และย่อหน้า */
	white-space: pre-wrap;
	overflow-wrap: anywhere;
	tab-size: 4;
}

/* ข้อมูลร่องรอยหลักฐาน (จาก text editor) */
.sar-rich {
	margin-bottom: 14px;
	line-height: 1.75;
	overflow-wrap: anywhere;
	overflow-x: auto;
}

.sar-rich > :last-child {
	margin-bottom: 0;
}

.sar-rich p {
	margin: 0 0 .6em;
}

.sar-rich ul,
.sar-rich ol {
	margin: 0 0 .6em;
	padding-left: 1.5em;
}

.sar-rich h4,
.sar-rich h5 {
	margin: .8em 0 .4em;
	font-weight: 700;
}

.sar-rich blockquote {
	margin: 0 0 .6em;
	padding: 8px 14px;
	border-left: 4px solid var(--g500);
	background: var(--g50);
	border-radius: 0 10px 10px 0;
}

.sar-rich table {
	border-collapse: collapse;
	margin: 0 0 .8em;
	max-width: 100%;
}

.sar-rich th,
.sar-rich td {
	border: 1px solid var(--g200);
	padding: 6px 10px;
	vertical-align: top;
}

.sar-rich th {
	background: var(--g50);
}

.sar-rich a {
	text-decoration: underline;
}

.sar-consider {
	padding: 12px 16px;
	border-radius: 12px;
	background: var(--g50);
}

.sar-muted {
	color: var(--muted);
	font-style: italic;
}

.sar-docs {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 10px;
}

.sar-doc {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 14px;
	border-radius: 12px;
	border: 1px solid var(--line);
	text-decoration: none;
	color: var(--ink);
	transition: border-color .15s, background-color .15s;
}

.sar-doc:hover {
	border-color: var(--g300);
	background: var(--g50);
	color: var(--ink);
}

.sar-doc-icon {
	flex: 0 0 42px;
	height: 42px;
	border-radius: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.25rem;
}

.sar-doc-icon.pdf {
	color: #d64545;
	background: #fdecec;
}

.sar-doc-icon.link {
	color: #2f6fca;
	background: #e8f1fd;
}

.sar-doc-main {
	flex: 1 1 auto;
	min-width: 0;
}

.sar-doc-main b {
	display: block;
	font-weight: 600;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.sar-doc-main small {
	color: var(--muted);
}

.sar-doc-go {
	color: var(--g500);
}

.sar-gallery {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	gap: 10px;
	margin-top: 10px;
}

.sar-gallery a {
	position: relative;
	display: block;
	aspect-ratio: 4 / 3;
	border-radius: 12px;
	overflow: hidden;
	background: var(--g100);
}

.sar-gallery img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .25s;
}

.sar-gallery a:hover img {
	transform: scale(1.05);
}

.sar-gallery span {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 18px 8px 6px;
	font-size: .8rem;
	color: #fff;
	background: linear-gradient(transparent, rgba(0, 0, 0, .6));
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.sar-empty {
	padding: 56px 16px;
	text-align: center;
	color: var(--muted);
	background: #fff;
	border-radius: 18px;
	border: 1px dashed var(--line);
}

.sar-empty i {
	display: block;
	font-size: 2.4rem;
	color: var(--g300);
	margin-bottom: 10px;
}

/* ---------- footer ---------- */
.sar-footer {
	padding: 28px 0;
	background: #fff;
	border-top: 1px solid var(--line);
	color: var(--muted);
	font-size: .92rem;
}

.sar-footer .container {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 16px;
}

.sar-footer-org {
	display: flex;
	align-items: center;
	gap: 14px;
}

.sar-footer-org img {
	width: 52px;
	height: 52px;
}

.sar-footer-org b {
	color: var(--g700);
}

.sar-footer-link {
	margin-left: auto;
	text-decoration: none;
	font-weight: 600;
}

/* ---------- จอเล็ก ---------- */
@media (max-width: 991.98px) {
	.sar-detail {
		grid-template-columns: minmax(0, 1fr);
	}

	.sar-toc {
		display: none;
	}
}

@media (max-width: 575.98px) {
	.sar-brand img {
		width: 38px;
		height: 38px;
		flex-basis: 38px;
	}

	.sar-brand b {
		font-size: .95rem;
	}

	.sar-brand small {
		max-width: 150px;
		font-size: .78rem;
	}

	.sar-year {
		padding: 4px 8px;
	}

	.sar-year i {
		display: none;
	}

	.sar-stats {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.sar-ind {
		padding: 18px 16px;
	}

	.sar-footer-link {
		margin-left: 0;
	}
}

/* ---------- พิมพ์ ---------- */
@media print {

	.sar-header,
	.sar-toc,
	.sar-footer {
		display: none;
	}

	.sar-detail {
		display: block;
	}

	.sar-ind {
		box-shadow: none;
		break-inside: avoid;
	}

	body {
		background: #fff;
	}
}
