/* ==========================================================================
   صدى — نظام التصميم
   بطاقات عائمة، صور رمزية مربعة الزوايا، ألوان متدرجة، عربي أولًا (RTL)
   ========================================================================== */

/* ---------- الرموز (Tokens) ---------- */
:root {
  --font: "Readex Pro", "IBM Plex Sans Arabic", "Tajawal", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  --fs: 15.5px;
  --r-xl: 28px;
  --r: 20px;
  --r-sm: 14px;
  --r-xs: 10px;
  --gap: 12px;
  --pad: 16px;
  --nav-w: 264px;
  --main-w: 640px;
  --side-w: 340px;
  --ease: cubic-bezier(.2, .8, .2, 1);

  --accent: #0d9488;
  --accent-2: #4f46e5;

  /* فاتح */
  --bg: #f4f2ee;
  --surface: #ffffff;
  --surface-2: #f7f5f1;
  --surface-3: #efece6;
  --border: #e7e2d9;
  --text: #1c1a22;
  --text-2: #4a4652;
  --muted: #77727f;
  --danger: #dc2626;
  --ok: #059669;
  --shadow: 0 1px 2px rgb(30 22 50 / .04), 0 10px 30px -14px rgb(30 22 50 / .16);
  --shadow-lg: 0 18px 50px -12px rgb(30 22 50 / .28);
  --glass: rgb(255 255 255 / .72);
  --aurora: .16;
  color-scheme: light;
}

[data-accent="teal"]    { --accent: #0d9488; --accent-2: #4f46e5; }
[data-accent="violet"]  { --accent: #7c3aed; --accent-2: #db2777; }
[data-accent="coral"]   { --accent: #ea580c; --accent-2: #db2777; }
[data-accent="amber"]   { --accent: #d97706; --accent-2: #dc2626; }
[data-accent="emerald"] { --accent: #059669; --accent-2: #0891b2; }
[data-accent="rose"]    { --accent: #e11d48; --accent-2: #9333ea; }
[data-accent="sky"]     { --accent: #0284c7; --accent-2: #14b8a6; }
[data-accent="indigo"]  { --accent: #4f46e5; --accent-2: #0ea5e9; }

/* غسق */
[data-theme="dusk"] {
  --bg: #13111b; --surface: #1c1928; --surface-2: #232031; --surface-3: #2b273b; --border: #312c44;
  --text: #eeecf5; --text-2: #c9c5d8; --muted: #9590a8; --glass: rgb(28 25 40 / .72);
  --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 12px 30px -14px rgb(0 0 0 / .6);
  --shadow-lg: 0 18px 50px -12px rgb(0 0 0 / .7); --aurora: .22; color-scheme: dark;
}
/* ليلي */
[data-theme="dark"] {
  --bg: #08080a; --surface: #121215; --surface-2: #18181c; --surface-3: #202026; --border: #26262d;
  --text: #f2f2f4; --text-2: #cacad0; --muted: #8e8e98; --glass: rgb(18 18 21 / .75);
  --shadow: 0 1px 2px rgb(0 0 0 / .5), 0 12px 30px -14px rgb(0 0 0 / .8);
  --shadow-lg: 0 18px 50px -12px rgb(0 0 0 / .9); --aurora: .14; color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  [data-theme="auto"] {
    --bg: #13111b; --surface: #1c1928; --surface-2: #232031; --surface-3: #2b273b; --border: #312c44;
    --text: #eeecf5; --text-2: #c9c5d8; --muted: #9590a8; --glass: rgb(28 25 40 / .72);
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 12px 30px -14px rgb(0 0 0 / .6);
    --shadow-lg: 0 18px 50px -12px rgb(0 0 0 / .7); --aurora: .22; color-scheme: dark;
  }
}

:root, [data-accent] {
  --accent-soft: color-mix(in srgb, var(--accent) 13%, transparent);
  --accent-ink: color-mix(in srgb, var(--accent) 82%, var(--text));
  --grad: linear-gradient(135deg, var(--accent), var(--accent-2));
}

[data-size="sm"] { --fs: 14px; }
[data-size="lg"] { --fs: 17px; }
[data-size="xl"] { --fs: 18.5px; }
[data-font="plex"] { --font: "IBM Plex Sans Arabic", system-ui, "Segoe UI", Tahoma, sans-serif; }
[data-font="tajawal"] { --font: "Tajawal", system-ui, "Segoe UI", Tahoma, sans-serif; }
[data-font="system"] { --font: system-ui, -apple-system, "Segoe UI", Tahoma, "Geeza Pro", sans-serif; }
[data-density="compact"] { --gap: 6px; --pad: 12px; }

/* ---------- الأساسيات ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: var(--fs); -webkit-text-size-adjust: 100%; scroll-padding-top: 90px; }
body {
  margin: 0; font-family: var(--font); background: var(--bg); color: var(--text);
  line-height: 1.65; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  min-height: 100vh; overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent-ink); }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; font-weight: 700; }
p { margin: 0 0 .6em; }
code, kbd {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .86em;
  background: var(--surface-3); padding: .1em .45em; border-radius: 6px; direction: ltr; unicode-bidi: isolate;
}
kbd { border: 1px solid var(--border); border-bottom-width: 2px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1em 0; }
::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.i { width: 1.35em; height: 1.35em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.3em; }
.i-sm { width: 1em; height: 1em; }
.seal { width: 1.1em; height: 1.1em; color: var(--accent); flex: none; vertical-align: -.18em; margin-inline-start: .2em; }

.skip { position: absolute; top: -50px; inset-inline-start: 12px; background: var(--accent); color: #fff; padding: 8px 14px; border-radius: 10px; z-index: 100; }
.skip:focus { top: 12px; }

.muted { color: var(--muted); }
.small { font-size: .86em; }
.center { text-align: center; justify-content: center; }
.pad { padding: var(--pad); }
.grow { flex: 1; }
.inline { display: inline-flex; }
.danger { color: var(--danger) !important; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: .05em; }
.linklike { color: var(--accent-ink); font-weight: 500; }
.linklike:hover { text-decoration: underline; }
.new {
  font-style: normal; font-size: .68em; font-weight: 600; padding: .15em .55em; border-radius: 99px;
  background: var(--grad); color: #fff; vertical-align: .15em; margin-inline-start: .3em; white-space: nowrap;
}

/* الخلفية الضبابية الملوّنة */
.aurora { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.aurora span { position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; filter: blur(80px); opacity: var(--aurora); }
.aurora span:first-child { background: var(--accent); top: -30vmax; inset-inline-end: -20vmax; }
.aurora span:last-child { background: var(--accent-2); bottom: -35vmax; inset-inline-start: -25vmax; opacity: calc(var(--aurora) * .7); }

/* ---------- الصور الرمزية ---------- */
.av { border-radius: 32%; object-fit: cover; flex: none; background: var(--surface-3); }
.av-gen {
  display: inline-grid; place-items: center; color: #fff; font-weight: 700; user-select: none;
  background: linear-gradient(135deg, hsl(var(--h) 70% 52%), hsl(calc(var(--h) + 40) 70% 42%));
}
.av-xs { width: 24px; height: 24px; font-size: 11px; border-radius: 30%; }
.av-sm { width: 36px; height: 36px; font-size: 15px; }
.av-md { width: 46px; height: 46px; font-size: 19px; }
.av-lg { width: 56px; height: 56px; font-size: 23px; }
.av-xl { width: 116px; height: 116px; font-size: 46px; border-radius: 30%; }

/* ---------- الأزرار والحقول ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45em; white-space: nowrap;
  padding: .58em 1.25em; border-radius: 99px; font-weight: 600; line-height: 1.2;
  transition: transform .15s var(--ease), box-shadow .2s, background .2s, opacity .2s; border: 1.5px solid transparent;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--accent) 80%, transparent); }
.btn-primary:hover { color: #fff; box-shadow: 0 10px 24px -8px color-mix(in srgb, var(--accent) 90%, transparent); }
.btn-outline { border-color: var(--border); background: var(--surface); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent-ink); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { color: #fff; filter: brightness(1.08); }
.btn-sm { padding: .4em .95em; font-size: .88em; }
.btn-lg { padding: .78em 1.7em; font-size: 1.05em; }
.btn-block { width: 100%; }
.btn-icon { padding: .6em; width: 2.6em; height: 2.6em; }
.btn .i { width: 1.15em; height: 1.15em; vertical-align: 0; }

.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; color: var(--text-2);
  transition: background .15s, color .15s; flex: none;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn.bordered { border: 1.5px solid var(--border); background: var(--surface); width: 40px; height: 40px; }
.icon-btn .i { width: 1.25em; height: 1.25em; }

.input {
  width: 100%; background: var(--surface-2); border: 1.5px solid var(--border); border-radius: var(--r-sm);
  padding: .68em .9em; outline: none; transition: border-color .15s, box-shadow .15s, background .15s; min-width: 0;
}
.input:focus { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 4px var(--accent-soft); }
textarea.input { resize: vertical; line-height: 1.6; }
select.input { cursor: pointer; }
.input-prefix { display: flex; align-items: center; background: var(--surface-2); border: 1.5px solid var(--border); border-radius: var(--r-sm); padding-inline-start: .8em; }
.input-prefix:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); background: var(--surface); }
.input-prefix b { color: var(--muted); font-weight: 500; }
.input-prefix .input { border: 0; background: transparent; box-shadow: none; padding-inline-start: .3em; }
.emoji-input { width: 4.2em; text-align: center; font-size: 1.2em; padding: .45em; flex: none; }

.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; border: 0; margin: 0; padding: 0; min-width: 0; }
.field > span:first-child, .field legend { font-weight: 600; font-size: .92em; color: var(--text-2); padding: 0; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row > .input { flex: 1; }
.row-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.check { display: flex; gap: .5em; align-items: center; cursor: pointer; font-size: .94em; }
.check input, .radio-row input { accent-color: var(--accent); width: 1.1em; height: 1.1em; }
.radio-list { display: grid; gap: 6px; }
.radio-row { display: flex; gap: .6em; align-items: center; padding: .55em .8em; border-radius: 12px; background: var(--surface-2); cursor: pointer; }
.radio-row:has(input:checked) { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.inline-field { display: flex; align-items: center; gap: 8px; font-size: .9em; color: var(--muted); }
.inline-field .input { width: auto; }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.switch-row:last-of-type { border-bottom: 0; }
.switch-row span { display: flex; flex-direction: column; gap: 2px; }
.switch-row small { color: var(--muted); font-size: .85em; }
.switch {
  appearance: none; width: 46px; height: 27px; border-radius: 99px; background: var(--surface-3); position: relative;
  cursor: pointer; transition: background .2s; flex: none; border: 1px solid var(--border);
}
.switch::after {
  content: ""; position: absolute; top: 2px; inset-inline-start: 2px; width: 21px; height: 21px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .25); transition: transform .2s var(--ease);
}
.switch:checked { background: var(--accent); border-color: var(--accent); }
.switch:checked::after { transform: translateX(-19px); }
[dir="ltr"] .switch:checked::after { transform: translateX(19px); }

.strength { height: 4px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.strength i { display: block; height: 100%; width: 0; background: var(--danger); transition: width .25s, background .25s; }

.chip {
  display: inline-flex; align-items: center; gap: .35em; padding: .3em .85em; border-radius: 99px; font-size: .86em;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); white-space: nowrap; cursor: pointer;
}
.chip:hover { border-color: var(--accent); color: var(--accent-ink); }
.chip.on { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); font-weight: 600; }
.chip .i { width: 1em; height: 1em; }
.chip-soft { background: var(--surface-3); border-color: transparent; font-size: .76em; padding: .15em .6em; cursor: default; }
.chip-danger { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); border-color: transparent; }
.chip-lg { font-size: .98em; padding: .5em 1.1em; }
.chip-add { border-style: dashed; }
.chips-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chips-row.center { justify-content: center; }
.chip.muted { opacity: .55; }

/* ---------- البطاقات ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow); padding: var(--pad); }
.card-title { font-size: 1.05em; display: flex; align-items: center; gap: .45em; margin-bottom: .6em; }
.section-title { font-size: 1.05em; margin: 22px 6px 10px; color: var(--text-2); display: flex; gap: .4em; align-items: center; }
.stack { display: flex; flex-direction: column; gap: var(--gap); }
.notice { padding: 12px 16px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px dashed var(--border); color: var(--text-2); font-size: .92em; display: flex; gap: .5em; align-items: center; margin-bottom: var(--gap); }
.notice a { color: var(--accent-ink); font-weight: 600; }

/* ---------- الهيكل العام ---------- */
.shell {
  display: grid; grid-template-columns: var(--nav-w) minmax(0, var(--main-w)) var(--side-w);
  gap: 24px; max-width: calc(var(--nav-w) + var(--main-w) + var(--side-w) + 80px); margin: 0 auto; padding: 0 16px;
  align-items: start;
}
.shell.is-wide { grid-template-columns: var(--nav-w) minmax(0, 1fr); max-width: 1240px; }
.main { min-width: 0; padding-bottom: 60px; }

/* الشريط الجانبي للتنقل */
.nav {
  position: sticky; top: 14px; height: calc(100vh - 28px); display: flex; flex-direction: column; gap: 6px;
  padding: 16px 12px; border-radius: var(--r-xl); background: var(--glass); border: 1px solid var(--border);
  backdrop-filter: blur(20px) saturate(1.4); -webkit-backdrop-filter: blur(20px) saturate(1.4); box-shadow: var(--shadow);
  overflow-y: auto; scrollbar-width: none; z-index: 30;
}
.nav::-webkit-scrollbar { display: none; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; font-weight: 800; font-size: 1.45em; letter-spacing: -.01em; }
.brand span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo { flex: none; border-radius: 30%; }
.nav-links { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-link {
  display: flex; align-items: center; gap: 14px; padding: 9px 12px; border-radius: 14px; font-size: 1.02em; color: var(--text-2);
  transition: background .15s, color .15s; width: 100%; text-align: start; list-style: none;
}
.nav-link::-webkit-details-marker { display: none; }
.nav-link:hover { background: var(--surface-3); color: var(--text); }
.nav-link.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; }
.nav-link.active .i { stroke-width: 2.3; }
.nav-ic { position: relative; display: inline-grid; place-items: center; }
.badge {
  position: absolute; top: -7px; inset-inline-end: -9px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px;
  background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; line-height: 1;
  border: 2px solid var(--surface); font-style: normal;
}
.nav-more summary { cursor: pointer; }
.nav-more[open] summary { color: var(--text); }
.nav-sub { display: flex; flex-direction: column; gap: 2px; padding: 4px 0 4px; margin-inline-start: 8px; border-inline-start: 2px solid var(--border); padding-inline-start: 6px; }
.nav-sub .nav-link { font-size: .95em; padding: 7px 10px; }
.btn-compose { margin: 10px 0 6px; padding: .8em 1em; font-size: 1.05em; }
.nav-me { position: relative; }
.nav-me summary { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 16px; cursor: pointer; list-style: none; }
.nav-me summary::-webkit-details-marker { display: none; }
.nav-me summary:hover { background: var(--surface-3); }
.nav-me-tx { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.3; }
.nav-me-tx b, .nav-me-tx small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-me-tx small { color: var(--muted); text-align: end; }
.nav-guest { display: flex; flex-direction: column; gap: 8px; padding-top: 10px; }

/* العمود الجانبي */
.side { position: sticky; top: 14px; display: flex; flex-direction: column; gap: 14px; padding-bottom: 30px; max-height: calc(100vh - 14px); overflow-y: auto; scrollbar-width: none; }
.side::-webkit-scrollbar { display: none; }
.side-search, .search-bar {
  display: flex; align-items: center; gap: 10px; padding: 0 14px; border-radius: 99px; background: var(--surface);
  border: 1.5px solid var(--border); box-shadow: var(--shadow); color: var(--muted);
}
.side-search:focus-within, .search-bar:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.side-search input, .search-bar input { flex: 1; border: 0; outline: 0; background: transparent; padding: 12px 0; min-width: 0; color: var(--text); }
.search-bar.card { border-radius: 99px; padding: 0 14px; margin-bottom: var(--gap); }
.search-bar.slim { box-shadow: none; background: var(--surface-2); }
.widget { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; }
.widget h3 { font-size: 1.02em; display: flex; align-items: center; gap: .45em; margin-bottom: 10px; }
.widget-more { display: block; color: var(--accent-ink); font-size: .9em; font-weight: 600; margin-top: 10px; }
.w-greet { background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 16%, var(--surface)), color-mix(in srgb, var(--accent-2) 12%, var(--surface))); }
.greet-hi { font-size: 1.15em; font-weight: 700; }
.greet-date { display: flex; flex-direction: column; color: var(--text-2); font-size: .9em; margin-top: 4px; }
.greet-hijri { color: var(--muted); }
.greet-digest { display: flex; align-items: center; gap: .4em; margin-top: 10px; padding: 8px 12px; border-radius: 12px; background: var(--surface); font-weight: 600; font-size: .9em; color: var(--accent-ink); }
.w-join p { color: var(--text-2); font-size: .92em; }
.w-join .btn { margin-top: 8px; }
.trend-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.trend-list a { display: flex; align-items: center; gap: 12px; padding: 7px 6px; border-radius: 12px; }
.trend-list a:hover { background: var(--surface-2); }
.trend-n { width: 26px; height: 26px; border-radius: 9px; background: var(--surface-3); display: grid; place-items: center; font-size: .8em; font-weight: 700; color: var(--muted); flex: none; }
.trend-list li:first-child .trend-n { background: var(--grad); color: #fff; }
.trend-tx { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.trend-tx b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trend-tx small { color: var(--muted); font-size: .8em; }
.mini-people { display: flex; flex-direction: column; gap: 10px; }
.mini-person { display: flex; align-items: center; gap: 10px; }
.mini-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.mini-tx small { color: var(--muted); font-size: .82em; text-align: start; }
.mini-name { display: flex; align-items: center; min-width: 0; }
.mini-name .uname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.mini-hubs { display: flex; flex-direction: column; gap: 6px; }
.mini-hub { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 14px; }
.mini-hub:hover { background: var(--surface-2); }
.hub-ic {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 13px; font-size: 1.25em; flex: none;
  background: color-mix(in srgb, var(--accent) 16%, var(--surface));
}
.side-foot { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 0 8px; font-size: .8em; color: var(--muted); }
.side-foot a:hover, .side-foot button:hover { color: var(--text); text-decoration: underline; }
.side-foot button { color: inherit; font-size: inherit; }

/* ترويسة الصفحة */
.page-head {
  position: sticky; top: 8px; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 10px 14px; margin: 8px 0 12px;
  background: var(--glass); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow);
}
.page-head-tabs { flex-wrap: wrap; }
.page-head-tabs .page-title, .page-head-tabs .search-bar { flex: 1 1 100%; }
.page-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.page-title h1 { font-size: 1.35em; font-weight: 800; }
.page-title small { color: var(--muted); font-size: .85em; }
.page-actions { display: flex; gap: 8px; }

/* التبويبات (مفتاح مقسّم) */
.tabs {
  display: flex; gap: 4px; padding: 4px; background: var(--surface-3); border-radius: 99px; overflow-x: auto; scrollbar-width: none;
  max-width: 100%;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  flex: 1 0 auto; text-align: center; padding: .48em 1.05em; border-radius: 99px; color: var(--muted); font-weight: 600; font-size: .93em;
  white-space: nowrap; transition: background .15s, color .15s;
}
.tabs a:hover { color: var(--text); }
.tabs a.active { background: var(--surface); color: var(--accent-ink); box-shadow: 0 1px 2px rgb(0 0 0 / .08), 0 4px 10px -4px rgb(0 0 0 / .12); }
.tabs .tab-add { flex: 0 0 auto; padding: .48em .7em; }
.tabs-solo { margin: 14px 0 var(--gap); }

.announce {
  display: flex; gap: 10px; align-items: center; padding: 10px 14px; margin: 12px 0 0; border-radius: var(--r-sm);
  background: var(--grad); color: #fff; font-weight: 500; font-size: .92em;
}
.announce a { color: #fff; text-decoration: underline; }

/* ---------- المنشور ---------- */
.feed { display: flex; flex-direction: column; gap: var(--gap); }
.post {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow);
  padding: var(--pad); position: relative; transition: border-color .2s, box-shadow .2s, transform .2s var(--ease); cursor: pointer;
  outline: none;
}
.post:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.post.is-focus { box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow); border-color: var(--accent); }
.post.is-new { animation: pop .5s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(-8px) scale(.98); } }
.post-main { cursor: default; padding: calc(var(--pad) + 4px); }
.post-main .post-text { font-size: 1.15em; line-height: 1.75; }
.post-ctx { display: flex; align-items: center; gap: .4em; font-size: .84em; color: var(--muted); font-weight: 600; margin: -2px 0 8px; padding-inline-start: 34px; }
.post-ctx .i { width: 1.05em; height: 1.05em; }
.post-ctx a:hover { text-decoration: underline; }
.post-grid { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; }
.post-av { position: relative; }
.post-body { min-width: 0; }
.post-head { display: flex; align-items: center; gap: 6px; min-height: 26px; flex-wrap: nowrap; }
.post-who { display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; }
.uname { font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uname:hover { text-decoration: underline; color: var(--text); }
.ustatus { font-size: .95em; margin-inline-start: .15em; }
.handle { color: var(--muted); font-size: .9em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.post-time { color: var(--muted); font-size: .88em; white-space: nowrap; }
.post-time::before { content: "·"; margin-inline-end: 6px; }
.post-time:hover { text-decoration: underline; color: var(--text-2); }
.post-flags { display: inline-flex; gap: 4px; align-items: center; margin-inline-start: auto; }
.flag { display: inline-flex; align-items: center; gap: 3px; font-size: .76em; color: var(--muted); background: var(--surface-2); border-radius: 99px; padding: .1em .5em; white-space: nowrap; }
.flag .i { width: 1.1em; height: 1.1em; }
.flag-eph { background: color-mix(in srgb, #f59e0b 16%, transparent); color: color-mix(in srgb, #b45309 85%, var(--text)); }
.post-menu summary { width: 32px; height: 32px; }
.post-head .post-menu { margin-inline-start: 0; }
.post-flags:empty + .post-menu { margin-inline-start: auto; }
.reply-ctx { font-size: .88em; color: var(--muted); margin-top: -2px; }
.reply-ctx a { color: var(--accent-ink); }
.post-text { margin-top: 4px; overflow-wrap: anywhere; white-space: normal; }
.post-text a, .quote-text a, .profile-bio a, .msg-bubble a, .announce a { color: var(--accent-ink); }
.post-text a:hover { text-decoration: underline; }
.post-text code { font-size: .85em; }
.mention, .tag { font-weight: 500; }
.ext { unicode-bidi: isolate; }

.media { display: grid; gap: 3px; margin-top: 10px; border-radius: 18px; overflow: hidden; border: 1px solid var(--border); }
.media-1 { grid-template-columns: 1fr; }
.media-2 { grid-template-columns: 1fr 1fr; aspect-ratio: 16 / 9; }
.media-3 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; aspect-ratio: 16 / 9; }
.media-3 .media-item:first-child { grid-row: span 2; }
.media-4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; aspect-ratio: 16 / 9; }
.media-item { display: block; overflow: hidden; background: var(--surface-3); min-height: 0; }
.media-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--ease); }
.media-1 .media-item img { max-height: 520px; height: auto; }
.media-item:hover img { transform: scale(1.03); }

.spoiler { margin-top: 8px; }
.spoiler summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: .55em; flex-wrap: wrap; padding: 14px 16px; border-radius: 16px;
  background: repeating-linear-gradient(45deg, var(--surface-2) 0 10px, var(--surface-3) 10px 20px); border: 1px dashed var(--border); color: var(--text-2);
}
.spoiler summary::-webkit-details-marker { display: none; }
.spoiler summary em { font-style: normal; margin-inline-start: auto; color: var(--accent-ink); font-weight: 600; font-size: .9em; }
.spoiler[open] summary { padding: 6px 10px; background: transparent; border-style: solid; font-size: .85em; }
.spoiler[open] summary em { display: none; }

.qa-card { margin: 6px 0 8px; padding: 12px 14px; border-radius: 16px; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, var(--surface)), color-mix(in srgb, var(--accent-2) 10%, var(--surface))); border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border)); }
.qa-label { display: flex; align-items: center; gap: .4em; font-size: .78em; font-weight: 700; color: var(--accent-ink); margin-bottom: 4px; }
.qa-card p { margin: 0; font-weight: 600; }

.quote { margin-top: 10px; border: 1px solid var(--border); border-radius: 16px; padding: 10px 12px; background: var(--surface); cursor: pointer; transition: background .15s; }
.quote:hover { background: var(--surface-2); }
.quote-head { display: flex; align-items: center; gap: 6px; font-size: .9em; min-width: 0; }
.quote-head .post-time::before { content: "·"; }
.quote-text { font-size: .94em; margin-top: 4px; color: var(--text-2); }
.quote-img { margin-top: 8px; border-radius: 12px; max-height: 200px; width: 100%; object-fit: cover; }
.quote-gone { color: var(--muted); font-size: .9em; cursor: default; display: flex; gap: .4em; align-items: center; }

.hub-chip { display: inline-flex; align-items: center; gap: .35em; margin-top: 10px; padding: .2em .75em; border-radius: 99px; font-size: .8em; font-weight: 600; background: var(--accent-soft); color: var(--accent-ink); }

.poll { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.poll form { display: flex; flex-direction: column; gap: 6px; }
.poll-opt {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 14px; border-radius: 12px;
  border: 1.5px solid var(--border); overflow: hidden; text-align: start; width: 100%; font-weight: 500;
}
button.poll-opt:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.poll-opt.is-result { border-color: transparent; background: var(--surface-2); }
.poll-bar { position: absolute; inset-block: 0; inset-inline-start: 0; background: color-mix(in srgb, var(--accent) 18%, transparent); border-radius: 12px; transition: width .6s var(--ease); }
.poll-opt.mine .poll-bar, .poll-opt.win .poll-bar { background: color-mix(in srgb, var(--accent) 32%, transparent); }
.poll-t, .poll-opt b { position: relative; display: inline-flex; align-items: center; gap: .3em; }
.poll-opt.win { font-weight: 700; }
.poll-meta { font-size: .82em; color: var(--muted); }

.post-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; color: var(--muted); font-size: .88em; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.post-meta .i { width: 1.1em; height: 1.1em; }
.rx-sum:hover { color: var(--accent-ink); }
.edit-history { margin-top: 10px; font-size: .88em; }
.edit-history summary { cursor: pointer; color: var(--muted); display: inline-flex; gap: .3em; align-items: center; }
.edit-v { padding: 8px 12px; margin-top: 6px; border-inline-start: 3px solid var(--border); background: var(--surface-2); border-radius: 0 10px 10px 0; }
.edit-v time { display: block; font-size: .85em; color: var(--muted); }
.reply-policy { margin-top: 8px; font-size: .85em; color: var(--muted); display: flex; gap: .3em; align-items: center; }

.post-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; margin-inline-start: -8px; max-width: 460px; }
.post-main .post-actions { max-width: none; padding-top: 6px; border-top: 1px solid var(--border); margin-inline-start: 0; }
.act {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border-radius: 99px; color: var(--muted); font-size: .88em;
  transition: background .15s, color .15s; list-style: none; cursor: pointer; min-height: 34px;
}
.act::-webkit-details-marker { display: none; }
.act .i { width: 1.25em; height: 1.25em; }
.act .count:empty { display: none; }
.act-reply:hover { color: #0284c7; background: color-mix(in srgb, #0284c7 12%, transparent); }
.act-repost:hover, .act-repost.on { color: #059669; }
.act-repost:hover { background: color-mix(in srgb, #059669 12%, transparent); }
.act-react:hover, .act-react.on { color: #e11d48; }
.act-react:hover { background: color-mix(in srgb, #e11d48 12%, transparent); }
.act-save:hover, .act-save.on { color: #d97706; }
.act-save:hover { background: color-mix(in srgb, #d97706 12%, transparent); }
.act-save.on .i, .act-react.on .i { fill: currentColor; }
.act-share:hover { color: var(--accent-ink); background: var(--accent-soft); }
.act-disabled { opacity: .5; cursor: not-allowed; }
.rx-ic { display: inline-grid; place-items: center; min-width: 1.25em; font-size: 1.05em; line-height: 1; }
.act-react.on .rx-ic { animation: bounce .4s var(--ease); }
@keyframes bounce { 40% { transform: scale(1.35); } }

.react { position: relative; }
.react-pick {
  position: absolute; bottom: calc(100% + 4px); inset-inline-start: -30px; display: flex; gap: 2px; padding: 5px; border-radius: 99px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); z-index: 15;
  opacity: 0; visibility: hidden; transform: translateY(6px) scale(.95); transition: opacity .15s, transform .2s var(--ease), visibility 0s .2s;
}
.react-pick::after { content: ""; position: absolute; top: 100%; inset-inline: 0; height: 10px; }
.react:hover .react-pick, .react:has(:focus-visible) .react-pick, .react.show .react-pick {
  opacity: 1; visibility: visible; transform: none; transition-delay: .25s, .25s, 0s;
}
.react-pick button { font-size: 1.45em; width: 1.75em; height: 1.75em; border-radius: 50%; display: grid; place-items: center; transition: transform .15s var(--ease), background .15s; }
.react-pick button:hover { transform: scale(1.3) translateY(-3px); background: var(--surface-2); }
.react-pick button.on { background: var(--accent-soft); }

.post-gone { cursor: default; }
.gone { color: var(--muted); font-size: .92em; display: flex; align-items: center; gap: .5em; }

/* سلسلة المنشورات */
.thread { display: flex; flex-direction: column; gap: 0; }
.thread .post { border-radius: 0; border-bottom-width: 0; box-shadow: none; }
.thread .post:first-child { border-radius: var(--r) var(--r) 0 0; }
.thread .post:last-child { border-radius: 0 0 var(--r) var(--r); border-bottom-width: 1px; box-shadow: var(--shadow); }
.thread .post:only-child { border-radius: var(--r); }
.has-thread .post-av::after {
  content: ""; position: absolute; top: 52px; bottom: calc(-1 * var(--pad) - 14px); inset-inline-start: 50%; width: 2px; transform: translateX(50%);
  background: var(--border); border-radius: 2px;
}
.replies .post .post-av::after { display: none; }
.replies-empty { padding: 16px; }

/* القوائم المنبثقة */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-pop {
  position: absolute; top: calc(100% + 6px); inset-inline-end: 0; min-width: 230px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 40; display: flex; flex-direction: column; animation: menu-in .15s var(--ease);
}
.act-menu .menu-pop { inset-inline-end: auto; inset-inline-start: 0; }
.menu-pop.menu-up { top: auto; bottom: calc(100% + 6px); inset-inline-start: 0; inset-inline-end: 0; }
.menu-pop.wide { min-width: 290px; }
.menu-pop form { display: block; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px); } }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 10px; font-size: .93em; text-align: start; color: var(--text);
}
.menu-item:hover { background: var(--surface-2); color: var(--text); }
.menu-item .i { width: 1.15em; height: 1.15em; color: var(--muted); }
.menu-item.danger .i { color: var(--danger); }

/* ---------- المحرر ---------- */
.composer-card { padding: 14px var(--pad); margin-bottom: var(--gap); }
.composer { position: relative; }
.cmp-grid { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; }
.cmp-items { display: flex; flex-direction: column; gap: 8px; }
.cmp-item { position: relative; }
.cmp-item + .cmp-item { padding-top: 8px; border-top: 1px dashed var(--border); }
.cmp-item textarea {
  width: 100%; border: 0; outline: 0; resize: none; background: transparent; font-size: 1.12em; line-height: 1.6; padding: 6px 0; min-height: 2.4em; color: var(--text);
}
.composer-reply .cmp-item textarea { font-size: 1em; }
.cmp-item textarea::placeholder { color: var(--muted); }
.cmp-item .cmp-remove { position: absolute; top: 8px; inset-inline-end: 0; }
.cmp-previews { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.cmp-prev { position: relative; width: 96px; height: 96px; border-radius: 14px; overflow: hidden; border: 1px solid var(--border); }
.cmp-prev img { width: 100%; height: 100%; object-fit: cover; }
.cmp-prev button { position: absolute; top: 4px; inset-inline-end: 4px; width: 24px; height: 24px; border-radius: 50%; background: rgb(0 0 0 / .65); color: #fff; display: grid; place-items: center; }
.cmp-prev button .i { width: 14px; height: 14px; }
.cmp-poll { border: 1.5px solid var(--border); border-radius: 16px; padding: 12px; margin: 10px 0; display: grid; gap: 8px; }
.cmp-poll legend { font-weight: 600; font-size: .9em; padding: 0 6px; display: flex; gap: .3em; align-items: center; }
.cmp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cmp-chips:not(:empty) { margin-top: 8px; }
.cmp-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.cmp-tools { display: flex; align-items: center; gap: 2px; }
.tool { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; color: var(--accent-ink); cursor: pointer; list-style: none; }
.tool::-webkit-details-marker { display: none; }
.tool:hover { background: var(--accent-soft); }
.tool-pop { position: relative; }
.tool-pop > summary { list-style: none; }
.tool-pop > summary::-webkit-details-marker { display: none; }
.pop {
  position: absolute; top: calc(100% + 6px); inset-inline-start: 0; z-index: 45; background: var(--surface); border: 1px solid var(--border);
  border-radius: 18px; box-shadow: var(--shadow-lg); padding: 12px; animation: menu-in .15s var(--ease);
}
.emoji-grid { display: grid; grid-template-columns: repeat(6, 38px); gap: 2px; }
.emoji-grid button { font-size: 1.35em; height: 38px; border-radius: 10px; }
.emoji-grid button:hover { background: var(--surface-2); transform: scale(1.15); }
.cmp-opts { width: min(320px, 80vw); display: flex; flex-direction: column; gap: 10px; }
.cmp-opts label { display: flex; flex-direction: column; gap: 4px; }
.cmp-opts label > span { font-size: .84em; font-weight: 600; color: var(--text-2); display: flex; gap: .35em; align-items: center; }
.cmp-opts .input { padding: .5em .7em; font-size: .92em; }
.cmp-send { display: flex; align-items: center; gap: 6px; margin-inline-start: auto; }
.cmp-draft span { display: inline; }
.ring { position: relative; width: 30px; height: 30px; display: inline-grid; place-items: center; }
.ring svg { width: 30px; height: 30px; transform: rotate(-90deg); position: absolute; inset: 0; }
.ring circle { fill: none; stroke: var(--surface-3); stroke-width: 3; }
.ring .ring-v { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 94.25; stroke-dashoffset: 94.25; transition: stroke-dashoffset .15s, stroke .15s; }
.ring.warn .ring-v { stroke: #f59e0b; }
.ring.over .ring-v { stroke: var(--danger); }
.ring b { font-size: .68em; font-weight: 600; color: var(--muted); position: relative; }
.ring.over b { color: var(--danger); }
.mention-box { position: absolute; z-index: 50; min-width: 240px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 5px; }
.mention-box button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 9px; border-radius: 10px; text-align: start; }
.mention-box button.on, .mention-box button:hover { background: var(--surface-2); }
.mention-box small { color: var(--muted); }

/* ---------- الأشخاص ---------- */
.people { display: flex; flex-direction: column; padding: 6px; }
.person { display: flex; gap: 12px; padding: 12px 10px; border-radius: 14px; align-items: flex-start; }
.person + .person, [data-row] + [data-row] .person { border-top: 1px solid var(--border); border-radius: 0; }
.person-tx { flex: 1; min-width: 0; }
.person-name { display: flex; align-items: center; gap: 4px; min-width: 0; }
.person-handle { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .88em; }
.person-bio { margin: 4px 0 0; color: var(--text-2); font-size: .92em; }
.person-act { flex: none; align-self: center; }
.rx-badge { font-size: 1.1em; }
.follow-btn[data-state="following"]:hover span, .follow-btn[data-state="requested"]:hover span { display: none; }
.follow-btn[data-state="following"]:hover::after { content: "إلغاء المتابعة"; }
.follow-btn[data-state="requested"]:hover::after { content: "إلغاء الطلب"; }
.follow-btn[data-state]:not([data-state="none"]):hover { border-color: var(--danger); color: var(--danger); }
.people-strip { padding: 10px; margin-bottom: var(--gap); }
.people-strip .card-title { padding: 6px 10px 0; }

/* ---------- الملف الشخصي ---------- */
.profile { padding: 0; overflow: hidden; }
.cover {
  height: 210px; position: relative; overflow: hidden;
  background: linear-gradient(135deg, hsl(var(--h, 170) 65% 55%), hsl(calc(var(--h, 170) + 60) 60% 45%));
}
.cover::after { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 90% at 85% 0%, rgb(255 255 255 / .25), transparent 55%); }
.cover img { width: 100%; height: 100%; object-fit: cover; position: relative; z-index: 1; }
.profile-top { display: flex; justify-content: space-between; align-items: flex-end; padding: 0 20px; margin-top: -58px; position: relative; z-index: 2; }
.profile-av .av { border: 5px solid var(--surface); box-shadow: var(--shadow); }
.profile-actions { display: flex; gap: 8px; align-items: center; padding-bottom: 6px; }
.profile-info { padding: 12px 20px 18px; }
.profile-name { font-size: 1.45em; font-weight: 800; display: flex; align-items: center; gap: .25em; flex-wrap: wrap; }
.profile-handle { color: var(--muted); display: flex; gap: 8px; align-items: center; }
.profile-status { display: inline-flex; gap: .4em; align-items: center; margin-top: 8px; padding: .3em .9em; border-radius: 99px; background: var(--surface-2); font-size: .9em; border: 1px solid var(--border); }
.profile-bio { margin: 10px 0 6px; white-space: pre-line; }
.profile-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: .9em; margin-top: 8px; }
.profile-meta > * { display: inline-flex; align-items: center; gap: 4px; }
.profile-meta a { color: var(--accent-ink); }
.profile-meta .i { width: 1.1em; height: 1.1em; }
.profile-stats { display: flex; gap: 18px; margin-top: 10px; font-size: .95em; color: var(--muted); }
.profile-stats b { color: var(--text); font-weight: 700; }
.profile-stats a:hover { text-decoration: underline; }
.mutuals { display: flex; align-items: center; gap: 8px; margin-top: 10px; color: var(--muted); }
.notif-avs { display: inline-flex; }
.notif-avs .av { border: 2px solid var(--surface); margin-inline-start: -7px; }
.notif-avs .av:first-child { margin-inline-start: 0; }
.achievements { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.ach { padding: .25em .75em; border-radius: 99px; font-size: .82em; font-weight: 600; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 14%, var(--surface)), color-mix(in srgb, var(--accent-2) 12%, var(--surface))); border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--border)); cursor: help; }
.private-note { margin: 0 20px 18px; padding: 10px 14px; border-radius: 14px; background: var(--surface-2); border: 1px dashed var(--border); }
.private-note summary { cursor: pointer; font-size: .9em; color: var(--text-2); display: flex; align-items: center; gap: .4em; flex-wrap: wrap; }
.private-note form { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; align-items: flex-start; }
.ask-box { display: flex; flex-direction: column; gap: 10px; margin-bottom: var(--gap); background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, var(--surface)), var(--surface)); }
.ask-head { display: flex; align-items: center; gap: 10px; }
.ask-emo { font-size: 1.8em; }

/* ---------- الإشعارات ---------- */
.notif-list { padding: 6px; display: flex; flex-direction: column; }
.notif { display: flex; gap: 12px; padding: 12px; border-radius: 14px; position: relative; }
.notif + .notif { border-top: 1px solid var(--border); border-radius: 0; }
.notif:hover { background: var(--surface-2); color: inherit; }
.notif.unread { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.notif.unread::before { content: ""; position: absolute; top: 18px; inset-inline-start: 4px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.notif-ic { width: 36px; display: grid; place-items: start center; color: var(--accent-ink); flex: none; padding-top: 2px; }
.notif-ic .i { width: 1.5em; height: 1.5em; }
.n-react .notif-ic, .n-follow .notif-ic { color: #e11d48; }
.n-repost .notif-ic { color: #059669; }
.n-question .notif-ic { color: #7c3aed; }
.notif-emo { font-size: 1.15em; letter-spacing: -.15em; }
.notif-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.notif-quote { color: var(--muted); font-size: .9em; }
.notif-time { color: var(--muted); font-size: .78em; }
.quick-links { display: grid; gap: 8px; margin-bottom: var(--gap); }
.quick { display: flex; align-items: center; gap: 10px; padding: 12px 16px; }
.quick span { flex: 1; }
.quick > .i:first-child { color: var(--accent-ink); }

/* ---------- الرسائل ---------- */
.dm { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 14px; height: calc(100vh - 28px); margin-top: 14px; position: sticky; top: 14px; }
.dm-list, .dm-conv { padding: 0; display: flex; flex-direction: column; overflow: hidden; min-height: 0; }
.dm-list { overflow-y: auto; }
.dm-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 10px; position: sticky; top: 0; background: var(--surface); z-index: 2; }
.dm-head h1 { font-size: 1.3em; font-weight: 800; }
.dm-item { display: flex; gap: 10px; align-items: center; padding: 12px 16px; position: relative; }
.dm-item:hover { background: var(--surface-2); color: inherit; }
.dm-item.active { background: var(--accent-soft); }
.dm-item-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dm-item-top { display: flex; align-items: center; gap: 4px; }
.dm-item-top b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-item-top time { margin-inline-start: auto; font-size: .78em; color: var(--muted); white-space: nowrap; }
.dm-item-last { color: var(--muted); font-size: .88em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-item.unread .dm-item-last { color: var(--text); font-weight: 600; }
.dot-unread { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex: none; }
.dm-empty, .dm-placeholder { text-align: center; padding: 40px 24px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 10px; margin: auto; }
.dm-empty .i { width: 2.4em; height: 2.4em; }
.dm-ph-ic { width: 76px; height: 76px; border-radius: 26px; background: var(--grad); color: #fff; display: grid; place-items: center; }
.dm-ph-ic .i { width: 2em; height: 2em; }
.dm-placeholder h2 { color: var(--text); }
.dm-conv-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.dm-who { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.dm-who span { display: flex; flex-direction: column; line-height: 1.3; }
.dm-who small { color: var(--muted); font-size: .82em; text-align: end; }
.dm-back { display: none; }
.dm-msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.dm-intro { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 0 24px; text-align: center; }
.dm-day { text-align: center; margin: 10px 0; }
.dm-day span { font-size: .76em; color: var(--muted); background: var(--surface-2); padding: .25em .9em; border-radius: 99px; }
.msg { display: flex; flex-direction: column; align-items: flex-start; max-width: 78%; }
.msg.mine { align-self: flex-end; align-items: flex-end; }
.msg:not(.mine) { align-self: flex-start; }
.msg-bubble { padding: 9px 14px; border-radius: 20px; background: var(--surface-3); overflow-wrap: anywhere; border-start-start-radius: 6px; }
.msg.mine .msg-bubble { background: var(--grad); color: #fff; border-start-start-radius: 20px; border-start-end-radius: 6px; }
.msg.mine .msg-bubble a { color: #fff; text-decoration: underline; }
.msg-time { font-size: .7em; color: var(--muted); padding: 2px 6px 4px; }
.msg.is-new { animation: pop .3s var(--ease); }
.dm-send { display: flex; gap: 8px; align-items: flex-end; padding: 12px; border-top: 1px solid var(--border); }
.dm-send textarea { border-radius: 22px; resize: none; max-height: 160px; }
.dm-conv .notice { margin: 12px; }

/* ---------- المحفوظات / المسودات / الأسئلة ---------- */
.bm-bar { display: flex; flex-direction: column; gap: 12px; margin-bottom: var(--gap); }
.bm { display: flex; flex-direction: column; }
.bm .post { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.bm-meta { background: var(--surface-2); border: 1px solid var(--border); border-top: 0; border-radius: 0 0 var(--r) var(--r); padding: 10px 16px; }
.bm-meta summary { cursor: pointer; display: flex; align-items: center; gap: .5em; color: var(--muted); font-size: .88em; list-style: none; }
.bm-meta summary::-webkit-details-marker { display: none; }
.bm-note { color: var(--text-2); font-style: italic; flex: 1; }
.bm-form { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.draft { display: flex; flex-direction: column; gap: 10px; }
.draft-text { white-space: pre-line; overflow-wrap: anywhere; }
.draft-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.sched-when { display: flex; align-items: center; gap: .45em; font-weight: 600; color: var(--accent-ink); flex-wrap: wrap; }
.ask-intro { display: flex; gap: 14px; align-items: flex-start; margin-bottom: var(--gap); }
.question { display: flex; flex-direction: column; gap: 10px; }
.q-text { display: flex; gap: 12px; align-items: flex-start; }
.q-text p { font-size: 1.08em; font-weight: 600; margin: 0; }
.q-mark { width: 36px; height: 36px; border-radius: 12px; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 1.2em; flex: none; }
.q-answer { display: flex; flex-direction: column; gap: 8px; }

/* ---------- الملتقيات والقوائم ---------- */
.hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--gap); }
.hub-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.hub-card-top { height: 84px; background: var(--grad); display: flex; align-items: flex-end; padding: 0 16px; }
.hub-ic-lg { width: 58px; height: 58px; font-size: 1.8em; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); transform: translateY(26px); }
.hub-card-body { padding: 34px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.hub-name { font-weight: 800; font-size: 1.08em; }
.hub-card-body p { color: var(--text-2); font-size: .9em; flex: 1; margin: 0; }
.hub-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); }
.hub-hero { padding: 0; overflow: hidden; }
.hub-banner { height: 150px; background: var(--grad); position: relative; display: flex; align-items: flex-end; padding: 0 20px; }
.hub-banner::after { content: ""; position: absolute; inset: 0; background: radial-gradient(90% 120% at 10% 0%, rgb(255 255 255 / .28), transparent 60%); }
.hub-ic-xl { width: 88px; height: 88px; font-size: 2.6em; border-radius: 28px; background: var(--surface); box-shadow: var(--shadow); transform: translateY(36px); position: relative; z-index: 1; }
.hub-hero-body { padding: 46px 20px 18px; }
.hub-hero-body h2 { font-size: 1.4em; font-weight: 800; }
.hub-hero-body p { color: var(--text-2); }
.hub-hero-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.hub-hero-foot a { color: var(--accent-ink); }
.rules { margin: 0; padding-inline-start: 1.3em; display: flex; flex-direction: column; gap: 6px; }
.list-grid { display: grid; gap: 8px; }
.list-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.list-ic { width: 44px; height: 44px; border-radius: 14px; background: var(--grad); color: #fff; display: grid; place-items: center; flex: none; }
.list-ic.big { width: 64px; height: 64px; border-radius: 20px; }
.list-ic.big .i { width: 1.8em; height: 1.8em; }
.list-tx { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.list-tx small { color: var(--muted); font-size: .85em; }
.list-hero { display: flex; gap: 14px; align-items: flex-start; }
.list-hero > div:nth-child(2) { flex: 1; }
.form.pad { padding: 8px; }
.create-box { margin-bottom: var(--gap); }
.create-box summary { cursor: pointer; font-weight: 700; display: flex; align-items: center; gap: .4em; color: var(--accent-ink); list-style: none; }
.create-box summary::-webkit-details-marker { display: none; }
.create-box[open] summary { margin-bottom: 12px; }
.feed-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.feed-info { display: flex; gap: 8px; align-items: center; padding: 10px 14px; margin-bottom: var(--gap); border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--border); font-size: .88em; color: var(--muted); }
.feed-info span { flex: 1; }
.feed-info a { color: var(--accent-ink); font-weight: 600; }

/* ---------- الاستكشاف والبحث ---------- */
.trends-card { margin-bottom: var(--gap); }
.trend-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.trend-tile { display: flex; flex-direction: column; padding: 12px 14px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--border); position: relative; transition: transform .2s var(--ease), border-color .2s; }
.trend-tile:hover { transform: translateY(-2px); border-color: var(--accent); color: inherit; }
.trend-tile b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trend-tile small { color: var(--muted); font-size: .8em; }
.trend-rank { position: absolute; top: 10px; inset-inline-end: 12px; font-size: .75em; font-weight: 800; color: var(--muted); }
.search-help ul.op-list { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 6px; }
.search-help li { color: var(--text-2); font-size: .94em; }

/* ---------- صفحات متفرقة ---------- */
.empty { text-align: center; padding: 42px 24px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty-ic { width: 70px; height: 70px; border-radius: 24px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); margin-bottom: 6px; }
.empty-ic .i { width: 2em; height: 2em; }
.empty h3 { font-size: 1.15em; }
.empty p { color: var(--muted); max-width: 380px; margin: 0; }
.empty .btn { margin-top: 10px; }
.load-more { display: block; text-align: center; padding: 12px; margin-top: var(--gap); border-radius: 99px; background: var(--surface); border: 1px solid var(--border); color: var(--accent-ink); font-weight: 600; }
.load-more.loading { opacity: .6; pointer-events: none; }
.digest-banner {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; margin-bottom: var(--gap); border-radius: var(--r);
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 18%, var(--surface)), color-mix(in srgb, var(--accent-2) 14%, var(--surface)));
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border));
}
.digest-banner > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; }
.digest-banner small { color: var(--text-2); }
.digest-ic { width: 42px; height: 42px; border-radius: 14px; background: var(--grad); color: #fff; display: grid; place-items: center; flex: none; }
.digest-ic.big { width: 58px; height: 58px; border-radius: 18px; }
.digest-ic.big .i { width: 1.7em; height: 1.7em; }
.digest-hero { display: flex; gap: 16px; align-items: flex-start; margin-bottom: var(--gap); }
.digest-hero h2 { font-size: 1.15em; margin-bottom: 4px; }
.digest-hero p { margin: 0; }
.tips ul { margin: 0; padding-inline-start: 1.2em; display: grid; gap: 6px; color: var(--text-2); font-size: .94em; }
.error-card { text-align: center; padding: 50px 24px; margin-top: 40px; }
.error-code { font-size: 4.5em; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1; }
.error-card h1 { font-size: 1.4em; margin: 10px 0; }
.prose { line-height: 1.85; }
.prose h3 { margin: 1.1em 0 .4em; }
.prose ul { padding-inline-start: 1.3em; display: grid; gap: 4px; }
.about-hero { display: flex; gap: 16px; align-items: center; margin-bottom: 16px; }
.faq { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.faq-item summary { cursor: pointer; font-weight: 600; }
.faq-item p { margin: 10px 0 0; color: var(--text-2); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; margin: 0; font-size: .92em; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }

/* الإعدادات */
.settings-grid { display: grid; gap: 8px; }
.set-tile { display: flex; align-items: center; gap: 14px; padding: 14px 16px; transition: transform .2s var(--ease), border-color .2s; }
.set-tile:hover { border-color: var(--accent); transform: translateX(-3px); color: inherit; }
.set-ic { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); flex: none; }
.set-tx { flex: 1; display: flex; flex-direction: column; }
.set-tx small { color: var(--muted); font-size: .86em; }
.set-tile > .i:last-child { color: var(--muted); }
.set-media { position: relative; margin: -16px -16px 50px; }
.set-media .cover { border-radius: var(--r) var(--r) 0 0; height: 170px; }
.set-av { position: absolute; bottom: -46px; inset-inline-start: 20px; z-index: 2; }
.set-av .av { border: 5px solid var(--surface); }
.upload-btn {
  position: absolute; z-index: 3; bottom: 12px; inset-inline-end: 12px; display: inline-flex; gap: .4em; align-items: center; padding: .4em .9em;
  border-radius: 99px; background: rgb(0 0 0 / .55); color: #fff; font-size: .85em; cursor: pointer; backdrop-filter: blur(6px);
}
.upload-btn.small { bottom: 4px; inset-inline-end: 4px; padding: .45em; }
.theme-pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.theme-opt { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px; border-radius: 16px; border: 2px solid var(--border); cursor: pointer; font-size: .84em; text-align: center; }
.theme-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); font-weight: 700; }
.theme-opt input, .swatch input, .seg input { position: absolute; opacity: 0; pointer-events: none; }
.t-swatch { width: 100%; height: 44px; border-radius: 10px; border: 1px solid var(--border); }
.t-auto .t-swatch { background: linear-gradient(90deg, #f4f2ee 50%, #13111b 50%); }
.t-light .t-swatch { background: #f4f2ee; }
.t-dusk .t-swatch { background: #1c1928; }
.t-dark .t-swatch { background: #08080a; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { cursor: pointer; position: relative; }
.swatch span { display: block; width: 38px; height: 38px; border-radius: 13px; background: var(--grad); box-shadow: inset 0 0 0 3px var(--surface); border: 2px solid transparent; transition: transform .15s var(--ease); }
.swatch:hover span { transform: scale(1.08); }
.swatch input:checked + span { border-color: var(--text); }
.swatch input:focus-visible + span { outline: 2.5px solid var(--accent); outline-offset: 2px; }
.seg { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--surface-3); border-radius: 14px; }
.seg label { flex: 1; cursor: pointer; }
.seg span { display: block; text-align: center; padding: .45em .8em; border-radius: 10px; font-size: .9em; color: var(--muted); font-weight: 600; white-space: nowrap; }
.seg input:checked + span { background: var(--surface); color: var(--accent-ink); box-shadow: 0 1px 4px rgb(0 0 0 / .1); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); }
.preview-post { display: flex; gap: 12px; padding: 14px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--border); }
.preview-post p { margin: 4px 0 0; }
.usage { padding: 10px 14px; border-radius: 12px; background: var(--surface-2); font-size: .9em; }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }
.danger-zone .card-title { color: var(--danger); }
.recovery { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; padding: 14px; border-radius: 16px; background: color-mix(in srgb, #f59e0b 12%, var(--surface)); border: 1px solid color-mix(in srgb, #f59e0b 35%, var(--border)); margin: 14px 0; text-align: start; }
.code-box { font-size: 1.25em; letter-spacing: .12em; padding: .5em 1em; background: var(--surface); border: 1px dashed var(--border); user-select: all; }

/* الإدارة */
.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); margin-bottom: var(--gap); }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat-ic { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); margin-bottom: 6px; }
.stat b { font-size: 1.55em; font-weight: 700; line-height: 1.2; }
.stat small { color: var(--muted); font-size: .84em; }
.notice-card { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: var(--gap); }
.admin-table { padding: 4px; }
.admin-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 8px 14px; padding: 12px; align-items: center; }
.admin-row + .admin-row { border-top: 1px solid var(--border); }
.admin-row .row-actions { grid-column: 1 / -1; }
.admin-user { display: flex; gap: 10px; align-items: center; min-width: 0; }
.admin-user span { display: flex; flex-direction: column; min-width: 0; }
.admin-user small { color: var(--muted); font-size: .8em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: end; }
.admin-tags { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.report { display: flex; flex-direction: column; gap: 10px; }
.report-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.report-note { margin: 0; color: var(--text-2); }
.report-target { padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-size: .92em; }
.report-target a { color: var(--accent-ink); }

/* ---------- الرسوم البيانية (الإحصاءات) ---------- */
.chart-card { margin-bottom: var(--gap); }
.charts-2 { gap: var(--gap); }
.colchart { display: grid; grid-template-columns: auto 1fr; gap: 8px; margin-top: 14px; }
.colchart-y { display: flex; flex-direction: column; justify-content: space-between; height: 200px; font-size: .74em; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; transform: translateY(.6em); }
.colchart-plot { position: relative; min-width: 0; }
.colchart-grid { position: absolute; inset: 0 0 auto; height: 200px; display: flex; flex-direction: column-reverse; justify-content: space-between; pointer-events: none; }
.colchart-grid i { display: block; height: 1px; background: var(--border); }
.colchart-cols { position: relative; height: 200px; display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 2px; align-items: end; }
.col { position: relative; height: 100%; display: flex; align-items: flex-end; justify-content: center; outline: none; }
.col-bar { width: min(24px, 70%); min-height: 0; background: var(--accent); border-radius: 4px 4px 0 0; transition: filter .15s; }
.col:hover .col-bar, .col:focus-visible .col-bar { filter: brightness(1.15); }
.col-val { position: absolute; transform: translateY(-4px); font-size: .74em; color: var(--text); font-weight: 600; white-space: nowrap; }
.colchart-x { display: grid; grid-template-columns: repeat(var(--n, 7), 1fr); gap: 2px; font-size: .72em; color: var(--muted); margin-top: 6px; text-align: center; font-variant-numeric: tabular-nums; white-space: nowrap; }
[data-tip] { position: relative; }
[data-tip]:hover::after, [data-tip]:focus-visible::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); z-index: 20; pointer-events: none;
  background: var(--text); color: var(--surface); font-size: .78rem; padding: .35em .7em; border-radius: 8px; white-space: nowrap; direction: rtl; font-weight: 500;
}
.col[data-tip]:hover::after { bottom: auto; top: -2px; transform: translate(-50%, -100%); }
.table-view { margin-top: 14px; font-size: .9em; }
.table-view summary { cursor: pointer; color: var(--accent-ink); font-weight: 600; }
.data-table { width: 100%; border-collapse: collapse; margin-top: 10px; font-variant-numeric: tabular-nums; }
.data-table th, .data-table td { padding: 6px 10px; text-align: start; border-bottom: 1px solid var(--border); }
.data-table th { color: var(--muted); font-weight: 600; font-size: .9em; }
.hbars { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.hbar { display: grid; grid-template-columns: 6.5em 1fr 2.5em; gap: 10px; align-items: center; font-size: .92em; outline: none; }
.hbar-label { white-space: nowrap; color: var(--text-2); }
.hbar-track { height: 12px; border-radius: 0 4px 4px 0; position: relative; }
.hbar-fill { position: absolute; inset-block: 0; inset-inline-start: 0; background: var(--accent); border-radius: 4px 0 0 4px; min-width: 0; }
.hbar-val { font-weight: 600; font-variant-numeric: tabular-nums; }
.hbar:hover .hbar-fill { filter: brightness(1.15); }
.best-hour { font-size: 1.02em; }
.best-hour b { color: var(--accent-ink); }
.hours { display: grid; grid-template-columns: repeat(24, 1fr); gap: 2px; margin-top: 12px; }
.hour { height: 34px; border-radius: 4px; background: color-mix(in srgb, var(--accent) calc(var(--v) * 100%), var(--surface-2)); outline: none; }
.hour.best { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text); }
.hours-axis { display: flex; justify-content: space-between; font-size: .72em; color: var(--muted); margin-top: 6px; }
.scale-legend { display: flex; align-items: center; gap: 8px; font-size: .76em; color: var(--muted); margin-top: 10px; justify-content: flex-end; }
.scale-legend i { width: 90px; height: 8px; border-radius: 4px; background: linear-gradient(to left, color-mix(in srgb, var(--accent) 12%, var(--surface-2)), var(--accent)); }

/* ---------- النوافذ والتنبيهات ---------- */
.dlg {
  border: 1px solid var(--border); border-radius: 24px; background: var(--surface); color: var(--text); padding: 0; width: min(600px, calc(100% - 24px));
  box-shadow: var(--shadow-lg); max-height: calc(100vh - 40px);
}
.dlg[open] { animation: dlg-in .22s var(--ease); }
@keyframes dlg-in { from { opacity: 0; transform: translateY(16px) scale(.98); } }
.dlg::backdrop { background: rgb(10 8 20 / .5); backdrop-filter: blur(4px); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.dlg-link { color: var(--accent-ink); font-weight: 600; font-size: .9em; padding: 0 8px; }
.dlg-compose { overflow: visible; }
.dlg-compose .composer { padding: 14px 16px; }
.dlg-compose .cmp-item textarea { min-height: 5em; }
.keys { padding: 12px 16px 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; }
.key-row { display: flex; align-items: center; gap: 10px; font-size: .92em; padding: 4px 0; }
.key-row kbd { min-width: 64px; text-align: center; }
.break { text-align: center; padding: 30px 24px; }
.break-ic { font-size: 3em; }
.break h2 { margin: 8px 0; }
.break p { color: var(--text-2); }
.break .row-actions { justify-content: center; margin-top: 16px; }
.toasts { position: fixed; bottom: 24px; 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(100% - 32px); }
.toast {
  pointer-events: auto; background: var(--text); color: var(--surface); padding: 11px 20px; border-radius: 16px; box-shadow: var(--shadow-lg);
  font-weight: 500; font-size: .94em; animation: toast-in .3s var(--ease), toast-out .4s 5s forwards; text-align: center;
}
.toast-err { background: var(--danger); color: #fff; }
.toast a { color: inherit; text-decoration: underline; margin-inline-start: .5em; font-weight: 700; }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(10px); visibility: hidden; } }
.lightbox { position: fixed; inset: 0; z-index: 150; background: rgb(6 5 12 / .92); display: grid; place-items: center; padding: 20px; animation: menu-in .2s; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 40px); border-radius: 12px; object-fit: contain; }
.lb-close { position: absolute; top: 16px; inset-inline-end: 16px; color: #fff; background: rgb(255 255 255 / .12); }

/* ---------- الصفحات بدون شريط (الهبوط والدخول) ---------- */
.bare-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: 1180px; margin: 0 auto; padding: 18px 20px; }
.bare-links { display: flex; align-items: center; gap: 18px; font-weight: 500; color: var(--text-2); }
.bare-main { max-width: 1180px; margin: 0 auto; padding: 0 20px 40px; }
.bare-foot { display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: center; padding: 24px; color: var(--muted); font-size: .88em; }
.bare-foot a:hover { color: var(--text); }
.auth { max-width: 460px; margin: 30px auto; padding: 32px; text-align: center; }
.auth h1 { font-size: 1.6em; font-weight: 800; margin: 12px 0 4px; }
.auth .form { text-align: start; margin-top: 20px; }
.auth-logo { display: flex; justify-content: center; }
.auth-links { display: flex; flex-direction: column; gap: 6px; margin-top: 18px; font-size: .92em; color: var(--muted); }
.auth-links a { color: var(--accent-ink); font-weight: 600; }
.welcome .auth { max-width: 560px; }
.welcome-h { text-align: start; margin: 20px 0 6px; font-size: 1em; }
.welcome .people { text-align: start; padding: 0; }
.welcome .mini-hubs { text-align: start; }
.welcome .row-actions { margin-top: 22px; }
.row-actions.center { justify-content: center; }

.hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; min-height: 72vh; padding: 20px 0 40px; }
.hero-kicker { display: inline-flex; align-items: center; gap: .4em; padding: .35em 1em; border-radius: 99px; background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; font-size: .9em; }
.hero h1 { font-size: clamp(2.4em, 5.5vw, 4.2em); font-weight: 800; line-height: 1.15; margin: 18px 0 14px; letter-spacing: -.01em; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { font-size: 1.15em; color: var(--text-2); max-width: 520px; }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 26px; }
.hero-stats { display: flex; gap: 24px; margin-top: 28px; color: var(--muted); }
.hero-stats b { color: var(--text); font-size: 1.3em; margin-inline-end: .2em; }
.hero-art { position: relative; height: 460px; display: grid; place-items: center; }
.echo { position: relative; display: grid; place-items: center; }
.echo .logo { position: relative; z-index: 2; box-shadow: 0 30px 60px -20px color-mix(in srgb, var(--accent) 70%, transparent); border-radius: 30%; }
.echo span { position: absolute; width: 140px; height: 140px; border-radius: 34%; border: 2px solid var(--accent); opacity: 0; animation: echo 3.6s var(--ease) infinite; }
.echo span:nth-child(2) { animation-delay: 1.2s; }
.echo span:nth-child(3) { animation-delay: 2.4s; }
@keyframes echo { 0% { transform: scale(.8); opacity: .55; } 100% { transform: scale(2.8); opacity: 0; } }
.float-card { position: absolute; width: 250px; padding: 14px; border-radius: 20px; background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--border); box-shadow: var(--shadow-lg); font-size: .9em; animation: float 7s ease-in-out infinite; z-index: 3; }
.float-card p { margin: 6px 0; color: var(--text-2); }
.fc-head { display: flex; align-items: center; gap: 8px; }
.fc-rx { font-size: .95em; }
.fc-0 { top: 0; inset-inline-start: 0; }
.fc-1 { bottom: 0; inset-inline-end: 0; animation-delay: -3.5s; }
@keyframes float { 50% { transform: translateY(-12px); } }
.features { padding: 30px 0; }
.features h2, .landing-trends h2 { text-align: center; font-size: 1.8em; font-weight: 800; margin-bottom: 24px; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.feature { padding: 22px; transition: transform .25s var(--ease), border-color .25s; }
.feature:hover { transform: translateY(-4px); border-color: var(--accent); }
.feature-emo { font-size: 1.9em; margin-bottom: 8px; }
.feature h3 { font-size: 1.1em; margin-bottom: 6px; }
.feature p { color: var(--text-2); margin: 0; font-size: .95em; }
.landing-trends { padding: 30px 0; }
.cta-band { text-align: center; padding: 44px 24px; margin: 30px 0; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 16%, var(--surface)), color-mix(in srgb, var(--accent-2) 14%, var(--surface))); }
.cta-band h2 { font-size: 1.8em; font-weight: 800; }
.cta-band p { color: var(--text-2); margin: 8px 0 20px; }

/* ---------- الجوال ---------- */
.mtop, .tabbar, .scrim { display: none; }

@media (max-width: 1200px) {
  :root { --side-w: 300px; --nav-w: 230px; }
}
@media (max-width: 1080px) {
  .shell { grid-template-columns: 84px minmax(0, var(--main-w)); justify-content: center; }
  .shell.is-wide { grid-template-columns: 84px minmax(0, 1fr); }
  .side { display: none; }
  .nav { align-items: center; padding: 14px 8px; }
  .nav .brand span, .nav-tx, .nav-me-tx, .nav-me-dots, .btn-compose span { display: none; }
  .brand { padding: 4px 0 12px; }
  .nav-link { justify-content: center; padding: 11px; width: auto; }
  .nav-sub { margin: 0; border: 0; padding: 0; }
  .btn-compose { width: 50px; height: 50px; padding: 0; border-radius: 17px; }
  .nav-me summary { padding: 4px; }
  .menu-pop.menu-up { inset-inline-start: 0; inset-inline-end: auto; min-width: 220px; }
  .nav-guest .btn { padding: .5em; font-size: .8em; }
}
@media (max-width: 760px) {
  :root { --r: 18px; }
  body { padding-bottom: 76px; }
  .shell, .shell.is-wide { display: block; padding: 0 10px; }
  .mtop {
    display: flex; position: sticky; top: 0; z-index: 35; align-items: center; justify-content: space-between; padding: 8px 10px;
    background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
  }
  .mtop .av { width: 32px; height: 32px; }
  .page-head { top: 58px; padding: 8px 12px; margin-top: 8px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav {
    position: fixed; top: 0; bottom: 0; inset-inline-start: 0; height: auto; width: min(300px, 84vw); border-radius: 0; z-index: 60;
    transform: translateX(105%); transition: transform .3s var(--ease); align-items: stretch; background: var(--surface); padding: 18px 14px;
  }
  .nav.open { transform: none; }
  .nav .brand span, .nav-tx, .nav-me-tx, .nav-me-dots, .btn-compose span { display: initial; }
  .nav-me-tx { display: flex; }
  .nav-link { justify-content: flex-start; width: 100%; }
  .btn-compose { display: none; }
  .scrim { position: fixed; inset: 0; z-index: 55; background: rgb(10 8 20 / .45); opacity: 0; pointer-events: none; transition: opacity .3s; display: block; }
  .scrim.on { opacity: 1; pointer-events: auto; }
  .tabbar {
    display: flex; position: fixed; bottom: 0; inset-inline: 0; z-index: 40; justify-content: space-around; align-items: center;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: var(--glass); backdrop-filter: blur(18px) saturate(1.4);
    -webkit-backdrop-filter: blur(18px) saturate(1.4); border-top: 1px solid var(--border);
  }
  .tb { position: relative; display: grid; place-items: center; width: 52px; height: 46px; border-radius: 14px; color: var(--muted); }
  .tb .i { width: 1.5em; height: 1.5em; }
  .tb.active { color: var(--accent-ink); }
  .tb.active .i { stroke-width: 2.3; }
  .tb .badge { top: 4px; inset-inline-end: 6px; }
  .tb-fab { background: var(--grad); color: #fff !important; width: 52px; height: 52px; border-radius: 18px; transform: translateY(-14px); box-shadow: 0 10px 22px -8px color-mix(in srgb, var(--accent) 80%, transparent); }
  .post { padding: 13px; }
  .post-grid { gap: 10px; }
  .post .av-md { width: 42px; height: 42px; }
  .post-actions { max-width: none; }
  .handle { display: none; }
  .post-main .handle { display: inline; }
  .grid-2, .charts-2 { grid-template-columns: 1fr; }
  .cover { height: 150px; }
  .av-xl { width: 92px; height: 92px; font-size: 36px; }
  .profile-top { margin-top: -46px; padding: 0 14px; }
  .profile-info { padding: 10px 14px 14px; }
  .dm { grid-template-columns: 1fr; height: calc(100vh - 140px); position: static; margin-top: 8px; }
  .dm.has-conv .dm-list { display: none; }
  .dm:not(.has-conv) .dm-conv { display: none; }
  .dm-back { display: grid; }
  .hero { grid-template-columns: 1fr; min-height: 0; padding-top: 10px; text-align: center; }
  .hero p { margin-inline: auto; }
  .hero-cta, .hero-stats { justify-content: center; }
  .hero-art { height: 340px; }
  .float-card { width: 220px; font-size: .82em; }
  .feature-grid { grid-template-columns: 1fr; }
  .bare-links a:not(.btn) { display: none; }
  .theme-pick { grid-template-columns: repeat(2, 1fr); }
  .keys { grid-template-columns: 1fr; }
  .toasts { bottom: 86px; }
  .cmp-draft span { display: none; }
  .admin-row { grid-template-columns: 1fr; }
  .dlg { max-height: calc(100vh - 20px); }
  .hub-grid { grid-template-columns: 1fr; }
}
@media (min-width: 761px) and (max-width: 980px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .hero { grid-template-columns: 1fr; text-align: center; }
  .hero p { margin-inline: auto; }
  .hero-cta, .hero-stats { justify-content: center; }
}

/* ---------- الهدوء وتقليل الحركة ---------- */
[data-hidecounts="1"] .count, [data-calm="1"] .count { display: none !important; }
[data-calm="1"] .w-trends { display: none; }
[data-calm="1"] .aurora { opacity: .5; }
[data-motion="reduce"] *, [data-motion="reduce"] *::before, [data-motion="reduce"] *::after { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .toast { animation: none; }
}
@media (forced-colors: active) {
  .col-bar, .hbar-fill, .hour { forced-color-adjust: none; background: CanvasText; }
}
@media print {
  .nav, .side, .tabbar, .mtop, .post-actions, .composer-card, .aurora { display: none !important; }
  .shell { display: block; }
}
