/* Demos por Nicho — capa compartida. La personalidad la ponen las variables de cada página. */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body), system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--font-display), serif; line-height: 1.12; margin: 0; letter-spacing: var(--display-tracking, -0.015em); }
p { margin: 0; }
a { color: inherit; }
button { font: inherit; cursor: pointer; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* ---- Topbar ---- */
.topbar { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.topbar .wrap { display: flex; align-items: center; gap: 12px; height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 17px; }
.brand-glyph { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: 16px; font-family: var(--font-body); font-weight: 700; }
.demo-badge { font-size: 11.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); background: var(--accent-soft); padding: 4px 10px; border-radius: 99px; }
.topbar .cta-mini { margin-left: auto; }

/* ---- Botones ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; padding: 12px 20px; font-weight: 600; font-size: 15px; text-decoration: none; transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--accent) 70%, transparent); }
.btn-primary:hover { box-shadow: 0 10px 22px -8px color-mix(in srgb, var(--accent) 80%, transparent); }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 9px 14px; font-size: 13.5px; border-radius: 10px; }

/* ---- Intro mínima: badge + h1 discreto, la demo es la protagonista ---- */
.intro { text-align: center; padding: 22px 20px 0; }
.intro h1 { font-family: var(--font-body); font-size: clamp(14px, 1.8vw, 16px); font-weight: 600; color: var(--muted); letter-spacing: 0; margin-top: 10px; }

/* ---- Consola demo ---- */
.console { padding: 18px 0 30px; }
.start-here { display: flex; flex-direction: column; align-items: center; gap: 3px; max-width: 430px; margin: 0 0 10px; text-align: center; overflow: hidden; max-height: 200px; transition: opacity 0.5s ease, max-height 0.6s ease 0.15s, margin 0.6s ease 0.15s; }
.start-here.hide { opacity: 0; max-height: 0; margin-bottom: 0; pointer-events: none; }
.start-here b { font-family: var(--font-display); font-size: clamp(26px, 3.6vw, 34px); color: var(--ink); }
.start-here span { color: var(--muted); font-size: 14px; }
.start-here svg { margin-top: 4px; color: var(--accent); animation: bounce 1.6s ease-in-out infinite; }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(10px); } }
.console-grid { display: grid; grid-template-columns: minmax(330px, 430px) minmax(0, 1fr); gap: 22px; align-items: start; }
.phone-col { min-width: 0; }

/* Cartas de datos bajo el chat */
.statcards { display: grid; gap: 10px; margin-top: 16px; }
.statcard { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 13px 16px; }
.statcard b { font-family: var(--font-display); font-size: 26px; color: var(--accent); min-width: 76px; text-align: center; flex-shrink: 0; }
.statcard span { font-size: 13px; color: var(--muted); line-height: 1.4; }
.statcard small { display: block; font-size: 10.5px; color: color-mix(in srgb, var(--muted) 65%, transparent); margin-top: 2px; }

/* Teléfono */
.phone { border: 1px solid var(--line); border-radius: 26px; overflow: hidden; background: #efe7db; box-shadow: 0 24px 60px -30px rgb(0 0 0 / 0.35); }
.wa-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: #075e54; color: #fff; }
.wa-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; flex-shrink: 0; }
.wa-head .who { min-width: 0; flex: 1; }
.wa-head .who b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-head .who span { font-size: 12px; opacity: 0.75; }
.wa-reset { background: rgb(255 255 255 / 0.12); border: 0; color: #fff; border-radius: 99px; padding: 6px 12px; font-size: 12px; }
.wa-reset:hover { background: rgb(255 255 255 / 0.22); }
.thread { height: 430px; overflow-y: auto; padding: 16px 12px; background: #efe7db url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23000000' fill-opacity='0.035'%3E%3Ccircle cx='7' cy='7' r='1.5'/%3E%3Ccircle cx='37' cy='23' r='1.5'/%3E%3Ccircle cx='17' cy='47' r='1.5'/%3E%3Ccircle cx='51' cy='51' r='1.5'/%3E%3C/g%3E%3C/svg%3E"); display: flex; flex-direction: column; gap: 7px; }
.msg { max-width: 84%; padding: 8px 12px; border-radius: 12px; font-size: 14.5px; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; box-shadow: 0 1px 1px rgb(0 0 0 / 0.08); animation: pop 0.22s ease; position: relative; }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } }
.msg.bot { align-self: flex-start; background: #fff; border-bottom-left-radius: 4px; color: #111; }
.msg.user { align-self: flex-end; background: #d9fdd3; border-bottom-right-radius: 4px; color: #111; }
.msg time { display: block; font-size: 10px; color: rgb(0 0 0 / 0.4); text-align: right; margin-top: 3px; }
.typing { align-self: flex-start; background: #fff; border-radius: 12px; padding: 12px 16px; display: flex; gap: 4px; box-shadow: 0 1px 1px rgb(0 0 0 / 0.08); }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: #9ca3af; animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: 0.18s; }
.typing i:nth-child(3) { animation-delay: 0.36s; }
@keyframes blink { 0%, 70%, 100% { opacity: 0.3; } 35% { opacity: 1; } }
.sys-note { align-self: center; font-size: 11.5px; color: #5b5346; background: rgb(255 255 255 / 0.72); padding: 4px 12px; border-radius: 99px; text-align: center; }

/* Overlay de inicio */
.starter { display: flex; flex-direction: column; gap: 10px; background: rgb(255 255 255 / 0.94); border-radius: 16px; padding: 18px; margin: auto 6px; box-shadow: 0 10px 30px -12px rgb(0 0 0 / 0.25); }
.starter h3 { font-size: 16px; }
.starter p { font-size: 13px; color: #57534e; }
.starter label { font-size: 12px; font-weight: 600; color: #44403c; display: grid; gap: 5px; }
.starter input { height: 40px; border: 1px solid #d6d3d1; border-radius: 10px; padding: 0 12px; font: inherit; font-size: 14px; outline: none; }
.starter input:focus { border-color: var(--accent); }
.starter .btn { width: 100%; }
.starter .alt { background: transparent; border: 1px solid #d6d3d1; color: #44403c; }

/* Chips */
.chips-zone { background: #f6f2ea; border-top: 1px solid #e3ddd0; padding: 8px 10px 4px; }
.chips-label { font-size: 10.5px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: #8a8378; padding: 0 4px 4px; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.chip { flex-shrink: 0; border: 1px solid #d9d2c3; background: #fff; color: #44403c; border-radius: 99px; padding: 6px 12px; font-size: 12.5px; transition: border-color 0.15s, color 0.15s; }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.composer { display: flex; gap: 8px; padding: 8px 10px 12px; background: #f6f2ea; }
.composer input { flex: 1; min-width: 0; height: 44px; border: 1px solid #ddd6c8; border-radius: 99px; padding: 0 16px; font: inherit; font-size: 14.5px; background: #fff; outline: none; }
.composer input:focus { border-color: var(--accent); }
.composer button { width: 44px; height: 44px; flex-shrink: 0; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: 17px; }
.composer button:disabled { opacity: 0.45; cursor: default; }

/* ---- Rail derecho ---- */
.rail { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px; min-width: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.panel-head h3 { font-size: 15px; }
.panel-head .live { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.live.on i { background: #22c55e; box-shadow: 0 0 0 4px rgb(34 197 94 / 0.15); }
.panel.span2 { grid-column: 1 / -1; }
.panel-sub { font-size: 12px; color: var(--muted); margin: -8px 0 12px; }

/* Calendario */
.cal { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 8px; }
.cal-day { min-width: 0; }
.cal-day h4 { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); text-align: center; margin: 0 0 6px; font-family: var(--font-body); }
.cal-day h4 b { display: block; font-size: 15px; color: var(--ink); }
.slots { display: grid; gap: 5px; }
.slot { font-size: 11.5px; text-align: center; border-radius: 8px; padding: 5px 2px; border: 1px solid var(--line); color: var(--ink); background: var(--surface); font-variant-numeric: tabular-nums; }
.slot.taken { color: color-mix(in srgb, var(--muted) 55%, transparent); background: color-mix(in srgb, var(--muted) 8%, transparent); border-color: transparent; text-decoration: line-through; }
.slot.free { border-color: color-mix(in srgb, var(--accent) 40%, transparent); color: var(--accent); font-weight: 600; }
.slot.booked { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; animation: bookpulse 0.9s ease; }
@keyframes bookpulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); } 100% { box-shadow: 0 0 0 14px transparent; } }
.cal-closed { font-size: 11px; color: var(--muted); text-align: center; padding: 6px 0; }

/* Ficha CRM */
.stagebar { display: flex; gap: 4px; margin-bottom: 12px; }
.stage { flex: 1; text-align: center; font-size: 10px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); border-top: 3px solid var(--line); padding-top: 5px; }
.stage.on { color: var(--accent); border-top-color: var(--accent); }
.kv { display: grid; grid-template-columns: 42% 1fr; gap: 6px 10px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; min-width: 0; overflow-wrap: break-word; }
.kv dd:empty::after, .kv dd.empty::after { content: "—"; color: var(--line); font-weight: 400; }
.flags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.flag { font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; padding: 3px 9px; border-radius: 99px; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.flag.warn { background: #fef3c7; color: #92400e; }
.resumen { margin-top: 12px; font-size: 12.5px; background: var(--accent-soft); border-left: 3px solid var(--accent); padding: 9px 12px; border-radius: 0 10px 10px 0; color: var(--ink); }
.resumen b { display: block; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin-bottom: 3px; }

/* Conocimiento */
.know { display: grid; gap: 4px; max-height: 300px; overflow-y: auto; scrollbar-width: thin; }
.know-row { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; padding: 6px 9px; border-radius: 8px; transition: background 0.3s; }
.know-row span { color: var(--muted); }
.know-row b { white-space: nowrap; font-variant-numeric: tabular-nums; }
.know-row.hit { background: var(--accent-soft); outline: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); animation: pop 0.3s ease; }
.know-row.hit span { color: var(--ink); font-weight: 600; }
.know-note { font-size: 11px; color: var(--muted); margin-top: 10px; }

/* Ops feed */
.ops { display: grid; gap: 0; max-height: 260px; overflow-y: auto; scrollbar-width: thin; }
.op { display: flex; gap: 10px; padding: 7px 2px; font-size: 12.5px; animation: pop 0.28s ease; border-bottom: 1px dashed color-mix(in srgb, var(--line) 60%, transparent); }
.op:last-child { border-bottom: 0; }
.op i { flex-shrink: 0; width: 22px; height: 22px; border-radius: 7px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-style: normal; font-size: 11px; }
.op .t { color: var(--muted); font-size: 10.5px; font-variant-numeric: tabular-nums; margin-left: auto; flex-shrink: 0; }
.ops-empty { font-size: 12.5px; color: var(--muted); padding: 8px 2px; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(80px); background: var(--ink); color: var(--bg); font-size: 13.5px; font-weight: 600; padding: 11px 20px; border-radius: 12px; box-shadow: 0 16px 40px -12px rgb(0 0 0 / 0.4); transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2); z-index: 90; max-width: min(92vw, 420px); text-align: center; }
.toast.show { transform: translateX(-50%) translateY(0); }

/* ---- Secciones de venta ---- */
.explain { padding: 56px 0; border-top: 1px solid var(--line); }
.explain h2, .faq h2, .close h2 { font-size: clamp(24px, 3.4vw, 32px); text-align: center; }
.explain .lead { text-align: center; color: var(--muted); max-width: 620px; margin: 12px auto 34px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 22px; }
.step em { font-style: normal; font-family: var(--font-display); font-size: 26px; color: var(--accent); }
.step h3 { font-size: 16.5px; margin: 8px 0 8px; }
.step p { font-size: 14px; color: var(--muted); }

.faq { padding: 10px 0 56px; }
.faq .wrap { max-width: 760px; }
.faq h2 { margin-bottom: 26px; }
.faq details { border-bottom: 1px solid var(--line); padding: 4px 0; }
.faq summary { cursor: pointer; font-weight: 600; font-size: 15.5px; padding: 14px 0; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 20px; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { padding: 0 0 16px; color: var(--muted); font-size: 14.5px; }

.close { padding: 60px 0 70px; background: var(--close-bg, var(--surface)); border-top: 1px solid var(--line); text-align: center; }
.close .wrap { max-width: 720px; }
.close p.sub { color: var(--muted); margin: 14px auto 28px; max-width: 560px; }
.close .actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.made-by { margin-top: 34px; font-size: 12.5px; color: var(--muted); }
.made-by a { color: var(--accent); font-weight: 600; text-decoration: none; }
.made-by a:hover { text-decoration: underline; }

footer.fine { border-top: 1px solid var(--line); padding: 18px 0 26px; }
footer.fine .wrap { font-size: 11.5px; color: var(--muted); text-align: center; }

/* ---- Responsive ---- */
@media (max-width: 960px) {
  .console-grid { grid-template-columns: 1fr; }
  .phone { position: static; }
  .phone-col { max-width: 520px; margin: 0 auto; width: 100%; }
  .rail { max-width: 640px; margin: 0 auto; width: 100%; }
  .start-here { margin: 0 auto 10px; }
}
@media (max-width: 560px) {
  .rail { grid-template-columns: 1fr; }
  .thread { height: 380px; }
  .topbar .cta-mini { display: none; }
  .hero .wrap { padding: 46px 20px 38px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
