/* =========================================================
   Generador de Web con IA — Luis R. Silva
   Tokens del sistema de diseño de Luis R. Silva
   ========================================================= */
@font-face { font-family: 'Geist'; font-weight: 400; font-display: swap; src: url('fonts/Geist-Regular.ttf') format('truetype'); }
@font-face { font-family: 'Geist'; font-weight: 500; font-display: swap; src: url('fonts/Geist-Medium.ttf') format('truetype'); }
@font-face { font-family: 'Geist'; font-weight: 600; font-display: swap; src: url('fonts/Geist-SemiBold.ttf') format('truetype'); }
@font-face { font-family: 'Geist'; font-weight: 700; font-display: swap; src: url('fonts/Geist-Bold.ttf') format('truetype'); }
@font-face { font-family: 'Geist'; font-weight: 900; font-display: swap; src: url('fonts/Geist-Black.ttf') format('truetype'); }

:root {
  --blue: #0055FF; --blue-600: #0046D4; --blue-700: #003AAF; --blue-50: #E6EEFF; --blue-100: #CCDCFF;
  --green: #6FEBB8; --green-600: #48C893; --green-50: #E8FBF2;
  --yellow: #F4E04D; --yellow-600: #D9C22E; --yellow-50: #FFFBE0;
  --ink: #212932; --ink-2: #4B5563; --ink-3: #6B7280;
  --line: #E5E7EB; --line-soft: #EEF0F3;
  --paper: #F5F7FA; --white: #FFFFFF;
  --navy: #0B1426;

  --font: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --r-sm: 8px; --r: 12px; --r-lg: 20px; --r-xl: 28px;
  --sh-1: 0 1px 2px rgba(16,24,40,.05);
  --sh-2: 0 4px 12px rgba(16,24,40,.08);
  --sh-3: 0 12px 32px rgba(16,24,40,.10);
  --sh-blue: 0 12px 32px rgba(0,85,255,.22);
  --ease: cubic-bezier(.2,.7,.2,1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.55; color: var(--ink);
  background: var(--paper); -webkit-font-smoothing: antialiased;
  min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { margin: 0; line-height: 1.1; letter-spacing: -0.02em; }
p { margin: 0; }
button { font: inherit; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.wrap--narrow { max-width: 680px; }

/* ---------- Topbar ---------- */
.topbar { background: var(--white); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo img { height: 30px; width: auto; }
.topbar-tag {
  font-size: 13px; font-weight: 600; color: var(--blue); background: var(--blue-50);
  padding: 6px 12px; border-radius: 999px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; cursor: pointer; text-decoration: none; font-weight: 600; font-size: 16px;
  padding: 13px 22px; border-radius: 999px; transition: transform .18s var(--ease), background .18s, box-shadow .18s, color .18s;
  -webkit-tap-highlight-color: transparent;
}
.btn:focus-visible, .option:focus-visible, .field:focus-visible, summary:focus-visible, .prompt-box:focus-visible {
  outline: 3px solid color-mix(in oklab, var(--blue) 50%, transparent); outline-offset: 2px;
}
.btn:active { transform: scale(.98); }
.btn--primary { background: var(--blue); color: var(--white); box-shadow: var(--sh-blue); }
.btn--primary.is-done { background: var(--green-600); box-shadow: none; }
.btn--ghost { background: transparent; color: var(--ink-2); }
.btn--yellow { background: var(--yellow); color: var(--ink); }
.btn--on-dark { background: rgba(255,255,255,.1); color: var(--white); }
.btn--lg { padding: 17px 30px; font-size: 17px; }
.btn--sm { padding: 9px 16px; font-size: 14px; }
.btn--block { width: 100%; }
.btn:disabled { opacity: .7; cursor: progress; }

/* ---------- Shared ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--blue);
  text-transform: uppercase; letter-spacing: .06em;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green-600); box-shadow: 0 0 0 4px var(--green-50); }
.hl { color: var(--blue); position: relative; white-space: nowrap; }
.hl::after {
  content: ''; position: absolute; left: -2%; right: -2%; bottom: .06em; height: .2em;
  background: var(--yellow); z-index: -1; border-radius: 4px;
}
.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r-xl);
  box-shadow: var(--sh-2); padding: 32px;
}
.chip {
  display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--blue-700); background: var(--blue-50); padding: 5px 11px; border-radius: 999px; margin-bottom: 14px;
}
.chip--green { color: #166A4A; background: var(--green-50); }
.chip--yellow { color: #6B5D00; background: var(--yellow-50); }

/* ---------- Intro ---------- */
.intro { padding: 64px 0 80px; position: relative; overflow: hidden; }
.intro::before {
  content: ''; position: absolute; inset: -20% -10% auto auto; width: 620px; height: 620px; border-radius: 50%;
  background: radial-gradient(circle, rgba(0,85,255,.14), transparent 65%); pointer-events: none;
}
.intro::after {
  content: ''; position: absolute; left: -160px; bottom: -160px; width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle, rgba(111,235,184,.22), transparent 65%); pointer-events: none;
}
.intro-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center; position: relative; z-index: 1; }
.intro h1 { font-size: clamp(2.6rem, 5.2vw, 4.6rem); font-weight: 900; letter-spacing: -0.035em; line-height: .98; margin: 18px 0 22px; }
.lead { font-size: 19px; color: var(--ink-2); max-width: 34em; margin-bottom: 32px; }
.intro-checks { list-style: none; padding: 0; margin: 26px 0 0; display: flex; flex-wrap: wrap; gap: 10px 22px; color: var(--ink-2); font-size: 15px; }
.intro-checks li { display: flex; align-items: center; gap: 8px; }
.intro-checks li::before {
  content: '✓'; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%;
  background: var(--green); color: var(--ink); font-size: 12px; font-weight: 700;
}

.mocks { position: relative; display: grid; gap: 18px; padding: 8px 0; }
.mock {
  background: var(--white); border-radius: var(--r-xl); box-shadow: var(--sh-3), 0 0 0 1px var(--line);
  overflow: hidden; width: 86%; animation: float 6s ease-in-out infinite;
}
.mock--1 { --rot: -1.5deg; justify-self: start; z-index: 3; }
.mock--2 { --rot: 2deg; justify-self: end; margin-top: -4px; animation-delay: -2s; animation-duration: 7s; z-index: 2; }
.mock--3 { --rot: -1deg; justify-self: start; width: 72%; margin-left: 10%; animation-delay: -4s; animation-duration: 6.5s; z-index: 1; }
@keyframes float { 0%,100% { transform: rotate(var(--rot)) translateY(0); } 50% { transform: rotate(var(--rot)) translateY(-10px); } }
.mock-bar { display: flex; align-items: center; gap: 6px; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); background: var(--paper); }
.mock-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.mock-bar span { margin-left: 8px; font-size: 12px; color: var(--ink-3); font-weight: 500; }
.mock-body { padding: 20px 22px; display: grid; gap: 10px; }
.mock-chip { justify-self: start; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--blue-700); background: var(--blue-50); padding: 4px 10px; border-radius: 999px; }
.mock-title { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.mock-chip--green { color: #166A4A; background: var(--green-50); }
.mock-chip--yellow { color: #6B5D00; background: var(--yellow-50); }
.mock-line { height: 9px; border-radius: 6px; background: var(--line-soft); }
.mock-line.light { background: rgba(255,255,255,.18); }
.w60 { width: 60%; } .w70 { width: 70%; } .w80 { width: 80%; } .w90 { width: 90%; }
.mock-prompt { background: var(--navy); border-radius: var(--r); padding: 14px 16px; display: grid; gap: 9px; position: relative; margin-top: 6px; }
.mock-label { font-size: 11px; font-weight: 600; color: var(--green); }
.mock-copy { position: absolute; top: 12px; right: 12px; font-size: 11px; font-weight: 700; background: var(--blue); color: var(--white); padding: 4px 10px; border-radius: 999px; }
.mock-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mock-stat { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; display: grid; }
.mock-stat b { font-size: 22px; font-weight: 900; color: var(--blue); }
.mock-stat span { font-size: 12px; color: var(--ink-3); }

.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 72px; position: relative; z-index: 1; }
.how-item { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; }
.how-item span { font-size: 13px; font-weight: 700; color: var(--blue); }
.how-item h3 { font-size: 20px; margin: 8px 0 6px; }
.how-item p { color: var(--ink-2); font-size: 15px; }

/* ---------- Quiz ---------- */
.quiz { padding: 40px 0 72px; }
.progress { height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--blue), var(--green-600)); border-radius: 999px; transition: width .4s var(--ease); }
.progress-label { font-size: 14px; color: var(--ink-3); margin: 10px 0 18px; font-weight: 500; }
.q-card { padding: 36px; }
.q-enter { animation: qIn .35s var(--ease); }
@keyframes qIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.q-title { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800; margin-bottom: 8px; }
.q-hint { color: var(--ink-3); margin-bottom: 4px; }
.q-body-gap { height: 8px; }
#q-body .field, #q-body .options { margin-top: 22px; }

.field {
  width: 100%; font: inherit; font-size: 17px; color: var(--ink); background: var(--white);
  border: 1.5px solid var(--line); border-radius: var(--r); padding: 14px 16px; transition: border-color .18s, box-shadow .18s;
}
.field:focus { border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-50); outline: none; }
textarea.field { resize: vertical; min-height: 110px; line-height: 1.5; }
textarea.field--short { min-height: 0; resize: none; }

.options { display: grid; gap: 10px; }
.options--grid { grid-template-columns: 1fr 1fr; }
.option {
  display: flex; align-items: center; gap: 14px; text-align: left; cursor: pointer; width: 100%;
  background: var(--white); border: 1.5px solid var(--line); border-radius: var(--r); padding: 14px 16px;
  color: var(--ink); transition: border-color .15s, background .15s, transform .15s;
}
.option.is-on { border-color: var(--blue); background: var(--blue-50); }
.option-mark { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); background: var(--white); transition: all .15s; position: relative; }
.option[role=checkbox] .option-mark { border-radius: 6px; }
.option.is-on .option-mark { border-color: var(--blue); background: var(--blue); }
.option.is-on .option-mark::after {
  content: ''; position: absolute; left: 5px; top: 1.5px; width: 5px; height: 10px;
  border: solid var(--white); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.option-text { display: grid; gap: 2px; }
.option-text strong { font-weight: 600; font-size: 16px; }
.option-text small { color: var(--ink-3); font-size: 13.5px; }

.q-error { color: #C2410C; font-size: 14px; font-weight: 500; min-height: 22px; margin-top: 12px; }
.q-error.is-info { color: var(--blue-700); background: var(--blue-50); border-radius: var(--r); padding: 10px 12px; }
.q-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 8px; }
.q-actions .btn--primary { margin-left: auto; }

/* ---------- Etiquetas de formulario ---------- */
.lbl { display: block; font-weight: 600; font-size: 14px; margin: 14px 0 6px; }
.opt { color: var(--ink-3); font-weight: 400; }

/* ---------- Results ---------- */
.results { padding: 48px 0 80px; }
.results .card { margin-top: 24px; }
.r-head { display: grid; gap: 4px; justify-items: start; }
.r-head .r-hello { font-size: clamp(2.2rem, 4.6vw, 3.6rem); font-weight: 900; letter-spacing: -0.03em; margin-top: 12px; }
.results .card h2 { font-size: clamp(1.5rem, 2.8vw, 2rem); font-weight: 800; }

.r-diag { border-top: 6px solid var(--blue); }
.r-diag h2#r-type { font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 900; color: var(--blue); }
.r-short { font-size: 19px; margin: 12px 0 16px; }
.r-why { color: var(--ink-2); }
.r-prompt-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 18px; }
.r-prompt-head p { color: var(--ink-2); margin-top: 8px; max-width: 40em; }
.r-prompt-head .btn { flex: none; }
.prompt-box {
  margin: 0; white-space: pre-wrap; word-wrap: break-word; font-family: var(--mono); font-size: 14.5px; line-height: 1.65;
  background: var(--navy); color: #E7ECF5; border-radius: var(--r-lg); padding: 24px; max-height: 460px; overflow: auto;
}
.prompt-box--short { margin: 14px 0 12px; max-height: none; }
.prompt-alt { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 16px; }
.prompt-alt summary { cursor: pointer; font-weight: 600; color: var(--blue); }

.r-budget { border-top: 6px solid var(--yellow); }
.budget-note { margin-top: 14px; color: var(--ink-2); font-size: 15px; background: var(--yellow-50); border-radius: var(--r); padding: 14px 16px; }
.budget-note--fine { background: none; padding: 0; font-size: 13px; color: var(--ink-3); }

.r-cta {
  margin-top: 24px; background: var(--navy); color: var(--white); border-radius: var(--r-xl); padding: 40px;
  display: grid; grid-template-columns: 1fr auto; gap: 24px 40px; align-items: center; position: relative; overflow: hidden;
}
.r-cta::before { content: ''; position: absolute; right: -120px; top: -120px; width: 360px; height: 360px; border-radius: 50%; background: radial-gradient(circle, rgba(0,85,255,.5), transparent 65%); }
.r-cta > * { position: relative; }
.r-cta h2 { font-size: clamp(1.8rem, 3.4vw, 2.4rem); font-weight: 900; }
.r-cta p { color: #B8C3D6; margin-top: 8px; }
.r-cta-actions { display: grid; gap: 10px; }


/* Selección de 1 a 3: número de orden en la marca */
.options--pick .option-mark { border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: var(--white); }
.options--pick .option.is-on .option-mark::after { display: none; }
.option.is-dim { opacity: .5; }
.pick-count { font-size: 14px; color: var(--ink-3); margin-top: 12px; min-height: 20px; }

.p-foot { font-size: 14px; color: var(--ink-3); margin-top: 14px; }

/* Mensaje de copiado */
.copy-msg { font-size: 14px; font-weight: 500; color: #166A4A; min-height: 0; margin: 0 0 10px; }
.copy-msg:empty { display: none; }

/* Checklist */
.r-check-intro { color: var(--ink-2); margin-top: 8px; }
.checklist { list-style: none; padding: 0; margin: 20px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.checklist label { display: flex; gap: 12px; align-items: flex-start; background: var(--paper); border-radius: var(--r); padding: 14px 16px; cursor: pointer; font-size: 15px; height: 100%; }
.checklist input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--green-600); flex: none; }
.checklist input:checked + span { color: var(--ink-3); text-decoration: line-through; }

/* Recomendado y sugerencias */
.rec { display: inline-block; margin-left: 8px; font-style: normal; font-size: 11px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: #166A4A; background: var(--green-50); border-radius: 999px; padding: 2px 8px; vertical-align: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip-btn { font: inherit; font-size: 14px; font-weight: 500; color: var(--ink); background: var(--white); border: 1.5px solid var(--line);
  border-radius: 999px; padding: 7px 14px; cursor: pointer; transition: all .15s; }
.chip-btn::before { content: '+ '; color: var(--blue); font-weight: 700; }
.chip-btn.is-on { background: var(--blue-50); border-color: var(--blue); }
.chip-btn.is-on::before { content: '✓ '; }

/* Páginas ajustables */
.r-side-hint { font-size: 13px; color: var(--ink-3); margin: -6px 0 12px; }
.r-pagelist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.r-pagelist label { display: flex; gap: 10px; align-items: center; background: var(--white); border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 12px; font-size: 15px; cursor: pointer; }
.r-pagelist label.is-req { cursor: default; }
.r-pagelist input { width: 17px; height: 17px; accent-color: var(--blue); flex: none; }
.r-pagelist em { font-style: normal; font-size: 12px; color: var(--ink-3); }

/* Estructura */
.r-structure-intro { color: var(--ink-2); margin-top: 8px; }
.r-structure-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 28px; margin-top: 20px; }
.r-structure-grid h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin: 0 0 10px; }
.r-structure-grid h3:not(:first-child) { margin-top: 20px; }
.tree { margin: 0; font-family: var(--mono); font-size: 14px; line-height: 1.6; background: var(--paper); border-radius: var(--r-lg);
  padding: 18px 20px; white-space: pre; overflow-x: auto; }
.r-headline { margin-bottom: 14px; }

/* Cómo conseguir visitas */
.vis-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 20px; }
.vis-box { background: var(--paper); border-radius: var(--r-lg); padding: 20px 22px; }
.vis-box h3 { font-size: 16px; margin-bottom: 10px; }
.vis-box ul, .vis-box ol { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 15px; color: var(--ink-2); }
.vis-box--accent { background: var(--blue-50); }
.vis-note { font-size: 13.5px; color: var(--ink-3); margin: 0 0 10px; }
.vis-box--accent .vis-note { margin: 12px 0 0; color: var(--blue-700); font-weight: 600; }

/* Saludo en el cuestionario */
.q-greet { font-size: 15px; font-weight: 600; color: var(--blue); margin-bottom: 8px; }

/* Agregar una página */
.r-addpage { margin-top: 14px; }
.r-addpage .lbl { margin-top: 0; }
.r-addpage-row { display: flex; gap: 8px; }
.r-addpage-row .field { padding: 10px 14px; font-size: 16px; }
.r-addpage-row .btn { flex: none; border: 1.5px solid var(--line); }
.r-addpage-msg { font-size: 13.5px; color: var(--ink-2); margin-top: 8px; min-height: 0; }
.r-addpage-msg:empty { display: none; }

/* Títulos recomendados */
.r-seo { border-top: 6px solid var(--green); }
.seo-list { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 10px; }
.seo-list li { background: var(--paper); border-radius: var(--r); padding: 14px 16px; display: grid; gap: 3px; }
.seo-page { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.seo-list strong { font-size: 17px; color: var(--blue-700); }
.seo-list small { font-size: 13.5px; color: var(--ink-2); }

/* Comparación de costos */
.cost-wrap { overflow-x: auto; margin-top: 20px; }
.cost { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.cost th, .cost td { padding: 14px 12px; border-bottom: 1px solid var(--line); text-align: right; vertical-align: top; }
.cost th[scope=row] { text-align: left; font-weight: 600; padding-left: 0; }
.cost thead th { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.cost td { font-weight: 700; white-space: nowrap; }
.cost small { display: block; font-weight: 400; font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.cost .nw { white-space: nowrap; }
.cost .is-you { background: var(--green-50); }
.cost thead .is-you { color: #166A4A; border-radius: var(--r) var(--r) 0 0; }
.cost tfoot th, .cost tfoot td { border-bottom: 0; font-size: 20px; font-weight: 900; padding-top: 18px; }
.cost tfoot .is-you { color: #166A4A; border-radius: 0 0 var(--r) var(--r); }
.r-budget .budget-note--fine { margin-top: 14px; }

/* Lo que necesitas */
.check-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; margin-top: 20px; align-items: start; }
.check-grid .checklist { margin-top: 0; }
.vis-box--accent a { color: var(--blue-700); }

/* Final del resultado */
.r-end { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 28px; }
.pdf-msg { flex-basis: 100%; font-size: 14.5px; color: var(--ink-2); }
.pdf-msg:empty { display: none; }
.pdf-msg a { color: var(--blue-700); font-weight: 600; }

/* Efectos al pasar el mouse: solo con mouse (en celular quedan "pegados" después de tocar) */
@media (hover: hover) {
  .btn--primary:hover { background: var(--blue-600); }
  .btn--ghost:hover { background: var(--line-soft); color: var(--ink); }
  .btn--yellow:hover { background: #FFE95E; transform: translateY(-1px); }
  .btn--on-dark:hover { background: rgba(255,255,255,.18); }
  .option:hover { border-color: var(--blue-100); background: #FAFCFF; }
  .chip-btn:hover { border-color: var(--blue-100); }
}
/* Lo elegido conserva su estilo aunque el mouse esté encima */
.option.is-on:hover { border-color: var(--blue); background: var(--blue-50); }
.chip-btn.is-on:hover { border-color: var(--blue); }
.btn--primary.is-done:hover { background: var(--green-600); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); background: var(--white); }
.footer-inner { display: flex; justify-content: space-between; gap: 12px; padding: 20px; font-size: 14px; color: var(--ink-3); flex-wrap: wrap; }
.footer a { color: var(--ink-3); }
.noscript { text-align: center; padding: 24px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .intro { padding: 40px 0 56px; }
  .intro-grid { grid-template-columns: 1fr; gap: 40px; }
  .intro-visual { max-width: 460px; }
  .r-cta { grid-template-columns: 1fr; }
  .check-grid .checklist { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .topbar-inner { height: 56px; }
  .logo img { height: 24px; }
  .topbar-tag { font-size: 12px; }
  .lead { font-size: 17px; }
  .btn--lg { width: 100%; }
  .how { grid-template-columns: 1fr; margin-top: 48px; gap: 12px; }
  .card, .q-card { padding: 22px; border-radius: var(--r-lg); }
  .options--grid { grid-template-columns: 1fr; }
  .option { padding: 12px 14px; }
  .r-prompt-head { flex-direction: column; align-items: stretch; }
  .prompt-box { font-size: 13.5px; padding: 18px; }
  .checklist, .vis-grid, .r-structure-grid, .check-grid { grid-template-columns: 1fr; }
  .tree { font-size: 12.5px; }
  .r-cta { padding: 28px 22px; }
  /* Costos en celular: cada concepto con sus dos valores uno debajo del otro (etiqueta a la izquierda, monto a la derecha) */
  .cost-wrap { overflow: visible; }
  .cost thead { display: none; }
  .cost tr { display: grid; grid-template-columns: 1fr; gap: 6px; padding: 14px 0; border-bottom: 1px solid var(--line); }
  .cost th, .cost td { display: block; padding: 0; border: 0; text-align: left; white-space: normal; }
  .cost td { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; border-radius: var(--r-sm); padding: 9px 12px; background: var(--paper); font-size: 15px; }
  .cost td::before { content: attr(data-label); flex: none; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); padding-top: 3px; max-width: 34%; }
  .cost .amt { text-align: right; }
  .cost td.is-you { background: var(--green-50); }
  .cost tfoot tr { border-bottom: 0; }
  .cost tfoot th { font-size: 17px; }
  .cost tfoot td { font-size: 16px; }
  .cost tfoot .is-you, .cost thead .is-you { border-radius: var(--r-sm); }

  /* Cuestionario: botones siempre a mano al pie de la pantalla */
  .q-card { padding-bottom: 0; }
  .q-actions { position: sticky; bottom: 0; z-index: 2; background: var(--white); margin: 8px -22px 0; padding: 12px 22px calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line-soft); border-radius: 0 0 var(--r-lg) var(--r-lg); }
  .chip-btn { min-height: 44px; }
  .q-error { margin-top: 10px; }

  /* Final: PDF ancho completo y "otro diagnóstico" centrado debajo */
  .r-end { flex-direction: column; align-items: stretch; text-align: center; }
  .r-end .btn--ghost { align-self: center; }
  .r-addpage-row { flex-direction: column; }
}

/* ---------- Guía «Pasos a seguir» (pregunta 1 de la versión directa) ---------- */
.guide { margin-top: 28px; padding: 20px; background: var(--blue-50); border-radius: var(--r-lg); }
.guide h3 { font-size: 17px; font-weight: 800; color: var(--blue-700); margin-bottom: 12px; }
.guide-steps { list-style: none; counter-reset: g; padding: 0; margin: 0; display: grid; gap: 12px; }
.guide-steps li { counter-increment: g; display: grid; grid-template-columns: 28px 1fr; gap: 2px 12px; align-items: start; }
.guide-steps li::before {
  content: counter(g); grid-row: span 2; display: grid; place-items: center; width: 28px; height: 28px;
  border-radius: 50%; background: var(--blue); color: var(--white); font-size: 14px; font-weight: 700;
}
.guide-steps strong { font-size: 15px; color: var(--ink); }
.guide-steps span { font-size: 14.5px; color: var(--ink-2); line-height: 1.45; }
.guide-why { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--blue-100); font-size: 14.5px; color: var(--ink-2); line-height: 1.5; }
.guide-why strong { color: var(--ink); }


/* ---------- Bienvenida: comunidad de WhatsApp (antes de la pregunta 1) ---------- */
.btn--green { background: var(--green); color: var(--ink); }
.welcome { padding: 40px 0 64px; }
.welcome-card { padding: 34px 30px; }
.welcome-title { font-size: clamp(1.7rem, 5vw, 2rem); line-height: 1.12; letter-spacing: -.03em; font-weight: 900; margin: 0 0 10px; outline: none; }
.welcome-soft { color: var(--ink-3); }
.welcome-lead { font-size: 16px; color: var(--ink-2); margin: 0 0 14px; }
.welcome-list { list-style: none; margin: 0 0 22px; padding: 0; }
.welcome-list li { position: relative; padding: 7px 0 7px 34px; font-size: 15px; line-height: 1.5; color: var(--ink); }
.welcome-list li::before {
  content: ''; position: absolute; left: 0; top: 9px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--blue-50) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230055FF' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center / 14px no-repeat;
}
.welcome .btn { text-decoration: none; }
.welcome-or { display: flex; align-items: center; gap: 12px; margin: 18px 0 10px; color: var(--ink-3); font-size: 13px; }
.welcome-or::before, .welcome-or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.welcome-note { font-size: 13px; color: var(--ink-3); text-align: center; margin: 0 0 16px; }
@media (max-width: 520px) { .welcome-card { padding: 26px 20px; } }

/* ---------- Resultados: navegación fija y tamaños de letra (nov 2026) ---------- */
.r-nav { position: sticky; top: 64px; z-index: 9; background: rgba(255,255,255,.94); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); margin: -48px 0 32px; }
.r-nav__inner { display: flex; align-items: center; gap: 4px; height: 56px; overflow-x: auto; scrollbar-width: none; }
.r-nav__inner::-webkit-scrollbar { display: none; }
.r-nav a, .r-nav button { flex: none; font: inherit; font-size: 15px; font-weight: 600; color: var(--ink-2); text-decoration: none; background: none; border: 0; cursor: pointer; padding: 8px 14px; border-radius: 999px; transition: background .2s, color .2s; }
.r-nav a:hover, .r-nav button:hover { background: var(--paper); color: var(--ink); }
.r-nav .r-nav__tutorial { margin-left: auto; background: var(--yellow); color: var(--ink); padding: 9px 18px; font-weight: 700; }
.r-nav .r-nav__tutorial:hover { background: var(--yellow-600); color: var(--ink); }
.results [id^="r-"].card { scroll-margin-top: 136px; }

.r-cost-cta { margin-top: 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; background: var(--yellow-50); border-radius: var(--r); padding: 16px 20px; }
.r-cost-cta p { margin: 0; font-weight: 600; color: var(--ink); }

/* Letra más contenida en escritorio */
.r-head .r-hello { font-size: clamp(1.9rem, 3.2vw, 2.6rem); }
.results .card h2 { font-size: clamp(1.3rem, 2vw, 1.6rem); }
.r-diag h2#r-type { font-size: clamp(1.7rem, 3vw, 2.2rem); }
.r-short { font-size: 17px; }
.r-cta h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
@media (min-width: 901px) { .results { font-size: 15px; } }

@media (max-width: 640px) {
  .r-nav { top: 64px; margin-bottom: 20px; }
  .r-nav__inner { height: 50px; gap: 0; padding: 0 10px; }
  .r-nav a, .r-nav button { font-size: 14px; padding: 7px 10px; }
  .r-nav .r-nav__tutorial { padding: 8px 14px; }
  .r-cost-cta .btn { width: 100%; }
}
