:root { color-scheme: dark; --bg:#06111f; --panel:rgba(13,34,56,.88); --panel-soft:rgba(20,47,75,.72); --line:rgba(171,205,230,.18); --text:#f4f8fb; --muted:#a9bac8; --accent:#73c8f3; --accent-2:#b7e8ff; --ok:#7ce0ac; --warn:#ffd17a; --bad:#ff8a8a; }
* { box-sizing:border-box; }
html,body { min-height:100%; }
body { margin:0; font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; background:radial-gradient(circle at 10% 0%,rgba(34,118,165,.28),transparent 34rem),radial-gradient(circle at 90% 10%,rgba(15,84,124,.22),transparent 30rem),var(--bg); color:var(--text); }
button { font:inherit; }
.shell { width:min(1120px,calc(100% - 28px)); margin:0 auto; padding:clamp(24px,5vw,64px) 0; }
.hero { display:grid; gap:24px; }
.brand-row { display:flex; align-items:center; gap:16px; }
.brand-mark { width:54px; height:54px; display:grid; place-items:center; border-radius:17px; font-weight:800; letter-spacing:-.03em; background:linear-gradient(145deg,#79d3ff,#267fb3); color:#03101c; box-shadow:0 12px 36px rgba(49,160,219,.22); }
.eyebrow { margin:0 0 5px; color:var(--accent); font-weight:700; font-size:.78rem; letter-spacing:.12em; text-transform:uppercase; }
h1 { margin:0; font-size:clamp(2rem,6vw,4.4rem); line-height:.98; max-width:820px; letter-spacing:-.055em; }
h2 { margin:0; font-size:clamp(1.3rem,3vw,2rem); letter-spacing:-.025em; }
.stage { min-height:340px; display:grid; grid-template-columns:minmax(240px,.8fr) minmax(300px,1.2fr); align-items:center; gap:clamp(20px,5vw,64px); padding:clamp(24px,5vw,54px); border:1px solid var(--line); border-radius:30px; background:linear-gradient(145deg,rgba(13,34,56,.94),rgba(7,22,38,.9)); box-shadow:0 24px 80px rgba(0,0,0,.28); overflow:hidden; }
.avatar-placeholder { position:relative; height:250px; display:grid; place-items:center; }
.avatar-placeholder::before { content:""; position:absolute; width:230px; height:230px; border-radius:50%; background:radial-gradient(circle,rgba(115,200,243,.24),rgba(115,200,243,0) 68%); }
.avatar-head { position:absolute; top:28px; width:104px; height:122px; border-radius:50% 50% 46% 46%; background:linear-gradient(180deg,#9edbf7,#4f9fc8); }
.avatar-body { position:absolute; bottom:12px; width:205px; height:122px; border-radius:110px 110px 30px 30px; background:linear-gradient(180deg,#3788b3,#174767); }
.speech { position:relative; padding:clamp(22px,4vw,34px); border-radius:24px; background:rgba(255,255,255,.055); border:1px solid rgba(255,255,255,.08); }
.speech-label { margin:0 0 10px; color:var(--accent-2); font-weight:700; }
.speech-text { margin:0; color:#edf6fb; font-size:clamp(1.02rem,2vw,1.28rem); line-height:1.55; }
.mic-card { padding:clamp(22px,4vw,34px); border:1px solid var(--line); border-radius:25px; background:var(--panel); display:grid; gap:18px; }
.mic-heading { display:flex; justify-content:space-between; gap:16px; align-items:start; }
.privacy-badge { border:1px solid rgba(124,224,172,.28); color:var(--ok); background:rgba(124,224,172,.08); border-radius:999px; padding:8px 12px; font-size:.8rem; font-weight:750; white-space:nowrap; }
.mic-explain,.device-label { margin:0; color:var(--muted); line-height:1.5; }
.mic-controls { display:flex; gap:10px; flex-wrap:wrap; }
button { min-height:52px; border-radius:16px; border:1px solid var(--line); padding:0 22px; font-weight:800; background:linear-gradient(145deg,#76d0fa,#3f99c6); color:#04131f; cursor:pointer; }
button.secondary { background:rgba(255,255,255,.06); color:var(--text); }
button:disabled { opacity:.48; cursor:not-allowed; }
.meter-wrap { display:grid; grid-template-columns:minmax(160px,1fr) auto; gap:12px; align-items:center; }
.meter { height:14px; border-radius:999px; overflow:hidden; background:rgba(255,255,255,.08); border:1px solid var(--line); }
.meter-bar { width:0%; height:100%; background:linear-gradient(90deg,#6fc9f2,#7ce0ac); transition:width 70ms linear; }
.notice { padding:14px 16px; border:1px solid var(--line); border-radius:16px; color:var(--muted); background:rgba(255,255,255,.035); line-height:1.45; }
.notice.ok { color:var(--ok); border-color:rgba(124,224,172,.25); }
.notice.warn { color:var(--warn); border-color:rgba(255,209,122,.25); }
.notice.bad { color:var(--bad); border-color:rgba(255,138,138,.25); }
.status-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:14px; }
.status-card { min-height:96px; display:flex; align-items:center; gap:14px; padding:18px; border-radius:20px; background:var(--panel-soft); border:1px solid var(--line); }
.status-card.muted { opacity:.72; }
.dot { width:14px; height:14px; border-radius:50%; background:#8aa0b0; box-shadow:0 0 0 7px rgba(138,160,176,.09); flex:0 0 auto; }
.dot.ok { background:var(--ok); box-shadow:0 0 0 7px rgba(124,224,172,.11); }
.dot.warn { background:var(--warn); box-shadow:0 0 0 7px rgba(255,209,122,.10); }
.dot.fail { background:var(--bad); box-shadow:0 0 0 7px rgba(255,138,138,.11); }
.icon { font-size:1.35rem; width:30px; text-align:center; }
.status-title { margin:0 0 3px; color:var(--muted); font-size:.82rem; }
.status-value { margin:0; font-weight:750; }
@media (max-width:760px) { .stage { grid-template-columns:1fr; min-height:auto; } .avatar-placeholder { height:215px; } .status-grid { grid-template-columns:1fr; } }
@media (max-width:520px) { .shell { width:min(100% - 18px,1120px); padding-top:18px; } .brand-mark { width:46px; height:46px; border-radius:14px; } .stage,.mic-card { border-radius:22px; } .mic-heading { display:grid; } .meter-wrap { grid-template-columns:1fr; } }
.ai-card {
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid var(--line);
  border-radius: 25px;
  background: var(--panel);
  display: grid;
  gap: 18px;
}
.ai-heading { display: flex; justify-content: space-between; align-items: start; gap: 16px; }
.ai-explain { margin: 0; color: var(--muted); line-height: 1.55; }
.ai-form { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: stretch; }
.ai-form textarea {
  min-height: 94px; resize: vertical; width: 100%; padding: 15px 17px;
  border-radius: 16px; border: 1px solid var(--line); background: rgba(255,255,255,.055);
  color: var(--text); font: inherit; line-height: 1.45;
}
.ai-form textarea:focus { outline: 2px solid rgba(115,200,243,.55); outline-offset: 1px; }
.ai-form button { min-width: 132px; }
@media (max-width: 620px) {
  .ai-heading { display: grid; }
  .ai-form { grid-template-columns: 1fr; }
  .ai-form button { width: 100%; }
}

/* DEV05A r5: conservar párrafos de texto plano y preparar la misma salida para voz. */
.speech-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* DEV05B — Realtime WebRTC con salida textual */
.realtime-card {
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid var(--line);
  border-radius: 25px;
  background: var(--panel);
  display: grid;
  gap: 18px;
}
.realtime-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.realtime-actions button { min-width: 170px; }
@media (max-width: 620px) {
  .realtime-actions { display: grid; }
  .realtime-actions button { width: 100%; }
}
