/* JJ, the Mangawik assistant (inc/jj.php, assets/jj.js). Mangawik purple/pink, mobile first. */
#mwjj { --jj-morado: #7b1fd1; --jj-rosa: #d0237e; position: fixed; right: 16px; bottom: 16px; z-index: 2147483000; font-family: inherit; font-size: 15px; line-height: 1.45; }
#mwjj * { box-sizing: border-box; }
#mwjj .mwjj-boton { display: flex; align-items: center; gap: 8px; border: 0; border-radius: 999px; padding: 8px 16px 8px 8px; cursor: pointer; color: #fff; font-weight: 700; font-size: 15px;
  background: linear-gradient(135deg, var(--jj-morado), var(--jj-rosa)); box-shadow: 0 6px 20px rgba(123, 31, 209, .35); }
#mwjj .mwjj-cara { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #fff; color: var(--jj-morado); font-weight: 800; font-size: 14px; flex: none; }
#mwjj.abierto .mwjj-boton { display: none; }
#mwjj .mwjj-panel { position: fixed; right: 16px; bottom: 16px; width: 380px; max-width: calc(100vw - 32px); height: 560px; max-height: calc(100vh - 32px);
  display: flex; flex-direction: column; background: #fff; border-radius: 18px; overflow: hidden; box-shadow: 0 16px 48px rgba(0, 0, 0, .25); }
#mwjj .mwjj-panel[hidden] { display: none; }
#mwjj header { display: flex; align-items: center; gap: 10px; padding: 12px 14px; color: #fff; background: linear-gradient(135deg, var(--jj-morado), var(--jj-rosa)); }
#mwjj header div { flex: 1; display: flex; flex-direction: column; } #mwjj header small { opacity: .9; font-size: 12.5px; }
#mwjj .mwjj-cerrar { display: flex; align-items: center; gap: 4px; border: 0; border-radius: 999px; background: rgba(255,255,255,.22); color: #fff; font: inherit; font-size: 14px; font-weight: 700; line-height: 1; cursor: pointer; padding: 8px 12px; }
#mwjj .mwjj-cerrar span { font-size: 22px; line-height: .8; }
#mwjj .mwjj-msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; background: #faf8fc; }
#mwjj .mwjj-msg { max-width: 86%; padding: 9px 12px; border-radius: 14px; word-wrap: break-word; }
#mwjj .mwjj-assistant { align-self: flex-start; background: #fff; border: 1px solid #ece6f3; border-bottom-left-radius: 4px; color: #2b2633; }
#mwjj .mwjj-user { align-self: flex-end; background: var(--jj-morado); color: #fff; border-bottom-right-radius: 4px; }
#mwjj .mwjj-msg a { color: var(--jj-rosa); font-weight: 600; } #mwjj .mwjj-user a { color: #fff; }
#mwjj .mwjj-pensando { color: #8a7f99; animation: mwjj-latir 1s infinite alternate; }
@keyframes mwjj-latir { from { opacity: .4; } to { opacity: 1; } }
#mwjj .mwjj-ideas { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 10px; background: #faf8fc; }
#mwjj .mwjj-ideas[hidden] { display: none; }
#mwjj .mwjj-ideas button { border: 1px solid #d9cdea; background: #fff; color: var(--jj-morado); border-radius: 999px; padding: 5px 10px; font-size: 13px; cursor: pointer; }
#mwjj .mwjj-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid #eee; }
#mwjj .mwjj-form textarea { flex: 1; resize: none; border: 1px solid #d9cdea; border-radius: 12px; padding: 9px 11px; font: inherit; font-size: 15px; min-height: 42px; max-height: 110px; }
#mwjj .mwjj-form button { border: 0; border-radius: 12px; width: 44px; color: #fff; font-size: 18px; cursor: pointer; background: linear-gradient(135deg, var(--jj-morado), var(--jj-rosa)); }
#mwjj .mwjj-pie { margin: 0; padding: 0 12px 10px; font-size: 11.5px; color: #8a7f99; }
#mwjj .mwjj-pie a { color: #8a7f99; } #mwjj .mwjj-pie .mwjj-wa { color: #128c4b; font-weight: 700; }
@media (max-width: 600px) {
  /* Same height and size as the round language button (design.css: bottom 20px, 46px), mirrored on the right.
     The theme's «scroll to top» square sat hidden behind JJ, so it is not shown on phones. */
  #mwjj { right: 20px; bottom: 20px; }
  .wil-scroll-top { display: none !important; }
  #mwjj .mwjj-txt { display: none; } #mwjj .mwjj-boton { padding: 6px; }
  /* Full screen on phones, above the site's sticky header, with the close button always visible at the top. */
  #mwjj .mwjj-panel { top: 0; left: 0; right: 0; bottom: 0; width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; }
  #mwjj header { padding-top: calc(12px + env(safe-area-inset-top)); }
  html.mwjj-abierto, html.mwjj-abierto body { overflow: hidden; }
}
