/* ==========================================================
   Vale · widget de chat
   ========================================================== */
.mp { position: fixed; right: 24px; bottom: 24px; z-index: 60; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; font-family: var(--font-sans); color: var(--grafito); }

.mp-panel { width: 380px; height: min(596px, calc(100vh - 120px)); display: flex; flex-direction: column; background: #fff; border: 1px solid var(--gris-100); border-radius: 18px; overflow: hidden; box-shadow: 0 18px 48px rgba(35, 38, 46, .22); }
.mp-panel[hidden] { display: none; }

.mp-head { background: var(--grafito); padding: 16px 16px 16px 18px; display: flex; align-items: center; gap: 12px; }
.mp-avatar { position: relative; width: 42px; height: 42px; border-radius: 50%; background: var(--teal-50); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 15px; font-weight: 800; color: var(--teal-900); letter-spacing: -.02em; }
.mp-avatar::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 50%; background: var(--teal-500); border: 2px solid var(--grafito); }
.mp-head__txt { display: flex; flex-direction: column; gap: 3px; flex-grow: 1; }
.mp-head__name { font-size: 16px; font-weight: 700; color: var(--papel); }
.mp-head__role { font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em; color: var(--teal-200); }
.mp-icon-btn { width: 36px; height: 36px; border: 0; border-radius: 8px; background: var(--gris-800); color: var(--papel); display: flex; align-items: center; justify-content: center; cursor: pointer; }

.mp-body { flex-grow: 1; overflow-y: auto; background: var(--papel); display: flex; flex-direction: column-reverse; }
.mp-log { padding: 18px 16px 8px; display: flex; flex-direction: column; gap: 12px; }
.mp-day { align-self: center; font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em; color: var(--gris-600); }

.mp-msg { display: flex; gap: 8px; align-items: flex-end; max-width: 300px; }
.mp-msg__av { width: 26px; height: 26px; border-radius: 50%; background: var(--teal-50); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 10px; font-weight: 800; color: var(--teal-900); }
.mp-bubble { display: flex; flex-direction: column; gap: 10px; background: #fff; border: 1px solid var(--gris-100); border-radius: 14px 14px 14px 4px; padding: 11px 14px; font-size: 14px; line-height: 1.5; white-space: pre-line; }
.mp-bubble .btn { align-self: flex-start; font-size: 13px; padding: 9px 14px; white-space: normal; }
.mp-msg--user { align-self: flex-end; max-width: 270px; }
.mp-msg--user .mp-bubble { background: var(--grafito); color: var(--papel); border-color: var(--grafito); border-radius: 14px 14px 4px 14px; }

.mp-typing { display: flex; gap: 4px; padding: 14px; }
.mp-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--gris-600); animation: mpdot 1.2s infinite; }
.mp-typing i:nth-child(2) { animation-delay: .2s; }
.mp-typing i:nth-child(3) { animation-delay: .4s; }
@keyframes mpdot { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

.mp-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 14px; background: var(--papel); border-top: 1px solid var(--gris-100); }
.mp-chips:empty { display: none; }
.mp-chip { border: 1px solid var(--teal-200); background: #fff; color: var(--teal-700); font-family: inherit; font-size: 12.5px; font-weight: 600; padding: 7px 11px; border-radius: 999px; cursor: pointer; }
.mp-chip:hover { background: var(--teal-50); }

.mp-form { display: flex; gap: 8px; align-items: center; padding: 12px 14px 6px; border-top: 1px solid var(--gris-100); }
.mp-input { flex-grow: 1; height: 44px; border: 1px solid var(--gris-300); border-radius: 10px; padding: 0 14px; font-family: inherit; font-size: 14px; color: var(--grafito); background: #fff; }
.mp-input:focus { outline: 2px solid var(--teal-500); outline-offset: 0; border-color: var(--teal-500); }
.mp-send { width: 44px; height: 44px; border: 0; border-radius: 10px; background: var(--teal-500); color: var(--grafito); display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.mp-send:disabled { opacity: .5; cursor: default; }
.mp-disclaimer { padding: 2px 14px 12px; font-size: 11px; color: var(--gris-600); }

.mp-launch-row { display: flex; align-items: center; gap: 12px; }
.mp-teaser { background: #fff; border: 1px solid var(--gris-100); border-radius: 14px 14px 4px 14px; padding: 12px 14px; box-shadow: 0 8px 24px rgba(35, 38, 46, .14); display: flex; flex-direction: column; gap: 2px; }
.mp-teaser[hidden] { display: none; }
.mp-teaser strong { font-size: 14px; }
.mp-teaser span { font-size: 13px; color: var(--gris-600); }
.mp-launcher { position: relative; width: 60px; height: 60px; border: 0; border-radius: 50%; background: var(--grafito); color: var(--papel); display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 10px 28px rgba(35, 38, 46, .3); font-family: inherit; font-size: 17px; font-weight: 800; letter-spacing: -.02em; }
.mp-launcher__dot { position: absolute; right: 2px; top: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--teal-500); border: 2px solid var(--papel); }
.mp.is-open .mp-launcher__dot, .mp.is-open .mp-launcher__label { display: none; }
.mp-launcher__close { display: none; }
.mp.is-open .mp-launcher__close { display: block; }

@media (max-width: 520px) {
  .mp { right: 12px; bottom: 12px; left: 12px; }
  .mp-panel { width: 100%; height: calc(100vh - 100px); }
  .mp-teaser { display: none; }
}
