:root {
  --bg: #0A0C0F;
  --surface: #14171C;
  --surface-raised: #191D23;
  --border: #262B32;
  --border-soft: #1C2027;
  --ink: #EDEFF2;
  --muted: #9AA2AF;
  --muted-dim: #6B7280;
  --accent: #F0524A;
  --accent-dim: #7A2A22;
  --accent-soft: rgba(240, 82, 74, 0.12);
  --radius: 4px;
  --serif: 'Noto Serif Thai', 'Noto Serif', Georgia, serif;
  --sans: 'IBM Plex Sans Thai', 'Noto Sans Thai', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  font-size: 15.5px;
}
a { color: inherit; }
ul { list-style: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.progress-bar {
  position: fixed; top: 0; left: 0; height: 2px; width: 0%;
  background: var(--accent); z-index: 100;
}

.topbar {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(10, 12, 15, 0.86);
  border-bottom: 1px solid var(--border-soft);
}
.topbar-inner {
  max-width: 1240px; margin: 0 auto; padding: 16px 32px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand-logo {
  width: 32px; height: 32px; border-radius: 8px; object-fit: cover;
  display: block; flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.brand-mark {
  width: 30px; height: 30px; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-weight: 700; border-radius: 6px; font-size: 16px;
}
.brand-name { font-weight: 600; letter-spacing: 0.04em; font-size: 15px; }
.topbar-link {
  font-family: var(--mono); font-size: 12px; color: var(--muted);
  text-decoration: none; border: 1px solid var(--border); padding: 8px 14px; border-radius: var(--radius);
}
.topbar-link:hover { color: var(--ink); border-color: var(--accent); }

.toc-toggle {
  display: none; align-items: center; gap: 8px;
  background: none; border: 1px solid var(--border); color: var(--ink);
  font-family: var(--sans); font-size: 13px; padding: 8px 14px;
  border-radius: var(--radius); cursor: pointer;
}
.toc-toggle svg { width: 14px; height: 14px; transition: transform 0.2s ease; }
.toc-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }

.layout {
  max-width: 1240px; margin: 0 auto; padding: 0 32px;
  display: grid; grid-template-columns: 260px 1fr; gap: 64px; align-items: start;
}
.sidebar {
  position: sticky; top: 88px;
  display: flex; flex-direction: column; gap: 26px;
  padding: 36px 0 40px; max-height: calc(100vh - 110px); overflow-y: auto;
}
.content { min-width: 0; padding-bottom: 100px; }

.sidebar-meta { font-family: var(--mono); }
.meta-label {
  color: var(--muted-dim); text-transform: uppercase;
  letter-spacing: 0.12em; font-size: 10.5px; margin-bottom: 10px;
}
.meta-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tag {
  background: var(--accent-soft); color: var(--accent);
  padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 500;
}
.tag-outline { background: none; border: 1px solid var(--border); color: var(--muted); }

.toc-title {
  font-family: var(--mono); color: var(--muted-dim);
  text-transform: uppercase; letter-spacing: 0.12em; font-size: 10.5px; margin-bottom: 12px;
}
.toc ol { list-style: none; display: flex; flex-direction: column; gap: 1px; border-left: 1px solid var(--border); }
.toc-link {
  display: flex; align-items: baseline; gap: 10px;
  padding: 7px 0 7px 18px; margin-left: -1px;
  border-left: 1px solid transparent; color: var(--muted);
  text-decoration: none; font-size: 13.3px; line-height: 1.4;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.toc-link .num { font-family: var(--mono); font-size: 10.5px; color: var(--muted-dim); min-width: 20px; }
.toc-link:hover { color: var(--ink); }
.toc-link.active, .toc-link[aria-current="page"] {
  color: var(--ink); border-left-color: var(--accent); font-weight: 500;
}
.toc-link.active .num, .toc-link[aria-current="page"] .num { color: var(--accent); }

.back-to-top, .page-nav-btn {
  background: none; border: 1px solid var(--border); color: var(--muted);
  font-family: var(--mono); font-size: 11.5px; padding: 10px 14px;
  border-radius: var(--radius); cursor: pointer; text-align: left;
  display: flex; align-items: center; gap: 8px;
  text-decoration: none; transition: border-color 0.15s ease, color 0.15s ease;
}
.back-to-top:hover, .page-nav-btn:hover { border-color: var(--accent); color: var(--ink); }
.page-nav { display: flex; gap: 12px; margin-top: 40px; flex-wrap: wrap; }

.hero {
  position: relative; padding: 64px 0 52px;
  border-bottom: 1px solid var(--border-soft); margin-bottom: 8px;
}
.hero::before {
  content: ""; position: absolute; top: -100px; left: -8%;
  width: 440px; height: 440px;
  background: radial-gradient(circle, var(--accent-dim) 0%, transparent 70%);
  opacity: 0.22; filter: blur(50px); pointer-events: none; z-index: -1;
}
.eyebrow {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.18em;
  color: var(--accent); margin-bottom: 18px; text-transform: uppercase;
}
.hero h1 {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(30px, 4.6vw, 46px); line-height: 1.28; margin-bottom: 14px;
}
.subtitle { color: var(--muted); font-size: 16px; margin-bottom: 36px; }

.doc-control {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.doc-control-title {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted-dim);
  padding: 13px 22px; border-bottom: 1px solid var(--border);
  display: flex; gap: 8px; align-items: baseline;
}
.doc-control-title .en { text-transform: none; letter-spacing: 0; }
.doc-control .row {
  display: flex; justify-content: space-between; gap: 20px;
  padding: 13px 22px; border-bottom: 1px solid var(--border-soft); font-size: 13.8px;
}
.doc-control .row:last-child { border-bottom: none; }
.doc-control dt { color: var(--muted); }
.doc-control dd { color: var(--ink); font-family: var(--mono); text-align: right; font-size: 13px; }
.doc-control dd .en { color: var(--muted-dim); font-size: 11.5px; }
.doc-control a.link { color: var(--accent); text-decoration: none; border-bottom: 1px solid transparent; }
.doc-control a.link:hover { border-bottom-color: var(--accent); }

.notice-banner {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--accent); padding: 16px 20px;
  border-radius: var(--radius); margin: 32px 0 52px;
  font-size: 13.3px; color: var(--muted); line-height: 1.7;
}
.notice-banner svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; color: var(--accent); }
.notice-banner strong { color: var(--ink); font-weight: 600; }

.policy-section {
  padding-bottom: 48px; margin-bottom: 48px;
  border-bottom: 1px solid var(--border-soft);
  scroll-margin-top: 96px;
  min-height: 40vh;
}
.policy-section:last-of-type { border-bottom: none; margin-bottom: 0; }
.section-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.section-num { font-family: var(--mono); color: var(--accent); font-size: 13.5px; flex-shrink: 0; }
.policy-section h2 { font-family: var(--serif); font-size: 23px; font-weight: 600; line-height: 1.3; }
.section-body { line-height: 1.85; max-width: 72ch; color: var(--muted); }
.section-body p { margin-bottom: 16px; }
.section-body h3 {
  font-size: 15px; font-weight: 600; color: var(--ink);
  margin: 24px 0 10px; font-family: var(--sans);
}
.section-body ul, .section-body ol { margin: 6px 0 16px 0; padding-left: 2px; }
.section-body li { margin-bottom: 9px; padding-left: 20px; position: relative; }
.section-body ul li::before { content: "—"; position: absolute; left: 0; color: var(--muted-dim); }
.section-body ol { list-style: decimal; padding-left: 1.4rem; }
.section-body ol li { padding-left: 4px; }
.section-body ol li::before { content: none; }
.section-body strong { color: var(--ink); font-weight: 600; }
.section-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

.summary-lead {
  font-size: 17px; line-height: 1.9; color: var(--ink);
  margin-bottom: 28px; padding-bottom: 28px; border-bottom: 1px solid var(--border-soft);
}
.summary-block {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px 24px; margin-bottom: 20px;
}
.summary-block h3 {
  font-family: var(--serif); font-size: 16px; color: var(--ink);
  margin: 0 0 12px;
}
.summary-block p:last-child { margin-bottom: 0; }

.table-wrap { overflow-x: auto; margin: 0 0 16px; border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td {
  padding: 10px 14px; text-align: left; vertical-align: top;
  border-bottom: 1px solid var(--border-soft);
}
th { background: var(--surface-raised); color: var(--ink); font-weight: 600; }
tr:last-child td { border-bottom: none; }
code {
  font-family: var(--mono); font-size: 0.9em;
  background: var(--surface-raised); padding: 2px 6px; border-radius: 3px; color: var(--accent);
}

.page-footer {
  border-top: 1px solid var(--border-soft); padding-top: 28px;
  font-family: var(--mono); font-size: 11.5px; color: var(--muted-dim);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: 0.01ms !important; }
}
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; gap: 0; padding: 0 20px; }
  .sidebar {
    position: fixed; top: 61px; left: 0; right: 0; bottom: 0;
    background: var(--bg); padding: 24px 20px 40px;
    transform: translateY(-110%); opacity: 0;
    transition: transform 0.25s ease, opacity 0.2s ease;
    z-index: 40; max-height: calc(100vh - 61px);
  }
  .sidebar.open { transform: translateY(0); opacity: 1; }
  .toc-toggle { display: flex; }
  .hero { padding: 44px 0 36px; }
  .hero h1 { font-size: 28px; }
  .doc-control .row { flex-direction: column; gap: 4px; }
  .doc-control dd { text-align: left; }
}
@media (min-width: 901px) { .toc-toggle { display: none; } }
@media print {
  .topbar, .sidebar, .progress-bar, .toc-toggle, .back-to-top, .page-nav { display: none !important; }
  .layout { grid-template-columns: 1fr; }
  body { background: #fff; color: #000; }
  .hero::before { display: none; }
}
