/* ============================================================
   QUIRÓN — LANDING PÚBLICA
   Capa pública separada de la app clínica.
   AUTOCONTENIDO a propósito: no importa design-system-v2.css
   porque ese archivo trae Google Fonts vía @import y la landing
   usa fuentes self-hosted. Los tokens de :root ESPEJAN los de
   design-system-v2.css — si aquel cambia, actualizar aquí.
   ============================================================ */

/* ── FUENTES SELF-HOSTED (woff2, subset latin) ── */
@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/fraunces-600-latin.woff2') format('woff2'); }
@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/fraunces-700-latin.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/inter-400-latin.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/inter-500-latin.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/inter-600-latin.woff2') format('woff2'); }
@font-face { font-family: 'Nunito'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/nunito-400-latin.woff2') format('woff2'); }
@font-face { font-family: 'Nunito'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/nunito-700-latin.woff2') format('woff2'); }
@font-face { font-family: 'Nunito'; font-style: normal; font-weight: 800; font-display: swap; src: url('/fonts/nunito-800-latin.woff2') format('woff2'); }

:root {
  /* Tokens espejados de design-system-v2.css */
  --color-bg:            #F7F3EA;
  --color-surface:       #FFFFFF;
  --color-surface-warm:  #FBF8F1;
  --color-surface-rose:  #F5EDE9;
  --color-text:          #10213D;
  --color-text-soft:     #6E7A8E;
  --color-text-faint:    #98A2B3;
  --color-border:        rgba(16, 33, 61, .12);
  --color-border-strong: rgba(16, 33, 61, .22);
  --color-primary:       #10213D;
  --color-primary-hover: #172F52;
  --color-primary-soft:  #EEF3F8;
  --color-on:            #1E88F5;   /* SOLO: CTA hero, submit form, momento Magia */
  --color-on-soft:       #EAF5FF;
  --color-accent:        #5B7E9F;
  --color-accent-soft:   #E7EEF4;
  --color-success:       #5F8A68;
  --color-success-soft:  #DFEBDF;
  --color-danger:        #B0524A;
  --color-danger-soft:   #F7E6E3;
  --tone-emotion:        #F1D1C8;
  --tone-emotion-deep:   #B96D61;
  --tone-reflection:     #DDE8EA;
  --tone-reflection-deep:#587278;
  --tone-action:         #DFEBDF;
  --tone-action-deep:    #5F8A68;
  --tone-learning:       #F2E6CF;
  --tone-learning-deep:  #B98935;
  --font-panel:   'Inter', system-ui, sans-serif;
  --font-patient: 'Nunito', system-ui, sans-serif;
  --font-display: 'Fraunces', Georgia, serif;
  --radius-xs: 8px; --radius-sm: 12px; --radius-md: 16px; --radius-lg: 22px; --radius-full: 999px;
  --shadow-1: 0 1px 2px rgba(16,33,61,.04), 0 4px 14px rgba(16,33,61,.05);
  --shadow-2: 0 2px 4px rgba(16,33,61,.05), 0 10px 28px rgba(16,33,61,.08);
  --shadow-3: 0 18px 44px rgba(16,33,61,.10);
  --shadow-focus: 0 0 0 4px rgba(91,126,159,.18);
  --shadow-on: 0 0 14px rgba(30,136,245,.30);
  --ease-premium: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 140ms; --dur-normal: 220ms; --dur-slow: 320ms;
}

/* ── BASE ── */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-panel);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--color-accent); }
:focus-visible { outline: none; box-shadow: var(--shadow-focus); border-radius: var(--radius-xs); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.icon { width: 20px; height: 20px; stroke-width: 1.75; flex-shrink: 0; }
.icon-sm { width: 16px; height: 16px; }

.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ── BOTONES ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 22px;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  font-family: inherit; font-size: 16px; font-weight: 600;
  text-decoration: none; cursor: pointer;
  transition: background var(--dur-fast) ease-out, transform var(--dur-fast) ease-out, box-shadow var(--dur-fast) ease-out;
}
.btn:active { transform: translateY(1px); }
.btn-on { background: var(--color-on); color: #fff; box-shadow: var(--shadow-on); }
.btn-on:hover { background: #1877DB; }
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-hover); }
.btn-ghost { background: transparent; color: var(--color-text); border-color: var(--color-border-strong); }
.btn-ghost:hover { background: var(--color-surface); }

/* ── HEADER ── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(247, 243, 234, .88);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; height: 60px;
}
/* Logo oficial — recorte real de quiron-logo-login-arena-azulhero.png
   (public/brand/landing/logo-wordmark-320.webp), generado por
   scripts/optimize-landing-assets.js. Nada dibujado ni inventado. */
.header-logo img { height: 28px; width: auto; }
.footer-logo img { height: 26px; width: auto; }
.header-nav { display: none; }
.header-actions { display: flex; align-items: center; gap: 14px; }
.header-login {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 8px 6px;
  font-size: 14px; font-weight: 500; color: var(--color-text-soft); text-decoration: none;
}
.header-login:hover { color: var(--color-text); }
.header-cta { min-height: 40px; padding: 8px 18px; font-size: 15px; }

/* ── HERO ── */
.hero { padding: 44px 0 0; overflow: hidden; }
.hero-inner { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; }
.badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--color-surface-warm); border: 1px solid var(--color-border);
  border-radius: var(--radius-full); padding: 6px 14px;
  font-size: 13px; font-weight: 500; color: var(--color-text-soft);
}
.badge::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: var(--color-success); flex-shrink: 0;
}
.hero h1 {
  margin: 0;
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(34px, 8.5vw, 58px);
  line-height: 1.12; letter-spacing: 0;
}
.hero-sub { margin: 0; font-size: 17px; color: var(--color-text-soft); max-width: 34em; }
.hero-ctas { display: flex; flex-direction: column; gap: 12px; width: 100%; }
.hero-ctas .btn { width: 100%; }
.hero-micro { margin: 0; font-size: 13px; color: var(--color-text-faint); }
.hero-figure { margin: 8px -20px 0; width: calc(100% + 40px); }
.hero-figure img { width: 100%; border-radius: var(--radius-md) var(--radius-md) 0 0; }

/* ── SECCIONES ── */
.section { padding: 56px 0; }
.section-eyebrow {
  font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--color-accent); margin: 0 0 10px;
}
.section-title {
  margin: 0 0 14px;
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(26px, 6vw, 40px); line-height: 1.15; letter-spacing: 0;
}
.section-lead { margin: 0 0 28px; font-size: 16px; color: var(--color-text-soft); max-width: 40em; }

/* ── PROBLEMA ── */
.problema { background: var(--color-surface-warm); border-top: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border); }
.problema-cards { display: grid; gap: 14px; }
.p-card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); padding: 20px; box-shadow: var(--shadow-1);
}
.p-card.tone-reflection { border-left: 3px solid var(--tone-reflection-deep); }
.p-card.tone-emotion    { border-left: 3px solid var(--tone-emotion-deep); }
.p-card.tone-learning   { border-left: 3px solid var(--tone-learning-deep); }
.p-card h3 { margin: 0 0 6px; font-size: 17px; font-weight: 600; }
.p-card p { margin: 0; font-size: 15px; color: var(--color-text-soft); }

/* ── CIRCUITO (cómo funciona) ── */
.circuito-steps { display: grid; gap: 0; }
.c-step { display: flex; gap: 16px; position: relative; padding-bottom: 26px; }
.c-step:last-child { padding-bottom: 0; }
.c-step::before {
  content: ''; position: absolute; left: 21px; top: 48px; bottom: 4px;
  border-left: 2px dotted var(--color-border-strong);
}
.c-step:last-child::before { display: none; }
.c-num {
  width: 44px; height: 44px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: var(--radius-sm);
  font-family: var(--font-display); font-size: 20px; font-weight: 600;
}
.c-step.tone-reflection .c-num { background: var(--tone-reflection); color: var(--tone-reflection-deep); }
.c-step.tone-action     .c-num { background: var(--tone-action);     color: var(--tone-action-deep); }
.c-step.tone-emotion    .c-num { background: var(--tone-emotion);    color: var(--tone-emotion-deep); }
.c-step.tone-learning   .c-num { background: var(--tone-learning);   color: var(--tone-learning-deep); }
.c-step h3 { margin: 2px 0 4px; font-size: 17px; font-weight: 600; }
.c-step p { margin: 0; font-size: 15px; color: var(--color-text-soft); }

/* ── DEMO: "Así lo ve el paciente" ── */
.demo-section { background: var(--color-primary); color: #F4F7FB; }
.demo-section .section-eyebrow { color: #9DB8D6; }
.demo-section .section-title { color: #fff; }
.demo-section .section-lead { color: #B9C6D8; }
.demo-layout { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.demo-side { width: 100%; max-width: 100%; min-width: 0; }

/* Lista vertical (no carrusel): en mobile hay que entender de un vistazo que
   esto es "elegí una tarea", no un filtro que se desliza. Full-width, cada
   opción es un botón claro con estado activo bien marcado. */
.demo-tabs { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.demo-tab {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  min-height: 50px; padding: 13px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,.22);
  background: transparent; color: #C9D5E4;
  font-family: inherit; font-size: 15px; font-weight: 500; text-align: left;
  cursor: pointer;
  transition: background var(--dur-fast) ease-out, color var(--dur-fast) ease-out, border-color var(--dur-fast) ease-out;
}
.demo-tab[aria-selected="true"] { background: #fff; color: var(--color-text); border-color: #fff; font-weight: 700; }
.demo-tab .tab-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.tab-dot.emotion { background: var(--tone-emotion-deep); }
.tab-dot.reflection { background: var(--tone-reflection-deep); }
.tab-dot.action { background: var(--tone-action-deep); }
.tab-dot.learning { background: var(--tone-learning-deep); }

/* Mockup de celular — puro CSS */
.demo-phone {
  width: min(340px, 88vw);
  aspect-ratio: 9 / 18.5;
  background: #0B1830;
  border-radius: 42px;
  padding: 10px;
  box-shadow: var(--shadow-3), 0 0 0 1px rgba(255,255,255,.08);
  position: relative;
  flex-shrink: 0;
}
.demo-phone::after {
  /* notch */
  content: ''; position: absolute; top: 20px; left: 50%; transform: translateX(-50%);
  width: 88px; height: 22px; border-radius: var(--radius-full); background: #0B1830; z-index: 5;
}
.phone-screen {
  width: 100%; height: 100%;
  background: var(--color-bg);
  border-radius: 33px;
  overflow: hidden;
  display: flex; flex-direction: column;
  font-family: var(--font-patient);   /* fidelidad: la app paciente usa Nunito */
  cursor: pointer;
  position: relative;
}

/* Header de tarea — espejo de .task-header de paciente-v2 (44px, warm glass) */
.phone-header {
  flex-shrink: 0; height: 44px; margin-top: 30px;
  padding: 0 18px 0 14px;
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(251,248,241,.9);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--color-border);
}
.phone-header .ph-title {
  font-size: 13px; font-weight: 800; color: var(--color-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55%;
}
/* Progreso — espejo de .progress-mini */
.progress-mini { display: flex; align-items: center; gap: 4px; }
.progress-mini span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--color-border);
  transition: background var(--dur-normal) var(--ease-premium);
}
.progress-mini span.active { background: var(--color-primary); }
.progress-count { font-size: 11px; color: #888; margin-left: 6px; font-weight: 700; }

.phone-chat {
  flex: 1; overflow-y: auto; padding: 14px 12px 10px;
  display: flex; flex-direction: column;
  overscroll-behavior: contain;
}

/* Mensajes — espejo de .msg / .bubble de paciente-v2 */
.d-msg { display: flex; flex-direction: column; margin-top: 14px; }
.d-msg:first-child { margin-top: 0; }
.d-msg.system { align-items: flex-start; padding-right: 34px; animation: messageIn var(--dur-slow) var(--ease-premium); }
.d-msg.user   { align-items: flex-end;   padding-left: 34px;  animation: userIn var(--dur-normal) var(--ease-premium); }
@keyframes messageIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes userIn    { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.d-bubble {
  padding: 11px 14px; border-radius: 18px;
  font-size: 14px; line-height: 1.5;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  max-width: 100%;
}
.d-msg.system .d-bubble {
  background: var(--color-surface); border: 1px solid rgba(0,0,0,.05);
  border-radius: 22px 22px 22px 8px;
  color: var(--color-text);
}
.d-msg.user .d-bubble {
  background: var(--color-primary); color: #fff;
  border-radius: 22px 22px 8px 22px;
  padding: 10px 14px;
}

/* Typing — espejo de .typing-indicator */
.typing-indicator {
  display: flex; align-items: center; gap: 5px;
  padding: 12px 15px;
  background: var(--color-surface); border: 1px solid rgba(0,0,0,.05);
  border-radius: 22px 22px 22px 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.typing-indicator span {
  width: 7px; height: 7px; border-radius: 50%; background: #CBD5E0;
  animation: typingDot 1.2s ease-in-out infinite;
}
.typing-indicator span:nth-child(2) { animation-delay: .2s; }
.typing-indicator span:nth-child(3) { animation-delay: .4s; }
.typing-indicator em { margin-left: 5px; font-style: normal; font-size: 12px; color: #718096; font-weight: 700; }
@keyframes typingDot {
  0%, 60%, 100% { transform: translateY(0); background: #CBD5E0; }
  30% { transform: translateY(-5px); background: var(--color-primary); }
}

/* Step-card — espejo de .step-card / .sc-* */
.d-step-card {
  border-radius: 14px; overflow: hidden;
  box-shadow: 0 1px 5px rgba(0,0,0,0.08);
  animation: cardIn .22s ease;
  margin-top: 14px; flex-shrink: 0;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.d-sc-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 14px 8px;
  font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase;
}
.d-sc-header.tone-emotion    { background: var(--tone-emotion);    color: var(--tone-emotion-deep); }
.d-sc-header.tone-reflection { background: var(--tone-reflection); color: var(--tone-reflection-deep); }
.d-sc-header.tone-action     { background: var(--tone-action);     color: var(--tone-action-deep); }
.d-sc-header.tone-learning   { background: var(--tone-learning);   color: var(--tone-learning-deep); }
.d-sc-body { background: var(--color-surface); padding: 6px 14px 14px; }
.d-sc-question { font-size: 15px; font-weight: 800; color: #1a1a2e; line-height: 1.3; margin: 0 0 4px; }
.d-sc-instruction { font-size: 12px; color: #718096; line-height: 1.4; margin: 0; }

/* Elementos internos de step-card */
.d-check-row { display: flex; align-items: flex-start; gap: 9px; margin-top: 10px; font-size: 13px; color: var(--color-text); }
.d-check-box {
  width: 18px; height: 18px; border-radius: 5px; flex-shrink: 0; margin-top: 1px;
  border: 1.5px solid var(--color-border-strong); background: #fff;
  display: grid; place-items: center;
  transition: background var(--dur-fast) ease-out, border-color var(--dur-fast) ease-out;
}
.d-check-row.checked .d-check-box { background: var(--color-success); border-color: var(--color-success); }
.d-check-box svg { width: 12px; height: 12px; stroke: #fff; stroke-width: 3; opacity: 0; }
.d-check-row.checked .d-check-box svg { opacity: 1; }

.d-signature { margin-top: 12px; border: 1.5px dashed var(--color-border-strong); border-radius: 10px; background: #fff; padding: 6px 10px 2px; }
.d-signature svg { width: 100%; height: 56px; }
.d-signature .sig-path {
  fill: none; stroke: var(--color-text); stroke-width: 2; stroke-linecap: round;
  stroke-dasharray: 420; stroke-dashoffset: 420;
}
.d-signature.drawn .sig-path { animation: sigDraw 1.5s var(--ease-premium) forwards; }
@keyframes sigDraw { to { stroke-dashoffset: 0; } }
.d-sig-label { font-size: 10px; color: var(--color-text-faint); text-align: center; padding-bottom: 4px; }

/* Timer (pausa breve) */
.d-timer { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 0 4px; }
.d-timer-ring { width: 92px; height: 92px; transform: rotate(-90deg); }
.d-timer-ring .ring-bg { fill: none; stroke: var(--color-primary-soft); stroke-width: 7; }
.d-timer-ring .ring-fg {
  fill: none; stroke: var(--color-success); stroke-width: 7; stroke-linecap: round;
  stroke-dasharray: 264; stroke-dashoffset: 264;
}
.d-timer.running .ring-fg { animation: ringGo var(--timer-dur, 6s) linear forwards; }
@keyframes ringGo { to { stroke-dashoffset: 0; } }
.d-timer-time { font-size: 20px; font-weight: 800; color: var(--color-text); font-variant-numeric: tabular-nums; }
.d-timer-hint { font-size: 12px; color: var(--color-text-soft); }
.d-play-btn {
  width: 46px; height: 46px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--color-primary); color: #fff;
  display: grid; place-items: center;
}
.d-play-btn svg { width: 18px; height: 18px; margin-left: 2px; }

/* Descarga de recurso */
.d-file-row {
  display: flex; align-items: center; gap: 11px; margin-top: 12px;
  border: 1px solid var(--color-border); border-radius: 10px; padding: 10px 12px; background: #fff;
}
.d-file-icon {
  width: 38px; height: 38px; border-radius: 9px; flex-shrink: 0;
  background: var(--tone-learning); color: var(--tone-learning-deep);
  display: grid; place-items: center;
}
.d-file-icon svg { width: 18px; height: 18px; }
.d-file-name { font-size: 13px; font-weight: 700; color: var(--color-text); }
.d-file-size { font-size: 11px; color: var(--color-text-faint); }
.d-file-btn {
  margin-left: auto; flex-shrink: 0; border: none; cursor: pointer;
  min-height: 34px; padding: 7px 13px; border-radius: var(--radius-full);
  background: var(--color-primary); color: #fff; font-family: inherit; font-size: 12px; font-weight: 700;
  display: inline-flex; align-items: center; gap: 6px;
}
.d-file-btn.done { background: var(--color-success); }
.d-file-btn svg { width: 14px; height: 14px; }

/* Opciones — espejo de .option-btn (estilo Notion) */
.d-options { display: grid; gap: 8px; margin-top: 12px; }
.d-option {
  width: 100%; text-align: left; cursor: default;
  border: 1px solid var(--color-border); border-radius: 12px;
  background: #fff; color: var(--color-text);
  font-family: inherit; font-size: 13.5px; font-weight: 700;
  padding: 11px 13px;
  transition: border-color var(--dur-fast) ease-out, background var(--dur-fast) ease-out;
}
.d-option.selected { border-color: var(--color-primary); background: var(--color-primary-soft); }

/* Franja Magia — espejo de .magic-review-strip */
.magic-review-strip {
  background: #EBF4FF; border-top: 1px solid #BEE3F8;
  padding: 8px 12px; display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--color-text-soft);
  animation: cardIn .22s ease;
}
.magic-review-label { flex: 1; display: flex; align-items: center; gap: 6px; }
.magic-review-label svg { width: 14px; height: 14px; color: var(--color-on); flex-shrink: 0; }
.magic-accept-btn, .magic-discard-btn {
  padding: 5px 12px; border-radius: var(--radius-full); border: none;
  font-size: 12px; font-family: inherit; font-weight: 700; cursor: pointer; flex-shrink: 0;
}
.magic-accept-btn { background: var(--color-primary); color: #fff; }
.magic-discard-btn { background: #E2E8F0; color: var(--color-text); }

/* Input bar — espejo de .input-bar */
.phone-input {
  flex-shrink: 0;
  background: var(--color-surface); border-top: 1px solid var(--color-border);
  padding: 9px 12px 12px;
  display: flex; align-items: flex-end; gap: 8px;
}
.phone-input .pi-field {
  flex: 1; min-height: 38px; max-height: 76px; overflow: hidden;
  border: 1px solid var(--color-border); border-radius: 19px;
  background: var(--color-bg);
  padding: 9px 13px; font-size: 14px; line-height: 1.4; color: var(--color-text);
  white-space: pre-wrap; word-break: break-word;
}
.phone-input .pi-field:empty::before { content: attr(data-placeholder); color: var(--color-text-faint); }
.pi-field .caret {
  display: inline-block; width: 1.5px; height: 1.05em; background: var(--color-text);
  vertical-align: text-bottom; margin-left: 1px;
  animation: caretBlink 1s steps(1) infinite;
}
@keyframes caretBlink { 50% { opacity: 0; } }
.d-send-btn {
  width: 40px; height: 40px; border-radius: 50%; border: none; flex-shrink: 0;
  background: var(--color-primary); color: #fff; cursor: pointer;
  display: grid; place-items: center;
  transition: background var(--dur-fast) ease-out;
}
.d-send-btn.disabled { background: #CBD5E0; }
.d-send-btn svg { width: 17px; height: 17px; }

/* Confeti final sobrio: chip de completado */
.d-done-chip {
  align-self: center; margin-top: 16px;
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--color-success-soft); color: var(--color-success);
  border-radius: var(--radius-full); padding: 7px 15px;
  font-size: 13px; font-weight: 800;
  animation: cardIn .3s var(--ease-premium);
}
.d-done-chip svg { width: 15px; height: 15px; }

/* Controles bajo el teléfono */
.demo-controls { display: flex; align-items: center; gap: 14px; }
.demo-replay {
  display: inline-flex; align-items: center; gap: 7px;
  background: transparent; border: 1px solid rgba(255,255,255,.28); color: #C9D5E4;
  border-radius: var(--radius-full); min-height: 42px; padding: 9px 18px;
  font-family: inherit; font-size: 14px; font-weight: 500; cursor: pointer;
}
.demo-replay:hover { background: rgba(255,255,255,.08); }
.demo-replay svg { width: 15px; height: 15px; }
.demo-note { margin: 0; font-size: 13px; color: #8FA3BC; text-align: center; max-width: 32em; }

/* ── BENTO "Qué incluye Quirón hoy" ── */
/* align-items:start — sin esto, un card normal comparte fila con un .tall (2 filas)
   y CSS Grid lo estira para llenar esa altura, dejando un hueco vacío debajo del texto. */
.bento-grid { display: grid; gap: 14px; grid-template-columns: 1fr; align-items: start; }
.b-card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); padding: 22px; box-shadow: var(--shadow-1);
  display: flex; flex-direction: column; gap: 10px; align-items: flex-start;
}
.b-card.featured { background: var(--color-surface-warm); border-color: var(--color-border-strong); }
.b-icon {
  width: 44px; height: 44px; border-radius: var(--radius-sm);
  display: grid; place-items: center;
}
.b-icon svg { width: 21px; height: 21px; }
.b-icon.tone-emotion    { background: var(--tone-emotion);    color: var(--tone-emotion-deep); }
.b-icon.tone-reflection { background: var(--tone-reflection); color: var(--tone-reflection-deep); }
.b-icon.tone-action     { background: var(--tone-action);     color: var(--tone-action-deep); }
.b-icon.tone-learning   { background: var(--tone-learning);   color: var(--tone-learning-deep); }
.b-icon.tone-on         { background: var(--color-on-soft);   color: var(--color-on); }
.b-card h3 { margin: 0; font-size: 17px; font-weight: 600; }
.b-card p { margin: 0; font-size: 14.5px; color: var(--color-text-soft); }
.bento-note { margin: 22px 0 0; font-size: 14px; color: var(--color-text-soft); }

/* ── VIDEOS (oculta hasta tener links reales) ── */
.videos-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
.v-card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-1);
}
.v-thumb { position: relative; aspect-ratio: 16 / 9; background: var(--color-primary-soft); cursor: pointer; border: none; padding: 0; width: 100%; display: block; }
.v-thumb img { width: 100%; height: 100%; object-fit: cover; }
.v-thumb .v-play {
  position: absolute; inset: 0; margin: auto;
  width: 56px; height: 56px; border-radius: 50%;
  background: rgba(16,33,61,.85); color: #fff;
  display: grid; place-items: center;
}
.v-play svg { width: 22px; height: 22px; margin-left: 3px; }
.v-card iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; display: block; }
.v-body { padding: 16px 18px 18px; }
.v-body h3 { margin: 0 0 5px; font-size: 16px; font-weight: 600; }
.v-body p { margin: 0; font-size: 14px; color: var(--color-text-soft); }

/* ── FUNDADORES ── */
.fundadores { background: var(--color-surface-warm); border-top: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border); }
.f-card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-2);
  padding: 26px 22px; display: grid; gap: 24px;
}
.f-col h3 { margin: 0 0 12px; font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.f-col h3 svg { width: 18px; height: 18px; color: var(--color-accent); }
.f-col ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.f-col li { display: flex; gap: 10px; font-size: 15px; color: var(--color-text-soft); }
.f-col li svg { width: 17px; height: 17px; margin-top: 2px; color: var(--color-success); flex-shrink: 0; }
.f-firma { margin: 4px 0 0; font-size: 14.5px; color: var(--color-text-soft); font-style: italic; }
.f-cta { margin-top: 26px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }

/* ── FORMULARIO ── */
.form-card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-2);
  padding: 26px 20px; max-width: 560px;
}
.form-grid { display: grid; gap: 16px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.field label .opt { font-weight: 400; color: var(--color-text-faint); }
.field input, .field select, .field textarea {
  width: 100%; font-family: inherit; font-size: 16px; color: var(--color-text);
  background: var(--color-surface-warm);
  border: 1px solid var(--color-border-strong); border-radius: var(--radius-xs);
  padding: 12px 14px; min-height: 48px;
}
.field textarea { resize: vertical; min-height: 92px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; box-shadow: var(--shadow-focus); border-color: var(--color-accent); }
.field .field-error { display: none; margin: 6px 0 0; font-size: 13px; color: var(--color-danger); }
.field.has-error input { border-color: var(--color-danger); }
.field.has-error .field-error { display: block; }
/* honeypot: invisible para humanos sin desplazar el layout horizontal */
.hp-field { position: absolute; inset: auto; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.form-submit { width: 100%; margin-top: 4px; }
.form-privacy { margin: 14px 0 0; font-size: 12.5px; color: var(--color-text-faint); line-height: 1.5; }
.form-status { margin: 12px 0 0; font-size: 14px; display: none; }
.form-status.error { display: block; color: var(--color-danger); }
.form-success {
  display: none; text-align: center; padding: 18px 6px;
}
.form-success.visible { display: block; animation: cardIn .3s var(--ease-premium); }
.form-success .fs-icon {
  width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%;
  background: var(--color-success-soft); color: var(--color-success);
  display: grid; place-items: center;
}
.fs-icon svg { width: 26px; height: 26px; }
.form-success h3 { margin: 0 0 8px; font-family: var(--font-display); font-weight: 600; font-size: 22px; }
.form-success p { margin: 0; font-size: 15px; color: var(--color-text-soft); }

/* ── FOOTER ── */
.site-footer { padding: 44px 0 36px; border-top: 1px solid var(--color-border); }
.footer-inner { display: flex; flex-direction: column; gap: 18px; align-items: flex-start; }
.footer-tagline { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .42em; text-transform: uppercase; color: var(--color-text-soft); }
.footer-phrase { margin: 0; font-family: var(--font-display); font-size: 17px; color: var(--color-text); }
.footer-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13.5px; color: var(--color-text-faint); align-items: center; }
.footer-meta a { color: var(--color-text-soft); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.footer-meta a:hover { color: var(--color-text); }
.footer-meta a svg { width: 15px; height: 15px; }

/* ── REVEAL ON SCROLL ── */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .55s var(--ease-premium), transform .55s var(--ease-premium); }
.reveal.in { opacity: 1; transform: none; }

/* ── REDUCED MOTION ── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .d-msg.system, .d-msg.user, .d-step-card, .magic-review-strip, .d-done-chip { animation: none; }
  .typing-indicator span { animation: none; }
  .pi-field .caret { animation: none; }
  .d-signature.drawn .sig-path { animation: none; stroke-dashoffset: 0; }
  .d-timer.running .ring-fg { animation: none; stroke-dashoffset: 0; }
}

/* ── DESKTOP ── */
@media (min-width: 768px) {
  .header-nav { display: flex; gap: 4px; }
  .header-nav a {
    padding: 8px 14px; border-radius: var(--radius-full);
    font-size: 14px; font-weight: 500; color: var(--color-text-soft); text-decoration: none;
  }
  .header-nav a:hover { background: var(--color-surface); color: var(--color-text); }

  .hero { padding-top: 64px; }
  .hero-inner { flex-direction: row; align-items: center; gap: 48px; }
  .hero-copy { flex: 1 1 55%; display: flex; flex-direction: column; align-items: flex-start; gap: 20px; }
  .hero-figure { flex: 1 1 45%; margin: 0; width: auto; }
  .hero-figure img { border-radius: var(--radius-md); box-shadow: var(--shadow-2); }
  .hero-ctas { flex-direction: row; width: auto; }
  .hero-ctas .btn { width: auto; }

  .section { padding: 84px 0; }
  .problema-cards { grid-template-columns: repeat(3, 1fr); }

  .circuito-steps { grid-template-columns: repeat(4, 1fr); gap: 22px; }
  .c-step { flex-direction: column; padding-bottom: 0; }
  .c-step::before { left: 48px; right: -18px; top: 22px; bottom: auto; border-left: none; border-top: 2px dotted var(--color-border-strong); }

  .demo-layout { flex-direction: row; align-items: center; justify-content: center; gap: 48px; }
  .demo-side { display: flex; flex-direction: column; gap: 18px; max-width: 320px; }
  .demo-note { text-align: left; }

  .bento-grid { grid-template-columns: repeat(2, 1fr); }
  .b-card.featured { grid-column: span 2; }

  .videos-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
  .videos-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }

  .f-card { grid-template-columns: 1fr 1fr; padding: 34px 32px; }
  .form-card { padding: 34px 32px; }
  .form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
}

@media (min-width: 1024px) {
  .bento-grid { grid-template-columns: repeat(3, 1fr); grid-auto-flow: dense; }
  .b-card.featured { grid-column: span 2; }
}

/* ============================================================
   NUESTRO NOMBRE — historia de marca (nombre, símbolo, tagline)
   ============================================================ */
.nombre-inner { display: flex; flex-direction: column; gap: 32px; align-items: stretch; }
.nombre-copy { width: 100%; }
.nombre-body { display: flex; flex-direction: column; gap: 14px; }
.nombre-copy .nombre-body p,
.nombre-simbolo .nombre-body p {
  margin: 0; font-size: 15.5px; color: var(--color-text-soft); line-height: 1.65;
}
.nombre-simbolo {
  display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center;
  background: var(--color-surface-warm); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); padding: 28px 24px;
}
.ns-logo-img { height: auto; width: 220px; max-width: 100%; }
.nombre-simbolo .nombre-body { text-align: left; gap: 12px; }
.nombre-simbolo strong { color: var(--color-text); }
.ns-lines {
  padding-top: 10px; border-top: 1px solid var(--color-border);
  font-weight: 600; color: var(--color-text) !important; line-height: 1.8 !important;
}

@media (min-width: 1024px) {
  .nombre-inner { flex-direction: row; align-items: flex-start; gap: 48px; }
  .nombre-copy { flex: 1 1 56%; }
  .nombre-simbolo { flex: 1 1 44%; }
}

/* ============================================================
   TARJETAS FLIP — bento cards con video embebido
   Solo las tarjetas con data-video-slug pueden voltearse, y solo
   cuando landing.js encuentra un video real para ese slug (VIDEOS).
   Sin video real: la tarjeta queda estática, sin ningún affordance.
   ============================================================ */
.b-card.flip-card {
  padding: 0; perspective: 1400px; overflow: visible;
  position: relative; display: block;
}
.b-card.flip-card > .b-face-front {
  padding: 22px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start;
  height: 100%; position: relative;
}
.b-card.flip-card > .b-face-front,
.b-card.flip-card > .b-face-back {
  transition: transform .7s var(--ease-premium);
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  width: 100%; height: 100%;
}
.b-card.flip-card > .b-face-back {
  position: absolute; inset: 0; transform: rotateY(180deg);
  border-radius: var(--radius-md); background: #0B1830;
  display: flex; flex-direction: column;
}
.b-card.flip-card.has-video { cursor: pointer; }
.b-card.flip-card.has-video .b-face-front::after {
  content: ''; position: absolute; top: 14px; right: 14px;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--color-on); box-shadow: var(--shadow-on);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center; background-size: 13px;
}
.b-card.flip-card.flipped > .b-face-front { transform: rotateY(180deg); }
.b-card.flip-card.flipped > .b-face-back { transform: rotateY(0deg); }

.b-video-embed { flex: 1; background: #000; }
.b-video-embed iframe { width: 100%; height: 100%; border: 0; display: block; }
.b-card[data-orientation="vertical"] .b-video-embed { aspect-ratio: 9 / 16; }
.b-card[data-orientation="horizontal"] .b-video-embed { aspect-ratio: 16 / 9; }
.b-video-actions {
  flex-shrink: 0; display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 10px 12px; background: #0B1830;
}
.b-video-open {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 600; color: #DCE6F2; text-decoration: none;
}
.b-video-open:hover { color: #fff; }
.b-video-open svg { width: 14px; height: 14px; }
.b-flip-back {
  width: 30px; height: 30px; border-radius: 50%; border: 1px solid rgba(255,255,255,.25);
  background: transparent; color: #DCE6F2; cursor: pointer;
  display: grid; place-items: center; flex-shrink: 0;
}
.b-flip-back svg { width: 14px; height: 14px; }

@media (min-width: 768px) {
  /* align-self:stretch SOLO en .tall — hace que ocupe de verdad sus 2 filas
     (todo lo demás respeta el align-items:start del grid, sin estirarse). */
  .b-card.tall { grid-row: span 2; align-self: stretch; }
  .b-card.tall.flip-card > .b-face-front { min-height: 340px; justify-content: center; }
}

/* ============================================================
   POTENCIAL — dos grupos, taxonomía real de Biblioteca Clínica
   ============================================================ */
.potencial-groups { display: flex; flex-direction: column; gap: 22px; margin-top: 18px; }
.potencial-group-title {
  margin: 0 0 4px; font-size: 12.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; color: var(--color-text-faint);
}
.potencial-group-sub { margin: 0 0 12px; font-size: 14px; color: var(--color-text-soft); }
.potencial-groups .chips { margin: 0; }
.chip-dot.cat-psicoeducacion { background: #757575; }
.chip-dot.cat-emocional      { background: #E91E63; }
.chip-dot.cat-cognitivo      { background: #2196F3; }
.chip-dot.cat-conductual     { background: #4CAF50; }
.chip-dot.cat-reflexion      { background: #FF9800; }

/* Checklist de "Tipos de tarea" — a propósito NO son chips: con 10 items,
   una nube de píldoras se ve desordenada. El check + texto se lee como una
   lista de capacidades reales, escala bien y no compite con las herramientas. */
.tipo-tarea-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 11px; }
.tipo-tarea-list li { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; color: var(--color-text); }
.tt-check {
  width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0; margin-top: 1px;
  display: grid; place-items: center; color: #fff;
}
.tt-check svg { width: 12px; height: 12px; }
.tt-check.tt-psicoeducacion { background: #757575; }
.tt-check.tt-emocional      { background: #E91E63; }
.tt-check.tt-cognitivo      { background: #2196F3; }
.tt-check.tt-conductual     { background: #4CAF50; }
.tt-check.tt-reflexion      { background: #FF9800; }

@media (min-width: 600px) {
  .tipo-tarea-list { grid-template-columns: 1fr 1fr; column-gap: 24px; }
}

.bento-note svg { display: inline-block; vertical-align: -3px; margin: 0 2px; color: var(--color-on); }

/* ============================================================
   CONOCÉ QUIRÓN EN ACCIÓN — demo esquemática del flujo completo
   (escritorio → tarea → asignación → paciente → respuesta → sesión)
   Todo ficticio y esquemático; misma familia visual del sistema.
   ============================================================ */
.accion { background: var(--color-surface-warm); border-top: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border); }

.flow-demo { display: flex; flex-direction: column; gap: 14px; }
.flow-stage {
  position: relative; width: 100%; min-height: 400px;
  background: var(--color-primary-soft);
  border: 1px solid var(--color-border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-2);
  display: flex; flex-direction: column;
  cursor: pointer; overflow: hidden;
}
.flow-scene-area {
  flex: 1; display: grid; place-items: center;
  padding: 20px 14px; min-height: 0;
}
.fs-scene { width: 100%; max-width: 460px; animation: messageIn .4s var(--ease-premium); }
.fs-scene .a1 { animation: flowIn .5s var(--ease-premium) both; animation-delay: .15s; }
.fs-scene .a2 { animation: flowIn .5s var(--ease-premium) both; animation-delay: .75s; }
.fs-scene .a3 { animation: flowIn .5s var(--ease-premium) both; animation-delay: 1.5s; }
.fs-scene .a4 { animation: flowIn .5s var(--ease-premium) both; animation-delay: 2.1s; }
@keyframes flowIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Caption COMO PARTE del dispositivo: barra oscura pegada abajo del stage,
   nunca un párrafo suelto — así se lee como la narración de lo que se ve arriba. */
.flow-caption {
  flex-shrink: 0; margin: 0; padding: 14px 18px;
  background: var(--color-primary); color: #E7EDF5;
  font-size: 14.5px; line-height: 1.5;
  border-top: 1px solid rgba(255,255,255,.08);
}
.flow-caption strong { color: #fff; margin-right: 6px; }
.fc-num {
  display: inline-block; font-weight: 700; color: #fff; margin-right: 8px;
  font-size: 12px; font-variant-numeric: tabular-nums;
  background: rgba(255,255,255,.16); padding: 2px 8px; border-radius: var(--radius-full);
}
.fc-text { display: block; margin-top: 3px; color: #C9D5E4; }

.flow-rail-wrap { display: flex; flex-direction: column; gap: 10px; }
.flow-rail {
  display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.flow-rail::-webkit-scrollbar { display: none; }
.flow-step {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--color-border-strong); background: transparent; color: var(--color-text-soft);
  border-radius: var(--radius-full); min-height: 40px; padding: 6px 14px 6px 7px;
  font-family: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background var(--dur-fast) ease-out, color var(--dur-fast) ease-out;
}
.fs-num {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--color-surface); color: var(--color-text-soft);
  font-size: 12.5px; font-weight: 700;
}
.flow-step.active { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.flow-step.active .fs-num { background: rgba(255,255,255,.16); color: #fff; }
.flow-step.done .fs-num { background: var(--color-success-soft); color: var(--color-success); }
.flow-replay { align-self: flex-start; color: var(--color-text-soft); border-color: var(--color-border-strong); }
.flow-replay:hover { background: var(--color-surface); }

/* ── Ventana esquemática del panel ── */
.mini-window {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-2);
  font-family: var(--font-panel);
}
.mw-bar {
  display: flex; align-items: center; gap: 5px;
  padding: 8px 10px; background: var(--color-surface-warm);
  border-bottom: 1px solid var(--color-border);
}
.mw-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-border-strong); }
.mw-url { margin-left: 6px; font-size: 10px; color: var(--color-text-faint); }
/* Barra de tabs superior — espejo del header.quiron-topbar real (Biblioteca / Editor) */
.mw-tabbar { display: flex; gap: 4px; padding: 6px 10px 0; background: var(--color-surface-warm); }
.mw-tab { font-size: 9px; font-weight: 700; padding: 4px 9px; border-radius: 6px 6px 0 0; color: var(--color-text-faint); }
.mw-tab.active { background: var(--color-surface); color: var(--color-text); }
.mw-body { display: flex; min-height: 188px; }
.mw-side {
  width: 92px; flex-shrink: 0; border-right: 1px solid var(--color-border);
  background: var(--color-surface-warm); padding: 8px 7px;
  display: flex; flex-direction: column; gap: 5px;
}
/* Buscador + botón nuevo — espejo de .sidebar-header de index.html */
.mw-search {
  display: flex; align-items: center; gap: 5px;
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 6px;
  padding: 4px 6px; font-size: 8.5px; color: var(--color-text-faint);
}
.mw-search-dot { width: 6px; height: 6px; border-radius: 50%; border: 1.3px solid var(--color-text-faint); flex-shrink: 0; }
/* De-enfatizado a propósito: no es el foco de la narración, solo contexto de fondo */
.mw-newbtn {
  display: block; text-align: center; background: transparent; color: var(--color-text-faint);
  border: 1px dashed var(--color-border-strong);
  font-size: 8px; font-weight: 600; padding: 3px; border-radius: 6px; margin-bottom: 3px;
}
.mw-pat { padding: 5px 7px; border-radius: 7px; display: flex; flex-direction: column; gap: 1px; }
/* El paciente elegido SÍ debe resaltar — es el centro de la historia */
.mw-pat.active {
  background: var(--color-surface); box-shadow: 0 0 0 1.5px var(--color-on), var(--shadow-1);
}
.mw-pat.active .mw-pat-name::after {
  content: ''; display: inline-block; width: 5px; height: 5px; border-radius: 50%;
  background: var(--color-on); margin-left: 5px; vertical-align: middle;
}
.mw-pat-name { font-size: 9.5px; font-weight: 700; color: var(--color-text-faint); }
.mw-pat.active .mw-pat-name { color: var(--color-text); font-weight: 800; }
.mw-pat-dx { font-size: 8px; color: var(--color-text-faint); }
.mw-pat.active .mw-pat-dx { color: var(--color-text-soft); }
.mw-main { flex: 1; min-width: 0; padding: 10px 12px; position: relative; }
.mw-title {
  margin: 0 0 8px; font-size: 10px; font-weight: 700;
  letter-spacing: .07em; text-transform: uppercase; color: var(--color-text-soft);
}
/* Mini calendario semanal — espejo de .grilla/.sesion-chip de index.html */
.mw-cal { border: 1px solid var(--color-border); border-radius: 8px; overflow: hidden; }
.mw-cal-hdr, .mw-cal-row { display: grid; grid-template-columns: 20px repeat(5, 1fr); }
.mw-cal-hdr { background: var(--color-surface-warm); border-bottom: 1px solid var(--color-border); }
.mw-cal-hdr span { font-size: 7.5px; font-weight: 700; color: var(--color-text-faint); text-align: center; padding: 3px 0; }
.mw-cal-row { border-bottom: 1px solid rgba(16,33,61,.06); }
.mw-cal-h { font-size: 7px; color: var(--color-text-faint); text-align: right; padding: 6px 3px 6px 0; }
.mw-cal-cell { min-height: 20px; border-left: 1px solid rgba(16,33,61,.06); }
.mw-cal-cell.today { background: rgba(234,245,255,.5); }
.mw-cal-cell.busy { position: relative; }
.mw-cal-cell.busy::after {
  content: ''; position: absolute; inset: 2px; border-radius: 3px;
  background: var(--color-primary-soft); border-left: 2px solid var(--color-primary);
}
/* Categorías reales de la Biblioteca Clínica */
.mw-catpane { display: flex; flex-wrap: wrap; gap: 5px; }
.mw-cat-pill {
  font-size: 8px; font-weight: 700; padding: 3px 8px; border-radius: var(--radius-full);
  border: 1px solid transparent; opacity: .6;
}
.mw-cat-pill.active { opacity: 1; box-shadow: 0 0 0 1px currentColor inset; }
.mw-cat-pill.cat-psicoeducacion { background: #FAFAFA; color: #757575; }
.mw-cat-pill.cat-emocional      { background: #FFF0F4; color: #E91E63; }
.mw-cat-pill.cat-cognitivo      { background: #F0F7FF; color: #2196F3; }
.mw-cat-pill.cat-conductual     { background: #F3FFF5; color: #4CAF50; }
.mw-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 8px; }
.mw-task { position: relative; border: 1px solid var(--color-border); border-radius: 8px; overflow: hidden; background: var(--color-surface); }
.mwt-cat { display: block; font-size: 8.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; padding: 4px 8px; }
.mw-task.cat-psicoeducacion .mwt-cat { background: #FAFAFA; color: #757575; }
.mw-task.cat-emocional .mwt-cat      { background: #FFF0F4; color: #E91E63; }
.mw-task.cat-cognitivo .mwt-cat      { background: #F0F7FF; color: #2196F3; }
.mw-task.cat-conductual .mwt-cat     { background: #F3FFF5; color: #4CAF50; }
.mwt-name { display: block; font-size: 10.5px; font-weight: 600; color: var(--color-text); padding: 6px 8px 8px; line-height: 1.25; }
.mw-task.picked { box-shadow: 0 0 0 2px var(--color-accent); }
.mw-task.picked::after {
  content: '✓'; position: absolute; top: 4px; right: 5px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--color-accent); color: #fff;
  font-size: 9px; font-weight: 800; display: grid; place-items: center;
}
.mw-foot { margin-top: 9px; display: flex; justify-content: flex-end; }
.mw-btn {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--color-primary); color: #fff;
  font-size: 10px; font-weight: 700; padding: 6px 13px; border-radius: var(--radius-full);
}
.mw-btn svg { width: 11px; height: 11px; }
.mw-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 9.5px; font-weight: 800; padding: 4px 9px; border-radius: var(--radius-full);
}
.mw-chip.ok { background: var(--color-success-soft); color: var(--color-success); }
.mw-chip svg { width: 10px; height: 10px; }

/* Panel "Asignar para sesión" — espejo de .gst-assign real (Paciente/Frecuencia/Inicio) */
.mw-assign {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: 12px; box-shadow: var(--shadow-modal);
  padding: 12px; max-width: 250px; margin: 6px auto 0;
  display: flex; flex-direction: column; gap: 8px;
}
.mwa-title { margin: 0; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--color-text-soft); }
.mwa-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mwa-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mwa-row2 > div { display: flex; flex-direction: column; gap: 2px; }
.mwa-label { display: block; font-size: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--color-text-faint); }
.mwa-pill {
  font-size: 10px; font-weight: 700; color: var(--color-text);
  background: var(--color-primary-soft); padding: 3px 9px; border-radius: var(--radius-full);
}
.mwa-sel {
  font-size: 10px; font-weight: 600; color: var(--color-text);
  border: 1px solid var(--color-border-strong); border-radius: 6px; padding: 4px 7px;
}
.mwm-send { align-self: flex-end; margin-top: 2px; }
.mw-assign .mw-chip { align-self: flex-start; }
/* Pestañas + filtro de Historia Clínica — espejo de ficha.html */
.mw-hctabs { display: flex; gap: 12px; border-bottom: 1px solid var(--color-border); margin: 2px 0 8px; }
.mw-hctab { font-size: 9px; font-weight: 700; color: var(--color-text-faint); padding-bottom: 5px; }
.mw-hctab.active { color: var(--color-text); border-bottom: 2px solid var(--color-primary); }
.mw-hcfilter { display: flex; gap: 5px; margin-bottom: 8px; }
.mw-hcf { font-size: 8px; font-weight: 700; padding: 3px 9px; border-radius: var(--radius-full); border: 1px solid var(--color-border); color: var(--color-text-faint); }
.mw-hcf.active { background: var(--color-primary-soft); color: var(--color-primary); border-color: transparent; }

/* ── Teléfono esquemático (escena paciente) ── */
.mini-phone-frame {
  width: 192px; margin: 0 auto;
  background: #0B1830; border-radius: 26px; padding: 7px;
  box-shadow: var(--shadow-2);
}
.mp-screen {
  background: var(--color-bg); border-radius: 20px;
  padding: 12px 10px 14px; min-height: 208px;
  display: flex; flex-direction: column; gap: 8px;
  font-family: var(--font-patient);
}
.mp-notif {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: 9px; padding: 6px 9px; font-size: 9.5px; color: var(--color-text-soft);
  box-shadow: var(--shadow-1);
}
.mp-notif strong { color: var(--color-text); }
.mp-bubble {
  font-size: 10.5px; line-height: 1.45; padding: 7px 10px;
  max-width: 88%; box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.mp-bubble.sys {
  background: var(--color-surface); border: 1px solid rgba(0,0,0,.05);
  border-radius: 14px 14px 14px 5px; align-self: flex-start; color: var(--color-text);
}
.mp-bubble.usr {
  background: var(--color-primary); color: #fff;
  border-radius: 14px 14px 5px 14px; align-self: flex-end;
}
.mp-done { align-self: center; margin-top: 4px; }

/* ── Escenas: respuesta y evolución ── */
.mw-resp {
  border: 1px solid var(--color-border); border-radius: 10px;
  padding: 10px 11px; background: var(--color-surface);
  display: flex; flex-direction: column; gap: 6px;
}
.mwr-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 11px; color: var(--color-text); }
.mwr-meta { margin: 0; font-size: 9.5px; color: var(--color-text-faint); }
.mwr-quote {
  margin: 0; font-size: 10.5px; font-style: italic; line-height: 1.45; color: var(--color-text);
  background: var(--color-bg); border-left: 3px solid var(--tone-emotion-deep);
  padding: 6px 9px; border-radius: 0 8px 8px 0;
}
.mwr-tag {
  align-self: flex-start; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
  background: var(--tone-emotion); color: var(--tone-emotion-deep); padding: 3px 8px; border-radius: var(--radius-full);
}
.mw-hc {
  border: 1px solid var(--color-border); border-radius: 10px;
  padding: 12px; background: var(--color-surface);
  display: flex; flex-direction: column; gap: 7px; margin-top: 4px;
}
.mwh-title { margin: 0; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--color-text-soft); }
.mwh-line { height: 7px; border-radius: 4px; background: var(--color-primary-soft); }
.mwh-attach {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 4px;
  font-size: 9.5px; font-weight: 700;
  background: var(--color-success-soft); color: var(--color-success);
  padding: 4px 9px; border-radius: var(--radius-full);
}
.mwh-attach svg { width: 10px; height: 10px; }
.mwh-foot { margin: 0; font-size: 10px; color: var(--color-text-faint); }

/* ── Tarjetas secundarias ── */
.accion-cards { display: grid; gap: 14px; margin-top: 40px; }
.a-card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-1);
  padding: 18px; display: flex; flex-direction: column; gap: 10px;
}
.a-card h3 { margin: 4px 0 0; font-size: 17px; font-weight: 600; }
.a-card p { margin: 0; font-size: 14.5px; color: var(--color-text-soft); }
.a-cta {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 2px;
  font-size: 14.5px; font-weight: 600; color: var(--color-accent); text-decoration: none;
  min-height: 40px;
}
.a-cta:hover { color: var(--color-text); }
.mini-demo {
  background: var(--color-primary-soft); border-radius: 12px;
  padding: 16px 14px; min-height: 158px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
  overflow: hidden;
}
/* animaciones de mini-demos pausadas hasta entrar al viewport */
.mini-demo:not(.run) * { animation-play-state: paused !important; }

.mdp-phone {
  width: 186px; background: var(--color-bg); border: 1px solid var(--color-border);
  border-radius: 16px; padding: 11px 10px;
  display: flex; flex-direction: column; gap: 7px;
  font-family: var(--font-patient); box-shadow: var(--shadow-1);
}
.mdp-typing { align-self: flex-start; padding: 8px 11px; border-radius: 14px 14px 14px 5px; }
.mdp-typing span { width: 6px; height: 6px; }

.hc-card {
  width: 100%; max-width: 232px;
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 12px;
  padding: 12px 13px; display: flex; flex-direction: column; gap: 7px; box-shadow: var(--shadow-1);
}
.hc-title { margin: 0 0 2px; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--color-text-soft); }
.hc-row { display: flex; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 600; color: var(--color-text); opacity: .3; }
.hc-check {
  width: 15px; height: 15px; border-radius: 50%; flex-shrink: 0;
  background: var(--color-success-soft); color: var(--color-success);
  display: grid; place-items: center;
}
.hc-check svg { width: 9px; height: 9px; }
.hc-line { height: 6px; border-radius: 3px; background: var(--color-primary-soft); opacity: .3; }
.hc-line.l2 { width: 68%; }
.md-hc.run .hc-row, .md-hc.run .hc-line { animation: miniTick 7s infinite both; }
.md-hc.run .r1 { animation-delay: 0s; }
.md-hc.run .r2 { animation-delay: .8s; }
.md-hc.run .r3 { animation-delay: 1.6s; }
.md-hc.run .l1 { animation-delay: 2.4s; }
.md-hc.run .l2 { animation-delay: 2.7s; }
@keyframes miniTick {
  0% { opacity: .3; }
  8%, 82% { opacity: 1; }
  92%, 100% { opacity: .3; }
}

.md-editor { align-items: stretch; }
.ed-prompt {
  font-size: 11px; font-style: italic; color: var(--color-text); line-height: 1.4;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: 10px 10px 10px 4px; padding: 8px 11px; box-shadow: var(--shadow-1);
  opacity: .3;
}
.ed-step {
  display: flex; align-items: center; gap: 8px;
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 8px;
  padding: 6px 10px; font-size: 11px; font-weight: 600; color: var(--color-text);
  opacity: .3;
}
.ed-num {
  width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0;
  background: var(--color-accent-soft); color: var(--color-accent);
  font-size: 9.5px; font-weight: 800; display: grid; place-items: center;
}
.ed-preview {
  display: flex; align-items: center; gap: 6px; margin-top: 1px;
  font-size: 10.5px; font-weight: 800; color: var(--color-success);
  opacity: .3;
}
.ed-preview svg { width: 12px; height: 12px; }
.md-editor.run .ed-prompt, .md-editor.run .ed-step, .md-editor.run .ed-preview { animation: miniTick 8s infinite both; }
.md-editor.run .ed-prompt { animation-delay: 0s; }
.md-editor.run .s1 { animation-delay: .9s; }
.md-editor.run .s2 { animation-delay: 1.5s; }
.md-editor.run .s3 { animation-delay: 2.1s; }
.md-editor.run .ed-preview { animation-delay: 2.9s; }

/* ── Franja de potencial ── */
.potencial {
  margin-top: 44px;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-1);
  padding: 24px 20px;
}
.potencial-title { margin: 0 0 6px; font-family: var(--font-display); font-weight: 600; font-size: 22px; }
.potencial-lead { margin: 0; font-size: 14px; color: var(--color-text-soft); }
.chips { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--color-border); background: var(--color-surface-warm);
  border-radius: var(--radius-full); padding: 8px 14px;
  font-size: 13.5px; font-weight: 500; color: var(--color-text);
}
.chip svg { width: 14px; height: 14px; color: var(--color-text-soft); }
.chip-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.chip-dot.tone-emotion    { background: var(--tone-emotion-deep); }
.chip-dot.tone-reflection { background: var(--tone-reflection-deep); }
.chip-dot.tone-action     { background: var(--tone-action-deep); }
.chip-dot.tone-learning   { background: var(--tone-learning-deep); }

/* ── Reduced motion (sección en acción) ── */
@media (prefers-reduced-motion: reduce) {
  .fs-scene, .fs-scene .a1, .fs-scene .a2, .fs-scene .a3, .fs-scene .a4 { animation: none; opacity: 1; }
  .md-hc.run .hc-row, .md-hc.run .hc-line,
  .md-editor.run .ed-prompt, .md-editor.run .ed-step, .md-editor.run .ed-preview { animation: none; opacity: 1; }
  .mdp-typing span { animation: none; }
}

/* ── Desktop (sección en acción) ── */
@media (min-width: 768px) {
  .flow-demo {
    /* El stage domina el layout; el riel de pasos queda angosto y centrado
       verticalmente a su lado (no arrancando arriba, desconectado). */
    display: grid; grid-template-columns: minmax(0, 2.3fr) minmax(0, 200px);
    gap: 24px; align-items: center;
  }
  .flow-stage { min-height: 480px; }
  .flow-scene-area { padding: 32px; }
  .fs-scene { max-width: 560px; }
  .flow-rail { flex-direction: column; overflow: visible; padding: 0; }
  .flow-step { width: 100%; justify-content: flex-start; padding: 8px 12px 8px 6px; }
  .fs-num { width: 22px; height: 22px; font-size: 11.5px; }
  .flow-step .fs-label { font-size: 13px; }
  /* Masonry: la demo del paciente (flagship) ocupa columna izquierda a doble altura;
     historia clínica + editor IA se apilan a la derecha — tamaños distintos, no una grilla pareja. */
  .accion-cards { grid-template-columns: 1.15fr 1fr; grid-template-rows: repeat(2, auto); }
  .accion-cards > .a-card:first-child { grid-row: span 2; justify-content: center; }
  .accion-cards > .a-card:first-child .mini-demo { min-height: 220px; }
  .potencial { display: grid; grid-template-columns: 250px 1fr; gap: 28px; align-items: center; padding: 30px 28px; }
  .chips { margin: 0; }
}

