:root {
  --ink: #18342d;
  --muted: #63706c;
  --paper: #fffaf6;
  --surface: #ffffff;
  --green: #173f35;
  --green-2: #2d6a59;
  --coral: #ee665b;
  --coral-dark: #c9473f;
  --sky: #d9eef5;
  --yellow: #f2c45d;
  --line: #dfe5e2;
  --soft: #f3f5f3;
  --shadow: 0 14px 38px rgba(24, 52, 45, .12);
  --max: 1060px;
}

* { box-sizing: border-box; }

html {
  color-scheme: light;
  scroll-behavior: smooth;
  background: var(--paper);
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Noto Sans Thai", "Leelawadee UI", Tahoma, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button { letter-spacing: 0; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  color: white;
  background: var(--green);
  transform: translateY(-140%);
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 62px;
  padding: 9px max(18px, env(safe-area-inset-left));
  border-bottom: 1px solid rgba(23, 63, 53, .1);
  background: rgba(255, 250, 246, .96);
  backdrop-filter: blur(14px);
}

.brand-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  color: var(--green);
  background: transparent;
  font-weight: 900;
  cursor: pointer;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  color: white;
  background: var(--green);
  box-shadow: inset -5px -5px 0 rgba(238, 102, 91, .7);
}

.age-note {
  color: var(--muted);
  font-size: .81rem;
  font-weight: 700;
}

main { min-height: calc(100svh - 138px); }

.landing-hero {
  position: relative;
  min-height: min(820px, calc(100svh - 62px));
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  color: white;
  background: var(--green) url("/assets/hero.jpg") center 42% / cover no-repeat;
}

.landing-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(15, 43, 36, .56);
}

.hero-content {
  position: relative;
  width: min(100%, var(--max));
  margin-inline: auto;
  padding: 56px 20px 42px;
}

.hero-kicker {
  display: inline-block;
  margin: 0 0 8px;
  color: #ffe39d;
  font-size: .84rem;
  font-weight: 900;
  text-transform: uppercase;
}

.hero-content h1 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(2.35rem, 9vw, 5.4rem);
  line-height: .98;
  font-weight: 950;
}

.hero-question {
  max-width: 650px;
  margin: 18px 0 6px;
  font-size: clamp(1.35rem, 5.5vw, 2.4rem);
  line-height: 1.28;
  font-weight: 850;
}

.hero-copy {
  max-width: 590px;
  margin: 0 0 24px;
  color: rgba(255, 255, 255, .91);
  font-size: 1rem;
}

.primary-button, .secondary-button, .text-button {
  min-height: 52px;
  border: 0;
  border-radius: 8px;
  font-weight: 850;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}

.primary-button {
  width: 100%;
  padding: 13px 18px;
  color: #172e28;
  background: var(--yellow);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .18);
}

.primary-button:hover, .primary-button:focus-visible { transform: translateY(-1px); }
.primary-button:disabled { cursor: wait; opacity: .7; transform: none; }
.primary-button.dark { color: white; background: var(--green); box-shadow: none; }
.primary-button.coral { color: white; background: var(--coral-dark); box-shadow: none; }

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 14px;
  margin: 14px 0 0;
  color: rgba(255, 255, 255, .84);
  font-size: .82rem;
  font-weight: 700;
}

.content-band { padding: 56px 20px; }
.content-band.alt { background: var(--sky); }
.content-band.green { color: white; background: var(--green); }
.content-inner { width: min(100%, var(--max)); margin-inline: auto; }
.section-kicker { margin: 0 0 6px; color: var(--coral-dark); font-size: .78rem; font-weight: 900; }
.green .section-kicker { color: #ffe39d; }
.section-title { margin: 0 0 24px; font-size: clamp(1.65rem, 7vw, 2.8rem); line-height: 1.25; }

.benefit-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  border: 1px solid var(--line);
  background: var(--line);
}

.benefit-item { min-height: 155px; padding: 22px; background: var(--surface); }
.benefit-item b { display: block; margin-bottom: 5px; font-size: 1.08rem; }
.benefit-item p { margin: 0; color: var(--muted); }
.benefit-swatch { display: block; width: 34px; height: 7px; margin-bottom: 20px; border-radius: 2px; }
.benefit-item:nth-child(1) .benefit-swatch { background: var(--coral); }
.benefit-item:nth-child(2) .benefit-swatch { background: var(--green-2); }
.benefit-item:nth-child(3) .benefit-swatch { background: var(--yellow); }
.benefit-item:nth-child(4) .benefit-swatch { background: #5aa3bb; }

.report-preview {
  display: grid;
  gap: 24px;
  padding: 24px 0 0;
}

.sample-sheet {
  padding: 24px;
  border: 1px solid rgba(23, 63, 53, .14);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
}
.sample-label { color: var(--coral-dark); font-size: .78rem; font-weight: 900; }
.sample-sheet h3 { margin: 5px 0 18px; font-size: 1.35rem; }
.mini-score { margin: 13px 0; }
.mini-score div { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 5px; font-size: .88rem; }
.mini-score i { display: block; height: 8px; overflow: hidden; background: var(--soft); border-radius: 3px; }
.mini-score u { display: block; height: 100%; background: var(--green-2); text-decoration: none; }
.sample-copy p { color: var(--muted); }
.sample-locks { display: grid; gap: 9px; margin-top: 20px; }
.sample-locks span { padding: 10px 12px; border-left: 3px solid var(--coral); background: rgba(255, 255, 255, .62); font-weight: 750; }

.steps { display: grid; gap: 0; counter-reset: step; }
.step {
  position: relative;
  padding: 4px 0 30px 58px;
  counter-increment: step;
}
.step::before {
  content: counter(step);
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 50%;
  color: var(--green);
  background: var(--yellow);
  font-weight: 900;
}
.step::after {
  content: "";
  position: absolute;
  top: 40px;
  bottom: 4px;
  left: 18px;
  width: 1px;
  background: rgba(255, 255, 255, .25);
}
.step:last-child::after { display: none; }
.step h3 { margin: 0 0 4px; }
.step p { margin: 0; color: rgba(255, 255, 255, .76); }

.boundary-note {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 38px 20px;
  text-align: center;
}
.boundary-note h2 { margin: 0 0 10px; font-size: 1.35rem; }
.boundary-note p { margin: 0; color: var(--muted); }

.quiz-shell, .result-shell, .report-shell, .loading-shell, .recovery-shell {
  width: min(100%, 820px);
  margin-inline: auto;
  padding: 20px 18px 48px;
}

.quiz-head {
  position: sticky;
  z-index: 20;
  top: 62px;
  margin: -20px -18px 24px;
  padding: 14px 18px 13px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 250, 246, .97);
  backdrop-filter: blur(12px);
}
.quiz-meta { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; font-size: .85rem; font-weight: 800; }
.progress-track { height: 7px; overflow: hidden; border-radius: 3px; background: var(--line); }
.progress-track span { display: block; height: 100%; background: var(--coral); transition: width .22s ease; }

.question-card { padding: 24px 0 12px; }
.dimension-pill { display: inline-block; margin-bottom: 14px; color: var(--green-2); font-size: .78rem; font-weight: 900; }
.question-card h1 { min-height: 100px; margin: 0; font-size: clamp(1.45rem, 6vw, 2.2rem); line-height: 1.42; }
.answer-hint { margin: 8px 0 14px; color: var(--muted); font-size: .88rem; }
.answer-list { display: grid; gap: 9px; }
.answer-option {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: white;
  text-align: left;
  cursor: pointer;
}
.answer-option strong {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid #b7c3bf;
  border-radius: 50%;
  font-size: .9rem;
}
.answer-option[aria-checked="true"] { border-color: var(--green); background: #edf5f1; box-shadow: 0 0 0 1px var(--green); }
.answer-option[aria-checked="true"] strong { color: white; border-color: var(--green); background: var(--green); }

.quiz-actions { display: grid; grid-template-columns: 54px 1fr; gap: 10px; margin-top: 18px; }
.back-button {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--green);
  background: white;
  font-size: 1.4rem;
  cursor: pointer;
}
.save-state { min-height: 25px; margin: 11px 0 0; color: var(--muted); text-align: center; font-size: .8rem; }

.result-intro { padding: 24px 0 14px; }
.result-intro h1, .report-title h1 { margin: 4px 0 10px; font-size: clamp(2rem, 8vw, 3.8rem); line-height: 1.1; }
.result-intro p, .report-title p { color: var(--muted); }
.eyebrow { color: var(--coral-dark); font-size: .78rem; font-weight: 900; }

.score-panel, .summary-panel, .unlock-panel, .report-section, .recovery-card {
  margin: 14px 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}
.score-panel h2, .summary-panel h2, .unlock-panel h2, .report-section h2 { margin: 0 0 16px; font-size: 1.25rem; }
.score-row { margin: 15px 0; }
.score-row > div { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 5px; }
.score-row b { color: var(--green); }
.score-row i { display: block; height: 11px; overflow: hidden; border-radius: 4px; background: var(--soft); }
.score-row u { display: block; height: 100%; background: var(--green-2); text-decoration: none; }
.score-row:nth-child(3n+1) u { background: var(--coral); }
.score-row:nth-child(3n+2) u { background: #4f9fba; }
.score-row:nth-child(3n) u { background: #d6a93e; }
.score-note { margin: 16px 0 0; color: var(--muted); font-size: .83rem; }

.summary-panel p { margin: 0 0 12px; }
.summary-panel p:last-child { margin-bottom: 0; }
.locked-list { display: grid; gap: 9px; margin: 20px 0; }
.locked-item { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--soft); font-weight: 750; }
.lock-icon { color: var(--coral-dark); font-weight: 950; }

.price-line { display: flex; align-items: baseline; gap: 8px; margin: 12px 0 18px; }
.price-line strong { font-size: 2.2rem; line-height: 1; }
.price-line span { color: var(--muted); }
.secure-note { margin: 12px 0 0; color: var(--muted); text-align: center; font-size: .82rem; }
.error-message { min-height: 24px; color: #a52d27; font-size: .88rem; }

.recovery-card { border-color: #c7dfe7; background: #eff8fb; }
.recovery-card code { display: block; margin: 14px 0; padding: 12px; border: 1px dashed #5a91a4; border-radius: 6px; background: white; text-align: center; font-size: 1.15rem; font-weight: 900; letter-spacing: .08em; }
.recovery-card p { margin: 0; color: var(--muted); font-size: .88rem; }

.report-status { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 5px; color: #184d3f; background: #dff3ea; font-size: .8rem; font-weight: 900; }
.report-title { padding: 28px 0 16px; }
.dimension-block { padding: 18px 0; border-top: 1px solid var(--line); }
.dimension-block:first-of-type { border-top: 0; }
.dimension-heading { display: flex; justify-content: space-between; gap: 14px; }
.dimension-heading h3 { margin: 0; font-size: 1.05rem; }
.dimension-heading b { color: var(--green-2); }
.dimension-block p { margin: 8px 0 0; color: var(--muted); }
.action-list { margin: 0; padding-left: 22px; }
.action-list li { margin: 10px 0; }
.day-plan { display: grid; gap: 1px; border: 1px solid var(--line); background: var(--line); }
.day-item { display: grid; grid-template-columns: 58px 1fr; gap: 13px; padding: 14px; background: white; }
.day-item b { color: var(--coral-dark); }
.report-actions { display: grid; gap: 10px; margin: 22px 0; }

.loading-shell { display: grid; min-height: 62svh; place-items: center; text-align: center; }
.loader { width: 42px; height: 42px; margin: 0 auto 18px; border: 4px solid var(--line); border-top-color: var(--coral); border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.recovery-shell { min-height: 65svh; padding-top: 54px; }
.recovery-shell h1 { margin-bottom: 4px; }
.recovery-form { display: grid; gap: 10px; margin-top: 22px; }
.recovery-form input { min-height: 54px; padding: 12px 14px; border: 1px solid #aebcb7; border-radius: 8px; background: white; text-transform: uppercase; }

.site-footer {
  padding: 28px 20px calc(28px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: white;
  text-align: center;
}
.site-footer p { margin: 0 0 8px; font-weight: 800; }
.site-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px 14px; }
.site-footer button { padding: 4px; border: 0; color: var(--muted); background: transparent; text-decoration: underline; cursor: pointer; }

.info-dialog { width: min(92vw, 650px); max-height: 84svh; padding: 28px; border: 0; border-radius: 8px; color: var(--ink); box-shadow: var(--shadow); }
.info-dialog::backdrop { background: rgba(10, 28, 23, .7); }
.info-dialog h2 { margin-top: 0; }
.info-dialog p, .info-dialog li { color: var(--muted); }
.dialog-close { float: right; width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--soft); font-size: 1.5rem; cursor: pointer; }

@media (min-width: 720px) {
  .site-header { padding-inline: 32px; }
  .hero-content { padding-inline: 38px; padding-bottom: 64px; }
  .primary-button { width: auto; min-width: 290px; }
  .benefit-grid { grid-template-columns: repeat(2, 1fr); }
  .report-preview { grid-template-columns: .95fr 1.05fr; align-items: center; }
  .steps { grid-template-columns: repeat(3, 1fr); gap: 32px; }
  .step { padding: 58px 0 0; }
  .step::after { top: 18px; right: -32px; bottom: auto; left: 40px; width: calc(100% + 24px); height: 1px; }
  .quiz-shell, .result-shell, .report-shell { padding-top: 34px; }
  .quiz-head { top: 62px; margin-top: -34px; }
  .question-card { padding: 42px 38px 18px; }
  .answer-list { grid-template-columns: repeat(5, 1fr); }
  .answer-option { grid-template-columns: 1fr; align-content: start; min-height: 128px; text-align: center; }
  .answer-option strong { margin-inline: auto; }
  .quiz-actions { max-width: 520px; margin: 24px auto 0; }
  .report-actions { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 1020px) {
  .benefit-grid { grid-template-columns: repeat(4, 1fr); }
  .landing-hero { background-position: center 45%; }
  .hero-content { padding-left: 50px; }
}

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

@media print {
  .site-header, .site-footer, .report-actions, .recovery-card { display: none !important; }
  body { background: white; }
  .report-shell { width: 100%; max-width: none; padding: 0; }
  .report-section, .score-panel { break-inside: avoid; box-shadow: none; }
}
