:root {
    color-scheme: light dark;
}

/* Fundo estilo papel de parede do WhatsApp */
body {
    background: #ece5dd url("./img/fundo.png") repeat;
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

/* Diferenciar a área do chat em telas >= sm */
@media (min-width:640px) {
    #chat {
        background: #ece5dd;
    }
}

/* Três pontinhos digitando */
.typing {
    width: 2.4rem;
    height: 1.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .25rem;
}

.typing span {
    width: .35rem;
    height: .35rem;
    border-radius: 50%;
    opacity: .45;
    animation: blink 1.2s infinite;
}

.typing span:nth-child(2) {
    animation-delay: .2s
}

.typing span:nth-child(3) {
    animation-delay: .4s
}

@keyframes blink {

    0%,
    60%,
    100% {
        opacity: .35
    }

    30% {
        opacity: 1
    }
}

/* Modal */
dialog::backdrop {
    background: rgba(0, 0, 0, .5);
}

/* ==== Estilo WhatsApp: respostas abaixo (cartão + botões) ==== */
.reply-card {
    margin-top: .25rem;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 1px 0 rgba(0, 0, 0, .06);
    padding: .5rem;
    width: clamp(220px, 92%, 360px);
}

.reply-hint {
    font-size: .75rem;
    color: rgb(75 85 99 / .9);
    margin: .25rem .25rem .5rem;
}

.reply-btn {
    width: 100%;
    text-align: center;
    padding: .65rem .9rem;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    color: #111827;
    font-weight: 600;
    cursor: pointer;
    transition: transform .06s ease, box-shadow .12s ease, background .12s ease, border-color .12s ease;
}

.reply-btn+.reply-btn {
    margin-top: .5rem;
}

.reply-btn:hover {
    background: #f3f4f6;
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, .06);
}

.reply-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, .05);
}

.reply-btn:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #22c55e;
}

.reply-btn--primary {
    background: #22c55e;
    border-color: #16a34a;
    color: #fff;
}

.reply-btn--danger {
    background: #fff1f2;
    border-color: #fda4af;
    color: #991b1b;
}

/* Footer (mantido como fallback) */
#footer {
    position: sticky;
    bottom: 0;
}