/* =========================================================
   Solina · chat del sitio (asistente con IA)
   ========================================================= */
.sch-btn {
  position: fixed; right: clamp(16px, 2.5vw, 28px); bottom: calc(clamp(16px, 2.5vw, 28px) + 62px); z-index: 61;
  display: flex; align-items: center; gap: 10px; padding: 8px 16px 8px 8px; border-radius: 999px;
  background: var(--grafito, #10151D); color: #fff; border: 1px solid rgba(99,179,255,.35);
  font: 500 .9rem/1 var(--f-body, system-ui); box-shadow: 0 14px 34px -12px rgba(31,107,255,.7);
  transform: translateY(160%); opacity: 0; transition: transform .6s cubic-bezier(.2,.7,.1,1), opacity .4s, background .2s;
}
.sch-btn.is-on { transform: none; opacity: 1; }
.sch-btn:hover { background: var(--grafito-2, #171E29); }
.sch-btn .sch-nuevo[hidden] { display: none; }
.sch-btn img { width: 34px; height: 34px; border-radius: 50%; }
.sch-btn .sch-punto { position: absolute; top: 4px; left: 32px; width: 11px; height: 11px; border-radius: 50%; background: #3FCF8E; border: 2px solid var(--grafito, #10151D); }
.sch-btn .sch-nuevo { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; border-radius: 10px; background: var(--azul, #1F6BFF); font-size: .7rem; font-weight: 700; display: grid; place-items: center; padding: 0 5px; }

.sch {
  position: fixed; right: clamp(16px, 2.5vw, 28px); bottom: clamp(16px, 2.5vw, 28px); z-index: 120;
  width: min(390px, calc(100vw - 32px)); height: min(620px, calc(100dvh - 40px));
  display: grid; grid-template-rows: auto 1fr auto auto; overflow: hidden;
  background: #0B0F15; color: var(--niebla, #EEF2F8); border: 1px solid rgba(150,180,230,.2); border-radius: 22px;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.8), 0 0 0 1px rgba(31,107,255,.1);
  transform-origin: bottom right; transform: scale(.92) translateY(12px); opacity: 0; pointer-events: none;
  transition: transform .35s cubic-bezier(.2,.7,.1,1), opacity .25s;
  font: 400 15px/1.5 var(--f-body, system-ui);
}
.sch.is-open { transform: none; opacity: 1; pointer-events: auto; }
.sch__cab { display: flex; align-items: center; gap: 11px; padding: 14px 14px 12px 16px; border-bottom: 1px solid rgba(150,180,230,.12); background: linear-gradient(180deg, rgba(31,107,255,.12), transparent); }
.sch__cab img { width: 36px; height: 36px; border-radius: 10px; }
.sch__cab b { display: block; font: 600 .98rem/1.2 var(--f-display, system-ui); }
.sch__cab small { color: #8A94A6; font-size: .76rem; display: flex; align-items: center; gap: 6px; }
.sch__cab small::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #3FCF8E; }
.sch__x { margin-left: auto; width: 34px; height: 34px; border-radius: 10px; border: 0; background: none; color: #8A94A6; font-size: 1.4rem; line-height: 1; cursor: pointer; }
.sch__x:hover { background: rgba(255,255,255,.06); color: #fff; }
.sch__msgs { overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; overscroll-behavior: contain; }
.sch__m { max-width: 86%; padding: 9px 13px; border-radius: 16px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .93rem; animation: schIn .3s ease both; }
.sch__m a { color: #8DB4FF; text-decoration: underline; }
.sch__m--bot, .sch__m--humano { align-self: flex-start; background: #171E29; border-bottom-left-radius: 5px; }
.sch__m--humano { border: 1px solid rgba(63,207,142,.35); }
.sch__m--humano::before { content: "Oliver"; display: block; font-size: .7rem; font-weight: 600; color: #3FCF8E; margin-bottom: 2px; }
.sch__m--cliente { align-self: flex-end; background: var(--azul, #1F6BFF); color: #fff; border-bottom-right-radius: 5px; }
.sch__m--error { align-self: center; background: rgba(255,107,107,.12); color: #FFC2C2; font-size: .82rem; }
.sch__escribiendo { align-self: flex-start; display: flex; gap: 4px; padding: 12px 14px; background: #171E29; border-radius: 16px; border-bottom-left-radius: 5px; }
.sch__escribiendo i { width: 6px; height: 6px; border-radius: 50%; background: #8A94A6; animation: schPunto 1.2s infinite; }
.sch__escribiendo i:nth-child(2) { animation-delay: .15s; } .sch__escribiendo i:nth-child(3) { animation-delay: .3s; }
@keyframes schPunto { 0%, 60%, 100% { opacity: .3; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }
@keyframes schIn { from { opacity: 0; transform: translateY(6px); } }
.sch__rapidas { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 16px 10px; }
.sch__rapidas button { border: 1px solid rgba(99,179,255,.35); background: none; color: #CFE0FF; border-radius: 999px; padding: 6px 11px; font: inherit; font-size: .8rem; cursor: pointer; }
.sch__rapidas button:hover { background: rgba(31,107,255,.15); }
.sch__form { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(150,180,230,.12); }
.sch__form textarea { flex: 1; resize: none; min-height: 42px; max-height: 120px; padding: 10px 12px; border-radius: 12px; border: 1px solid rgba(150,180,230,.22); background: #07090D; color: inherit; font: inherit; font-size: 16px; outline: none; }
.sch__form textarea:focus { border-color: var(--azul, #1F6BFF); }
.sch__form button { width: 42px; height: 42px; flex: none; border-radius: 12px; border: 0; background: var(--azul, #1F6BFF); color: #fff; display: grid; place-items: center; cursor: pointer; }
.sch__form button:disabled { opacity: .5; cursor: default; }
.sch__form svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sch__pie { font-size: .68rem; color: #5F6A7D; text-align: center; padding: 0 12px 8px; margin-top: -4px; }
.sch__pie a { color: #7E8BA0; }
@media (max-width: 560px) {
  .sch { right: 0; bottom: 0; width: 100vw; height: 100dvh; border-radius: 0; border: 0; }
  .sch-btn .sch-txt { display: none; }
  .sch-btn { padding: 8px; }
}
body.sch-abierto .wa-float { opacity: 0; pointer-events: none; }

.sch__img { display: block; max-width: 100%; border-radius: 10px; margin-bottom: 6px; }
.sch__audio { display: block; width: 230px; max-width: 100%; margin-bottom: 4px; }
.sch__doc { display: inline-block; padding: 6px 10px; border-radius: 10px; background: rgba(255,255,255,.08); margin-bottom: 4px; font-weight: 600; text-decoration: none !important; }
