.tedu-chatbot{
    position:fixed;
    right:18px;
    bottom:18px;
    z-index:9999;
    font-family:'Barlow', Arial, sans-serif;
}

.tedu-chatbot-toggle{
    width:60px;
    height:60px;
    border:none;
    border-radius:50%;
    background:linear-gradient(135deg,#0d6efd,#2b84ff);
    color:#fff;
    font-size:24px;
    cursor:pointer;
    box-shadow:0 16px 32px rgba(13,110,253,.28);
    display:flex;
    align-items:center;
    justify-content:center;
}

.tedu-chatbot-toggle:hover{
    transform:translateY(-2px);
}

.tedu-chatbot-panel{
    position:absolute;
    right:0;
    bottom:74px;
    width:380px;
    max-width:calc(100vw - 24px);
    height:560px;
    background:#fff;
    border:1px solid #e5ebf3;
    border-radius:22px;
    box-shadow:0 20px 44px rgba(15,23,42,.16);
    overflow:hidden;
    display:none;
    grid-template-rows:auto 1fr auto;
}

.tedu-chatbot-panel.open{
    display:grid;
}

.tedu-chatbot-header{
    padding:16px 18px;
    background:linear-gradient(135deg,#0d6efd,#2b84ff);
    color:#fff;
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:12px;
}

.tedu-chatbot-header-text strong{
    display:block;
    font-size:18px;
    line-height:1.1;
}

.tedu-chatbot-header-text span{
    display:block;
    margin-top:4px;
    font-size:12px;
    color:rgba(255,255,255,.92);
    line-height:1.45;
}

.tedu-chatbot-header-actions{
    display:flex;
    gap:8px;
}

.tedu-chatbot-reset,
.tedu-chatbot-minimize,
.tedu-chatbot-close{
    border:none;
    background:rgba(255,255,255,.15);
    color:#fff;
    width:34px;
    height:34px;
    border-radius:10px;
    cursor:pointer;
    font-size:18px;
    line-height:1;
}

.tedu-chatbot-body{
    padding:14px;
    overflow:auto;
    background:#f7faff;
}

.tedu-chatbot-msg{
    display:flex;
    margin-bottom:12px;
}

.tedu-chatbot-msg.user{
    justify-content:flex-end;
}

.tedu-chatbot-msg.bot{
    justify-content:flex-start;
}

.tedu-chatbot-msg .bubble{
    max-width:85%;
    padding:12px 14px;
    border-radius:16px;
    font-size:14px;
    line-height:1.5;
    box-shadow:0 4px 14px rgba(15,23,42,.05);
    white-space:pre-wrap;
}

.tedu-chatbot-msg.user .bubble{
    background:#0d6efd;
    color:#fff;
    border-bottom-right-radius:6px;
}

.tedu-chatbot-msg.bot .bubble{
    background:#fff;
    color:#1f2937;
    border:1px solid #e5ebf3;
    border-bottom-left-radius:6px;
}

.tedu-chatbot-quick{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    margin:10px 0 4px;
}

.tedu-quick-btn{
    border:1px solid #d7e6ff;
    background:#fff;
    color:#0d6efd;
    border-radius:999px;
    min-height:34px;
    padding:0 12px;
    font-size:12px;
    font-weight:700;
    cursor:pointer;
}

.tedu-chatbot-cards{
    display:grid;
    gap:8px;
    margin:8px 0 14px;
}

.tedu-chatbot-card{
    display:block;
    background:#fff;
    border:1px solid #e6edf5;
    border-radius:14px;
    padding:12px;
    text-decoration:none;
    color:#111827;
}

.tedu-chatbot-card strong{
    display:block;
    font-size:14px;
    margin-bottom:4px;
}

.tedu-chatbot-card span{
    display:block;
    font-size:12px;
    color:#667085;
    line-height:1.45;
}

.tedu-chatbot-form{
    display:grid;
    grid-template-columns:1fr auto;
    gap:10px;
    padding:12px;
    border-top:1px solid #e5ebf3;
    background:#fff;
}

.tedu-chatbot-form input{
    width:100%;
    min-height:46px;
    border:1px solid #d9e2ec;
    border-radius:12px;
    padding:0 14px;
    font-size:14px;
    outline:none;
}

.tedu-chatbot-form button{
    min-width:88px;
    min-height:46px;
    border:none;
    border-radius:12px;
    background:#0d6efd;
    color:#fff;
    font-weight:800;
    cursor:pointer;
}

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

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

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

@keyframes teduBlink{
    0%,100%{opacity:.35;transform:translateY(0)}
    50%{opacity:1;transform:translateY(-2px)}
}

@media (max-width:640px){
    .tedu-chatbot{
        right:10px;
        left:10px;
        bottom:calc(72px + 22px + env(safe-area-inset-bottom, 0px));
        display:flex;
        justify-content:flex-end;
        pointer-events:none;
    }

    .tedu-chatbot > *{
        pointer-events:auto;
    }

    .tedu-chatbot-panel{
        position:fixed;
        left:50%;
        right:auto;
        bottom:calc(72px + 14px + env(safe-area-inset-bottom, 0px));
        transform:translateX(-50%);
        width:calc(100vw - 20px);
        max-width:calc(100vw - 20px);
        height:calc(100vh - 106px);
        max-height:74vh;
    }
}

.tedu-chatbot-toggle.has-notification::after{
    content:'';
    position:absolute;
    top:6px;
    right:6px;
    width:12px;
    height:12px;
    border-radius:50%;
    background:#ef4444;
    border:2px solid #fff;
}

.tedu-chatbot-toggle{
    position:relative;
}

.tedu-chatbot-cards{
    display:grid;
    gap:10px;
    margin:8px 0 14px;
}

.tedu-chatbot-card{
    display:block;
    background:#fff;
    border:1px solid #e6edf5;
    border-radius:16px;
    padding:12px;
    text-decoration:none;
    color:#111827;
    box-shadow:0 4px 12px rgba(15,23,42,.05);
}

.tedu-chatbot-card-head{
    margin-bottom:10px;
}

.tedu-chatbot-card-head strong{
    display:block;
    font-size:14px;
    line-height:1.35;
    margin-bottom:4px;
    color:#111827;
}

.tedu-chatbot-card-head span{
    display:block;
    font-size:12px;
    color:#667085;
    line-height:1.45;
}

.tedu-chatbot-card-meta{
    display:inline-flex;
    align-items:center;
    min-height:26px;
    padding:0 10px;
    border-radius:999px;
    background:#f5f8fc;
    border:1px solid #e3ebf3;
    color:#475467;
    font-size:11px;
    font-weight:700;
    margin-bottom:10px;
}

.tedu-chatbot-card-actions{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:8px;
}

.tedu-chatbot-card-btn{
    min-height:36px;
    border-radius:10px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    text-align:center;
    text-decoration:none;
    font-size:12px;
    font-weight:800;
    padding:0 10px;
}

.tedu-chatbot-card-btn.primary{
    background:#0d6efd;
    color:#fff;
}

.tedu-chatbot-card-btn.primary:hover{
    background:#0b5ed7;
}

.tedu-chatbot-card-btn.secondary{
    background:#f5f7fb;
    color:#374151;
    border:1px solid #e2e8f0;
}

.tedu-chatbot-card-btn.secondary:hover{
    background:#eef3f9;
}

@media (max-width:640px){
    .tedu-chatbot-card-actions{
        grid-template-columns:1fr;
    }
}

.tedu-chatbot-card-top{
    display:grid;
    grid-template-columns:52px 1fr;
    gap:10px;
    align-items:start;
    margin-bottom:10px;
}

.tedu-chatbot-card-thumb{
    width:52px;
    height:52px;
    border-radius:12px;
    overflow:hidden;
    background:#eef3f8;
    border:1px solid #e5ebf3;
    flex:0 0 52px;
}

.tedu-chatbot-card-thumb img{
    width:100%;
    height:100%;
    object-fit:cover;
    display:block;
}

.tedu-chatbot-auth-box{
    display:grid;
    gap:10px;
    margin:8px 0 14px;
}

.tedu-chatbot-auth-actions{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:8px;
}

.tedu-chatbot-auth-btn{
    min-height:38px;
    border-radius:10px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    text-align:center;
    text-decoration:none;
    font-size:12px;
    font-weight:800;
    padding:0 10px;
}

.tedu-chatbot-auth-btn.primary{
    background:#0d6efd;
    color:#fff;
}

.tedu-chatbot-auth-btn.secondary{
    background:#f5f7fb;
    color:#374151;
    border:1px solid #e2e8f0;
}

@media (max-width:640px){
    .tedu-chatbot-auth-actions{
        grid-template-columns:1fr;
    }
}