/* Avatar en directo de AEREN LABS. Paleta neutra a juego con el fondo de la cara (gris muy claro) y tinta oscura. */
:root {
  --bg: #EDEEF1; --surface: #FFFFFF; --ink: #0B1220; --muted: #5B6475; --line: #D9DDE4;
  --accent: #0B1220; --accent-ink: #FFFFFF; --live: #2E9E6B; --warn: #C2410C; --user: #E4E9F2; --bot: #F3F4F7;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0E1117; --surface: #161A22; --ink: #E8EAEE; --muted: #9AA3B2; --line: #262C38;
    --accent: #E8EAEE; --accent-ink: #0B1220; --user: #1F2633; --bot: #1A1F29; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: inherit; }
.top { max-width: 1080px; margin: 0 auto; padding: 18px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.logo { text-decoration: none; letter-spacing: .18em; font-weight: 500; font-size: 14px; }
.logo b { font-weight: 800; margin-left: .25em; }
.human { font-size: 13px; font-weight: 600; text-decoration: none; border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; background: var(--surface); white-space: nowrap; }
.human:hover { border-color: var(--ink); }

.layout { max-width: 1080px; margin: 0 auto; padding: 0 16px 32px; display: grid; gap: 20px; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); align-items: start; }
@media (max-width: 820px) { .layout { grid-template-columns: 1fr; } }

.video-wrap { position: relative; aspect-ratio: 9 / 16; max-height: 78vh; margin: 0 auto; border-radius: 18px; overflow: hidden; background: #E9EAEE; box-shadow: 0 1px 0 var(--line); }
@media (max-width: 820px) { .video-wrap { max-height: 70vh; } }
video { width: 100%; height: 100%; object-fit: cover; display: block; }
.overlay { position: absolute; inset: 0; display: grid; align-items: end; padding: 16px; overflow-y: auto; background: linear-gradient(to top, rgba(11,18,32,.94) 0%, rgba(11,18,32,.86) 55%, rgba(11,18,32,.45) 85%, rgba(11,18,32,.2) 100%); color: #fff; }
.overlay-inner { display: grid; gap: 9px; }
.overlay h1 { margin: 0; font-size: 21px; line-height: 1.2; letter-spacing: -.01em; }
.overlay p { margin: 0; font-size: 13px; line-height: 1.45; color: rgba(255,255,255,.9); }
.overlay .hint { font-size: 12px; color: rgba(255,255,255,.7); }
.lang { border: 0; margin: 0; padding: 0; }
.lang legend { font-size: 12px; color: rgba(255,255,255,.75); margin-bottom: 6px; padding: 0; }
.lang-options { display: flex; flex-wrap: wrap; gap: 5px; }
.lang-options label { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 5px 9px; border-radius: 999px; background: rgba(255,255,255,.14); cursor: pointer; }
.lang-options label:has(input:checked) { background: rgba(255,255,255,.3); }
.lang-options input { accent-color: #fff; margin: 0; }

.status-bar { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; justify-content: space-between; pointer-events: none; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 999px; background: rgba(11,18,32,.6); color: #fff; }
.pill i { width: 7px; height: 7px; border-radius: 50%; background: #9AA3B2; }
.pill.listening i, .pill.speaking i { background: var(--live); }
.pill.thinking i, .pill.connecting i { background: #E0B84A; }
.pill.error i { background: var(--warn); }
.timer { font: 600 12px/1 ui-monospace, "SF Mono", Menlo, monospace; padding: 7px 10px; border-radius: 999px; background: rgba(11,18,32,.6); color: #fff; }

.controls { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.text-form { display: flex; gap: 8px; flex: 1 1 220px; min-width: 0; }
.text-form input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font: inherit; background: var(--surface); color: var(--ink); }
.btn { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; font: 600 14px/1.2 inherit; font-family: inherit; cursor: pointer; background: var(--surface); color: var(--ink); display: inline-flex; align-items: center; gap: 8px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: #fff; color: #0B1220; border-color: #fff; }
.btn.big { padding: 13px 18px; font-size: 15px; justify-self: start; }
.btn.danger:not(:disabled) { color: var(--warn); }
.mic-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--live); }
.btn[aria-pressed="true"] .mic-dot { background: var(--muted); }

.side { display: grid; gap: 12px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.panel h2 { margin: 0 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.log { display: flex; flex-direction: column; gap: 8px; min-height: 220px; max-height: 52vh; overflow: auto; }
.msg { padding: 9px 12px; border-radius: 12px; max-width: 92%; font-size: 14px; overflow-wrap: anywhere; }
.msg.user { align-self: flex-end; background: var(--user); }
.msg.avatar { align-self: flex-start; background: var(--bot); }
.msg.system { align-self: center; font-size: 12px; color: var(--muted); background: none; padding: 2px; }
.notice p { margin: 0 0 8px; font-size: 13px; color: var(--muted); }
.notice p:last-child { margin: 0; }
.consent { color: rgba(255,255,255,.85); }
.linklike { background: none; border: 0; padding: 0; color: rgba(255,255,255,.85); font: inherit; font-size: 12px; text-decoration: underline; cursor: pointer; }
.privacy { margin: 0 0 8px; font-size: 13px; color: var(--muted); }
.privacy summary { cursor: pointer; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.privacy div { line-height: 1.55; }
[hidden] { display: none !important; }
.field { display: grid; gap: 6px; }
.field-label { font-size: 12px; color: rgba(255,255,255,.75); }
.select { appearance: none; -webkit-appearance: none; width: 100%; max-width: 280px; font: inherit; font-size: 14px; color: #fff; background: rgba(255,255,255,.14) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23fff' stroke-width='1.6' fill='none'/%3E%3C/svg%3E") no-repeat right 12px center; border: 1px solid rgba(255,255,255,.28); border-radius: 10px; padding: 9px 34px 9px 12px; cursor: pointer; }
.select:focus { outline: 2px solid rgba(255,255,255,.7); outline-offset: 1px; }
.select option { color: #0B1220; background: #fff; }
.btn.primary:disabled { opacity: .5; }
