:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --text: #142131;
  --muted: #647080;
  --line: #dde3ea;
  --accent: #12263f;
  --accent-hover: #0b1c31;
  --accent-soft: #edf2f7;
  --priority: #243f60;
  --shadow: 0 18px 44px rgba(18, 38, 63, .08);
  --shadow-soft: 0 8px 24px rgba(18, 38, 63, .06);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); }
button, input { font: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid rgba(18, 38, 63, .25); outline-offset: 3px; }
.shell { width: min(1080px, calc(100% - 32px)); margin: 0 auto; padding: 46px 0 72px; }
.hero, .card { background: var(--surface); border: 1px solid var(--line); border-radius: 26px; box-shadow: var(--shadow); }
.hero { padding: clamp(30px, 6vw, 68px); }
.card { padding: clamp(22px, 4vw, 38px); }
.eyebrow { font-size: .76rem; font-weight: 850; letter-spacing: .13em; color: var(--muted); margin-bottom: 12px; }
h1 { font-size: clamp(2.25rem, 5.8vw, 4.75rem); line-height: .99; letter-spacing: -.035em; margin: 0 0 24px; max-width: 920px; }
h2 { margin: 0 0 14px; line-height: 1.12; letter-spacing: -.015em; }
h3 { letter-spacing: -.01em; }
.lede { font-size: clamp(1.05rem, 2.1vw, 1.3rem); line-height: 1.62; max-width: 830px; color: var(--muted); margin-bottom: 26px; }

.proof-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; max-width: 760px; margin: 26px 0 14px; }
.proof-chip { border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; display: flex; align-items: baseline; gap: 8px; background: #fbfcfd; }
.proof-chip strong { font-size: 1.55rem; }
.proof-chip span { color: var(--muted); font-size: .88rem; }
.trust-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 4px; }
.trust-row span { background: var(--accent-soft); color: #405269; border-radius: 999px; padding: 8px 12px; font-size: .82rem; font-weight: 700; }
.guardrail { margin: 28px 0; padding: 16px 18px; background: var(--accent-soft); border-radius: 14px; color: #33485f; line-height: 1.5; }

.primary, .secondary, .link-button { border: 0; border-radius: 12px; padding: 13px 18px; font-weight: 780; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; transition: transform .12s ease, background .12s ease; }
.primary { background: var(--accent); color: white; }
.primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.secondary { background: var(--accent-soft); color: var(--accent); }
.secondary:hover { background: #e2e9f0; }
button:disabled { opacity: .45; cursor: not-allowed; transform: none !important; }
.hero-cta { min-height: 50px; padding-inline: 22px; }
.hidden { display: none !important; }

.assessment-topline { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.step-label { font-size: 1.05rem; font-weight: 800; }
.progress-percent { font-size: 1.05rem; font-weight: 850; color: var(--accent); }
.progress-track { height: 9px; background: var(--accent-soft); border-radius: 999px; overflow: hidden; margin: 14px 0 34px; }
.progress-bar { height: 100%; width: 0; background: var(--accent); transition: width .2s ease; }
.question-section-head { padding-bottom: 12px; }
.section-title { font-size: clamp(1.65rem, 3vw, 2.25rem); margin: 4px 0 9px; }
.section-note { color: var(--muted); margin: 0 0 16px; font-size: 1.02rem; line-height: 1.55; }
.question { border: 0; border-top: 1px solid var(--line); margin: 0; padding: 26px 0; min-inline-size: 0; }
.question legend { width: 100%; font-size: 1.08rem; font-weight: 760; line-height: 1.48; padding: 0; margin-bottom: 15px; }
.question-number { display: inline-grid; place-content: center; width: 28px; height: 28px; margin-right: 10px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: .82rem; vertical-align: middle; }
.options { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.option { position: relative; }
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option span { display: flex; min-height: 76px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; align-items: center; justify-content: center; text-align: center; cursor: pointer; font-size: .84rem; color: var(--muted); background: #fff; }
.option span:hover { border-color: #b9c4cf; }
.option input:checked + span { border: 2px solid var(--accent); color: var(--accent); background: var(--accent-soft); font-weight: 780; }
.nav-row { margin-top: 24px; display: flex; justify-content: space-between; gap: 12px; }

.results-hero { margin-bottom: 32px; }
.score-row { display: flex; gap: 28px; align-items: center; justify-content: space-between; }
.score-copy { max-width: 760px; }
.result-status { display: inline-flex; margin-bottom: 12px; background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 7px 11px; font-size: .78rem; font-weight: 850; letter-spacing: .035em; text-transform: uppercase; }
#statusCopy { color: var(--muted); line-height: 1.58; font-size: 1.03rem; }
.score-badge { flex: 0 0 auto; width: 138px; height: 138px; border: 9px solid var(--accent-soft); border-radius: 50%; display: grid; place-content: center; text-align: center; }
.score-badge span { font-size: 2.65rem; font-weight: 900; line-height: 1; }
.score-badge small { color: var(--muted); }
.fine-print { color: var(--muted); font-size: .9rem; line-height: 1.55; }
.results-section { margin: 36px 0; }
.section-heading-row { display: flex; gap: 18px; align-items: flex-end; justify-content: space-between; margin-bottom: 16px; }
.priority-key { color: var(--muted); font-size: .83rem; background: var(--accent-soft); border-radius: 999px; padding: 8px 11px; font-weight: 750; }

.leak-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: stretch; }
.leak-card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 23px; box-shadow: var(--shadow-soft); }
.priority-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rank { font-size: .75rem; font-weight: 850; color: var(--muted); letter-spacing: .09em; }
.fix-first { background: var(--accent); color: white; border-radius: 999px; padding: 6px 9px; font-size: .72rem; font-weight: 850; }
.leak-card h3 { margin: 15px 0 8px; font-size: 1.2rem; }
.leak-score { display: flex; align-items: center; gap: 9px; margin: 8px 0; }
.leak-score strong { font-size: 1.08rem; }
.leak-score span { color: var(--muted); font-size: .82rem; font-weight: 750; }
.evidence-pill { display: inline-flex; background: #f6f8fa; border: 1px solid var(--line); border-radius: 999px; padding: 6px 9px; color: var(--muted); font-size: .72rem; font-weight: 700; }
.leak-card > p { color: var(--muted); line-height: 1.52; }
.card-subsection { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.card-subsection strong { font-size: .9rem; }
.card-subsection ul { margin: 10px 0 0; padding-left: 19px; line-height: 1.5; font-size: .9rem; }
.validation-block { background: #f9fafb; border-radius: 12px; padding: 14px; border-top: 0; }
.validation-block ul { color: #465468; }

.lifecycle-card { overflow: hidden; }
.map-label { margin: 24px 0 10px; font-size: .76rem; font-weight: 850; letter-spacing: .09em; color: var(--muted); text-transform: uppercase; }
.journey-label { margin-top: 30px; }
.foundation-map { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.journey-map { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr) auto minmax(0,1fr) auto minmax(0,1fr) auto minmax(0,1fr); gap: 8px; align-items: stretch; }
.map-tile { position: relative; min-width: 0; border: 1px solid var(--line); background: #fbfcfd; border-radius: 16px; padding: 16px; }
.map-tile.is-priority { border: 2px solid var(--accent); background: #f7f9fc; }
.map-priority { display: inline-flex; margin-bottom: 9px; border-radius: 999px; background: var(--accent); color: white; padding: 5px 8px; font-size: .68rem; font-weight: 850; }
.map-title { min-height: 40px; font-size: .88rem; font-weight: 780; line-height: 1.32; }
.map-score { font-size: 1.7rem; font-weight: 900; margin-top: 12px; }
.map-score small { color: var(--muted); font-size: .72rem; margin-left: 2px; }
.map-status { color: var(--muted); font-size: .76rem; font-weight: 750; margin-top: 4px; }
.journey-arrow { display: grid; place-content: center; color: #98a4b2; font-size: 1.1rem; }
.methodology { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 16px; color: var(--muted); }
.methodology summary { cursor: pointer; color: var(--accent); font-weight: 800; }
.methodology p { line-height: 1.55; margin-bottom: 0; }

.cta { display: flex; gap: 28px; align-items: center; justify-content: space-between; margin: 36px 0; }
.cta-copy { max-width: 650px; }
.cta-copy p { color: var(--muted); line-height: 1.55; margin-bottom: 0; }
.cta-actions { flex: 0 0 310px; display: grid; gap: 10px; }
.cta-actions .link-button { width: 100%; text-align: center; }
.assessment-details { scroll-margin-top: 18px; }
.details-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 20px; }
.details-grid > div { border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: grid; gap: 8px; background: #fbfcfd; }
.details-grid strong { font-size: .93rem; }
.details-grid span { color: var(--muted); line-height: 1.48; font-size: .87rem; }

.result-email { margin-top: 36px; }
.email-heading { align-items: center; }
.preview-notice { margin: 18px 0; border: 1px solid #d6dee7; background: #f6f8fb; border-radius: 12px; padding: 12px 14px; color: #526176; font-size: .88rem; line-height: 1.48; }
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 20px 0; }
label { display: grid; gap: 6px; font-weight: 720; font-size: .9rem; }
input[type="text"], input[type="email"] { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; background: #fff; color: var(--text); }
input[type="text"]:focus, input[type="email"]:focus { border-color: #8ea0b3; }
.check { display: flex; align-items: flex-start; gap: 9px; font-weight: 500; margin: 10px 0; color: var(--muted); }
.check input { margin-top: 3px; }
.form-actions { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.form-status { color: var(--muted); font-size: .88rem; }
.safeguards { color: var(--muted); font-size: .9rem; line-height: 1.55; margin-top: 36px; }
.safeguards summary { cursor: pointer; color: var(--accent); font-weight: 850; }
.safeguards ul { margin-bottom: 0; }
.restart { margin-top: 4px; }

@media (max-width: 920px) {
  .leak-grid { grid-template-columns: 1fr; }
  .details-grid { grid-template-columns: repeat(2, 1fr); }
  .journey-map { grid-template-columns: 1fr; }
  .journey-arrow { transform: rotate(90deg); min-height: 18px; }
  .map-title { min-height: 0; }
}

@media (max-width: 760px) {
  .shell { width: min(100% - 20px, 1080px); padding-top: 10px; }
  .hero, .card { border-radius: 18px; }
  .proof-row { grid-template-columns: repeat(2, 1fr); }
  .options { grid-template-columns: 1fr; }
  .option span { min-height: 48px; justify-content: flex-start; text-align: left; }
  .score-row, .cta { align-items: flex-start; flex-direction: column; }
  .score-badge { width: 112px; height: 112px; }
  .section-heading-row { align-items: flex-start; flex-direction: column; }
  .foundation-map, .details-grid, .form-grid { grid-template-columns: 1fr; }
  .cta-actions { width: 100%; flex-basis: auto; }
  .email-heading #printBtn { width: 100%; }
  .form-actions { align-items: stretch; flex-direction: column; }
  .form-status { margin: 0; }
}

@media print {
  body { background: white; }
  .shell { width: 100%; padding: 0; }
  #intro, #assessment, .cta, .result-email, .restart { display: none !important; }
  .hero, .card, .leak-card { box-shadow: none; }
  #results { display: block !important; }
  .results-section, .results-hero, .assessment-details, .safeguards { break-inside: avoid; }
  .leak-grid { grid-template-columns: 1fr; }
  .journey-map { grid-template-columns: 1fr; }
  .journey-arrow { display: none; }
}

/* v1.2 conversion routing and CRM-ready layer */
.routing-note {
  margin-top: 14px;
  padding: 11px 13px;
  border-radius: 12px;
  background: #f7f9fb;
  border: 1px solid var(--line);
  color: #566579;
  font-size: .82rem;
  line-height: 1.45;
}
.details-bottom-cta {
  display: flex;
  justify-content: flex-end;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.intent-dialog {
  width: min(760px, calc(100% - 28px));
  max-height: min(90vh, 820px);
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: transparent;
  overflow: visible;
}
.intent-dialog::backdrop {
  background: rgba(12, 24, 39, .58);
  backdrop-filter: blur(3px);
}
.intent-dialog-card {
  margin: 0;
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(12, 24, 39, .24);
  max-height: min(90vh, 820px);
  overflow-y: auto;
}
.intent-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}
.intent-dialog-head h2 { margin-bottom: 0; }
.icon-button {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #f7f9fb;
  color: var(--accent);
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
}
.icon-button:hover { background: var(--accent-soft); }
.intent-copy {
  margin: 14px 0 16px;
  color: var(--muted);
  line-height: 1.55;
}
.intent-priority-summary {
  margin: 16px 0 4px;
  padding: 15px 16px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid var(--line);
}
.intent-summary-label {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.intent-priority-summary ol {
  margin: 9px 0;
  padding-left: 21px;
  line-height: 1.45;
  font-weight: 720;
}
.intent-summary-score {
  color: var(--muted);
  font-size: .84rem;
}
.intent-actions { flex-wrap: wrap; }

@media (max-width: 760px) {
  .details-bottom-cta { justify-content: stretch; }
  .details-bottom-cta .primary { width: 100%; }
  .intent-dialog { width: min(100% - 14px, 760px); }
  .intent-dialog-card { border-radius: 16px; padding: 20px 16px; }
  .intent-dialog-head { gap: 10px; }
  .intent-dialog .form-grid { grid-template-columns: 1fr; }
  .intent-actions { flex-direction: column; align-items: stretch; }
  .intent-actions .primary, .intent-actions .secondary { width: 100%; }
}

@media print {
  .intent-dialog { display: none !important; }
  .details-bottom-cta { display: none !important; }
}
