/* ==========================================================================
   Aether blade — طبقة التصميم v4
   تُحمَّل بعد style.css. الفكرة: هوية الأوربت والنجمة رباعية الرؤوس تبقى،
   والزينة المتكررة (توهّج، تدرجات، ظهور متتابع) تُستبدل بتفاصيل لها وظيفة.
   ========================================================================== */

:root {
    --font-display: 'IBM Plex Sans Arabic', 'Tajawal', system-ui, sans-serif;
    --r-lg: 16px;      /* الأسطح الكبيرة */
    --r-md: 12px;      /* الحقول والأزرار */
    --r-sm: 8px;       /* العناصر الداخلية */
    --edge: #6b9bff;   /* حدّ النصل */
    --ease: cubic-bezier(.22, .8, .3, 1);
    --press: cubic-bezier(.3, 1.5, .5, 1);
    --discord-bg: #313338;
    --discord-bg-2: #2b2d31;
    --discord-text: #dbdee1;
}
html[data-theme="light"] { --edge: #2468cc; }

h1, h2, .tab-title, .page-title, .wordmark, .brand-mini strong, .error-code, .stat-value, .section-heading h2 {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: 0;
}
.stat-value { font-feature-settings: "tnum"; font-weight: 600; }
::selection { background: color-mix(in srgb, var(--gold) 34%, transparent); color: inherit; }
* { scrollbar-color: color-mix(in srgb, var(--text-dim) 40%, transparent) transparent; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--text-dim) 38%, transparent); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--text-dim) 60%, transparent); }

/* ---------- نصل: الخط الفاصل المميز (يُستخدم في موضعين فقط) ---------- */
.edge {
    display: block; height: 1px; width: 100%; border: 0; margin: 0;
    background: linear-gradient(90deg, transparent 0%, var(--line) 12%, var(--edge) 50%, var(--line) 88%, transparent 100%);
    opacity: .9;
}

/* ==========================================================================
   اللوحة: تهدئة الطبقات المتراكمة
   ========================================================================== */
.card, .stat-card, .quick-card, .guild-card, .command-card, .feature, .feature-card {
    background-image: none;
    box-shadow: none;
}
.card { border-radius: var(--r-lg); }
.builder-item, .workflow-button-card, .role-check, .media-upload-inline { border-radius: var(--r-md); }

/* الأزرار: لون واحد، وضغطة محسوسة بدل التوهّج */
.btn-gold { background: var(--gold); color: var(--accent-ink); box-shadow: none; animation: none; }
.btn-gold:hover { background: var(--gold-soft); filter: none; }
.btn { transition: background .15s, border-color .15s, transform .18s var(--press), opacity .15s; }
.btn:active, .filter-chip:active, .nav-item:active { transform: scale(.975); }
.btn-gold:active { filter: none; }
.fx-rip { display: none; }

/* الصفحة تظهر بتلاشٍ واحد خفيف، بدل تتابع كل عنصر */
.content > :not(.topbar), .stats-grid > *, .quick-grid > *, .split-cards > *, .command-grid > * { animation: none; }
.content { animation: pageIn .2s ease-out both; }
@keyframes pageIn { from { opacity: 0; } to { opacity: 1; } }

/* الشريط الجانبي */
.nav-item { transition: background .14s, color .14s; }
.nav-item.active { background: color-mix(in srgb, var(--gold) 11%, transparent); }
html[data-theme="light"] .nav-item.active { background: color-mix(in srgb, var(--gold) 9%, transparent); }
.nav-item.active::before { filter: none; transform-origin: center; animation: starSet .3s var(--press) both; }
@keyframes starSet { from { transform: scale(0) rotate(-90deg); } }

/* الرئيسية: لوحة التحكم تبدأ بالمعلومة، لا بالزينة */
.premium-hero {
    background: var(--orbit-art) no-repeat left 70px bottom -30px / 440px auto;
    background-color: var(--card);
    border-radius: var(--r-lg);
}
html[data-theme="light"] .premium-hero { background: var(--orbit-art) no-repeat left 70px bottom -30px / 440px auto; background-color: var(--card); }
.hero-status { border-radius: var(--r-md); }
.hero-status .status-dot { animation: live 2.6s ease-in-out infinite; }
@keyframes live { 50% { box-shadow: 0 0 0 6px rgba(56, 201, 141, 0); } }

.stats-grid { gap: 0; border: 1px solid var(--card-border); border-radius: var(--r-lg); background: var(--card); overflow: hidden; }
.stat-card { border: 0; border-radius: 0; background: transparent; padding: 20px 22px; align-items: center; position: relative; }
.stat-card + .stat-card::before { content: ""; position: absolute; inset-block: 18px; inset-inline-start: 0; width: 1px; background: var(--line); }
.stat-icon { width: auto; height: auto; background: none; border: 0; border-radius: 0; color: var(--gold); display: grid; place-items: center; }
.stat-icon .ico { width: 24px; height: 24px; stroke-width: 1.6; }
.stat-card:hover { box-shadow: none; border-color: transparent; }
.stat-value { font-size: 1.9rem; }

.quick-grid { gap: 1px; background: var(--line); border: 1px solid var(--card-border); border-radius: var(--r-lg); overflow: hidden; }
.quick-card { border: 0; border-radius: 0; background: var(--card); padding: 18px 20px; transition: background .14s; }
.quick-card > span { background: none; border: 0; width: 28px; height: 28px; color: var(--gold); }
.quick-card > span .ico { width: 22px; height: 22px; stroke-width: 1.6; }
.quick-card > b { transition: transform .22s var(--ease), color .14s; display: inline-block; }
.quick-card:hover { background: var(--card-hover); border-color: transparent; }
.quick-card:hover > b { transform: translateX(-5px); }
.quick-card:active { background: color-mix(in srgb, var(--gold) 8%, var(--card)); }

/* مربع الاختيار: علامة تُرسم عند التحديد (عدا المفاتيح التي لها تصميم خاص) */
input[type=checkbox]:not(.ab-switch input):not(.vis-switch input):not(.command-toggle input) {
    -webkit-appearance: none; appearance: none; width: 18px; height: 18px; flex: none; margin: 0;
    border: 1.5px solid var(--hover-line); border-radius: 5px; background: var(--bg-0); cursor: pointer;
    display: inline-grid; place-content: center; vertical-align: middle;
    transition: background .14s, border-color .14s, transform .18s var(--press);
}
input[type=checkbox]:not(.ab-switch input):not(.vis-switch input):not(.command-toggle input)::after {
    content: ""; width: 10px; height: 6px; margin-top: -2px; border: solid var(--accent-ink); border-width: 0 0 2px 2px;
    transform: rotate(-45deg) scale(0); transition: transform .18s var(--press);
}
input[type=checkbox]:not(.ab-switch input):not(.vis-switch input):not(.command-toggle input):hover { border-color: var(--gold); }
input[type=checkbox]:not(.ab-switch input):not(.vis-switch input):not(.command-toggle input):checked { background: var(--gold); border-color: var(--gold); }
input[type=checkbox]:not(.ab-switch input):not(.vis-switch input):not(.command-toggle input):checked::after { transform: rotate(-45deg) scale(1); }
input[type=checkbox]:not(.ab-switch input):not(.vis-switch input):not(.command-toggle input):active { transform: scale(.88); }

/* مفتاح التشغيل: ضغطة تمدّد الزر، والتوهّج يخفّ */
.ab-switch input:checked + .ab-switch-track { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }

/* شريط الحفظ والتنبيه: ظهور بنابض قصير */
.toast { transition: opacity .18s, transform .32s var(--press); border-radius: var(--r-md); }
.savebar { transition: opacity .18s, transform .34s var(--press); border-radius: var(--r-md); }

/* ==========================================================================
   الصفحة العامة (index)
   ========================================================================== */
.lp { background: var(--bg-0); overflow-x: hidden; }
html[data-theme="light"] .lp, html[data-theme="dark"] .lp { background-image: none; }
.lp-wrap { width: min(1160px, 100% - 48px); margin-inline: auto; }

.lp-nav { display: flex; align-items: center; justify-content: space-between; padding: 22px 0; }
.lp .wordmark { font-size: 1.2rem; letter-spacing: .02em; gap: 12px; }
.lp .wordmark .logo { width: 36px; height: 36px; }

/* --- المدخل --- */
.lp-hero { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 480px); gap: clamp(32px, 6vw, 88px); align-items: center; padding: clamp(28px, 6vw, 72px) 0 clamp(56px, 8vw, 104px); }
.lp-copy h1 { font-size: clamp(2.2rem, 4.6vw, 3.6rem); line-height: 1.22; margin: 0 0 20px; max-width: 14ch; text-wrap: balance; }
.lp-copy .lead { color: var(--text-dim); font-size: 1.1rem; line-height: 1.9; max-width: 46ch; margin: 0 0 32px; }
.lp-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.lp-actions .btn-gold { min-height: 48px; padding: 11px 26px; font-size: 1rem; }
.lp-actions .btn:not(.btn-gold) { min-height: 48px; padding: 11px 22px; }
.lp-note { display: flex; align-items: center; gap: 8px; margin-top: 18px; color: var(--text-dim); font-size: .88rem; }
.lp-note .ico { color: var(--success); }

.lp-orbit { position: absolute; inset-inline-end: -8%; top: 50%; width: min(760px, 110%); height: auto; transform: translateY(-50%); pointer-events: none; z-index: 0; color: var(--edge); opacity: .55; }
.lp-copy, .lp-console { position: relative; z-index: 1; }

/* --- وحدة التحكم التوضيحية --- */
.lp-console { display: flex; flex-direction: column; align-items: stretch; }
.lc-panel { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--r-lg); overflow: hidden; }
.lc-head { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--line); font-size: .86rem; font-weight: 600; }
.lc-head i { width: 8px; height: 8px; border-radius: 50%; background: var(--success); animation: live 2.6s ease-in-out infinite; }
.lc-head small { margin-inline-start: auto; color: var(--text-dim); font-weight: 400; font-size: .76rem; }
.lc-rows { list-style: none; margin: 0; padding: 0; }
.lc-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 18px; transition: background .2s; }
.lc-row + .lc-row { border-top: 1px solid var(--line); }
.lc-row.is-on { background: color-mix(in srgb, var(--gold) 6%, transparent); }
.lc-row b { display: block; font-size: .95rem; font-weight: 600; line-height: 1.4; }
.lc-row small { color: var(--text-dim); font-size: .8rem; }

.lc-link { position: relative; align-self: center; width: 2px; height: 28px; background: var(--line); }
.lc-link::after { content: ""; position: absolute; inset-inline-start: 50%; top: 0; width: 9px; height: 9px; margin-inline-start: -4.5px; background: var(--edge); opacity: 0;
    clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); }
.lc-link.go::after { animation: signal .42s var(--ease) both; }
@keyframes signal { 0% { transform: translateY(0) scale(.6); opacity: 0; } 20% { opacity: 1; } 100% { transform: translateY(22px) scale(1); opacity: 0; } }

.lc-discord { background: var(--discord-bg); color: var(--discord-text); border: 1px solid var(--card-border); border-radius: var(--r-lg); overflow: hidden; min-height: 214px; direction: rtl; }
.ld-head { display: flex; align-items: center; gap: 8px; padding: 11px 16px; background: var(--discord-bg-2); font-size: .84rem; font-weight: 600; box-shadow: 0 1px 0 rgba(0, 0, 0, .25); }
.ld-head span { color: #949ba4; }
.ld-feed { padding: 8px 6px; display: flex; flex-direction: column; }
.ld-empty { padding: 34px 20px; text-align: center; color: #949ba4; font-size: .88rem; line-height: 1.8; }
.ld-msg { display: grid; grid-template-columns: 40px 1fr; gap: 12px; padding: 8px 14px; overflow: hidden; animation: msgIn .34s var(--ease) both; }
.ld-msg.out { animation: msgOut .22s ease-in forwards; }
@keyframes msgIn { from { opacity: 0; transform: translateY(10px); max-height: 0; } to { opacity: 1; transform: none; max-height: 140px; } }
@keyframes msgOut { to { opacity: 0; max-height: 0; padding-block: 0; } }
.ld-avatar { width: 40px; height: 40px; border-radius: 50%; background: #05050f url("../img/bot-avatar.png") center / cover; }
.ld-name { font-size: .92rem; font-weight: 600; color: #fff; display: flex; align-items: center; gap: 6px; }
.ld-tag { font-size: .62rem; font-weight: 700; padding: 1px 5px; border-radius: 4px; background: #5865f2; color: #fff; line-height: 1.4; }
.ld-text { font-size: .9rem; line-height: 1.7; margin-top: 2px; }
.ld-embed { margin-top: 6px; border-inline-start: 4px solid #6b9bff; background: var(--discord-bg-2); border-radius: 4px; padding: 10px 14px; }
.ld-embed b { display: block; color: #fff; font-size: .92rem; margin-bottom: 2px; }
.ld-embed span { font-size: .86rem; color: #c4c9ce; }
.ld-log { color: #b5bac1; }
.ld-log em { font-style: normal; color: #f0b232; }

/* --- الوحدات: دفتر بدل بطاقات متطابقة --- */
.lp-modules { padding: clamp(56px, 8vw, 96px) 0 clamp(40px, 6vw, 72px); }
.lp-modules h2, .lp-trust h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.35; margin: 0 0 12px; max-width: 22ch; text-wrap: balance; }
.lp-sub { color: var(--text-dim); margin: 0 0 40px; max-width: 52ch; line-height: 1.85; }
.lp-ledger { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; column-gap: clamp(32px, 6vw, 88px); border-top: 1px solid var(--card-border); }
.lp-ledger li { display: grid; grid-template-columns: 28px 1fr; gap: 6px 16px; padding: 24px 0; border-bottom: 1px solid var(--line); transition: background .2s; }
.lp-ledger .ico { grid-row: span 2; width: 24px; height: 24px; margin-top: 3px; color: var(--gold); stroke-width: 1.6; transition: transform .3s var(--press); }
.lp-ledger li:hover .ico { transform: rotate(-8deg) scale(1.12); }
.lp-ledger h3 { margin: 0; font-size: 1.08rem; font-weight: 600; font-family: var(--font-display); }
.lp-ledger p { margin: 0; color: var(--text-dim); font-size: .94rem; line-height: 1.8; max-width: 44ch; }

/* --- الثقة --- */
.lp-trust { padding: clamp(40px, 6vw, 72px) 0 clamp(56px, 8vw, 96px); }
.lp-facts { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 36px; border: 1px solid var(--card-border); border-radius: var(--r-lg); background: var(--card); }
.lp-fact { padding: 26px 28px; }
.lp-fact + .lp-fact { border-inline-start: 1px solid var(--line); }
.lp-fact h3 { margin: 0 0 8px; font-size: 1.02rem; font-weight: 600; font-family: var(--font-display); }
.lp-fact p { margin: 0; color: var(--text-dim); font-size: .92rem; line-height: 1.85; }

/* --- الدعوة --- */
.lp .invite-hero { max-width: none; width: min(1160px, 100% - 48px); margin: 0 auto clamp(40px, 6vw, 72px); border-radius: var(--r-lg); border: 1px solid var(--card-border);
    background: var(--card); box-shadow: none; padding: 40px clamp(24px, 5vw, 56px); justify-content: flex-start; gap: clamp(24px, 4vw, 48px); }
.lp .invite-rays { animation: none; background: none; -webkit-mask: none; mask: none; width: 176px; height: 176px; border: 1px solid var(--card-border); border-radius: 50%; }
.lp .invite-rays::after { content: ""; position: absolute; inset: -14px -30px; border: 1px solid var(--edge); opacity: .5; border-radius: 50%; transform: rotate(-22deg) scaleY(.32); }
.lp .invite-orb img { animation: none; filter: none; }
.lp .invite-orb { width: 176px; height: 176px; }
.lp .invite-copy h2 { color: var(--text); font-family: var(--font-display); font-weight: 600; font-size: 1.7rem; }
.lp .invite-copy p { color: var(--text-dim); }
.lp .invite-btn { background: var(--bg-2); box-shadow: none; transition: border-color .18s, transform .18s var(--press); }
.lp .invite-btn:hover { transform: none; box-shadow: none; border-color: var(--edge); }
.lp .invite-btn:active { transform: scale(.975); }
.lp .invite-btn img, .lp .invite-glow { filter: none; }
.lp .invite-glow { display: none; }

.lp .adsterra-ad-slot { width: min(1160px, 100% - 48px); margin: 0 auto 40px; min-height: 0; }
.lp .site-footer { border-top: 1px solid var(--line); font-family: var(--font-display); letter-spacing: .04em; }

@media (max-width: 920px) {
    .lp-hero { grid-template-columns: 1fr; }
    .lp-copy h1 { max-width: none; }
    .lp-orbit { inset-inline-end: -40%; top: 18%; opacity: .35; }
    .lp-ledger { grid-template-columns: 1fr; }
    .lp-facts { grid-template-columns: 1fr; }
    .lp-fact + .lp-fact { border-inline-start: 0; border-top: 1px solid var(--line); }
    .lp .invite-hero { flex-direction: column; text-align: center; }
    .lp .invite-copy p { margin-inline: auto; }
    .stats-grid { border-radius: var(--r-md); }
}
@media (max-width: 560px) {
    .lp-wrap, .lp .invite-hero, .lp .adsterra-ad-slot { width: calc(100% - 32px); }
    .lp-actions .btn { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .ld-msg, .ld-msg.out, .lc-link.go::after, .content, .nav-item.active::before { animation: none !important; }
    .btn:active, .filter-chip:active, .nav-item:active { transform: none; }
}

/* إصلاح الوضع الفاتح: نص زر الدعوة، وخلفية الشعار */
.lp .invite-btn { color: var(--text); }
.lp .invite-orb { background: #070a18; border-radius: 50%; overflow: hidden; border: 1px solid var(--card-border); }
.lp .invite-rays { border: 0; }
.lp .invite-rays::after { display: none; }
.lp .invite-orb img { width: 150px; margin-top: 6px; }

/* ==========================================================================
   صفحة اختيار السيرفر: قائمة واحدة بدل شبكة بطاقات
   ========================================================================== */
.picker-page { max-width: 720px; }
.guild-grid { display: block; border: 1px solid var(--card-border); border-radius: var(--r-lg); background: var(--card); overflow: hidden; }
.guild-card { border: 0; border-radius: 0; background: transparent; padding: 16px 20px; transition: background .14s; }
.guild-card + .guild-card { border-top: 1px solid var(--line); }
.guild-card:hover { background: var(--card-hover); border-color: transparent; }
.guild-card:active { background: color-mix(in srgb, var(--gold) 8%, var(--card)); }
.guild-card .fallback-icon, .guild-card img { box-shadow: none; border-radius: 12px; }
.guild-card .go { transition: transform .22s var(--ease); }
.guild-card:hover .go { transform: translateX(-4px); }
html[dir="ltr"] .guild-card:hover .go { transform: translateX(4px); }
html[dir="ltr"] .quick-card:hover > b { transform: translateX(5px); }

/* بقية التفاصيل */
.lc-discord { direction: inherit; }
.dashboard-layout::before { opacity: .45; }

@media (max-width: 720px) {
    .stat-card:nth-child(n+3) { border-top: 1px solid var(--line); }
    .stat-card:nth-child(odd)::before { display: none; }
}


/* ==========================================================================
   وضوح الخط العربي
   الأسباب التي كانت تُضعف القراءة: تنعيم يُنحّف الخط على الخلفية الداكنة، رمادي باهت،
   أحجام صغيرة جدًا، وتباعد حروف سالب/موجب يقطع اتصال الحروف العربية.
   ========================================================================== */
:root { --text-dim: #aab3d3; }
html[data-theme="light"] { --text-dim: #4b556b; }

html, body { -webkit-font-smoothing: auto; -moz-osx-font-smoothing: auto; text-rendering: optimizeLegibility; }
body { font-size: 1rem; line-height: 1.75; font-feature-settings: "kern" 1, "liga" 1, "calt" 1, "tnum" 1; }
html[data-theme="dark"] body { font-weight: 500; }

/* الحروف العربية لا تقبل تباعدًا بينها */
html[lang="ar"] body, html[lang="ar"] body * { letter-spacing: 0 !important; }
html[lang="ar"] .wordmark, html[lang="ar"] .ae-code { letter-spacing: .02em !important; }

h1, h2, h3, .tab-title, .page-title, .card h3, .section-heading h2 { font-weight: 700; line-height: 1.4; }
.tab-title { font-size: 1.75rem; }
.card h3 { font-size: 1.1rem; }
.tab-desc, .page-intro p, .lp-sub { font-size: 1rem; line-height: 1.85; }
small { font-size: .88rem; }
.nav-item { font-size: 1rem; }
.nav-group-title { font-size: .84rem; }
label, .field label { font-size: .95rem; font-weight: 600; }
input, select, textarea, .btn { font-size: 1rem; }
.lc-row small, .stat-label, .lc-head small { font-size: .84rem; }
.ld-text, .ld-embed span { font-size: .95rem; }


/* ==========================================================================
   v5 — الألوان والبهجة
   ثلاث أفكار فقط، كلها لها وظيفة:
   1) كل قسم له لونه (يظهر في القائمة، الأزرار، المفاتيح، العنوان) فيعرف المستخدم أين هو.
   2) الأزرار الأساسية لها "حافة" تنضغط كزر حقيقي.
   3) النجاح يُحتفى به بشرارات صغيرة، والأرقام تصل بعدّ سريع، والصفحات تتبدّل بنعومة.
   ========================================================================== */
:root {
    --h-blue: #6b9bff; --h-violet: #a285ff; --h-amber: #ffc24d; --h-rose: #ff7d8f; --h-mint: #4fd8ac;
    --h: var(--h-blue);
    --star-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
    --stars: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='320'%3E%3Cg fill='%23b9c8ff' fill-opacity='.065'%3E%3Cpath d='M40 52l2.2 6.8 6.8 2.2-6.8 2.2L40 70l-2.2-6.8L31 61l6.8-2.2z'/%3E%3Cpath d='M214 30l1.6 4.9 4.9 1.6-4.9 1.6L214 43l-1.6-4.9-4.9-1.6 4.9-1.6z'/%3E%3Cpath d='M268 176l2.4 7.2 7.2 2.4-7.2 2.4-2.4 7.2-2.4-7.2-7.2-2.4 7.2-2.4z'/%3E%3Cpath d='M96 238l1.6 4.9 4.9 1.6-4.9 1.6L96 251l-1.6-4.9-4.9-1.6 4.9-1.6z'/%3E%3Cpath d='M176 136l1.2 3.6 3.6 1.2-3.6 1.2-1.2 3.6-1.2-3.6-3.6-1.2 3.6-1.2z'/%3E%3C/g%3E%3C/svg%3E");
}
html[data-theme="light"] {
    --h-blue: #2468cc; --h-violet: #6c4fe0; --h-amber: #a85f00; --h-rose: #d03a55; --h-mint: #0d8a63;
    --stars: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='320'%3E%3Cg fill='%23516a9f' fill-opacity='.09'%3E%3Cpath d='M40 52l2.2 6.8 6.8 2.2-6.8 2.2L40 70l-2.2-6.8L31 61l6.8-2.2z'/%3E%3Cpath d='M214 30l1.6 4.9 4.9 1.6-4.9 1.6L214 43l-1.6-4.9-4.9-1.6 4.9-1.6z'/%3E%3Cpath d='M268 176l2.4 7.2 7.2 2.4-7.2 2.4-2.4 7.2-2.4-7.2-7.2-2.4 7.2-2.4z'/%3E%3Cpath d='M96 238l1.6 4.9 4.9 1.6-4.9 1.6L96 251l-1.6-4.9-4.9-1.6 4.9-1.6z'/%3E%3C/g%3E%3C/svg%3E");
}
body { background-image: var(--stars); background-size: 320px 320px; background-attachment: fixed; }

/* لون القسم الحالي يصير هو اللون الأساسي للصفحة كلها */
body[data-tab] {
    --gold: var(--h);
    --gold-soft: color-mix(in srgb, var(--h) 72%, var(--text));
    --sw-on: var(--h);
    --sw-on-glow: transparent;
}
/* ألوان الأقسام */
body[data-tab="welcome"],
body[data-tab="leveling"],
body[data-tab="reaction_roles"],
body[data-tab="autorole"],
body[data-tab="verification"],
body[data-tab="extras"],
body[data-tab="adhkar"],
body[data-tab="tempvoice"],
body[data-tab="notify"],
body[data-tab="scheduled"] { --h: var(--h-violet); }
.nav-row[data-slug="welcome"],
.nav-row[data-slug="leveling"],
.nav-row[data-slug="reaction_roles"],
.nav-row[data-slug="autorole"],
.nav-row[data-slug="verification"],
.nav-row[data-slug="extras"],
.nav-row[data-slug="adhkar"],
.nav-row[data-slug="tempvoice"],
.nav-row[data-slug="notify"],
.nav-row[data-slug="scheduled"],
.quick-card[href$="/welcome"],
.quick-card[href$="/leveling"],
.quick-card[href$="/reaction_roles"],
.quick-card[href$="/autorole"],
.quick-card[href$="/verification"],
.quick-card[href$="/extras"],
.quick-card[href$="/adhkar"],
.quick-card[href$="/tempvoice"],
.quick-card[href$="/notify"],
.quick-card[href$="/scheduled"] { --h: var(--h-violet); }
body[data-tab="economy"],
body[data-tab="games"] { --h: var(--h-amber); }
.nav-row[data-slug="economy"],
.nav-row[data-slug="games"],
.quick-card[href$="/economy"],
.quick-card[href$="/games"] { --h: var(--h-amber); }
body[data-tab="antinuke"],
body[data-tab="automod"],
body[data-tab="advanced_security"],
body[data-tab="aimod"],
body[data-tab="moderation"],
body[data-tab="modplus"] { --h: var(--h-rose); }
.nav-row[data-slug="antinuke"],
.nav-row[data-slug="automod"],
.nav-row[data-slug="advanced_security"],
.nav-row[data-slug="aimod"],
.nav-row[data-slug="moderation"],
.nav-row[data-slug="modplus"],
.quick-card[href$="/antinuke"],
.quick-card[href$="/automod"],
.quick-card[href$="/advanced_security"],
.quick-card[href$="/aimod"],
.quick-card[href$="/moderation"],
.quick-card[href$="/modplus"] { --h: var(--h-rose); }
body[data-tab="ai"],
body[data-tab="auto_responses"],
body[data-tab="autoreply"] { --h: var(--h-mint); }
.nav-row[data-slug="ai"],
.nav-row[data-slug="auto_responses"],
.nav-row[data-slug="autoreply"],
.quick-card[href$="/ai"],
.quick-card[href$="/auto_responses"],
.quick-card[href$="/autoreply"] { --h: var(--h-mint); }

/* القائمة الجانبية: أيقونة كل قسم بلونه */
.nav-row .nav-item span { color: var(--h, var(--h-blue)); }
.nav-row .nav-item:hover { background: color-mix(in srgb, var(--h, var(--h-blue)) 11%, transparent); color: var(--text); }
.nav-row .nav-item.active { background: color-mix(in srgb, var(--h, var(--h-blue)) 17%, transparent); color: var(--text); font-weight: 600; }
.nav-row .nav-item.active::before { background: var(--h, var(--h-blue)); }

/* العنوان: شريط بلون القسم يمتد عند الوصول */
.tab-title::after { content: ""; display: block; width: 46px; height: 4px; border-radius: 4px; margin-top: 12px; background: var(--gold); animation: barIn .5s var(--ease) both; }
.premium-hero .tab-title::after { display: none; }
@keyframes barIn { from { width: 0; } }

/* عنوان البطاقة: نجمة صغيرة بلون القسم */
.card > h3::before, .card h3:first-child::before {
    content: ""; display: inline-block; width: 11px; height: 11px; margin-inline-end: 10px; vertical-align: -1px;
    background: var(--gold); clip-path: var(--star-path);
}
html[data-theme="dark"] .card { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035); }

/* الزر الأساسي: حافة سفلية تنضغط */
.btn-gold {
    --lip: color-mix(in srgb, var(--gold) 52%, #000);
    box-shadow: 0 3px 0 var(--lip);
    transition: transform .12s var(--press), box-shadow .12s, background .15s;
}
.btn-gold:hover { transform: translateY(-1px); box-shadow: 0 4px 0 var(--lip); background: var(--gold-soft); }
.btn-gold:active { transform: translateY(3px); box-shadow: 0 0 0 var(--lip); }
.btn-gold:disabled, .btn-gold[disabled] { box-shadow: none; transform: none; }
html[data-theme="light"] .btn-gold { --lip: color-mix(in srgb, var(--gold) 62%, #000); }

/* المفاتيح: حلقة تنبض عند التبديل */
.ab-switch::before { content: ""; position: absolute; inset: -3px; border-radius: 16px; border: 2px solid var(--sw-on); opacity: 0; pointer-events: none; }
.ab-switch.pop::before { animation: swPop .5s ease-out; }
@keyframes swPop { from { opacity: .8; transform: scale(.88); } to { opacity: 0; transform: scale(1.35); } }
.ab-switch input:checked + .ab-switch-track { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); }

/* الرئيسية */
.greet { display: flex; align-items: center; gap: 9px; font-weight: 600; color: var(--h-amber); margin-bottom: 8px; font-size: 1rem; }
.greet::before { content: ""; width: 14px; height: 14px; background: var(--h-amber); clip-path: var(--star-path); }
.stat-card:nth-child(1) .stat-icon { color: var(--h-violet); }
.stat-card:nth-child(2) .stat-icon { color: var(--h-blue); }
.stat-card:nth-child(3) .stat-icon { color: var(--h-mint); }
.stat-card:nth-child(4) .stat-icon { color: var(--h-amber); }
.quick-card > span { color: var(--h, var(--h-blue)); }
.quick-card:hover { background: color-mix(in srgb, var(--h, var(--h-blue)) 9%, var(--card)); }
.hero-status .status-dot { background: var(--h-mint); }

/* الحالات الفارغة: الشخصية تظهر هنا فقط */
.empty-state::before {
    content: ""; display: block; width: 76px; height: 76px; margin: 0 auto 16px; border-radius: 50%;
    background: #070a18 url("../img/bot-avatar.png") center / cover; border: 1px solid var(--card-border);
    transition: transform .4s var(--press);
}
.empty-state:hover::before { transform: rotate(-8deg) scale(1.06); }

/* شرارات النجاح */
.spark { position: fixed; z-index: 9999; width: 11px; height: 11px; pointer-events: none; clip-path: var(--star-path);
    animation: spark .72s cubic-bezier(.2, .8, .3, 1) forwards; }
@keyframes spark {
    from { transform: translate(-50%, -50%) scale(.3) rotate(0); opacity: 1; }
    70% { opacity: 1; }
    to { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.15) rotate(var(--r)); opacity: 0; }
}

/* تبديل الصفحات بنعومة، والقائمة الجانبية ثابتة */
@view-transition { navigation: auto; }
.sidebar { view-transition-name: sidebar; }
.topbar { view-transition-name: topbar; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .16s; }

/* --- الصفحة العامة --- */
.lc-row { --c: var(--h-blue); --sw-on: var(--c); position: relative; }
.lc-row[data-scene="welcome"] { --c: var(--h-violet); }
.lc-row[data-scene="links"] { --c: var(--h-rose); }
.lc-row[data-scene="voice"] { --c: var(--h-blue); }
.lc-row[data-scene="tasks"] { --c: var(--h-amber); }
.lc-row.is-on { background: color-mix(in srgb, var(--c) 11%, transparent); }
.lc-row::before { content: ""; position: absolute; inset-inline-start: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--c); transform: scaleY(0); transition: transform .28s var(--press); }
.lc-row.is-on::before { transform: scaleY(1); }
.ld-msg[data-scene="welcome"] { --c: var(--h-violet); }
.ld-msg[data-scene="links"] { --c: var(--h-rose); }
.ld-msg[data-scene="voice"] { --c: var(--h-blue); }
.ld-msg[data-scene="tasks"] { --c: #ffc24d; }
.ld-embed { border-inline-start-color: var(--c, #6b9bff); }
.ld-log .ico { color: var(--c); }
.lc-link::after { background: var(--h-amber); }
.lp { background-image: var(--stars); background-size: 320px 320px; }
.lp-orbit .spark-orbit { color: var(--h-amber); }
.lp-ledger li:nth-child(1) .ico, .lp-ledger li:nth-child(2) .ico { color: var(--h-blue); }
.lp-ledger li:nth-child(3) .ico { color: var(--h-rose); }
.lp-ledger li:nth-child(4) .ico, .lp-ledger li:nth-child(5) .ico { color: var(--h-violet); }
.lp-ledger li:nth-child(6) .ico { color: var(--h-amber); }
.lp-facts { overflow: hidden; }
.lp-fact { border-top: 3px solid var(--c); }
.lp-fact:nth-child(1) { --c: var(--h-mint); }
.lp-fact:nth-child(2) { --c: var(--h-blue); }
.lp-fact:nth-child(3) { --c: var(--h-violet); }
.lp-note .ico { color: var(--h-mint); }
.lp .btn-gold { --gold: var(--h-blue); }

@media (prefers-reduced-motion: reduce) {
    .tab-title::after, .ab-switch.pop::before, .spark { animation: none !important; }
    .spark { display: none; }
    @view-transition { navigation: none; }
}
.lp-orbit { opacity: 1; }
.lp-orbit ellipse { opacity: .5; }
.lp-orbit ellipse:nth-of-type(2) { opacity: .28; }

/* تصحيح الدلالات: الأخضر للحماية (أمان)، والوردي محجوز للتحذير فقط، والسماوي للردود والذكاء */
:root { --h-sky: #45c8e8; }
html[data-theme="light"] { --h-sky: #0a7ea4; }
body[data-tab="antinuke"],
body[data-tab="automod"],
body[data-tab="advanced_security"],
body[data-tab="aimod"],
body[data-tab="moderation"],
body[data-tab="modplus"] { --h: var(--h-mint); }
.nav-row[data-slug="antinuke"],
.nav-row[data-slug="automod"],
.nav-row[data-slug="advanced_security"],
.nav-row[data-slug="aimod"],
.nav-row[data-slug="moderation"],
.nav-row[data-slug="modplus"] { --h: var(--h-mint); }
.quick-card[href$="/antinuke"],
.quick-card[href$="/automod"],
.quick-card[href$="/advanced_security"],
.quick-card[href$="/aimod"],
.quick-card[href$="/moderation"],
.quick-card[href$="/modplus"] { --h: var(--h-mint); }
body[data-tab="ai"],
body[data-tab="auto_responses"],
body[data-tab="autoreply"] { --h: var(--h-sky); }
.nav-row[data-slug="ai"],
.nav-row[data-slug="auto_responses"],
.nav-row[data-slug="autoreply"] { --h: var(--h-sky); }
.quick-card[href$="/ai"],
.quick-card[href$="/auto_responses"],
.quick-card[href$="/autoreply"] { --h: var(--h-sky); }
.lp-ledger li:nth-child(3) .ico { color: var(--h-mint); }


/* ==========================================================================
   v6 — إصلاحات + لون مستقل لكل تبويب
   كل تبويب له درجة لون خاصة به (بخطوة الزاوية الذهبية فلا يتشابه جاران)،
   بنفس السطوع والتشبّع كي تبقى عائلة واحدة. تُستبعد درجات الأحمر لأنها للتحذير.
   ========================================================================== */
.topbar-actions > .theme-toggle { position: relative; }   /* كان يُلغى موضعه فيطفو مؤشره فوق زر البحث */
.search-btn .ico, .search-btn svg { width: 17px; height: 17px; flex: none; stroke-width: 2; color: var(--text-dim); opacity: 1; }
.search-btn:hover .ico, .search-btn:hover svg { color: var(--text); }
.search-btn-icon .ico, .search-btn-icon svg { width: 20px; height: 20px; }

/* علامة التبويب الحالي: شريط داخل العنصر عند طرفه، لا نجمة معلّقة خارجه */
.nav-row .nav-item.active::before {
    content: ""; position: absolute; inset-inline-start: auto; right: 0; left: auto; top: 9px; bottom: 9px; width: 3px; height: auto; margin: 0;
    border-radius: 3px; clip-path: none; filter: none; background: var(--h, var(--h-blue)); animation: barSet .25s var(--ease) both;
}
@keyframes barSet { from { transform: scaleY(.2); opacity: 0; } }
html[dir="ltr"] .nav-row .nav-item.active::before { right: auto; left: 0; }
.nav-row .nav-item { overflow: hidden; }

@supports (color: oklch(0.5 0.1 100)) {
    :root { --hl: .80; --hc: .14; --yl: 0; }
    html[data-theme="light"] { --hl: .52; --hc: .16; --yl: .12; }
    body[data-tab], .nav-row[data-slug], .quick-card[href] { --h: oklch(calc(var(--hl) + var(--yl) * var(--y, 0) + var(--dl, 0)) var(--hc) var(--hue, 262)); }
    body[data-tab="home"], .nav-row[data-slug="home"], .quick-card[href$="/home"] { --hue: 262; --y: 0.00; --dl: 0.04; }
    body[data-tab="general"], .nav-row[data-slug="general"], .quick-card[href$="/general"] { --hue: 230; --y: 0.00; --dl: -0.05; }
    body[data-tab="stats"], .nav-row[data-slug="stats"], .quick-card[href$="/stats"] { --hue: 116; --y: 0.98; --dl: 0.04; }
    body[data-tab="embeds"], .nav-row[data-slug="embeds"], .quick-card[href$="/embeds"] { --hue: 301; --y: 0.00; --dl: -0.05; }
    body[data-tab="panel_builder"], .nav-row[data-slug="panel_builder"], .quick-card[href$="/panel_builder"] { --hue: 187; --y: 0.14; --dl: 0.04; }
    body[data-tab="adhkar"], .nav-row[data-slug="adhkar"], .quick-card[href$="/adhkar"] { --hue: 72; --y: 0.84; --dl: -0.05; }
    body[data-tab="commands"], .nav-row[data-slug="commands"], .quick-card[href$="/commands"] { --hue: 257; --y: 0.00; --dl: 0.04; }
    body[data-tab="reaction_roles"], .nav-row[data-slug="reaction_roles"], .quick-card[href$="/reaction_roles"] { --hue: 143; --y: 0.79; --dl: -0.05; }
    body[data-tab="autorole"], .nav-row[data-slug="autorole"], .quick-card[href$="/autorole"] { --hue: 328; --y: 0.00; --dl: 0.04; }
    body[data-tab="tickets"], .nav-row[data-slug="tickets"], .quick-card[href$="/tickets"] { --hue: 214; --y: 0.00; --dl: -0.05; }
    body[data-tab="applications"], .nav-row[data-slug="applications"], .quick-card[href$="/applications"] { --hue: 99; --y: 0.99; --dl: 0.04; }
    body[data-tab="leveling"], .nav-row[data-slug="leveling"], .quick-card[href$="/leveling"] { --hue: 285; --y: 0.00; --dl: -0.05; }
    body[data-tab="economy"], .nav-row[data-slug="economy"], .quick-card[href$="/economy"] { --hue: 170; --y: 0.42; --dl: 0.04; }
    body[data-tab="games"], .nav-row[data-slug="games"], .quick-card[href$="/games"] { --hue: 55; --y: 0.64; --dl: -0.05; }
    body[data-tab="changelog"], .nav-row[data-slug="changelog"], .quick-card[href$="/changelog"] { --hue: 241; --y: 0.00; --dl: 0.04; }
    body[data-tab="support"], .nav-row[data-slug="support"], .quick-card[href$="/support"] { --hue: 126; --y: 0.93; --dl: -0.05; }
    body[data-tab="welcome"], .nav-row[data-slug="welcome"], .quick-card[href$="/welcome"] { --hue: 312; --y: 0.00; --dl: 0.04; }
    body[data-tab="modlog"], .nav-row[data-slug="modlog"], .quick-card[href$="/modlog"] { --hue: 197; --y: 0.00; --dl: -0.05; }
    body[data-tab="auto_responses"], .nav-row[data-slug="auto_responses"], .quick-card[href$="/auto_responses"] { --hue: 82; --y: 0.92; --dl: 0.04; }
    body[data-tab="moderation"], .nav-row[data-slug="moderation"], .quick-card[href$="/moderation"] { --hue: 268; --y: 0.00; --dl: -0.05; }
    body[data-tab="antinuke"], .nav-row[data-slug="antinuke"], .quick-card[href$="/antinuke"] { --hue: 153; --y: 0.67; --dl: 0.04; }
    body[data-tab="automod"], .nav-row[data-slug="automod"], .quick-card[href$="/automod"] { --hue: 339; --y: 0.00; --dl: -0.05; }
    body[data-tab="aimod"], .nav-row[data-slug="aimod"], .quick-card[href$="/aimod"] { --hue: 224; --y: 0.00; --dl: 0.04; }
    body[data-tab="ai"], .nav-row[data-slug="ai"], .quick-card[href$="/ai"] { --hue: 109; --y: 1.00; --dl: -0.05; }
    body[data-tab="notify"], .nav-row[data-slug="notify"], .quick-card[href$="/notify"] { --hue: 295; --y: 0.00; --dl: 0.04; }
    body[data-tab="tempvoice"], .nav-row[data-slug="tempvoice"], .quick-card[href$="/tempvoice"] { --hue: 180; --y: 0.26; --dl: -0.05; }
    body[data-tab="modplus"], .nav-row[data-slug="modplus"], .quick-card[href$="/modplus"] { --hue: 66; --y: 0.78; --dl: 0.04; }
    body[data-tab="advanced_security"], .nav-row[data-slug="advanced_security"], .quick-card[href$="/advanced_security"] { --hue: 251; --y: 0.00; --dl: -0.05; }
    body[data-tab="extras"], .nav-row[data-slug="extras"], .quick-card[href$="/extras"] { --hue: 136; --y: 0.86; --dl: 0.04; }
    body[data-tab="verification"], .nav-row[data-slug="verification"], .quick-card[href$="/verification"] { --hue: 322; --y: 0.00; --dl: -0.05; }
    body[data-tab="autoreply"], .nav-row[data-slug="autoreply"], .quick-card[href$="/autoreply"] { --hue: 207; --y: 0.00; --dl: 0.04; }
    body[data-tab="scheduled"], .nav-row[data-slug="scheduled"], .quick-card[href$="/scheduled"] { --hue: 93; --y: 0.98; --dl: -0.05; }
    body[data-tab="backup"], .nav-row[data-slug="backup"], .quick-card[href$="/backup"] { --hue: 278; --y: 0.00; --dl: 0.04; }
    html[data-theme="light"] body[data-tab="stats"],
    html[data-theme="light"] body[data-tab="adhkar"],
    html[data-theme="light"] body[data-tab="reaction_roles"],
    html[data-theme="light"] body[data-tab="applications"],
    html[data-theme="light"] body[data-tab="games"],
    html[data-theme="light"] body[data-tab="support"],
    html[data-theme="light"] body[data-tab="auto_responses"],
    html[data-theme="light"] body[data-tab="antinuke"],
    html[data-theme="light"] body[data-tab="ai"],
    html[data-theme="light"] body[data-tab="modplus"],
    html[data-theme="light"] body[data-tab="extras"],
    html[data-theme="light"] body[data-tab="scheduled"] { --accent-ink: #1a1300; }
}

/* ==========================================================================
   v7 — علامة Premium + محاكاة ديسكورد
   ========================================================================== */
:root { --premium: #e8b84b; --gem: polygon(25% 0, 75% 0, 100% 36%, 50% 100%, 0 36%); }
html[data-theme="light"] { --premium: #9a6a00; }

/* علامة Premium: جوهرة صغيرة + كلمة، بحافة ذهبية هادئة. اللمعة عند المرور فقط */
.pl-badge {
    position: relative; display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 9px 0 7px; margin-inline-start: 8px;
    vertical-align: middle; border-radius: 999px; overflow: hidden; white-space: nowrap; flex: none;
    font: 700 .64rem/1 var(--font, inherit); text-transform: uppercase;
    color: var(--premium); background: color-mix(in srgb, var(--premium) 13%, transparent);
    border: 1px solid color-mix(in srgb, var(--premium) 46%, transparent);
}
.pl-badge::before { content: ""; width: 9px; height: 8px; background: currentColor; clip-path: var(--gem); flex: none; }
.pl-badge::after { content: ""; position: absolute; inset: 0; width: 40%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .45), transparent); transform: translateX(-160%) skewX(-18deg); }
.pl-badge:hover::after, li:hover > .pl-feat .pl-badge::after, .card:hover .pl-badge::after { transform: translateX(380%) skewX(-18deg); transition: transform .7s var(--ease); }
html[lang="ar"] body .pl-badge { letter-spacing: .09em !important; }
.nav-row[data-slug="premium"] .nav-item { color: var(--premium); font-weight: 600; }
.nav-row[data-slug="premium"] .nav-item span svg { display: none; }
.nav-row[data-slug="premium"] .nav-item span::before { content: ""; width: 14px; height: 13px; background: var(--premium); clip-path: var(--gem); }

/* الصفحة العامة: سطر Premium داخل الوحدة */
.lp-ledger .pl-feat { display: flex; align-items: center; gap: 4px; margin-top: 2px; font-size: .86rem; color: var(--text); }
.lp-ledger .pl-feat .pl-badge { margin-inline-start: 0; margin-inline-end: 6px; }
.lp-ledger li { grid-template-columns: 28px 1fr; }
.lp-ledger li > .pl-feat, .lp-ledger li > p { grid-column: 2; }

/* لوحة التحكم المصغّرة: شبكة من عمودين */
.lp-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 560px); }
.lc-rows { display: grid; grid-template-columns: 1fr 1fr; }
.lc-row { padding: 11px 16px; }
.lc-row + .lc-row { border-top: 0; }
.lc-row:nth-child(n+3) { border-top: 1px solid var(--line); }
.lc-row:nth-child(even) { border-inline-start: 1px solid var(--line); }
.lc-row b { font-size: .92rem; }

/* نافذة ديسكورد */
.dc { --d-bg: #313338; --d-rail: #2b2d31; --d-deep: #1e1f22; --d-text: #dbdee1; --d-mute: #949ba4; --d-blurple: #5865f2;
    display: grid; grid-template-columns: 152px minmax(0, 1fr); height: 430px; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--card-border);
    background: var(--d-bg); color: var(--d-text); font-size: .9rem; }
.dc-rail { background: var(--d-rail); display: flex; flex-direction: column; min-width: 0; }
.dc-server { padding: 13px 14px; font-weight: 700; font-size: .92rem; color: #fff; box-shadow: 0 1px 0 rgba(0, 0, 0, .3); }
.dc-channels { padding: 8px 6px; overflow-y: auto; flex: 1; scrollbar-width: none; }
.dc-cat { display: flex; align-items: center; gap: 4px; padding: 12px 6px 4px; font-size: .7rem; font-weight: 700; color: var(--d-mute); }
.dc-ch { position: relative; display: flex; align-items: center; gap: 6px; width: 100%; padding: 5px 8px; border: 0; border-radius: 5px; background: none; color: var(--d-mute); font: inherit; font-size: .9rem; text-align: start; cursor: pointer; transition: background .12s, color .12s; }
.dc-ch:hover { background: rgba(78, 80, 88, .45); color: #dbdee1; }
.dc-ch.active { background: rgba(78, 80, 88, .6); color: #fff; }
.dc-ch .h { font-size: 1.05rem; font-weight: 500; opacity: .75; width: 14px; text-align: center; flex: none; }
.dc-ch .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.dc-ch.unread { color: #fff; font-weight: 600; }
.dc-ch .dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; flex: none; transform: scale(0); transition: transform .2s var(--press); }
.dc-ch.unread .dot { transform: scale(1); }
.dc-ch.fresh { animation: chIn .45s var(--ease) both; }
@keyframes chIn { from { opacity: 0; transform: translateX(10px); max-height: 0; } to { opacity: 1; transform: none; max-height: 40px; } }
.dc-ch.gone { animation: chOut .25s ease-in forwards; }
@keyframes chOut { to { opacity: 0; max-height: 0; padding-block: 0; } }
.dc-ch svg { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: .75; }
.dc-ch.voice-room { padding-inline-start: 22px; font-size: .84rem; }
.dc-ch .live { width: 18px; height: 18px; border-radius: 50%; background: #4fd8ac; color: #06241a; display: grid; place-items: center; font-size: .6rem; font-weight: 700; flex: none; box-shadow: 0 0 0 0 rgba(79, 216, 172, .6); animation: speak 1.6s ease-out infinite; }
@keyframes speak { 60% { box-shadow: 0 0 0 6px rgba(79, 216, 172, 0); } }

.dc-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.dc-head { display: flex; align-items: center; gap: 8px; padding: 13px 16px; box-shadow: 0 1px 0 rgba(0, 0, 0, .3); font-size: .92rem; }
.dc-hash { color: var(--d-mute); font-size: 1.15rem; }
.dc-head b { color: #fff; font-weight: 700; }
.dc-feeds { position: relative; flex: 1; min-height: 0; }
.dc-feed { position: absolute; inset: 0; overflow-y: auto; padding: 10px 0 6px; display: none; scrollbar-width: thin; scrollbar-color: #1a1b1e transparent; }
.dc-feed.active { display: block; }
.dc-intro { padding: 10px 16px 14px; }
.dc-intro i { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: #41434a; color: #fff; font-style: normal; font-size: 1.6rem; margin-bottom: 8px; }
.dc-intro b { display: block; color: #fff; font-size: 1.15rem; margin-bottom: 2px; }
.dc-intro span { color: var(--d-mute); font-size: .84rem; }

.dc-msg { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; padding: 4px 16px; animation: msgIn .3s var(--ease) both; transition: background .12s; }
.dc-msg:hover { background: rgba(2, 2, 2, .06); }
.dc-msg.out { animation: msgOut .22s ease-in forwards; }
@keyframes msgIn { from { opacity: 0; transform: translateY(8px); } }
@keyframes msgOut { to { opacity: 0; transform: translateX(-12px); max-height: 0; padding-block: 0; } }
.dc-msg.pinged { background: rgba(250, 166, 26, .08); box-shadow: inset 3px 0 0 #f0b232; }
.dc-av { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 1rem; flex: none; }
.dc-av.bot { background: #05050f url("../img/bot-avatar.png") center / cover; font-size: 0; }
.dc-who { display: flex; align-items: center; gap: 6px; line-height: 1.3; }
.dc-who b { font-weight: 600; font-size: .95rem; }
.dc-tag { font-size: .6rem; font-weight: 700; padding: 1px 5px; border-radius: 4px; background: var(--d-blurple); color: #fff; line-height: 1.5; }
.dc-time { font-size: .72rem; color: var(--d-mute); }
.dc-body { line-height: 1.55; word-break: break-word; }
.dc-mention { background: rgba(88, 101, 242, .3); color: #c9cdfb; padding: 0 3px; border-radius: 3px; font-weight: 500; }
.dc-link { color: #00a8fc; }
.dc-sys { display: flex; align-items: center; gap: 12px; padding: 4px 16px; animation: msgIn .3s var(--ease) both; color: var(--d-mute); font-size: .88rem; }
.dc-sys svg { width: 40px; height: 16px; flex: none; fill: none; stroke: #23a559; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.dc-sys b { color: #fff; font-weight: 600; }

.dc-embed { margin-top: 6px; max-width: 420px; display: grid; gap: 6px; padding: 10px 14px 12px; background: var(--d-rail); border-radius: 4px; border-inline-start: 4px solid var(--c, #5865f2); }
.dc-embed h4 { margin: 0; font-size: .95rem; color: #fff; font-weight: 700; }
.dc-embed p { margin: 0; color: #dbdee1; font-size: .88rem; line-height: 1.5; }
.dc-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
.dc-fields div b { display: block; font-size: .74rem; color: #fff; }
.dc-fields div span { font-size: .84rem; }
.dc-foot { font-size: .72rem; color: var(--d-mute); }
.dc-bar { height: 8px; border-radius: 6px; background: #1e1f22; overflow: hidden; }
.dc-bar i { display: block; height: 100%; width: var(--w, 70%); background: var(--c, #5865f2); border-radius: 6px; transform-origin: right; animation: grow .9s .2s var(--ease) both; }
@keyframes grow { from { transform: scaleX(0); } }
.dc-btns { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.dc-btn { border: 0; border-radius: 4px; padding: 6px 14px; font: inherit; font-size: .84rem; font-weight: 500; color: #fff; background: #4e5058; cursor: default; transition: filter .15s, transform .15s var(--press), opacity .2s; }
.dc-btn.blurple { background: #5865f2; } .dc-btn.green { background: #248046; } .dc-btn.red { background: #da373c; }
.dc-btn.pressed { transform: scale(.94); filter: brightness(1.25); }
.dc-btn.done { opacity: .5; }
.dc-react { display: inline-flex; align-items: center; gap: 5px; margin: 6px 6px 0 0; padding: 2px 8px; border-radius: 8px; background: rgba(88, 101, 242, .25); border: 1px solid #5865f2; font-size: .8rem; }
.dc-msg.deleted .dc-body { opacity: .5; text-decoration: line-through; transition: opacity .3s; }

.dc-typing { height: 22px; padding: 0 16px; display: flex; align-items: center; gap: 8px; font-size: .76rem; color: #dbdee1; opacity: 0; transition: opacity .15s; }
.dc-typing.on { opacity: 1; }
.dc-typing .dots { display: inline-flex; gap: 3px; }
.dc-typing .dots i { width: 5px; height: 5px; border-radius: 50%; background: #dbdee1; animation: typ 1s ease-in-out infinite; }
.dc-typing .dots i:nth-child(2) { animation-delay: .15s; } .dc-typing .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes typ { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }
.dc-compose { display: flex; align-items: center; gap: 10px; margin: 0 14px 14px; padding: 0 12px; height: 42px; border-radius: 8px; background: #383a40; }
.dc-plus { width: 22px; height: 22px; border-radius: 50%; background: #b5bac1; color: #383a40; display: grid; place-items: center; font-weight: 700; font-size: 1rem; flex: none; }
.dc-input { flex: 1; min-width: 0; border: 0; background: none; color: #dbdee1; font: inherit; font-size: .9rem; outline: none; height: 100%; }
.dc-input::placeholder { color: #6d6f78; }
.dc-hint { font-size: .7rem; color: #6d6f78; white-space: nowrap; }

@media (max-width: 920px) {
    .lp-hero { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .dc { grid-template-columns: 1fr; grid-template-rows: auto 1fr; height: 480px; }
    .dc-rail { flex-direction: row; overflow-x: auto; }
    .dc-server { display: none; }
    .dc-channels { display: flex; gap: 4px; overflow-x: auto; padding: 6px; flex: none; }
    .dc-cat { display: none; }
    .dc-ch { width: auto; flex: none; }
    .dc-ch.voice-room { padding-inline-start: 8px; }
    .lc-rows { grid-template-columns: 1fr; }
    .lc-row:nth-child(n+2) { border-top: 1px solid var(--line); }
    .lc-row:nth-child(even) { border-inline-start: 0; }
    .dc-hint { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .dc-msg, .dc-ch.fresh, .dc-bar i, .dc-typing .dots i, .dc-ch .live, .pl-badge::after { animation: none !important; transition: none !important; }
}

/* ---- إصلاحات المحاكاة ---- */
.dc-compose .dc-input[type="text"] { border: 0 !important; background: none !important; box-shadow: none !important; padding: 0 !important; height: 100% !important; min-height: 0 !important; border-radius: 0 !important; }
.dc-compose:focus-within { box-shadow: 0 0 0 1px rgba(88, 101, 242, .7); }
.dc-body, .dc-hint { unicode-bidi: plaintext; }
.dc { height: 468px; }
.dc-ch { padding: 4px 8px; }
.dc-cat { padding-top: 10px; }
html:has(body.lp), body.lp { overflow-x: clip; }
.lp-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 560px); }
@media (max-width: 920px) { .lp-hero { grid-template-columns: minmax(0, 1fr); } .lp-console, .dc, .dc-main, .lc-panel { min-width: 0; } }
@media (max-width: 560px) { .dc { grid-template-columns: minmax(0, 1fr); height: 500px; } .lp-wrap { width: calc(100% - 32px); } }
.lp-ledger li { align-content: start; }

/* علامة Premium: حالة الاشتراك الفعّال (مملوءة) */
.pl-badge.on { background: var(--premium); color: #1a1300; border-color: var(--premium); }
.pl-badge.on::before { background: #1a1300; }
.search-btn .ico { display: block; }
