:root{color-scheme:dark;--bg:#09070d;--panel:#17131e;--text:#f7f2ff;--muted:#aaa1b7;--line:#33283f;--blue:#a875ff;--blue2:#e0c7ff;--radius:24px}*{box-sizing:border-box}html,body{margin:0;min-height:100%;background:var(--bg);color:var(--text);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif}body{min-height:100dvh}.app-shell{width:100%;max-width:560px;min-height:100dvh;margin:0 auto;background:radial-gradient(ellipse at 50% 24%,#21152e 0%,#100c17 36%,#09070d 75%);position:relative;overflow:hidden}.screen{min-height:100dvh;padding:24px 24px 28px}.hidden{display:none!important}.setup-screen{display:flex;flex-direction:column;align-items:center;padding-top:clamp(30px,7vh,76px)}.brand-mark{width:170px;height:170px;border-radius:50%;margin:5vh auto 28px;background:radial-gradient(ellipse at 32% 18%,#fff8ff 0%,#f0dcff 12%,#caa4ff 30%,#9b63ff 48%,#6330c5 70%,#28104f 100%);box-shadow:inset -15px -18px 30px #19072f99,inset 10px 9px 24px #fff9,0 0 26px #a875ff44,0 0 65px #8a43ff24;position:relative;overflow:hidden;isolation:isolate;flex-shrink:0;animation:orbFloat 6s ease-in-out infinite,orbGlow 5s ease-in-out infinite} .brand-mark:before{content:"";position:absolute;inset:-18%;border-radius:43% 57% 62% 38%;background:conic-gradient(from 20deg,transparent 0 12%,#f6eaffcc 19%,#c69aff 29%,#7135db 42%,#e5caff 54%,#7a40d7 68%,#3c1a79 78%,transparent 88%);filter:blur(9px);mix-blend-mode:screen;animation:orbSwirl 8s linear infinite}.brand-mark:after{content:"";position:absolute;width:80%;height:52%;left:-9%;top:3%;border-radius:50%;background:radial-gradient(ellipse at 40% 30%,#fff 0%,#f7eaff 15%,#d8b7ff88 40%,transparent 73%);filter:blur(11px);transform:rotate(-32deg);animation:orbMist 5s ease-in-out infinite alternate}.eyebrow{display:none}.setup-screen h1{font-size:clamp(25px,7vw,32px);letter-spacing:-.7px;line-height:1.15;text-align:center;margin:0 0 10px;font-weight:650}.intro{font-size:15px;line-height:1.45;text-align:center;color:var(--muted);max-width:300px;margin:0 auto 30px}.panel{width:100%;max-width:410px;margin:0 auto;background:transparent;border:0;border-radius:0;padding:0;box-shadow:none}.section-heading{display:flex;align-items:center;gap:11px;margin:24px 0 14px}.step-number{width:28px;height:28px;display:grid;place-items:center;border-radius:50%;font-size:12px;color:#bfe8ff;background:#2b1c3e;border:1px solid #67448a}.section-heading h2{font-size:16px;margin:0 0 3px;font-weight:650}.section-heading p{font-size:13px;color:var(--muted);margin:0}.panel label{display:block;font-size:13px;color:#d5d5d9;margin:13px 0 7px}.panel input,.panel select{display:block;width:100%;height:48px;padding:0 14px;border:1px solid #453653;border-radius:13px;background:#17121e;color:#fff;font:inherit;font-size:15px;outline:none}.panel input:focus,.panel select:focus{border-color:#c49aff;box-shadow:0 0 0 3px #a875ff22}.form-divider{height:1px;background:var(--line);margin:24px 0 8px}.primary-button{display:flex;justify-content:center;align-items:center;gap:10px;width:100%;min-height:54px;margin:28px 0 0;border:0;border-radius:999px;background:linear-gradient(135deg,#f8efff,#d7b7ff);color:#21132f;font-size:16px;font-weight:650;cursor:pointer;box-shadow:0 4px 18px #0002}.primary-button span{display:none}.primary-button:active{transform:scale(.99)}.privacy-note{font-size:11px;color:#88888e;text-align:center;margin:14px 0 0}.privacy-note span{color:#c59aff}.chat-screen{display:flex;flex-direction:column;padding:14px 16px 18px;min-height:100dvh}.chat-header{display:flex;align-items:center;gap:11px;padding:6px 0 17px;border-bottom:1px solid #33283f}.icon-button,.text-button{border:0;background:transparent;color:#f5f5f7;cursor:pointer}.icon-button{font-size:25px;width:34px;height:38px}.avatar-small{width:38px;height:38px;border-radius:50%;background:radial-gradient(ellipse at 30% 20%,#fff8ff,#d8b7ff 38%,#9254e8 70%,#38166e);font-size:0;flex-shrink:0;box-shadow:0 0 18px #a875ff44}.header-copy{display:flex;flex-direction:column;gap:3px;flex:1}.header-copy strong{font-size:15px}.header-copy span{font-size:11px;color:#a5a5ab}.status-dot{display:inline-block;width:6px;height:6px;border-radius:50%;background:#58d68d;margin-right:4px}.text-button{font-size:12px;color:#b5b5bb}.relationship-note{text-align:center;color:#929299;font-size:12px;padding:14px 0 8px}.messages{display:flex;flex-direction:column;gap:13px;flex:1;overflow-y:auto;padding:14px 0 20px}.message{max-width:85%;padding:12px 15px;border-radius:19px;font-size:15px;line-height:1.45;white-space:pre-wrap;overflow-wrap:anywhere}.message.assistant{align-self:flex-start;background:#211a2b;color:#f6f0ff;border-bottom-left-radius:6px}.message.user{align-self:flex-end;background:linear-gradient(135deg,#9c68ec,#7040ba);color:#fff;border-bottom-right-radius:6px}.composer{display:flex;align-items:flex-end;gap:9px;padding:9px 10px 9px 15px;border:1px solid #44354f;border-radius:26px;background:#17121e}.composer textarea{resize:none;flex:1;max-height:120px;min-height:25px;border:0;outline:none;background:transparent;color:#fff;font:inherit;font-size:15px;line-height:1.4;padding:3px 0}.composer textarea::placeholder{color:#96969d}.send-button{width:35px;height:35px;border:0;border-radius:50%;background:linear-gradient(135deg,#f8efff,#d7b7ff);color:#21132f;font-size:22px;line-height:1;cursor:pointer;flex-shrink:0}.prototype-note{font-size:10px;color:#75757b;text-align:center;margin:10px 0 0}.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}select{appearance:none;background-image:linear-gradient(45deg,transparent 50%,#aaa 50%),linear-gradient(135deg,#aaa 50%,transparent 50%);background-position:calc(100% - 18px) 20px,calc(100% - 13px) 20px;background-size:5px 5px,5px 5px;background-repeat:no-repeat}@media(min-width:600px){body{padding:20px 0;background:#050408}.app-shell{min-height:calc(100dvh - 40px);border:1px solid #333;border-radius:28px}.screen{min-height:calc(100dvh - 40px)}.setup-screen{padding-left:34px;padding-right:34px}.brand-mark{margin-top:3vh;width:160px;height:160px}.chat-screen{min-height:calc(100dvh - 40px)}}@media(max-height:760px){.setup-screen{padding-top:20px}.brand-mark{width:120px;height:120px;margin:10px auto 18px}.intro{margin-bottom:12px}.section-heading{margin-top:15px}.form-divider{margin-top:16px}.primary-button{margin-top:20px}}@keyframes orbFloat{0%,100%{transform:translateY(0) scale(1)}50%{transform:translateY(-6px) scale(1.015)}}@keyframes orbGlow{0%,100%{box-shadow:inset -15px -18px 30px #19072f99,inset 10px 9px 24px #fff9,0 0 26px #a875ff44,0 0 65px #8a43ff24}50%{box-shadow:inset -15px -18px 30px #19072f99,inset 10px 9px 24px #fff9,0 0 38px #bc8aff77,0 0 85px #8a43ff44}}@keyframes orbSwirl{from{transform:rotate(0deg) scale(1)}to{transform:rotate(360deg) scale(1)}}@keyframes orbMist{from{transform:translate(-2%,0) rotate(-32deg);opacity:.65}to{transform:translate(13%,9%) rotate(-20deg);opacity:1}}@media(prefers-reduced-motion:reduce){.brand-mark,.brand-mark:before,.brand-mark:after{animation:none}}


/* ═════════════ ELYA v2 — añadidos (todo lo de arriba es el diseño original) ═════════════ */
:root{--scale:1}
:focus-visible{outline:3px solid #e0c7ff;outline-offset:2px}

/* Altura del chat: la lista de mensajes hace scroll y el cuadro de escribir queda siempre visible */
.chat-screen{height:var(--app-h,100dvh);min-height:0;overflow:hidden}
.messages{min-height:0}
@media(min-width:600px){.chat-screen{height:calc(var(--app-h,100dvh) - 40px);min-height:0}}

/* Textos más legibles (el original usaba 10–12 px) y 16 px en campos para que iPhone no haga zoom */
.panel input,.panel select{font-size:16px}
.composer textarea{font-size:calc(16px*var(--scale))}
.message{font-size:calc(15px*var(--scale))}
.message-label{font-size:12px;font-weight:600;color:#c9b6ea;margin-bottom:4px}
.privacy-note{font-size:12px;color:#9a93a6}
.prototype-note{font-size:12px;color:#9a93a6;line-height:1.35}
.relationship-note{font-size:13px;color:#a39bb0}
.header-copy span{font-size:12px;color:#b4acc1;line-height:1.25}
.text-button{font-size:15px;min-height:38px;padding:0 8px;color:#e9dffa}

/* Esfera dentro del chat */
.orb-stage{display:flex;flex-direction:column;align-items:center;padding-top:10px;flex-shrink:0}
.chat-screen .brand-mark.orb-chat{width:112px;height:112px;margin:2px auto 0;font-size:0}
.orb-caption{min-height:22px;margin:8px 0 0;font-size:calc(14px*var(--scale));color:var(--blue2);letter-spacing:.2px}
.chat-screen .brand-mark.is-listening{animation:orbFloat 2.4s ease-in-out infinite,orbListen 1.4s ease-in-out infinite}
.chat-screen .brand-mark.is-thinking:before{animation-duration:2.2s}
.chat-screen .brand-mark.is-speaking{animation:orbSpeak 1s ease-in-out infinite,orbGlow 2s ease-in-out infinite}
@keyframes orbListen{
  0%,100%{box-shadow:inset -15px -18px 30px #19072f99,inset 10px 9px 24px #fff9,0 0 30px #a875ff77,0 0 0 0 #e0c7ff66}
  50%{box-shadow:inset -15px -18px 30px #19072f99,inset 10px 9px 24px #fff9,0 0 44px #bc8aff99,0 0 0 16px #e0c7ff00}
}
@keyframes orbSpeak{0%,100%{transform:scale(1)}50%{transform:scale(1.07)}}
@media(max-height:760px){
  .chat-screen .brand-mark.orb-chat{width:84px;height:84px}
  .relationship-note{display:none}
}
@media(max-height:560px){.orb-stage{display:none}}

/* Botones de voz */
.voice-bar{display:flex;gap:8px;justify-content:center;flex-wrap:wrap;padding:6px 0 10px}
.pill{display:inline-flex;align-items:center;gap:7px;min-height:40px;padding:0 14px;border-radius:999px;border:1px solid #453653;background:#17121e;color:#e9dffa;font:inherit;font-size:calc(13px*var(--scale));cursor:pointer}
.pill svg{width:18px;height:18px;fill:currentColor;flex-shrink:0}
.pill[aria-pressed="true"]{background:#2b1c3e;border-color:#a875ff;color:#fff}
.mic-button{width:40px;height:40px;border:1px solid #5a4572;border-radius:50%;background:#241a30;color:#f0e4ff;flex-shrink:0;display:grid;place-items:center;cursor:pointer;padding:0}
.mic-button svg{width:20px;height:20px;fill:currentColor}
.mic-button.on{background:linear-gradient(135deg,#f8efff,#d7b7ff);color:#21132f;border-color:#f8efff}
.mic-button:disabled,.send-button:disabled{opacity:.45;cursor:default}
.send-button{width:40px;height:40px}
.notice{margin:0 0 8px;padding:10px 14px;border-radius:14px;background:#2b1c3e;border:1px solid #67448a;color:#f0e4ff;font-size:14px;line-height:1.4;text-align:center}

/* Estado de conexión */
.status-dot.demo{background:#e6b450}
.status-dot.off{background:#e57373}

/* Indicador "escribiendo" */
.message.typing{display:flex;gap:5px;align-items:center;align-self:flex-start;padding:15px 17px;background:#211a2b;border-bottom-left-radius:6px}
.message.typing span{width:7px;height:7px;border-radius:50%;background:#c9b6ea;animation:elyaDot 1.2s infinite ease-in-out}
.message.typing span:nth-child(2){animation-delay:.15s}
.message.typing span:nth-child(3){animation-delay:.3s}
@keyframes elyaDot{0%,80%,100%{opacity:.25;transform:scale(.8)}40%{opacity:1;transform:scale(1)}}

/* Mensajes de seguridad con botones para llamar */
.message.kind-crisis,.message.kind-emergency,.message.kind-violence{border:1px solid #a875ff88;background:#2a1d3a}
.crisis-actions{display:flex;flex-direction:column;gap:8px;margin-top:14px}
.crisis-link{display:block;text-align:center;padding:13px 14px;border-radius:14px;border:0;background:linear-gradient(135deg,#f8efff,#d7b7ff);color:#21132f;font:inherit;font-size:calc(15px*var(--scale));font-weight:650;text-decoration:none;cursor:pointer}

/* Botón y panel de ayuda */
.help-button{border:1px solid #a875ff;background:#2b1c3e;color:#f4eaff;border-radius:999px;padding:0 15px;min-height:38px;font:inherit;font-size:15px;font-weight:600;cursor:pointer}
.overlay{position:fixed;inset:0;z-index:50;display:flex;align-items:flex-end;justify-content:center;background:#000b}
.sheet{width:100%;max-width:560px;max-height:92dvh;overflow:auto;background:#17131e;border:1px solid #33283f;border-radius:24px 24px 0 0;padding:22px 20px 26px}
.sheet h2{margin:0 0 10px;font-size:20px}
.sheet-text{font-size:15px;line-height:1.5;color:#d8cfe6;margin:0 0 12px}
.sheet-text.small{font-size:13px;color:#a39bb0;margin-top:16px}
.help-row{display:flex;flex-direction:column;gap:3px;padding:14px 16px;margin:10px 0;border-radius:16px;background:#211a2b;border:1px solid #453653;color:#fff;text-decoration:none}
.help-row strong{font-size:22px;color:#e0c7ff}
.help-row span{font-size:14px;color:#cfc6dc;line-height:1.35}
.ghost-button{width:100%;min-height:46px;margin-top:6px;border-radius:999px;border:1px solid #453653;background:transparent;color:#d8cfe6;font:inherit;font-size:15px;cursor:pointer}
.sheet .primary-button{margin-top:12px}
.sheet .primary-button span{display:none}
@media(min-width:600px){.overlay{align-items:center}.sheet{border-radius:24px}}

/* Pantalla de inicio */
.wipe-button{display:block;margin:20px auto 0;border:0;background:transparent;color:#9a93a6;font:inherit;font-size:13px;text-decoration:underline;cursor:pointer}

@media(prefers-reduced-motion:reduce){
  .chat-screen .brand-mark.is-listening,.chat-screen .brand-mark.is-speaking{animation:none}
  .chat-screen .brand-mark.is-thinking:before{animation:none}
  .message.typing span{animation:none;opacity:.7}
}
