:root {
  color-scheme: dark;
  --ink: #f8f7ff;
  --muted: #c7c5da;
  --faint: #9793ad;
  --night: #060814;
  --night-soft: #0d1023;
  --panel: rgba(20, 23, 49, 0.82);
  --panel-strong: rgba(27, 30, 62, 0.94);
  --line: rgba(177, 171, 255, 0.18);
  --violet: #7d6bff;
  --cyan: #45d9ff;
  --gold: #ffce67;
  --rose: #ff7cad;
  --success: #7de0bd;
  --warning: #ffd27a;
  --danger: #ff9aab;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans Thai",
    "Noto Sans SC", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--night);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 4%, rgba(69, 217, 255, 0.15), transparent 29rem),
    radial-gradient(circle at 91% 12%, rgba(125, 107, 255, 0.24), transparent 34rem),
    linear-gradient(160deg, #080a17 0%, #0c0b22 46%, #080916 100%);
  line-height: 1.68;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
  opacity: 0.34;
  background-image:
    radial-gradient(circle at 12% 30%, white 0 1px, transparent 1.4px),
    radial-gradient(circle at 78% 18%, white 0 1px, transparent 1.4px),
    radial-gradient(circle at 62% 74%, white 0 1px, transparent 1.4px),
    radial-gradient(circle at 24% 86%, white 0 1px, transparent 1.4px);
  background-size: 220px 220px, 290px 290px, 330px 330px, 390px 390px;
}

a {
  color: #8fe9ff;
  text-underline-offset: 0.18em;
}

a:hover {
  color: #c7f5ff;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(69, 217, 255, 0.8);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 16px;
  color: #07121c;
  background: var(--cyan);
  border-radius: 999px;
  transform: translateY(-180%);
  transition: transform 160ms ease;
}

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

.site-shell {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 64px;
}

.topbar {
  position: sticky;
  top: 12px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 12px 10px 14px;
  background: rgba(9, 11, 27, 0.72);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
  letter-spacing: 0.04em;
}

.brand img {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(81, 74, 255, 0.34);
}

.language-switcher {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
}

.language-switcher button {
  min-height: 44px;
  padding: 6px 12px;
  color: var(--muted);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 750;
  background: transparent;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}

.language-switcher button[aria-pressed="true"] {
  color: #090b1b;
  background: linear-gradient(135deg, var(--cyan), #b4efff);
  box-shadow: 0 5px 18px rgba(69, 217, 255, 0.25);
}

.draft-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 16px 0 0;
  padding: 12px 16px;
  color: #fff2d3;
  font-size: 0.92rem;
  background: rgba(107, 72, 16, 0.55);
  border: 1px solid rgba(255, 210, 122, 0.4);
  border-radius: 16px;
}

.draft-banner::before {
  flex: 0 0 auto;
  content: "!";
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: #241705;
  font-weight: 900;
  background: var(--warning);
  border-radius: 50%;
}

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 26px;
  margin: 28px 0 22px;
  padding: clamp(28px, 5vw, 56px);
  background:
    linear-gradient(132deg, rgba(34, 37, 79, 0.95), rgba(17, 20, 45, 0.85)),
    var(--panel-strong);
  border: 1px solid rgba(164, 157, 255, 0.24);
  border-radius: 32px;
  box-shadow: var(--shadow);
}

.hero::before,
.hero::after {
  position: absolute;
  z-index: -1;
  content: "";
  border-radius: 50%;
  filter: blur(1px);
}

.hero::before {
  width: 330px;
  height: 330px;
  right: -110px;
  top: -160px;
  background: radial-gradient(circle, rgba(125, 107, 255, 0.64), transparent 67%);
}

.hero::after {
  width: 240px;
  height: 240px;
  left: -130px;
  bottom: -150px;
  background: radial-gradient(circle, rgba(69, 217, 255, 0.31), transparent 70%);
}

.hero-kicker {
  margin: 0 0 8px;
  color: var(--cyan);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2.05rem, 6vw, 4.4rem);
  line-height: 1.09;
  letter-spacing: -0.035em;
}

.hero-copy {
  max-width: 760px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.7vw, 1.15rem);
}

.hero-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(96px, 15vw, 156px);
  aspect-ratio: 1;
}

.hero-mark img {
  width: 100%;
  border-radius: 28%;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.16),
    0 22px 55px rgba(21, 10, 89, 0.52);
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 22px;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 5px 11px;
  color: #dedbff;
  font-size: 0.82rem;
  font-weight: 700;
  background: rgba(125, 107, 255, 0.13);
  border: 1px solid rgba(174, 166, 255, 0.21);
  border-radius: 999px;
}

.layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  align-items: start;
  gap: 22px;
}

.toc {
  position: sticky;
  top: 92px;
  padding: 20px;
  background: rgba(14, 17, 38, 0.72);
  border: 1px solid var(--line);
  border-radius: 22px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.toc h2 {
  margin: 0 0 12px;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}

.toc nav {
  display: grid;
  gap: 2px;
}

.toc a {
  display: block;
  padding: 8px 10px;
  color: var(--muted);
  font-size: 0.91rem;
  text-decoration: none;
  border-radius: 10px;
}

.toc a:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.055);
}

.content {
  min-width: 0;
}

.notice-card,
.policy-section,
.action-card {
  margin: 0 0 16px;
  padding: clamp(21px, 4vw, 34px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 12px 42px rgba(0, 0, 0, 0.16);
}

.notice-card {
  background:
    linear-gradient(135deg, rgba(69, 217, 255, 0.085), rgba(125, 107, 255, 0.09)),
    var(--panel);
}

.notice-card strong {
  color: var(--gold);
}

.policy-section {
  scroll-margin-top: 104px;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}

.section-number {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: #0a0d1e;
  font-size: 0.83rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--gold), #fff1b2);
  border-radius: 12px;
}

.policy-section h2,
.action-card h2 {
  margin: 0;
  font-size: clamp(1.24rem, 2.4vw, 1.62rem);
  line-height: 1.35;
}

.policy-section h3 {
  margin: 24px 0 8px;
  font-size: 1.05rem;
  color: #e9e6ff;
}

.policy-section p,
.policy-section li,
.notice-card p,
.action-card p {
  color: var(--muted);
}

.policy-section p:last-child,
.notice-card p:last-child,
.action-card p:last-child {
  margin-bottom: 0;
}

.policy-section ul,
.policy-section ol {
  margin: 10px 0 0;
  padding-left: 1.35rem;
}

.policy-section li + li {
  margin-top: 8px;
}

.data-grid,
.step-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.data-item,
.step-item {
  padding: 18px;
  background: rgba(255, 255, 255, 0.038);
  border: 1px solid rgba(207, 202, 255, 0.11);
  border-radius: 17px;
}

.data-item h3,
.step-item h3 {
  margin: 0 0 7px;
  color: var(--ink);
  font-size: 0.98rem;
}

.data-item p,
.step-item p {
  margin: 0;
  font-size: 0.92rem;
}

.step-index {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-bottom: 10px;
  color: #071019;
  font-weight: 900;
  background: var(--cyan);
  border-radius: 9px;
}

.callout {
  margin: 18px 0 0;
  padding: 16px 18px;
  color: #e6e4f7;
  background: rgba(69, 217, 255, 0.075);
  border-left: 4px solid var(--cyan);
  border-radius: 4px 14px 14px 4px;
}

.callout.warning {
  background: rgba(255, 210, 122, 0.075);
  border-left-color: var(--warning);
}

.callout.danger {
  background: rgba(255, 122, 155, 0.075);
  border-left-color: var(--danger);
}

.required-field {
  display: inline-block;
  padding: 2px 7px;
  color: #fff0c9;
  font-weight: 760;
  background: rgba(255, 210, 122, 0.11);
  border: 1px dashed rgba(255, 210, 122, 0.54);
  border-radius: 7px;
}

.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 11px 18px;
  font-weight: 800;
  text-decoration: none;
  border-radius: 14px;
}

.primary-action {
  color: #080b19;
  background: linear-gradient(135deg, var(--gold), #fff1b2);
  box-shadow: 0 12px 32px rgba(255, 206, 103, 0.2);
}

.primary-action:hover {
  color: #080b19;
}

.secondary-action {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--line);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.action-disabled {
  color: var(--faint);
  cursor: not-allowed;
  background: rgba(255, 255, 255, 0.035);
  border: 1px dashed rgba(255, 255, 255, 0.16);
  box-shadow: none;
}

details {
  margin-top: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(207, 202, 255, 0.1);
  border-radius: 14px;
}

summary {
  padding: 14px 16px;
  color: var(--ink);
  font-weight: 760;
  cursor: pointer;
}

details > div {
  padding: 0 16px 16px;
  color: var(--muted);
}

.document-switch {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0 0;
}

.document-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  padding: 16px 18px;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.document-link[aria-current="page"] {
  background: linear-gradient(135deg, rgba(125, 107, 255, 0.2), rgba(69, 217, 255, 0.1));
  border-color: rgba(120, 217, 255, 0.36);
}

.document-link span:last-child {
  color: var(--cyan);
  font-size: 1.25rem;
}

.page-footer {
  margin-top: 24px;
  padding: 24px 4px 12px;
  color: var(--faint);
  font-size: 0.86rem;
  text-align: center;
}

[hidden] {
  display: none !important;
}

@media (max-width: 860px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .toc {
    position: static;
  }

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

@media (max-width: 640px) {
  .site-shell {
    width: min(100% - 20px, 1160px);
    padding-top: 10px;
  }

  .topbar {
    top: 6px;
    border-radius: 18px;
  }

  .brand span {
    display: none;
  }

  .language-switcher button {
    min-width: 46px;
    padding-inline: 9px;
  }

  .hero {
    grid-template-columns: 1fr;
    padding: 28px 22px;
    border-radius: 24px;
  }

  .hero-mark {
    position: absolute;
    right: 18px;
    top: 18px;
    width: 74px;
    opacity: 0.3;
  }

  .hero h1 {
    max-width: calc(100% - 34px);
    font-size: clamp(2rem, 12vw, 3.05rem);
  }

  .data-grid,
  .step-grid,
  .document-switch,
  .toc nav {
    grid-template-columns: 1fr;
  }

  .notice-card,
  .policy-section,
  .action-card {
    border-radius: 20px;
  }
}

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