/* Sofía · estilo G — Klarna + Lifesum en colores MediSel.
   Solo presentación: los ids y clases que usa app.js se respetan tal cual. */

/* La palabra «MediSel» con la letra de su logo (Carlito, la gemela libre de Calibri); el archivo trae solo esas letras (3 KB). */
@font-face { font-family: 'MediSel Marca'; src: url(/medisel-palabra.woff2) format('woff2'); font-display: block; }

:root {
  --ink: #1A1220; --ink-2: #3E3644; --muted: #6B6272; --faint: #A39BA8;
  --line: #ECE7EF; --pill: #F1EDF4; --white: #FFFFFF; --chat-bg: #F6F3F8;
  --purple: #6F4886; --deep: #4E2F63; --magenta: #A349A4; --lilac: #EFE6F5;
  --leaf: #59A80F; --leaf-ink: #3D7A08; --leaf-soft: #EAF5DD; --lime: #8DD23C;
  --coral: #E9573B; --coral-ink: #B23A22; --coral-soft: #FDECE7; --amber: #9A6206; --amber-soft: #F8EDD5;
  --glass: rgba(255, 255, 255, .64); --glass-edge: rgba(255, 255, 255, .92);
  --shadow: 0 14px 34px rgba(78, 47, 99, .12); --shadow-sm: 0 6px 20px rgba(78, 47, 99, .10);
  --display: 'Archivo', 'Instrument Sans', system-ui, sans-serif;
  --body: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --brand: 'MediSel Marca', Carlito, Calibri, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --nav-space: calc(104px + env(safe-area-inset-bottom));
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: var(--white); color: var(--ink); font: 400 16px/1.45 var(--body); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
h1, h2, h3, p, figure, blockquote, ul { margin: 0; }
ul { padding: 0; list-style: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--purple); }
.hide { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { display: inline-block; width: 22px; height: 22px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.skip-link { position: fixed; top: -80px; left: 16px; z-index: 90; padding: 12px 18px; background: var(--white); border-radius: 999px; box-shadow: var(--shadow); }
.skip-link:focus { top: 12px; }
:focus-visible { outline: 3px solid rgba(111, 72, 134, .45); outline-offset: 2px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.err:empty { display: none; }
.err { margin-top: 12px; padding: 11px 14px; border-radius: 14px; background: var(--coral-soft); color: var(--coral-ink); font-size: 14px; }
.field-help, .fine { font-size: 13px; color: var(--muted); }

/* La marca: la hoja de MediSel dibujada con trazo. */
.brand-leaf, .splash-leaf, .leaf-mark svg { fill: none; stroke: currentColor; stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }

/* Lavado pastel de arriba (detrás de la cabecera y del inicio de cada pestaña). */
.wash { position: absolute; inset: 0 0 auto; height: 470px; z-index: 0; pointer-events: none;
  background:
    radial-gradient(120% 70% at 0% 0%, #CDB6E6 0%, rgba(205, 182, 230, 0) 60%),
    radial-gradient(90% 60% at 100% 8%, #EDBFE4 0%, rgba(237, 191, 228, 0) 62%),
    radial-gradient(80% 50% at 72% 62%, #DDF0C6 0%, rgba(221, 240, 198, 0) 70%),
    linear-gradient(180deg, #E4D9EE 0%, #FFFFFF 94%); }

/* ---------- botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border: 0; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 600; font-size: 16px; text-decoration: none; transition: transform .12s var(--ease), opacity .15s, background .15s; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .4; cursor: default; transform: none; }
.btn.verde { background: var(--ink); }
.btn.sec { background: var(--pill); color: var(--ink); }
.btn.linea { background: var(--white); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn.peligro { background: var(--white); color: var(--coral-ink); box-shadow: inset 0 0 0 1.5px #F2C3B8; }
.btn.full { width: 100%; }
.btn.big { min-height: 58px; font-size: 17px; }
.btn .icon { width: 20px; height: 20px; }
.link { padding: 0; border: 0; background: none; color: var(--purple); font-size: 16px; font-weight: 500; }
.round { width: 44px; height: 44px; border: 0; border-radius: 50%; display: grid; place-items: center; background: var(--white); box-shadow: var(--shadow-sm); flex: none; }
.pill-btn { height: 36px; padding: 0 14px; border: 0; border-radius: 18px; background: var(--pill); font-size: 14px; font-weight: 600; white-space: nowrap; }

/* ---------- campos ---------- */
main label:not([class]), .sv-l, .range-label { display: block; margin: 18px 0 7px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
input[type=text], input[type=tel], input[type=email], input[type=password], input[type=number], input[type=search], textarea {
  width: 100%; height: 54px; padding: 0 16px; border: 1.5px solid var(--line); border-radius: 16px; background: var(--white); font-size: 17px;
  transition: border-color .15s, box-shadow .15s; -webkit-appearance: none; appearance: none; }
textarea { height: auto; min-height: 112px; padding: 14px 16px; line-height: 1.45; resize: vertical; }
input::placeholder, textarea::placeholder { color: #ADA5B3; }
input:focus, textarea:focus { outline: none; border-color: var(--purple); box-shadow: 0 0 0 4px rgba(111, 72, 134, .12); }

/* ---------- cabecera ---------- */
.app-page > .top { position: relative; z-index: 2; display: flex; align-items: center; gap: 10px; max-width: 560px; margin: 0 auto; padding: calc(14px + env(safe-area-inset-top)) 20px 0; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--deep); }
.brand-leaf { width: 28px; height: 28px; color: var(--leaf); }
.brand-w { font: 400 26px/1 var(--brand); color: var(--magenta); }
.sp { flex: 1; }
.badge { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 14px; border-radius: 16px; background: rgba(255, 255, 255, .78); box-shadow: var(--shadow-sm); font-size: 13px; font-weight: 600; white-space: nowrap; }
.badge:empty { display: none; }
.badge.ok::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--leaf); animation: pulse 2s infinite; }

/* ---------- estructura ---------- */
main#mainContent { position: relative; z-index: 1; max-width: 560px; margin: 0 auto; padding-bottom: var(--nav-space); outline: none; }
section[data-tab] { animation: tabIn .32s var(--ease) both; }
.hello { padding: 22px 20px 0; }
.hello h1 { font-family: var(--display); font-stretch: 68%; font-weight: 800; font-size: 50px; line-height: .95; letter-spacing: -.005em; }
.hello p { margin-top: 10px; color: var(--muted); font-size: 16px; max-width: 34ch; }
.row-h { display: flex; align-items: center; justify-content: space-between; }
.block { margin-top: 30px; padding: 0 20px; }
.block-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.block-h h2, .block-t { font-size: 22px; font-weight: 700; letter-spacing: -.015em; }
.block-t { margin-bottom: 12px; }
.card { padding: 6px 18px 18px; border-radius: 24px; background: var(--white); border: 1px solid var(--line); }

.demo-bar { position: relative; z-index: 2; display: flex; align-items: center; gap: 12px; margin: 14px 16px 0; padding: 12px 12px 12px 18px; border-radius: 22px; background: var(--ink); color: #fff; font-size: 14px; }
.demo-bar .btn { margin-left: auto; min-height: 38px; padding: 0 14px; background: #fff; color: var(--ink); font-size: 13px; white-space: nowrap; }

/* ---------- inicio ---------- */
.home-hello h1 { font: 700 34px/1.08 var(--body); letter-spacing: -.025em; font-stretch: normal; max-width: 12ch; }
.home-hello p { font-size: 17px; }
body.sofia-on #status::before { content: ''; display: inline-block; width: 9px; height: 9px; margin-right: 9px; border-radius: 50%; background: var(--leaf); vertical-align: 1px; animation: pulse 2s infinite; }

.ask { display: flex; align-items: center; gap: 12px; width: calc(100% - 32px); height: 56px; margin: 20px 16px 0; padding: 0 20px; border: 0; border-radius: 28px; background: var(--white); box-shadow: var(--shadow-sm); color: var(--muted); font-size: 17px; text-align: left; }
.ask .icon { color: var(--magenta); }

.stats { display: flex; gap: 12px; overflow-x: auto; padding: 18px 16px 26px; scroll-snap-type: x mandatory; scroll-padding: 16px; scrollbar-width: none; }
.stats::-webkit-scrollbar { display: none; }
.stat { flex: none; display: flex; flex-direction: column; align-items: flex-start; width: 212px; min-height: 200px; padding: 18px 18px 16px; border-radius: 28px; text-align: left; scroll-snap-align: start;
  background: var(--glass); backdrop-filter: blur(22px) saturate(170%); -webkit-backdrop-filter: blur(22px) saturate(170%); border: 1px solid var(--glass-edge); box-shadow: var(--shadow); color: var(--ink); }
button.stat { cursor: pointer; transition: transform .15s var(--ease); }
button.stat:active { transform: scale(.98); }
.stat-ic { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--white); margin-bottom: auto; }
.stat-ic .icon { width: 22px; height: 22px; }
.live-ic i { width: 11px; height: 11px; border-radius: 50%; background: var(--faint); }
body.sofia-on .live-ic i { background: var(--leaf); animation: pulse 2s infinite; }
.stat-l { margin-top: 26px; color: var(--muted); font-size: 15px; }
.stat-n { font-family: var(--display); font-stretch: 68%; font-weight: 800; font-size: 58px; line-height: 1; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.stat-f { margin-top: 4px; font-size: 15px; color: var(--leaf-ink); }
.stat-f.warn { color: var(--coral-ink); }

/* El doctor nuevo ve primero cómo dejar lista a Sofía (sin tarjetas en cero). */
body.is-new .stats, body.is-new .ask { display: none; }
body.is-new .home-hello { padding-bottom: 6px; }

/* Lo que te necesita y las citas por confirmar (los arma ui.js con datos reales). */
.home-ok { display: flex; align-items: center; gap: 12px; padding: 14px 0; color: var(--muted); }
.home-ok .icon { width: 20px; height: 20px; color: var(--leaf-ink); }

/* La tarjeta para dejar lista a Sofía. */
/* Encabezado suelto (título + avance) y, debajo, un widget por tema: no un solo bloque enorme. */
.setup-wrap { display: grid; gap: 12px; }
.setup-head { padding: 0 4px; }
.widget { padding: 14px 18px 4px; border-radius: 26px; background: var(--white); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.widget-h { display: flex; align-items: center; justify-content: space-between; margin: 2px 0 2px; font-size: 15px; font-weight: 700; }
.widget-h .count { padding: 2px 9px; border-radius: 10px; background: var(--pill); font-size: 12px; font-weight: 700; color: var(--muted); }
.setup-h { display: flex; align-items: flex-start; gap: 12px; }
.setup-h h2 { font-size: 22px; font-weight: 700; letter-spacing: -.015em; }
.setup-h p { margin-top: 4px; color: var(--muted); font-size: 15px; }
.setup-n { margin-left: auto; flex: none; font-size: 14px; font-weight: 600; color: var(--muted); }
.setup-bar { height: 6px; margin: 14px 0 2px; border-radius: 3px; background: var(--pill); overflow: hidden; }
.setup-bar i { display: block; width: 0; height: 100%; border-radius: 3px; background: var(--leaf); transition: width .8s var(--ease); }
.count { font-variant-numeric: tabular-nums; }
.setup-edit { display: none; margin: 2px 0 14px; font-size: 15px; }

.step-card + .step-card { border-top: 1px solid var(--line); }
.sc-head { display: flex; align-items: center; gap: 14px; width: 100%; padding: 13px 0; border: 0; background: none; text-align: left; }
button.sc-head:disabled { cursor: default; }
.sc-head .ic { position: relative; flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--pill); color: var(--ink); transition: background .3s; }
.sc-head .ic .icon { width: 21px; height: 21px; }
.sc-head .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sc-head .tx > b { font-size: 17px; font-weight: 600; }
.sc-head .tx > span { font-size: 14px; color: var(--muted); }
.sc-head > .icon.go { color: var(--faint); width: 18px; height: 18px; }
.sc-body { display: none; padding: 2px 0 18px 58px; }
.step-card.current .sc-body { display: block; animation: fadeUp .3s var(--ease) both; }
.sc-lead { display: flex; gap: 10px; margin-bottom: 10px; font-size: 15px; color: var(--ink-2); }
.sc-lead .icon { width: 18px; height: 18px; margin-top: 2px; color: var(--leaf-ink); }
.sc-body .btn + .btn { margin-top: 8px; }
.step-card.current .sc-head .ic { background: var(--ink); color: #fff; }
.step-card.done .sc-head .ic { background: var(--leaf); }
.step-card.done .sc-head .ic .icon { opacity: 0; }
.step-card.done .sc-head .ic::after { content: ''; position: absolute; width: 14px; height: 8px; border-left: 2.5px solid #fff; border-bottom: 2.5px solid #fff; transform: translateY(-2px) rotate(-45deg); }
.step-card.done .sc-head .tx > span { color: var(--leaf-ink); }
.step-card.locked .sc-head { opacity: .5; }
.step-card.locked .sc-head > .icon.go { visibility: hidden; }

/* Con todo listo, la tarjeta se reduce al interruptor de Sofía. */
body.setup-done .setup-bar, body.setup-done #wWhatsapp, body.setup-done #wAsistente .widget-h, body.setup-done #stConfigure, body.setup-done #stTest { display: none; }
body.setup-done .setup-edit { display: inline-block; }
body.setup-done #stActivate .sc-head .ic { background: var(--leaf-soft); }
body.setup-done #stActivate .sc-head .ic .icon { opacity: 1; color: var(--leaf-ink); }
body.setup-done #stActivate .sc-head .ic::after { display: none; }

.switch { position: relative; flex: none; width: 56px; height: 44px; margin: 0; cursor: pointer; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; z-index: 1; cursor: pointer; }
.switch input:disabled { cursor: default; }
.switch i { position: absolute; inset: 7px 0; border-radius: 999px; background: #D6CFDC; transition: background .2s; pointer-events: none; }
.switch i::after { content: ''; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(26, 18, 32, .2); transition: transform .25s var(--ease); }
.switch input:checked + i { background: var(--leaf); }
.switch input:checked + i::after { transform: translateX(26px); }
.switch input:focus-visible + i { outline: 3px solid rgba(111, 72, 134, .45); outline-offset: 3px; }
.switch input:disabled + i { opacity: .5; }

.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mini-ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--lilac); color: var(--deep); }
.mini-ic .icon { width: 20px; height: 20px; }
/* Los dos planes, lado a lado: el de WhatsApp en blanco y el Premium (con voz) en oscuro. */
.plan-mini { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-height: 214px; padding: 16px; border-radius: 26px; border: 1px solid var(--line); background: var(--white); box-shadow: var(--shadow-sm); color: var(--ink); text-align: left; transition: transform .15s var(--ease); }
.plan-mini:active { transform: scale(.98); }
.plan-mini > b { margin-top: 12px; font-size: 18px; font-weight: 700; letter-spacing: -.01em; line-height: 1.15; }
.plan-mini-tx { font-size: 14px; line-height: 1.35; color: var(--muted); }
.plan-mini-price { display: flex; flex-direction: column; margin-top: auto; padding-top: 14px; }
.plan-mini-price small { font-size: 12px; color: var(--muted); }
.plan-mini-price b { font-family: var(--display); font-stretch: 68%; font-weight: 800; font-size: 38px; line-height: 1; }
.plan-mini.voz { background: var(--ink); border-color: var(--ink); color: #fff; }
.plan-mini.voz .plan-mini-tx, .plan-mini.voz .plan-mini-price small { color: rgba(255, 255, 255, .68); }
.plan-mini.voz .mini-ic { background: rgba(255, 255, 255, .14); color: #fff; }
.plan-tag { position: absolute; top: 16px; right: 14px; padding: 3px 9px; border-radius: 10px; background: #B9E67F; color: var(--ink); font-size: 11px; font-weight: 700; }
.plan-note { margin: 10px 4px 0; font-size: 12px; color: var(--muted); }
/* «Sofía, contigo» (su resumen por WhatsApp) vive en la pestaña Sofía y solo aparece si ese número existe. */
.wa-sofia { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; margin: 16px 16px 0; padding: 12px 12px 12px 14px; border-radius: 22px; background: rgba(255, 255, 255, .8); border: 1px solid var(--glass-edge); box-shadow: var(--shadow-sm); }
.wa-sofia > div { flex: 1; min-width: 0; }
.wa-sofia b { display: block; font-weight: 600; }
.wa-sofia span:not(.mini-ic) { display: block; font-size: 13px; color: var(--muted); }
.wa-sofia .pill-btn { flex: none; display: inline-flex; align-items: center; color: var(--ink); text-decoration: none; }

/* ---------- listas (chats, citas, contactos) ---------- */
.list { display: block; }
.list .it { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 0; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; color: var(--ink); }
.list .it:first-child { border-top: 0; }
.list button.it { cursor: pointer; }
.list button.it:active { background: linear-gradient(90deg, transparent, var(--chat-bg) 12%, var(--chat-bg) 88%, transparent); }
.av { flex: none; width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; background: var(--deep); color: #fff; font-size: 17px; font-weight: 600; letter-spacing: .01em; }
.av.c0 { background: var(--purple); } .av.c1 { background: var(--coral); } .av.c2 { background: #4E8F12; } .av.c3 { background: var(--magenta); } .av.c4 { background: #2E6F8E; } .av.c5 { background: #A86E12; }
.tx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tx > b { font-size: 17px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx > span:not(.pill) { font-size: 15px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .meta { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; font-size: 13px; color: var(--muted); text-align: right; }
.list .meta br { display: none; }
.pill { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 12px; background: var(--pill); color: var(--ink-2); font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill.rojo { background: var(--coral); color: #fff; }
.pill.ambar { background: var(--amber-soft); color: var(--amber); }
.pill.morado { background: var(--lilac); color: var(--deep); }
.pill.verde { background: var(--leaf-soft); color: var(--leaf-ink); }
.unread { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--leaf); color: #fff; font-size: 12px; font-weight: 700; }

/* Citas como tarjetas de vidrio, con los botones abajo. */
.list.cards { padding: 18px 16px 0; }
.list.cards .it { display: grid; grid-template-columns: 50px 1fr; gap: 0 14px; align-items: center; margin-bottom: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 26px; background: var(--white); box-shadow: var(--shadow-sm); }
.list.cards .it:first-child { border-top: 1px solid var(--line); }
.list.cards .tx > span:not(.pill) { white-space: normal; }
.list.cards .tx > .pill { align-self: flex-start; margin-top: 8px; }
.list.cards .meta { grid-column: 1 / -1; flex-direction: row-reverse; gap: 8px; }
.list.cards .meta:empty { display: none; }
.list.cards .meta .btn { flex: 1; margin: 14px 0 0 !important; min-height: 46px; }
.list.cards .meta .btn.linea { background: var(--pill); box-shadow: none; }

/* Contactos personales: interruptores. */
#contactList .it { gap: 14px; }
#contactList .switch { margin-left: auto; }

/* Cargando y vacío. */
.loading-state { padding: 6px 0; }
.skeleton-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; }
.skeleton-row > div { flex: 1; }
.skeleton-row i { flex: none; width: 50px; height: 50px; border-radius: 50%; }
.skeleton-row span { display: block; height: 12px; border-radius: 6px; width: 55%; }
.skeleton-row span + span { margin-top: 10px; width: 80%; }
.skeleton-row i, .skeleton-row span { background: linear-gradient(90deg, #F1EDF4 0%, #F8F5FA 40%, #F1EDF4 80%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
.empty-state { display: flex; flex-direction: column; align-items: center; padding: 44px 16px 30px; text-align: center; }
.empty-icon { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: var(--lilac); color: var(--deep); margin-bottom: 18px; }
.empty-icon .icon { width: 30px; height: 30px; }
.empty-state h2 { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.empty-state p { margin-top: 6px; max-width: 30ch; color: var(--muted); }
.empty-state .btn { margin-top: 20px; }

/* ---------- chats ---------- */
.search { display: flex; align-items: center; gap: 10px; margin: 18px 16px 0; padding: 0 18px; height: 52px; border-radius: 26px; background: var(--white); box-shadow: var(--shadow-sm); color: var(--muted); }
.search input { height: 50px; padding: 0; border: 0; background: none; font-size: 17px; box-shadow: none !important; }
.search input:focus { border: 0; }
.seg { display: flex; gap: 8px; overflow-x: auto; padding: 16px 16px 4px; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: none; height: 40px; padding: 0 16px; border: 1px solid var(--line); border-radius: 20px; background: var(--white); font-size: 15px; font-weight: 500; transition: background .15s, color .15s; }
.seg button.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.seg em { margin-left: 6px; font-style: normal; font-size: 13px; font-weight: 700; color: var(--coral); }
.seg button.on em { color: #FFB4A3; }
.live-card { display: flex; align-items: center; gap: 14px; margin: 14px 16px 0; padding: 14px 16px; border-radius: 22px; background: var(--glass); backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%); border: 1px solid var(--glass-edge); box-shadow: var(--shadow-sm); }
.live-card > i { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--faint); }
body.sofia-on .live-card > i { background: var(--leaf); animation: pulse 2s infinite; }
.live-card b { display: block; font-weight: 600; }
.live-card span { display: block; font-size: 14px; color: var(--muted); }
#chatList { padding: 6px 20px 0; }
#homeNeedsList, #homeApptsList { padding: 0; }

/* ---------- conversación ---------- */
.thread { display: flex; flex-direction: column; gap: 8px; }
.bub { max-width: 82%; padding: 10px 14px; border-radius: 20px; font-size: 16px; line-height: 1.4; white-space: pre-wrap; word-wrap: break-word; animation: bubIn .25s var(--ease) both; }
.bub small { display: block; margin-top: 4px; font-size: 12px; opacity: .62; }
.bub.them { align-self: flex-start; background: var(--white); border-bottom-left-radius: 6px; box-shadow: 0 1px 2px rgba(26, 18, 32, .06); }
.bub.me, .bub.doc { align-self: flex-end; border-bottom-right-radius: 6px; }
/* En el chat de un paciente: Sofía en morado, tú en negro. */
#chatThread .bub.me { background: var(--deep); color: #fff; }
#chatThread .bub.doc { background: var(--ink); color: #fff; }
/* Hablando con Sofía: tú en negro, ella en blanco. */
#ownerThread .bub.me { background: var(--ink); color: #fff; }
/* En la prueba, tú escribes como paciente (verde WhatsApp claro) y Sofía contesta. */
#simThread .bub.me { background: #DDF5C8; color: var(--ink); }
.wa-bg { flex: 1; padding: 14px 12px; border-radius: 24px; background: var(--chat-bg); }
.typing { display: flex; gap: 4px; width: max-content; margin-top: 8px; padding: 12px 14px; border-radius: 20px; border-bottom-left-radius: 6px; background: var(--white); }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); animation: dot 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
.composer { display: flex; align-items: center; gap: 10px; }
.composer input { flex: 1; height: 52px; border-radius: 26px; padding: 0 20px; }
.send-button { flex: none; width: 52px; min-height: 52px; height: 52px; padding: 0; border-radius: 50%; }
.send-button .icon { width: 20px; height: 20px; }

/* Pestaña Sofía (como el chat de lea+ de Leona): resplandor suave detrás y sugerencias para empezar. */
section[data-tab="sofia"] { position: relative; }
.sofia-glow { position: absolute; left: 50%; top: 40px; z-index: 0; width: 460px; height: 460px; margin-left: -230px; border-radius: 50%; pointer-events: none; filter: blur(34px); opacity: .9;
  background: radial-gradient(circle at 42% 40%, rgba(111, 72, 134, .45) 0 18%, rgba(194, 123, 195, .32) 34%, rgba(185, 230, 127, .22) 52%, transparent 70%);
  animation: glow 9s ease-in-out infinite alternate; }
.sofia-hello, .conversation-panel { position: relative; z-index: 1; }
.conversation-panel { display: flex; flex-direction: column; gap: 12px; margin: 22px 16px 0; }
.conversation-panel .thread { min-height: max(240px, calc(100vh - 500px)); padding: 16px 12px; border-radius: 26px; background: rgba(255, 255, 255, .55); backdrop-filter: blur(18px) saturate(150%); -webkit-backdrop-filter: blur(18px) saturate(150%); border: 1px solid var(--glass-edge); }
.suggest p { margin: 2px 4px 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.suggest-row { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 0 16px 2px; scrollbar-width: none; }
.suggest-row::-webkit-scrollbar { display: none; }
.suggest-row button { flex: none; height: 40px; padding: 0 16px; border: 1px solid var(--line); border-radius: 20px; background: rgba(255, 255, 255, .85); font-size: 15px; font-weight: 500; color: var(--deep); }
.suggest-row button:active { transform: scale(.97); }

/* Sofía al centro de la barra, con su esfera (como lea+). */
nav.bottom .nav-sofia .orb { width: 28px; height: 28px; margin: -2px 0 -1px; box-shadow: 0 0 0 2px #fff, 0 4px 12px rgba(111, 72, 134, .35); }

/* Sello de confianza al conectar. */
.meta-chip { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 14px 0 12px; border-radius: 16px; background: #EEF4FF; color: #1663D6; box-shadow: inset 0 0 0 1.5px rgba(24, 119, 242, .35); font-size: 13px; font-weight: 600; }
.meta-chip .icon { width: 22px; height: 11px; stroke-width: 2.2; }
.wab-link { display: block; margin: 4px 0 0; padding: 8px 0; font-size: 15px; text-decoration: underline; text-underline-offset: 3px; }

/* Ayuda dentro de la tarjeta de pasos. */
.setup-help { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: 22px; background: var(--chat-bg); color: var(--ink); text-decoration: none; font-weight: 500; }
.setup-help .icon { width: 20px; height: 20px; color: var(--purple); }
.setup-help .go { margin-left: auto; width: 18px; height: 18px; color: var(--faint); }
body.setup-done .setup-help { display: none; }
.conversation-panel .typing { margin-top: -4px; margin-left: 12px; }
.conversation-panel .composer { position: sticky; bottom: calc(100px + env(safe-area-inset-bottom)); z-index: 3; padding: 6px; border-radius: 32px; background: rgba(255, 255, 255, .9); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }

/* ---------- cuenta ---------- */
.who { padding: 28px 20px 0; text-align: center; }
.who-av { width: 96px; height: 96px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; background: var(--deep); color: #fff; font-size: 32px; font-weight: 600; box-shadow: 0 0 0 6px rgba(255, 255, 255, .7); }
.who-av:empty::before { content: ''; width: 34px; height: 34px; border-radius: 50%; background: rgba(255, 255, 255, .3); }
.who-name { margin-top: 16px; font-family: var(--display); font-stretch: 68%; font-weight: 800; font-size: 42px; line-height: 1; }
.who p { margin-top: 8px; }
.tiles2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile2 { display: flex; flex-direction: column; align-items: flex-start; min-height: 132px; padding: 16px; border-radius: 24px; text-align: left; color: var(--ink);
  background: var(--glass); backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%); border: 1px solid var(--glass-edge); box-shadow: var(--shadow-sm); transition: transform .15s var(--ease); }
.tile2:active { transform: scale(.98); }
.tile2 .icon { margin-bottom: auto; }
.tile2 b { margin-top: 16px; font-size: 17px; font-weight: 600; }
.tile2 > span { font-size: 14px; color: var(--muted); }
.conn-info { margin: 14px 0; color: var(--ink-2); }
.rows.card { padding: 0 18px; }
.row-link { display: flex; align-items: center; gap: 16px; width: 100%; padding: 17px 0; border: 0; border-top: 1px solid var(--line); background: none; color: var(--ink); font-size: 17px; text-align: left; text-decoration: none; }
.row-link:first-child { border-top: 0; }
.row-link .go { margin-left: auto; width: 18px; height: 18px; color: var(--faint); }
.row-link .orb { width: 24px; height: 24px; }
.row-link.danger { color: var(--coral-ink); }
.row-link.logout { justify-content: center; border: 0; border-radius: 999px; background: var(--coral-soft); }

/* ---------- barra de abajo ---------- */
nav.bottom { position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 20; width: min(calc(100% - 28px), 520px); transform: translateX(-50%); }
nav.bottom .in { display: flex; padding: 6px; border-radius: 36px; background: rgba(255, 255, 255, .94); backdrop-filter: blur(24px) saturate(160%); -webkit-backdrop-filter: blur(24px) saturate(160%); border: 1px solid rgba(255, 255, 255, .9); box-shadow: 0 10px 34px rgba(26, 18, 32, .15); }
nav.bottom button { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 0 7px; border: 0; border-radius: 30px; background: none; color: var(--muted); font-size: 11.5px; font-weight: 500; transition: background .2s, color .2s; }
nav.bottom button.on { background: var(--pill); color: var(--ink); font-weight: 600; }
nav.bottom .icon { width: 24px; height: 24px; }
.nav-badge { position: absolute; top: 3px; left: calc(50% + 5px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--coral); color: #fff; font: 700 10.5px/18px var(--body); font-style: normal; text-align: center; }

/* ---------- hojas ---------- */
body.has-sheet::after { content: ''; position: fixed; inset: 0; z-index: 25; background: rgba(26, 18, 32, .38); animation: fade .25s ease both; }
.sheet { position: fixed; inset: 10px 0 0; z-index: 30; display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain; border-radius: 28px 28px 0 0; background: var(--white); box-shadow: 0 -10px 40px rgba(26, 18, 32, .18); animation: sheetUp .42s var(--ease) both; }
.sheet::before { content: ''; flex: none; width: 40px; height: 5px; margin: 8px auto 0; border-radius: 3px; background: #E2DDE6; }
.sheet > header.top { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 10px; padding: 8px 14px 10px; background: rgba(255, 255, 255, .9); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.sheet > header.top > button:not(.pill-btn) { flex: none; width: 42px; height: 42px; border: 0; border-radius: 50%; display: grid; place-items: center; background: var(--pill); }
.sheet-title { font-size: 18px; font-weight: 600; }
.sheet > main { flex: 1; width: 100%; max-width: 560px; margin: 0 auto; padding: 8px 20px calc(28px + env(safe-area-inset-bottom)); }
.sheet-h { font-size: 28px; font-weight: 700; letter-spacing: -.02em; line-height: 1.12; }
.sheet-p { margin: 8px 0 8px; font-size: 17px; }
.sticky-cta { position: sticky; bottom: calc(14px + env(safe-area-inset-bottom)); margin-top: 18px; box-shadow: 0 10px 26px rgba(26, 18, 32, .2); }

/* Chat abierto y prueba. */
.chat-av { width: 42px; height: 42px; font-size: 15px; }
.chat-av:empty { display: none; }
.chat-who { min-width: 0; display: flex; flex-direction: column; }
.chat-who .sheet-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; }
.chat-state { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-state[data-tono="sofia"] { color: var(--leaf-ink); }
.chat-state[data-tono="urgente"] { color: var(--coral-ink); font-weight: 600; }
.chat-state[data-tono="hoy"] { color: var(--amber); font-weight: 600; }
.chat-main { display: flex; flex-direction: column; gap: 12px; }
.chat-actions { display: flex; gap: 8px; }
.chat-note { font-size: 14px; color: var(--muted); }
.chat-main .wa-bg { min-height: 50vh; }
.chat-main .composer { position: sticky; bottom: 0; z-index: 2; padding: 10px 0 calc(6px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, rgba(255, 255, 255, 0), #fff 30%); }
#chatHelp { margin-top: -6px; text-align: center; }

/* Conectar WhatsApp. */
.conn-status { padding: 10px 0 4px; }
.conn-status h2 { margin-top: 18px; font-size: 30px; font-weight: 700; line-height: 1.12; letter-spacing: -.02em; }
.conn-status p { margin-top: 8px; font-size: 17px; }
.conn-points { margin: 18px 0 6px; }
.conn-points li { display: flex; align-items: center; gap: 14px; padding: 15px 0; font-size: 17px; }
.conn-points li + li { border-top: 1px solid var(--line); }
.conn-points .icon.ok { color: var(--leaf-ink); }
.help-bar { position: relative; display: flex; align-items: center; gap: 10px; margin: 18px 0 14px; padding: 14px 16px 18px; border-radius: 18px; background: var(--chat-bg); font-size: 15px; }
.help-bar .link { margin-left: auto; font-size: 15px; font-weight: 600; }
.help-progress { position: absolute; left: 16px; right: 16px; bottom: 9px; height: 3px; border-radius: 2px; background: #E6DFEB; overflow: hidden; }
.help-progress i { display: block; width: 0; height: 100%; background: var(--leaf); transition: width .3s var(--ease); }
.fine { margin-top: 16px; line-height: 1.45; }
.done-card:empty { display: none; }
.done-card { padding: 22px 20px; border: 0; background: var(--leaf-soft); }
.done-card h2 { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 700; color: var(--leaf-ink); }
.done-card .icon { width: 26px; height: 26px; }

/* La guía de Meta flota sobre la hoja. */
.guide-sheet { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 40; max-width: 520px; margin: 0 auto; padding: 20px; border-radius: 28px;
  background: rgba(255, 255, 255, .94); backdrop-filter: blur(22px) saturate(160%); -webkit-backdrop-filter: blur(22px) saturate(160%); box-shadow: 0 20px 50px rgba(26, 18, 32, .25); border: 1px solid #fff; }
.guide-logos { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.meta-mark { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: #E8F0FE; color: #1877F2; }
.meta-mark .icon { width: 24px; height: 12px; stroke-width: 2.2; }
.guide-logos .sync { width: 18px; height: 18px; }
.leaf-mark { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--leaf-soft); color: var(--leaf); }
.leaf-mark svg { width: 24px; height: 24px; }
.guide-step { margin-top: 14px; font-size: 13px; font-weight: 600; color: var(--muted); }
.guide-sheet h2 { margin-top: 4px; font-size: 21px; font-weight: 700; letter-spacing: -.01em; }
#guideText { margin-top: 6px; color: var(--ink-2); }
.guide-sheet.anim > h2, .guide-sheet.anim > #guideText { animation: fadeUp .3s var(--ease) both; }
.guide-dots { display: flex; gap: 6px; margin: 16px 0; }
.guide-dots i { width: 8px; height: 8px; border-radius: 4px; background: #E2DDE6; transition: width .25s var(--ease), background .25s; }
.guide-dots i.past { background: var(--leaf); }
.guide-dots i.on { width: 24px; background: var(--ink); }
.guide-actions { display: flex; gap: 10px; }
.guide-actions .btn { flex: 1; }

/* La encuesta: pantalla completa, una pregunta a la vez. */
.sheet.survey { inset: 0; border-radius: 0; box-shadow: none; }
.sheet.survey::before { display: none; }
.sv-top { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 14px; padding: calc(12px + env(safe-area-inset-top)) 16px 10px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.sv-round { flex: none; width: 42px; height: 42px; border: 0; border-radius: 50%; display: grid; place-items: center; background: var(--pill); color: var(--ink); }
.sv-bar { flex: 1; height: 6px; border-radius: 3px; background: var(--pill); overflow: hidden; }
.sv-bar i { display: block; width: 6%; height: 100%; border-radius: 3px; background: var(--leaf); transition: width .5s var(--ease); }
.sheet.survey.sv-intro .sv-bar { visibility: hidden; }
.sv-main { flex: 1; width: 100%; max-width: 560px; margin: 0 auto; padding: 18px 22px 24px; }
.sv-who { display: flex; align-items: center; gap: 10px; color: var(--purple); font-size: 15px; font-weight: 600; }
.sv-who .orb { width: 34px; height: 34px; }
.sv-intro .sv-who { display: none; }
.sv-opt { display: inline-block; margin-top: 18px; padding: 3px 10px; border-radius: 10px; background: var(--pill); color: var(--muted); font-size: 12px; font-weight: 600; }
.sv-opt.hide + h1 { margin-top: 16px; }
#svTitle { margin-top: 10px; font-size: 30px; font-weight: 700; line-height: 1.12; letter-spacing: -.02em; }
#svTitle.enter { animation: fadeUp .35s var(--ease) both; }
.sv-sub { margin-top: 8px; color: var(--muted); font-size: 17px; }
#svBody { margin-top: 8px; }
#svBody > * { animation: fadeUp .35s var(--ease) both; }
.sv-sep { margin: 22px 0 4px; border: 0; border-top: 1px solid var(--line); }
.sv-card { margin-top: 16px; padding: 4px 18px 18px; border-radius: 24px; background: var(--chat-bg); }
.sv-card .sv-l:first-child, .sv-card .sv-badge + .sv-l { margin-top: 14px; }
.sv-badge { display: inline-block; margin-top: 16px; padding: 3px 10px; border-radius: 10px; background: var(--leaf-soft); color: var(--leaf-ink); font-size: 12px; font-weight: 700; }
.sv-opts { display: grid; gap: 10px; }
.sv-o { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 56px; padding: 14px 18px; border: 1.5px solid var(--line); border-radius: 18px; background: var(--white); font-size: 16px; text-align: left; transition: border-color .15s, background .15s, transform .12s var(--ease); }
.sv-o:active { transform: scale(.98); }
.sv-o .icon { width: 22px; height: 22px; padding: 4px; flex: none; border-radius: 50%; background: var(--ink); color: #fff; stroke-width: 3; opacity: 0; transform: scale(.6); transition: opacity .15s, transform .2s var(--ease); }
.sv-o.on { border-color: var(--purple); background: var(--lilac); }
.sv-o.on .icon { opacity: 1; transform: none; }
.sv-opts.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sv-opts.chips .sv-o { width: auto; min-height: 44px; padding: 8px 16px; border-radius: 22px; }
.sv-opts.chips .sv-o .icon { display: none; }
.sv-other { margin-top: 10px; }
.sv-carousel { display: flex; gap: 12px; overflow-x: auto; margin: 22px -22px 0; padding: 4px 22px 18px; scroll-snap-type: x mandatory; scroll-padding: 22px; scrollbar-width: none; }
.sv-carousel::-webkit-scrollbar { display: none; }
.sv-skill { flex: 0 0 82%; max-width: 340px; min-height: 330px; padding: 24px 22px; border-radius: 28px; scroll-snap-align: start; background: var(--lilac); }
.sv-skill:nth-child(2) { background: var(--amber-soft); }
.sv-skill:nth-child(3) { background: var(--leaf-soft); }
.sv-skill:nth-child(4) { background: var(--coral-soft); }
.sv-skill:nth-child(5) { background: #ECEFF7; }
.sv-art { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--white); color: var(--ink); }
.sv-art .icon { width: 26px; height: 26px; }
.sv-skill h2 { margin: 26px 0 20px; font-size: 25px; font-weight: 700; line-height: 1.15; letter-spacing: -.02em; }
.sv-skill ul { display: grid; gap: 13px; }
.sv-skill li { display: flex; align-items: center; gap: 12px; font-size: 16px; }
.sv-skill li .icon { width: 20px; height: 20px; color: var(--ink-2); }
.sv-done { display: grid; place-items: center; width: 96px; height: 96px; margin: 26px 0 0; border-radius: 50%; background: var(--leaf-soft); color: var(--leaf-ink); }
.sv-done .icon { width: 44px; height: 44px; stroke-width: 2.4; }
.sv-foot { position: sticky; bottom: 0; z-index: 3; display: flex; gap: 10px; width: 100%; max-width: 560px; margin: 0 auto; padding: 12px 22px calc(16px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, rgba(255, 255, 255, 0), #fff 28%); }
.sv-back { flex: none; min-width: 58px; height: 58px; padding: 0 20px; border: 0; border-radius: 29px; background: var(--white); box-shadow: inset 0 0 0 1.5px var(--ink); font-weight: 600; }
.sv-next { flex: 1; height: 58px; border: 0; border-radius: 29px; background: var(--ink); color: #fff; font-size: 18px; font-weight: 600; transition: transform .12s var(--ease), opacity .15s; }
.sv-next:active { transform: scale(.98); }
.sv-next:disabled { opacity: .45; }
.sheet.survey .err { text-align: center; }

/* Planes. */
.plans-hero { padding: 12px 0 4px; }
.plans-hero .orb { width: 72px; height: 72px; }
.plans-hero h1 { margin-top: 18px; font-family: var(--display); font-stretch: 68%; font-weight: 800; font-size: 46px; line-height: .95; }
.plans-hero p { margin-top: 10px; color: var(--muted); font-size: 17px; }
.quote { margin: 24px 0; padding: 4px 0 4px 18px; border-left: 3px solid var(--lilac); }
.quote blockquote { font-size: 17px; line-height: 1.5; color: var(--ink-2); }
.quote figcaption { margin-top: 8px; font-size: 14px; font-weight: 600; color: var(--purple); }
.vs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.vs-col { padding: 16px; border-radius: 22px; font-size: 14px; }
.vs-col.sin { background: var(--chat-bg); color: var(--muted); }
.vs-col.con { background: var(--lilac); color: var(--deep); }
.vs-h { margin-bottom: 10px; font-size: 15px; font-weight: 700; }
.vs-col li + li { margin-top: 8px; }
.vs-col.con li::before { content: '✓ '; color: var(--leaf-ink); font-weight: 700; }
.plan-card { position: relative; margin-top: 16px; padding: 20px; border-radius: 28px; box-shadow: var(--shadow-sm); }
.plan-card h2 { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 700; }
.patient-count { display: flex; align-items: baseline; gap: 10px; }
.patient-count b { font-family: var(--display); font-stretch: 68%; font-weight: 800; font-size: 50px; line-height: 1; }
input[type=range] { width: 100%; height: 34px; margin: 10px 0 0; background: none; -webkit-appearance: none; appearance: none; }
input[type=range]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: var(--pill); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 30px; height: 30px; margin-top: -12px; border-radius: 50%; background: #fff; box-shadow: 0 2px 10px rgba(26, 18, 32, .25), inset 0 0 0 2px var(--purple); }
input[type=range]::-moz-range-track { height: 6px; border-radius: 3px; background: var(--pill); }
input[type=range]::-moz-range-thumb { width: 26px; height: 26px; border: 2px solid var(--purple); border-radius: 50%; background: #fff; }
.ticks { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.plan-box { margin-top: 16px; padding: 16px; border-radius: 20px; background: var(--chat-bg); }
.price { font-family: var(--display); font-stretch: 68%; font-weight: 800; font-size: 44px; line-height: 1.05; }
.price small { font-family: var(--body); font-stretch: normal; font-size: 15px; font-weight: 500; color: var(--muted); }
.plan-box .btn { margin-top: 12px; }
.plan-feats { margin-top: 16px; display: grid; gap: 10px; }
.plan-feats li { display: flex; align-items: center; gap: 10px; }
.plan-feats .icon { width: 18px; height: 18px; color: var(--leaf-ink); stroke-width: 2.4; }
.voz-tag { position: absolute; top: 18px; right: 18px; padding: 3px 10px; border-radius: 10px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 700; }
.plan-box.voz .price { font-size: 34px; margin-top: 6px; }
.plan-legal { margin: 16px 4px 0; font-size: 12px; color: var(--muted); }

/* ---------- la esfera de Sofía (mezcla viva de colores MediSel) ---------- */
.orb { position: relative; display: block; flex: none; width: 56px; height: 56px; border-radius: 50%; overflow: hidden; isolation: isolate; }
.orb::before { content: ''; position: absolute; inset: -25%; filter: blur(9px); animation: orbSpin 9s linear infinite;
  background:
    radial-gradient(circle at 32% 34%, #6F4886 0 24%, transparent 50%),
    radial-gradient(circle at 70% 40%, #C27BC3 0 24%, transparent 52%),
    radial-gradient(circle at 46% 74%, #B9E67F 0 18%, transparent 46%),
    #E9DDF1; }

/* ---------- capas que monta ui.js ---------- */
.toast { position: fixed; left: 50%; bottom: calc(104px + env(safe-area-inset-bottom)); z-index: 70; max-width: calc(100% - 32px); padding: 13px 20px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 15px; font-weight: 500; box-shadow: 0 12px 30px rgba(26, 18, 32, .28); transform: translateX(-50%); animation: toastIn .3s var(--ease) both; }
body.has-sheet .toast { bottom: calc(96px + env(safe-area-inset-bottom)); } /* arriba de los botones de abajo de la hoja */

.overlay { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; background: var(--white); animation: fade .35s ease both; }
.overlay.out { animation: fadeOut .35s ease both; }
.ov-c { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 28px; text-align: center; }
.ov-orb { width: 210px; height: 210px; transition: transform 1s var(--ease); }
.ov-orb::before { filter: blur(22px); animation-duration: 7s; }
.overlay.ready .ov-orb { transform: scale(1.1); }
.ov-t { margin-top: 44px; font-size: 27px; font-weight: 700; letter-spacing: -.015em; }
.ov-s { margin-top: 8px; min-height: 26px; color: var(--muted); font-size: 17px; }
.ov-s span { display: inline-block; animation: fadeUp .45s var(--ease) both; }
.ov-bar { width: 140px; height: 3px; margin-top: 22px; border-radius: 2px; background: var(--pill); overflow: hidden; }
.ov-bar i { display: block; width: 0; height: 100%; background: var(--ink); transition: width .6s var(--ease); }
.overlay.ready .ov-bar { visibility: hidden; }
.ov-foot { display: grid; gap: 10px; padding: 0 24px calc(28px + env(safe-area-inset-bottom)); opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .45s ease, transform .45s var(--ease); }
.overlay.ready .ov-foot { opacity: 1; transform: none; pointer-events: auto; }
.ov-foot .link { justify-self: center; padding: 8px; }

/* Bienvenida (como Klarna): tarjetas apiladas, tres beneficios y «Empezar». */
.welcome .ov-c { justify-content: flex-start; padding-top: 12vh; padding-bottom: 20px; overflow-y: auto; min-height: 0; } /* en pantallas chicas se desliza; «Empezar» siempre a la vista */
.stack { position: relative; flex: none; width: 290px; height: 140px; }
.welcome .ov-c > * { flex-shrink: 0; } /* con textos largos el contenedor se desliza; nada se encoge ni se encima */
.stack .l1, .stack .l2, .stack .cardx { position: absolute; left: 50%; border: 2px solid var(--ink); border-radius: 22px; transform: translateX(-50%); }
.stack .l2 { top: 72px; width: 240px; height: 52px; background: #B79AC9; }
.stack .l1 { top: 56px; width: 270px; height: 52px; background: #CFE7B0; }
.stack .cardx { top: 0; width: 290px; height: 90px; display: flex; align-items: center; gap: 14px; padding: 0 18px; background: #fff; animation: lift .8s var(--ease) both .15s; }
.stack .cardx .orb { width: 50px; height: 50px; }
.stack .lines { flex: 1; }
.stack .lines i { display: block; height: 9px; border-radius: 5px; background: #EFEBF2; }
.stack .lines i + i { width: 55%; margin-top: 10px; }
.welcome h1 { margin-top: 40px; font-size: 31px; font-weight: 700; line-height: 1.15; letter-spacing: -.02em; }
.welcome .lead { margin-top: 12px; max-width: 32ch; font-size: 18px; color: var(--ink-2); }
.welcome ul { margin-top: 30px; text-align: left; display: grid; gap: 20px; }
.welcome li { display: flex; gap: 16px; }
.welcome li .icon { margin-top: 2px; }
.welcome li b { display: block; font-size: 17px; font-weight: 600; }
.welcome li span { display: block; color: var(--muted); }

/* Arranque (como Lifesum): color orgánico en movimiento, barra de carga y salida con motion:
   el color se recoge como iris hacia el logo, la hoja y «MediSel» viajan a la cabecera y la app entra en cascada.
   iPhone (Safari 26+): Safari ya no lee theme-color; pinta la franja de la hora y la de su barra con un solo color que
   saca de la página. Por eso, mientras se ve el arranque (o se abre el círculo del login), la página es verde por debajo,
   el arranque tiene fondo verde propio y la malla se funde a ese mismo verde arriba y abajo: el verde llega de orilla a orilla. */
html.con-arranque:not(.no-splash), html.con-arranque:not(.no-splash) body,
html.iris-verde, html.iris-verde body { background-color: #4F9A12; }
.splash { position: fixed; inset: 0; z-index: 100; color: #fff; background-color: #4F9A12; animation: fadeOut .5s ease 4s forwards; }
.no-splash .splash { display: none; }
.splash.out { animation: fadeOut .45s ease forwards; }
.splash-bg { position: absolute; inset: 0; overflow: hidden; background: #4F9A12; clip-path: circle(150vmax at var(--cx, 50%) var(--cy, 50%)); }
.splash.leaving { pointer-events: none; animation: none; background-color: transparent; }
.splash.leaving .splash-bg { clip-path: circle(0px at var(--cx) var(--cy)); transition: clip-path .7s cubic-bezier(.7, 0, .2, 1); }
/* Las manchas son degradados con caída suave (como un desenfoque), sin blur: el teléfono no redibuja un desenfoque
   gigante en cada cuadro. Mismo centro que antes y un poco más grandes, porque el blur las extendía. */
.splash-mesh, .splash-c, .splash-bar { pointer-events: none; }
.splash-mesh { position: absolute; inset: -20%; }
.splash-mesh i { position: absolute; border-radius: 50%; animation: drift 14s ease-in-out infinite alternate; }
.splash-mesh i:nth-child(1) { width: 80%; height: 63%; left: -10%; top: -4%;
  background: radial-gradient(closest-side, #8DD23C, rgba(141, 210, 60, .85) 25%, rgba(141, 210, 60, .5) 50%, rgba(141, 210, 60, .2) 72%, rgba(141, 210, 60, 0)); }
.splash-mesh i:nth-child(2) { width: 69%; height: 58%; right: -14.5%; top: 6%; animation-duration: 17s;
  background: radial-gradient(closest-side, #3E8C0C, rgba(62, 140, 12, .85) 25%, rgba(62, 140, 12, .5) 50%, rgba(62, 140, 12, .2) 72%, rgba(62, 140, 12, 0)); }
.splash-mesh i:nth-child(3) { width: 63%; height: 52%; left: 1%; bottom: 1.5%; animation-duration: 19s;
  background: radial-gradient(closest-side, #6F4886, rgba(111, 72, 134, .85) 25%, rgba(111, 72, 134, .5) 50%, rgba(111, 72, 134, .2) 72%, rgba(111, 72, 134, 0)); }
.splash-mesh i:nth-child(4) { width: 58%; height: 46%; right: -4%; bottom: 12%; animation-duration: 15s;
  background: radial-gradient(closest-side, #C3E06A, rgba(195, 224, 106, .85) 25%, rgba(195, 224, 106, .5) 50%, rgba(195, 224, 106, .2) 72%, rgba(195, 224, 106, 0)); }
.splash-mesh i:nth-child(5) { width: 46%; height: 40%; left: 32%; top: 35.5%; opacity: .55; animation-duration: 21s;
  background: radial-gradient(closest-side, #A349A4, rgba(163, 73, 164, .85) 25%, rgba(163, 73, 164, .5) 50%, rgba(163, 73, 164, .2) 72%, rgba(163, 73, 164, 0)); }
.splash-bg::after, .iris-open::after { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, #4F9A12 0, rgba(79, 154, 18, 0) 13%, rgba(79, 154, 18, 0) 85%, #4F9A12 100%); }
.splash-c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; }
.splash-leaf { width: 66px; height: 66px; stroke-width: 5; animation: fadeUp .6s ease .05s both; }
.splash-w { font: 400 62px/1 var(--brand); animation: fadeUp .6s ease .18s both; }
.splash-leaf, .splash-w { transform-origin: center; transition: transform .7s cubic-bezier(.65, 0, .25, 1), color .4s ease .2s; }
.splash.leaving .splash-leaf { color: var(--leaf); }
.splash.leaving .splash-w { color: var(--magenta); }
.splash-bar { position: absolute; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom)); width: 132px; height: 3px; margin-left: -66px; border-radius: 2px; background: rgba(255, 255, 255, .28); overflow: hidden; transition: opacity .3s ease; }
.splash-bar i { display: block; width: 0; height: 100%; border-radius: 2px; background: #fff; animation: loadBar .8s cubic-bezier(.45, .05, .25, 1) .2s forwards; }
.splash.leaving .splash-bar { opacity: 0; }

/* Venimos del login: la pantalla llega ya verde con la hoja y «MediSel» quietas (sin intro ni barra) y solo se recoge. */
.splash-entrada .splash-leaf, .splash-entrada .splash-w { animation: none; }
.splash-entrada .splash-bar { display: none; }

/* Login → Inicio: un círculo verde se abre desde el botón que tocaste hasta cubrir la pantalla. */
.iris-open { position: fixed; inset: 0; z-index: 150; overflow: hidden; color: #fff; background: #4F9A12; pointer-events: none;
  clip-path: circle(0px at var(--cx, 50%) var(--cy, 50%)); transition: clip-path .5s cubic-bezier(.7, 0, .2, 1); }
.iris-open.abre { clip-path: circle(150vmax at var(--cx, 50%) var(--cy, 50%)); }
.iris-open .splash-leaf, .iris-open .splash-w { animation-duration: .35s; }
.iris-open .splash-leaf { animation-delay: .1s; }
.iris-open .splash-w { animation-delay: .15s; }

/* La app (o el login) entra en cascada mientras el color se recoge. */
body.logo-viajando > .top .brand, body.logo-viajando .auth .brand { visibility: hidden; }
body.entrando .auth-form-wrap > * { animation: enterUp .5s var(--ease) .15s both; }
body.entrando .auth-form-wrap > :nth-child(2) { animation-delay: .2s; }
body.entrando .auth-form-wrap > :nth-child(3) { animation-delay: .25s; }
body.entrando .auth-form-wrap > :nth-child(n+4) { animation-delay: .3s; }
body.entrando .auth-preview { animation: enterUp .55s var(--ease) .2s both; }
body.entrando .badge { animation: enterUp .45s var(--ease) .3s both; }
body.entrando main#mainContent > section:not(.hide) > *, body.entrando .demo-bar { animation: enterUp .5s var(--ease) .15s both; }
body.entrando main#mainContent > section:not(.hide) > :nth-child(2) { animation-delay: .2s; }
body.entrando main#mainContent > section:not(.hide) > :nth-child(3) { animation-delay: .25s; }
body.entrando main#mainContent > section:not(.hide) > :nth-child(4) { animation-delay: .3s; }
body.entrando main#mainContent > section:not(.hide) > :nth-child(n+5) { animation-delay: .35s; }
body.entrando nav.bottom { animation: navIn .5s var(--ease) .3s both; }
@keyframes enterUp { from { opacity: 0; transform: translateY(18px); } }
@keyframes navIn { from { opacity: 0; transform: translate(-50%, 30px); } }
@keyframes loadBar { to { width: 100%; } }

/* ---------- login y registro ---------- */
.auth { position: relative; z-index: 1; display: grid; min-height: 100vh; }
.auth-form-panel { display: flex; flex-direction: column; width: 100%; max-width: 440px; margin: 0 auto; padding: calc(18px + env(safe-area-inset-top)) 22px calc(22px + env(safe-area-inset-bottom)); }
.auth .brand { text-decoration: none; }
.brand-by { align-self: flex-end; margin: 0 0 3px 2px; font-size: 12px; color: var(--muted); }
.auth-form-wrap { margin-top: 8vh; }
.auth-intro h1 { font: 700 36px/1.08 var(--body); letter-spacing: -.025em; }
.auth-intro p { margin-top: 8px; color: var(--muted); font-size: 17px; }
.seg.auth-seg { display: flex; gap: 4px; margin-top: 26px; padding: 4px; border-radius: 26px; background: rgba(255, 255, 255, .72); box-shadow: var(--shadow-sm); overflow: visible; }
.seg.auth-seg button { flex: 1; height: 44px; border: 0; border-radius: 22px; background: none; font-weight: 600; }
.seg.auth-seg button.on { background: var(--ink); color: #fff; }
#fIn, #fUp { margin-top: 6px; }
#fIn .btn, #fUp .btn { margin-top: 22px; }
.auth .field-help { margin-top: 6px; }
.check { display: flex; align-items: flex-start; gap: 10px; margin-top: 18px; font-size: 14px; color: var(--ink-2); }
.check input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--ink); }
.demo-btn { margin-top: 12px; }
.auth-note { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 16px; color: var(--leaf-ink); font-size: 14px; font-weight: 600; }
.auth-note .icon { width: 18px; height: 18px; stroke-width: 2.4; }
.auth-footer { margin-top: auto; padding-top: 34px; text-align: center; font-size: 13px; color: var(--muted); }
.auth-preview { display: none; }
@media (min-width: 980px) {
  .auth { grid-template-columns: minmax(440px, 1fr) 1.15fr; }
  .auth-form-panel { justify-content: space-between; min-height: 100vh; }
  .auth-form-wrap { margin-top: 0; }
  .auth-footer { margin-top: 0; }
  .auth-preview { display: flex; flex-direction: column; justify-content: center; gap: 24px; padding: 56px 64px; }
}
.preview-lead { max-width: 30ch; font: 700 30px/1.15 var(--body); letter-spacing: -.02em; }
.product-preview { max-width: 460px; padding: 18px; border-radius: 30px; background: var(--glass); backdrop-filter: blur(24px) saturate(170%); -webkit-backdrop-filter: blur(24px) saturate(170%); border: 1px solid var(--glass-edge); box-shadow: var(--shadow); }
.preview-bar { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid rgba(26, 18, 32, .07); }
.preview-bar .orb { width: 40px; height: 40px; }
.preview-clinic b { display: block; font-size: 15px; }
.preview-clinic span { font-size: 13px; color: var(--muted); }
.live-dot { margin-left: auto; width: 10px; height: 10px; border-radius: 50%; background: var(--leaf); animation: pulse 2s infinite; }
.preview-conversation { display: flex; flex-direction: column; gap: 8px; padding: 14px 0; }
.chat-day { align-self: center; font-size: 12px; color: var(--muted); }
.preview-message { max-width: 80%; padding: 10px 14px; border-radius: 18px; font-size: 15px; line-height: 1.4; }
.preview-message small { display: block; margin-top: 3px; font-size: 11px; opacity: .6; }
.preview-message.patient { align-self: flex-start; background: #fff; border-bottom-left-radius: 6px; box-shadow: 0 1px 3px rgba(26, 18, 32, .1); }
.preview-message.assistant { align-self: flex-end; background: var(--deep); color: #fff; border-bottom-right-radius: 6px; }
.preview-appointment { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 18px; background: #fff; }
.appointment-icon { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--lilac); color: var(--deep); }
.appointment-icon .icon { width: 20px; height: 20px; }
.preview-appointment b { display: block; font-size: 15px; }
.preview-appointment div > span { font-size: 13px; color: var(--muted); }
.preview-appointment .pill { margin-left: auto; }
.preview-caption { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--ink-2); }
.preview-caption .icon { color: var(--leaf-ink); }

/* ---------- clínicas: papeles, equipo, horario por semana, plan y pago ---------- */

/* Lo que cada papel no usa. El servidor revisa cada permiso; esto solo quita lo que estorba. */
body.rol-medico nav.bottom [data-go="chats"], body:not(.rol-admin) nav.bottom [data-go="sofia"],
body:not(.rol-admin) .ask, body.rol-medico .stat[data-ir="chats"], body.rol-medico #homeNeeds,
body.rol-recepcion .setup-wrap, body.rol-medico #wWhatsapp, body.rol-medico #wAsistente, body.rol-medico .setup-help,
body:not(.rol-admin) #bPlanes, body:not(.rol-admin) .tiles2, body:not(.rol-admin) #bWhatsapp,
body:not(.rol-admin) [data-ir="sofia"], body.setup-done #stEquipo, body.setup-done.rol-admin #wMedico { display: none; }

/* Meta no deja contestar (falta tarjeta, número limitado, permiso vencido): se ve primero en Inicio. */
.aviso-wa { display: flex; align-items: center; gap: 12px; width: calc(100% - 32px); margin: 18px 16px 0; padding: 14px 16px; border: 0; border-radius: 22px; background: var(--coral-soft); color: var(--coral-ink); text-align: left; }
.aviso-wa > span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.aviso-wa b { font-weight: 600; }
.aviso-wa span span { font-size: 14px; color: var(--ink-2); }
.aviso-wa .go { width: 18px; height: 18px; }
.wa-estado { margin: -4px 0 14px; padding: 12px 14px; border-radius: 14px; background: var(--coral-soft); color: var(--ink-2); font-size: 14px; }
.wa-estado b { display: block; margin-bottom: 2px; color: var(--coral-ink); }

/* Listas desplegables, con la misma forma que los campos. */
select { width: 100%; height: 54px; padding: 0 42px 0 16px; border: 1.5px solid var(--line); border-radius: 16px; font-size: 17px; -webkit-appearance: none; appearance: none;
  background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B6272' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center / 16px; }
select:focus { outline: none; border-color: var(--purple); box-shadow: 0 0 0 4px rgba(111, 72, 134, .12); }
select:disabled { opacity: .55; }

/* Opciones con título y explicación (papel al invitar, cuándo contesta Sofía, número de Meta). */
.sv-o > span { display: flex; flex-direction: column; min-width: 0; }
.sv-o b { font-weight: 600; }
.sv-o small { margin-top: 2px; font-size: 14px; line-height: 1.35; color: var(--muted); }

/* Hojas: renglones con dos líneas, subtítulos y avisos. */
.sub-h { margin: 28px 0 10px; font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.row-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row-tx b { font-weight: 500; }
.row-tx span { font-size: 14px; color: var(--muted); }
.row-static { cursor: default; }
.row-static .pill-btn { flex: none; margin-left: auto; }
.row-switch { display: flex; align-items: center; gap: 14px; padding: 14px 14px 14px 18px; }
.row-switch .tx > span { white-space: normal; }

/* Equipo. */
.team-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 26px 0 2px; }
.team-h h3 { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.team-h .link { font-size: 15px; font-weight: 600; }
.add-medico { margin: 10px 0 6px; padding: 2px 16px 16px; border-radius: 22px; background: var(--chat-bg); }
.duo-btn { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.list .it.miembro, .list .it.invitacion, .list .it.op-cuenta { flex-wrap: wrap; row-gap: 10px; }
.miembro-acc, .op-acc { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; padding-left: 64px; }
.miembro-acc select, .op-acc select { width: auto; height: 36px; padding: 0 32px 0 14px; border: 0; border-radius: 18px; background-color: var(--pill); background-position: right 11px center; background-size: 13px; font-size: 14px; font-weight: 600; }
.pill-btn.quitar { color: var(--coral-ink); }
.op-cuenta .tx > span:not(.pill) { white-space: normal; }

/* Invitación lista para mandar. */
.inv-listo { display: flex; flex-direction: column; align-items: center; gap: 10px; padding-top: 22px; text-align: center; }
.inv-listo .empty-icon { margin-bottom: 4px; }
.liga { width: 100%; margin: 4px 0; padding: 12px 14px; border-radius: 14px; background: var(--chat-bg); color: var(--ink-2); font-size: 14px; text-align: left; word-break: break-all; -webkit-user-select: all; user-select: all; }

/* Panel de Optima: crear cuenta desde la encuesta */
#impTexto { min-height: 150px; font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.imp-revisar { margin-top: 14px; }
.imp-previa { margin-top: 20px; }
.imp-avisos { padding: 14px 16px; border-radius: 16px; background: var(--amber-soft); color: var(--amber); font-size: 14px; }
.imp-avisos ul { margin: 8px 0 0; padding-left: 18px; }
.imp-avisos li + li { margin-top: 6px; }
.imp-dl { margin: 6px 0 18px; }
.imp-dl dt { margin-top: 16px; font-size: 13px; font-weight: 600; color: var(--muted); }
.imp-dl dd { margin: 3px 0 0; font-size: 15px; white-space: pre-line; overflow-wrap: anywhere; }
.op-cuentas-h { margin-top: 44px; }
.inv-otra { margin-top: 6px; }

/* Un doctor. */
.med-head { display: flex; align-items: center; gap: 16px; margin: 6px 0 18px; }
.med-head .av { width: 64px; height: 64px; font-size: 22px; }
.med-head p { margin-top: 2px; }
.medisel-card { padding: 16px 18px 18px; }
.medisel-card:empty { display: none; }
.ms-ok { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--leaf-ink); }
.ms-ok .icon { width: 20px; height: 20px; stroke-width: 2.4; }
.ms-tx { color: var(--ink-2); font-size: 15px; }
.ms-ok + .ms-tx { margin-top: 6px; }
.ms-form .btn { margin-top: 14px; }
.ms-form .field-help { margin-top: 8px; }
.ms-quitar { display: block; margin-top: 16px; color: var(--coral-ink); font-size: 15px; }
#medQuitar { margin-top: 28px; }
#medQuitar + .field-help { margin-top: 8px; }

/* Cuándo contesta Sofía. */
.aj-notas { display: grid; gap: 10px; margin: 16px 0 4px; }
.aj-notas li { display: flex; gap: 10px; font-size: 15px; color: var(--ink-2); }
.aj-notas .icon { width: 18px; height: 18px; margin-top: 2px; color: var(--muted); }
.aj-revisar { margin-top: 12px; }

/* Contactos: paciente o personal. */
.contact-nota { margin: 4px 0 6px; padding: 10px 14px; border-radius: 14px; background: var(--amber-soft); color: var(--amber); font-size: 14px; }
.contact-nota:empty { display: none; }
.dos { flex: none; display: flex; margin-left: auto; padding: 3px; border-radius: 16px; background: var(--pill); }
.dos button { height: 34px; padding: 0 11px; border: 0; border-radius: 13px; background: none; color: var(--muted); font-size: 13px; font-weight: 600; transition: background .15s, color .15s; }
.dos button[aria-pressed="true"] { background: var(--white); color: var(--ink); box-shadow: 0 1px 3px rgba(26, 18, 32, .12); }
.dos button[data-tipo="personal"][aria-pressed="true"] { background: var(--ink); color: #fff; }
#contactList .it.por-revisar .tx > span { color: var(--amber); }

/* Conectar: la cuenta de WhatsApp tiene varios números. */
.conn-elegir { margin: 18px 0 4px; }
.conn-personal { margin: 18px 0 6px; }
.conn-personal h3 { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.conn-personal > p { margin: 4px 0 12px; }
.conn-personal .btn { margin-top: 10px; }
.conn-elegir h3 { margin-bottom: 10px; font-size: 18px; font-weight: 700; }

/* Plan y pago. */
.pago-card { margin-top: 6px; padding: 20px; border-radius: 26px; background: var(--lilac); }
.pago-card .pill { background: var(--white); }
.pago-card h2 { margin-top: 14px; font-size: 26px; font-weight: 700; line-height: 1.12; letter-spacing: -.02em; }
.pago-card p { margin-top: 6px; color: var(--ink-2); }
.pago-card[data-estado="activa"] { background: var(--leaf-soft); }
.pago-card[data-estado="pendiente"] { background: var(--amber-soft); }
.pago-card[data-estado$="-parada"] { background: var(--coral-soft); }
.pago-card[data-estado$="-parada"] h2 { color: var(--coral-ink); }
.pago-rows { margin-top: 14px; }
.pago-cta { margin-top: 16px; }
.pago-cta + .btn { margin-top: 8px; }

/* Cuenta de IA. */
.ia-card { display: flex; align-items: center; gap: 16px; margin: 6px 0 16px; padding: 18px; border-radius: 26px; background: var(--lilac); }
.ia-card .orb { width: 52px; height: 52px; }
.ia-card b { display: block; font-size: 18px; font-weight: 700; }
.ia-card span:not(.orb) { display: block; color: var(--muted); }

/* Horario por semana: un renglón por día; el día marcado se pinta y muestra sus turnos. */
.semana { margin-top: 2px; }
.dia { display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: start; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.dia:first-child { border-top: 0; }
.dia-t { height: 44px; padding: 0; border: 1.5px solid var(--line); border-radius: 14px; background: var(--white); color: var(--muted); font-size: 15px; font-weight: 600; transition: background .15s, color .15s, border-color .15s; }
.dia.on .dia-t { background: var(--ink); border-color: var(--ink); color: #fff; }
.turnos { display: grid; gap: 8px; min-width: 0; }
.dia:not(.on) .turnos { display: none; }
.cerrado { align-self: center; color: var(--faint); font-size: 15px; }
.dia.on .cerrado { display: none; }
/* Columnas que se encogen: en teléfonos angostos nada se sale de la pantalla. */
.turno { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto; align-items: center; gap: 6px; }
.turno input[type=time] { width: 100%; min-width: 0; height: 44px; padding: 0 8px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--white); font-size: 16px; font-variant-numeric: tabular-nums; -webkit-appearance: none; appearance: none; }
.turno input[type=time]::-webkit-calendar-picker-indicator { display: none; } /* Chrome: sin reloj; en el teléfono el selector abre al tocar */
.turno input[type=time]:focus { outline: none; border-color: var(--purple); box-shadow: 0 0 0 4px rgba(111, 72, 134, .12); }
.turno > span { color: var(--muted); font-size: 14px; }
.turno-x { flex: none; width: 30px; height: 30px; border: 0; border-radius: 50%; display: grid; place-items: center; background: var(--pill); color: var(--muted); }
.turno-x .icon { width: 15px; height: 15px; stroke-width: 2.4; }
.turno-mas { justify-self: start; height: 34px; padding: 0 14px; border: 1.5px dashed #D9D2DF; border-radius: 17px; background: none; color: var(--purple); font-size: 14px; font-weight: 600; }
.turno-mas[hidden] { display: none; }
.sem-antes { margin: 0 0 10px; padding: 10px 14px; border-radius: 14px; background: var(--chat-bg); color: var(--ink-2); }
.semana + .field-help { margin-top: 10px; }

/* Registro: consultorio o clínica. */
.tipo-cuenta { min-width: 0; margin: 20px 0 0; padding: 0; border: 0; }
.tipo-cuenta legend { margin-bottom: 8px; padding: 0; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.tipo-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tipo { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px; border: 1.5px solid var(--line); border-radius: 18px; background: var(--white); text-align: left; transition: border-color .15s, background .15s; }
.tipo b { font-size: 16px; font-weight: 600; }
.tipo span { font-size: 13px; line-height: 1.35; color: var(--muted); }
.tipo.on { border-color: var(--purple); background: var(--lilac); }
#upClinica .check { margin-top: 12px; }

/* Página de invitación. */
.auth-intro .inv-de { display: inline-block; margin: 0 0 12px; padding: 4px 12px; border-radius: 12px; background: var(--lilac); color: var(--deep); font-size: 13px; font-weight: 600; }
.inv-yo { display: flex; align-items: center; gap: 14px; margin: 22px 0 6px; padding: 14px 16px; border-radius: 22px; background: var(--white); box-shadow: var(--shadow-sm); }
.inv-otro { display: block; margin: 14px auto 0; }

/* ---------- movimiento ---------- */
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(89, 168, 15, .5); } 70%, 100% { box-shadow: 0 0 0 9px rgba(89, 168, 15, 0); } }
@keyframes tabIn { from { opacity: 0; transform: translateY(8px); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; visibility: hidden; } }
@keyframes sheetUp { from { transform: translateY(32%); opacity: .4; } }
@keyframes bubIn { from { opacity: 0; transform: translateY(6px) scale(.98); } }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px); } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes dot { 0%, 60%, 100% { opacity: .3; } 30% { opacity: 1; } }
@keyframes orbSpin { to { transform: rotate(360deg); } }
@keyframes drift { to { transform: translate(14%, 10%) scale(1.15); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes lift { from { transform: translate(-50%, 16px); } }
@keyframes glow { to { transform: translate(18px, 24px) scale(1.08); opacity: .75; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- pantallas grandes: la app al centro ---------- */
@media (min-width: 640px) {
  .sheet { inset: 24px 0 0 50%; width: 560px; transform: translateX(-50%); }
  @keyframes sheetUp { from { transform: translate(-50%, 32%); opacity: .4; } }
  .sheet.survey { inset: 0 0 0 50%; }
}
