*{
    box-sizing:border-box;
    margin:0;
    padding:0;
}

html,body{
    width:100%;
    min-height:100%;
    font-family:Arial, Helvetica, sans-serif;
}

body{
    min-height:100vh;
    background:#d9d1c7;
    background-image:
        radial-gradient(circle at 20% 20%, rgba(255,255,255,.35) 0 2px, transparent 2px),
        radial-gradient(circle at 80% 30%, rgba(255,255,255,.25) 0 2px, transparent 2px);
    background-size:36px 36px;
    display:flex;
    align-items:center;
    justify-content:center;
}

.phone{
    width:100%;
    max-width:460px;
    height:100vh;
    max-height:900px;
    background:#efe7dd;
    display:flex;
    flex-direction:column;
    box-shadow:0 20px 60px rgba(0,0,0,.22);
    position:relative;
    overflow:hidden;
}

.chat-header{
    height:68px;
    background:#075e54;
    color:white;
    display:flex;
    align-items:center;
    gap:12px;
    padding:12px 16px;
    flex-shrink:0;
    box-shadow:0 2px 8px rgba(0,0,0,.18);
    z-index:2;
}

.avatar{
    width:44px;
    height:44px;
    background:#21c063;
    border-radius:50%;
    display:flex;
    align-items:center;
    justify-content:center;
    font-weight:800;
    font-size:22px;
}

.header-info{
    display:flex;
    flex-direction:column;
    gap:2px;
}

.header-info strong{
    font-size:16px;
}

.header-info span{
    font-size:12px;
    color:#dcfce7;
}

.chat-body{
    flex:1;
    overflow-y:auto;
    padding:18px 12px 12px;
    background:#e5ddd5;
    background-image:
      linear-gradient(45deg, rgba(255,255,255,.13) 25%, transparent 25%),
      linear-gradient(-45deg, rgba(255,255,255,.13) 25%, transparent 25%);
    background-size:26px 26px;
}

.msg{
    width:max-content;
    max-width:82%;
    padding:10px 12px;
    margin-bottom:10px;
    border-radius:14px;
    font-size:15px;
    line-height:1.42;
    box-shadow:0 1px 2px rgba(0,0,0,.12);
    animation:msgIn .24s ease;
    word-break:break-word;
}

.msg.bot{
    background:#fff;
    color:#111827;
    border-top-left-radius:4px;
}

.msg.user{
    background:#dcf8c6;
    color:#111827;
    border-top-right-radius:4px;
    margin-left:auto;
}

.msg img{
    max-width:100%;
    border-radius:12px;
    display:block;
}

.typing{
    display:inline-flex;
    gap:4px;
    align-items:center;
}

.typing span{
    width:6px;
    height:6px;
    background:#94a3b8;
    border-radius:50%;
    animation:typing 1s infinite ease-in-out;
}

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

@keyframes typing{
    0%,80%,100%{transform:translateY(0);opacity:.4}
    40%{transform:translateY(-4px);opacity:1}
}

@keyframes msgIn{
    from{opacity:0;transform:translateY(8px)}
    to{opacity:1;transform:translateY(0)}
}

.chat-footer{
    background:#f0f2f5;
    padding:10px;
    flex-shrink:0;
    border-top:1px solid rgba(0,0,0,.08);
}

.input-row{
    display:flex;
    align-items:center;
    gap:8px;
}

.input-row input{
    flex:1;
    border:0;
    outline:0;
    border-radius:999px;
    padding:14px 16px;
    background:#fff;
    font-size:15px;
    min-width:0;
}

.btn-send,.btn-option,.btn-reset{
    border:0;
    background:#128c7e;
    color:white;
    border-radius:999px;
    padding:13px 16px;
    font-weight:700;
    cursor:pointer;
    white-space:nowrap;
}

.options{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:10px;
}

.btn-option{
    background:#075e54;
    padding:14px;
    font-size:15px;
}

.btn-reset{
    width:100%;
    background:#64748b;
}

.cta{
    display:block;
    margin-top:12px;
    background:#16a34a;
    color:white;
    text-decoration:none;
    text-align:center;
    padding:14px 16px;
    border-radius:999px;
    font-weight:800;
    box-shadow:0 8px 18px rgba(22,163,74,.28);
}

#toast-area{
    position:fixed;
    top:14px;
    left:0;
    width:100%;
    z-index:9999;
    display:flex;
    justify-content:center;
    pointer-events:none;
    padding:0 12px;
}

.toast{
    background:rgba(17,24,39,.96);
    color:white;
    padding:12px 15px;
    border-radius:14px;
    font-size:14px;
    box-shadow:0 12px 30px rgba(0,0,0,.22);
    animation:toastDown .35s ease, toastUp .35s ease 3.7s forwards;
    max-width:420px;
    width:max-content;
}

@keyframes toastDown{
    from{opacity:0;transform:translateY(-20px)}
    to{opacity:1;transform:translateY(0)}
}

@keyframes toastUp{
    to{opacity:0;transform:translateY(-20px)}
}

@media(max-width:520px){
    body{
        align-items:stretch;
        justify-content:stretch;
    }

    .phone{
        max-width:none;
        max-height:none;
        height:100dvh;
        box-shadow:none;
    }

    .msg{
        max-width:86%;
        font-size:14.5px;
    }
}
