/* ============================================================
 * Saqar Chat — تنسيقات مشتركة لرسائل المساعد الذكي "صقار" (Tag-Tail)
 * تُستخدم مع window.SaqarAI.md() في: صفحة الدخول، الودجت الداخلي، BotChat
 * ============================================================ */

/* كتلة المحتوى المنسّق داخل الفقاعة */
.sq-md {
    direction: rtl;
    text-align: right;
    line-height: 1.85;
    word-break: break-word;
}

/* العناوين */
.sq-md .sq-h {
    font-weight: 800;
    margin: 10px 0 4px 0;
    line-height: 1.5;
}
.sq-md .sq-h1 { font-size: 15.5px; color: #0d9488; border-bottom: 2px solid #ccfbf1; padding-bottom: 3px; }
.sq-md .sq-h2 { font-size: 14px;   color: #0f766e; }
.sq-md .sq-h3 { font-size: 13px;   color: #115e59; }
.sq-md .sq-h:first-child { margin-top: 0; }

/* العريض */
.sq-md b { font-weight: 800; color: #0f766e; }
.msg-row.user .lbub .sq-md b, .lrow.u .lbub b, .brow.user .bbubble b { color: #fff; }

/* عناصر القوائم */
.sq-md .sq-li {
    display: flex;
    gap: 7px;
    align-items: flex-start;
    padding: 2px 0;
    margin: 2px 0;
}
.sq-md .sq-bullet { color: #14b8a6; font-weight: 800; flex-shrink: 0; }
.sq-md .sq-num    { color: #14b8a6; font-weight: 800; flex-shrink: 0; min-width: 20px; }
.sq-md .sq-li > span:last-child { flex: 1; }

/* الشيفرة */
.sq-md .sq-code {
    background: #f1f5f4;
    border: 1px solid #d7e3e0;
    border-radius: 10px;
    padding: 10px 12px;
    margin: 8px 0;
    font-family: Consolas, 'Courier New', monospace;
    font-size: 12px;
    direction: ltr;
    text-align: left;
    white-space: pre-wrap;
    overflow-x: auto;
    color: #134e4a;
}
.sq-md .sq-ic {
    background: #f0fdfa;
    border: 1px solid #ccfbf1;
    border-radius: 6px;
    padding: 1px 6px;
    font-family: Consolas, 'Courier New', monospace;
    font-size: 12px;
    color: #0f766e;
    direction: ltr;
    display: inline-block;
}

/* الخط الفاصل */
.sq-md .sq-hr {
    border: none;
    border-top: 1px dashed #99e2d8;
    margin: 10px 0;
}

/* مؤشر الكتابة المتحرك أثناء البث */
.sq-cursor {
    display: inline-block;
    width: 8px;
    height: 15px;
    background: #14b8a6;
    vertical-align: middle;
    margin-inline-start: 3px;
    border-radius: 2px;
    animation: sqBlink 1s infinite;
}
@keyframes sqBlink { 50% { opacity: 0; } }

/* شارة الثواني أثناء الانتظار */
.sq-wait {
    font-size: 11px;
    color: #6b7280;
    margin-top: 3px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.sq-wait::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #14b8a6;
    animation: sqPulse 1s infinite;
}
@keyframes sqPulse { 50% { opacity: .25; } }
