/* METAPROTEC · Asistente virtual. Usa los tokens y fuentes de style.css. */
.mp-chat { position: fixed; z-index: 290; right: max(1.5rem, env(safe-area-inset-right)); bottom: max(1.5rem, env(safe-area-inset-bottom)); color: var(--fg); font-family: var(--font-sans); }
.mp-chat-launch.btn { min-height: 56px; padding: .85rem 1.25rem; color: var(--c-7546); background: var(--c-paper); border-color: var(--c-paper); box-shadow: 0 8px 28px #0005; }
.mp-chat-launch.btn:hover { background: var(--c-white); }
.mp-chat-launch:focus-visible { outline: 3px solid var(--c-7699); outline-offset: 4px; }
.mp-chat-panel { display: flex; flex-direction: column; width: min(400px, calc(100vw - 3rem)); height: min(650px, calc(100vh - 3rem)); height: min(650px, calc(100dvh - 3rem)); background: var(--c-deep); border: 1px solid var(--line-strong); border-radius: 20px; box-shadow: 0 20px 70px #0008; overflow: hidden; animation: mp-chat-in var(--dur-med) var(--ease-out); }
@keyframes mp-chat-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.mp-chat-head { flex: 0 0 auto; display: flex; align-items: center; gap: .8rem; padding: 1rem; background: linear-gradient(125deg, var(--c-7546), var(--c-deep)); border-bottom: 1px solid var(--line); }
.mp-chat-brand { flex: 0 0 48px; height: 48px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--c-7546); }
.mp-chat-brand img { width: 30px; height: 30px; object-fit: contain; }
.mp-chat-heading { flex: 1; min-width: 0; }
.mp-chat-eyebrow { color: var(--muted); font-size: .69rem; font-weight: 600; letter-spacing: .15em; line-height: 1.3; margin-bottom: .25rem; }
.mp-chat-heading h2 { font: 400 1.65rem/1.1 var(--font-accent); letter-spacing: var(--tr-small); }
.mp-chat-icon { flex: 0 0 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); transition: background var(--dur-fast); }
.mp-chat-icon:hover { background: var(--hover); }
.mp-chat-log { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 1rem; scrollbar-width: thin; scrollbar-color: var(--c-7699) transparent; display: flex; flex-direction: column; gap: 1rem; }
.mp-chat-message { display: flex; flex-direction: column; align-items: flex-start; max-width: 93%; min-width: 0; flex-shrink: 0; }
.mp-chat-author { font-size: .7rem; font-weight: 600; color: var(--muted); margin: 0 .1rem .25rem; }
.mp-chat-bubble { font-size: .93rem; line-height: 1.55; padding: .7rem .85rem; background: var(--c-7546); color: var(--c-paper); border: 1px solid var(--line); border-radius: 3px 15px 15px 15px; white-space: pre-wrap; overflow-wrap: anywhere; }
.mp-chat-user { align-self: flex-end; align-items: flex-end; }
.mp-chat-user .mp-chat-bubble { background: var(--c-paper); color: var(--c-7546); border-color: transparent; border-radius: 15px 3px 15px 15px; }
.mp-chat-sources { display: flex; flex-wrap: wrap; gap: .25rem .65rem; padding: .3rem .1rem 0; font-size: .78rem; }
.mp-chat-sources a { text-underline-offset: 3px; color: var(--muted); overflow-wrap: anywhere; }
.mp-chat-sources a:hover { color: var(--c-white); }
.mp-chat-quick { flex: 0 0 auto; padding: .7rem 1rem .8rem; background: var(--c-deep); border-top: 1px solid var(--line); }
.mp-chat-quick-label { margin-bottom: .5rem; font-size: .75rem; color: var(--muted); font-weight: 600; }
.mp-chat-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.mp-chat-action.chip { min-height: 34px; padding: .35rem .65rem; font-size: .78rem; line-height: 1.25; text-align: left; transition: background var(--dur-fast), border-color var(--dur-fast); }
.mp-chat-action:hover:not(:disabled) { background: var(--c-7546); border-color: var(--c-paper); }
.mp-chat-bottom { flex: 0 0 auto; padding: .8rem 1rem 1rem; border-top: 1px solid var(--line); }
.mp-chat-status { font-size: .78rem; color: var(--muted); padding-bottom: .6rem; }
.mp-chat-form { display: flex; align-items: flex-end; gap: .5rem; padding: .35rem; border-radius: 16px; border: 1px solid var(--line-strong); background: var(--field-bg); }
.mp-chat-form:focus-within { border-color: var(--c-paper); }
.mp-chat-form textarea { flex: 1; width: 100%; min-width: 0; min-height: 40px; max-height: 104px; padding: .55rem .45rem; resize: none; background: transparent; color: var(--fg); border: 0; font: 400 .95rem/1.4 var(--font-sans); }
.mp-chat-form textarea::placeholder { color: var(--faint); }
.mp-chat-form textarea:focus { outline: none; }
.mp-chat-send { flex: 0 0 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: var(--c-paper); color: var(--c-7546); transition: background var(--dur-fast); }
.mp-chat-send:hover:not(:disabled) { background: var(--c-white); }
.mp-chat button:disabled { cursor: not-allowed; opacity: .48; }
.mp-chat-note { font-size: .67rem; line-height: 1.45; color: var(--faint); padding: .65rem .1rem 0; }
.mp-chat-note a { text-underline-offset: 2px; }
.mp-chat-note a:hover { color: var(--c-paper); }
@media (max-width: 600px) {
  .mp-chat { right: max(.75rem, env(safe-area-inset-right)); bottom: max(.75rem, env(safe-area-inset-bottom)); }
  .mp-chat-launch.btn { min-height: 50px; padding: .7rem .9rem; font-size: .87rem; }
  .mp-chat-panel { width: min(400px, calc(100vw - 1.5rem - env(safe-area-inset-left) - env(safe-area-inset-right))); height: min(650px, calc(100vh - 1.5rem - env(safe-area-inset-top) - env(safe-area-inset-bottom))); height: min(650px, calc(100dvh - 1.5rem - env(safe-area-inset-top) - env(safe-area-inset-bottom))); border-radius: 16px; }
  .mp-chat-form textarea { font-size: 16px; }
  .mp-chat-head { padding: .8rem; }
  .mp-chat-log { padding: .8rem; }
  .mp-chat-bottom, .mp-chat-quick { padding-inline: .8rem; }
}
@media (max-height: 480px) { .mp-chat-head { padding-block: .4rem; } .mp-chat-quick { padding-block: .4rem; } .mp-chat-bottom { padding-block: .4rem; } .mp-chat-brand { width: 38px; height: 38px; flex-basis: 38px; } }
@media (prefers-reduced-motion: reduce) { .mp-chat *, .mp-chat-panel { animation: none !important; transition: none !important; } }
