/* ==========================================================================
   Uniqx — نظام التصميم
   الخط: Readex Pro للنصوص، JetBrains Mono للكود
   المسافات: 4 · 8 · 12 · 16 · 20 · 24 · 32 | الزوايا: 6 · 10 · 14
   ========================================================================== */

:root {
  --bg: #000000;
  --card: #0B0C0E;
  --soft: #16181C;
  --hover: #1D2025;
  --line: #2F3336;
  --line2: #1E2124;
  --line-hover: #44494F;
  --wash: rgba(255, 255, 255, .03);
  --text: #F5F7FA;
  --muted: #94A3B8;
  --dim: #6E7A87;
  --acc: #00FFC3;
  --acc-2: #5CFFD8;
  --acc-ink: #00140F;
  --acc-dim: rgba(0, 255, 195, .1);
  --acc-line: rgba(0, 255, 195, .34);
  --acc-glow: var(--acc-glow);
  --red: #FF5C7A;
  --red-dim: rgba(255, 92, 122, .1);
  --red-line: rgba(255, 92, 122, .38);
  --amber: #FFB547;
  --amber-dim: rgba(255, 181, 71, .1);
  --amber-line: rgba(255, 181, 71, .36);
  --blue: #5AA9FF;
  --blue-dim: rgba(90, 169, 255, .1);
  --blue-line: rgba(90, 169, 255, .38);
  --purple: var(--purple);
  --purple-dim: rgba(199, 155, 255, .1);
  --purple-line: rgba(199, 155, 255, .38);
  --green: var(--green);
  --green-dim: rgba(43, 213, 118, .13);
  --pink: #FF7AB8;
  --orange: #FF8A3D;
  --gold: #F5C04A;
  --verified: #00FFC3;
  --code-bg: #08090B;
  --overlay: rgba(91, 112, 131, .3);
  --glass: rgba(0, 0, 0, .74);
  --shadow: 0 12px 40px rgba(0, 0, 0, .75);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .6);
  --tk-k: #FF7AB8; --tk-s: #A5E86B; --tk-n: #FFB86B; --tk-c: #5F7489; --tk-f: #6CB6FF; --tk-b: #00FFC3; --tk-o: #94A3B8;

  --r1: 6px;
  --r2: 10px;
  --r3: 14px;
  --pill: 999px;
  --font: "Readex Pro", "Segoe UI", Tahoma, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  --nav: 252px;
  --main: 620px;
  --rail: 330px;
  --bar: 56px;
  --tab: 62px;
  --pad: 16px;
  --gap: 14px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}

/* الثيم الفاتح: يدويًا، أو «حسب الجهاز» عندما يكون نظام التشغيل فاتحًا */
[data-theme="light"] {
  --bg: #FFFFFF;
  --card: #FFFFFF;
  --soft: #F3F5F7;
  --hover: #EBEEF1;
  --line: #DCE1E6;
  --line2: #ECEFF2;
  --line-hover: #BCC4CC;
  --wash: rgba(15, 20, 25, .03);
  --text: #0F1419;
  --muted: #536471;
  --dim: #66737F;
  --acc: #007F64;
  --acc-2: #006B54;
  --acc-ink: #FFFFFF;
  --acc-dim: rgba(0, 127, 100, .08);
  --acc-line: rgba(0, 127, 100, .36);
  --acc-glow: rgba(0, 127, 100, .25);
  --red: #D21F45;
  --red-dim: rgba(210, 31, 69, .07);
  --red-line: rgba(210, 31, 69, .34);
  --amber: #A35F00;
  --amber-dim: rgba(163, 95, 0, .08);
  --amber-line: rgba(163, 95, 0, .32);
  --blue: #1D6FD6;
  --blue-dim: rgba(29, 111, 214, .08);
  --blue-line: rgba(29, 111, 214, .32);
  --purple: #7546D8;
  --purple-dim: rgba(117, 70, 216, .08);
  --purple-line: rgba(117, 70, 216, .32);
  --green: #13854A;
  --green-dim: rgba(19, 133, 74, .1);
  --pink: #C2185B;
  --orange: #C2410C;
  --gold: #A16207;
  --verified: #007F64;
  --code-bg: #F6F8FA;
  --overlay: rgba(15, 20, 25, .4);
  --glass: rgba(255, 255, 255, .84);
  --shadow: 0 10px 32px rgba(15, 20, 25, .12), 0 1px 3px rgba(15, 20, 25, .08);
  --shadow-sm: 0 1px 2px rgba(15, 20, 25, .12);
  --tk-k: #C2185B; --tk-s: #2E7D32; --tk-n: #B35900; --tk-c: #6A7886; --tk-f: #1565C0; --tk-b: #00796B; --tk-o: #536471;
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  [data-theme="system"] {
    --bg: #FFFFFF;
    --card: #FFFFFF;
    --soft: #F3F5F7;
    --hover: #EBEEF1;
    --line: #DCE1E6;
    --line2: #ECEFF2;
    --line-hover: #BCC4CC;
    --wash: rgba(15, 20, 25, .03);
    --text: #0F1419;
    --muted: #536471;
    --dim: #66737F;
    --acc: #007F64;
    --acc-2: #006B54;
    --acc-ink: #FFFFFF;
    --acc-dim: rgba(0, 127, 100, .08);
    --acc-line: rgba(0, 127, 100, .36);
    --acc-glow: rgba(0, 127, 100, .25);
    --red: #D21F45;
    --red-dim: rgba(210, 31, 69, .07);
    --red-line: rgba(210, 31, 69, .34);
    --amber: #A35F00;
    --amber-dim: rgba(163, 95, 0, .08);
    --amber-line: rgba(163, 95, 0, .32);
    --blue: #1D6FD6;
    --blue-dim: rgba(29, 111, 214, .08);
    --blue-line: rgba(29, 111, 214, .32);
    --purple: #7546D8;
    --purple-dim: rgba(117, 70, 216, .08);
    --purple-line: rgba(117, 70, 216, .32);
    --green: #13854A;
    --green-dim: rgba(19, 133, 74, .1);
  --pink: #C2185B;
  --orange: #C2410C;
  --gold: #A16207;
    --verified: #007F64;
    --code-bg: #F6F8FA;
    --overlay: rgba(15, 20, 25, .4);
    --glass: rgba(255, 255, 255, .84);
    --shadow: 0 10px 32px rgba(15, 20, 25, .12), 0 1px 3px rgba(15, 20, 25, .08);
    --shadow-sm: 0 1px 2px rgba(15, 20, 25, .12);
    --tk-k: #C2185B; --tk-s: #2E7D32; --tk-n: #B35900; --tk-c: #6A7886; --tk-f: #1565C0; --tk-b: #00796B; --tk-o: #536471;
    color-scheme: light;
  }
}
[data-density="compact"] { --gap: 9px; }

/* ——— الأساس ——— */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  background: var(--bg); color: var(--text);
  font: 400 15px/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--acc); }
img, video { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--acc); color: var(--acc-ink); }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; border-radius: var(--r1); }
[hidden] { display: none !important; }
code, pre, kbd, .mono { font-family: var(--mono); }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; font-weight: 600; }
h1 { font-size: 24px; letter-spacing: -.01em; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
p { margin: 0 0 12px; }
hr { border: 0; height: 1px; background: var(--line2); margin: 16px 0; }

.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.i.xs { width: 14px; height: 14px; }
.i.sm { width: 16px; height: 16px; }
.i.lg { width: 24px; height: 24px; }
.i.xl { width: 36px; height: 36px; stroke-width: 1.5; }
.vb { width: 17px; height: 17px; flex: none; color: var(--verified); vertical-align: -3px; }
.vb.lg { width: 22px; height: 22px; vertical-align: -4px; }

.muted { color: var(--muted); }
.dim { color: var(--dim); }
.acc { color: var(--acc); }
.red { color: var(--red); }
.small { font-size: 13.5px; }
.tiny { font-size: 12px; }
.bold { font-weight: 600; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.row.wrap { flex-wrap: wrap; }
.row.top { align-items: flex-start; }
.col { display: flex; flex-direction: column; gap: 8px; }
.grow { flex: 1; min-width: 0; }
.between { justify-content: space-between; }
.center { text-align: center; }
.mt { margin-top: 16px; }
.mt-s { margin-top: 8px; }
.mt-xs { margin-top: 4px; }
.mb { margin-bottom: 16px; }
.mb-s { margin-bottom: 8px; }
.clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.pad { padding: var(--pad); }
.stack > * + * { margin-top: 16px; }

/* ==========================================================================
   هيكل الصفحة
   ========================================================================== */
.shell {
  display: grid;
  grid-template-columns: var(--nav) minmax(0, var(--main)) var(--rail);
  justify-content: center;
  gap: 0 28px;
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 20px;
}
.shell.wide { grid-template-columns: var(--nav) minmax(0, 1fr); max-width: 1320px; }
.shell.full { grid-template-columns: var(--nav) minmax(0, 1fr); max-width: none; padding: 0; gap: 0; }
.shell.admin { grid-template-columns: var(--nav) minmax(0, 1fr); max-width: 1400px; }

/* العمود الأوسط بحدود جانبية مثل تويتر */
main {
  min-width: 0; min-height: 100vh;
  border-inline: 1px solid var(--line2);
  padding-bottom: 96px;
}
.shell.full main { border: 0; padding: 0; }
.lay-bare main { border: 0; padding: 0; }
.rail { padding: 12px 0 40px; }
.rail-in { position: sticky; top: 12px; display: flex; flex-direction: column; gap: 16px; }

/* ——— التنقل الجانبي (الكمبيوتر) ——— */
.nav {
  position: sticky; top: 0; height: 100vh; height: 100dvh;
  display: flex; flex-direction: column; gap: 2px;
  padding: 14px 0 16px;
  overflow-y: auto; scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.shell.full .nav { padding: 14px 12px 16px; border-inline-end: 1px solid var(--line2); }
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 12px 16px; font-weight: 600; font-size: 21px; letter-spacing: -.02em; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.brand:hover { color: var(--text); }
.nav-a {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 14px; border-radius: var(--pill);
  font-size: 16.5px; color: var(--muted);
  transition: background .15s, color .15s;
  position: relative; width: fit-content; max-width: 100%;
}
.nav-a:hover { background: var(--soft); color: var(--text); }
.nav-a.on { color: var(--text); font-weight: 600; }
.nav-a.on .i { color: var(--acc); stroke-width: 2.1; }
.nav-sep { height: 1px; background: var(--line2); margin: 8px 14px; }
.post-btn { margin-top: 14px; height: 50px; font-size: 16px; width: 100%; }
.nav-me-wrap { margin-top: auto; padding-top: 12px; }
.nav-me { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px; border-radius: var(--pill); border: 0; background: none; cursor: pointer; }
.nav-me:hover { background: var(--soft); }
.nav-me .who { text-align: start; min-width: 0; line-height: 1.35; }
.nav-me .who b { display: flex; align-items: center; gap: 4px; font-weight: 600; }
.nav-dev { margin: 10px 14px 0; }
.badge {
  min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px;
  background: var(--acc); color: var(--acc-ink);
  font: 700 11px/19px var(--font); text-align: center; font-variant-numeric: tabular-nums;
}
.badge.red { background: var(--red); color: #fff; }
.dev-tag {
  display: inline-flex; align-items: center; gap: 6px; width: fit-content;
  font-size: 12px; color: var(--amber);
  border: 1px solid var(--amber-line); background: var(--amber-dim);
  padding: 2px 9px; border-radius: var(--pill);
}

/* ——— رأس الصفحة (يتحول إلى شريط تطبيق في الجوال) ——— */
.head {
  position: sticky; top: 0; z-index: 30;
  background: var(--glass);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  backdrop-filter: saturate(160%) blur(16px);
  border-bottom: 1px solid var(--line2);
}
.head-in { display: flex; align-items: center; gap: 10px; min-height: var(--bar); padding: 0 var(--pad); }
.head-t { flex: 1; min-width: 0; line-height: 1.25; }
.head-t h1 { font-size: 19px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 4px; }
.head-t .sub { font-size: 12.5px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.head-acts { display: flex; align-items: center; gap: 6px; }
.head .tabs { border-bottom: 0; }
.head .search-box { flex: 1; }
.icon-btn.me-btn { display: none; }

.icon-btn {
  width: 38px; height: 38px; display: inline-grid; place-items: center; flex: none;
  border: 0; background: none; border-radius: 50%; color: var(--muted); cursor: pointer; position: relative;
  transition: background .15s, color .15s, transform .1s;
}
.icon-btn:hover { background: var(--soft); color: var(--text); }
.icon-btn:active { transform: scale(.92); }
.icon-btn.sm { width: 32px; height: 32px; }
.icon-btn .badge { position: absolute; top: 1px; inset-inline-end: -2px; min-width: 17px; height: 17px; line-height: 17px; font-size: 10px; }

/* ——— التبويبات ——— */
.tabs { display: flex; border-bottom: 1px solid var(--line2); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 1 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 14px 16px 13px; color: var(--muted); font-weight: 500; position: relative; white-space: nowrap;
  transition: background .15s, color .15s;
}
.tab:hover { color: var(--text); background: var(--soft); }
.tab.on { color: var(--text); font-weight: 600; }
.tab.on::after { content: ""; position: absolute; left: 50%; transform: translateX(-50%); width: 56px; max-width: 70%; bottom: -1px; height: 3px; background: var(--acc); border-radius: 3px 3px 0 0; }
.tab .n { color: var(--dim); font-size: 12px; font-weight: 600; background: var(--soft); border-radius: var(--pill); padding: 0 7px; line-height: 19px; }
.tab .i { width: 17px; height: 17px; }
.tabs.left { padding-inline: 8px; }
.tabs.left .tab { flex: 0 0 auto; padding-inline: 12px; }
.tabs.left .tab.on::after { width: auto; left: 10px; right: 10px; transform: none; max-width: none; }

/* ==========================================================================
   العناصر
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: var(--pill);
  background: transparent; color: var(--text);
  font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; user-select: none;
  transition: background .15s, border-color .15s, color .15s, transform .08s, opacity .15s;
}
.btn:hover { background: var(--soft); color: var(--text); border-color: var(--line-hover); }
.btn:active { transform: scale(.97); }
.btn:disabled, .btn.busy { opacity: .55; pointer-events: none; }
.btn.pri { background: var(--acc); border-color: var(--acc); color: var(--acc-ink); }
.btn.pri:hover { background: var(--acc-2); border-color: var(--acc-2); color: var(--acc-ink); }
.btn.solid { background: var(--text); border-color: var(--text); color: var(--bg); }
.btn.solid:hover { opacity: .88; color: var(--bg); background: var(--text); }
.btn.soft { background: var(--soft); border-color: transparent; }
.btn.soft:hover { background: var(--hover); }
.btn.ghost { border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--soft); color: var(--text); }
.btn.danger { color: var(--red); border-color: var(--red-line); }
.btn.danger:hover { background: var(--red-dim); color: var(--red); border-color: var(--red); }
.btn.danger.fill { background: var(--red); border-color: var(--red); color: #fff; }
.btn.on { border-color: var(--line); color: var(--text); background: transparent; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.xs { height: 28px; padding: 0 10px; font-size: 12.5px; gap: 6px; }
.btn.lg { height: 48px; padding: 0 24px; font-size: 16px; }
.btn.block { width: 100%; }
.btn .i { width: 18px; height: 18px; }
.btn.discord { background: #5865F2; border-color: #5865F2; color: #fff; }
.btn.discord:hover { background: #4752C4; border-color: #4752C4; color: #fff; }
.btn.busy::after { content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
/* زر المتابعة: «تتابعه» يتحول إلى «إلغاء المتابعة» عند المرور */
.btn.on[data-follow]:hover { border-color: var(--red-line); color: var(--red); background: var(--red-dim); }

.card { background: var(--card); border: 1px solid var(--line2); border-radius: var(--r3); }
.box { background: var(--card); border: 1px solid var(--line2); border-radius: var(--r3); padding: 16px; }
.box > h3 { font-size: 17px; font-weight: 700; margin-bottom: 10px; }
.box.flush { padding: 0; overflow: hidden; }
.box.flush > h3 { padding: 14px 16px 4px; margin: 0; }
.sec { padding: var(--pad); border-bottom: 1px solid var(--line2); }
.sec-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px var(--pad) 8px; }
.sec-title h2 { font-size: 18px; }
.sec-title a { font-size: 13.5px; color: var(--acc); font-weight: 500; }

.av { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; background: var(--soft); flex: none; }
.av.xs { width: 22px; height: 22px; }
.av.sm { width: 32px; height: 32px; }
.av.md { width: 48px; height: 48px; }
.av.lg { width: 64px; height: 64px; }
.av.xl { width: 128px; height: 128px; border: 4px solid var(--bg); }
.av-wrap { position: relative; flex: none; display: inline-block; }
.online-dot { position: absolute; bottom: 1px; inset-inline-end: 1px; width: 11px; height: 11px; border-radius: 50%; background: var(--dim); border: 2px solid var(--bg); }
.online-dot.on { background: var(--green); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 10px; border-radius: var(--pill);
  background: var(--soft); border: 1px solid var(--line2);
  font-size: 12.5px; color: var(--muted); white-space: nowrap; font-weight: 500;
}
a.chip:hover { color: var(--acc); border-color: var(--acc-line); }
.chip.acc { color: var(--acc); border-color: var(--acc-line); background: var(--acc-dim); }
.chip.red { color: var(--red); border-color: var(--red-line); background: var(--red-dim); }
.chip.amber { color: var(--amber); border-color: var(--amber-line); background: var(--amber-dim); }
.chip.blue { color: var(--blue); border-color: var(--blue-line); background: var(--blue-dim); }
.chip .i { width: 14px; height: 14px; }
.chip.sm { height: 22px; font-size: 11.5px; padding: 0 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* ——— النماذج ——— */
.form { padding: 20px var(--pad) 32px; max-width: 760px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.field > label, .label { font-size: 14px; font-weight: 600; }
.hint { font-size: 12.5px; color: var(--dim); }
.opt { color: var(--dim); font-weight: 400; }
.input, select.input, textarea.input {
  width: 100%; min-height: 44px; padding: 10px 14px;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--r2);
  transition: border-color .15s, box-shadow .15s;
}
select.input {
  cursor: pointer; appearance: none; -webkit-appearance: none; padding-left: 38px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: 18px 50%, 23px 50%; background-size: 5px 5px; background-repeat: no-repeat;
}
select.input option { background: var(--card); color: var(--text); }
textarea.input { resize: vertical; min-height: 96px; line-height: 1.6; }
.input:hover { border-color: var(--line-hover); }
.input:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-dim); }
.input.code { font-family: var(--mono); font-size: 13px; direction: ltr; text-align: left; tab-size: 4; }
.input[aria-invalid="true"] { border-color: var(--red); }
.input-pre { display: flex; align-items: stretch; }
.input-pre > span { display: grid; place-items: center; padding: 0 12px; background: var(--soft); border: 1px solid var(--line); border-inline-end: 0; border-start-start-radius: var(--r2); border-end-start-radius: var(--r2); color: var(--muted); font-family: var(--mono); font-size: 13px; white-space: nowrap; }
.input-pre > .input { border-start-start-radius: 0; border-end-start-radius: 0; min-width: 0; }
fieldset.plain { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
fieldset.plain > legend { padding: 0; }
.field-note { font-size: 12.5px; min-height: 18px; }
.field-note.ok { color: var(--acc); }
.field-note.err { color: var(--red); }
.counter { font-size: 12px; color: var(--dim); font-variant-numeric: tabular-nums; }
.counter.over { color: var(--red); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 14px; }
.form-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 8px; }
input[type="file"] { font-size: 13px; color: var(--muted); max-width: 100%; }
input[type="file"]::file-selector-button { font: 600 13px var(--font); color: var(--text); background: var(--soft); border: 1px solid var(--line); border-radius: var(--pill); padding: 7px 14px; margin-inline-end: 10px; cursor: pointer; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--acc); width: 16px; height: 16px; flex: none; }

.pick { display: flex; flex-wrap: wrap; gap: 8px; }
.pick input { position: absolute; opacity: 0; pointer-events: none; }
.pick label {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: var(--pill); cursor: pointer; font-size: 13.5px; color: var(--muted); font-weight: 500;
  transition: all .15s; user-select: none;
}
.pick label:hover { border-color: var(--line-hover); color: var(--text); }
.pick input:checked + label { border-color: var(--acc); color: var(--acc); background: var(--acc-dim); }
.pick input:focus-visible + label { outline: 2px solid var(--acc); outline-offset: 2px; }

.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line2); cursor: pointer; }
.switch:last-of-type { border-bottom: 0; }
.switch input { appearance: none; width: 44px; height: 26px; border-radius: 13px; background: var(--line); position: relative; cursor: pointer; flex: none; transition: background .2s; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: inset-inline-start .2s var(--ease); box-shadow: var(--shadow-sm); }
.switch input:checked { background: var(--acc); }
.switch input:checked::after { inset-inline-start: 21px; }
.switch .t { font-weight: 600; }
.switch .d { font-size: 13px; color: var(--dim); }
.radio-row { display: flex; gap: 14px; flex-wrap: wrap; }
.radio-row label { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); cursor: pointer; font-size: 13.5px; }

/* ——— التنبيهات ——— */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r2); border: 1px solid var(--line); background: var(--soft); font-size: 14px; }
.alert .i { margin-top: 2px; }
.alert.ok { border-color: var(--acc-line); background: var(--acc-dim); }
.alert.ok .i { color: var(--acc); }
.alert.err { border-color: var(--red-line); background: var(--red-dim); }
.alert.err .i { color: var(--red); }
.alert.warn { border-color: var(--amber-line); background: var(--amber-dim); }
.alert.warn .i { color: var(--amber); }
.page-alert { margin: 12px var(--pad) 0; }
.banner { display: flex; align-items: center; gap: 12px; padding: 12px var(--pad); border-bottom: 1px solid var(--line2); font-size: 14px; }
.banner > .i { flex: none; }
.banner.err { background: var(--red-dim); }
.banner.err > .i { color: var(--red); }
.banner.warn { background: var(--amber-dim); }
.banner.warn > .i { color: var(--amber); }
.banner.ok { background: var(--acc-dim); }
.banner.ok > .i { color: var(--acc); }

#toasts { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast {
  background: var(--text); color: var(--bg); padding: 11px 18px; border-radius: var(--pill);
  font-size: 14px; font-weight: 500; animation: toast .25s var(--ease);
  display: flex; align-items: center; gap: 8px; box-shadow: var(--shadow); max-width: 100%;
}
.toast.err { background: var(--red); color: #fff; }
@keyframes toast { from { opacity: 0; transform: translateY(10px) scale(.98); } }

.empty { text-align: center; padding: 64px 24px; color: var(--muted); }
.empty > .i { width: 40px; height: 40px; color: var(--dim); margin: 0 auto 14px; stroke-width: 1.4; display: block; }
.empty h3 { color: var(--text); margin-bottom: 6px; font-size: 18px; }
.empty p { max-width: 360px; margin: 0 auto 18px; font-size: 14px; }
.loader { display: flex; justify-content: center; padding: 28px; }
.loader::before { content: ""; width: 24px; height: 24px; border: 2.5px solid var(--line); border-top-color: var(--acc); border-radius: 50%; animation: spin .7s linear infinite; }

/* ——— القوائم المنبثقة ——— */
.menu-wrap { position: relative; }
.menu {
  position: absolute; top: calc(100% + 4px); inset-inline-end: 0; z-index: 60;
  min-width: 230px; padding: 6px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--r2); box-shadow: var(--shadow);
  animation: pop .14s var(--ease);
}
.menu a, .menu button {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px;
  background: none; border: 0; border-radius: var(--r1); font-size: 14.5px; font-weight: 500; color: var(--text); cursor: pointer; text-align: start;
}
.menu a:hover, .menu button:hover { background: var(--soft); color: var(--text); }
.menu .danger, .menu .danger:hover { color: var(--red); }
.menu .danger:hover { background: var(--red-dim); }
.menu hr { margin: 4px 0; }
.menu .menu-t { padding: 6px 12px 2px; font-size: 12px; color: var(--dim); font-weight: 600; }
.menu form { margin: 0; }
.menu.up { bottom: calc(100% + 6px); top: auto; inset-inline-start: 0; inset-inline-end: auto; }
.sheet-bg { display: none; }

/* ——— النوافذ ——— */
dialog {
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  border-radius: var(--r3); padding: 0; width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 48px);
  box-shadow: var(--shadow);
}
dialog::backdrop { background: var(--overlay); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
dialog[open] { animation: pop .18s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.985); } }
.dlg-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px 10px 16px; border-bottom: 1px solid var(--line2); }
.dlg-head h2 { font-size: 17px; flex: 1; }
.dlg-body { padding: 16px; overflow-y: auto; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line2); }
.grab { display: none; }
.reason-list { display: flex; flex-direction: column; gap: 6px; }
.reason-list label { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border: 1px solid var(--line2); border-radius: var(--r2); cursor: pointer; font-size: 14.5px; }
.reason-list label:has(input:checked) { border-color: var(--acc-line); background: var(--acc-dim); }

/* ==========================================================================
   المنشورات (تويتر)
   ========================================================================== */
.composer { padding: 14px var(--pad) 10px; border-bottom: 1px solid var(--line2); display: flex; gap: 12px; }
.composer textarea { width: 100%; border: 0; background: none; resize: none; min-height: 56px; font-size: 18px; padding: 8px 0; line-height: 1.5; }
.composer textarea:focus { outline: none; }
.composer textarea::placeholder { color: var(--dim); }
.composer-tools { display: flex; align-items: center; gap: 0; padding-top: 8px; border-top: 1px solid var(--line2); margin-top: 6px; }
.composer-tools .icon-btn { color: var(--acc); width: 36px; height: 36px; }
.composer-tools .icon-btn:hover { background: var(--acc-dim); color: var(--acc); }
.composer-tools .icon-btn.on { background: var(--acc-dim); }
.composer-tools .btn { margin-inline-start: 10px; }
.composer-extra { display: flex; flex-direction: column; gap: 10px; }
.composer-extra > :not([hidden]):first-child { margin-top: 6px; }
.in-dlg { border: 0; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumb { position: relative; width: 100px; height: 100px; border-radius: var(--r2); overflow: hidden; background: var(--soft); border: 1px solid var(--line2); }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; }
.thumb button { position: absolute; top: 5px; inset-inline-end: 5px; width: 26px; height: 26px; border-radius: 50%; background: rgba(0, 0, 0, .72); border: 0; color: #fff; display: grid; place-items: center; cursor: pointer; }

.fresh-pill { position: sticky; top: calc(var(--bar) + 54px); z-index: 25; display: flex; justify-content: center; height: 0; }
.fresh-pill button { margin-top: 10px; box-shadow: var(--shadow); }

.post { display: flex; gap: 12px; padding: var(--gap) var(--pad); border-bottom: 1px solid var(--line2); position: relative; transition: background .15s; }
.post.link-card { cursor: pointer; }
.post.link-card:hover { background: var(--wash); }
.post-side { flex: none; }
.post-body { flex: 1; min-width: 0; }
.post-meta { display: flex; align-items: center; gap: 5px; font-size: 14.5px; min-width: 0; line-height: 1.4; }
.post-meta .name { font-weight: 600; color: var(--text); flex-shrink: 0; max-width: 55%; display: inline-flex; align-items: center; gap: 3px; min-width: 0; }
.post-meta .name > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-meta .name:hover > span { text-decoration: underline; }
.post-meta .handle { color: var(--dim); flex-shrink: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-meta .time { color: var(--dim); white-space: nowrap; }
.post-meta .time:hover { text-decoration: underline; color: var(--muted); }
.post-meta .menu-wrap { margin-inline-start: auto; margin-block: -6px; }
.post-text { margin-top: 2px; font-size: 15.5px; overflow-wrap: anywhere; line-height: 1.6; }
.post-text a.tag, .post-text a.mention, .rich a, .cmt-text a { color: var(--acc); }
.post-text a:hover, .cmt-text a:hover { text-decoration: underline; }
.post.big { display: block; }
.post.big .post-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.post.big .post-text { font-size: 18.5px; line-height: 1.55; }
.post-ctx { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--dim); margin-bottom: 2px; }
.post-ctx .i { width: 15px; height: 15px; }
.post-ctx a:hover { text-decoration: underline; color: var(--dim); }
.edited { font-size: 12.5px; color: var(--dim); }

.media { margin-top: 10px; display: grid; gap: 2px; border-radius: var(--r3); overflow: hidden; border: 1px solid var(--line2); }
.media.n2, .media.n3, .media.n4 { grid-template-columns: 1fr 1fr; }
.media.n3 a:first-child { grid-row: span 2; }
.media a { display: block; background: var(--soft); }
.media img { width: 100%; height: 100%; object-fit: cover; max-height: 540px; }
.media.n2 img, .media.n3 img, .media.n4 img { aspect-ratio: 1; }
.post-video { margin-top: 10px; border-radius: var(--r3); overflow: hidden; background: #000; border: 1px solid var(--line2); max-width: 300px; aspect-ratio: 9/16; position: relative; display: block; }
.post-video video { width: 100%; height: 100%; object-fit: cover; }

/* كتلة الكود: رأس ملف مثل GitHub */
.codebox { margin-top: 10px; border: 1px solid var(--line); border-radius: var(--r2); overflow: hidden; background: var(--code-bg); direction: ltr; text-align: left; }
.codebox-head { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 6px 0 12px; background: var(--soft); border-bottom: 1px solid var(--line); font: 12px var(--mono); color: var(--muted); }
.codebox-head .lang { display: inline-flex; align-items: center; gap: 6px; }
.codebox-head .lang::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--acc); }
.codebox-head .grow { text-align: right; padding-right: 4px; }
.codebox pre { margin: 0; padding: 12px 0; overflow-x: auto; max-height: 480px; font-size: 13px; line-height: 1.65; tab-size: 4; counter-reset: ln; }
.codebox pre code { display: block; min-width: max-content; }
.ln { display: block; padding: 0 16px 0 0; white-space: pre; }
.codebox .ln::before { counter-increment: ln; content: counter(ln); display: inline-block; width: 3.4em; padding-right: 1.2em; text-align: right; color: var(--dim); opacity: .55; user-select: none; }
.codebox .ln:hover { background: var(--wash); }
.codebox.collapsed pre { max-height: 260px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.codebox-more { display: block; width: 100%; padding: 9px; background: var(--soft); border: 0; border-top: 1px solid var(--line); color: var(--muted); font: 600 12.5px var(--font); cursor: pointer; }
.codebox-more:hover { color: var(--acc); }
.tk-k { color: var(--tk-k); }
.tk-s { color: var(--tk-s); }
.tk-n { color: var(--tk-n); }
.tk-c { color: var(--tk-c); font-style: italic; }
.tk-f { color: var(--tk-f); }
.tk-b { color: var(--tk-b); }
.tk-o { color: var(--tk-o); }

.embed { margin-top: 10px; display: flex; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r2); }
.embed:hover { border-color: var(--acc-line); background: var(--acc-dim); color: var(--text); }
.embed > .i { color: var(--acc); }
.embed-t { font-weight: 600; font-size: 14px; }
.embed-d { font-size: 13px; color: var(--muted); }

.acts { display: flex; justify-content: space-between; max-width: 460px; margin-top: 6px; margin-inline-start: -9px; }
.post.big .acts { max-width: none; padding: 4px 0; border-top: 1px solid var(--line2); margin: 12px 0 0; }
.act {
  display: inline-flex; align-items: center; gap: 4px; height: 34px; padding: 0 9px;
  background: none; border: 0; border-radius: var(--pill); color: var(--dim); font-size: 13px; cursor: pointer;
  transition: color .15s, background .15s; font-variant-numeric: tabular-nums;
}
.act .i { width: 18.5px; height: 18.5px; }
.act:hover { color: var(--acc); background: var(--acc-dim); }
.act.like:hover, .act.like.on { color: var(--red); }
.act.like:hover { background: var(--red-dim); }
.act.on { color: var(--acc); }
.act.like.on .i { animation: beat .35s var(--ease); }
@keyframes beat { 40% { transform: scale(1.3); } }
.post-stats { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 12px 0 0; font-size: 14px; color: var(--muted); }
.post-stats b { color: var(--text); font-weight: 700; }
.history { border-bottom: 1px solid var(--line2); padding: 12px var(--pad); }
.history summary { cursor: pointer; color: var(--muted); font-size: 14px; display: flex; align-items: center; gap: 6px; }
.hist-item { padding: 12px 0; border-top: 1px dashed var(--line2); margin-top: 10px; }

/* ——— التعليقات ——— */
.comments { padding: 0 var(--pad); }
.cmt-group + .cmt-group { border-top: 1px solid var(--line2); }
.cmt { display: flex; gap: 10px; padding: 12px 0; }
.cmt.fresh { animation: fresh 1.8s var(--ease); }
@keyframes fresh { from { background: var(--acc-dim); } }
.cmt-body { flex: 1; min-width: 0; }
.cmt-text { font-size: 14.5px; overflow-wrap: anywhere; margin-top: 1px; }
.cmt-acts { display: flex; gap: 2px; margin-top: 2px; margin-inline-start: -8px; }
.cmt-acts .act { height: 28px; font-size: 12.5px; }
.cmt-acts .act .i { width: 15px; height: 15px; }
.replies { margin-inline-start: 20px; border-inline-start: 2px solid var(--line2); padding-inline-start: 18px; margin-bottom: 8px; }
.replies .cmt { padding: 8px 0; }
.cmt.gone .cmt-text { color: var(--dim); font-style: italic; }
.cmt-form { display: flex; gap: 10px; padding: 14px var(--pad); border-bottom: 1px solid var(--line2); align-items: flex-start; }
.cmt-form textarea { min-height: 44px; }
.reply-form { padding: 8px 0 !important; border: 0 !important; }
.locked { padding: 14px var(--pad); font-size: 14px; color: var(--dim); border-bottom: 1px solid var(--line2); display: flex; align-items: center; gap: 8px; }

/* ——— العمود الجانبي ——— */
.side-list { display: flex; flex-direction: column; }
.side-item { display: flex; align-items: center; gap: 10px; padding: 10px 16px; min-width: 0; transition: background .15s; }
a.side-item:hover { background: var(--soft); color: var(--text); }
.trend { display: block; padding: 10px 16px; transition: background .15s; }
.trend:hover { background: var(--soft); color: var(--text); }
.trend .t { font-weight: 700; }
.trend .n { font-size: 12.5px; color: var(--dim); }
.search-box { position: relative; }
.search-box .i { position: absolute; top: 50%; transform: translateY(-50%); inset-inline-start: 14px; color: var(--dim); pointer-events: none; }
.search-box .input { padding-inline-start: 42px; border-radius: var(--pill); background: var(--soft); border-color: transparent; height: 44px; }
.search-box .input:focus { background: var(--bg); }
.foot-links { font-size: 12.5px; color: var(--dim); display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 0 16px; }
.foot-links a:hover { color: var(--muted); text-decoration: underline; }

/* ==========================================================================
   الملف الشخصي
   ========================================================================== */
.cover { height: 200px; background: var(--soft); position: relative; overflow: hidden; }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover.empty-cover { background-image: radial-gradient(circle at 1px 1px, var(--line) 1px, transparent 0); background-size: 18px 18px; }
.prof { padding: 0 var(--pad) 16px; border-bottom: 1px solid var(--line2); }
.prof-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-top: -64px; position: relative; }
.prof-top .row { padding-bottom: 8px; }
.prof-name { font-size: 22px; margin-top: 10px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.prof .handle { color: var(--dim); font-size: 15px; }
.prof-bio { margin-top: 12px; font-size: 15px; overflow-wrap: anywhere; white-space: pre-line; }
.prof-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; color: var(--muted); font-size: 14px; }
.prof-meta span, .prof-meta a { display: inline-flex; align-items: center; gap: 6px; }
.prof-meta .i { width: 17px; height: 17px; color: var(--dim); }
.prof-meta a { color: var(--acc); }
.prof-meta a:hover { text-decoration: underline; }
.prof-nums { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 12px; font-size: 14px; color: var(--muted); }
.prof-nums b { color: var(--text); font-weight: 700; margin-inline-end: 4px; font-variant-numeric: tabular-nums; }
.prof-nums a:hover { text-decoration: underline; color: var(--text); }
.prof-skills { margin-top: 14px; }
.blocked-note { padding: 48px 16px; text-align: center; color: var(--muted); }
.user-row { display: flex; align-items: center; gap: 12px; padding: 12px var(--pad); border-bottom: 1px solid var(--line2); transition: background .15s; }
.user-row:hover { background: var(--wash); }
.user-row .bio { font-size: 13.5px; color: var(--muted); }
.side-list .user-row { border: 0; padding: 10px 16px; }

/* ==========================================================================
   الفيديوهات (تيك توك)
   ========================================================================== */
.reel-page { height: 100vh; height: 100dvh; overflow: hidden; position: relative; }
.reels { height: 100%; overflow-y: auto; scroll-snap-type: y mandatory; scrollbar-width: none; overscroll-behavior: contain; }
.reels::-webkit-scrollbar { display: none; }
.reel { height: 100%; scroll-snap-align: start; scroll-snap-stop: always; display: flex; align-items: center; justify-content: center; gap: 18px; padding: 18px 0; position: relative; }
.reel-frame { position: relative; height: 100%; aspect-ratio: 9/16; background: #000; border-radius: var(--r3); overflow: hidden; box-shadow: 0 0 0 1px var(--line2); }
.reel-frame video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.reel-tap { position: absolute; inset: 0; z-index: 1; cursor: pointer; background: none; border: 0; }
.reel-state { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; z-index: 2; }
.reel-state .i { width: 72px; height: 72px; color: rgba(255, 255, 255, .92); filter: drop-shadow(0 2px 10px rgba(0, 0, 0, .5)); opacity: 0; transform: scale(.85); transition: opacity .18s, transform .18s; }
.reel.paused .reel-state .i { opacity: 1; transform: none; }
.reel-info { position: absolute; inset-inline: 0; bottom: 0; z-index: 3; padding: 64px 16px 20px; background: linear-gradient(transparent, rgba(0, 0, 0, .82)); color: #fff; pointer-events: none; }
.reel-info a, .reel-info button { pointer-events: auto; }
.reel-info .who { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 15px; }
.reel-info .who:hover { color: #fff; text-decoration: underline; }
.reel-info .desc { font-size: 14px; margin-top: 6px; max-height: 4.8em; overflow: hidden; line-height: 1.6; }
.reel-info .desc a { color: #fff; font-weight: 700; }
.reel-top { position: absolute; top: 12px; inset-inline: 12px; z-index: 3; display: flex; justify-content: space-between; gap: 8px; }
.reel-top button { width: 40px; height: 40px; border-radius: 50%; background: rgba(0, 0, 0, .45); border: 0; color: #fff; display: grid; place-items: center; cursor: pointer; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.reel-views { display: inline-flex; align-items: center; gap: 6px; background: rgba(0, 0, 0, .45); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); color: #fff; border-radius: 20px; padding: 0 12px; height: 40px; font-size: 13px; font-weight: 600; }
.reel-bar { position: absolute; inset-inline: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, .22); z-index: 4; cursor: pointer; direction: ltr; transition: height .15s; }
.reel-bar:hover { height: 7px; }
.reel-bar span { display: block; height: 100%; width: 0; background: var(--acc); }
.reel-side { display: flex; flex-direction: column; gap: 16px; align-items: center; align-self: flex-end; padding-bottom: 28px; }
.reel-side .av-link img { width: 50px; height: 50px; border-radius: 50%; border: 2px solid var(--text); object-fit: cover; }
.reel-btn { display: flex; flex-direction: column; align-items: center; gap: 5px; background: none; border: 0; color: var(--text); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.reel-btn .ic { width: 50px; height: 50px; border-radius: 50%; background: var(--soft); display: grid; place-items: center; transition: background .15s, transform .1s; }
.reel-btn:hover .ic { background: var(--hover); }
.reel-btn:active .ic { transform: scale(.9); }
.reel-btn .i { width: 25px; height: 25px; }
.reel-btn.on.like .i { color: var(--red); }
.reel-btn.on.save .i { color: var(--amber); }
.reel-up { position: absolute; top: 14px; inset-inline-end: 18px; z-index: 6; display: flex; gap: 10px; align-items: center; }
.reel-tabs { background: var(--glass); border-radius: var(--pill); border: 1px solid var(--line2); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); padding: 0 4px; }
.reel-tabs .tab { padding: 8px 12px; font-size: 14px; }
.reel-tabs .tab.on::after { display: none; }
.reel-tabs .tab.on { color: var(--acc); }
.reel-more { height: 40px; scroll-snap-align: end; }
.reel .empty { margin: auto; }
.drawer-panel { position: fixed; inset-block: 0; inset-inline-end: 0; width: min(420px, 100vw); background: var(--card); border-inline-start: 1px solid var(--line); z-index: 80; display: flex; flex-direction: column; transform: translateX(-100%); transition: transform .26s var(--ease); box-shadow: var(--shadow); }
.drawer-panel.open { transform: none; }
.drawer-body { flex: 1; overflow-y: auto; }

.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px; padding: 4px; }
.vtile { position: relative; aspect-ratio: 9/16; background: #000; border-radius: var(--r1); overflow: hidden; display: block; }
.vtile img, .vtile video { width: 100%; height: 100%; object-fit: cover; transition: transform .3s var(--ease); }
.vtile:hover img { transform: scale(1.04); }
.vtile .v-n { position: absolute; bottom: 6px; inset-inline-start: 8px; display: flex; align-items: center; gap: 4px; color: #fff; font-size: 12.5px; font-weight: 700; text-shadow: 0 1px 4px rgba(0, 0, 0, .9); }
.vtile .v-n .i { width: 14px; height: 14px; }

.upload-page { padding: 20px var(--pad); }
.upload-page form { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 24px; align-items: start; }
.drop { display: grid; place-items: center; aspect-ratio: 9/16; border: 1.5px dashed var(--line); border-radius: var(--r3); background: var(--card); cursor: pointer; overflow: hidden; position: relative; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--acc); background: var(--acc-dim); }
.drop video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.drop-in { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 16px; }
.drop-in .i { color: var(--acc); }
.progress { height: 6px; background: var(--soft); border-radius: 3px; overflow: hidden; margin-bottom: 12px; direction: ltr; }
.progress span { display: block; height: 100%; width: 0; background: var(--acc); transition: width .2s; }

/* ==========================================================================
   المشاريع (GitHub)
   ========================================================================== */
.repo-head { padding: 20px var(--pad) 0; border-bottom: 1px solid var(--line2); }
.repo-title { display: flex; align-items: center; gap: 8px; font-size: 21px; flex-wrap: wrap; line-height: 1.35; }
.repo-title > .i { color: var(--muted); }
.repo-title .owner { color: var(--acc); font-weight: 400; }
.repo-title .owner:hover { text-decoration: underline; }
.repo-title .slash { color: var(--dim); font-weight: 300; }
.repo-title b { font-weight: 700; }
.repo-fork { font-size: 12.5px; color: var(--dim); margin-top: 2px; }
.repo-fork a { color: var(--muted); text-decoration: underline; }
.repo-sum { color: var(--muted); margin-top: 8px; font-size: 15px; }
.repo-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.btn-count { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r1); overflow: hidden; height: 32px; }
.btn-count .btn { border: 0; border-radius: 0; height: 30px; font-size: 13px; padding: 0 12px; background: var(--soft); }
.btn-count .btn:hover { background: var(--hover); color: var(--text); }
.btn-count .btn.on .i { color: var(--amber); }
.btn-count span { display: grid; place-items: center; padding: 0 10px; border-inline-start: 1px solid var(--line); font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.repo-tabs { margin-top: 12px; margin-inline: calc(var(--pad) * -1); padding-inline: 8px; border-bottom: 0; }
.repo-grid { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 24px; padding: 20px var(--pad); }
.repo-main { min-width: 0; }
.repo-tools { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.crumbs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 15px; direction: ltr; unicode-bidi: isolate; }
.crumbs a { color: var(--acc); font-weight: 600; }
.crumbs a:hover { text-decoration: underline; }
.crumbs .sep { color: var(--dim); }
.crumbs b { font-weight: 700; }
.files { border: 1px solid var(--line); border-radius: var(--r2); overflow: hidden; }
.files-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--soft); border-bottom: 1px solid var(--line); font-size: 13.5px; min-height: 48px; }
.files-head .msg { color: var(--muted); }
.files-head .msg:hover { color: var(--acc); text-decoration: underline; }
.file-row { display: grid; grid-template-columns: 22px minmax(0, 1.2fr) minmax(0, 1.4fr) auto; align-items: center; gap: 12px; padding: 9px 14px; border-top: 1px solid var(--line2); font-size: 14px; }
.files-head + .file-row { border-top: 0; }
.file-row:hover { background: var(--wash); }
.file-row > .i { color: var(--muted); width: 18px; height: 18px; }
.file-row .i.dir { color: var(--blue); }
.file-row .fn { direction: ltr; text-align: right; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row a.fn:hover { color: var(--acc); text-decoration: underline; }
.file-row .fm { color: var(--dim); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row .fm:hover { color: var(--acc); text-decoration: underline; }
.file-row .fs { color: var(--dim); font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.file-row.simple { grid-template-columns: 22px minmax(0, 1fr) auto auto; }
.zip-box { border-top: 1px solid var(--line2); padding: 6px 14px 10px 48px; }
.zip-box summary { cursor: pointer; }
.zip-list { font: 12px var(--mono); color: var(--dim); direction: ltr; text-align: left; max-height: 220px; overflow-y: auto; padding-top: 6px; }
.readme { border: 1px solid var(--line); border-radius: var(--r2); margin-top: 16px; overflow: hidden; }
.readme-head { padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; background: var(--soft); }
.readme-body { padding: 24px 28px; }
.about h3 { font-size: 16px; margin-bottom: 10px; }
.about-row { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); padding: 5px 0; }
.about-row .i { width: 16px; height: 16px; flex: none; }
.about-row b { color: var(--text); }
.about-sec { padding: 16px 0; border-bottom: 1px solid var(--line2); }
.about-sec:first-child { padding-top: 0; }
.about-sec:last-child { border-bottom: 0; }
.langbar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; gap: 2px; margin: 8px 0 10px; background: var(--soft); }
.langbar span { display: block; height: 100%; }
.langs { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--muted); }
.langs i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-inline-end: 6px; }
.rel { padding: 18px 0; border-bottom: 1px solid var(--line2); }
.rel:first-child { padding-top: 0; }
.rel:last-child { border-bottom: 0; }
.rel-ver { font: 700 17px var(--mono); }
.repo-card { display: block; padding: 18px var(--pad); border-bottom: 1px solid var(--line2); transition: background .15s; }
.repo-card:hover { background: var(--wash); color: var(--text); }
.repo-card .name { color: var(--acc); font-weight: 600; font-size: 17px; }
.repo-card .sum { font-size: 14px; color: var(--muted); margin-top: 4px; }
.repo-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin-top: 10px; font-size: 12.5px; color: var(--dim); }
.repo-stats span { display: inline-flex; align-items: center; gap: 5px; }
.repo-stats .i { width: 14px; height: 14px; }
.dot { width: 11px; height: 11px; border-radius: 50%; background: #00A2FF; display: inline-block; flex: none; }
.dot.lua { background: #6CB6FF; }
.dot.ts { background: #3178C6; }
.dot.none { background: var(--dim); }
.previews { display: flex; gap: 8px; overflow-x: auto; margin-top: 16px; padding-bottom: 4px; }
.previews img { height: 170px; width: auto; border-radius: var(--r2); border: 1px solid var(--line); }
.code-view { border: 1px solid var(--line); border-radius: var(--r2); overflow: hidden; }
.code-view .codebox { margin: 0; border: 0; border-radius: 0; }
.code-view .codebox pre { max-height: none; }
.blob-head { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; background: var(--soft); border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); flex-wrap: wrap; direction: ltr; }
.btn-group { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r1); overflow: hidden; direction: rtl; }
.btn-group > * { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; font-size: 12.5px; font-weight: 600; background: var(--card); border: 0; border-inline-start: 1px solid var(--line); color: var(--text); cursor: pointer; }
.btn-group > :first-child { border-inline-start: 0; }
.btn-group > :hover { background: var(--hover); color: var(--text); }
.btn-group .danger { color: var(--red); }
.btn-group .i { width: 15px; height: 15px; }
.editor { display: flex; border: 1px solid var(--line); border-radius: var(--r2); overflow: hidden; background: var(--code-bg); direction: ltr; }
.editor-ln { padding: 12px 10px 12px 0; min-width: 48px; text-align: right; color: var(--dim); font: 13px/1.65 var(--mono); user-select: none; background: var(--wash); border-right: 1px solid var(--line2); white-space: pre; overflow: hidden; }
.editor textarea { flex: 1; min-height: 460px; border: 0; background: none; padding: 12px 14px; font: 13px/1.65 var(--mono); color: var(--text); resize: vertical; outline: none; white-space: pre; overflow: auto; tab-size: 4; }
.commit-box { margin-top: 16px; border: 1px solid var(--line); border-radius: var(--r2); padding: 16px; background: var(--card); }
.commits-list { border: 1px solid var(--line); border-radius: var(--r2); overflow: hidden; }
.commit-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line2); }
.commit-row:first-child { border-top: 0; }
.commit-row .msg { font-weight: 600; }
.commit-row .msg:hover { color: var(--acc); text-decoration: underline; }
.commit-day { font-size: 13px; color: var(--muted); padding: 16px 2px 8px; display: flex; align-items: center; gap: 8px; }
.sha { font: 600 12px var(--mono); color: var(--muted); background: var(--soft); border: 1px solid var(--line2); padding: 2px 8px; border-radius: var(--r1); }
.sha:hover { color: var(--acc); }
.plus { color: var(--green); font-weight: 700; font-family: var(--mono); font-size: 12.5px; }
.minus { color: var(--red); font-weight: 700; font-family: var(--mono); font-size: 12.5px; }
.diff { border: 1px solid var(--line); border-radius: var(--r2); overflow: hidden; margin-top: 16px; }
.diff-head { display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: var(--soft); border-bottom: 1px solid var(--line); font-size: 13.5px; direction: ltr; }
.diff-body { overflow-x: auto; direction: ltr; text-align: left; background: var(--code-bg); }
.diff table { border-collapse: collapse; width: 100%; font: 12.5px/1.6 var(--mono); }
.diff td { padding: 0 10px; white-space: pre; vertical-align: top; }
.diff td.n { width: 1%; min-width: 44px; text-align: right; color: var(--dim); user-select: none; }
.diff tr.add { background: var(--green-dim); }
.diff tr.add td.s::before { content: "+ "; color: var(--green); }
.diff tr.del { background: var(--red-dim); }
.diff tr.del td.s::before { content: "- "; color: var(--red); }
.diff tr.ctx td.s::before { content: "  "; }
.diff tr.gap td { background: var(--blue-dim); color: var(--blue); padding: 3px 10px; }
.issue-row { display: flex; gap: 12px; padding: 14px var(--pad); border-bottom: 1px solid var(--line2); align-items: flex-start; }
.issue-row > .i { margin-top: 3px; }
.issue-row .t { font-weight: 600; font-size: 15.5px; }
.issue-row .t:hover { color: var(--acc); }
.i.open { color: var(--green); }
.i.closed { color: var(--purple); }
.state-pill { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px; border-radius: var(--pill); font-weight: 600; font-size: 14px; color: #fff; }
.state-pill .i { width: 17px; height: 17px; color: #fff; }
.state-pill.open { background: #1F9D55; }
.state-pill.closed { background: #7C5CD6; }
.label-bug { color: var(--red); border-color: var(--red-line); background: var(--red-dim); }
.label-feature { color: var(--acc); border-color: var(--acc-line); background: var(--acc-dim); }
.label-question { color: var(--purple); border-color: var(--purple-line); background: var(--purple-dim); }
.label-docs { color: var(--blue); border-color: var(--blue-line); background: var(--blue-dim); }
.label-help { color: var(--amber); border-color: var(--amber-line); background: var(--amber-dim); }
.thumb-rm { cursor: pointer; }
.thumb-rm input { position: absolute; top: 6px; inset-inline-start: 6px; }
.thumb-rm span { position: absolute; bottom: 0; inset-inline: 0; background: rgba(0, 0, 0, .65); color: #fff; font-size: 11px; text-align: center; padding: 2px; }
.thumb-rm:has(input:checked) img { opacity: .3; }

/* ——— Markdown ——— */
.md { overflow-wrap: anywhere; font-size: 15px; line-height: 1.7; }
.md h1, .md h2 { padding-bottom: 8px; border-bottom: 1px solid var(--line2); margin: 24px 0 14px; }
.md h1 { font-size: 26px; }
.md h2 { font-size: 21px; }
.md h3 { font-size: 17px; margin: 20px 0 10px; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md a { color: var(--acc); }
.md a:hover { text-decoration: underline; }
.md ul, .md ol { padding-inline-start: 24px; margin: 0 0 14px; }
.md li + li { margin-top: 4px; }
.md blockquote { margin: 0 0 14px; padding: 2px 14px; border-inline-start: 3px solid var(--line); color: var(--muted); }
.md code { background: var(--soft); padding: 2px 6px; border-radius: var(--r1); font-size: 13px; direction: ltr; unicode-bidi: isolate; }
.md pre { background: var(--code-bg); border: 1px solid var(--line); border-radius: var(--r2); padding: 14px 16px; overflow-x: auto; direction: ltr; text-align: left; font-size: 13px; line-height: 1.65; margin: 0 0 14px; }
.md pre code { background: none; padding: 0; }
.md .ln { display: block; white-space: pre; }
.md table { border-collapse: collapse; margin: 0 0 14px; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--line); padding: 7px 13px; }
.md th { background: var(--soft); }
.md img { max-width: 100%; border-radius: var(--r2); }
.md hr { margin: 22px 0; }

/* ==========================================================================
   النقاشات
   ========================================================================== */
.thread-row { display: flex; gap: 16px; padding: 16px var(--pad); border-bottom: 1px solid var(--line2); transition: background .15s; }
.thread-row:hover { background: var(--wash); }
.thread-nums { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; width: 92px; flex: none; font-size: 12.5px; color: var(--dim); text-align: end; padding-top: 2px; }
.thread-nums .solved { color: var(--acc-ink); background: var(--acc); padding: 1px 9px; border-radius: var(--pill); font-weight: 700; }
.thread-nums .has { color: var(--acc); border: 1px solid var(--acc-line); padding: 0 8px; border-radius: var(--pill); }
.thread-t { font-weight: 600; font-size: 16px; color: var(--text); line-height: 1.45; }
.thread-t:hover { color: var(--acc); }
.q { padding: 20px var(--pad); border-bottom: 1px solid var(--line2); }
.q-title { font-size: 23px; line-height: 1.4; }
.q-meta { margin: 10px 0 18px; }
.q-body { margin-bottom: 18px; }
.answer { display: flex; gap: 14px; padding: 20px var(--pad); border-bottom: 1px solid var(--line2); }
.answer.accepted { background: linear-gradient(270deg, var(--acc-dim), transparent 70%); box-shadow: inset -3px 0 0 var(--acc); }
.vote { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: none; width: 42px; }
.vote button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; background: none; color: var(--muted); display: grid; place-items: center; cursor: pointer; transition: all .15s; }
.vote button:hover:not(:disabled) { border-color: var(--acc); color: var(--acc); }
.vote button:disabled { opacity: .4; cursor: default; }
.vote button.on { background: var(--acc-dim); border-color: var(--acc); color: var(--acc); }
.vote b { font-size: 18px; font-variant-numeric: tabular-nums; }
.accept-mark { color: var(--acc); margin-top: 6px; }
.a-cmts { margin-top: 12px; }
.a-cmts summary { cursor: pointer; padding: 4px 0; }
.a-cmts .cmt-form, .a-cmts .comments, .a-cmts .locked { padding-inline: 0; }
.a-cmts .empty { display: none; }

/* ==========================================================================
   الإشعارات والرسائل
   ========================================================================== */
.notif { display: flex; gap: 14px; padding: 14px var(--pad); border-bottom: 1px solid var(--line2); position: relative; transition: background .15s; }
.notif.new { background: var(--acc-dim); }
.notif.new::before { content: ""; position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 3px; background: var(--acc); }
.notif:hover { background: var(--soft); color: var(--text); }
.notif .ic { width: 32px; flex: none; display: grid; place-items: start center; padding-top: 6px; }
.notif .ic .i { width: 24px; height: 24px; }
.notif .body { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.ic-follow { color: var(--blue); }
.ic-like { color: var(--red); }
.ic-comment, .ic-reply, .ic-mention, .ic-answer, .ic-acomment, .ic-pcomment, .ic-icomment, .ic-repost, .ic-accept, .ic-verify, .ic-issue-closed { color: var(--acc); }
.ic-badge { color: var(--pink); }
.ic-star, .ic-release, .ic-fork, .ic-issue { color: var(--amber); }
.ic-admin { color: var(--red); }
.notif-text { font-size: 15px; }
.notif-snip { font-size: 14px; color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

.dm { display: grid; grid-template-columns: 360px minmax(0, 1fr); height: 100vh; height: 100dvh; }
.dm-list { border-inline-end: 1px solid var(--line2); overflow-y: auto; }
.dm-item { display: flex; gap: 12px; padding: 14px var(--pad); align-items: center; transition: background .15s; }
.dm-item:hover { background: var(--soft); color: var(--text); }
.dm-item.on { background: var(--soft); box-shadow: inset -3px 0 0 var(--acc); }
.dm-item .last { font-size: 13.5px; color: var(--muted); }
.dm-item.unread .last { color: var(--text); font-weight: 600; }
.dm-chat { display: flex; flex-direction: column; min-height: 0; }
.dm-msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 3px; overscroll-behavior: contain; }
.bubble { max-width: min(78%, 520px); padding: 9px 14px; border-radius: 20px; font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; align-self: flex-start; background: var(--soft); border-start-start-radius: 6px; }
.bubble.mine { align-self: flex-end; background: var(--acc); color: var(--acc-ink); border-radius: 20px; border-start-end-radius: 6px; }
.bubble.mine a { color: var(--acc-ink); text-decoration: underline; }
.bubble.pending { opacity: .6; }
.bubble-meta { font-size: 11.5px; color: var(--dim); margin: 2px 6px 10px; align-self: flex-start; display: flex; align-items: center; gap: 4px; }
.bubble-meta.mine { align-self: flex-end; }
.bubble-meta .i { width: 15px; height: 15px; }
.bubble-meta .seen { color: var(--acc); }
.typing { align-self: flex-start; display: inline-flex; gap: 4px; padding: 12px 16px; background: var(--soft); border-radius: 20px; border-start-start-radius: 6px; margin: 2px 0 8px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: typing 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 30% { transform: translateY(-4px); opacity: .6; } }
.dm-form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line2); align-items: flex-end; }
.dm-form textarea { min-height: 44px; max-height: 160px; resize: none; border-radius: 22px; padding: 10px 16px; }
.dm-form .btn { width: 44px; height: 44px; padding: 0; flex: none; }
.day-sep { align-self: center; font-size: 12px; color: var(--dim); margin: 14px 0 8px; background: var(--soft); border-radius: var(--pill); padding: 2px 12px; }
.dm .head { position: static; }
.dm-back { display: none; }

/* ==========================================================================
   الإعدادات ولوحة الإدارة
   ========================================================================== */
.set-grid { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 28px; padding: 20px var(--pad); align-items: start; }
.set-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 76px; }
.set-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--r2); color: var(--muted); font-size: 14.5px; font-weight: 500; }
.set-nav a:hover { background: var(--soft); color: var(--text); }
.set-nav a.on { background: var(--soft); color: var(--text); font-weight: 600; }
.set-nav a.on .i { color: var(--acc); }
.set-nav a .badge { margin-inline-start: auto; }
.set-sec { min-width: 0; }
.set-sec > h2 { margin-bottom: 4px; font-size: 21px; }
.set-sec > .muted { margin-bottom: 20px; }
.set-two { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 28px; align-items: start; }
.set-prev { position: sticky; top: 76px; }
.prev-card { border: 1px solid var(--line); border-radius: var(--r3); overflow: hidden; background: var(--card); }
.prev-card .cover { height: 100px; }
.prev-card .prof-top { margin-top: -36px; padding: 0 14px; }
.prev-card .av.xl { width: 76px; height: 76px; }
.prev-card .p-in { padding: 0 14px 16px; }
.upload-zone { display: flex; align-items: center; gap: 16px; }
.danger-zone { border: 1px solid var(--red-line); border-radius: var(--r3); padding: 18px; }
.danger-zone h3 { color: var(--red); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.stat { background: var(--card); border: 1px solid var(--line2); border-radius: var(--r3); padding: 16px; display: block; }
a.stat:hover { border-color: var(--acc-line); color: var(--text); }
.stat .k { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.stat .k .i { width: 17px; height: 17px; }
.stat .v { font-size: 30px; font-weight: 700; margin-top: 6px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; line-height: 1.1; }
.stat .s { font-size: 12.5px; color: var(--dim); margin-top: 4px; }
.stat.hot { border-color: var(--red-line); }
.stat.hot .v { color: var(--red); }
.stat.good .v { color: var(--acc); }
.table-wrap { border: 1px solid var(--line2); border-radius: var(--r3); overflow-x: auto; background: var(--card); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: start; font-weight: 600; color: var(--muted); font-size: 12.5px; padding: 11px 14px; border-bottom: 1px solid var(--line); background: var(--soft); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: var(--wash); }
.adm-acts { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.adm-acts form { margin: 0; }
.adm-card { background: var(--card); border: 1px solid var(--line2); border-radius: var(--r3); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.adm-card h3 { display: flex; align-items: center; gap: 8px; font-size: 15.5px; }
.adm-card h3 .i { color: var(--acc); }
.adm-card.danger { border-color: var(--red-line); }
.adm-card.danger h3 .i { color: var(--red); }
.adm-card .input { min-height: 40px; }
.adm-card textarea.input { min-height: 70px; }
.adm-user { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.log-row { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line2); font-size: 14px; align-items: flex-start; }
.log-row:last-child { border-bottom: 0; }
.perm-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.perm-list label { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--r2); cursor: pointer; font-size: 13.5px; }
.perm-list label:has(input:checked) { border-color: var(--acc-line); background: var(--acc-dim); }
.adm-wrap { padding: 20px var(--pad) 40px; }

/* ==========================================================================
   صفحات خاصة
   ========================================================================== */
.welcome { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(400px, .9fr); }
/* الجانب التعريفي */
.w-art {
  position: relative; overflow: hidden; border-inline-end: 1px solid var(--line2);
  padding: 36px clamp(32px, 4vw, 64px) 32px; display: flex; flex-direction: column; gap: 28px; height: 100vh; height: 100dvh; position: sticky; top: 0;
  background-image: radial-gradient(circle at 1px 1px, var(--line2) 1px, transparent 0); background-size: 22px 22px;
}
.w-brand { display: inline-flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 700; letter-spacing: -.01em; width: fit-content; }
.w-brand img { width: 34px; height: 34px; border-radius: 9px; }
.w-brand:hover { color: var(--text); }
.w-brand.sm { font-size: 18px; } .w-brand.sm img { width: 30px; height: 30px; }
.w-head { max-width: 580px; margin-top: auto; }
.w-kicker { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border: 1px solid var(--acc-line); background: var(--acc-dim); color: var(--acc); border-radius: var(--pill); font-size: 13px; font-weight: 600; }
.w-head h1 { font-size: clamp(32px, 3.1vw, 46px); line-height: 1.15; font-weight: 700; letter-spacing: -.02em; margin-top: 18px; text-wrap: balance; }
.w-head p { color: var(--muted); font-size: 17px; margin: 16px 0 0; max-width: 500px; line-height: 1.7; }
/* معاينة مرتبة بشبكة (بدون تداخل) */
.w-stage { display: grid; grid-template-columns: minmax(0, 1fr) 168px; grid-template-rows: auto auto; gap: 14px; max-width: 600px; }
.w-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r3); padding: 14px; min-width: 0; }
.w-post { grid-column: 1; grid-row: 1; }
.w-post .codebox pre { font-size: 11.5px; padding: 8px 0; max-height: none; }
.w-repo { grid-column: 1; grid-row: 2; }
.w-reel { grid-column: 2; grid-row: 1 / span 2; max-height: 340px; position: relative; padding: 0; overflow: hidden; background: #000; border-color: var(--line); display: flex; flex-direction: column; justify-content: flex-end; min-height: 280px; }
.w-reel .scr { position: absolute; inset: 12px 10px 76px; border-radius: var(--r1); background: #0B0C0E; border: 1px solid #1E2124; padding: 8px; font: 9.5px/1.55 var(--mono); color: #94A3B8; direction: ltr; text-align: left; overflow: hidden; }
.w-reel .cap { position: relative; padding: 12px; font-size: 11.5px; color: #fff; line-height: 1.5; }
.w-reel .bar { position: absolute; bottom: 0; left: 0; right: 0; height: 3px; background: rgba(255, 255, 255, .2); }
.w-reel .bar span { display: block; width: 0; height: 100%; background: #00FFC3; animation: reelbar 6s linear infinite; }
@keyframes reelbar { to { width: 100%; } }
.w-legend { display: flex; flex-wrap: wrap; gap: 10px 22px; color: var(--muted); font-size: 14px; list-style: none; padding: 0; margin: 0; }
.w-legend li { display: inline-flex; align-items: center; gap: 8px; }
.w-legend .i { color: var(--acc); width: 18px; height: 18px; }

@media (max-height: 820px) { .w-stage { display: none; } }
/* جانب الدخول */
.w-side { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; padding: 20px clamp(20px, 3vw, 40px) 28px; }
.w-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.w-top .w-brand { visibility: hidden; }
.w-card-form { width: 100%; max-width: 400px; margin: auto; padding: 32px 0; }
.w-card-form h2 { font-size: 28px; letter-spacing: -.01em; }
.w-card-form > .muted { margin: 6px 0 24px; font-size: 15px; }
.w-card-form .alert { margin-bottom: 18px; }
.w-card-form .field { margin-bottom: 16px; }
.w-card-form .btn.lg { margin-top: 6px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--soft); border: 1px solid var(--line2); border-radius: var(--pill); padding: 4px; margin-bottom: 22px; }
.seg a { text-align: center; padding: 8px; border-radius: var(--pill); font-size: 14px; color: var(--muted); font-weight: 600; transition: background .15s, color .15s; }
.seg a:hover { color: var(--text); }
.seg a.on { background: var(--bg); color: var(--text); box-shadow: var(--shadow-sm); }
/* حقل بأيقونة */
.input-ic { position: relative; }
.input-ic > .i { position: absolute; top: 50%; transform: translateY(-50%); inset-inline-start: 14px; color: var(--dim); pointer-events: none; }
/* الصفحة RTL دائمًا والحقول LTR: الأيقونة يمين والزر يسار، فالحشو بالاتجاه الفعلي */
.input-ic > .input { padding-right: 42px; height: 48px; }
.input-ic > .input:focus ~ .i, .input-ic:focus-within > .i { color: var(--acc); }
.input-ic .pw-eye { position: absolute; top: 50%; transform: translateY(-50%); inset-inline-end: 6px; }
.input-ic:has(.pw-eye) > .input { padding-left: 46px; }
.hint.caps { color: var(--amber); display: inline-flex; align-items: center; gap: 4px; }
.dev-note { margin-top: 24px; border: 1px solid var(--line2); border-radius: var(--r2); padding: 0 14px; }
.dev-note summary { display: flex; align-items: center; gap: 10px; padding: 12px 0; cursor: pointer; list-style: none; }
.dev-note summary::-webkit-details-marker { display: none; }
.dev-note summary::after { content: ""; margin-inline-start: auto; width: 8px; height: 8px; border: solid var(--dim); border-width: 0 0 1.5px 1.5px; transform: rotate(-45deg); transition: transform .15s; }
.dev-note[open] summary::after { transform: rotate(135deg); }
.dev-note[open] { padding-bottom: 14px; }
.dev-note p { margin: 0 0 12px; }
.w-foot { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.w-nums { display: flex; gap: 22px; font-size: 13px; color: var(--dim); }
.w-nums b { color: var(--text); font-size: 15px; margin-inline-end: 4px; font-variant-numeric: tabular-nums; }
.legal { font-size: 12.5px; color: var(--dim); margin: 0; }
.legal a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.onboard { max-width: 660px; margin: 0 auto; padding: 40px 20px 80px; }
.onboard fieldset { border: 0; padding: 0; margin: 0 0 30px; }
.onboard legend { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.onboard legend + .muted { margin-bottom: 16px; font-size: 14px; }
.ava-choice { display: flex; gap: 12px; flex-wrap: wrap; }
.ava-choice label { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r2); cursor: pointer; font-size: 12.5px; color: var(--muted); width: 116px; }
.ava-choice input { position: absolute; opacity: 0; }
.ava-choice input:checked + label { border-color: var(--acc); color: var(--acc); background: var(--acc-dim); }
.ava-choice img { width: 58px; height: 58px; border-radius: 50%; object-fit: cover; }
.page-doc { max-width: 760px; padding: 24px var(--pad) 60px; }
.page-doc h1 { margin-bottom: 8px; }
.page-doc h2 { margin: 28px 0 10px; font-size: 19px; }
.page-doc p, .page-doc li { color: var(--muted); }
.err-page { min-height: 72vh; display: grid; place-items: center; text-align: center; padding: 40px 16px; }
.err-code { font: 700 104px/1 var(--mono); color: var(--acc); letter-spacing: -.05em; }
.err-page h1 { margin: 14px 0 8px; }
.err-page p { color: var(--muted); max-width: 420px; margin: 0 auto 24px; }
.err-acts { justify-content: center; }
.filter-chips { padding: 12px var(--pad); border-bottom: 1px solid var(--line2); }
.pager { padding: 8px var(--pad); }
.readme-input { min-height: 240px; }
.icon-chip { width: 44px; height: 44px; border-radius: var(--r2); display: grid; place-items: center; background: var(--acc-dim); color: var(--acc); flex: none; }

/* عناصر الجوال (مخفية على الكمبيوتر) */
.tabbar, .fab, .side-drawer, .drawer-bg { display: none; }

/* ==========================================================================
   التجاوب
   ========================================================================== */
@media (max-width: 1260px) {
  :root { --rail: 300px; --nav: 230px; }
}
@media (max-width: 1120px) {
  .shell { grid-template-columns: 80px minmax(0, var(--main)) var(--rail); gap: 0 20px; }
  .shell.wide, .shell.full, .shell.admin { grid-template-columns: 80px minmax(0, 1fr); }
  .nav { align-items: center; }
  .nav .lbl, .brand span, .nav-me .who, .nav-dev { display: none; }
  .nav-a { padding: 12px; width: auto; }
  .nav-a .badge { position: absolute; top: 4px; inset-inline-end: 2px; margin: 0; }
  .post-btn { width: 52px !important; height: 52px; padding: 0; border-radius: 50% !important; }
  .brand { padding: 6px 0 16px; }
  .nav-me { padding: 6px; width: auto; }
  .nav-sep { width: 32px; }
  .welcome { grid-template-columns: minmax(0, 1fr) minmax(380px, 1fr); }
  .w-stage { display: none; }
  .set-two { grid-template-columns: 1fr; }
  .set-prev { position: static; order: -1; }
}
@media (max-width: 980px) {
  /* الدخول: النموذج أولًا والتعريف يختفي */
  .welcome { grid-template-columns: 1fr; }
  .w-art { display: none; }
  .w-top .w-brand { visibility: visible; }
  .w-side { padding-top: calc(16px + var(--safe-t)); padding-bottom: calc(24px + var(--safe-b)); }
  .shell { grid-template-columns: 80px minmax(0, 1fr); max-width: 780px; }
  .rail { display: none; }
  .repo-grid { grid-template-columns: 1fr; }
  .set-grid { grid-template-columns: 1fr; gap: 16px; }
  .set-nav { position: static; flex-direction: row; overflow-x: auto; scrollbar-width: none; margin-inline: calc(var(--pad) * -1); padding-inline: var(--pad); }
  .set-nav::-webkit-scrollbar { display: none; }
  .set-nav a { white-space: nowrap; flex: none; }
  .dm { grid-template-columns: 300px minmax(0, 1fr); }
  .file-row { grid-template-columns: 22px minmax(0, 1fr) auto; }
  .file-row .fm { display: none; }
}

/* ——— الجوال: تجربة تطبيق ——— */
@media (max-width: 680px) {
  :root { --pad: 14px; --bar: 54px; }
  html { scroll-padding-top: 64px; }
  body { overscroll-behavior-y: none; }
  .shell, .shell.wide, .shell.full, .shell.admin { display: block; padding: 0; max-width: none; }
  .nav { display: none; }
  main { border: 0; min-height: 100dvh; padding-bottom: calc(var(--tab) + var(--safe-b) + 24px); }
  .lay-full main { padding-bottom: 0; }

  /* الرأس = شريط التطبيق */
  .head { padding-top: var(--safe-t); }
  .head-in { min-height: var(--bar); gap: 6px; }
  .head-t h1 { font-size: 17.5px; }
  .icon-btn.me-btn { display: inline-grid; }
  .me-btn img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }

  /* شريط التبويبات السفلي */
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; bottom: 0; inset-inline: 0; z-index: 70;
    height: calc(var(--tab) + var(--safe-b)); padding-bottom: var(--safe-b);
    background: var(--glass); -webkit-backdrop-filter: saturate(160%) blur(18px); backdrop-filter: saturate(160%) blur(18px);
    border-top: 1px solid var(--line2);
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--dim); position: relative; font-size: 10.5px; font-weight: 600; }
  .tabbar a .i { width: 25px; height: 25px; transition: transform .12s; }
  .tabbar a.on { color: var(--text); }
  .tabbar a.on .i { color: var(--acc); stroke-width: 2.2; }
  .tabbar a:active .i { transform: scale(.86); }
  .tabbar .badge { position: absolute; top: 5px; left: calc(50% - 22px); }

  /* زر النشر العائم */
  .fab {
    display: grid; place-items: center; position: fixed; z-index: 65;
    bottom: calc(var(--tab) + var(--safe-b) + 16px); inset-inline-end: 16px;
    width: 56px; height: 56px; border-radius: 50%; background: var(--acc); color: var(--acc-ink);
    box-shadow: 0 8px 24px var(--acc-glow), var(--shadow); transition: transform .15s;
  }
  .fab:active { transform: scale(.92); }
  .fab:hover { color: var(--acc-ink); }
  .fab .i { width: 26px; height: 26px; stroke-width: 2.2; }
  .lay-full .fab, .no-fab .fab { display: none; }

  /* الدرج الجانبي */
  .drawer-bg { display: block; position: fixed; inset: 0; z-index: 90; background: var(--overlay); opacity: 0; pointer-events: none; transition: opacity .25s; }
  .side-drawer {
    display: flex; flex-direction: column; position: fixed; inset-block: 0; right: 0; z-index: 95;
    width: min(320px, 84vw); background: var(--bg); border-left: 1px solid var(--line2);
    transform: translateX(100%); transition: transform .28s var(--ease);
    padding: calc(var(--safe-t) + 18px) 0 calc(var(--safe-b) + 14px); overflow-y: auto;
  }
  .drawer-open .side-drawer { transform: none; }
  .drawer-open .drawer-bg { opacity: 1; pointer-events: auto; }
  .drawer-open { overflow: hidden; }

  /* القوائم المنبثقة تصبح ورقة سفلية */
  .menu, .menu.up {
    position: fixed; inset: auto 0 0 0; top: auto; z-index: 120;
    min-width: 0; padding: 8px 10px calc(var(--safe-b) + 12px);
    border-radius: 18px 18px 0 0; border: 0; border-top: 1px solid var(--line);
    animation: sheet .24s var(--ease);
  }
  .menu::before { content: ""; display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 2px auto 10px; }
  .menu a, .menu button { padding: 14px 12px; font-size: 16px; }
  .sheet-bg { display: block; position: fixed; inset: 0; z-index: 110; background: var(--overlay); animation: fade .2s; }

  /* النوافذ تصبح أوراقًا سفلية */
  dialog { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 20px 20px 0 0; border-inline: 0; border-bottom: 0; max-height: 92dvh; padding-bottom: var(--safe-b); }
  dialog[open] { animation: sheet .26s var(--ease); }
  .grab { display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 8px auto 0; }

  .input, select.input, textarea.input { font-size: 16px; }
  .composer textarea { font-size: 17px; }
  .post-meta .name { max-width: 48%; }
  .acts { max-width: none; }
  .post.big .post-text { font-size: 17px; }
  .cover { height: 132px; }
  .av.xl { width: 88px; height: 88px; }
  .prof-top { margin-top: -44px; }
  .prof-name { font-size: 20px; }
  .thread-row { gap: 12px; }
  .thread-nums { width: 70px; }
  .replies { margin-inline-start: 6px; padding-inline-start: 14px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .w-card-form { padding: 24px 0 32px; }
  .w-card-form h2 { font-size: 25px; }
  #toasts { bottom: calc(var(--tab) + var(--safe-b) + 84px); }
  .lay-full #toasts, .lay-bare #toasts { bottom: calc(24px + var(--safe-b)); }

  /* الفيديوهات بملء الشاشة */
  .reel { padding: 0; }
  .reel-frame { width: 100%; height: 100%; border-radius: 0; aspect-ratio: auto; box-shadow: none; }
  .reel-side { position: absolute; inset-inline-end: 10px; bottom: calc(var(--tab) + var(--safe-b) + 70px); z-index: 6; padding: 0; gap: 18px; }
  .reel-btn { color: #fff; text-shadow: 0 1px 4px rgba(0, 0, 0, .7); }
  .reel-btn .ic { background: rgba(0, 0, 0, .3); width: 46px; height: 46px; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
  .reel-side .av-link img { border-color: #fff; width: 46px; height: 46px; }
  .reel-info { padding: 60px 76px calc(var(--tab) + var(--safe-b) + 20px) 14px; }
  .reel-bar { bottom: calc(var(--tab) + var(--safe-b)); }
  .reel-up { top: calc(var(--safe-t) + 10px); inset-inline: 10px; justify-content: space-between; }
  .reel-top { top: calc(var(--safe-t) + 62px); }
  .lay-full .tabbar { background: rgba(0, 0, 0, .92); border-color: rgba(255, 255, 255, .08); }
  .lay-full .tabbar a { color: rgba(255, 255, 255, .55); }
  .lay-full .tabbar a.on { color: #fff; }
  .drawer-panel { inset: auto 0 0 0; width: 100vw; height: 72dvh; border-radius: 18px 18px 0 0; border: 0; transform: translateY(100%); }
  .drawer-panel.open { transform: none; }

  .vgrid { grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 2px 0; }
  .vtile { border-radius: 0; }
  .upload-page form { grid-template-columns: 1fr; }
  .drop { max-height: 52vh; margin: 0 auto; width: auto; }

  .dm { grid-template-columns: 1fr; height: calc(100dvh - var(--tab) - var(--safe-b)); }
  .dm.in-chat { height: 100dvh; }
  .dm.in-chat .dm-list { display: none; }
  .dm:not(.in-chat) .dm-chat { display: none; }
  .dm-back { display: inline-grid; }
  .in-chat-page .tabbar, .in-chat-page .fab { display: none; }
  .in-chat-page main { padding-bottom: 0; }
  .dm-form { padding-bottom: calc(10px + var(--safe-b)); }

  .repo-title { font-size: 18px; }
  .readme-body { padding: 16px; }
  .file-row { padding: 11px 12px; }
  .editor textarea { min-height: 52dvh; }
  .stat .v { font-size: 26px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .table th, .table td { padding: 10px; }
  .adm-acts { grid-template-columns: 1fr; }
  .err-code { font-size: 80px; }
}
@keyframes sheet { from { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }

/* الدرج: محتوى */
.sd-head { padding: 0 20px 14px; border-bottom: 1px solid var(--line2); }
.sd-head .av { width: 48px; height: 48px; }
.sd-name { font-weight: 700; font-size: 17px; margin-top: 10px; display: flex; align-items: center; gap: 4px; }
.sd-nums { display: flex; gap: 16px; margin-top: 10px; font-size: 14px; color: var(--muted); }
.sd-nums b { color: var(--text); margin-inline-end: 4px; }
.sd-link { display: flex; align-items: center; gap: 16px; padding: 13px 20px; font-size: 17px; font-weight: 600; background: none; border: 0; width: 100%; text-align: start; cursor: pointer; color: var(--text); }
.sd-link .i { width: 24px; height: 24px; }
.sd-link:active { background: var(--soft); }
.sd-link .badge { margin-inline-start: auto; }
.sd-sep { height: 1px; background: var(--line2); margin: 6px 20px; }
.sd-foot { margin-top: auto; padding: 14px 20px 0; }

@media (hover: none) {
  .post.link-card:hover, .user-row:hover, .thread-row:hover, .repo-card:hover { background: none; }
  .post.link-card:active { background: var(--soft); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
@media (max-width: 680px) { .composer-wrap { display: none; } }
.typing { margin-inline: 16px; }
.seg-inline { display: inline-grid; margin: 0; } .seg-inline a { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 16px; } .drop-wide { aspect-ratio: auto; min-height: 160px; }
.offline-logo { margin: 0 auto 16px; border-radius: 14px; }
.code-view .codebox-head { display: none; }
.reel-side .menu.up { inset-inline-start: auto; inset-inline-end: 0; }
@media (max-width: 680px) { .reel-side { gap: 12px; } .reel-btn { font-size: 11.5px; } .reel-btn .ic { width: 44px; height: 44px; } }

/* ==========================================================================
   الشارات (Badges)
   ========================================================================== */
.ubs { display: inline-flex; align-items: center; gap: 2px; flex: none; vertical-align: middle; }
.ub {
  position: relative; display: inline-grid; place-items: center; flex: none;
  width: 20px; height: 20px; border-radius: 6px; cursor: default; outline-offset: 1px;
  color: var(--b, var(--muted));
}
.ub svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ub.more { width: auto; min-width: 20px; padding: 0 5px; font: 700 10.5px/20px var(--font); color: var(--muted); background: var(--soft); border-radius: var(--pill); }
.ub-founder { --b: var(--gold); }
.ub-admin { --b: var(--red); }
.ub-moderator { --b: var(--blue); }
.ub-verified { --b: var(--verified); }
.ub-developer { --b: var(--purple); }
.ub-contributor { --b: var(--green); }
.ub-bug_hunter { --b: var(--orange); }
.ub-early { --b: var(--pink); }
.ub-vip { --b: var(--gold); }
/* شريط الشارات في الملف الشخصي (مثل بطاقة Discord) */
.ubs.full { gap: 4px; padding: 3px 6px; border: 1px solid var(--line2); background: var(--soft); border-radius: var(--r2); }
.ubs.full .ub { width: 24px; height: 24px; }
.ubs.full .ub svg { width: 20px; height: 20px; }
.ub.lg { width: 36px; height: 36px; border-radius: var(--r2); background: color-mix(in srgb, var(--b) 12%, transparent); }
.ub.lg svg { width: 22px; height: 22px; }
/* التلميح: عند المرور أو التركيز أو اللمس */
.ub[data-tip]::after {
  content: attr(data-tip); display: none; position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translate(-50%, 4px);
  width: max-content; max-width: 240px; padding: 6px 10px; border-radius: var(--r1);
  background: var(--text); color: var(--bg); font: 600 12px/1.45 var(--font); text-align: center; white-space: normal;
  pointer-events: none; z-index: 80; transform: translate(-50%, 0); animation: tipin .12s var(--ease);
}
/* يُرسم عند الظهور فقط، فلا يسبب تمريرًا أفقيًا عند حواف الشاشة */
.ub[data-tip]:hover::after, .ub[data-tip]:focus-visible::after, .ub.tip-on::after { display: block; }
@keyframes tipin { from { opacity: 0; transform: translate(-50%, 4px); } }
.badge-admin { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 8px; }
.badge-line { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line2); border-radius: var(--r2); }
.badge-line.has { border-color: var(--line); background: var(--wash); }
.badge-line form { margin: 0; }

/* ——— حسابات التواصل في الملف ——— */
.prof-sub { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.prof-sub .handle { color: var(--dim); font-size: 15px; }
.soc-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.soc {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px 0 10px;
  border: 1px solid var(--line); border-radius: var(--pill); font-size: 13.5px; color: var(--text);
  transition: border-color .15s, background .15s;
}
.soc:hover { border-color: var(--line-hover); background: var(--soft); color: var(--text); }
.soc .i { width: 17px; height: 17px; color: var(--muted); }
.soc-n { font-weight: 600; }
.soc-h { color: var(--muted); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.soc-field .input-pre > span { min-width: 112px; justify-content: flex-start; gap: 8px; display: flex; align-items: center; font-family: var(--font); font-weight: 600; color: var(--text); }
.soc-field .input-pre > span .i { width: 17px; height: 17px; color: var(--muted); }

/* ——— اختيار السمة ——— */
.theme-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.theme-pick input { position: absolute; opacity: 0; pointer-events: none; }
.theme-opt { display: flex; flex-direction: column; gap: 4px; padding: 10px 10px 12px; border: 1px solid var(--line); border-radius: var(--r3); cursor: pointer; transition: border-color .15s, background .15s; }
.theme-opt:hover { border-color: var(--line-hover); }
.theme-pick input:checked + .theme-opt { border-color: var(--acc); box-shadow: 0 0 0 1px var(--acc); }
.theme-pick input:focus-visible + .theme-opt { outline: 2px solid var(--acc); outline-offset: 2px; }
.theme-opt b { font-size: 14px; display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.theme-opt b .i { width: 16px; height: 16px; color: var(--muted); }
.theme-pick input:checked + .theme-opt b .i { color: var(--acc); }
.theme-opt .d { font-size: 12.5px; color: var(--dim); }
/* معاينات ثابتة الألوان عمدًا: تعرض شكل كل سمة بغض النظر عن السمة الحالية */
.tprev { display: grid; grid-template-columns: 28% 1fr; gap: 6px; height: 74px; padding: 8px; border-radius: var(--r2); border: 1px solid; overflow: hidden; }
.tprev i { display: block; border-radius: 3px; }
.tprev .c { display: flex; flex-direction: column; gap: 5px; }
.tprev.dark { background: #000; border-color: #2F3336; }
.tprev.dark i { background: #16181C; } .tprev.dark i.a { background: #00FFC3; width: 46%; height: 8px; } .tprev.dark i.t { background: #F5F7FA; height: 6px; width: 80%; } .tprev.dark i.m { background: #2F3336; height: 6px; }
.tprev.light { background: #fff; border-color: #DCE1E6; }
.tprev.light i { background: #F3F5F7; } .tprev.light i.a { background: #007F64; width: 46%; height: 8px; } .tprev.light i.t { background: #0F1419; height: 6px; width: 80%; } .tprev.light i.m { background: #DCE1E6; height: 6px; }
.tprev.system { padding: 0; grid-template-columns: 1fr 1fr; gap: 0; border-color: #2F3336; }
.tprev.system > span { display: flex; flex-direction: column; gap: 5px; padding: 8px; }
.tprev.system > span:first-child { background: #000; } .tprev.system > span:last-child { background: #fff; }
.tprev.system > span:first-child i { background: #2F3336; height: 6px; } .tprev.system > span:first-child i.a { background: #00FFC3; width: 60%; height: 8px; }
.tprev.system > span:last-child i { background: #DCE1E6; height: 6px; } .tprev.system > span:last-child i.a { background: #007F64; width: 60%; height: 8px; }

/* ——— حالة الحفظ وأخطاء الحقول ——— */
.saved-state { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--acc); opacity: 0; transform: translateX(6px); transition: opacity .2s, transform .2s; }
.saved-state .i { width: 16px; height: 16px; }
.saved-state.show { opacity: 1; transform: none; }
.field-err { color: var(--red); font-size: 12.5px; font-weight: 500; margin-top: 4px; display: flex; align-items: center; gap: 6px; }
.cmt-form .field-err { position: absolute; bottom: -2px; inset-inline-start: 56px; }
.cmt-form { position: relative; }
.cedit-form { padding: 6px 0 4px !important; border: 0 !important; flex-direction: column; align-items: stretch; }
.cedit-form .row { justify-content: flex-end; }
form[aria-busy="true"] textarea { opacity: .7; }
.gap-s { gap: 6px; }
@media (max-width: 680px) {
  .theme-pick { grid-template-columns: 1fr 1fr; }
  .theme-pick > :nth-last-child(-n+2) { grid-column: 1 / -1; }
  .ub[data-tip]::after { max-width: 200px; }
}
.shake { animation: shake .32s var(--ease); }
@keyframes shake { 25% { transform: translateX(-5px); } 50% { transform: translateX(4px); } 75% { transform: translateX(-2px); } }
a.btn.busy { pointer-events: none; opacity: .7; }
.name-line { gap: 4px; min-width: 0; }
.name-line > a { gap: 3px; min-width: 0; }
.handle-line { text-align: right; }
.cmt-form textarea, .dm-form textarea, .cedit-form textarea { resize: none; }
.box-more { display: block; padding: 12px 16px; font-size: 14px; color: var(--acc); border-top: 1px solid var(--line2); }
.box-more:hover { background: var(--wash); color: var(--acc); }
/* ——— البحث ——— */
.search-box .search-x { position: absolute; top: 50%; transform: translateY(-50%); inset-inline-end: 6px; }
.search-box .search-x .i { position: static; transform: none; }
.search-box:has(.search-x:not([hidden])) .input { padding-inline-end: 42px; }
.search-box .input::-webkit-search-cancel-button { display: none; }
.search-sum { padding: 14px var(--pad) 0; margin: 0; font-size: 14px; color: var(--muted); }
.search-sum b { color: var(--text); }
.recent-list { display: flex; flex-direction: column; padding: 0 8px 4px; }
.recent-row { display: flex; align-items: center; gap: 4px; border-radius: var(--r2); }
.recent-row:hover { background: var(--wash); }
.recent-row a { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 10px 8px; font-size: 15px; }
.recent-row a .i { color: var(--dim); }
.recent-row a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-tips { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; padding: 0 var(--pad) 24px; }
.search-tips .tip { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--line2); border-radius: var(--r3); background: var(--card); }
.search-tips .icon-chip { width: 38px; height: 38px; }
.search-tips b { font-size: 14.5px; }
.search-tips p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }

/* ==========================================================================
   التسجيلات الصوتية، الوسائط في الرسائل، والمشاركة
   ========================================================================== */
/* مشغل التسجيل */
.vplayer { display: flex; align-items: center; gap: 10px; min-width: 220px; max-width: 320px; padding: 6px 12px 6px 6px; margin-top: 6px; border-radius: var(--pill); background: var(--soft); border: 1px solid var(--line2); color: var(--text); direction: rtl; }
.vp-btn { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 0; background: var(--acc); color: var(--acc-ink); cursor: pointer; transition: transform .1s; }
.vp-btn:active { transform: scale(.92); }
.vp-btn .i { width: 18px; height: 18px; }
.vp-bar { flex: 1; height: 6px; border-radius: 3px; background: var(--line); position: relative; cursor: pointer; overflow: hidden; }
.vp-bar span { position: absolute; inset-block: 0; right: 0; width: 0; background: var(--acc); border-radius: 3px; }
.vp-bar:focus-visible { outline: 2px solid var(--acc); outline-offset: 3px; }
.vp-t { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 34px; text-align: left; direction: ltr; }
.vplayer audio { display: none; }
/* داخل فقاعتي (خلفية بلون التمييز) */
.bubble.mine .vplayer { background: rgba(0, 0, 0, .12); border-color: transparent; color: var(--acc-ink); }
.bubble.mine .vp-btn { background: var(--acc-ink); color: var(--acc); }
.bubble.mine .vp-bar { background: rgba(0, 0, 0, .2); }
.bubble.mine .vp-bar span { background: var(--acc-ink); }
.bubble.mine .vp-t { color: var(--acc-ink); opacity: .8; }

/* شريط التسجيل */
.mic-btn { color: var(--muted); }
.mic-btn:hover { color: var(--acc); }
form[data-recording] { position: relative; }
form[data-recording] > :not(.rec-bar):not([type="hidden"]) { visibility: hidden; }
.rec-bar { position: absolute; inset: 0; display: flex; align-items: center; gap: 10px; padding: 0 var(--pad); background: var(--bg); z-index: 2; animation: fade .15s; }
.cmt-form .rec-bar, .dm-form .rec-bar { padding-inline: 10px; }
.rec-bar .icon-btn { color: var(--red); }
.rec-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--red); animation: recpulse 1s ease-in-out infinite; flex: none; }
@keyframes recpulse { 50% { opacity: .3; } }
.rec-t { font-weight: 700; font-variant-numeric: tabular-nums; direction: ltr; min-width: 40px; }
.rec-hint { flex: 1; color: var(--muted); font-size: 13.5px; }

/* الرسائل: وسائط وبطاقات */
.bubble.has-media { padding: 5px; max-width: min(82%, 380px); }
.bubble.has-media .b-text { padding: 4px 9px 3px; }
.bubble > :first-child { margin-top: 0; }
.b-imgs { display: grid; gap: 3px; border-radius: 15px; overflow: hidden; }
.b-imgs.n2, .b-imgs.n3, .b-imgs.n4 { grid-template-columns: 1fr 1fr; }
.b-imgs.n3 a:first-child { grid-row: span 2; }
.b-imgs img { width: 100%; height: 100%; max-height: 360px; object-fit: cover; background: var(--soft); }
.b-imgs.n2 img, .b-imgs.n3 img, .b-imgs.n4 img { aspect-ratio: 1; }
.b-card { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); color: var(--text); min-width: 220px; text-align: start; }
.b-card:hover { border-color: var(--line-hover); color: var(--text); }
.b-card + .b-text, .b-imgs + .b-text, .vplayer + .b-text { margin-top: 4px; }
.b-thumb { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; flex: none; background: var(--soft); }
.b-thumb.tall { height: 86px; }
.b-thumb.round { border-radius: 50%; width: 52px; height: 52px; }
.b-ic { width: 52px; height: 52px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--acc-dim); color: var(--acc); }
.b-info { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.b-kind { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--dim); font-weight: 600; }
.b-kind .i { width: 13px; height: 13px; }
.b-info b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-sub { font-size: 13px; color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.b-card.gone { color: var(--dim); font-size: 13.5px; }
.bubble.mine .b-card { background: var(--bg); }
.dm-thumbs { display: flex; gap: 8px; padding: 10px 12px 0; border-top: 1px solid var(--line2); overflow-x: auto; }
.dm-thumbs .thumb { width: 72px; height: 72px; flex: none; }
.dm-form > label.icon-btn { cursor: pointer; }
.dm-form textarea { flex: 1; }

/* نافذة المشاركة */
.send-preview:empty { display: none; }
.send-list { display: flex; flex-direction: column; max-height: min(46dvh, 380px); overflow-y: auto; margin-inline: -8px; }
.send-row { display: flex; align-items: center; gap: 12px; padding: 9px 8px; border-radius: var(--r2); }
.send-row:hover { background: var(--wash); }
.send-row b { font-size: 14.5px; }
.send-empty { color: var(--muted); text-align: center; padding: 28px 12px; font-size: 14px; margin: 0; }
.send-foot { justify-content: flex-start; flex-wrap: wrap; }
.cmt-text[hidden] + .vplayer { margin-top: 2px; }
/* عناصر المحادثة لا تنكمش داخل العمود المرن (كانت الوسائط تنضغط) */
.dm-msgs > * { flex-shrink: 0; }
.rec-bar .btn { flex: none; }
.rec-bar .rec-hint { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.send-row .grow { display: flex; flex-direction: column; line-height: 1.35; }
.send-row .grow .dim { direction: ltr; text-align: right; }
@media (max-width: 680px) {
  .rec-bar .rec-hint { display: none; }
  .rec-bar .btn { margin-inline-start: auto; }
  .vplayer { min-width: 200px; }
}
.bubble.mine .b-card, .bubble.mine .b-card:hover { color: var(--text); text-decoration: none; }
.dm-form .rec-bar .btn { width: auto; height: 36px; padding: 0 14px; }

/* ==========================================================================
   المساحات الصوتية (Spaces) — بألوان الموقع: أسود صافي في الداكن وأبيض صافي في الفاتح
   اللمسة البنفسجية خاصة بالمساحات فقط (كما في X)
   ========================================================================== */
:root { --sp: #7856FF; --sp-2: #5B3BEA; --sp-soft: rgba(120, 86, 255, .14); --sp-line: rgba(140, 112, 255, .45); --amber-hand: #FFB547; }

/* بطاقة المساحة في القوائم */
.sp-card { display: block; margin: 12px 16px; padding: 14px 16px; border: 1px solid var(--line2); background: var(--card); border-radius: 16px; color: var(--text); transition: background .15s, border-color .15s; }
.sp-card:hover { background: var(--soft); color: var(--text); border-color: var(--line); }
.sp-card.live { border-color: var(--sp-line); }
.sp-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--sp); }
.sp-tag.off { color: var(--dim); }
.sp-dot { opacity: .6; }
.sp-title { font-size: 17px; line-height: 1.5; margin: 8px 0 12px; font-weight: 700; overflow-wrap: anywhere; }
.sp-who { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--muted); }
.sp-who b { color: var(--text); }
.sp-mute { opacity: .85; }
.sp-avs { display: inline-flex; flex: none; }
.sp-avs .av { border: 2px solid var(--card); margin-inline-start: -8px; }
.sp-avs .av:first-child { margin-inline-start: 0; }
.sp-eq { display: inline-flex; gap: 2px; align-items: flex-end; height: 12px; }
.sp-eq i { width: 3px; background: currentColor; border-radius: 2px; animation: sp-eq 1s ease-in-out infinite; }
.sp-eq i:nth-child(1) { height: 6px; }
.sp-eq i:nth-child(2) { height: 12px; animation-delay: .2s; }
.sp-eq i:nth-child(3) { height: 8px; animation-delay: .4s; }
@keyframes sp-eq { 50% { transform: scaleY(.45); } }
.sp-h { font-size: 15px; color: var(--muted); padding: 16px 16px 0; font-weight: 600; }
.sp-page-list { padding-bottom: 24px; }

/* شريط المساحات المباشرة أعلى الرئيسية (مثل Spacebar في X) */
.sp-strip { display: flex; gap: 14px; overflow-x: auto; padding: 12px 16px; border-bottom: 1px solid var(--line2); scrollbar-width: none; }
.sp-strip::-webkit-scrollbar { display: none; }
.sp-pill { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 76px; flex: none; color: var(--text); }
.sp-pill:hover { color: var(--text); }
.sp-ring { position: relative; display: flex; align-items: center; justify-content: center; min-width: 64px; height: 52px; padding: 0 8px; border-radius: 26px; background: linear-gradient(135deg, var(--sp), var(--sp-2)); box-shadow: 0 0 0 0 var(--sp-line); animation: sp-ring 2.4s ease-in-out infinite; }
.sp-ring .av { width: 38px; height: 38px; border: 2px solid var(--bg); margin-inline-start: -10px; }
.sp-ring .av:first-child { margin-inline-start: 0; }
.sp-ring .n { position: absolute; bottom: -4px; inset-inline-end: -4px; background: var(--bg); color: var(--sp); font-size: 11px; font-weight: 700; border-radius: var(--pill); padding: 0 5px; border: 1px solid var(--sp-line); }
.sp-pl { font-size: 12px; color: var(--muted); max-width: 100%; text-align: center; }
@keyframes sp-ring { 50% { box-shadow: 0 0 0 5px var(--sp-soft); } }

/* ——— غلاف المساحة ——— */
.sp-body { background: var(--bg); }
.sp-shell { position: fixed; inset: 0; z-index: 30; display: flex; align-items: flex-end; justify-content: center; background: var(--bg); }
.sp-frame { position: fixed; inset: 0; width: 100%; height: 100%; border: 0; background: var(--bg); pointer-events: none; }
.sp-dim { position: fixed; inset: 0; background: var(--overlay); -webkit-backdrop-filter: blur(1.5px); backdrop-filter: blur(1.5px); }
.sp-shell.min .sp-dim { display: none; }
.sp-frame[hidden] { display: none; }
.sp-shell.min { background: transparent; pointer-events: none; }
.sp-shell.min .sp-sheet { transform: translateY(110%); visibility: hidden; }
.sp-shell.min .sp-dock, .sp-shell.min .sp-frame { pointer-events: auto; }

.sp-sheet {
  position: relative; width: 100%; max-width: 560px; height: min(92dvh, 820px); display: flex; flex-direction: column;
  background: var(--bg); color: var(--text); border: 1px solid var(--line2); border-bottom: 0; border-radius: 22px 22px 0 0; box-shadow: var(--shadow);
  transition: transform .28s var(--ease), visibility .28s; animation: sp-up-in .3s var(--ease);
}
@keyframes sp-up-in { from { transform: translateY(40px); opacity: 0; } }
.sp-grab { width: 38px; height: 4px; border-radius: 4px; background: var(--line); margin: 8px auto 0; flex: none; }
.sp-head { display: flex; align-items: center; gap: 6px; padding: 8px 12px 8px 14px; flex: none; }
.sp-head-t { min-width: 0; }
.sp-h1 { font-size: 19px; line-height: 1.4; font-weight: 800; margin: 0; }
.sp-sub { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.sp-head-r { display: flex; align-items: center; gap: 4px; flex: none; }
.sp-txt { background: none; border: 0; font: inherit; font-weight: 700; font-size: 15px; color: var(--sp); cursor: pointer; padding: 8px 10px; border-radius: var(--pill); }
.sp-txt:hover { background: var(--sp-soft); }
.sp-txt.red { color: var(--red); }
.sp-txt.red:hover { background: var(--red-dim); }
.sp-txt[hidden] { display: none; }
.sp-scroll { flex: 1; overflow-y: auto; padding: 8px 16px 24px; overscroll-behavior: contain; }
.sp-gate { display: flex; flex-direction: column; gap: 14px; padding-top: 6px; }
.sp-host { display: flex; align-items: center; gap: 12px; color: var(--text); }
.sp-host:hover { color: var(--text); }
.sp-when-box { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: var(--r3); background: var(--soft); border: 1px solid var(--line2); }
.sp-when-box .i { width: 26px; height: 26px; color: var(--sp); }
.sp-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sp-sum > div { background: var(--soft); border-radius: var(--r3); padding: 14px 8px; text-align: center; display: flex; flex-direction: column; gap: 2px; }
.sp-sum b { font-size: 24px; }
.sp-sum span { font-size: 12px; color: var(--muted); }

/* شبكة الحاضرين: متحدثون ثم مستمعون بنفس الحجم */
.sp-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px 4px; align-items: start; }
.sp-tile { display: flex; flex-direction: column; align-items: center; gap: 4px; background: none; border: 0; color: inherit; padding: 6px 2px; cursor: pointer; min-width: 0; font: inherit; border-radius: var(--r3); }
.sp-tile:hover { background: var(--soft); color: inherit; }
.sp-avw { position: relative; display: inline-block; }
.sp-av { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: var(--soft); display: block; }
.sp-tile.speaking .sp-av { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--sp); animation: sp-pulse 1.2s ease-in-out infinite; }
@keyframes sp-pulse { 50% { box-shadow: 0 0 0 2px var(--bg), 0 0 0 7px var(--sp-line); } }
.sp-mb { position: absolute; bottom: -3px; inset-inline-end: -3px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); color: var(--muted); border: 2px solid var(--bg); }
.sp-mb .i { width: 13px; height: 13px; }
.sp-mb.live { background: var(--sp); color: #fff; }
.sp-nm { font-size: 13px; font-weight: 600; max-width: 100%; display: inline-flex; align-items: center; gap: 3px; }
.sp-rl { font-size: 12px; color: var(--dim); }
.sp-hb { position: absolute; top: -3px; inset-inline-start: -3px; width: 22px; height: 22px; border-radius: 50%; background: var(--amber-hand); color: #1B1240; display: grid; place-items: center; border: 2px solid var(--bg); }
.sp-hb .i { width: 12px; height: 12px; }
.sp-plus { align-self: center; justify-self: center; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); color: var(--text); font-weight: 700; font-size: 16px; border: 0; cursor: pointer; font-family: inherit; }
.sp-more { align-self: center; margin-inline-start: 8px; font-size: 13px; color: var(--muted); }

/* شريط الانضمام والتحكم */
.sp-joinbar { flex: none; padding: 10px 16px calc(14px + var(--safe-b)); border-top: 1px solid var(--line2); display: flex; flex-direction: column; gap: 10px; }
.sp-join { height: 50px; border: 0; border-radius: var(--pill); background: linear-gradient(90deg, var(--sp), var(--sp-2)); color: #fff; font: inherit; font-weight: 700; font-size: 16px; display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; transition: transform .1s, filter .15s; }
.sp-join:hover { filter: brightness(1.1); }
.sp-join:active { transform: scale(.98); }
.sp-join.busy { opacity: .6; pointer-events: none; }
.sp-ctl { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px calc(12px + var(--safe-b)); border-top: 1px solid var(--line2); background: var(--bg); }
.sp-ctl[hidden] { display: none; }
.sp-ctl-l, .sp-ctl-r { display: flex; align-items: center; gap: 6px; }
.sp-act-w { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 58px; }
.sp-act-w[hidden] { display: none; }
.sp-act { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); border: 1px solid var(--line2); color: var(--text); cursor: pointer; transition: background .15s, transform .1s; }
.sp-act:hover { background: var(--hover); }
.sp-act:active { transform: scale(.94); }
.sp-act.mic:not(.off) { background: var(--sp); border-color: var(--sp); color: #fff; }
.sp-act.on { background: var(--amber-hand); border-color: var(--amber-hand); color: #1B1240; }
.sp-act-l { font-size: 12px; color: var(--muted); }
.sp-ic { position: relative; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: none; border: 0; color: var(--text); cursor: pointer; }
.sp-ic:hover { background: var(--soft); }
.sp-ic.sm { width: 38px; height: 38px; }
.sp-ic.on { color: var(--sp); }
.sp-ic .badge { position: absolute; top: 0; inset-inline-end: 0; }
.sp-tray-wrap { position: relative; }
.sp-tray { position: absolute; bottom: 52px; inset-inline-end: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; padding: 8px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); z-index: 8; }
.sp-tray[hidden] { display: none; }
.sp-tray button { font-size: 26px; width: 44px; height: 44px; border-radius: 12px; background: none; border: 0; cursor: pointer; }
.sp-tray button:hover { background: var(--soft); }
.sp-ctl .menu-wrap { position: relative; }
.sp-ctl .menu { inset-inline-end: 0; inset-inline-start: auto; min-width: 210px; }

/* شريط التصغير */
.sp-dock { position: fixed; bottom: 0; inset-inline: 0; height: 64px; z-index: 31; display: flex; align-items: center; gap: 4px; padding: 0 12px calc(0px + var(--safe-b)); background: var(--card); border-top: 1px solid var(--line); box-sizing: content-box; }
.sp-dock[hidden] { display: none; }
.sp-dock-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; background: none; border: 0; color: var(--text); font: inherit; text-align: start; cursor: pointer; padding: 6px 4px; }
.sp-dock-main .grow { display: flex; flex-direction: column; min-width: 0; }
.sp-dock .sp-avs .av { border-color: var(--card); width: 30px; height: 30px; }
.sp-shell.min .sp-frame { inset: 0 0 auto 0; height: calc(100% - 64px - var(--safe-b)); pointer-events: auto; }

.sp-invite { position: fixed; inset-inline: 12px; bottom: calc(96px + var(--safe-b)); margin: 0 auto; max-width: 520px; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: 16px; background: linear-gradient(90deg, var(--sp), var(--sp-2)); color: #fff; box-shadow: var(--shadow); }
.sp-invite[hidden] { display: none; }
.sp-invite .btn.pri { background: #fff; border-color: #fff; color: var(--sp-2); }
.sp-invite .btn.ghost { color: #fff; }
.sp-float { position: fixed; bottom: calc(90px + var(--safe-b)); inset-inline: 0; height: 0; pointer-events: none; z-index: 45; }
.sp-fl { position: absolute; bottom: 0; font-size: 34px; animation: sp-up 2.5s ease-out forwards; }
@keyframes sp-up { 0% { transform: translate(0, 0) scale(.6); opacity: 0; } 12% { opacity: 1; } 100% { transform: translate(var(--x, 0), -260px) scale(1.15); opacity: 0; } }

/* قائمة الحاضرين */
.sp-dlg { width: min(520px, calc(100vw - 24px)); }
.sp-tabs { padding: 0 8px; }
.sp-tabs .tab { background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; flex: 1; }
.sp-tabs .tab.on { color: var(--text); }
.sp-tabs .tab[hidden] { display: none; }
.sp-tabs .tab .n { margin-inline-start: 6px; background: var(--sp); color: #fff; border-radius: var(--pill); padding: 0 7px; font-size: 12px; }
.sp-people { padding: 4px 8px 12px; min-height: 160px; }
.sp-prow { border-radius: var(--r2); }
.sp-prow.open { background: var(--soft); }
.sp-pmain { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 8px; background: none; border: 0; color: inherit; cursor: pointer; text-align: start; font: inherit; }
.sp-acts { display: none; flex-wrap: wrap; gap: 6px; padding: 0 8px 10px 8px; }
.sp-acts.show { display: flex; }

@media (max-width: 700px) {
  .sp-shell { align-items: flex-end; }
  .sp-sheet { height: 94dvh; max-width: none; }
}
@media (max-width: 380px) { .sp-av { width: 56px; height: 56px; } .sp-grid { gap: 14px 2px; } }
@media (prefers-reduced-motion: reduce) { .sp-eq i, .sp-tile.speaking .sp-av, .sp-fl, .sp-ring, .sp-sheet { animation: none; } }
.sp-ic .badge { background: var(--sp); color: #fff; }

.sp-card[hidden], .sp-pill[hidden] { display: none; }
