:root {
  --bg: #efe6d4;
  --paper: #fffaf1;
  --ink: #1b1712;
  --muted: #5d564c;
  --line: #e2d5bf;
  --green: #0e6a4b;
  --green-dark: #094833;
  --green-soft: #e3f4eb;
  --gold: #c3922a;
  --gold-soft: #f8edd3;
  --danger: #9b2c2c;
  --shadow: 0 18px 40px rgba(40, 28, 10, 0.14);
  --shadow-deep: 0 28px 60px rgba(40, 28, 10, 0.22);
  --radius: 22px;
  --display: "Prompt", "Sarabun", "Noto Sans Thai", sans-serif;
  --font: "Sarabun", "Noto Sans Thai", "TH Sarabun New", "Leelawadee UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.7;
  background:
    radial-gradient(circle at 12% -10%, rgba(255, 176, 32, 0.38), transparent 32%),
    radial-gradient(circle at 92% 8%, rgba(14, 160, 90, 0.22), transparent 28%),
    linear-gradient(180deg, #ffe9c4 0%, #f3d7a1 42%, #d9f0e3 100%);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background-image: radial-gradient(#7a6240 0.6px, transparent 0.6px);
  background-size: 4px 4px;
  z-index: 0;
}
body > * { position: relative; z-index: 1; }
a { color: var(--green-dark); }
.wrap { width: min(1160px, calc(100% - 32px)); margin: 0 auto; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.skip-link {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--green);
  color: #fff;
  padding: 8px 12px;
}
.skip-link:focus { left: 8px; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 250, 241, 0.82);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(226, 213, 191, 0.8);
  box-shadow: 0 8px 30px rgba(40, 28, 10, 0.06);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 76px;
}
.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  text-decoration: none;
  color: inherit;
}
.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #1a8a62, #0b4d37);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 10px 18px rgba(11, 77, 55, 0.28), inset 0 1px 0 rgba(255,255,255,.35);
}
.brand small { display: block; color: var(--muted); font-size: 13px; }
.nav { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.nav a { text-decoration: none; font-weight: 600; }
.free-badge {
  background: linear-gradient(180deg, #ffe9b0, #f3d48a);
  color: #6a4b10;
  border: 1px solid #e4c57a;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 8px 16px rgba(195, 146, 42, 0.22);
}

.hero { padding: 28px 0 8px; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 28px;
  align-items: center;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--green-soft);
  color: var(--green-dark);
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 600;
  margin: 0 0 12px;
  box-shadow: inset 0 1px 0 #fff;
}
h1, h2, .brand strong { font-family: var(--display); }
.hero h1 { font-size: clamp(30px, 5vw, 48px); line-height: 1.2; margin: 0 0 10px; }
.lead { font-size: 18px; color: var(--muted); max-width: 42rem; }
.search-box { margin-top: 22px; }
.search-box input {
  width: min(520px, 100%);
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 16px;
  padding: 14px 16px;
  font: inherit;
  font-size: 16px;
  box-shadow: inset 0 1px 0 #fff, 0 12px 24px rgba(40, 28, 10, 0.08);
}

.hero-stage {
  position: relative;
  min-height: 320px;
  perspective: 900px;
}
.hero-art {
  width: 100%;
  max-width: 520px;
  display: block;
  border-radius: 36px;
  box-shadow: var(--shadow-deep);
  transform: rotate(-2deg);
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
}
.orb-a {
  width: 180px;
  height: 180px;
  right: 18px;
  top: 10px;
  background: radial-gradient(circle at 30% 30%, #ffe7a8, #d7a13a 62%, transparent 70%);
  box-shadow: 0 20px 40px rgba(195, 146, 42, 0.28);
}
.orb-b {
  width: 140px;
  height: 140px;
  left: 20px;
  bottom: 10px;
  background: radial-gradient(circle at 30% 30%, #b7efd3, #0e6a4b 64%, transparent 72%);
}
.float-card {
  position: absolute;
  width: 168px;
  padding: 14px;
  border-radius: 20px;
  background: linear-gradient(180deg, #fffdf8, #f4ead6);
  box-shadow: var(--shadow-deep);
  transform: rotateX(12deg) rotateY(-16deg);
  border: 1px solid rgba(255,255,255,.7);
}
.float-card svg { width: 34px; height: 34px; }
.fc1 { top: 24px; left: 36px; }
.fc2 { top: 86px; right: 18px; transform: rotateX(10deg) rotateY(14deg); }
.fc3 { bottom: 18px; left: 78px; transform: rotateX(8deg) rotateY(-8deg); }
.float-card b { display: block; margin-top: 8px; }
.float-card .card-icon { width: 48px; height: 48px; border-radius: 16px; }
.float-card .card-icon svg { width: 26px; height: 26px; }

.section { padding: 22px 0 42px; }
.section-head h2 { margin: 0; }
.section-head p { margin: 6px 0 0; color: var(--muted); }
.cat-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0; }
.chip {
  border: 1px solid var(--line);
  background: #fffaf1;
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(40, 28, 10, 0.06);
}
.chip.is-on {
  background: linear-gradient(180deg, #1a8a62, #0b4d37);
  color: #fff;
  border-color: #0b4d37;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.tool-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.72), transparent 42%),
    var(--paper);
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 24px;
  padding: 18px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  min-height: 176px;
  transform: translateY(0);
  transition: transform .18s ease, box-shadow .18s ease;
}
.tool-card:hover {
  transform: translateY(-8px) rotateX(4deg);
  box-shadow: var(--shadow-deep);
}
.tool-card.is-soon { opacity: 0.78; box-shadow: none; }
.card-icon {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  color: #fff;
  flex: none;
  box-shadow: 0 12px 20px rgba(0,0,0,.16), inset 0 1px 0 rgba(255,255,255,.4);
}
.card-icon svg { width: 34px; height: 34px; display: block; }
.icon-tax { background: linear-gradient(160deg, #2f9e6f, #0b4d37); }
.icon-loan { background: linear-gradient(160deg, #4c8dff, #1d4ed8); }
.icon-gold { background: linear-gradient(160deg, #f0c14b, #b7791f); }
.icon-salary { background: linear-gradient(160deg, #34d399, #047857); }
.icon-holiday { background: linear-gradient(160deg, #fb7185, #be123c); }
.icon-vat { background: linear-gradient(160deg, #a78bfa, #6d28d9); }
.icon-bmi { background: linear-gradient(160deg, #38bdf8, #0369a1); }
.icon-unit { background: linear-gradient(160deg, #f97316, #c2410c); }
.icon-electric { background: linear-gradient(160deg, #facc15, #ca8a04); color: #3f2d00; }
.icon-market { background: linear-gradient(160deg, #fb7185, #7c3aed); }
.icon-card { background: linear-gradient(160deg, #0ea5e9, #1d4ed8); }
.icon-wallet { background: linear-gradient(160deg, #059669, #f59e0b); }
.card-body { display: flex; flex-direction: column; gap: 4px; }
.card-body strong { font-size: 19px; }
.card-body span { color: var(--muted); }
.card-cat { font-size: 12px; font-weight: 700; color: var(--gold); letter-spacing: 0.04em; }

.tool-layout { padding: 28px 0 64px; }
.crumb { color: var(--muted); }
.tool-head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: start;
  margin-bottom: 8px;
}
.tool-head h1 { margin: 0 0 8px; }
.free-inline { color: var(--green-dark); font-weight: 700; }
.tool-root {
  background: linear-gradient(180deg, #fffefb, #fff7ea);
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 28px;
  padding: 22px;
  box-shadow: var(--shadow);
}
.disclaimer { color: var(--muted); font-size: 14px; }

.grid-2, .grid-3 { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
label { display: block; font-weight: 600; margin-bottom: 6px; }
input, select, textarea {
  width: 100%;
  font: inherit;
  font-size: 16px;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: inset 0 1px 2px rgba(40, 28, 10, 0.06);
}
.field { margin-bottom: 12px; }
.hint { color: var(--muted); font-size: 13px; font-weight: 400; }
.btn, button.btn {
  appearance: none;
  border: 0;
  background: linear-gradient(180deg, #1a8a62, #0b4d37);
  color: #fff;
  font: inherit;
  font-weight: 700;
  padding: 12px 16px;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 10px 18px rgba(11, 77, 55, 0.24);
}
.btn.secondary { background: var(--green-soft); color: var(--green-dark); box-shadow: none; }
.result-box {
  margin-top: 16px;
  background: linear-gradient(180deg, #edf8f1, #d7efe3);
  border-radius: 18px;
  padding: 16px;
  box-shadow: inset 0 1px 0 #fff, 0 10px 24px rgba(11, 77, 55, 0.08);
}
.result-box .big {
  font-size: 32px;
  font-weight: 700;
  color: var(--green-dark);
}
.table-wrap { overflow: auto; margin-top: 12px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-grid span, .cal-grid button {
  min-height: 38px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 13px;
  border: 0;
  background: transparent;
  font: inherit;
}
.cal-head { font-weight: 700; color: var(--muted); }
.day { background: #fff; border: 1px solid var(--line) !important; }
.day.holiday { background: #fde8e8; color: var(--danger); font-weight: 700; }
.day.weekend { background: #f4eee3; }
.month-title { margin: 18px 0 8px; }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 24px 0 40px;
  color: var(--muted);
}
.prose { padding: 32px 0 64px; max-width: 720px; }
.hidden { display: none !important; }

.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c23b3b;
  box-shadow: 0 0 0 0 rgba(194, 59, 59, 0.6);
  animation: pulse 1.6s infinite;
  margin-right: 6px;
  vertical-align: middle;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(194, 59, 59, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(194, 59, 59, 0); }
  100% { box-shadow: 0 0 0 0 rgba(194, 59, 59, 0); }
}
.news-page { padding: 28px 0 64px; }
.news-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.news-item {
  display: flex;
  flex-direction: column;
  min-height: 250px;
  background: var(--paper);
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 22px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transform: translateY(0);
  transition: transform .18s ease, box-shadow .18s ease;
}
.news-item:hover {
  transform: translateY(-7px);
  box-shadow: var(--shadow-deep);
}
.news-item.is-featured {
  grid-column: span 2;
  grid-row: span 2;
  min-height: 420px;
}
.news-thumb {
  height: 150px;
  background: linear-gradient(160deg, #d7efe3, #f3d48a);
  position: relative;
  overflow: hidden;
}
.news-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.photo-sheen {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(20, 12, 4, 0.55));
  pointer-events: none;
}
.news-item.is-featured .news-thumb { height: 260px; }
.news-thumb.has-img { background-color: #1b1712; }
.news-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.news-source {
  font-size: 12px;
  font-weight: 700;
  color: var(--gold);
}
.news-meta { color: var(--muted); font-size: 13px; }
.news-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: #fff;
}
.news-fallback svg { width: 42px; height: 42px; opacity: .9; }

.gold-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}
.gold-card {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(145deg, #fff4cc 0%, #e0b34d 42%, #9a6b16 100%);
  border: 1px solid #f2d789;
  border-radius: 22px;
  padding: 18px 16px 16px 18px;
  min-height: 128px;
  color: #3f2d00;
  box-shadow: 0 18px 30px rgba(154, 107, 22, 0.22), inset 0 1px 0 rgba(255,255,255,.55);
}
.gold-ico {
  width: 42px;
  height: 42px;
  display: block;
  margin-bottom: 8px;
  filter: drop-shadow(0 6px 8px rgba(0,0,0,.18));
}
.gold-card strong {
  display: block;
  font-size: 24px;
  color: #3b2a05;
  text-shadow: 0 1px 0 rgba(255,255,255,.35);
}
.gold-card small, .gold-card span { color: #5c430d; }
.gold-live-compact { margin: 0 0 18px; }
.tool-banner {
  position: relative;
  height: 120px;
  border-radius: 28px;
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.tool-banner svg {
  position: absolute;
  right: 24px;
  bottom: -8px;
  width: 120px;
  height: 120px;
  color: #fff;
  opacity: .9;
}
.banner-blob {
  position: absolute;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  left: -40px;
  top: -50px;
  background: rgba(255,255,255,.18);
}
.banner-tax { background: linear-gradient(120deg, #0b4d37, #34d399); }
.banner-loan { background: linear-gradient(120deg, #1d4ed8, #93c5fd); }
.banner-gold { background: linear-gradient(120deg, #b7791f, #fde68a); }
.banner-salary { background: linear-gradient(120deg, #047857, #6ee7b7); }
.banner-holiday { background: linear-gradient(120deg, #be123c, #fda4af); }
.banner-vat { background: linear-gradient(120deg, #6d28d9, #c4b5fd); }
.banner-bmi { background: linear-gradient(120deg, #0369a1, #7dd3fc); }
.banner-unit { background: linear-gradient(120deg, #c2410c, #fdba74); }
.banner-electric { background: linear-gradient(120deg, #ca8a04, #fde047); }
.banner-market { background: linear-gradient(120deg, #7c3aed, #fb7185); }
.banner-card { background: linear-gradient(120deg, #1d4ed8, #38bdf8); }
.banner-wallet { background: linear-gradient(120deg, #047857, #fbbf24); }
.wallet-page { padding: 28px 0 64px; }
.wallet-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin: 0 0 16px;
}
.chart-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  align-items: end;
  min-height: 140px;
}
.chart-col { text-align: center; }
.chart-bars {
  display: flex;
  gap: 3px;
  align-items: end;
  height: 110px;
  justify-content: center;
}
.bar {
  width: 10px;
  min-height: 4px;
  border-radius: 6px 6px 2px 2px;
}
.bar.in { background: #059669; }
.bar.out { background: #dc2626; }
.bar.save { background: #d4a017; }
.alert-box {
  background: #fde8e8;
  border: 1px solid #f0b4b4;
  border-radius: 16px;
  padding: 12px 16px;
  margin: 0 0 16px;
}
.progress {
  height: 10px;
  background: #eee4d2;
  border-radius: 999px;
  overflow: hidden;
  margin: 6px 0;
}
.progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #059669, #fbbf24);
}
.goal-card { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); }
.bill-cal { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.bill-day {
  min-width: 72px;
  background: #fff;
  border-radius: 12px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  font-size: 12px;
}
.st-overdue { color: #b42318; font-weight: 700; display: block; }
.st-due_today { color: #b45309; font-weight: 700; display: block; }
.st-due_soon { color: #a16207; display: block; }
.st-paid { color: #047857; display: block; }
.campaign-box { margin-bottom: 16px; }
.campaign-list { display: grid; gap: 8px; }
.campaign-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  box-shadow: 0 8px 18px rgba(40, 28, 10, 0.06);
}
.campaign-item:hover { transform: translateY(-2px); }
.check-list { display: grid; gap: 12px; }
.check-group {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  display: grid;
  gap: 8px;
}
.check-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  font-weight: 500;
  margin: 0;
}
.check-item em { color: var(--gold); font-style: normal; font-weight: 700; }
.check-item small { display: block; color: var(--muted); font-weight: 400; }
.news-hero-art {
  height: 160px;
  overflow: hidden;
  border-radius: 28px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.news-hero-art img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  object-position: center 20%;
  display: block;
}

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-stage { min-height: 220px; }
  .news-list { grid-template-columns: 1fr 1fr; }
  .news-item.is-featured { grid-column: span 2; grid-row: auto; min-height: 320px; }
}
@media (max-width: 700px) {
  .header-inner { align-items: flex-start; padding: 10px 0; }
  .tool-root { padding: 14px; }
  .result-box .big { font-size: 26px; }
  .news-list { grid-template-columns: 1fr; }
  .news-item.is-featured { grid-column: auto; }
  .float-card { width: 140px; }
  .tool-head { grid-template-columns: 1fr; }
}
