:root {
  --bg: #ffffff;
  --bg-2: #eef8f7;
  --paper: #ffffff;
  --ink: #162536;
  --muted: #64748b;
  --line: #ead9c5;
  --accent: #f47c20;
  --accent-dark: #b95412;
  --teal: #167b83;
  --teal-dark: #0d5962;
  --rose: #f5b7bd;
  --gold: #ffd166;
  --soft: #fff1dd;
  --shadow: 0 18px 45px rgba(86, 52, 22, .12);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: #ffffff;
  color: var(--ink);
  font-family: Arial, "Tahoma", sans-serif;
  line-height: 1.65;
}
a { color: inherit; text-decoration: none; }

.site-header {
  min-height: 88px;
  padding: 0 6vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  background: rgba(255, 255, 255, .92);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 13px; font-weight: 900; }
.brand strong { font-size: 19px; }
.brand small { display: block; color: var(--muted); font-size: 12px; font-weight: 800; margin-top: -5px; }
.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #ffad3d);
  border: 3px solid #fff;
  box-shadow: 0 0 0 3px var(--accent), 0 10px 24px rgba(244, 124, 32, .25);
  font-size: 24px;
}
.top-nav { display: flex; align-items: center; gap: 22px; font-weight: 900; font-size: 15px; }
.top-nav a { padding: 8px 0; border-bottom: 2px solid transparent; }
.top-nav a:hover { color: var(--accent); border-color: var(--accent); }

.hero {
  max-width: 1220px;
  margin: 44px auto 28px;
  padding: 0 24px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) 430px;
  gap: 30px;
  align-items: stretch;
}
.hero-copy {
  padding: 44px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.hero-copy:after {
  display: none;
}
.hero h1 { font-size: clamp(36px, 5vw, 64px); line-height: 1.08; margin: 8px 0 16px; letter-spacing: 0; position: relative; }
.hero p { color: var(--muted); font-weight: 800; max-width: 780px; position: relative; }
.eyebrow { color: var(--teal)!important; text-transform: uppercase; letter-spacing: .03em; font-size: 13px; margin: 0; font-weight: 900; }

.search-form {
  display: flex;
  max-width: 780px;
  margin: 28px 0 16px;
  border: 2px solid var(--ink);
  background: var(--paper);
  box-shadow: 9px 9px 0 rgba(244, 124, 32, .22);
  position: relative;
}
.search-form input { min-width: 0; flex: 1; border: 0; padding: 18px 20px; font-size: 20px; outline: 0; background: transparent; }
.search-form button { border: 0; background: var(--accent); color: #fff; font-weight: 900; padding: 0 32px; font-size: 18px; cursor: pointer; }
.search-form button:hover { background: var(--accent-dark); }
.quick-links { display: flex; gap: 10px; flex-wrap: wrap; position: relative; }
.quick-links a, .tag-link {
  border: 1px solid var(--line);
  background: #fff;
  padding: 9px 13px;
  font-weight: 900;
  box-shadow: 0 5px 0 rgba(234, 217, 197, .65);
}
.quick-links a:hover, .tag-link:hover { border-color: var(--accent); color: var(--accent-dark); transform: translateY(-1px); }

.hero-panel {
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 26px;
  display: grid;
  align-content: space-between;
  overflow: hidden;
}
.hero-illustration {
  min-height: 210px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid #d8eceb;
  margin-bottom: 22px;
}
.hero-illustration img { width: 95%; max-height: 245px; object-fit: contain; display: block; }
.hero-panel span { color: var(--teal); font-weight: 900; }
.hero-panel strong { font-size: 52px; line-height: 1; margin: 10px 0 6px; display: block; }
.mini-chart { height: 96px; display: flex; align-items: end; gap: 9px; margin-top: 18px; border-bottom: 2px solid var(--line); }
.mini-chart i { flex: 1; display: block; background: linear-gradient(180deg, var(--teal), #8ed6d7); min-height: 16px; }

.feature-strip {
  max-width: 1220px;
  margin: 0 auto 28px;
  padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.feature-tile {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 18px;
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  align-items: center;
}
.icon-bubble {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--teal);
  font-weight: 900;
  font-size: 18px;
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, .12);
}
.feature-tile:nth-child(2) .icon-bubble { background: var(--accent); }
.feature-tile:nth-child(3) .icon-bubble { background: #dc6b7a; }
.feature-tile:nth-child(4) .icon-bubble { background: #5d6fb1; }
.feature-tile strong { display: block; font-size: 16px; }
.feature-tile div span { display: block; color: var(--muted); font-size: 13px; font-weight: 800; }
.feature-tile .icon-bubble {
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 12px;
  line-height: 1;
  text-align: center;
  letter-spacing: 0;
  flex: 0 0 48px;
}
.feature-tile:nth-child(3) .icon-bubble { font-size: 11px; }

.content-grid, .result-layout, .plain-page { max-width: 1180px; margin: 0 auto 52px; padding: 0 24px; }
.content-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.panel, .name-card, .letter-page {
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(0, 0, 0, .04);
}
.panel { padding: 24px; }
.panel h2, .name-card h2 { margin-top: 0; font-size: 25px; }
.panel h2:before, .name-card h2:before { content: ""; display: inline-block; width: 9px; height: 24px; margin-right: 10px; background: var(--accent); vertical-align: -5px; }
.name-list { display: grid; gap: 10px; }
.name-row {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.name-row strong { font-size: 20px; }
.mini-name-icon {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  margin-right: 10px;
  border-radius: 50%;
  color: #fff;
  background: var(--teal);
  font-size: 15px;
  line-height: 1;
  text-align: center;
  vertical-align: middle;
}
.name-row > span { color: var(--muted); font-weight: 800; }
.name-row .mini-name-icon {
  color: #fff;
  font-weight: 900;
}
.badge { display: inline-flex; align-items: center; background: var(--bg-2); color: var(--teal-dark); padding: 5px 9px; font-size: 12px; font-weight: 900; }

.result-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; margin-top: 36px; }
.name-card { padding: 26px; margin-bottom: 20px; }
.name-hero-card {
  background: #fff;
  box-shadow: var(--shadow);
}
.name-title { display: flex; justify-content: space-between; gap: 16px; align-items: start; border-bottom: 1px solid var(--line); padding-bottom: 18px; margin-bottom: 18px; }
.name-title h1 { margin: 0; font-size: clamp(48px, 7vw, 82px); line-height: .95; color: #10243a; }
.thai-reading { color: var(--accent); font-size: 25px; font-weight: 900; }
.thai-reading span { color: var(--muted); font-size: 15px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 18px 0; }
.stat, .insight-grid div {
  background: linear-gradient(180deg, #fffaf4, #fff2df);
  padding: 14px;
  border: 1px solid var(--line);
}
.stat span, .insight-grid span { display: block; color: var(--muted); font-size: 12px; font-weight: 900; }
.stat strong, .insight-grid strong { display: block; font-size: 23px; margin-top: 3px; }
.stat.hot { background: linear-gradient(180deg, #fff4d5, #ffe6aa); border-color: #f1c15f; }
.stat.teal { background: linear-gradient(180deg, #e8fbfa, #d2f0ef); border-color: #a6d8d8; }
.stat.hot strong { color: var(--accent-dark); }
.stat.teal strong { color: var(--teal-dark); }
.chart { height: 210px; display: flex; align-items: end; gap: 3px; padding-top: 18px; border-bottom: 2px solid var(--line); overflow: hidden; }
.bar { flex: 1; min-width: 2px; background: linear-gradient(180deg, var(--teal), #89d2d4); opacity: .95; }
.detail-list { display: grid; gap: 10px; }
.detail-list p { margin: 0; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.related { display: flex; flex-wrap: wrap; gap: 9px; }
.faq dt { font-weight: 900; margin-top: 12px; }
.faq dd { margin: 4px 0 0; color: var(--muted); }

.insight-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 18px; }
.insight-grid em { display: block; color: var(--muted); font-size: 12px; font-style: normal; margin-top: 2px; }
.insight-grid .up strong { color: #16794f; }
.insight-grid .down strong { color: #a33a2d; }
.insight-grid .flat strong { color: var(--teal); }
.decades { display: grid; gap: 8px; }
.decade-row { display: grid; grid-template-columns: 74px 1fr auto; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.decade-row span { font-weight: 900; }
.decade-row strong { color: var(--accent); letter-spacing: 0; }
.decade-row em { color: var(--muted); font-style: normal; font-weight: 800; }
.similar-list { display: grid; gap: 9px; }
.similar-list a { display: block; border: 1px solid var(--line); background: var(--soft); padding: 10px 12px; }
.similar-list strong { display: block; font-size: 17px; }
.similar-list span { display: block; color: var(--muted); font-size: 12px; font-weight: 800; margin-top: 2px; }
.source-note { background: var(--bg-2); }
.source-note p { color: var(--muted); font-size: 14px; }
.visual-card {
  background: #fff;
  text-align: center;
}
.visual-card img {
  width: 100%;
  max-height: 210px;
  object-fit: contain;
  display: block;
  margin: 0 auto 14px;
  background: #fff;
  border: 1px solid #d8eceb;
}
.visual-card strong {
  display: block;
  font-size: 24px;
  color: var(--accent-dark);
}
.visual-card span {
  display: block;
  color: var(--muted);
  font-weight: 800;
  font-size: 13px;
}

.letter-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 24px; }
.letter-nav a { display: grid; place-items: center; width: 36px; height: 36px; background: var(--paper); border: 1px solid var(--line); font-weight: 900; }
.letter-page { padding: 28px; margin-top: 36px; }
.word-columns { columns: 4 180px; column-gap: 30px; }
.word-columns a { display: block; break-inside: avoid; padding: 7px 0; border-bottom: 1px solid var(--line); font-weight: 900; }
.word-columns span { color: var(--muted); font-size: 13px; }

.about-hero {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 28px;
  align-items: center;
}
.about-hero img { width: 100%; max-height: 260px; object-fit: contain; background: #fff; border: 1px solid var(--line); }
.network-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 18px; }
.network-card { display: block; border: 1px solid var(--line); background: var(--soft); padding: 16px; }
.network-card strong { display: block; color: var(--teal-dark); font-size: 18px; }
.network-card span { color: var(--muted); font-weight: 800; font-size: 13px; }

.site-footer { padding: 34px 6vw; color: var(--muted); border-top: 1px solid var(--line); background: #fff; }
.site-footer nav { display: flex; gap: 18px; margin-bottom: 12px; font-weight: 900; color: var(--ink); flex-wrap: wrap; }
.site-footer a:hover { color: var(--accent); }
.loading { color: var(--muted); font-weight: 800; }

@media (max-width: 980px) {
  .hero, .content-grid, .result-layout, .about-hero { grid-template-columns: 1fr; }
  .feature-strip { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .site-header { position: static; align-items: flex-start; flex-direction: column; padding: 20px 24px; }
  .top-nav { flex-wrap: wrap; gap: 14px; }
  .hero-copy { padding: 28px; }
  .search-form { flex-direction: column; }
  .search-form button { padding: 14px; }
  .stats, .insight-grid, .feature-strip, .network-grid { grid-template-columns: 1fr; }
  .name-row { grid-template-columns: 1fr; gap: 3px; }
  .decade-row { grid-template-columns: 70px 1fr; }
}
