/* PAM — painel do assistente do editor (ver pam-assistente.v1.js). Tokens do pam-theme (--pl-*). */
.pam-assist { --w: 400px; font-family: "Source Sans Pro", "Source Sans 3", system-ui, sans-serif; color: var(--pl-font, #1B102C); }
.pam-assist[hidden] { display: none; }

/* O editor abre espaço para o painel em vez de ficar coberto. */
html.pam-assist-open #root { margin-right: var(--pam-assist-w, 400px); transition: margin-right 250ms var(--pl-ease, ease); }

/* Botão de abrir: discreto, padrão de IA do CRM (fundo claro, texto roxo, borda em gradiente). */
.pam-assist__launch {
  position: fixed; right: 24px; bottom: 24px; z-index: 60;
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px 0 12px;
  border: 0; border-radius: 5px; cursor: pointer; font: 600 14px/1 inherit;
  color: var(--pl-brand, #7E33E6); background: #fff;
  box-shadow: var(--pl-shadow-4dp), inset 0 0 0 1px rgb(126 51 230 / .35);
}
.pam-assist__launch svg { width: 16px; height: 16px; fill: var(--pl-brand, #7E33E6); }
.pam-assist__launch:hover { background: var(--pl-brand-soft, rgb(126 51 230 / .08)); }
.pam-assist__launch[hidden] { display: none; }

/* Painel lateral: camada flutuante (sombra 24dp, sem borda). */
.pam-assist__panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: var(--w); z-index: 60;
  display: flex; flex-direction: column; background: #fff; box-shadow: var(--pl-shadow-24dp);
}
.pam-assist__panel[hidden] { display: none; }
.pam-assist__head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;
  padding: 15px 15px 12px 20px; border-bottom: 1px solid var(--pl-neutral-2, rgb(27 16 44 / .1));
}
.pam-assist__title {
  font-size: 16px; font-weight: 700;
  background: linear-gradient(to right, #CD3DFF, #0F2FFF); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.pam-assist__sub { font-size: 13px; color: var(--pl-font-1, rgb(27 16 44 / .7)); margin-top: 2px; }
.pam-assist__head-actions { display: flex; gap: 5px; align-items: center; }

.pam-assist__list { flex: 1; overflow-y: auto; padding: 15px 20px; display: flex; flex-direction: column; gap: 10px; background: var(--pl-bg-1, #FAFAFB); }
.pam-assist__msg { font-size: 14px; line-height: 1.45; max-width: 92%; word-wrap: break-word; }
.pam-assist__msg p { margin: 0 0 6px; } .pam-assist__msg p:last-child { margin-bottom: 0; }
.pam-assist__msg ul { margin: 4px 0 6px 18px; padding: 0; } .pam-assist__msg li { margin: 2px 0; }
.pam-assist__msg code, .pam-assist__card code { font: 12px/1.3 ui-monospace, Menlo, Consolas, monospace; background: var(--pl-neutral-1); padding: 1px 4px; border-radius: 3px; }
.pam-assist__msg--user { align-self: flex-end; background: #fff; box-shadow: inset 0 0 0 1px var(--pl-neutral-2); border-radius: 10px 10px 2px 10px; padding: 8px 12px; }
.pam-assist__msg--bot { align-self: flex-start; padding: 2px 0; }
.pam-assist__msg--erro { color: var(--pl-danger, #F22727); }
.pam-assist__loading { color: var(--pl-font-2); display: inline-flex; align-items: center; gap: 4px; }
.pam-assist__loading span { width: 6px; height: 6px; border-radius: 50%; background: var(--pl-brand); opacity: .3; animation: pam-dot 1s infinite; }
.pam-assist__loading span:nth-child(2) { animation-delay: .15s; } .pam-assist__loading span:nth-child(3) { animation-delay: .3s; margin-right: 4px; }
@keyframes pam-dot { 50% { opacity: 1; } }

.pam-assist__empty { color: var(--pl-font-1); font-size: 14px; display: flex; flex-direction: column; gap: 8px; }
.pam-assist__empty p { margin: 0 0 4px; }
.pam-assist__chip {
  text-align: left; font: 400 13px/1.35 inherit; color: var(--pl-font); background: #fff; cursor: pointer;
  border: 0; border-radius: 5px; padding: 8px 10px; box-shadow: inset 0 0 0 1px var(--pl-neutral-2);
}
.pam-assist__chip:hover { box-shadow: inset 0 0 0 1px var(--pl-brand); color: var(--pl-brand-2); }

/* Proposta de alteração: superfície no fluxo -> borda, sem sombra. */
.pam-assist__card { background: #fff; border: 1px solid var(--pl-neutral-2); border-left: 3px solid var(--pl-brand); border-radius: 10px; padding: 12px 14px; font-size: 13px; }
.pam-assist__card-title { font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.pam-assist__card ol { margin: 0 0 8px 18px; padding: 0; } .pam-assist__card li { margin: 3px 0; }
.pam-assist__status { font-size: 13px; color: var(--pl-font-1); margin-top: 4px; }
.pam-assist__status--ok { color: #1E8C6A; } .pam-assist__status--erro { color: var(--pl-danger); }
.pam-assist__actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }

.pam-assist__composer { border-top: 1px solid var(--pl-neutral-2); padding: 12px 20px 15px; background: #fff; }
.pam-assist__composer textarea {
  width: 100%; box-sizing: border-box; resize: none; border: 0; outline: 0; border-radius: 5px; padding: 8px 10px;
  font: 400 14px/1.4 inherit; color: var(--pl-font); background: #fff; box-shadow: inset 0 0 0 1px var(--pl-neutral-2);
}
.pam-assist__composer textarea:focus { box-shadow: inset 0 0 0 1px var(--pl-confirmation, #1A94FF); }
.pam-assist__composer-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.pam-assist__hint { font-size: 12px; color: var(--pl-font-2); }

/* Botões: soft antes, action por último. */
.pam-assist__send { height: 30px; padding: 0 14px; border: 0; border-radius: 5px; cursor: pointer; font: 600 13px/1 inherit; color: #fff; background: var(--pl-confirmation, #1A94FF); }
.pam-assist__send:hover { background: #0B85F0; } .pam-assist__send:disabled { opacity: .45; cursor: default; }
.pam-assist__ghost { height: 30px; padding: 0 10px; border: 0; border-radius: 5px; cursor: pointer; font: 600 13px/1 inherit; color: var(--pl-font); background: transparent; }
.pam-assist__ghost:hover, .pam-assist__icon:hover { background: var(--pl-neutral-1); }
.pam-assist__icon { width: 30px; height: 30px; border: 0; border-radius: 5px; cursor: pointer; background: transparent; color: var(--pl-font-1); font-size: 14px; }
.pam-assist button:focus-visible, .pam-assist textarea:focus-visible { outline: none; box-shadow: 0 0 0 2px rgb(26 148 255 / .5) !important; }

@media (prefers-reduced-motion: reduce) { html.pam-assist-open #root { transition: none; } .pam-assist__loading span { animation: none; opacity: .6; } }

.pam-assist__via { margin-top: 4px; font-size: 11px; color: var(--pl-font-2); }
