:root {
  --cream: #faf3e7;
  --surface: #fffcf6;
  --ink: #2c1f14;
  --muted: #756252;
  --bronze: #a87547;
  --bronze-deep: #7a4f2e;
  --gold: #ffcb47;
  --border: #e8d9c2;
  --border-strong: #d9c2a2;
  --espresso: #2d2119;
  --shadow: 0 18px 52px rgba(76,49,28,.09);
  --font-display: "Mitr", sans-serif;
  --font-body: "IBM Plex Sans Thai", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { min-width: 320px; margin: 0; overflow-x: clip; background: var(--surface); color: var(--ink); font-family: var(--font-body); line-height: 1.8; -webkit-font-smoothing: antialiased; }
body.is-locked { overflow: hidden; }
button, input, select, textarea { font: inherit; }
a { color: inherit; }
svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 300; padding: 11px 16px; border-radius: 10px; background: var(--ink); color: #fff; text-decoration: none; transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
:is(a,button,summary):focus-visible { outline:3px solid var(--ink); outline-offset:3px; box-shadow:0 0 0 6px #fff; }

.legal-header { position: sticky; top: 0; z-index: 70; display: flex; min-height: 70px; align-items: center; justify-content: space-between; gap: 28px; padding: 10px max(32px, calc((100vw - 1200px) / 2)); border-bottom: 1px solid rgba(232,217,194,.92); background: rgba(255,252,246,.96); backdrop-filter: blur(16px); }
.legal-brand { display: inline-flex; min-width: 210px; min-height: 48px; align-items: center; text-decoration: none; }
.legal-brand-copy { display: grid; gap: 1px; }
.legal-brand-th { font-family: var(--font-display); font-size: 17px; font-weight: 600; line-height: 1.2; }
.legal-brand-en { color: #a15423; font-size: 9px; font-weight: 700; letter-spacing: .18em; }
.legal-nav { display: flex; align-items: center; justify-content: center; gap: 21px; }
.legal-nav a { position: relative; display: inline-flex; min-width: 44px; min-height: 44px; align-items: center; justify-content: center; color: #584739; font-size: 13px; font-weight: 550; text-decoration: none; }
.legal-nav a:hover, .legal-nav a[aria-current="page"] { color: var(--bronze-deep); }
.legal-nav a[aria-current="page"]::after { position: absolute; right: 4px; bottom: 2px; left: 4px; height: 2px; border-radius: 99px; background: var(--bronze); content: ""; }
.legal-header-actions { display: flex; min-width: 210px; align-items: center; justify-content: flex-end; gap: 8px; }
.legal-book, .legal-primary, .legal-secondary { display: inline-flex; min-height: 48px; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border: 1px solid transparent; border-radius: 12px; font-weight: 650; line-height: 1.35; text-decoration: none; }
.legal-book, .legal-primary { background: var(--gold); color: #2c210e; box-shadow: 0 8px 20px rgba(188,127,16,.16); }
.legal-secondary { border-color: var(--border-strong); background: var(--surface); color: var(--bronze-deep); }
.legal-hamburger { display: none; width: 46px; height: 46px; place-items: center; padding: 0; border: 1px solid var(--border); border-radius: 50%; background: var(--surface); color: var(--ink); cursor: pointer; }
.legal-scrim, .legal-mobile-menu { display: none; }

.legal-hero { border-bottom: 1px solid var(--border); background: radial-gradient(circle at 88% 10%, rgba(255,203,71,.11), transparent 25%), var(--cream); }
.legal-shell { width: min(1200px, calc(100% - 48px)); margin: 0 auto; }
.legal-hero .legal-shell { padding: 26px 0 46px; }
.legal-breadcrumbs { display: flex; min-height: 44px; flex-wrap: wrap; align-items: center; gap: 7px; margin-bottom: 18px; color: #6b5848; font-size: 12px; }
.legal-breadcrumbs a { display: inline-flex; min-width: 44px; min-height: 44px; align-items: center; }
.legal-hero-grid { display: grid; grid-template-columns: 240px minmax(0,780px); gap: 50px; justify-content: center; }
.legal-doc-mark { padding-top: 8px; color: var(--bronze-deep); font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.legal-doc-mark::before { display: block; width: 34px; height: 2px; margin-bottom: 13px; background: var(--bronze); content: ""; }
.legal-kicker { margin: 0 0 8px; color: var(--bronze-deep); font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.legal-hero h1 { margin: 0 0 14px; font-family: var(--font-display); font-size: clamp(44px,4.6vw,64px); font-weight: 500; letter-spacing: -.04em; line-height: 1.2; text-wrap: balance; }
.legal-updated { display: inline-flex; min-height: 34px; align-items: center; gap: 7px; margin-bottom: 18px; padding: 5px 11px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 11px; }
.legal-intro { margin: 0; color: #5f4e40; font-size: 15px; line-height: 1.8; }

.legal-main { padding: 42px 0 76px; }
.legal-layout { display: grid; grid-template-columns: 240px minmax(0,780px); gap: 50px; justify-content: center; align-items: start; }
.legal-toc { position: sticky; top: 102px; padding: 19px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.legal-toc h2 { margin: 0 0 12px; font-size: 13px; font-weight: 700; }
.legal-toc ol { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; counter-reset: legal-toc; }
.legal-toc li { counter-increment: legal-toc; }
.legal-toc a { display: grid; min-height: 40px; grid-template-columns: 24px minmax(0,1fr); align-items: center; padding: 5px 7px; border-left: 2px solid transparent; color: var(--muted); font-size: 11.5px; line-height: 1.4; text-decoration: none; }
.legal-toc a::before { color: #6f5947; content: counter(legal-toc,decimal-leading-zero); font-size: 9px; font-weight: 700; }
.legal-toc a:hover, .legal-toc a[aria-current="true"] { border-left-color: var(--bronze); background: var(--cream); color: var(--bronze-deep); }
.legal-mobile-toc { display: none; }

.legal-document { min-width: 0; }
.legal-quick { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin-bottom: 30px; }
.legal-quick > div { padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--cream); }
.legal-quick span { display: grid; width: 31px; height: 31px; place-items: center; margin-bottom: 9px; border-radius: 50%; background: #f2dfc4; color: var(--bronze-deep); font-size: 10px; font-weight: 700; }
.legal-quick strong { display: block; margin-bottom: 3px; font-size: 13px; }
.legal-quick p { margin: 0; color: var(--muted); font-size: 11.5px; line-height: 1.55; }
.legal-section { scroll-margin-top: 100px; padding: 31px 0 8px; border-top: 1px solid var(--border); }
.legal-section:first-of-type { border-top: 0; }
.legal-section h2 { display: grid; grid-template-columns: 38px minmax(0,1fr); gap: 11px; align-items: start; margin: 0 0 14px; color: var(--ink); font-family: var(--font-display); font-size: 22px; font-weight: 500; line-height: 1.45; }
.legal-section h2 span { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; background: var(--bronze-deep); color: #fff; font-family: var(--font-body); font-size: 11px; font-weight: 700; }
.legal-document p, .legal-document li { color: #49392e; font-size: 15px; line-height: 1.85; }
.legal-document p { margin: 0 0 14px; }
.legal-document ul, .legal-document ol { margin: 0 0 15px; padding-left: 24px; }
.legal-document li { margin: 5px 0; padding-left: 3px; }
.legal-document a { color: var(--bronze-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.legal-document strong { font-weight: 700; }
.legal-alert { margin: 18px 0; padding: 19px 21px; border: 1px solid #e6bd70; border-radius: 14px; background: #fff6df; }
.legal-alert p { margin: 0; }
.legal-contact { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 24px; align-items: center; margin-top: 38px; padding: 25px; border: 1px solid var(--border-strong); border-radius: 18px; background: radial-gradient(circle at 90% 15%, rgba(255,203,71,.14), transparent 28%), var(--cream); }
.legal-contact h2 { margin: 0 0 5px; font-family: var(--font-display); font-size: 21px; font-weight: 500; }
.legal-contact p { margin: 0; color: var(--muted); font-size: 13px; }
.legal-contact-actions { display: grid; gap: 8px; }
.legal-next { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin-top: 16px; }
.legal-next a { display: flex; min-height: 52px; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 15px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface); color: var(--bronze-deep); font-size: 13px; font-weight: 700; text-decoration: none; }

.legal-footer { padding: 44px 24px 24px; background: var(--espresso); color: rgba(255,248,238,.76); }
.legal-footer-shell { display: grid; width: min(1200px,100%); grid-template-columns: 1.5fr .8fr .8fr; gap: 44px; margin: 0 auto; }
.legal-footer h2 { margin: 0 0 8px; color: #fff8ee; font-size: 17px; font-weight: 500; }
.legal-footer p { margin: 4px 0; font-size: 12px; line-height: 1.65; }
.legal-footer-links { display: grid; align-content: start; gap: 3px; }
.legal-footer-links a { display: inline-flex; min-height: 44px; align-items: center; color: rgba(255,248,238,.82); font-size: 12px; }
.legal-footer-bottom { display: flex; width: min(1200px,100%); align-items: center; justify-content: space-between; gap: 18px; margin: 24px auto 0; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.1); color: rgba(255,248,238,.72); font-size: 11px; }

@media (max-width:1080px) {
  .legal-header { padding-inline: 24px; }
  .legal-brand, .legal-header-actions { min-width: auto; }
  .legal-nav { gap: 12px; }
  .legal-hero-grid, .legal-layout { grid-template-columns: 210px minmax(0,720px); gap: 38px; }
}

@media (max-width:980px) {
  .legal-nav, .legal-book { display: none; }
  .js .legal-hamburger { display: grid; }
  .legal-scrim { position: fixed; inset: 0; z-index: 89; display: block; width: 100%; height: 100%; padding: 0; border: 0; background: rgba(45,33,25,.42); }
  .legal-mobile-menu { position: fixed; top: 0; right: 0; bottom: 0; z-index: 90; display: flex; width: min(390px,90vw); flex-direction: column; padding: 20px; overflow-y: auto; background: var(--surface); box-shadow: -20px 0 60px rgba(45,33,25,.2); }
  .legal-mobile-menu-head { display: flex; min-height: 52px; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
  .legal-mobile-menu-close { display: grid; width: 46px; height: 46px; place-items: center; padding: 0; border: 1px solid var(--border); border-radius: 50%; background: var(--surface); color: var(--ink); cursor: pointer; }
  .legal-mobile-menu nav { display: grid; margin-bottom: 18px; }
  .legal-mobile-menu nav a { display: flex; min-height: 52px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); color: #554437; font-weight: 600; text-decoration: none; }
  .legal-mobile-menu nav a[aria-current="page"] { color: var(--bronze-deep); }
  .legal-hero-grid { grid-template-columns: minmax(0,760px); }
  .legal-doc-mark { display: none; }
  .legal-layout { grid-template-columns: minmax(0,760px); }
  .legal-toc { display: none; }
  .legal-mobile-toc { display: block; margin-bottom: 25px; border: 1px solid var(--border-strong); border-radius: 14px; background: var(--cream); }
  .legal-mobile-toc summary { display: flex; min-height: 52px; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 15px; color: var(--bronze-deep); font-weight: 700; cursor: pointer; list-style: none; }
  .legal-mobile-toc summary::-webkit-details-marker { display: none; }
  .legal-mobile-toc summary span { font-size: 21px; transition: transform 160ms ease; }
  .legal-mobile-toc[open] summary span { transform: rotate(45deg); }
  .legal-mobile-toc ol { display: grid; margin: 0; padding: 0 15px 14px 43px; }
  .legal-mobile-toc a { display: inline-flex; min-height: 44px; align-items: center; color: var(--bronze-deep); font-size: 13px; }
}

@media (max-width:700px) {
  .legal-header { min-height: 64px; padding: 8px 18px; }
  .legal-brand { min-width: 0; min-height: 44px; }
  .legal-brand-th { max-width: 58vw; overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
  .legal-brand-en { font-size: 8px; }
  .legal-shell { width: min(100% - 36px,560px); }
  .legal-hero .legal-shell { padding: 10px 0 30px; }
  .legal-breadcrumbs { margin-bottom: 10px; }
  .legal-hero h1 { margin-bottom: 12px; font-size: clamp(35px,10vw,42px); line-height: 1.22; }
  .legal-updated { margin-bottom: 14px; }
  .legal-intro { font-size: 14px; line-height: 1.75; }
  .legal-main { padding: 28px 0 50px; }
  .legal-mobile-toc { margin-bottom: 20px; }
  .legal-quick { grid-template-columns: minmax(0,1fr); gap: 8px; margin-bottom: 24px; }
  .legal-quick > div { display: grid; grid-template-columns: 34px minmax(0,1fr); column-gap: 11px; padding: 13px; }
  .legal-quick span { grid-row: 1 / 3; margin: 0; }
  .legal-quick strong { margin: 0; }
  .legal-section { scroll-margin-top: 108px; padding-top: 25px; }
  .legal-section h2 { grid-template-columns: 34px minmax(0,1fr); gap: 9px; font-size: 20px; line-height: 1.45; }
  .legal-section h2 span { width: 31px; height: 31px; }
  .legal-document p, .legal-document li { font-size: 16px; line-height: 1.85; }
  .legal-document ul, .legal-document ol { padding-left: 22px; }
  .legal-alert { padding: 16px; }
  .legal-contact { grid-template-columns: minmax(0,1fr); gap: 16px; padding: 20px 17px; }
  .legal-contact-actions { grid-template-columns: minmax(0,1fr); }
  .legal-next { grid-template-columns: minmax(0,1fr); }
  .legal-footer { padding: 34px 18px 24px; }
  .legal-footer-shell { grid-template-columns: minmax(0,1fr); gap: 18px; }
  .legal-footer-links { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .legal-footer-bottom { align-items: flex-start; flex-direction: column; margin-top: 18px; }
}

@media (max-width:360px) {
  .legal-hero h1 { font-size: 34px; }
  .legal-footer-links { grid-template-columns: minmax(0,1fr); }
}

@media (prefers-reduced-motion:reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration:.01ms !important; animation-iteration-count:1 !important; transition-duration:.01ms !important; }
}

@media print {
  .legal-header,.legal-toc,.legal-mobile-toc,.legal-contact,.legal-next,.legal-footer { display:none !important; }
  body,.legal-hero { background:#fff !important; }
  .legal-hero { border-bottom:1px solid #bbb; }
  .legal-shell,.legal-hero-grid,.legal-layout { display:block; width:100%; max-width:none; }
  .legal-hero .legal-shell,.legal-main { padding:0; }
  .legal-doc-mark { display:none; }
  .legal-document { max-width:none; }
  .legal-section { break-inside:avoid; scroll-margin-top:0; }
  .legal-document a { color:#000; }
}
