/*
 * دردشة أسئلة المحاضر: ملف مستقل لأن صفحتي الإدارة والمحاضر لا تحمّلان تنسيقات الطالب
 * (بلاغ المالكة: الأزرار بلا شكل هناك). يُحمَّل في كل الصفحات من head.php.
 */
:root { --qa-line: #E3EDED; --qa-line-2: #EEF3F3; --qa-ink: #0F1B1C; --qa-muted: #6B7B7C; --qa-brand: #3DA7A9; --qa-brand-50: #F0F8F8; --qa-brand-100: #D7ECEC; --qa-brand-700: #26706F; --qa-flame: #F36829; }
/* =====================================================================
   القرار 16: دردشة أسئلة المحاضر (زر عائم + نافذة دردشة)
   ===================================================================== */
.qa-launch { position: fixed; z-index: 85; inset-inline-start: 18px; bottom: calc(18px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 10px; border: 1px solid var(--qa-line); border-radius: 999px; background: #fff; box-shadow: 0 12px 30px rgba(15, 27, 28, .16); cursor: pointer; font: inherit; }
.qa-launch:hover { box-shadow: 0 14px 34px rgba(15, 27, 28, .22); }
.qa-launch__avatar .ic-avatar { width: 38px; height: 38px; font-size: 15px; }
.qa-launch__text { display: grid; text-align: start; }
.qa-launch__text b { font-size: 14px; font-weight: 800; color: var(--qa-brand-700); }
.qa-launch__text small { color: var(--qa-muted); font-size: 11.5px; }
.qa-launch__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--qa-flame); box-shadow: 0 0 0 3px rgba(243, 104, 41, .18); }
@media (max-width: 1023px) { body:has(.cp-mbar) .qa-launch { bottom: calc(80px + env(safe-area-inset-bottom)); } }
@media (max-width: 420px) { .qa-launch__text b { font-size: 13px; } .qa-launch { padding: 7px 12px 7px 8px; } }

.qa-chat { width: min(420px, calc(100vw - 20px)); max-height: min(78vh, 680px); padding: 0; border: 0; border-radius: 22px; background: #fff; box-shadow: 0 24px 60px rgba(15, 27, 28, .28); overflow: hidden; }
.qa-chat::backdrop { background: rgba(15, 27, 28, .45); }
.qa-chat[open] { display: flex; flex-direction: column; }
.qa-chat__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; background: linear-gradient(180deg, var(--qa-brand-50), #fff); border-bottom: 1px solid var(--qa-line); }
.qa-chat__who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.qa-chat__who .ic-avatar { width: 40px; height: 40px; }
.qa-chat__who b { display: block; font-size: 15px; font-weight: 800; color: var(--qa-ink); }
.qa-chat__who small { color: var(--qa-muted); font-size: 12px; }
.qa-chat__close { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; color: var(--qa-muted); cursor: pointer; }
.qa-chat__close:hover { background: var(--qa-line-2); }
.qa-chat__body { flex: 1; overflow-y: auto; padding: 14px; background: #F7FAFA; }
.qa-chat__lesson { display: flex; align-items: center; gap: 6px; margin: 0 0 12px; padding: 7px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--qa-line-2); color: var(--qa-muted); font-size: 12px; }
.qa-chat__empty, .qa-chat__locked { margin: 0; padding: 14px; border-radius: 14px; background: #fff; border: 1px dashed var(--qa-line); color: var(--qa-muted); font-size: 13.5px; line-height: 1.9; }
.qa-chat__locked { display: flex; align-items: center; gap: 8px; margin: 12px; background: #FFF6E5; border: 0; color: #8A5A00; }
.qa-chat__error { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; padding: 10px 12px; border-radius: 12px; background: #FFF6E5; color: #8A5A00; font-size: 13px; }
.qa-chat__msgs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.qa-chat__day { text-align: center; margin: 6px 0; }
.qa-chat__day span { display: inline-block; padding: 3px 12px; border-radius: 999px; background: #E8F1F1; color: #5E6E70; font-size: 11.5px; }
.qa-chat__msg { max-width: 82%; padding: 9px 12px 6px; border-radius: 16px; background: #fff; border: 1px solid var(--qa-line-2); }
.qa-chat__msg p { margin: 0; font-size: 14px; line-height: 1.85; color: var(--qa-ink); white-space: pre-line; word-break: break-word; }
.qa-chat__msg time { display: block; margin-top: 2px; text-align: end; color: var(--qa-muted); font-size: 10.5px; }
.qa-chat__msg--me { margin-inline-start: auto; background: var(--qa-brand); border-color: var(--qa-brand); border-end-end-radius: 6px; }
.qa-chat__msg--me p { color: #fff; }
.qa-chat__msg--me time { color: rgba(255, 255, 255, .8); }
.qa-chat__msg--them { margin-inline-end: auto; border-end-start-radius: 6px; }
.qa-chat__author { display: block; margin-bottom: 2px; color: var(--qa-brand-700); font-size: 11.5px; font-weight: 800; }
.qa-chat__form { border-top: 1px solid var(--qa-line); background: #fff; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); }
.qa-chat__row { display: flex; align-items: flex-end; gap: 8px; }
.qa-chat__row textarea { flex: 1; min-width: 0; max-height: 120px; padding: 10px 12px; border: 1px solid var(--qa-line); border-radius: 16px; font: inherit; font-size: 14px; line-height: 1.7; color: var(--qa-ink); background: #fff; resize: none; }
.qa-chat__row textarea:focus { border-color: var(--qa-brand); outline: none; box-shadow: 0 0 0 3px var(--qa-brand-100); }
.qa-chat__emoji-btn, .qa-chat__send { flex-shrink: 0; display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--qa-line); border-radius: 50%; background: #fff; font-size: 18px; cursor: pointer; }
.qa-chat__send { border: 0; background: var(--qa-flame); color: #fff; font-size: 15px; }
.qa-chat__emojis { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.qa-chat__emojis[hidden] { display: none; }
.qa-chat__emojis button { width: 34px; height: 34px; border: 1px solid var(--qa-line-2); border-radius: 10px; background: #fff; font-size: 17px; cursor: pointer; }
.qa-chat__emojis button:hover { background: var(--qa-brand-50); }
body:has(.qa-chat[open]) .ic-whatsapp, body:has(.qa-chat[open]) .qa-launch { opacity: 0; pointer-events: none; }



/* مرفقات الدردشة: صورة ورسالة صوتية. */
.qa-chat__icon-btn { flex-shrink: 0; display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--qa-line); border-radius: 50%; background: #fff; color: var(--qa-brand-700); font-size: 15px; cursor: pointer; }
.qa-chat__icon-btn:hover { background: var(--qa-brand-50); }
.qa-chat__icon-btn.is-recording { background: var(--qa-flame); border-color: var(--qa-flame); color: #fff; animation: ic-chat-pulse 1.1s ease-in-out infinite; }
@keyframes ic-chat-pulse { 50% { transform: scale(1.08); } }
.qa-chat__preview { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; padding: 8px 12px; border-radius: 12px; background: var(--qa-brand-50); color: var(--qa-muted); font-size: 12.5px; }
.qa-chat__preview[hidden] { display: none; }
.qa-chat__preview button { border: 0; background: transparent; color: var(--qa-muted); font-size: 15px; cursor: pointer; }
.qa-chat__img { display: block; margin-bottom: 4px; }
.qa-chat__img img { display: block; max-width: 100%; max-height: 220px; border-radius: 12px; }
.qa-chat__audio { display: block; width: 100%; min-width: 180px; margin-bottom: 2px; }
.qa-chat__dur { color: var(--qa-muted); font-size: 11px; }
.qa-chat__msg--me .qa-chat__dur { color: rgba(255, 255, 255, .85); }

/* الدردشة: أزرار أوضح، وزر تسجيل يعرض المدة، وشريط أدوات المحاضر والإدارة. */
.qa-chat__icon-btn.is-recording::after { content: attr(data-qa-timer); position: absolute; transform: translateY(26px); font-size: 10px; font-weight: 700; color: #d9531e; }
.qa-chat__icon-btn { position: relative; transition: background .15s ease, color .15s ease, transform .15s ease; }
.qa-chat__icon-btn:active { transform: scale(.94); }
.qa-chat__send { transition: transform .15s ease, opacity .15s ease; }
.qa-chat__send:active { transform: scale(.94); }
.qa-chat__send.is-sending, .qa-staff__send.is-sending { opacity: .6; pointer-events: none; }
.qa-staff__row { display: flex; align-items: center; gap: 8px; }
.qa-staff__send { display: inline-flex; align-items: center; gap: 8px; margin-inline-start: auto; padding: 10px 20px; border: 0; border-radius: 999px; background: #2f8f90; color: #fff; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.qa-staff__send:hover { background: var(--qa-brand-700); }
.qa-staff__msgs { max-height: 420px; overflow-y: auto; padding: 4px; }
.qa-staff__msgs .qa-chat__msg { max-width: 88%; }

/* حراسة الإخفاء: قواعد العرض أعلاه لا يجوز أن تتجاوز سمة hidden. */
.qa-chat__error[hidden], .qa-chat__preview[hidden], .qa-chat__msgs[hidden], .qa-chat__emojis[hidden], .qa-launch[hidden], [data-qa-record][hidden] { display: none !important; }

/* ═══ منقولة من ثيم الطالب لتعمل أيضًا عند المحاضر والإدارة (بلاغ المالكة) ═══ */
/* ─── الرسالة الصوتية بشكل تطبيقات المحادثة (طلب المالكة) ────────── */
.qa-voice { --qa-progress: 0%; display: flex; align-items: center; gap: 10px; min-width: 190px; max-width: 260px; padding: 6px 8px; border-radius: 999px; background: rgba(255, 255, 255, .55); }
.qa-chat__msg--me .qa-voice { background: rgba(255, 255, 255, .22); }
.qa-voice__play { flex-shrink: 0; display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--brand-500); color: #fff; font-size: 13px; cursor: pointer; }
.qa-chat__msg--me .qa-voice__play { background: #fff; color: var(--brand-700); }
.qa-voice__wave { flex: 1; display: flex; align-items: center; gap: 2px; height: 26px; overflow: hidden; }
.qa-voice__wave i { flex: 1; min-width: 2px; border-radius: 2px; background: currentColor; opacity: .32; transition: opacity .2s ease; }
.qa-voice.is-playing .qa-voice__wave i { animation: qa-wave 1.1s ease-in-out infinite; }
.qa-voice.is-playing .qa-voice__wave i:nth-child(odd) { animation-delay: .2s; }
@keyframes qa-wave { 50% { opacity: .85; transform: scaleY(1.18); } }
.qa-voice__time { flex-shrink: 0; font-variant-numeric: tabular-nums; font-size: 11.5px; opacity: .8; }
.qa-voice audio { display: none; }
@media (prefers-reduced-motion: reduce) { .qa-voice.is-playing .qa-voice__wave i { animation: none; opacity: .7; } }

/* ─── المحادثة تُفتح على آخر رسالة ───────────────────────────────── */
.qa-chat__msgs { scroll-behavior: smooth; }

/* ─── أيقونة الدور بدل كلمته (طلب المالكة) ───────────────────────────── */
.qa-chat__role {
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; margin-bottom: 4px; border-radius: 50%;
    font-size: 11px; line-height: 1; flex-shrink: 0;
}
.qa-chat__role--student { background: #E8F1F1; color: #26706F; }
.qa-chat__role--instructor { background: #EFE7FB; color: #6A3FB5; }
.qa-chat__role--admin { background: #FDECE6; color: #C2410C; }

/* الرسالة الصوتية التي تعذّر تشغيلها تقول ذلك بدل زر لا يستجيب. */
.qa-voice.is-error { opacity: .7; }
.qa-voice.is-error .qa-voice__time { color: #C2410C; }

/* ─── صفّ المحادثة بشكل تطبيقات المحادثة (طلب المالكة) ──────────────── */
.qa-row {
    display: flex; align-items: center; gap: 12px; padding: 12px 14px;
    cursor: pointer; list-style: none; border-radius: var(--r-lg, 16px);
    transition: background .15s ease;
}
.qa-row::-webkit-details-marker { display: none; }
.qa-row:hover { background: var(--line-2, #F2F6F6); }
.qa-row__ava {
    display: grid; place-items: center; width: 42px; height: 42px; flex-shrink: 0;
    border-radius: 50%; background: var(--brand-50, #E8F1F1); color: var(--brand-700, #1F5A5C);
    font-size: 17px; font-weight: 800;
}
.qa-row__main { flex: 1; min-width: 0; }
.qa-row__top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.qa-row__top b { color: var(--ink, #1B2A2B); font-size: 14px; font-weight: 700; }
.qa-row__top time { color: var(--muted, #6C7B7C); font-size: 11px; flex-shrink: 0; }
.qa-row__sub {
    display: block; margin-top: 2px; color: var(--ink-2, #3C4B4C); font-size: 12.5px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.qa-row__meta {
    display: block; margin-top: 2px; color: var(--muted, #6C7B7C); font-size: 11px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.qa-row__side { display: flex; align-items: center; gap: 8px; flex-shrink: 0; color: var(--muted, #6C7B7C); }
.qa-row__flag {
    padding: 3px 10px; border-radius: 99px; background: #FFF4E5; color: #8A5A00;
    font-size: 10.5px; font-style: normal; font-weight: 700;
}
.qa-row__flag--off { background: #F1F4F4; color: #6C7B7C; }
details[open] > .qa-row { background: var(--brand-50, #E8F1F1); }
details[open] > .qa-row .fa-chevron-down { transform: rotate(180deg); }
.qa-row .fa-chevron-down { transition: transform .2s ease; font-size: 12px; }
@media (max-width: 560px) {
    .qa-row { gap: 10px; padding: 10px; }
    .qa-row__ava { width: 36px; height: 36px; font-size: 15px; }
    .qa-row__flag { display: none; }
}

/* ═════════════ صندوق المحادثات — الإدارة والمحاضر (طلب المالكة: شات احترافي) ═════════════ */
.ib { --ib-top: 96px; display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); height: clamp(520px, calc(100dvh - var(--ib-top) - 12px), 880px); scroll-margin-top: var(--ib-top); border: 1px solid var(--qa-line); border-radius: 22px; background: #fff; overflow: hidden; box-shadow: 0 10px 30px rgba(15, 27, 28, .06); }
.ib-side { display: flex; flex-direction: column; min-height: 0; border-inline-end: 1px solid var(--qa-line); background: #FBFDFD; }
.ib-tabs { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 12px 6px; }
.ib-tabs::-webkit-scrollbar { display: none; }
.ib-tabs a { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; background: #EEF3F3; color: #334244; font-size: 12.5px; font-weight: 800; text-decoration: none; }
.ib-tabs a b { min-width: 20px; padding: 1px 6px; border-radius: 999px; background: #fff; color: var(--qa-brand-700); font-size: 11px; text-align: center; }
.ib-tabs a.is-on { background: var(--qa-brand-700); color: #fff; }
.ib-tabs a.is-on b { background: rgba(255, 255, 255, .22); color: #fff; }
.ib-tools { display: flex; gap: 8px; padding: 6px 12px 10px; }
.ib-search { position: relative; flex: 1; min-width: 0; }
.ib-search i { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); color: var(--qa-muted); font-size: 13px; }
.ib-search input { width: 100%; border: 1px solid var(--qa-line); border-radius: 12px; padding: 9px 12px; padding-inline-start: 34px; font: inherit; font-size: 13.5px; background: #fff; }
.ib-search input:focus, .ib-tools select:focus { outline: none; border-color: var(--qa-brand); box-shadow: 0 0 0 3px rgba(61, 167, 169, .15); }
.ib-tools select { max-width: 140px; border: 1px solid var(--qa-line); border-radius: 12px; padding: 8px; font: inherit; font-size: 12.5px; background: #fff; }
.ib-new { margin: 0 12px 8px; padding: 8px 12px; border-radius: 12px; background: #FFF7E6; color: #7C4A03; font-size: 12.5px; }
.ib-new a { font-weight: 800; color: #7C4A03; }
.ib-list { list-style: none; margin: 0; padding: 4px 8px 12px; overflow-y: auto; overflow-x: hidden; flex: 1; min-height: 0; }
.ib-row { width: 100%; display: flex; gap: 12px; align-items: flex-start; padding: 11px 10px; border: 0; border-radius: 14px; background: transparent; text-align: start; font: inherit; cursor: pointer; color: var(--qa-ink); }
.ib-row:hover { background: #F1F7F7; }
.ib-row.is-active { background: var(--qa-brand-50); box-shadow: inset 3px 0 0 var(--qa-brand); }
.ib-ava { flex: 0 0 42px; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 900; font-size: 17px; }
.ib-row__main { flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px; }   /* عمود مقيَّد: النص بسطر واحد كان يمدّ الصف خارج القائمة */
.ib-row__top { display: flex; justify-content: space-between; gap: 8px; }
.ib-row__top b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ib-row__top time { flex: 0 0 auto; font-size: 11.5px; color: var(--qa-muted); }
.ib-row__sub { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #51605F; }
.ib-row__sub > span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ib-row__sub em { font-style: normal; color: var(--qa-brand-700); font-weight: 700; }
.ib-row__meta { font-size: 11.5px; color: var(--qa-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ib-dot { display: none; flex: 0 0 10px; width: 10px; height: 10px; border-radius: 50%; background: #F26A2C; box-shadow: 0 0 0 3px rgba(242, 106, 44, .18); }
.ib-row.is-unread .ib-dot { display: block; }
.ib-row.is-unread .ib-row__top b, .ib-row.is-unread .ib-row__sub > span { font-weight: 800; color: var(--qa-ink); }
.ib-pill { display: inline-block; font-style: normal; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; vertical-align: 1px; }
.ib-pill.is-open { background: #FFF1E8; color: #C2410C; } .ib-pill.is-done { background: #ECFDF3; color: #15803D; } .ib-pill.is-off { background: #F1F4F4; color: #6C7B7C; }
.ib-none, .ib-blank { margin: 18px; text-align: center; color: var(--qa-muted); font-size: 13px; }
.ib-blank i { font-size: 30px; color: var(--qa-brand-100); }
.ib-main { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: linear-gradient(180deg, #F6FAFA, #fff 40%); }
.ib-placeholder { margin: auto; display: grid; justify-items: center; gap: 6px; text-align: center; color: var(--qa-muted); padding: 30px; }
.ib-placeholder i { font-size: 44px; color: var(--qa-brand-100); }
.ib-placeholder b { color: var(--qa-ink); font-size: 16px; }
.ib-conv { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.ib-conv[hidden] { display: none; }
.ib-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--qa-line); background: #fff; }
.ib-head__who { flex: 1; min-width: 0; display: grid; }
.ib-head__who b { font-size: 15px; }
.ib-head__who span { font-size: 12px; color: var(--qa-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ib-head__acts { display: flex; gap: 6px; }
.ib-act { display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: 999px; border: 1px solid var(--qa-line); background: #fff; color: #334244; font: inherit; font-size: 12.5px; font-weight: 700; text-decoration: none; cursor: pointer; }
.ib-act:hover { border-color: var(--qa-brand); color: var(--qa-brand-700); }
.ib-back { display: none; width: 36px; height: 36px; border-radius: 50%; border: 0; background: #EEF3F3; color: var(--qa-brand-700); cursor: pointer; }
.ib-hide { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 16px; background: #FFF7E6; border-bottom: 1px solid #FDE3B0; }
.ib-hide[hidden] { display: none; }
.ib-hide input { flex: 1; min-width: 180px; border: 1px solid #F4D38A; border-radius: 10px; padding: 8px 12px; font: inherit; font-size: 13px; }
.ib-hide button { padding: 8px 16px; border: 0; border-radius: 999px; background: #B45309; color: #fff; font: inherit; font-size: 12.5px; font-weight: 800; cursor: pointer; }
.ib-msgs { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 18px; }
.ib-msgs .qa-chat__msg { max-width: min(76%, 560px); }
.ib-compose { border-top: 1px solid var(--qa-line); background: #fff; padding: 8px 12px 12px; display: grid; gap: 8px; }
.ib-quick { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.ib-quick::-webkit-scrollbar { display: none; }
.ib-quick button { flex: 0 0 auto; padding: 6px 12px; border-radius: 999px; border: 1px dashed var(--qa-brand-100); background: var(--qa-brand-50); color: var(--qa-brand-700); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.ib-quick button:hover { border-style: solid; }
.ib-bar { display: flex; align-items: flex-end; gap: 6px; }
.ib-bar textarea { flex: 1; min-width: 0; resize: none; min-height: 44px; max-height: 160px; overflow-y: auto; padding: 10px 14px; border: 1px solid var(--qa-line); border-radius: 18px; font: inherit; font-size: 14px; line-height: 1.55; }
.ib-bar textarea:focus { outline: none; border-color: var(--qa-brand); box-shadow: 0 0 0 3px rgba(61, 167, 169, .15); }
.ib-send { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--qa-brand-700); color: #fff; font-size: 16px; cursor: pointer; box-shadow: 0 8px 18px rgba(38, 112, 111, .28); }
.ib-send:hover { background: #1F5A5C; }
.ib-hidden-note { padding: 12px 16px; border-top: 1px solid var(--qa-line); background: #F7F9F9; font-size: 13px; color: #51605F; display: grid; gap: 8px; }
.ib-hidden-note .ib-hide { background: transparent; border: 0; padding: 0; }
@media (max-width: 900px) {
    .ib { grid-template-columns: 1fr; height: calc(100vh - var(--ib-top) - 8px); height: calc(100dvh - var(--ib-top) - 8px); min-height: 460px; border-radius: 18px; }
    .ib-main { display: none; }
    .ib.is-conv .ib-side { display: none; }
    .ib.is-conv .ib-main { display: flex; }
    .ib-back { display: inline-grid; place-items: center; }
    .ib-head { padding: 10px 12px; gap: 10px; }
    .ib-act span { display: none; }
    .ib-msgs { padding: 12px; }
    .ib-msgs .qa-chat__msg { max-width: 88%; }
}

/* الطالب: «أُرسلت / قُرئت»، والشات بملء الشاشة على الجوال */
.qa-receipt { margin: 4px 0 0; display: flex; align-items: center; justify-content: flex-end; gap: 5px; font-size: 11.5px; font-weight: 700; color: var(--qa-muted); }
.qa-receipt[hidden] { display: none; }
.qa-receipt[data-state="seen"] { color: var(--qa-brand-700); }
.qa-receipt[data-state="sent"] i::before { content: "\f00c"; }
@media (max-width: 640px) {
    .qa-chat { width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
    .qa-chat[open] { inset: 0; }
}

/* رسالة من رموز تعبيرية فقط (حتى ثلاثة): تكبر كتطبيقات المحادثة */
.qa-chat__msg.is-emoji { background: transparent !important; border-color: transparent !important; box-shadow: none; padding-inline: 4px; }
.qa-chat__msg.is-emoji p { font-size: 38px; line-height: 1.2; }
.qa-chat__msg.is-emoji time { color: var(--qa-muted) !important; }
.qa-chat__msg.is-emoji .qa-chat__role { opacity: .7; }
