.lang-switch {
  position: relative;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  padding: 3px;
  border-radius: 9999px;
  border: 1px solid rgba(201, 211, 219, 0.6);
  background: #ffffff;
}
.lang-switch-thumb {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc(50% - 3px);
  border-radius: 9999px;
  background: #4f98d3;
  box-shadow: 0 4px 12px rgba(79, 152, 211, 0.28);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}
.lang-switch[data-current="en"] .lang-switch-thumb { transform: translateX(100%); }
.lang-switch-opt {
  position: relative;
  z-index: 1;
  padding: 5px 11px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #495057;
  transition: color 0.3s ease;
}
.lang-switch-opt.is-active { color: #ffffff; }
.lang-switch-opt:hover:not(.is-active) { color: #4f98d3; }
.theme-toggle {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 9999px;
  border: 1px solid rgba(201, 211, 219, 0.6);
  background: #ffffff;
  color: #4f98d3;
  box-shadow: 0 4px 12px rgba(79, 152, 211, 0.1);
  transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.theme-toggle:hover { transform: translateY(-1px); }
.theme-toggle-icon {
  position: absolute;
  font-size: 18px;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.theme-toggle-sun {
  opacity: 0;
  transform: scale(0.75);
}
.dark .theme-toggle-moon {
  opacity: 0;
  transform: scale(0.75);
}
.dark .theme-toggle-sun {
  opacity: 1;
  transform: scale(1);
}
[data-i18n] { transition: opacity 0.22s ease; }
.lang-fade [data-i18n] { opacity: 0.28; }
html, body { overflow-x: hidden; max-width: 100%; }
body {
  font-family: "IBM Plex Sans Thai", "IBM Plex Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
}
.dark body {
  background: #08131d;
  color: #e6edf3;
}
.dark .theme-toggle,
.dark .lang-switch {
  background: #0f1d2b;
  border-color: rgba(84, 108, 132, 0.45);
}
.dark .theme-toggle {
  color: #e8f1f8;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}
.dark .lang-switch-opt { color: #b4c4d4; }
.dark .lang-switch-opt.is-active { color: #ffffff; }
h1, h2, h3 { font-family: "Anuphan", "IBM Plex Sans Thai", "IBM Plex Sans", sans-serif; }
.site-prose h2 { font-size: 1.15rem; font-weight: 700; color: #1a1c1e; margin: 1.5rem 0 0.5rem; }
.site-prose p, .site-prose li { color: #495057; font-size: 0.98rem; line-height: 1.75; }
.site-prose ul { margin: 0.5rem 0 0; padding-left: 1.15rem; list-style: disc; }
.site-prose li { margin: 0.35rem 0; }
.dark .site-prose h2,
.dark .text-on-surface { color: #e6edf3 !important; }
.dark .site-prose p,
.dark .site-prose li,
.dark .text-on-surface-variant { color: #9fb1c2 !important; }
.dark .bg-background { background-color: #08131d !important; }
.dark .bg-surface,
.dark header.bg-surface\/90 { background-color: #0f1d2b !important; }
.dark .border-outline-variant\/30,
.dark .border-outline-variant\/40,
.dark .border-outline-variant\/60 { border-color: rgba(84, 108, 132, 0.45) !important; }
.dark input,
.dark textarea,
.dark select {
  background: #0b1824 !important;
  color: #e6edf3 !important;
  border-color: rgba(84, 108, 132, 0.55) !important;
}
.dark input::placeholder,
.dark textarea::placeholder { color: #7f95aa !important; }
@media (max-width: 639px) {
  input, select, textarea { font-size: 16px !important; }
}

.site-footer {
  margin-top: 3rem;
  padding-bottom: env(safe-area-inset-bottom);
  color: #e8eef3;
  background:
    radial-gradient(circle at 12% 0%, rgba(88, 185, 157, 0.22), transparent 42%),
    radial-gradient(circle at 88% 20%, rgba(79, 152, 211, 0.28), transparent 46%),
    linear-gradient(180deg, #123a58 0%, #0c2842 100%);
}
.site-footer-inner {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 20px;
}
.site-footer-grid {
  display: grid;
  gap: 32px;
}
.site-footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #ffffff;
  text-decoration: none;
  font-family: Anuphan, "IBM Plex Sans Thai", sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
}
.site-footer-logo img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  background: #ffffff;
  border-radius: 12px;
  padding: 4px;
}
.site-footer-tagline {
  margin: 14px 0 18px;
  max-width: 280px;
  color: rgba(232, 238, 243, 0.78);
  font-size: 14px;
  line-height: 1.7;
}
.site-footer-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 999px;
  background: #58b99d;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.site-footer-cta:hover { filter: brightness(1.06); }
.site-footer-cta .material-symbols-outlined { font-size: 18px; }
.site-footer-heading {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7ee0c2;
}
.site-footer-links {
  display: grid;
  gap: 8px;
}
.site-footer-links a,
.site-footer-links .site-footer-cookie-btn,
.site-footer-contact a,
.site-footer-contact p {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: rgba(232, 238, 243, 0.82);
  font-size: 14px;
  line-height: 1.5;
  text-decoration: none;
}
.site-footer-cookie-btn {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font: inherit;
  text-align: left;
}
.site-footer-links a:hover,
.site-footer-links .site-footer-cookie-btn:hover,
.site-footer-contact a:hover { color: #ffffff; }
.site-footer-links a.is-current,
.site-footer-contact a.is-current {
  color: #7ee0c2;
  font-weight: 600;
}
.site-footer-contact .material-symbols-outlined {
  font-size: 18px;
  margin-top: 1px;
}
.site-footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  margin-top: 36px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(232, 238, 243, 0.55);
  font-size: 12px;
}
@media (min-width: 768px) {
  .site-footer-inner { padding: 56px 8px 24px; }
  .site-footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 40px; }
}

.cookie-consent {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 80;
  padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
  pointer-events: none;
}
.cookie-consent.is-visible { pointer-events: auto; }
.cookie-consent[hidden] { display: none !important; }

.cookie-consent__banner {
  position: relative;
  width: min(940px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 16px;
  padding: 18px 18px 16px;
  border-radius: 22px;
  border: 1px solid rgba(201, 211, 219, 0.55);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(241, 248, 253, 0.96) 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.85) inset,
    0 18px 40px rgba(12, 40, 66, 0.16);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.cookie-consent__banner-icon {
  display: none;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  color: #4f98d3;
  background: linear-gradient(160deg, #e8f4fc 0%, #d7ebf8 100%);
  box-shadow: 0 8px 18px rgba(79, 152, 211, 0.18);
}
.cookie-consent__banner-icon .material-symbols-outlined {
  font-size: 26px;
  font-variation-settings: "FILL" 1;
}
.cookie-consent__title {
  margin: 0;
  font-family: Anuphan, "IBM Plex Sans Thai", sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #0f172a;
}
.cookie-consent__text {
  margin: 6px 0 0;
  font-size: 13.5px;
  line-height: 1.65;
  color: #64748b;
}
.cookie-consent__links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 10px 0 0;
  font-size: 13px;
}
.cookie-consent__links a,
.cookie-consent__link-btn {
  color: #4f98d3;
  font-weight: 650;
  text-decoration: none;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font: inherit;
}
.cookie-consent__links a:hover,
.cookie-consent__link-btn:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.cookie-consent__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.cookie-consent__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  transition: filter 0.15s ease, background-color 0.15s ease, color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.cookie-consent__btn:active { transform: scale(0.97); }
.cookie-consent__btn--primary {
  color: #ffffff;
  background: linear-gradient(135deg, #6aafdf 0%, #4f98d3 55%, #3d87c4 100%);
  box-shadow: 0 10px 20px rgba(79, 152, 211, 0.28);
}
.cookie-consent__btn--primary:hover { filter: brightness(1.04); }
.cookie-consent__btn--secondary {
  background: #e8f3fb;
  color: #0c2842;
}
.cookie-consent__btn--secondary:hover { background: #dceef9; }
.cookie-consent__btn--ghost {
  background: #ffffff;
  border-color: #e2e8f0;
  color: #475569;
}
.cookie-consent__btn--ghost:hover { background: #f8fafc; }

.cookie-consent__prefs {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 16px 12px calc(16px + env(safe-area-inset-bottom));
}
.cookie-consent__prefs[hidden] { display: none !important; }
.cookie-consent__prefs-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 28%, rgba(79, 152, 211, 0.16), transparent 55%),
    rgba(8, 19, 29, 0.48);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.22s ease;
}
.cookie-consent__prefs-dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 440px);
  transform: translateY(14px) scale(0.96);
  opacity: 0;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.22s ease;
}
.cookie-consent__prefs.is-open .cookie-consent__prefs-backdrop { opacity: 1; }
.cookie-consent__prefs.is-open .cookie-consent__prefs-dialog {
  transform: translateY(0) scale(1);
  opacity: 1;
}
.cookie-consent__prefs-panel {
  position: relative;
  overflow: hidden;
  max-height: min(88vh, 720px);
  overflow-y: auto;
  padding: 1.5rem 1.35rem 1.25rem;
  border-radius: 1.5rem;
  border: 1px solid rgba(201, 211, 219, 0.55);
  background: linear-gradient(180deg, #ffffff 0%, #f7fafc 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.85) inset,
    0 24px 48px rgba(8, 19, 29, 0.2);
}
.cookie-consent__prefs-glow {
  position: absolute;
  top: -40%;
  left: 50%;
  width: 240px;
  height: 160px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(79, 152, 211, 0.2), transparent 70%);
  pointer-events: none;
}
.cookie-consent__close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  z-index: 2;
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.cookie-consent__close:hover {
  background: #e2e8f0;
  color: #0f172a;
}
.cookie-consent__close .material-symbols-outlined { font-size: 18px; }
.cookie-consent__prefs-hero {
  position: relative;
  text-align: center;
  padding: 0.35rem 0.5rem 0.25rem;
}
.cookie-consent__prefs-icon {
  display: grid;
  place-items: center;
  width: 3.75rem;
  height: 3.75rem;
  margin: 0 auto 0.85rem;
  border-radius: 1.15rem;
  color: #4f98d3;
  background: linear-gradient(160deg, #e8f4fc 0%, #d7ebf8 100%);
  box-shadow:
    0 0 0 6px rgba(79, 152, 211, 0.07),
    0 10px 22px rgba(79, 152, 211, 0.16);
}
.cookie-consent__prefs-icon .material-symbols-outlined {
  font-size: 1.7rem;
  font-variation-settings: "FILL" 1;
}
.cookie-consent__prefs-hero h2 {
  margin: 0;
  font-family: Anuphan, "IBM Plex Sans Thai", sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #0f172a;
}
.cookie-consent__prefs-lead {
  margin: 0.5rem auto 0;
  max-width: 20rem;
  font-size: 13.5px;
  line-height: 1.65;
  color: #64748b;
}
.cookie-consent__list {
  display: grid;
  gap: 10px;
  margin-top: 1.15rem;
}
.cookie-consent__row {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 1rem;
  border: 1px solid rgba(201, 211, 219, 0.55);
  background: rgba(255, 255, 255, 0.88);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.cookie-consent__row:hover {
  border-color: rgba(79, 152, 211, 0.35);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}
.cookie-consent__row.is-locked {
  cursor: default;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}
.cookie-consent__row.is-locked:hover {
  border-color: rgba(201, 211, 219, 0.55);
  box-shadow: none;
}
.cookie-consent__row-icon {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.85rem;
  color: #334155;
  background: #eef2f7;
  flex-shrink: 0;
}
.cookie-consent__row-icon .material-symbols-outlined { font-size: 1.2rem; }
.cookie-consent__row-icon--analytics {
  color: #4f98d3;
  background: #e8f4fc;
}
.cookie-consent__row-icon--marketing {
  color: #58b99d;
  background: #e8f7f2;
}
.cookie-consent__row-title {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}
.cookie-consent__row-desc {
  display: block;
  margin-top: 3px;
  font-size: 12.25px;
  line-height: 1.55;
  color: #64748b;
}
.cookie-consent__switch {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}
.cookie-consent__switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}
.cookie-consent__switch input:disabled { cursor: default; }
.cookie-consent__switch-ui {
  display: block;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: #cbd5e1;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.08);
  transition: background-color 0.2s ease;
}
.cookie-consent__switch-ui::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18);
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.cookie-consent__switch input:checked + .cookie-consent__switch-ui {
  background: linear-gradient(135deg, #6aafdf 0%, #4f98d3 100%);
}
.cookie-consent__switch input:checked + .cookie-consent__switch-ui::after {
  transform: translateX(18px);
}
.cookie-consent__switch input:disabled:checked + .cookie-consent__switch-ui {
  background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
}
.cookie-consent__switch input:focus-visible + .cookie-consent__switch-ui {
  outline: 2px solid rgba(79, 152, 211, 0.45);
  outline-offset: 2px;
}
.cookie-consent__prefs-actions {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 8px;
  margin-top: 1.15rem;
}
.cookie-consent__prefs-actions .cookie-consent__btn {
  width: 100%;
  min-height: 44px;
}
body.cookie-prefs-open { overflow: hidden; }

@media (min-width: 720px) {
  .cookie-consent__banner {
    grid-template-columns: auto 1fr auto;
    align-items: center;
    padding: 18px 20px;
  }
  .cookie-consent__banner-icon { display: grid; }
  .cookie-consent__actions { justify-content: flex-end; }
}
@media (max-width: 420px) {
  .cookie-consent__prefs-actions { grid-template-columns: 1fr; }
  .cookie-consent__actions { width: 100%; }
  .cookie-consent__actions .cookie-consent__btn { flex: 1 1 auto; }
}

.dark .cookie-consent__banner,
.dark .cookie-consent__prefs-panel {
  background: linear-gradient(180deg, #122131 0%, #0f1c29 100%);
  border-color: rgba(84, 108, 132, 0.45);
}
.dark .cookie-consent__title,
.dark .cookie-consent__prefs-hero h2,
.dark .cookie-consent__row-title { color: #e6edf3; }
.dark .cookie-consent__text,
.dark .cookie-consent__prefs-lead,
.dark .cookie-consent__row-desc { color: #9fb1c2; }
.dark .cookie-consent__btn--ghost {
  background: #152433;
  border-color: rgba(84, 108, 132, 0.55);
  color: #d7e3ee;
}
.dark .cookie-consent__btn--ghost:hover,
.dark .cookie-consent__close { background: #1a2b3c; color: #e6edf3; }
.dark .cookie-consent__btn--secondary {
  background: rgba(79, 152, 211, 0.18);
  color: #d7ebf8;
}
.dark .cookie-consent__row {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(84, 108, 132, 0.4);
}
.dark .cookie-consent__row.is-locked { background: rgba(255, 255, 255, 0.04); }
.dark .cookie-consent__row-icon { background: #1a2b3c; color: #cbd5e1; }
.dark .cookie-consent__row-icon--analytics {
  background: rgba(79, 152, 211, 0.16);
  color: #9fc8e8;
}
.dark .cookie-consent__row-icon--marketing {
  background: rgba(88, 185, 157, 0.16);
  color: #8fd4be;
}
.dark .cookie-consent__banner-icon,
.dark .cookie-consent__prefs-icon {
  background: rgba(79, 152, 211, 0.16);
  color: #9fc8e8;
}
.dark .cookie-consent__switch-ui { background: #475569; }
