/* Remi — chat de RescueMe. Colores planos del tema, siempre claro. */
#remi-root{
  --remi-ink:#16324F; --remi-muted:#5D6B7E; --remi-line:#E1EBF4; --remi-bg:#F2F8FD;
  --remi-blue:#4C9FE0; --remi-link:#0772BA; --remi-action:#163A5F;
  font-family:'Plus Jakarta Sans',system-ui,-apple-system,'Segoe UI',sans-serif;
  color:var(--remi-ink); color-scheme:light;
}
#remi-root *,#remi-root *::before,#remi-root *::after{box-sizing:border-box}
.remi-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* Lanzador: la casa de Remi + "¿Tienes preguntas?" (en el lugar del botón de WhatsApp) */
.remi-fab{
  position:fixed;right:18px;bottom:18px;z-index:72;padding:0;border:0;background:none;cursor:pointer;
  display:flex;flex-direction:column;align-items:center;gap:6px;color:var(--remi-ink);
}
.remi-house{
  width:72px;height:72px;border-radius:50%;background:#fff;border:3px solid var(--remi-blue);
  box-shadow:0 12px 28px -10px rgba(22,50,79,.45);display:flex;align-items:center;justify-content:center;
  transition:transform .18s ease;
}
.remi-house img{width:52px;height:52px;object-fit:contain}
.remi-fab-label{
  background:var(--remi-action);color:#fff;font-weight:800;font-size:.82rem;line-height:1;white-space:nowrap;
  padding:8px 12px;border-radius:999px;box-shadow:0 8px 18px -10px rgba(22,50,79,.6);
}
.remi-fab:hover .remi-house{transform:translateY(-2px)}
.remi-fab:hover .remi-fab-label{background:var(--remi-link)}
.remi-fab:focus-visible{outline:none}
.remi-fab:focus-visible .remi-house{outline:3px solid var(--remi-link);outline-offset:3px}
.remi-house.is-greeting{animation:remi-hop .6s ease}
@keyframes remi-hop{0%,100%{transform:translateY(0) scale(1)}35%{transform:translateY(-8px) scale(1.08)}65%{transform:translateY(0) scale(.97)}}

/* El riel recto viejo (script.js) ya no se usa: Remi vive en la casa */
.scroll-pet{display:none !important}

/* Camino en serpiente (solo pantallas anchas, ver remi.js) */
.remi-path{position:fixed;z-index:44;pointer-events:none;display:none}
html.remi-path-on .remi-path{display:block}
html.remi-chat-open .remi-path{display:none}
.remi-path svg{position:absolute;inset:0;overflow:visible}
.remi-path-track{fill:none;stroke:#C9D8E6;stroke-width:2.5;stroke-linecap:round;stroke-dasharray:2 9}
.remi-path-done{fill:none;stroke:#4C9FE0;stroke-width:3;stroke-linecap:round}
.remi-path-dog{
  position:absolute;left:0;top:0;width:44px;height:auto;will-change:transform;
  filter:drop-shadow(0 5px 8px rgba(18,41,59,.25));transition:opacity .35s ease;
}
.remi-path-dog.is-home{opacity:0}

/* Ventana */
.remi-panel{
  position:fixed;right:18px;bottom:132px;z-index:73;width:380px;height:min(560px,calc(100vh - 160px));
  display:flex;flex-direction:column;background:#fff;border:1px solid var(--remi-line);border-radius:24px;
  box-shadow:0 24px 56px -24px rgba(22,50,79,.5);overflow:hidden;animation:remi-pop .22s ease;
}
.remi-panel[hidden]{display:none}

.remi-head{display:flex;align-items:center;gap:10px;padding:12px 12px 12px 14px;background:var(--remi-blue);color:#fff}
.remi-head-avatar{width:40px;height:40px;border-radius:50%;background:#fff;padding:3px;object-fit:contain;transform:scaleX(-1)}
.remi-head-text{flex:1;display:flex;flex-direction:column;line-height:1.2}
.remi-head-text strong{font-family:'Fredoka',ui-rounded,sans-serif;font-size:1.15rem;font-weight:700;color:#fff}
.remi-head-text span{font-size:.8rem;color:#fff;opacity:.95}
.remi-icon-btn{width:36px;height:36px;border:0;border-radius:50%;background:rgba(255,255,255,.18);color:#fff;display:flex;align-items:center;justify-content:center;cursor:pointer}
.remi-icon-btn:hover{background:rgba(255,255,255,.3)}
.remi-icon-btn:focus-visible{outline:3px solid #fff;outline-offset:2px}

.remi-log{flex:1;overflow-y:auto;padding:16px 14px 8px;background:var(--remi-bg);display:flex;flex-direction:column;gap:12px;overscroll-behavior:contain}
.remi-row{display:flex;align-items:flex-end;gap:8px;max-width:100%}
.remi-row.is-user{justify-content:flex-end}
.remi-mini{width:28px;height:28px;flex:none;border-radius:50%;background:#fff;border:1px solid var(--remi-line);padding:2px;object-fit:contain;transform:scaleX(-1)}
.remi-col{display:flex;flex-direction:column;gap:8px;min-width:0;max-width:calc(100% - 36px)}
.remi-bubble{margin:0;padding:10px 13px;border-radius:18px 18px 18px 6px;background:#fff;border:1px solid var(--remi-line);font-size:.93rem;line-height:1.5;color:var(--remi-ink);overflow-wrap:anywhere}
.remi-bubble b{color:var(--remi-action)}
.remi-row.is-user .remi-bubble{background:var(--remi-link);border-color:var(--remi-link);color:#fff;border-radius:18px 18px 6px 18px;max-width:82%}

.remi-actions{display:flex;flex-direction:column;gap:6px}
.remi-action{display:block;text-align:center;padding:10px 14px;border-radius:14px;font-weight:700;font-size:.9rem;text-decoration:none;background:#fff;color:var(--remi-link);border:2px solid #CFE0EE}
.remi-action:hover{border-color:var(--remi-link)}
.remi-action.is-primary{background:var(--remi-action);border-color:var(--remi-action);color:#fff}
.remi-action.is-primary:hover{background:var(--remi-link);border-color:var(--remi-link)}

.remi-chips{display:flex;flex-wrap:wrap;gap:6px}
.remi-chip{border:1px solid #CFE0EE;background:#fff;color:var(--remi-ink);border-radius:999px;padding:8px 12px;font:700 .82rem 'Plus Jakarta Sans',system-ui,sans-serif;cursor:pointer}
.remi-chip:hover{background:#DDF0F5;border-color:#DDF0F5;color:#1E7A93}
.remi-chip:focus-visible,.remi-action:focus-visible{outline:3px solid var(--remi-link);outline-offset:2px}

.remi-typing{display:flex;gap:4px;align-items:center;padding:14px 16px}
.remi-typing i{width:7px;height:7px;border-radius:50%;background:#9FB3C8;animation:remi-dot 1s infinite ease-in-out}
.remi-typing i:nth-child(3){animation-delay:.15s}.remi-typing i:nth-child(4){animation-delay:.3s}
@keyframes remi-dot{0%,80%,100%{transform:translateY(0);opacity:.5}40%{transform:translateY(-4px);opacity:1}}

.remi-form{display:flex;gap:8px;padding:10px 12px 6px;border-top:1px solid var(--remi-line);background:#fff}
.remi-form input{flex:1;min-width:0;height:46px;border:1.5px solid #CFE0EE;border-radius:14px;padding:0 14px;font:500 .95rem 'Plus Jakarta Sans',system-ui,sans-serif;color:var(--remi-ink);background:#fff}
.remi-form input:focus{outline:none;border-color:var(--remi-link)}
.remi-send{width:46px;height:46px;flex:none;border:0;border-radius:14px;background:var(--remi-action);color:#fff;display:flex;align-items:center;justify-content:center;cursor:pointer}
.remi-send:hover{background:var(--remi-link)}
.remi-wa-link{display:block;text-align:center;padding:6px 12px 12px;font-size:.8rem;font-weight:700;color:var(--remi-link);text-decoration:underline;text-underline-offset:3px;background:#fff}

/* Celular: hoja a pantalla completa */
@media (max-width:600px){
  .remi-fab{right:12px;bottom:12px;gap:4px}
  .remi-house{width:58px;height:58px}
  .remi-house img{width:42px;height:42px}
  .remi-fab-label{font-size:.74rem;padding:6px 10px}
  .remi-panel{inset:0;width:auto;height:100%;height:100dvh;border-radius:0;border:0}
  #remi-root.is-open .remi-fab{display:none}
  .remi-head{padding-top:max(12px,env(safe-area-inset-top))}
  .remi-wa-link{padding-bottom:max(12px,env(safe-area-inset-bottom))}
  html.remi-lock,html.remi-lock body{overflow:hidden}
  .remi-form input{font-size:16px} /* evita el zoom de iOS al escribir */
}
/* Si el banner de la app está visible arriba, no tapa la cabecera del chat */
@media (max-width:600px){html.has-app-banner .remi-panel{top:0}}

@media (prefers-reduced-motion: reduce){
  .remi-panel{animation:none}
  .remi-house.is-greeting{animation:none}
  .remi-typing i{animation:none;opacity:.8}
  .remi-house{transition:none}
}

@keyframes remi-pop{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}

