/* Asistente de FROST (14-11-2026): botón «Preguntar» y hoja de conversación, grandes y claros para personas mayores */
.ia-btn { position: fixed; right: 84px; bottom: 24px; z-index: 60; display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 0 22px 0 18px;
  border: 0; border-radius: 28px; background: var(--accent); color: #061018; font: 650 17px var(--font-ui); box-shadow: 0 8px 24px rgba(0, 0, 0, .35); cursor: pointer; }
.ia-btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.ia-btn.on { background: var(--surface-2); color: var(--text); border: 1px solid var(--border-hi); }
.ia-sheet { position: fixed; right: 24px; bottom: 92px; z-index: 61; width: min(420px, calc(100vw - 32px)); max-height: min(640px, calc(100dvh - 140px));
  display: flex; flex-direction: column; border-radius: 20px; border: 1px solid var(--border-hi); background: var(--surface); box-shadow: 0 16px 48px rgba(0, 0, 0, .45); overflow: hidden; }
.ia-sheet.hidden { display: none; }
.ia-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 18px 10px; border-bottom: 1px solid var(--border); }
.ia-head b { display: block; font: 700 20px var(--font-ui); color: var(--text); }
.ia-head small { display: block; margin-top: 2px; font-size: 14px; color: var(--text-2); }
.ia-x { min-width: 44px; min-height: 44px; border: 0; background: none; color: var(--text-2); font-size: 18px; cursor: pointer; }
.ia-log { flex: 1; overflow: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; min-height: 120px; }
.ia-b { max-width: 88%; padding: 11px 14px; border-radius: 16px; font-size: 16.5px; line-height: 1.4; color: var(--text); }
.ia-b.frost { align-self: flex-start; background: var(--surface-2); border-bottom-left-radius: 6px; }
.ia-b.yo { align-self: flex-end; background: color-mix(in srgb, var(--accent) 22%, var(--surface)); border-bottom-right-radius: 6px; }
.ia-b.nota { align-self: center; background: none; color: var(--text-2); font-size: 13.5px; padding: 2px 8px; }
.ia-b.opciones { align-self: stretch; max-width: none; background: none; padding: 0; display: grid; gap: 8px; }
.ia-b.opciones button, .ia-sug button { min-height: 48px; padding: 8px 14px; border-radius: 12px; border: 1px solid var(--border-hi); background: var(--surface); color: var(--text);
  font: 600 16px var(--font-ui); text-align: left; cursor: pointer; }
.ia-sug { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 10px; }
.ia-sug:empty { display: none; }
.ia-sug button { min-height: 40px; font-size: 15px; font-weight: 500; border-radius: 20px; }
.ia-in { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border); }
.ia-in input { flex: 1; min-width: 0; min-height: 48px; padding: 0 14px; border-radius: 24px; border: 1px solid var(--border); background: var(--field, var(--surface-2)); color: var(--text); font-size: 17px; }
.ia-mic, .ia-send { flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; border: 0; cursor: pointer; }
.ia-mic { background: var(--accent); color: #061018; }
.ia-mic.oyendo { background: var(--bad); color: #fff; animation: ia-late 1.1s ease-in-out infinite; }
.ia-send { background: var(--surface-2); color: var(--text); }
.ia-mic svg, .ia-send svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ia-voz { display: flex; align-items: center; gap: 8px; padding: 0 16px 12px; font-size: 14px; color: var(--text-2); }
.ia-dots { display: inline-flex; gap: 5px; }
.ia-dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--text-2); animation: ia-dot 1s infinite ease-in-out; }
.ia-dots span:nth-child(2) { animation-delay: .15s; } .ia-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes ia-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@keyframes ia-late { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 93, 93, .5); } 50% { box-shadow: 0 0 0 10px rgba(255, 93, 93, 0); } }
@media (max-width: 860px) {
  .ia-btn { right: 14px; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 14px); min-height: 52px; padding: 0 18px 0 14px; }
  .ia-sheet { left: 0; right: 0; bottom: 0; width: 100%; max-height: 82dvh; border-radius: 20px 20px 0 0; padding-bottom: env(safe-area-inset-bottom); z-index: 70; }
}

/* Grabar un audio, como en WhatsApp (14-11-2026): mientras graba, el campo de texto se cambia por el tiempo y la onda;
   el micrófono queda en rojo y la flecha (o tocar de nuevo el micrófono) lo envía; el basurero lo bota.
   Colores con respaldo: si hay un tema cargado (tema-b) usa los suyos, y si no, los de siempre. */
.ia-rec { display: none; flex: 1; min-width: 0; min-height: 48px; align-items: center; gap: 8px; padding: 0 14px 0 2px; border-radius: 28px;
  border: 1px solid var(--border); background: var(--field, var(--surface-2)); }
.ia-in.grabando input { display: none; }
.ia-in.grabando .ia-rec { display: flex; }
.ia-in.grabando .ia-send { background: var(--accent); color: #061018; }
.ia-rec-x { flex: none; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--text-2); cursor: pointer; }
.ia-rec-x svg, .ia-audio svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ia-rec-t { flex: none; display: inline-flex; align-items: center; gap: 7px; min-width: 58px; font: 650 17px var(--font-ui); font-variant-numeric: tabular-nums; color: var(--text); }
.ia-rec-t::before { content: ''; flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--bad); animation: ia-punto 1.1s ease-in-out infinite; }
.ia-rec-t.poco { color: var(--bad); }
.ia-onda { flex: 1; min-width: 0; height: 30px; display: flex; align-items: center; justify-content: space-between; gap: 2px; overflow: hidden; }
.ia-onda i { flex: 0 1 3px; min-width: 2px; height: 12%; min-height: 3px; border-radius: 2px; background: var(--text-2); transition: height .1s linear; }
.ia-onda.sola i { animation: ia-onda 1s ease-in-out infinite; } /* el teléfono no deja medir el micrófono: la onda se mueve sola */
.ia-onda.sola i:nth-child(3n) { animation-delay: .2s; } .ia-onda.sola i:nth-child(3n+1) { animation-delay: .45s; } .ia-onda.sola i:nth-child(4n) { animation-delay: .7s; }
.ia-audio { display: inline-flex; align-items: center; gap: 8px; min-height: 23px; } /* burbuja del audio mientras el servidor lo escucha */
.ia-audio svg { width: 18px; height: 18px; stroke-width: 2.2; }
@keyframes ia-punto { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@keyframes ia-onda { 0%, 100% { height: 14%; } 50% { height: 78%; } }
html[data-diseno="b"] .ia-rec { min-height: 56px; border-color: transparent; background: var(--b-2); }
html[data-diseno="b"] .ia-rec-x { color: var(--b-tx2); } html[data-diseno="b"] .ia-rec-t { color: var(--b-tx); } html[data-diseno="b"] .ia-onda i { background: var(--b-tx2); }
html[data-diseno="b"] .ia-rec-t::before { background: var(--b-bad, var(--bad)); } html[data-diseno="b"] .ia-rec-t.poco { color: var(--b-bad, var(--bad)); }
html[data-diseno="b"] .ia-in.grabando .ia-send { background: var(--b-ac); color: var(--b-ac-ink); }
@media (prefers-reduced-motion: reduce) { .ia-rec-t::before, .ia-onda.sola i, .ia-mic.oyendo { animation: none; } .ia-onda i { transition: none; } }

/* 14-11 · Frost es el asistente: su cara en el botón (con un micrófono chico) y en la cabecera de la hoja */
.ia-cara { position: relative; display: inline-block; width: 34px; height: 34px; flex: none; }
.ia-cara img { width: 100%; height: 100%; border-radius: 50%; display: block; object-fit: cover; }
.ia-cara .ia-mini { position: absolute; right: -4px; bottom: -4px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #061018; box-shadow: 0 0 0 2px var(--surface); }
.ia-btn .ia-cara .ia-mini svg { width: 11px; height: 11px; padding: 0; background: none; box-shadow: none; stroke-width: 2.6; }
.ia-avatar { width: 44px; height: 44px; border-radius: 14px; flex: none; }
.ia-head { align-items: center; }
.ia-head > div { flex: 1; min-width: 0; }
