/* Painel do assistente: mesmo desenho do Centro de Custos (ia.css do /d/): 420 x 640 px na tela, logo abaixo da barra do topo. */
.ch-ai-panel { position: fixed; z-index: 70; top: calc(var(--top-h) + 8px); right: 24px; width: min(420px, calc(100vw - 32px)); height: 640px; max-height: calc(100% - var(--top-h) - 32px); display: flex; flex-direction: column; overflow: hidden; padding: 14px 16px 12px; border-radius: 18px; color: var(--text); background: var(--vidro-painel-forte, var(--surface)); box-shadow: var(--shadow-pop); backdrop-filter: blur(12px) saturate(1.2); }
.ch-ai-panel header { display: flex; align-items: center; gap: 6px; }
.ch-ai-panel header b { display: inline-flex; align-items: center; gap: 8px; margin-right: auto; font-size: calc(15px * var(--fs, 1)); }
.ch-ai-panel header b .ph { color: var(--primary); }
.ch-ai-new, .ch-ai-empty button, .ch-ai-go { min-height: 34px; padding: 0 12px; border: 0; border-radius: 10px; color: var(--primary); background: var(--soft); font: 600 calc(12.5px * var(--fs, 1)) var(--font); display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; cursor: pointer; }
.ch-ai-new:hover, .ch-ai-empty button:hover, .ch-ai-go:hover { box-shadow: inset 0 0 0 1px var(--primary); }
.ch-ai-new:disabled { opacity: .55; cursor: default; }
.ch-ai-close { width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 10px; color: var(--text); background: transparent; cursor: pointer; }
.ch-ai-close:hover { background: var(--soft); }
.ch-ai-log { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 12px 2px; overscroll-behavior: contain; }
.ch-ai-msg { max-width: 90%; padding: 10px 13px; border-radius: 14px; font-size: calc(13.5px * var(--fs, 1)); line-height: 1.45; overflow-wrap: anywhere; background: var(--bg); box-shadow: var(--shadow-sm); }
.ch-ai-msg.ia { align-self: flex-start; border-bottom-left-radius: 4px; }
.ch-ai-msg.eu { align-self: flex-end; color: var(--on-brand); background: var(--brand); border-bottom-right-radius: 4px; white-space: pre-wrap; }
.ch-ai-msg.erro { align-self: center; max-width: 100%; color: var(--bad); text-align: center; font-size: calc(12.5px * var(--fs, 1)); }
.ch-ai-msg p { margin: 0 0 6px; }
.ch-ai-msg p:last-child { margin-bottom: 0; }
.ch-ai-empty { margin: auto 0; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0 6px; color: var(--muted); font-size: calc(13px * var(--fs, 1)); text-align: center; }
.ch-ai-empty > .ph-fill { color: var(--primary); }
.ch-ai-empty b { color: var(--text); font-size: calc(16px * var(--fs, 1)); }
.ch-ai-empty div { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; }
.ch-ai-go { display: flex; margin-top: 10px; }
.ch-ai-form { display: flex; align-items: flex-end; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.ch-ai-form textarea { flex: 1; min-height: 42px; max-height: 120px; resize: none; padding: 10px 12px; border: 0; border-radius: 12px; color: var(--text); background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); font: 400 calc(14px * var(--fs, 1))/1.35 var(--font); outline: none; }
.ch-ai-form textarea:focus { box-shadow: inset 0 0 0 2px var(--primary); }
.ch-ai-form textarea.ch-ai-parcial { color: color-mix(in srgb, var(--text) 70%, var(--bg)); box-shadow: inset 0 0 0 2px var(--warn); }
.ch-ai-form button { flex: none; width: 42px; height: 42px; display: grid; place-items: center; border: 0; border-radius: 12px; color: var(--on-brand); background: var(--brand); cursor: pointer; }
.ch-ai-form button:disabled { opacity: .55; cursor: default; }
.ch-ai-form .ch-ai-mic { color: var(--text); background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); }
.ch-ai-form .ch-ai-mic:hover:not(:disabled) { box-shadow: inset 0 0 0 1px var(--primary); }
.ch-ai-form .ch-ai-mic.rec { color: var(--warn); background: var(--warn-bg); box-shadow: inset 0 0 0 2px var(--warn); animation: chAiRec 1.2s infinite ease-in-out; }
.ch-ai-dots { display: inline-flex; gap: 4px; }
.ch-ai-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--primary); animation: chAiDot 1s infinite ease-in-out; }
.ch-ai-dots i:nth-child(2) { animation-delay: .15s; }
.ch-ai-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes chAiRec { 50% { opacity: .65; } }
@keyframes chAiDot { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ch-ai-form .ch-ai-mic.rec, .ch-ai-dots i { animation: none; } }
.ch-ai-panel > small.ch-ai-voz { color: var(--text); font-size: calc(12.5px * var(--fs, 1)); }
.ch-ai-panel > small.ch-ai-voz[hidden] { display: none; }
.ch-ai-panel > small { display: block; margin-top: 6px; color: var(--muted); font-size: calc(11.5px * var(--fs, 1)); text-align: center; }
@media screen and (min-width: 1200px) { .ch-ai-panel { right: 32px; width: 560px; height: 853px; } }
@media (max-width: 800px) { .ch-ai-panel { inset: 0; width: auto; height: auto; max-height: none; border-radius: 0; } }
