:root {
  --pub-max: 1120px;
  --pub-reading: 760px;
  --pub-line: 1.78;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--mt-bg, #fffdf8); color: var(--mt-text, #183a3d); font-family: "IBM Plex Sans Thai Looped", sans-serif; }
a { color: var(--mt-teal-700, #075e5b); text-underline-offset: .18em; }
a:focus-visible, button:focus-visible { outline: 3px solid #ffb703; outline-offset: 3px; }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 100; background: #fff; color: #102f32; padding: .75rem 1rem; border-radius: .6rem; }
.skip-link:focus { top: 1rem; }
.pub-header { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 1rem; padding: .85rem max(1rem, calc((100vw - var(--pub-max)) / 2)); background: color-mix(in srgb, var(--mt-bg, #fffdf8) 94%, transparent); border-bottom: 1px solid var(--mt-border, #d9e3df); backdrop-filter: blur(12px); }
.pub-brand { margin-right: auto; display: inline-flex; align-items: center; gap: .65rem; color: inherit; font: 600 1.35rem "Mitr", sans-serif; text-decoration: none; }
.pub-brand-dots { display: inline-flex; gap: 4px; }
.pub-brand-dots span { display: block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-coral); }
.pub-brand-dots span:nth-child(2) { background: var(--accent-yellow); }
.pub-brand-dots span:nth-child(3) { background: var(--brand); }
.pub-header nav { display: flex; gap: .9rem; flex-wrap: wrap; }
.pub-header nav a { color: inherit; text-decoration: none; font-weight: 600; }
#themeToggle { flex: 0 0 auto; }
.pub-main { width: min(var(--pub-max), calc(100% - 2rem)); min-height: 70vh; margin: 0 auto; padding: 2rem 0 5rem; }
.breadcrumbs { display: flex; gap: .55rem; flex-wrap: wrap; margin-bottom: 2rem; color: var(--mt-text-muted, #4b6668); font-size: .94rem; }
.article { width: min(var(--pub-reading), 100%); margin: 0 auto; }
.article h1, .hub-intro h1, .not-found h1 { margin: .2rem 0 1rem; font: 600 clamp(2rem, 6vw, 3.5rem)/1.18 "Mitr", sans-serif; letter-spacing: -.02em; }
.article h2 { margin-top: 2.6rem; font: 600 clamp(1.35rem, 3vw, 1.8rem)/1.3 "Mitr", sans-serif; }
.article h3 { margin-top: 2rem; font: 600 1.2rem/1.4 "Mitr", sans-serif; }
.article-body { font-size: 1.08rem; line-height: var(--pub-line); }
.article-body li { margin: .45rem 0; }
.article-body blockquote { margin: 1.4rem 0; padding: .8rem 1rem; border-left: 4px solid var(--mt-coral, #ef6f61); background: var(--mt-surface, #fff); border-radius: 0 .8rem .8rem 0; }
.lede { max-width: 65ch; color: var(--mt-text-muted, #405e60); font-size: 1.18rem; line-height: 1.7; }
.meta, .eyebrow { color: var(--mt-text-muted, #526e70); font-size: .92rem; }
.eyebrow { margin: 0 0 .4rem; color: var(--mt-coral-700, #a43b32); font-weight: 700; letter-spacing: .05em; }
.boundary, .disclosure { margin: 1.6rem 0; padding: 1rem 1.15rem; background: var(--mt-surface, #fff); border: 1px solid var(--mt-border, #d9e3df); border-radius: 1rem; line-height: 1.65; }
.sources { padding-left: 1.4rem; }
.sources li { margin: .7rem 0; line-height: 1.55; overflow-wrap: anywhere; }
.hub-intro { max-width: 760px; margin: 1rem auto 2.5rem; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); gap: 1rem; }
.pub-card { padding: 1.2rem; background: var(--mt-surface, #fff); border: 1px solid var(--mt-border, #d9e3df); border-radius: 1.1rem; box-shadow: 0 12px 34px rgba(12, 47, 50, .06); }
.pub-card h2 { margin: .25rem 0 .6rem; font: 600 1.28rem/1.4 "Mitr", sans-serif; }
.pub-card h2 a { color: inherit; text-decoration: none; }
.pub-card p { line-height: 1.6; }
.pub-footer { padding: 2.4rem max(1rem, calc((100vw - var(--pub-max)) / 2)); background: #1E3433; color: #F2F0EA; line-height: 1.7; }
.pub-footer a { color: #E5F3F0; }
.not-found { width: min(620px, 100%); margin: 10vh auto; text-align: center; }
.button { display: inline-block; padding: .75rem 1rem; border-radius: .75rem; background: #0b6c68; color: white; text-decoration: none; font-weight: 700; }
.button.secondary { background: transparent; color: inherit; border: 1px solid currentColor; }
.router { padding: 1.2rem; border: 1px solid var(--mt-border, #d9e3df); border-radius: 1rem; background: var(--mt-surface, #fff); }
.router label { display: block; margin: .7rem 0; padding: .75rem; border: 1px solid var(--mt-border, #d9e3df); border-radius: .75rem; cursor: pointer; }
.router-result { margin-top: 1rem; padding: 1rem; border-left: 4px solid #0b6c68; background: color-mix(in srgb, #0b6c68 8%, transparent); }

@media (max-width: 760px) {
  .pub-header { align-items: center; flex-wrap: wrap; }
  .pub-header nav { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; padding: .25rem 0 .15rem; scrollbar-width: none; }
  .pub-header nav a { white-space: nowrap; }
  .pub-main { padding-top: 1.3rem; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

