* {
  box-sizing: border-box;
}

:root {
  --ink: #1a1f1e;
  --teal: #006b5d;
  --teal-soft: #e0f2f1;
  --orange: #d95400;
  --orange-soft: #fff3e9;
  --red: #c62828;
  --yellow: #f5c518;
  --page: #fafcfc;
  --font-heading: 'Kanit', ui-sans-serif, system-ui, sans-serif;
  --font-body: 'Noto Sans Thai', ui-sans-serif, system-ui, sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.5;
}

h1, h2, h3, legend {
  font-family: var(--font-heading);
}

[hidden] {
  display: none !important;
}

.text-danger {
  color: red;
}
.text-black {
  color: #000 !important;
}
.w-100 {
  width: 100%;
}

/* Grid (Bootstrap 4 style, self-hosted) */
.container {
  width: 100%;
  margin-right: auto;
  margin-left: auto;
  padding-right: 15px;
  padding-left: 15px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  margin-right: -15px;
  margin-left: -15px;
}

.col-md-6 {
  position: relative;
  width: 100%;
  padding-right: 15px;
  padding-left: 15px;
}

.align-items-center {
  align-items: center;
}

.mb-5 {
  margin-bottom: 3rem;
}

@media (min-width: 576px) {
  .container { max-width: 540px; }
}

@media (min-width: 768px) {
  .container { max-width: 720px; }

  .col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
  }

  .mb-md-0 {
    margin-bottom: 0;
  }
}

@media (min-width: 992px) {
  .container { max-width: 960px; }
}

@media (min-width: 1200px) {
  .container { max-width: 1140px; }
}

label {
  margin-bottom: 0;
}

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--page);
}

.hero-inner {
  padding-top: 64px;
  padding-bottom: 64px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  padding: 8px 16px;
  border-radius: 9999px;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 14px;
  font-weight: 600;
}

.hero h1 {
  margin: 0;
  color: var(--ink);
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.hero h1 .title-main,
.hero h1 .title-sub {
  display: block;
}

.hero h1 .title-sub {
  margin-top: 4px;
  color: var(--teal);
  font-size: 0.78em;
}

.hero h1 .title-drug {
  display: inline-block;
  color: rgba(26, 31, 30, 0.55);
  font-size: 0.72em;
  font-weight: 600;
  letter-spacing: 0.01em;
  vertical-align: 0.12em;
}

.hero-notes {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.hero-note {
  display: flex;
  flex: 0 1 auto;
  min-width: 0;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.35;
}

.hero-note svg {
  flex-shrink: 0;
}

.hero-note strong {
  font-weight: 600;
}

.hero-note--warn {
  border-color: rgba(200, 30, 30, 0.2);
  background: #fdecec;
  color: #b42318;
}

.hero-note--area {
  border-color: rgba(217, 84, 0, 0.2);
  background: var(--orange-soft);
  color: var(--orange);
}

.hero-lead {
  max-width: 28rem;
  margin: 20px 0 0;
  color: rgba(26, 31, 30, 0.7);
  font-size: 18px;
  line-height: 1.6;
}

.start-button {
  position: relative;
  display: inline-flex;
  height: 64px;
  margin-top: 40px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0 40px;
  border-radius: 16px;
  background: var(--teal);
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.3s;
}

.start-button:hover {
  color: #fff;
  text-decoration: none;
  transform: scale(1.02);
}

.start-button:active {
  transform: scale(0.98);
}

.start-ripple {
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.2);
  transform: scale(0);
  transition: transform 0.5s;
}

.start-button:hover .start-ripple {
  transform: scale(3);
}

.start-label {
  position: relative;
}

.hero-image {
  width: 100%;
  max-width: 24rem;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 16px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.hero-image img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

/* Checklist */
.checklist-section {
  padding-top: 64px;
  padding-bottom: 64px;
}

.checklist {
  --accent: var(--teal);
  --accent-soft: var(--teal-soft);
  --accent-ring: rgba(0, 107, 93, 0.08);
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.checklist-stop {
  --accent: var(--orange);
  --accent-soft: var(--orange-soft);
  --accent-ring: rgba(217, 84, 0, 0.08);
}

.checklist legend {
  padding: 0;
  color: var(--accent);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.33;
  display: flex;
  align-items: center;
  gap: 10px;
}

.checklist legend .legend-icon {
  width: 50px;
  height: 50px;
  flex-shrink: 0;
  object-fit: contain;
}

.checklist-items {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.checklist-item {
  position: relative;
  display: flex;
  min-height: 64px;
  align-items: flex-start;
  gap: 16px;
  padding: 20px;
  border: 2px solid rgba(26, 31, 30, 0.1);
  border-radius: 16px;
  background: #fff;
  cursor: pointer;
  transition: all 0.3s;
}

.checklist-item:hover {
  border-color: rgba(26, 31, 30, 0.2);
}

.checklist-item input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.checklist-box {
  display: flex;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(26, 31, 30, 0.25);
  border-radius: 8px;
  background: #fff;
  transition: border-color 0.15s, background-color 0.15s;
}

.checklist-box::after {
  content: '';
  width: 6px;
  height: 11px;
  margin-top: -3px;
  border: solid #fff;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg) scale(0);
}

.checklist-text {
  color: var(--ink);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.6;
}

.checklist-item:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 4px var(--accent-ring);
}

.checklist-item input:checked + .checklist-box {
  border-color: var(--accent);
  background: var(--accent);
}

.checklist-item input:checked + .checklist-box::after {
  transform: rotate(45deg) scale(1);
}

.checklist-item:has(input:focus-visible) {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* Safety */
.safety-section {
  padding-top: 64px;
  padding-bottom: 64px;
}

.safety-card {
  padding: 32px;
  border: 2px solid rgba(217, 84, 0, 0.3);
  border-radius: 2rem;
  background: var(--orange-soft);
}

.safety-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.safety-icon {
  display: flex;
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: var(--orange);
  color: #fff;
  animation: safety-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes safety-pulse {
  50% { opacity: 0.5; }
}

@media (prefers-reduced-motion: reduce) {
  .safety-icon { animation: none; }
  .start-button, .start-ripple, .assess-button, .result-action { transition: none; }
}

.safety-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 24px;
  font-weight: 700;
}

.safety-head ul {
  display: grid;
  gap: 12px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  color: rgba(26, 31, 30, 0.85);
  font-size: 18px;
  line-height: 1.6;
}

.safety-ack {
  display: flex;
  min-height: 56px;
  margin-top: 32px;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 2px solid rgba(217, 84, 0, 0.4);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}

.safety-ack:focus-within {
  outline: 3px solid var(--orange);
}

.safety-ack input {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  margin: 0;
  accent-color: var(--orange);
}

.safety-ack span {
  color: var(--ink);
  font-size: 17px;
  font-weight: 500;
}

.safety-hint {
  margin: 8px 0 0;
  color: rgba(26, 31, 30, 0.6);
  font-size: 14px;
}

/* Assess button */
.assess-section {
  padding-top: 16px;
  padding-bottom: 16px;
}

.assess-button {
  width: 100%;
  height: 64px;
  border: 0;
  border-radius: 16px;
  background: var(--teal);
  color: #fff;
  font-family: inherit;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.assess-button:hover:not(:disabled) {
  transform: scale(1.01);
}

.assess-button:disabled {
  background: rgba(26, 31, 30, 0.1);
  color: rgba(26, 31, 30, 0.4);
  cursor: not-allowed;
}

.assess-button:focus-visible,
.result-action:focus-visible,
.start-button:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 2px;
}

.assess-hint {
  margin: 12px 0 0;
  color: rgba(26, 31, 30, 0.5);
  font-size: 14px;
}

/* Result */
.result-section {
  padding-top: 64px;
  padding-bottom: 64px;
}

.result-card {
  padding: 32px;
  border-radius: 2rem;
}

.result-card svg {
  display: block;
}

.result-card h3 {
  margin: 16px 0 0;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.2;
}

.result-card > p {
  margin: 16px 0 0;
  font-size: 18px;
  line-height: 1.6;
}

.result-stop,
.result-consider {
  color: #fff;
}

.result-stop > p,
.result-consider > p {
  color: rgba(255, 255, 255, 0.9);
}

.result-stop {
  background: var(--orange);
}

.result-caution {
  background: var(--yellow);
  color: #fff;
}

.result-caution > p {
  color: rgba(255, 255, 255, 0.9);
}

.result-caution .result-action,
.result-caution .result-action:hover {
  color: var(--ink);
}

.result-consider {
  background: var(--teal);
}

.result-none {
  border: 2px solid rgba(26, 31, 30, 0.1);
  background: #fff;
}

.result-none svg {
  color: rgba(26, 31, 30, 0.4);
}

.result-none h3 {
  color: var(--ink);
  font-size: 24px;
}

.result-none > p {
  color: rgba(26, 31, 30, 0.7);
}

.result-box {
  margin-top: 24px;
  padding: 24px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.1);
}

.result-box-title {
  margin: 0;
  font-weight: 600;
}

.result-box ul {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  font-size: 17px;
  line-height: 1.6;
}

.result-action {
  display: inline-flex;
  min-height: 64px;
  margin-top: 24px;
  align-items: center;
  justify-content: center;
  padding: 0 32px;
  border-radius: 16px;
  background: #fff;
  color: var(--teal);
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  transition: transform 0.15s;
}

.result-action:hover {
  color: var(--teal);
  text-decoration: none;
  transform: scale(1.02);
}

/* Footer */
.site-footer {
  padding: 40px 24px;
  border-top: 1px solid rgba(26, 31, 30, 0.1);
  background: #fff;
  color: rgba(26, 31, 30, 0.5);
  font-size: 14px;
  text-align: center;
}

.site-footer p {
  margin: 0;
}

.site-footer p + p {
  margin-top: 6px;
}

.site-footer a {
  color: var(--teal);
}

@media (min-width: 768px) {
  .hero-inner {
    padding-top: 96px;
    padding-bottom: 96px;
  }

  .hero h1 {
    font-size: 3rem;
  }

  .hero-note {
    font-size: 15px;
  }

  .checklist-text {
    font-size: 18px;
  }

  .safety-card,
  .result-card {
    padding: 48px;
  }

  .assess-button {
    width: auto;
    padding: 0 64px;
  }
}

@media (max-width: 767px) {
  .hide-mobile { display: none; }
}
