/* محاكي نافذة ديسكورد لرسائل Components V2 — يتبع اتجاه الصفحة (يمين لليسار في العربية)
   كل الهوامش والحدود منطقية (inline-start/end) حتى لا تنعكس العناصر في أي اتجاه. */
.dc-window { display: grid; grid-template-columns: 250px minmax(0, 1fr); height: min(80vh, 820px); border-radius: 18px; overflow: hidden;
    border: 1px solid #1E1F22; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); font-family: 'IBM Plex Sans Arabic', 'gg sans', 'Segoe UI', sans-serif; color: #DBDEE1; background: #313338; }
.dc-side { background: #2B2D31; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.dc-server { padding: 14px 16px; font-weight: 700; color: #F2F3F5; border-bottom: 1px solid #1F2023; display: flex; align-items: center; gap: 10px; }
.dc-server img { width: 28px; height: 28px; border-radius: 50%; }
.dc-cat { font-size: .72rem; letter-spacing: .04em; color: #949BA4; padding: 16px 16px 6px; font-weight: 700; }
.dc-chan { all: unset; box-sizing: border-box; display: block; margin: 1px 8px; padding: 7px 10px; border-radius: 6px; color: #949BA4; cursor: pointer; text-align: start; }
.dc-chan:hover { background: #35373C; color: #DBDEE1; }
.dc-chan:focus-visible { outline: 2px solid #5865F2; }
.dc-chan[aria-selected="true"] { background: #404249; color: #F2F3F5; }
.dc-chan .hash { color: #80848E; margin-inline-end: 4px; }
.dc-chan small { display: block; color: #80848E; font-size: .74rem; line-height: 1.4; margin-top: 2px; }
.dc-chan[aria-selected="true"] small { color: #B5BAC1; }
.dc-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.dc-topbar { height: 48px; flex: none; display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid #26272B; }
.dc-topbar b { color: #F2F3F5; white-space: nowrap; }
.dc-topbar span { color: #949BA4; font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* منطقة الرسائل تتمدد داخل النافذة وتُمرَّر بشريط ظاهر مثل ديسكورد */
.dc-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 12px 0 28px; scrollbar-width: auto; scrollbar-color: #1A1B1E #2B2D31; }
.dc-scroll::-webkit-scrollbar { width: 14px; }
.dc-scroll::-webkit-scrollbar-track { background: #2B2D31; border-radius: 8px; border: 3px solid #313338; }
.dc-scroll::-webkit-scrollbar-thumb { background: #1A1B1E; border-radius: 8px; border: 3px solid #313338; }

img.emoji { height: 1.2em; width: 1.2em; margin: 0 .05em; vertical-align: -0.22em; }

/* ملاحظة المعرض فوق كل رسالة */
.dc-note { margin: 22px 16px 6px; margin-inline-start: 72px; display: flex; align-items: center; gap: 10px; color: #E8B931; font-size: .83rem; }
.dc-note::before { content: ''; height: 1px; flex: 0 0 22px; background: #E8B931; opacity: .6; }

.dc-msg { padding: 2px 16px 6px; }
.dc-msg:hover { background: #2E3035; }
.dc-reply { display: flex; align-items: center; gap: 6px; font-size: .82rem; color: #B5BAC1; margin: 4px 0 2px; margin-inline-start: 56px; position: relative; }
.dc-reply-line { position: absolute; inset-inline-start: -36px; top: 8px; width: 30px; height: 10px; border-top: 2px solid #4E5058; border-inline-start: 2px solid #4E5058; border-start-start-radius: 6px; }
.dc-reply.dm { color: #949BA4; }
.dc-cmd { color: #00A8FC; }
.dc-msg-main { display: flex; gap: 16px; }
.dc-avatar { width: 40px; height: 40px; border-radius: 50%; flex: none; margin-top: 2px; }
.dc-msg-body { min-width: 0; flex: 1; max-width: 640px; }
.dc-author { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.dc-author b { color: #F2F3F5; font-weight: 600; }
.dc-app { background: #5865F2; color: #fff; font-size: .62rem; font-weight: 700; padding: 1px 5px; border-radius: 4px; }
.dc-stamp { color: #949BA4; font-size: .75rem; }

.dc-container { background: #2B2D31; border: 1px solid #26272B; border-inline-start: 4px solid var(--accent, #4E5058); border-radius: 8px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.dc-text { font-size: .95rem; line-height: 1.5; overflow-wrap: anywhere; text-align: start; }
.dc-text p, .dc-text h1, .dc-text h2, .dc-text h3, .dc-text small, .dc-text blockquote { margin: 0; }
.dc-text h1 { font-size: 1.85rem; line-height: 1.25; color: #F2F3F5; }
.dc-text h1 img.emoji { height: 1.1em; width: 1.1em; }
.dc-text h2 { font-size: 1.35rem; color: #F2F3F5; }
.dc-text h3 { font-size: 1.08rem; color: #F2F3F5; }
.dc-text small { display: block; font-size: .76rem; color: #949BA4; }
.dc-text blockquote { border-inline-start: 4px solid #4E5058; padding-inline-start: 10px; }
.dc-text code { background: #1E1F22; padding: 1px 4px; border-radius: 4px; font-size: .86em; }
.dc-text pre { background: #1E1F22; padding: 8px; border-radius: 4px; margin: 0; white-space: pre-wrap; }
.dc-gap { height: .5em; }
.dc-mention { background: rgba(88, 101, 242, .3); color: #C9CDFB; padding: 0 3px; border-radius: 3px; font-weight: 500; direction: ltr; unicode-bidi: isolate; }
.dc-time { background: #3A3C42; padding: 0 4px; border-radius: 4px; }
.dc-section { display: flex; gap: 12px; align-items: flex-start; }
.dc-section-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.dc-accessory { flex: none; }
.dc-thumb { width: 85px; height: 85px; object-fit: cover; border-radius: 8px; display: block; }
.dc-gallery { display: grid; gap: 4px; border-radius: 8px; overflow: hidden; }
.dc-gallery img { width: 100%; height: auto; display: block; background: #1E1F22; }
.dc-gallery:not(.n1) img { aspect-ratio: 1; object-fit: cover; }
.dc-gallery.n1 img { max-height: 420px; object-fit: contain; }
.dc-gallery.n2, .dc-gallery.n3, .dc-gallery.n4 { grid-template-columns: 1fr 1fr; }
.dc-sep { border: 0; border-top: 1px solid #3F4147; margin: 2px 0; width: 100%; }
.dc-sep.blank { border-color: transparent; }
.dc-sep.large { margin: 8px 0; }
.dc-row { display: flex; flex-wrap: wrap; gap: 8px; }
.dc-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 2px 14px; border-radius: 8px; font-size: .86rem; font-weight: 500; color: #fff; white-space: nowrap; }
.dc-btn.primary { background: #5865F2; } .dc-btn.secondary { background: #4E5058; } .dc-btn.success { background: #248046; } .dc-btn.danger { background: #DA373C; } .dc-btn.link { background: #4E5058; }
.dc-btn.disabled { opacity: .5; }
.dc-btn:not(:has(span)) { padding: 2px 10px; }
.dc-select { display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%; max-width: 520px; background: #1E1F22; border: 1px solid #1A1B1E; border-radius: 8px; padding: 8px 12px; font-size: .9rem; }
.dc-select .ph { color: #949BA4; }
.dc-select .chev { color: #B5BAC1; }

/* نافذة مفردة بلا قائمة قنوات (المعاينة في الصفحة الرئيسية) */
.dc-window.solo { grid-template-columns: minmax(0, 1fr); height: auto; }
.dc-window.solo .dc-scroll { max-height: 560px; }

@media (max-width: 860px) {
    .dc-window { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); height: 82vh; }
    .dc-side { flex-direction: row; overflow-x: auto; border-bottom: 1px solid #1F2023; }
    .dc-server, .dc-cat, .dc-chan small { display: none; }
    .dc-side > div[role="tablist"] { display: flex; padding: 0 4px; }
    .dc-chan { margin: 8px 4px; white-space: nowrap; flex: none; }
    .dc-note { margin-inline-start: 16px; }
    .dc-msg-main { gap: 10px; }
    .dc-avatar { width: 32px; height: 32px; }
    .dc-reply { margin-inline-start: 42px; }
    .dc-scroll::-webkit-scrollbar { width: 8px; }
}
