/* =========================================================================
   DRE 360 — assistente (rosto no cabeçalho, corpo no painel da direita)
   Só tokens de tema.css: a tela precisa funcionar no claro e no escuro.
   ========================================================================= */

.sr-apenas {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* --------------------------------------- personagem: Tecla, a calculadora */
.ast-rosto, .ast-corpo { overflow: visible; }

.ast-cabeca { fill: var(--sf); stroke: var(--t2); stroke-width: 2; }      /* a carcaça */
.ast-visor  { fill: var(--sf-2); stroke: var(--t2); stroke-width: 2; }    /* onde fica o rosto */
.ast-teclas rect { fill: var(--sf-2); stroke: var(--t2); stroke-width: 1.6; }
.ast-tecla-marca { fill: var(--destaque); }                               /* a tecla de igual */
.ast-membro, .ast-boca {
    fill: none; stroke: var(--t2); stroke-width: 2; stroke-linecap: round;
}
.ast-olho { fill: var(--t1); transform-origin: center; }
.ast-sobrancelhas { fill: none; stroke: var(--t2); stroke-width: 2; stroke-linecap: round; opacity: 0; }
.ast-pe { fill: var(--t2); }
.ast-sombra { fill: var(--t1); opacity: .08; }

/* piscada — some no "prefere menos movimento" */
@keyframes astPiscar {
    0%, 92%, 100% { transform: scaleY(1); }
    95% { transform: scaleY(.1); }
}
.ast-olho { animation: astPiscar 6s infinite; }

/* expressões */
.ast-feliz .ast-tecla-marca { fill: var(--ok); }
.ast-feliz .ast-boca { stroke-width: 2.6; }
.ast-pensando .ast-tecla-marca { fill: var(--av); animation: astPulsar 1.1s infinite ease-in-out; }
.ast-pensando .ast-boca { d: path("M52 54h16"); }          /* boca reta (navegadores que aceitam 'd') */
.ast-pensando .ast-rosto .ast-boca { d: path("M19.5 23h9"); }
.ast-alerta .ast-tecla-marca { fill: var(--er); }
.ast-alerta .ast-sobrancelhas { opacity: 1; }
@keyframes astPulsar { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

@media (prefers-reduced-motion: reduce) {
    .ast-olho, .ast-pensando .ast-tecla-marca { animation: none; }
}

/* ------------------------------------------------------- botão do topo */
.ast-botao {
    position: relative;
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; padding: 0;
    border: 1px solid var(--ln-forte); border-radius: var(--r-lg);
    background: var(--sf); cursor: pointer;
    transition: border-color var(--transicao), background var(--transicao);
}
.ast-botao:hover { background: var(--marca-sv); border-color: var(--marca-bd); }
.ast-botao[aria-expanded="true"] { background: var(--marca-sv); border-color: var(--marca); }
.ast-selo {
    position: absolute; top: -2px; right: -2px;
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--av); border: 2px solid var(--sf);
}

/* ------------------------------------------------------------- painel */
.ast-painel {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 70;
    width: 380px; max-width: 100vw;
    display: flex; flex-direction: column;
    background: var(--sf); border-left: 1px solid var(--ln);
    box-shadow: var(--sombra-3);
    animation: astEntrar 160ms ease-out;
}
.ast-painel[hidden] { display: none; }
@keyframes astEntrar { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }

.ast-veu { position: fixed; inset: 0; z-index: 69; background: var(--veu); }
.ast-veu[hidden] { display: none; }
@media (min-width: 900px) { .ast-veu { display: none; } }

.ast-cabecalho {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 14px 10px; border-bottom: 1px solid var(--ln);
    background: var(--sf-2);
}
.ast-figura { flex: 0 0 auto; }
.ast-titulo h2 { margin: 0; font: 600 15px var(--sans); color: var(--t1); }
.ast-titulo p { margin: 2px 0 0; font-size: 11.5px; color: var(--t3); }
.ast-acoes { margin-left: auto; align-self: flex-start; display: flex; gap: 6px; }
.ast-fechar, .ast-limpar {
    width: 28px; height: 28px; line-height: 1;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--ln-forte); border-radius: var(--r);
    background: var(--sf); color: var(--t2); font-size: 18px; cursor: pointer;
}
.ast-fechar:hover, .ast-limpar:hover { background: var(--hover); color: var(--t1); }

/* ---------------------------------------------------------- conversa */
.ast-conversa {
    flex: 1; overflow-y: auto; padding: 14px;
    display: flex; flex-direction: column; gap: 10px;
}
.ast-fala {
    max-width: 90%; padding: 9px 12px; border-radius: var(--r-lg);
    font-size: 13px; line-height: 1.5; white-space: pre-wrap;
}
.ast-fala-ele { align-self: flex-start; background: var(--sf-2); color: var(--t1); border: 1px solid var(--ln); }
.ast-fala-eu { align-self: flex-end; background: var(--marca); color: var(--marca-txt); }
.ast-fala ul { margin: 6px 0 0; padding-left: 18px; }
.ast-fala li { margin: 2px 0; }

/* O item do alerta é um link para a lista de onde o número saiu. Precisa
   parecer clicável: dentro de uma fala, texto sublinhado é o que diz isso. */
.ast-fala .ast-alertas a {
    color: inherit; text-decoration: underline; text-underline-offset: 2px;
    text-decoration-color: var(--ln-forte);
}
.ast-fala .ast-alertas a:hover { text-decoration-color: currentColor; }
.ast-fala p { margin: 6px 0 0; }

.ast-digitando { display: inline-flex; gap: 4px; align-items: center; }
.ast-digitando span {
    width: 6px; height: 6px; border-radius: 50%; background: var(--t4);
    animation: astPonto 1s infinite ease-in-out;
}
.ast-digitando span:nth-child(2) { animation-delay: .15s; }
.ast-digitando span:nth-child(3) { animation-delay: .3s; }
@keyframes astPonto { 0%, 100% { opacity: .3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }

/* ----------------------------------------------------------- opções */
.ast-opcoes { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 10px; }
.ast-opcoes:empty { display: none; }
.ast-opcao {
    padding: 6px 11px; border: 1px solid var(--marca-bd); border-radius: 999px;
    background: var(--marca-sv); color: var(--marca);
    font: 500 12px var(--sans); cursor: pointer;
}
.ast-opcao:hover { background: var(--marca); color: var(--marca-txt); border-color: var(--marca); }

/* --------------------------------------------------------- escrever */
.ast-escrever { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--ln); background: var(--sf-2); }
.ast-escrever input {
    flex: 1; height: 36px; padding: 0 10px;
    border: 1px solid var(--ln-forte); border-radius: var(--r);
    background: var(--input); color: var(--t1); font: 400 13px var(--sans);
}
.ast-escrever input:focus { outline: none; border-color: var(--marca); box-shadow: 0 0 0 3px var(--foco); }
.ast-enviar {
    width: 36px; height: 36px; border: 1px solid var(--marca); border-radius: var(--r);
    background: var(--marca); color: var(--marca-txt); font-size: 16px; cursor: pointer;
}
.ast-enviar:hover { background: var(--marca-2); border-color: var(--marca-2); }

@media (max-width: 899px) {
    .ast-painel { width: 100vw; border-left: 0; }
}
