:root {
  --fondo: #0f1720; --panel: #17222e; --texto: #eef2f5; --suave: #93a3b3;
  --acento: #e8b34b; --escucha: #4fb6a8; --habla: #e8b34b; --alerta: #e2705f;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: radial-gradient(120% 80% at 50% 0%, #1b2a3a 0%, var(--fondo) 60%);
  color: var(--texto);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.app {
  min-height: 100dvh; max-width: 480px; margin: 0 auto;
  padding: calc(16px + env(safe-area-inset-top)) 22px calc(22px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 18px;
}
header { display: flex; justify-content: space-between; align-items: center; }
.marca { font-family: Georgia, "Times New Roman", serif; font-size: 22px; letter-spacing: .5px; }
.marca.grande { font-size: 40px; font-weight: 400; margin: 6px 0 22px; }
.link { background: none; border: 0; color: var(--suave); font-size: 15px; padding: 8px; cursor: pointer; }

.centro { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.orbe { --c: #3a4b5d; width: 190px; height: 190px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--c) 55%, white 8%), color-mix(in srgb, var(--c) 35%, #0f1720) 70%);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--c) 50%, transparent), 0 0 60px color-mix(in srgb, var(--c) 35%, transparent);
  transition: box-shadow .4s, background .4s; }
.orbe.chico { width: 84px; height: 84px; --c: var(--acento); }
.orbe span { width: 38%; height: 38%; border-radius: 50%; background: color-mix(in srgb, var(--c) 80%, white 10%); opacity: .9; transition: transform .3s, background .4s; }
body[data-state="listening"] .orbe { --c: var(--escucha); }
body[data-state="hearing"] .orbe { --c: var(--escucha); }
body[data-state="hearing"] .orbe span { transform: scale(1.5); }
body[data-state="thinking"] .orbe { --c: #7f93a8; }
body[data-state="speaking"] .orbe { --c: var(--habla); }
body[data-state="connecting"] .orbe, body[data-state="reconnecting"] .orbe { --c: #7f93a8; }
body[data-state="reconnecting"] .orbe { --c: var(--alerta); }
@media (prefers-reduced-motion: no-preference) {
  body[data-state="speaking"] .orbe span { animation: pulso 1.1s ease-in-out infinite; }
  body[data-state="thinking"] .orbe span, body[data-state="connecting"] .orbe span, body[data-state="reconnecting"] .orbe span { animation: pulso 1.8s ease-in-out infinite; }
  body[data-state="listening"] .orbe span { animation: pulso 3.2s ease-in-out infinite; }
}
@keyframes pulso { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.35); } }

.estado { font-size: 24px; margin: 30px 0 6px; min-height: 32px; }
.ayuda { color: var(--suave); font-size: 15px; line-height: 1.45; margin: 0; max-width: 30ch; min-height: 44px; }

.frases { min-height: 96px; display: flex; flex-direction: column; gap: 8px; }
.frase { margin: 0; font-size: 15px; line-height: 1.4; color: var(--suave);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.frase:has(span:last-child:empty) { visibility: hidden; }
.quien { color: var(--texto); font-weight: 600; margin-right: 8px; }

footer { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
button { font: inherit; }
.principal { background: var(--acento); color: #1a1407; border: 0; border-radius: 16px; padding: 18px; font-size: 19px; font-weight: 600; cursor: pointer; }
.principal.on { background: transparent; color: var(--alerta); box-shadow: inset 0 0 0 2px var(--alerta); }
.secundario { background: var(--panel); color: var(--texto); border: 0; border-radius: 16px; padding: 15px; font-size: 16px; cursor: pointer; }
.principal:focus-visible, .secundario:focus-visible, .link:focus-visible, input:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.latencia { color: var(--suave); font-size: 13px; text-align: center; margin: 0; min-height: 18px; }

.login form { width: 100%; max-width: 320px; display: flex; flex-direction: column; gap: 10px; text-align: left; }
.login label { color: var(--suave); font-size: 14px; }
.login input[type=password] { background: var(--panel); border: 1px solid #2b3b4c; color: var(--texto); border-radius: 12px; padding: 15px; font-size: 18px; }
.error { color: var(--alerta); font-size: 14px; min-height: 20px; margin: 0; }
