/* Tela de chat do assistente RIFT. Azul e grafite do símbolo da marca, marinho do Charta. */

:root {
    --fonte: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    --fonte-titulo: "Plus Jakarta Sans", "Inter", "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, sans-serif;
    --fonte-codigo: "Cascadia Code", "Cascadia Mono", Consolas, "SF Mono", Menlo, monospace;
    --largura: 800px;
    --curva: cubic-bezier(.22, .8, .24, 1);

    color-scheme: light;
    --fundo: #f5f7fb;
    --superficie: #ffffff;
    --superficie-2: #eef2f8;
    --superficie-3: #e3e9f3;
    --texto: #141a33;
    --texto-2: #4c5670;
    --texto-3: #667089;
    --borda: #dde3ee;
    --borda-forte: #c9d2e1;
    --azul: #1f6fb8;
    --azul-vivo: #2a86cf;
    --marinho: #1b2347;
    --balao: #e4edf9;
    --balao-texto: #141a33;
    --sombra-p: 0 1px 2px rgb(27 35 71 / .06);
    --sombra-m: 0 12px 32px -12px rgb(27 35 71 / .22), 0 2px 6px rgb(27 35 71 / .05);
    --sombra-composicao: 0 16px 40px -18px rgb(27 35 71 / .28), 0 2px 8px rgb(27 35 71 / .05);
    --teste-fundo: #fdf3dc;
    --teste-texto: #80590a;
    --teste-ponto: #d1a84f;
    --alerta-fundo: #fdf0ef;
    --alerta-borda: #f4cfcb;
    --alerta-texto: #a02e24;
    --codigo-fundo: #eef2f8;
    --bloco-fundo: #141a33;
    --bloco-topo: #1d2545;
    --bloco-texto: #dfe6f5;
    --aurora-1: rgb(58 155 216 / .20);
    --aurora-2: rgb(27 35 71 / .10);
    --rede-linha: rgb(31 111 184 / .16);
    --rede-no: rgb(31 111 184 / .34);
    --rede-pulso: #3a9bd8;
    --azul-1: #3a9bd8;
    --azul-2: #1f5ea6;
    --corpo-1: #4d5a78;
    --corpo-2: #1b2347;
    --rosto: #ffffff;
    --pulso: #8fd0ff;
    --halo: rgb(58 155 216 / .24);
}

html[data-tema="escuro"] {
    color-scheme: dark;
    --fundo: #0d1122;
    --superficie: #171c31;
    --superficie-2: #1f2640;
    --superficie-3: #2a3250;
    --texto: #e9edf6;
    --texto-2: #b3bcd1;
    --texto-3: #8a94ad;
    --borda: #272e49;
    --borda-forte: #363f60;
    --azul: #6bb9f0;
    --azul-vivo: #3a9bd8;
    --balao: #27304f;
    --balao-texto: #eef1f8;
    --sombra-p: 0 1px 2px rgb(0 0 0 / .3);
    --sombra-m: 0 16px 40px -14px rgb(0 0 0 / .7), 0 2px 6px rgb(0 0 0 / .3);
    --sombra-composicao: 0 18px 44px -18px rgb(0 0 0 / .8), 0 2px 8px rgb(0 0 0 / .3);
    --teste-fundo: rgb(209 168 79 / .14);
    --teste-texto: #e8c477;
    --alerta-fundo: rgb(204 65 65 / .13);
    --alerta-borda: rgb(204 65 65 / .35);
    --alerta-texto: #f3a9a2;
    --codigo-fundo: #262e4a;
    --bloco-fundo: #0a0e1c;
    --bloco-topo: #141a2f;
    --bloco-texto: #dfe6f5;
    --aurora-1: rgb(58 155 216 / .20);
    --aurora-2: rgb(70 88 170 / .20);
    --rede-linha: rgb(107 185 240 / .13);
    --rede-no: rgb(107 185 240 / .32);
    --rede-pulso: #8fd0ff;
    --azul-1: #63b6f2;
    --azul-2: #2c7cc7;
    --corpo-1: #dbe4f3;
    --corpo-2: #93a5c4;
    --rosto: #151b30;
    --pulso: #1f5ea6;
    --halo: rgb(58 155 216 / .26);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    margin: 0;
}

body {
    background: var(--fundo);
    color: var(--texto);
    font-family: var(--fonte);
    font-size: 15.5px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow: hidden;
    transition: background-color .25s ease, color .25s ease;
}

button,
textarea {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
}

:focus-visible {
    outline: 2px solid var(--azul);
    outline-offset: 2px;
}

.definicoes {
    position: absolute;
}

.somente-leitor {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.icone {
    width: 19px;
    height: 19px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.icone-p {
    width: 16px;
    height: 16px;
}

/* Estrutura */

.app {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

.fundo {
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
    transition: opacity .7s ease;
}

.fundo::before,
.fundo::after {
    content: "";
    position: absolute;
    width: 62vmax;
    height: 62vmax;
    border-radius: 50%;
    filter: blur(70px);
    animation: derivar 26s ease-in-out infinite alternate;
}

.fundo::before {
    top: -34vmax;
    left: -12vmax;
    background: radial-gradient(circle, var(--aurora-1), transparent 68%);
}

.fundo::after {
    right: -14vmax;
    bottom: -38vmax;
    background: radial-gradient(circle, var(--aurora-2), transparent 68%);
    animation-delay: -13s;
}

.rede {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    -webkit-mask-image: radial-gradient(ellipse 58% 62% at 50% 50%, transparent 42%, #000 100%);
    mask-image: radial-gradient(ellipse 58% 62% at 50% 50%, transparent 42%, #000 100%);
    transition: opacity .7s ease;
}

.rede-linhas path {
    fill: none;
    stroke: var(--rede-linha);
    stroke-width: 1.2;
}

.rede-linhas .rede-ponte {
    stroke-dasharray: 3 8;
    stroke-linecap: round;
}

.rede-nos circle {
    fill: var(--rede-no);
}

.rede-pulsos circle {
    fill: var(--rede-pulso);
    filter: drop-shadow(0 0 5px var(--rede-pulso));
}

.app[data-estado="conversando"] .rede {
    opacity: 0;
}

.app[data-estado="conversando"] .fundo {
    opacity: .45;
}

/* Topo */

.topo {
    position: relative;
    z-index: 20;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 20px;
    border-bottom: 1px solid transparent;
    transition: border-color .3s ease;
}

.app[data-estado="conversando"] .topo {
    border-bottom-color: var(--borda);
}

.topo-esquerda,
.topo-direita {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.topo-esquerda {
    gap: 18px;
}

.marca {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
}

.marca-logo {
    flex: none;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 11px;
    background: #ffffff;
    box-shadow: var(--sombra-p), inset 0 0 0 1px rgb(27 35 71 / .06);
}

.marca-logo img {
    display: block;
    width: 26px;
    height: auto;
}

.marca-textos {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    white-space: nowrap;
}

.marca-textos strong {
    font-family: var(--fonte-titulo);
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -.015em;
}

.marca-textos small {
    margin-top: 2px;
    font-size: 11.5px;
    color: var(--texto-3);
}

.seletor {
    position: relative;
}

.seletor-botao {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 36px;
    padding: 0 10px 0 13px;
    border: 1px solid var(--borda);
    border-radius: 11px;
    background: var(--superficie);
    box-shadow: var(--sombra-p);
    font-weight: 600;
    font-size: 14px;
    transition: border-color .15s ease, background-color .15s ease;
}

.seletor-botao:hover {
    border-color: var(--borda-forte);
}

.seletor-botao .icone {
    color: var(--texto-3);
    transition: transform .2s var(--curva);
}

.seletor-botao[aria-expanded="true"] .icone {
    transform: rotate(180deg);
}

.seletor-lista {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 230px;
    max-height: 320px;
    margin: 0;
    padding: 6px;
    overflow-y: auto;
    list-style: none;
    border: 1px solid var(--borda);
    border-radius: 14px;
    background: var(--superficie);
    box-shadow: var(--sombra-m);
    transform-origin: top left;
    animation: abrir-menu .16s var(--curva);
}

.seletor-lista:focus {
    outline: none;
}

.seletor-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 11px;
    border-radius: 9px;
    font-size: 14px;
    cursor: pointer;
}

.seletor-item:hover,
.seletor-item.ativa {
    background: var(--superficie-2);
}

.seletor-marca {
    color: var(--azul);
    visibility: hidden;
}

.seletor-item[aria-selected="true"] {
    font-weight: 600;
}

.seletor-item[aria-selected="true"] .seletor-marca {
    visibility: visible;
}

.seletor-uf {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.seletor-uf select {
    height: 36px;
    padding: 0 30px 0 13px;
    border: 1px solid var(--borda);
    border-radius: 11px;
    background: var(--superficie);
    box-shadow: var(--sombra-p);
    color: var(--texto);
    font: inherit;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    appearance: none;
    transition: border-color .15s ease, background-color .15s ease;
}

.seletor-uf select:hover {
    border-color: var(--borda-forte);
}

.seletor-uf option {
    background: var(--superficie);
    color: var(--texto);
}

.seletor-uf .icone {
    position: absolute;
    right: 9px;
    color: var(--texto-3);
    pointer-events: none;
}

.usuario-logado {
    max-width: 220px;
    padding-right: 4px;
    overflow: hidden;
    color: var(--texto-2);
    font-size: 13.5px;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.selo-teste {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 28px;
    padding: 0 11px;
    border-radius: 999px;
    background: var(--teste-fundo);
    color: var(--teste-texto);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.selo-ponto {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--teste-ponto);
}

.botao-suave,
.botao-icone {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: var(--texto-2);
    transition: background-color .15s ease, color .15s ease;
}

.botao-suave {
    gap: 7px;
    padding: 0 12px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.botao-icone {
    width: 36px;
}

.botao-suave:hover,
.botao-icone:hover {
    background: var(--superficie-3);
    color: var(--texto);
}

html[data-tema="escuro"] .tema-lua,
html:not([data-tema="escuro"]) .tema-sol {
    display: none;
}

/* Palco */

.palco {
    position: relative;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.app[data-estado="vazio"] .palco {
    justify-content: center;
    padding-bottom: 7vh;
}

.rolagem {
    flex: none;
}

.app[data-estado="conversando"] .rolagem {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable both-edges;
    scrollbar-width: thin;
    scrollbar-color: var(--borda-forte) transparent;
}

/* Boas-vindas */

.boas-vindas {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 24px 26px;
    text-align: center;
    animation: surgir .6s var(--curva) both;
}

.app[data-estado="conversando"] .boas-vindas {
    display: none;
}

.boas-vindas-mascote {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 18px;
}

.boas-vindas-mascote::before {
    content: "";
    position: absolute;
    inset: -30px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--halo), transparent 68%);
    animation: respirar 5s ease-in-out infinite;
}

.boas-vindas-mascote .mascote {
    position: relative;
    width: 100%;
    height: 100%;
    animation: flutuar 6s ease-in-out infinite;
}

.sigla {
    margin: 0 0 14px;
    font-family: var(--fonte-titulo);
}

.sigla p {
    margin: 0;
}

.sigla p + p {
    margin-top: 4px;
}

.sigla-saudacao {
    font-size: 15px;
    color: var(--texto-3);
}

.sigla-saudacao strong {
    color: var(--azul-2);
    font-weight: 700;
    letter-spacing: .04em;
}

.sigla-significado {
    font-size: 16px;
    font-weight: 600;
}

.sigla-inicial {
    display: inline-block;
    background: linear-gradient(95deg, var(--azul-2), var(--azul-1));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-size: 1.3em;
    font-weight: 800;
    line-height: 1;
    animation: soletrar .55s var(--curva) both;
}

.sigla-termo:nth-child(1) .sigla-inicial { animation-delay: .35s; }
.sigla-termo:nth-child(2) .sigla-inicial { animation-delay: .55s; }
.sigla-termo:nth-child(3) .sigla-inicial { animation-delay: .75s; }
.sigla-termo:nth-child(4) .sigla-inicial { animation-delay: .95s; }

.sigla-comentario {
    font-size: 12.5px;
    font-style: italic;
    color: var(--texto-3);
    animation: surgir .6s var(--curva) 1.5s both;
}

.boas-vindas h1 {
    margin: 0;
    font-family: var(--fonte-titulo);
    font-size: clamp(27px, 3.5vw, 38px);
    font-weight: 700;
    line-height: 1.16;
    letter-spacing: -.028em;
}

/* Mascote */

.parada-azul-1 { stop-color: var(--azul-1); }
.parada-azul-2 { stop-color: var(--azul-2); }
.parada-corpo-1 { stop-color: var(--corpo-1); }
.parada-corpo-2 { stop-color: var(--corpo-2); }

.mascote {
    display: block;
    overflow: visible;
}

.mascote-olho-fundo {
    fill: var(--rosto);
}

/* O rosto gira em torno do centro da cabeça: como a cabeça é um círculo, parece que ela inteira balança. */
.mascote-rosto {
    transform-origin: 46.5px 34.8px;
    animation: chacoalhar 10s ease-in-out infinite;
}

/* O grupo reúne o olho e o reflexo, para que os dois pisquem juntos. Mesma duração do chacoalhar, para os dois ficarem sincronizados. */
.mascote-olho {
    transform-box: fill-box;
    transform-origin: center;
    animation: piscar 10s ease-in-out infinite;
}

/* Só a resposta mais recente do assistente se mexe; as anteriores ficam paradas. */
.msg-assistente:has(~ .msg-assistente) .mascote-rosto,
.msg-assistente:has(~ .msg-assistente) .mascote-olho {
    animation: none;
}

.mascote-boca {
    fill: none;
    stroke: var(--rosto);
    stroke-width: 3;
    stroke-linecap: round;
}

.mascote-pulso {
    fill: var(--pulso);
    opacity: 0;
}

.mascote.pensando .mascote-rosto {
    animation: olhar 2.4s ease-in-out infinite;
}

.mascote.pensando .mascote-boca {
    opacity: 0;
}

.mascote.pensando .mascote-pulso {
    animation: atravessar 1.5s ease-in-out infinite;
}

.mascote.pensando .mascote-arco {
    transform-origin: 47px 40px;
    animation: oscilar 2.4s ease-in-out infinite;
}

/* Conversa */

.conversa {
    max-width: calc(var(--largura) + 48px);
    margin: 0 auto;
    padding: 28px 24px 8px;
    list-style: none;
}

.conversa:empty {
    display: none;
}

.msg {
    display: flex;
    gap: 14px;
    margin-bottom: 30px;
    animation: surgir .34s var(--curva) both;
}

.msg-usuario {
    justify-content: flex-end;
}

.balao {
    max-width: min(80%, 640px);
    padding: 10px 16px;
    border-radius: 20px 20px 6px 20px;
    background: var(--balao);
    color: var(--balao-texto);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.avatar {
    flex: none;
    width: 34px;
    height: 34px;
}

.avatar .mascote {
    width: 100%;
    height: 100%;
}

.corpo {
    flex: 1;
    min-width: 0;
    padding-top: 3px;
}

.divisor {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 0 26px;
    color: var(--texto-3);
    font-size: 12.5px;
    text-align: center;
}

.divisor::before,
.divisor::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--borda);
}

/* Estado de espera */

.pensando-texto {
    display: inline-block;
    padding-top: 3px;
    background: linear-gradient(90deg, var(--texto-3) 30%, var(--azul) 50%, var(--texto-3) 70%);
    background-size: 220% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 500;
    animation: brilhar 2s linear infinite;
}

.pensando-tempo {
    margin-left: 8px;
    color: var(--texto-3);
    font-size: 12.5px;
    font-variant-numeric: tabular-nums;
}

/* Rodapé da resposta */

.msg-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    min-height: 28px;
    margin-top: 6px;
    color: var(--texto-3);
    font-size: 12.5px;
}

.etiqueta {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 9px;
    border-radius: 999px;
    background: var(--superficie-3);
    color: var(--texto-2);
    font-size: 11.5px;
    font-weight: 600;
}

.tempo {
    font-variant-numeric: tabular-nums;
}

.acao-msg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--texto-3);
    transition: background-color .15s ease, color .15s ease, opacity .15s ease;
}

.acao-msg .icone {
    width: 16px;
    height: 16px;
}

.acao-msg:hover {
    background: var(--superficie-3);
    color: var(--texto);
}

.acao-msg.feito {
    color: var(--azul);
}

@media (hover: hover) {
    .msg-assistente .acao-msg {
        opacity: 0;
    }

    .msg-assistente:hover .acao-msg,
    .msg-assistente:last-child .acao-msg,
    .msg-assistente .acao-msg:focus-visible {
        opacity: 1;
    }
}

/* Avisos e falhas */

.alerta {
    display: flex;
    gap: 11px;
    padding: 12px 14px;
    border: 1px solid var(--alerta-borda);
    border-radius: 14px;
    background: var(--alerta-fundo);
    color: var(--texto);
}

.alerta > .icone {
    margin-top: 2px;
    color: var(--alerta-texto);
}

.alerta-conteudo {
    flex: 1;
    min-width: 0;
}

.alerta-codigo {
    display: inline-block;
    margin-top: 4px;
    color: var(--alerta-texto);
    font-family: var(--fonte-codigo);
    font-size: 12px;
}

.botao-repetir {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 11px;
    border: 1px solid var(--borda-forte);
    border-radius: 9px;
    background: var(--superficie);
    color: var(--texto);
    font-size: 13px;
    font-weight: 500;
    transition: border-color .15s ease;
}

.botao-repetir:hover {
    border-color: var(--azul);
}

.botao-repetir .icone {
    width: 15px;
    height: 15px;
}

/* Conteúdo em Markdown */

.md > :first-child {
    margin-top: 0;
}

.md > :last-child {
    margin-bottom: 0;
}

.md p {
    margin: 0 0 .85em;
}

.md h3,
.md h4,
.md h5 {
    margin: 1.35em 0 .5em;
    font-family: var(--fonte-titulo);
    line-height: 1.3;
    letter-spacing: -.012em;
}

.md h3 { font-size: 1.24em; }
.md h4 { font-size: 1.1em; }
.md h5 { font-size: 1.05em; }

.md ul,
.md ol {
    margin: 0 0 .85em;
    padding-left: 1.5em;
}

.md li {
    margin: .3em 0;
    padding-left: .15em;
}

.md li > ul,
.md li > ol {
    margin: .3em 0 0;
}

.md li > p {
    margin-bottom: .4em;
}

.md ul > li::marker {
    color: var(--azul);
}

.md ol > li::marker {
    color: var(--azul);
    font-weight: 600;
}

.md strong {
    font-weight: 650;
}

.md a {
    color: var(--azul);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.md code {
    padding: .12em .38em;
    border-radius: 6px;
    background: var(--codigo-fundo);
    font-family: var(--fonte-codigo);
    font-size: .87em;
    overflow-wrap: anywhere;
}

.md blockquote {
    margin: 0 0 .85em;
    padding: .1em 0 .1em 1em;
    border-left: 3px solid var(--azul-vivo);
    color: var(--texto-2);
}

.md hr {
    height: 1px;
    margin: 1.4em 0;
    border: 0;
    background: var(--borda);
}

.md-codigo {
    margin: 0 0 .95em;
    overflow: hidden;
    border-radius: 12px;
    background: var(--bloco-fundo);
    color: var(--bloco-texto);
}

.md-codigo-topo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 34px;
    padding: 3px 5px 3px 14px;
    background: var(--bloco-topo);
    color: #9aa7c4;
    font-size: 12px;
}

.md-codigo-topo .acao-msg {
    color: #9aa7c4;
    opacity: 1;
}

.md-codigo-topo .acao-msg:hover {
    background: rgb(255 255 255 / .1);
    color: #ffffff;
}

.md-codigo pre {
    margin: 0;
    padding: 13px 15px;
    overflow-x: auto;
    font-size: 13.5px;
    line-height: 1.55;
}

.md-codigo code {
    padding: 0;
    background: none;
    font-size: inherit;
    overflow-wrap: normal;
}

.md-tabela {
    margin: 0 0 .95em;
    overflow-x: auto;
    border: 1px solid var(--borda);
    border-radius: 12px;
}

.md table {
    width: 100%;
    border-collapse: collapse;
    font-size: .94em;
}

.md th,
.md td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--borda);
    text-align: left;
    vertical-align: top;
}

.md th {
    background: var(--superficie-2);
    font-weight: 600;
    white-space: nowrap;
}

.md tr:last-child td {
    border-bottom: 0;
}

/* Composição */

.ir-ao-fim {
    position: absolute;
    left: 50%;
    bottom: calc(var(--altura-composicao, 124px) + 12px);
    z-index: 5;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    margin-left: -18px;
    border: 1px solid var(--borda);
    border-radius: 50%;
    background: var(--superficie);
    color: var(--texto-2);
    box-shadow: var(--sombra-m);
    animation: surgir .2s var(--curva);
}

.ir-ao-fim[hidden] {
    display: none;
}

.ir-ao-fim:hover {
    color: var(--texto);
}

.area-composicao {
    position: relative;
    z-index: 4;
    flex: none;
    width: 100%;
    max-width: calc(var(--largura) + 48px);
    margin: 0 auto;
    padding: 6px 24px calc(10px + env(safe-area-inset-bottom));
    animation: surgir .6s .06s var(--curva) both;
}

/* O texto da conversa some aos poucos atrás da caixa de mensagem */
.app[data-estado="conversando"] .area-composicao::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 100%;
    height: 34px;
    background: linear-gradient(to bottom, transparent, var(--fundo));
    pointer-events: none;
}

.composicao {
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 9px 9px 9px 20px;
    border: 1px solid var(--borda);
    border-radius: 26px;
    background: var(--superficie);
    box-shadow: var(--sombra-composicao);
    transition: border-color .2s ease, box-shadow .2s ease, background-color .25s ease;
}

.composicao:focus-within {
    border-color: color-mix(in srgb, var(--azul) 55%, var(--borda));
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--azul) 13%, transparent), var(--sombra-composicao);
}

.composicao textarea {
    flex: 1;
    display: block;
    min-width: 0;
    max-height: 208px;
    padding: 7px 0;
    border: 0;
    background: transparent;
    font-size: 16px;
    line-height: 1.5;
    resize: none;
    scrollbar-width: thin;
    scrollbar-color: var(--borda-forte) transparent;
}

.composicao textarea:focus {
    outline: none;
}

.composicao textarea::placeholder {
    color: var(--texto-3);
    opacity: 1;
}

.contador {
    flex: none;
    align-self: center;
    color: var(--texto-3);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.contador.no-limite {
    color: var(--alerta-texto);
    font-weight: 600;
}

.enviar {
    flex: none;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: linear-gradient(140deg, #3a9bd8, #1f5ea6);
    color: #ffffff;
    box-shadow: 0 6px 14px -6px rgb(31 94 166 / .8);
    transition: transform .15s var(--curva), filter .15s ease, background .2s ease, box-shadow .2s ease;
}

.enviar:hover:not(:disabled) {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

.enviar:active:not(:disabled) {
    transform: scale(.94);
}

.enviar:disabled {
    background: var(--superficie-3);
    color: var(--texto-3);
    box-shadow: none;
    cursor: default;
}

.enviar .icone {
    stroke-width: 2.2;
}

.sugestoes {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}

.app[data-estado="conversando"] .sugestoes {
    display: none;
}

.sugestao {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 36px;
    padding: 0 14px;
    border: 1px solid var(--borda);
    border-radius: 999px;
    background: color-mix(in srgb, var(--superficie) 72%, transparent);
    color: var(--texto-2);
    font-size: 13.5px;
    white-space: nowrap;
    backdrop-filter: blur(6px);
    transition: border-color .15s ease, color .15s ease, transform .15s var(--curva);
}

.sugestao:hover {
    border-color: color-mix(in srgb, var(--azul) 55%, var(--borda));
    color: var(--texto);
    transform: translateY(-1px);
}

.sugestao .icone {
    color: var(--azul);
}

.aviso {
    margin: 9px 0 0;
    color: var(--texto-3);
    font-size: 12px;
    text-align: center;
}

.app[data-estado="vazio"] .aviso {
    margin-top: 18px;
}

/* Animações */

@keyframes surgir {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

@keyframes soletrar {
    0% { opacity: 0; transform: translateY(10px) scale(.5); }
    60% { opacity: 1; transform: translateY(-3px) scale(1.25); }
    100% { opacity: 1; transform: none; }
}

@keyframes abrir-menu {
    from { opacity: 0; transform: translateY(-4px) scale(.98); }
    to { opacity: 1; transform: none; }
}

@keyframes derivar {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to { transform: translate3d(5vmax, 3vmax, 0) scale(1.12); }
}

@keyframes respirar {
    0%, 100% { opacity: .75; transform: scale(.94); }
    50% { opacity: 1; transform: scale(1.06); }
}

@keyframes flutuar {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/*
 * Ciclo de 10 s (1% = 100 ms): piscada simples em ~1,2 s; olhos fechados entre ~3,1 s e ~4,1 s enquanto
 * o rosto chacoalha; piscada simples em ~6 s e dupla em ~8,3 s. Fecha em ~120 ms e abre em ~180 ms.
 */
@keyframes piscar {
    0%, 12%, 15%, 30%, 43%, 60%, 63%, 83%, 86%, 89%, 100% { transform: scaleY(1); }
    13.2%, 31.2%, 41%, 61.2%, 84.2%, 87.2% { transform: scaleY(.1); }
}

/* Mesmo ciclo do piscar: o balanço acontece com os olhos fechados. */
@keyframes chacoalhar {
    0%, 32%, 40.5%, 100% { transform: rotate(0); }
    33.5% { transform: rotate(-7deg); }
    35.5% { transform: rotate(7deg); }
    37.5% { transform: rotate(-5deg); }
    39% { transform: rotate(3deg); }
}

@keyframes olhar {
    0%, 100% { transform: translateX(-3px); }
    50% { transform: translateX(3.5px); }
}

@keyframes oscilar {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
}

@keyframes atravessar {
    0% { cx: 18; opacity: 0; }
    15% { opacity: 1; }
    85% { opacity: 1; }
    100% { cx: 80; opacity: 0; }
}

@keyframes brilhar {
    from { background-position: 120% 0; }
    to { background-position: -100% 0; }
}

/* Login */

.login {
    position: relative;
    isolation: isolate;
    display: grid;
    place-items: center;
    height: 100vh;
    height: 100dvh;
    padding: 24px 16px;
    overflow-y: auto;
}

.login-cartao {
    width: 100%;
    max-width: 380px;
    padding: 28px;
    border: 1px solid var(--borda);
    border-radius: 18px;
    background: var(--superficie);
    box-shadow: var(--sombra-m);
}

.login-marca {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    line-height: 1.15;
}

.login-mascote {
    width: 64px;
    height: 64px;
    margin-bottom: 12px;
}

.login-mascote .mascote {
    width: 100%;
    height: 100%;
}

.login-marca strong {
    font-family: var(--fonte-titulo);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -.015em;
}

.login-marca small {
    margin-top: 4px;
    font-size: 12.5px;
    color: var(--texto-3);
}

.login-cartao h1 {
    margin: 22px 0 4px;
    font-family: var(--fonte-titulo);
    font-size: 22px;
    letter-spacing: -.015em;
}

.login-explicacao {
    margin: 0 0 18px;
    color: var(--texto-2);
    font-size: 14px;
}

.login-erro {
    margin: 0 0 16px;
    padding: 10px 12px;
    border: 1px solid var(--alerta-borda);
    border-radius: 10px;
    background: var(--alerta-fundo);
    color: var(--alerta-texto);
    font-size: 14px;
}

.login-formulario {
    display: flex;
    flex-direction: column;
}

.login-formulario label {
    margin-bottom: 5px;
    font-size: 13.5px;
    font-weight: 600;
}

.login-formulario input {
    height: 42px;
    margin-bottom: 14px;
    padding: 0 12px;
    border: 1px solid var(--borda-forte);
    border-radius: 11px;
    background: var(--superficie);
    color: var(--texto);
    font: inherit;
}

.login-formulario button {
    height: 42px;
    margin-top: 4px;
    border: 0;
    border-radius: 11px;
    background: var(--marinho);
    color: #ffffff;
    font-weight: 600;
}

.login-formulario #codigo {
    font-family: var(--fonte-codigo);
    font-size: 18px;
    letter-spacing: 0.12em;
    text-align: center;
}

html[data-tema="escuro"] .login-formulario button {
    background: var(--azul-vivo);
}

.login-voltar {
    margin-top: 14px;
    color: var(--azul);
    font-size: 14px;
    text-align: center;
}

/* Telas menores */

@media (max-width: 760px) {
    .topo {
        align-items: flex-start;
        padding: 10px 14px;
    }

    .topo-esquerda {
        flex-wrap: wrap;
        gap: 8px 12px;
    }

    .marca-textos small,
    .selo-texto,
    .botao-texto,
    .usuario-logado {
        display: none;
    }

    .selo-teste {
        width: 28px;
        padding: 0;
        justify-content: center;
    }

    .botao-suave {
        width: 36px;
        padding: 0;
    }

    .conversa {
        padding: 20px 16px 6px;
    }

    .area-composicao {
        padding-left: 12px;
        padding-right: 12px;
    }

    .balao {
        max-width: 88%;
    }

    .avatar {
        width: 28px;
        height: 28px;
    }

    .msg {
        gap: 10px;
        margin-bottom: 24px;
    }

    .boas-vindas-mascote {
        width: 96px;
        height: 96px;
    }

    .sigla-significado {
        font-size: 14.5px;
    }

    .sugestoes {
        flex-wrap: nowrap;
        justify-content: flex-start;
        margin-left: -12px;
        margin-right: -12px;
        padding: 0 12px 2px;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .sugestoes::-webkit-scrollbar {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }

    .rede-pulsos {
        display: none;
    }

    .sigla-inicial,
    .sigla-comentario {
        animation: none;
    }
}

.mascote-reflexo {
    fill: #fff;
}

/* No tema claro, o olho é branco e o reflexo usa a mesma cor da cabeça. */
html:not([data-tema="escuro"]) .mascote-reflexo {
    fill: url(#mascote-corpo);
}
