:root {
  --ink: #20283a;
  --muted: #6d707a;
  --line: #eadfe0;
  --paper: #ffffff;
  --page: #fbf7f5;
  --teal: #b56f7d;
  --teal-dark: #7a4350;
  --mint: #f6e3e5;
  --coral: #c47a86;
  --coral-soft: #f8e6e7;
  --gold: #c5a05a;
  --blue: #315f91;
  --blue-soft: #dfe8f4;
  --shadow: 0 18px 46px rgba(24, 35, 38, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 16px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 8px;
  background: var(--teal-dark);
  color: #fff;
  font-size: 13px;
  font-weight: 950;
}

.logo-mark {
  overflow: hidden;
  border: 1px solid rgba(182, 134, 46, 0.28);
  background: #fff;
}

.logo-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 18px;
  font-weight: 950;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.top-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.top-nav button,
.lang-toggle,
.surface-switch,
.primary-btn,
.secondary-btn,
.text-btn {
  min-height: 42px;
  border-radius: 8px;
  font-weight: 850;
}

.top-nav button,
.lang-toggle,
.surface-switch,
.secondary-btn,
.text-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.top-nav button {
  padding: 0 13px;
}

.top-nav button.active {
  border-color: var(--teal);
  background: var(--mint);
  color: var(--teal-dark);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ref-pill,
.status-pill,
.source-pill {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: #edf2ef;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.lang-toggle {
  padding: 0 14px;
}

.surface-switch {
  padding: 0 14px;
  border-color: #d8c391;
  background: #fff8e6;
  color: #6e4e11;
}

.agent-surface {
  --teal: #315f91;
  --teal-dark: #173f68;
  --mint: #dfe8f4;
}

.agent-surface .brand-mark {
  background: #173f68;
}

.agent-surface .site-header {
  background: rgba(251, 252, 250, 0.94);
}

.app {
  padding: 26px;
}

.assessment-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 22px;
  min-height: calc(100vh - 122px);
  align-items: stretch;
}

.hero-copy,
.hero-panel,
.tool-shell,
.admin-shell,
.agent-kit {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px;
}

.eyebrow {
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  max-width: 780px;
  margin-top: 12px;
  font-size: 54px;
  line-height: 1.03;
}

.hero-copy p {
  max-width: 680px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.only-three > button {
  flex: 1 1 190px;
}

.primary-btn {
  padding: 0 18px;
  border: 1px solid var(--teal);
  background: linear-gradient(135deg, var(--teal), #d0a460);
  color: #fff;
}

.secondary-btn,
.text-btn {
  padding: 0 16px;
}

.text-btn {
  min-height: 34px;
  padding: 0 10px;
  color: var(--teal);
}

.safe-copy {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.privacy-note {
  margin: -8px 0 18px;
  padding: 12px 14px;
  border: 1px solid #c7ddd7;
  border-radius: 8px;
  background: var(--mint);
  color: var(--teal-dark);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.45;
}

.hero-panel {
  position: relative;
  overflow: hidden;
  min-height: 620px;
  background:
    radial-gradient(circle at 50% 22%, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.5) 42%, rgba(196, 122, 134, 0.3) 100%),
    linear-gradient(180deg, rgba(255, 250, 248, 0.9), rgba(122, 67, 80, 0.62));
}

.thai-brand-card {
  position: absolute;
  top: 34px;
  right: 34px;
  left: 34px;
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 24px;
  border: 1px solid rgba(197, 160, 90, 0.32);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  text-align: center;
  backdrop-filter: blur(10px);
}

.thai-brand-card img {
  width: min(260px, 72%);
  aspect-ratio: 1;
  object-fit: contain;
}

.thai-brand-card span,
.thai-brand-card strong,
.thai-brand-card small {
  display: block;
}

.thai-brand-card span {
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.thai-brand-card strong {
  margin-top: 4px;
  color: var(--ink);
  font-size: 34px;
  font-weight: 950;
}

.thai-brand-card small {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.18em;
}

.pathway-card {
  position: absolute;
  right: 28px;
  bottom: 28px;
  left: 28px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
}

.pathway-top {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.pathway-top strong {
  color: var(--teal-dark);
}

.pathway-line {
  height: 12px;
  margin-top: 18px;
  border-radius: 999px;
  background: #e8eeee;
}

.pathway-line.active {
  width: 82%;
  background: var(--teal);
}

.pathway-line.short {
  width: 56%;
}

.mini-results {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.mini-results span {
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--mint);
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 850;
}

.trust-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.trust-row article {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.trust-row strong,
.trust-row span {
  display: block;
}

.trust-row strong {
  font-size: 30px;
  font-weight: 950;
}

.trust-row span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.tool-shell,
.admin-shell,
.agent-kit {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px;
}

.tool-shell.narrow {
  max-width: 720px;
}

.tool-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.tool-head h1 {
  font-size: 36px;
}

.progress-meta {
  display: grid;
  min-width: 72px;
  min-height: 52px;
  place-items: center;
  border-radius: 8px;
  background: var(--mint);
  color: var(--teal-dark);
  font-weight: 950;
}

.progress-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf2ef;
}

#progressFill {
  width: 20%;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
  transition: width 160ms ease;
}

.assessment-form {
  margin-top: 26px;
}

.step-card {
  display: none;
}

.step-card.active {
  display: block;
}

.step-title {
  margin-bottom: 18px;
  font-size: 24px;
  font-weight: 950;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.stack-form,
.field {
  display: grid;
  gap: 8px;
}

.stack-form {
  gap: 16px;
}

.field span,
.stack-form label span,
.checkbox-field legend {
  font-size: 13px;
  font-weight: 900;
}

.checkbox-field {
  grid-column: 1 / -1;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.check-option {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  color: var(--ink);
}

.check-option input {
  width: 18px;
  height: 18px;
  accent-color: var(--teal);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  color: var(--ink);
}

input,
select {
  height: 44px;
  padding: 0 12px;
}

textarea {
  resize: vertical;
  padding: 12px;
}

small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.step-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
}

.step-actions button {
  min-width: 130px;
}

.result-shell {
  max-width: 860px;
}

.result-card {
  padding: 12px;
}

.result-card h1 {
  font-size: 34px;
}

.suggestion-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 24px 0;
}

.result-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.suggestion-item {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.suggestion-item.clickable {
  cursor: pointer;
  transition: border-color 140ms ease, transform 140ms ease;
}

.suggestion-item.clickable:hover {
  border-color: var(--teal);
  transform: translateY(-1px);
}

.suggestion-item strong {
  display: block;
  font-size: 16px;
}

.suggestion-item span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.admin-shell {
  max-width: 1280px;
}

.admin-grid {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 18px;
}

.lead-list,
.lead-detail {
  min-height: 520px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.lead-list {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 12px;
}

.lead-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: left;
}

.lead-card.active {
  border-color: var(--teal);
  background: var(--mint);
}

.lead-card strong {
  display: block;
  font-size: 15px;
}

.lead-card span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.lead-detail {
  padding: 20px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.detail-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.detail-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.detail-item strong {
  display: block;
  margin-top: 5px;
  word-break: break-word;
}

.admin-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 18px 0;
}

.subsection-title {
  margin: 18px 0 10px;
  font-size: 15px;
  font-weight: 950;
}

.note-form {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.note-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.note-item {
  padding: 12px;
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.comparison-shell {
  max-width: 1240px;
}

.comparison-intro {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.comparison-intro article,
.comparison-card,
.prep-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.comparison-intro article {
  padding: 16px;
}

.comparison-intro strong,
.comparison-intro span {
  display: block;
}

.comparison-intro strong {
  font-size: 16px;
  font-weight: 950;
}

.comparison-intro span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.comparison-table {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.comparison-card {
  padding: 18px;
}

.comparison-card h2 {
  font-size: 20px;
}

.compare-block {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.compare-block span {
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.compare-block p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.comparison-next {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.comparison-next h2 {
  font-size: 22px;
}

.prep-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.prep-item {
  padding: 13px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.4;
}

.kit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.agent-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 22px;
  border: 1px solid #cbd8ea;
  border-radius: 8px;
  background: linear-gradient(135deg, #f7f9fc, #eef4fb);
}

.agent-hero p {
  max-width: 720px;
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.5;
}

.agent-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.agent-metrics article {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.agent-metrics strong,
.agent-metrics span,
.agent-metrics small {
  display: block;
}

.agent-metrics strong {
  color: var(--blue);
  font-size: 30px;
  font-weight: 950;
}

.agent-metrics span {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 900;
}

.agent-metrics small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.agent-section-head {
  margin-bottom: 14px;
}

.kit-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.kit-card h2 {
  font-size: 20px;
}

.kit-card p,
.kit-card li {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.5;
}

.link-builder {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin: 14px 0;
}

#agentLinkOutput {
  min-height: 86px;
}

.empty-state {
  display: grid;
  min-height: 320px;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 980px) {
  .site-header {
    grid-template-columns: 1fr;
  }

  .top-nav {
    justify-content: flex-start;
  }

  .assessment-hero,
  .admin-grid,
  .comparison-intro,
  .comparison-table {
    grid-template-columns: 1fr;
  }

  .hero-panel {
    min-height: 560px;
  }
}

@media (max-width: 720px) {
  .app,
  .site-header {
    padding: 16px;
  }

  .hero-copy,
  .tool-shell,
  .admin-shell,
  .agent-kit {
    padding: 20px;
  }

  h1,
  .tool-head h1 {
    font-size: 31px;
  }

  .field-grid,
  .trust-row,
  .suggestion-list,
  .result-actions,
  .check-grid,
  .detail-grid,
  .admin-controls,
  .prep-grid,
  .agent-metrics,
  .kit-grid {
    grid-template-columns: 1fr;
  }

  .agent-hero {
    flex-direction: column;
  }

  .step-actions {
    flex-direction: column;
  }

  .link-builder {
    grid-template-columns: 1fr;
  }

  .thai-brand-card {
    top: 18px;
    right: 18px;
    left: 18px;
    padding: 18px;
  }

  .thai-brand-card img {
    width: min(210px, 74%);
  }

  .thai-brand-card strong {
    font-size: 28px;
  }

  .pathway-card {
    right: 18px;
    bottom: 18px;
    left: 18px;
  }
}
