/* Inversiones → Análisis IA (22-nov-2026). Va después de bolsa.css y usa sus tokens (ui.css).
   Celular primero: todo en una columna, sin tablas; el color solo informa. */

.bv .bia-prep{display:flex;gap:12px;align-items:flex-start;background:var(--acento-cl);color:var(--marca-osc);border-radius:10px;padding:12px 14px;margin:0 0 14px;line-height:1.45}
.bv .bia-prep b{display:block;font-weight:600}
.bv .bia-prep span:not(.bia-giro){font-size:14px;opacity:.9}
.bv .bia-giro{flex:none;width:18px;height:18px;margin-top:2px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:bia-giro .9s linear infinite}
@keyframes bia-giro{to{transform:rotate(360deg)}}

.bv .bia-hist{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:0 0 12px;font-size:13.5px;color:var(--tinta2)}
.bv .bia-hist select{flex:1 1 220px;max-width:360px;width:auto}

.bv .bia-resumen{border-left:4px solid var(--marca)}
.bv .bia-eti{display:block;font-size:12px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:var(--tinta3);margin-bottom:6px}
.bv .bia-resumen p{margin:0;font-size:16.5px;line-height:1.55;color:var(--tinta)}

/* Selector Portafolio / Mercado / Macro */
.bv .bia-seg{display:flex;gap:4px;background:var(--hover);border-radius:10px;padding:4px;margin:4px 0 14px}
.bv .bia-seg button{flex:1 1 0;min-height:40px;border:0;border-radius:8px;background:none;color:var(--tinta2);font:inherit;font-weight:600;font-size:14.5px;cursor:pointer}
.bv .bia-seg button.activa{background:var(--hoja);color:var(--tinta);box-shadow:0 1px 2px rgba(16,24,40,.08)}
.bv .bia-seg button:focus-visible{outline:none;box-shadow:var(--foco)}

.bv .bia-tit{margin:0 0 10px;font-size:18px;line-height:1.35;font-weight:600;color:var(--tinta)}
.bv .bia-p{margin:0 0 10px;font-size:15px;line-height:1.6;color:var(--tinta);max-width:80ch;overflow-wrap:anywhere}
.bv .bia-puntos{list-style:none;margin:12px 0 0;padding:0;display:flex;flex-direction:column;gap:8px}
.bv .bia-puntos li{display:flex;gap:10px;align-items:flex-start;font-size:14.5px;line-height:1.5}
.bv .bia-puntos li>span:last-child{min-width:0;overflow-wrap:anywhere}

.bv .bia-chip{flex:none;display:inline-flex;align-items:center;font-size:12px;font-weight:600;border-radius:6px;padding:2px 8px;background:var(--hover);color:var(--tinta2);white-space:nowrap}
.bv .bia-chip.ok{background:var(--ok-cl);color:var(--ok)}
.bv .bia-chip.rojo{background:var(--sello-cl);color:var(--sello)}
.bv .bia-chip.amb{background:var(--ambar-cl);color:var(--ambar)}
.bv .bia-chip.azul{background:var(--acento-cl);color:var(--marca)}

/* Indicadores macro: fichas pequeñas */
.bv .bia-inds{display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:10px;margin:0 0 14px}
.bv .bia-ind{background:var(--hoja);border:1px solid var(--linea);border-radius:10px;padding:12px;display:flex;flex-direction:column;gap:4px;min-width:0}
.bv .bia-ind .n{font-size:12.5px;color:var(--tinta3)}
.bv .bia-ind .v{font-size:19px;font-weight:600;color:var(--tinta);font-variant-numeric:tabular-nums}
.bv .bia-ind .l{font-size:13.5px;line-height:1.45;color:var(--tinta2);overflow-wrap:anywhere}

/* Emisores */
.bv .bia-emis{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:10px}
.bv .bia-emi{border:1px solid var(--linea);border-radius:10px;padding:12px;min-width:0}
.bv .bia-emi .k{display:flex;align-items:center;justify-content:space-between;gap:8px}
.bv .bia-emi .k b{font-size:15px;letter-spacing:.01em}
.bv .bia-emi p{margin:6px 0 0;font-size:14px;line-height:1.5;color:var(--tinta2);overflow-wrap:anywhere}

.bv .bia-acciones{margin:0;padding-left:22px;display:flex;flex-direction:column;gap:8px;font-size:15px;line-height:1.5}
.bv .bia-fuentes summary{cursor:pointer;font-weight:600;font-size:14.5px;min-height:28px}
.bv .bia-fuentes ul{margin:10px 0 0;padding-left:20px;font-size:14px;line-height:1.6}
.bv .bia-fuentes a{color:var(--marca);overflow-wrap:anywhere}

/* Chat */
.bv .bia-msgs{display:flex;flex-direction:column;gap:10px;max-height:min(520px,62vh);overflow-y:auto;padding:4px 2px;margin:12px 0 10px;overscroll-behavior:contain}
.bv .bia-msg{max-width:min(88%,720px);border-radius:14px;padding:10px 14px;font-size:15px;line-height:1.55;overflow-wrap:anywhere}
.bv .bia-msg p{margin:0 0 8px}
.bv .bia-msg p:last-of-type{margin-bottom:0}
.bv .bia-msg ul,.bv .bia-msg ol{margin:4px 0 8px;padding-left:20px}
.bv .bia-msg a{color:inherit;text-decoration:underline}
.bv .bia-msg .t{display:block;margin-top:6px;font-size:12px;opacity:.7}
.bv .bia-msg.yo{align-self:flex-end;background:var(--marca);color:#fff;border-bottom-right-radius:4px}
.bv .bia-msg.ia{align-self:flex-start;background:var(--hover);color:var(--tinta);border-bottom-left-radius:4px}
.bv .bia-msg.ia.err{background:var(--sello-cl);color:#8E2A20}
.bv .bia-msg.pensando{display:flex;align-items:center;gap:10px}
.bv .bia-msg.pensando .t{margin:0}
.bv .bia-puntos3{display:inline-flex;gap:4px}
.bv .bia-puntos3 i{width:6px;height:6px;border-radius:50%;background:var(--tinta3);animation:bia-punto 1.2s infinite ease-in-out}
.bv .bia-puntos3 i:nth-child(2){animation-delay:.15s}
.bv .bia-puntos3 i:nth-child(3){animation-delay:.3s}
@keyframes bia-punto{0%,80%,100%{opacity:.25}40%{opacity:1}}
.bv .bia-vacio{text-align:center;margin:16px auto}
.bv .bia-sugs{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 10px}
.bv .bia-sug{border:1px solid var(--linea);background:var(--hoja);color:var(--tinta);border-radius:999px;padding:8px 12px;font:inherit;font-size:13.5px;line-height:1.3;text-align:left;cursor:pointer;min-height:36px}
.bv .bia-sug:hover{background:var(--hover)}
.bv .bia-form{display:flex;gap:8px;align-items:flex-end}
.bv .bia-form textarea{flex:1 1 auto;min-height:48px;max-height:180px;resize:vertical;font-size:16px;line-height:1.4;padding:10px 12px}
.bv .bia-form .btn{flex:none;min-height:48px}
.bv .bia-legal{margin:14px 0 4px;font-size:12.5px;color:var(--tinta3)}

@media (max-width:759px){
  .bv .bia-resumen p{font-size:16px}
  .bv .bia-emis,.bv .bia-inds{grid-template-columns:1fr}
  .bv .bia-msg{max-width:94%}
  .bv .bia-msgs{max-height:58vh}
  .bv .bia-form{flex-direction:column;align-items:stretch}
  .bv .bia-form .btn{width:100%}
}
@media (prefers-reduced-motion:reduce){
  .bv .bia-giro,.bv .bia-puntos3 i{animation:none}
}
