/* فريق العمل — لوحة التحكم الشخصية
   Original code written for this project. No third-party code. */

:root {
  --bg: #12161f;
  --bg-2: #1a2029;
  --card: #1e2530;
  --card-2: #232b38;
  --ink: #f2eee6;
  --ink-2: #a8aeba;
  --ink-3: #6b7280;
  --gold: #d4a857;
  --teal: #5fae9e;
  --red: #e05a5a;
  --hairline: #2a3240;
  --radius: 16px;
  --nav-h: 64px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, "Segoe UI", Tahoma, "Noto Kufi Arabic", sans-serif;
  font-size: 15px;
  line-height: 1.65;
  min-height: 100vh;
}

#app { max-width: 560px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }

/* ── Top bar ─────────────────────────── */
#topbar {
  position: sticky; top: 0; z-index: 20;
  background: linear-gradient(var(--bg) 82%, transparent);
  padding: calc(env(safe-area-inset-top, 0px) + 14px) 18px 10px;
  display: flex; align-items: flex-start; justify-content: space-between;
}
#topbar-title { display: flex; gap: 12px; align-items: center; }
#topbar-logo { width: 42px; height: 42px; border-radius: 12px; }
#view-title { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
#view-subtitle { font-size: 12px; color: var(--ink-2); }
#online-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--teal); margin-top: 8px; }
#online-dot.off { background: var(--gold); }

/* ── Main ────────────────────────────── */
#view { flex: 1; padding: 6px 18px calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 28px); }

.section-label { font-size: 12px; color: var(--ink-3); margin: 22px 2px 8px; font-weight: 600; }
.section-label:first-child { margin-top: 6px; }

.card {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 10px;
}
.card.tappable { cursor: pointer; transition: border-color 0.15s, transform 0.1s; }
.card.tappable:active { transform: scale(0.985); border-color: var(--gold); }

.card h3 { font-size: 15px; font-weight: 700; }
.card p { color: var(--ink-2); font-size: 13.5px; margin-top: 4px; }

.rowline { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

.chip {
  display: inline-block; font-size: 11px; font-weight: 600;
  padding: 3px 10px; border-radius: 999px;
  background: var(--card-2); color: var(--ink-2);
  border: 1px solid var(--hairline);
}
.chip.gold { color: var(--gold); border-color: #3d3325; background: #241f16; }
.chip.teal { color: var(--teal); border-color: #24443d; background: #16241f; }

/* ── Stats ───────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat {
  background: var(--card); border: 1px solid var(--hairline);
  border-radius: var(--radius); padding: 12px 8px; text-align: center;
}
.stat b { display: block; font-size: 22px; color: var(--gold); font-weight: 700; }
.stat span { font-size: 11.5px; color: var(--ink-2); }

/* ── Team ────────────────────────────── */
.member { display: flex; gap: 12px; align-items: center; }
.avatar {
  width: 44px; height: 44px; border-radius: 14px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 17px; color: #12161f;
}
.member-meta { flex: 1; min-width: 0; }
.member-meta h3 { font-size: 14.5px; }
.member-meta p { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Buttons ─────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--gold); color: #12161f; border: 0; border-radius: 12px;
  font-family: inherit; font-size: 14px; font-weight: 700;
  padding: 12px 18px; cursor: pointer; text-decoration: none;
}
.btn:active { filter: brightness(0.92); }
.btn.ghost { background: var(--card-2); color: var(--ink); border: 1px solid var(--hairline); }
.btn.small { padding: 8px 14px; font-size: 13px; border-radius: 10px; }
.btn.block { display: flex; width: 100%; }
.btnrow { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

/* ── Forms ───────────────────────────── */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 6px; font-weight: 600; }
.field input[type="text"], .field textarea, .field select {
  width: 100%; background: var(--bg-2); color: var(--ink);
  border: 1px solid var(--hairline); border-radius: 12px;
  font-family: inherit; font-size: 14.5px; padding: 12px 14px;
}
.field textarea { min-height: 84px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { outline: 2px solid var(--gold); outline-offset: -1px; }

.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice {
  background: var(--bg-2); border: 1px solid var(--hairline); color: var(--ink-2);
  border-radius: 999px; padding: 8px 14px; font-size: 13px; font-weight: 600;
  font-family: inherit; cursor: pointer;
}
.choice.on { background: #241f16; color: var(--gold); border-color: var(--gold); }

/* ── Tasks ───────────────────────────── */
.task-state { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.st-new { background: #232b38; color: var(--ink-2); }
.st-sent { background: #1d2a3a; color: #7db3e8; }
.st-review { background: #2e2416; color: var(--gold); }
.st-approved { background: #16301f; color: #6fce8b; }
.st-done { background: #16241f; color: var(--teal); }

.suggest-note { font-size: 12px; color: var(--teal); margin-top: 6px; }
.suggest-note button { background: none; border: none; color: var(--gold); font: inherit; cursor: pointer; text-decoration: underline; padding: 0 2px; }

/* ── Workflow checklist ──────────────── */
.step { display: flex; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--hairline); align-items: flex-start; }
.step:last-child { border-bottom: 0; }
.step-check {
  min-width: 64px; height: 28px; padding: 0 10px; border-radius: 999px; border: 1.5px solid var(--ink-3);
  background: none; cursor: pointer; flex-shrink: 0; margin-top: 1px;
  color: var(--ink-2); font-family: inherit; font-weight: 600; font-size: 12px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
.step-check.on, .step.done .step-check { background: var(--teal); border-color: var(--teal); color: #12161f; }
.step.done .step-text { color: var(--ink-3); text-decoration: line-through; }
.step-text { font-size: 13.5px; }

/* ── Prompt box ──────────────────────── */
.promptbox {
  background: var(--bg-2); border: 1px solid var(--hairline); border-radius: 12px;
  padding: 14px; font-size: 12.8px; color: var(--ink-2);
  white-space: pre-wrap; max-height: 300px; overflow-y: auto; margin-top: 10px;
}

/* ── Bottom nav ──────────────────────── */
#bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  max-width: 560px; margin: 0 auto;
  display: flex; height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--bg-2); border-top: 1px solid var(--hairline);
}
.navbtn {
  flex: 1; background: none; border: 0; color: var(--ink-3);
  font-family: inherit; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.navbtn.on { color: var(--gold); }
.navicon { font-size: 20px; line-height: 1; }
.navlabel { font-size: 10.5px; font-weight: 600; }
.navbtn-add .navicon {
  background: var(--gold); color: #12161f; width: 40px; height: 40px;
  border-radius: 14px; display: flex; align-items: center; justify-content: center;
  font-size: 22px; margin-top: -14px; box-shadow: 0 4px 14px rgba(212, 168, 87, 0.3);
}

/* ── Sheet (modal) ───────────────────── */
/* مهم: سمة hidden لازم تكسب على display بتاعنا، وإلا الستار يفضل ظاهر دايمًا */
[hidden] { display: none !important; }
#sheet-backdrop {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(8, 10, 14, 0.72);
  display: flex; align-items: flex-end; justify-content: center;
}
#sheet-backdrop[hidden] { display: none; }
#sheet {
  background: var(--bg-2); border-radius: 20px 20px 0 0;
  width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto;
  padding: 20px 18px calc(env(safe-area-inset-bottom, 0px) + 24px);
  border-top: 1px solid var(--hairline);
}
#sheet h2 { font-size: 17px; margin-bottom: 4px; }
#sheet .sheet-sub { color: var(--ink-2); font-size: 13px; margin-bottom: 14px; }

/* ── Toast ───────────────────────────── */
#toast {
  position: fixed; bottom: calc(var(--nav-h) + 18px); left: 50%; transform: translateX(-50%);
  background: var(--card-2); border: 1px solid var(--hairline); color: var(--ink);
  border-radius: 999px; padding: 10px 20px; font-size: 13.5px; z-index: 50;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

/* ── Lists ───────────────────────────── */
.plain-list { list-style: none; }
.plain-list li { padding: 10px 2px; border-bottom: 1px solid var(--hairline); font-size: 13.5px; color: var(--ink-2); }
.plain-list li:last-child { border-bottom: 0; }
.plain-list b { color: var(--ink); }

.empty { text-align: center; color: var(--ink-3); padding: 36px 20px; font-size: 13.5px; }

.learn-note {
  background: #16241f; border: 1px solid #24443d; color: var(--teal);
  border-radius: 12px; padding: 10px 14px; font-size: 12.5px; margin-top: 12px;
}

.hr { border: 0; border-top: 1px solid var(--hairline); margin: 16px 0; }

a.ext { color: var(--gold); text-decoration: none; }
a.ext:active { text-decoration: underline; }

@media (min-width: 561px) {
  body { background: #0d1017; }
  #app { border-inline: 1px solid var(--hairline); }
  #bottomnav { border-radius: 18px 18px 0 0; }
}

/* ── شاشة القفل ── */
.lock-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 24px;
}
.lock-card {
  width: 100%;
  max-width: 340px;
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 28px 22px;
  text-align: center;
}
.lock-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 8px;
}
.lock-sub {
  color: var(--ink-2);
  font-size: 13px;
  margin-bottom: 18px;
}
.lock-input {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  color: var(--ink);
  font-size: 18px;
  text-align: center;
  letter-spacing: 6px;
  padding: 12px;
  margin-bottom: 12px;
}
.lock-input:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.lock-btn {
  width: 100%;
  background: var(--gold);
  color: #1a1408;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  padding: 12px;
  cursor: pointer;
}
.lock-btn:active { opacity: 0.85; }
.lock-msg {
  color: var(--red);
  font-size: 13px;
  min-height: 20px;
  margin-top: 10px;
}

/* ── محادثة الذكاء الحقيقي ── */
.ai-note { color: var(--ink-2); font-size: 12.5px; margin: 6px 0 12px; }
.ai-link { display: inline-block; margin-top: 10px; color: var(--teal); font-size: 13px; }
.ai-msgs {
  max-height: 46vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
  padding: 4px 2px;
}
.ai-bubble {
  background: var(--card-2);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}
.ai-bubble.me { background: var(--bg-2); border-color: var(--gold); align-self: flex-start; }
.ai-bubble.thinking { color: var(--ink-3); font-style: italic; }
.ai-form { display: flex; gap: 8px; align-items: flex-end; }
.ai-input {
  flex: 1;
  background: var(--bg-2);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  padding: 10px 12px;
  resize: none;
}
.ai-input:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.ai-send { width: auto; padding: 10px 18px; }
.ai-status { color: var(--red); font-size: 13px; min-height: 18px; margin-top: 8px; }
.ai-setup { padding: 4px 0; }
.out-body {
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--bg-2);
  border-radius: 10px;
  font-size: 13.5px;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 220px;
  overflow-y: auto;
}

.ai-label { font-size: 0.85rem; margin: 10px 0 4px; opacity: 0.85; }
.ai-mini-btn { background: none; border: 1px solid currentColor; border-radius: 8px; padding: 1px 10px; font-size: 0.8rem; cursor: pointer; opacity: 0.8; }

/* ── النواة: شات واحدة لكل الأدوات (v11) ── */
.core-card { border-color: rgba(212, 168, 87, 0.5); }
.core-badge {
  font-size: 10.5px; font-weight: 700; color: #12161f; background: var(--gold);
  border-radius: 8px; padding: 1px 8px; align-self: center;
}
.core-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.core-head-btns { display: flex; gap: 6px; }
.core-chip {
  background: var(--card-2); border: 1px solid var(--hairline); color: var(--ink);
  font-family: inherit; font-size: 13px; padding: 6px 12px; border-radius: 10px; cursor: pointer;
}
.core-chip:active { border-color: var(--gold); }
.core-gear {
  background: none; border: 1px solid var(--hairline); color: var(--ink-2);
  width: 36px; height: 36px; border-radius: 10px; font-size: 16px; cursor: pointer;
}
.core-note { color: var(--ink-3); font-size: 12px; margin-bottom: 10px; }
.core-msgs {
  display: flex; flex-direction: column; gap: 8px;
  min-height: 44vh; max-height: 56vh; overflow-y: auto;
  padding: 4px 2px; margin-bottom: 12px;
}
.core-empty {
  color: var(--ink-3); font-size: 13.5px; line-height: 1.9;
  border: 1px dashed var(--hairline); border-radius: 12px; padding: 14px; text-align: center;
}
.core-route { color: var(--ink-3); font-size: 11.5px; margin: -2px 0 4px; padding-inline-start: 4px; }
.core-meta { color: var(--ink-3); font-size: 11.5px; margin: -2px 0 2px; padding-inline-start: 4px; }
.core-handoff {
  align-self: flex-start; background: none; border: 1px solid var(--teal); color: var(--teal);
  font-family: inherit; font-size: 12.5px; padding: 5px 12px; border-radius: 9px; cursor: pointer;
  margin-bottom: 4px;
}
.core-form { display: flex; gap: 8px; align-items: flex-end; }
.core-input {
  flex: 1; background: var(--bg-2); border: 1px solid var(--hairline); border-radius: 10px;
  color: var(--ink); font-family: inherit; font-size: 14px; padding: 10px 12px; resize: none;
}
.core-input:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.core-send { width: auto; padding: 10px 18px; }
.core-status { color: var(--red); font-size: 13px; min-height: 18px; margin-top: 8px; }

/* ── المشاريع وخطة اليوم (v12) ── */
.plan-card { padding: 6px 4px; }
.plan-row {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 8px; border-bottom: 1px solid var(--hairline); cursor: pointer;
}
.plan-row:last-of-type { border-bottom: 0; }
.plan-num {
  width: 22px; height: 22px; border-radius: 50%; background: var(--gold); color: #12161f;
  font-weight: 700; font-size: 12px; display: flex; align-items: center; justify-content: center;
  flex: 0 0 22px; margin-top: 2px;
}
.plan-name { font-weight: 600; font-size: 14px; }
.plan-why { color: var(--ink-2); font-size: 12.5px; }
.plan-counts { color: var(--ink-3); font-size: 12px; padding: 8px 10px 4px; }
.mini-add {
  float: left; background: none; border: 1px solid var(--gold); color: var(--gold);
  border-radius: 8px; font-family: inherit; font-size: 11.5px; padding: 1px 8px; cursor: pointer;
}
.pflag { font-size: 11px; border-radius: 8px; padding: 1px 8px; align-self: center; white-space: nowrap; }
.f-late { background: rgba(224, 90, 90, 0.15); color: var(--red); }
.f-today { background: rgba(212, 168, 87, 0.18); color: var(--gold); }
.f-waiting { background: rgba(95, 174, 158, 0.16); color: var(--teal); }
.f-nonext, .f-stalled { background: rgba(168, 174, 186, 0.14); color: var(--ink-2); }
.f-ok { background: rgba(95, 174, 158, 0.12); color: var(--teal); }
.proj-sub { color: var(--ink-3); font-size: 12px; }

/* ── شريط الأوفلاين (v12.1) ── */
.offline-bar {
  margin: 0 18px 6px;
  background: rgba(212, 168, 87, 0.14); border: 1px solid var(--gold); color: var(--ink);
  border-radius: 12px; padding: 8px 12px; font-size: 12.5px; text-align: center;
}
.ai-bubble.pending { border-style: dashed; border-color: var(--gold); opacity: 0.85; }

/* ── التطوير الذاتي (v13): نتائج الفحص ── */
.sd-checks { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.sd-check { font-size: 13px; padding: 8px 10px; border-radius: 10px; background: var(--card-2); border: 1px solid var(--hairline); }
.sd-check.ok { color: #8fd6b4; }
.sd-check.bad { color: #e88b8b; }

/* v16 — بدائل الستايل المضمّن: سياسة الأمان (CSP style-src 'self') بتمنع style=""
   فكانت ألوان الدواير ودرجات الخط بتتشال من غير ما حد ياخد باله. */
.avatar.av-gemini { background: #7db3e8; }
.avatar.av-perplexity { background: #5fae9e; }
.avatar.av-deepseek { background: #9b8ce8; }
.avatar.av-copilot { background: #e8a37c; }
.avatar.av-mistral { background: #e87c8c; }
.avatar.av-grok { background: #c9c9c9; }
.t-ink { color: var(--ink); }
.t-strong { font-weight: 600; }
.t-sub12 { color: var(--ink-3); font-size: 12px; }
.t-sub125 { color: var(--ink-3); font-size: 12.5px; }
.t-13 { font-size: 13px; }
.t-teal-note { font-size: 12.5px; color: var(--teal); margin-top: 6px; }
.t-note12 { margin-top: 12px; font-size: 12px; color: var(--ink-3); }
.t-note8 { margin-top: 8px; font-size: 12px; color: var(--ink-3); }
.promptbox.tall { max-height: 120px; }

/* ═══ الأدوات الجاهزة والمشاريع (v17) ═══ */
.tool-prompt {
  white-space: pre-wrap; word-break: break-word;
  background: var(--bg-2); border: 1px solid var(--hairline); border-radius: 12px;
  padding: 12px; max-height: 260px; overflow: auto;
  font-size: 13px; line-height: 1.75; color: var(--ink-2);
}
.rule-box {
  border: 1px solid rgba(212, 168, 87, 0.45); background: rgba(212, 168, 87, 0.07);
  border-radius: 12px; padding: 10px 12px; margin: 10px 0; font-size: 13px;
}
.rule-box b { color: var(--gold); font-size: 13px; }
.rule-box .plain-list { margin-top: 4px; }
.tool-rule-line { color: var(--gold); font-size: 12.5px; }
.lock-input.grow { flex: 1; min-width: 0; }

.prog { display: flex; align-items: center; gap: 8px; margin: 8px 0 2px; }
.prog-bar { flex: 1; height: 7px; border-radius: 99px; background: rgba(255, 255, 255, 0.10); overflow: hidden; }
.prog-fill { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--gold), var(--teal)); }
.p0 { width: 0; } .p10 { width: 10%; } .p20 { width: 20%; } .p30 { width: 30%; } .p40 { width: 40%; }
.p50 { width: 50%; } .p60 { width: 60%; } .p70 { width: 70%; } .p80 { width: 80%; } .p90 { width: 90%; }
.p100 { width: 100%; }
.prog-txt { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.proj-res { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; }

.plan-steps { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 8px; }
.step-item {
  display: flex; gap: 8px; align-items: flex-start; text-align: right;
  background: var(--bg-2); border: 1px solid var(--hairline); border-radius: 10px;
  padding: 8px 10px; color: var(--ink); font: inherit; font-size: 13px;
  cursor: pointer; line-height: 1.5;
}
.step-item.done { opacity: 0.62; }
.step-item.done .step-box { background: var(--teal); border-color: var(--teal); color: #08131a; }
.step-box {
  width: 18px; height: 18px; border-radius: 6px; border: 1px solid rgba(255, 255, 255, 0.25);
  display: grid; place-items: center; font-size: 11px; flex: 0 0 auto; margin-top: 2px;
}
.res-list li { font-size: 13px; color: var(--ink-2); }
.res-date { font-size: 11px; color: var(--ink-3); }

.chip.os-new { color: var(--gold); border-color: #3d3325; background: #241f16; }
.chip.os-work { color: var(--teal); border-color: #24443d; background: #16241f; }
.chip.os-done { color: #bfe8df; border-color: #2c5a51; background: #122420; }
.chip.os-lost { color: #e08a8a; border-color: #472626; background: #241616; }

/* ── الجدولة (v19) ───────────────────────── */
.chip.off { color: var(--ink-3); border-color: var(--hairline); background: #1a1f28; }

.brief-box {
  white-space: pre-wrap; word-break: break-word;
  font-family: inherit; font-size: 13.5px; line-height: 1.9;
  color: var(--ink-2); background: var(--bg-2);
  border: 1px solid var(--hairline); border-radius: 12px;
  padding: 12px 14px; margin: 4px 0 2px;
}

.sched-card .btnrow .choice { flex: 1 1 30%; }
.sched-tools { align-items: center; }
.sched-time {
  background: var(--bg-2); color: var(--ink);
  border: 1px solid var(--hairline); border-radius: 10px;
  padding: 8px 10px; font-family: inherit; font-size: 14px;
  min-width: 118px;
}
.sched-log { display: flex; flex-direction: column; gap: 2px; }
.sched-run { padding: 10px 0; border-bottom: 1px solid var(--hairline); }
.sched-run:last-child { border-bottom: 0; }
.sched-run .rowline { align-items: baseline; }
.sched-run-time { color: var(--ink-3); font-size: 12px; }
.sched-time-label { color: var(--ink-3); font-size: 12.5px; }
.sched-card .rowline { align-items: flex-start; }
.sched-card .chip { white-space: nowrap; flex: 0 0 auto; }

/* ── أوامر محلية (v21) ───────────────────── */
.core-quick {
  display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 8px;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.core-quick::-webkit-scrollbar { display: none; }
.core-qbtn {
  flex: 0 0 auto; background: var(--card-2); color: var(--ink-2);
  border: 1px solid var(--hairline); border-radius: 999px;
  padding: 6px 12px; font-family: inherit; font-size: 12.5px; cursor: pointer;
}
.core-qbtn:active { border-color: var(--gold); color: var(--gold); }
/* رد محلي (v21): من بيانات الجهاز، مفيش نت */
.ai-bubble.local { border-color: #24443d; }

/* ── v23: الأدوات جوه نفس الشات ───────── */
.core-chip-tool { font-size: 12.5px; }
.core-chip-tool.on { border-color: var(--gold); color: var(--gold); background: #241f16; }
.core-engines { color: var(--ink-3); font-size: 11.5px; margin-top: 6px; line-height: 1.7; }
.core-handoff.paste { border-color: var(--gold); color: var(--gold); margin-inline-start: 6px; }
.tool-pick-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.tool-pick {
  text-align: start; background: var(--bg-2); border: 1px solid var(--hairline); color: var(--ink);
  border-radius: 10px; padding: 10px 12px; font-family: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
}
.tool-pick.on { border-color: var(--gold); color: var(--gold); background: #241f16; }

/* ── v23: المدير التنفيذي ───────── */
.mgr-rule { justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--hairline); }
.mgr-rule:last-child { border-bottom: none; }
.mgr-rule span { font-size: 13.5px; }
.mgr-rule .choice { padding: 5px 12px; font-size: 12px; }

.rl-video{width:100%;max-width:320px;border-radius:12px}

/* ═══ فريق المحتوى: الإعداد والقفل ═══ */
.field input[type="password"], .field input[type="number"] {
  width: 100%; padding: 12px; border-radius: 12px; border: 1px solid var(--hairline);
  background: var(--card-2); color: var(--ink); font-size: 18px; letter-spacing: 6px; text-align: center;
}
.field input.keyin { letter-spacing: 0; font-size: 14px; text-align: left; direction: ltr; }
.steps { margin: 8px 18px 0 0; color: var(--ink-2); font-size: 13.5px; line-height: 1.9; }
.note { color: var(--ink-2); font-size: 12.5px; line-height: 1.8; }
.okmsg { color: var(--teal); font-size: 13px; margin-top: 8px; }
.errmsg { color: #f87171; font-size: 13px; margin-top: 8px; }
.dots { display: flex; gap: 6px; justify-content: center; margin-bottom: 10px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--hairline); display: inline-block; }
.dots i.on { background: var(--gold); }
.linkbtn { color: var(--gold); text-decoration: underline; background: none; border: 0; font-size: 13px; cursor: pointer; padding: 4px; }

/* ═══ هوية «فريقك»: النواة. داكن متدرج ومبهج، تباين مقروء ═══ */
:root {
  --bg: #15123A; --bg-2: #1D1950; --card: rgba(255,255,255,.08); --card-2: rgba(255,255,255,.12);
  --ink: #FFFFFF; --ink-2: #D2CFF5; --ink-3: #A9A5D8;
  --gold: #8F7FFF; --teal: #5FE3C0; --red: #FF8A8A; --sun: #FFE27A; --hairline: rgba(255,255,255,.16);
  --radius: 24px; --nav-h: 70px; --btn: linear-gradient(135deg, #6A5AF9, #3F6FE8);
}
html, body { background: #15123A; }
body { font-family: "Noto Sans Arabic", "Segoe UI", Tahoma, system-ui, sans-serif; font-size: 16px; line-height: 1.8; color: var(--ink); background: radial-gradient(1200px 600px at 50% -10%, #3B2FA8 0%, #15123A 60%) fixed; }
#topbar { background: linear-gradient(#15123A 78%, transparent); }
#view-title { font-size: 24px; font-weight: 800; }
#view-subtitle { color: var(--ink-2); }
#topbar-logo { border-radius: 14px; box-shadow: 0 0 18px rgba(124,108,255,.55); }
.card { background: var(--card); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; backdrop-filter: blur(8px); animation: pop .3s ease both; }
.card h3 { font-size: 17px; color: #fff; }
.card p { color: var(--ink-2); font-size: 15px; }
.card.tappable:active { border-color: #A5F3FF; }
.btn { background: var(--btn); color: #fff; border: 0; border-radius: 18px; padding: 13px 22px; font-size: 16px; font-weight: 800; font-family: inherit; box-shadow: 0 8px 22px rgba(80,70,220,.45); transition: transform .12s, box-shadow .12s; cursor: pointer; }
.btn:active { transform: scale(.97); box-shadow: 0 3px 10px rgba(80,70,220,.4); filter: none; }
.btn.ghost { background: rgba(255,255,255,.1); color: #fff; border: 1.5px solid var(--hairline); box-shadow: none; }
.btn.small { padding: 9px 16px; font-size: 14px; border-radius: 14px; }
.btn[disabled] { opacity: .5; }
.btnrow { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.chip { border-radius: 999px; font-weight: 700; }
.chip.gold { color: #FFE9A8; background: rgba(255,226,122,.16); border-color: rgba(255,226,122,.4); }
.chip.teal { color: #9CF5DE; background: rgba(95,227,192,.16); border-color: rgba(95,227,192,.4); }
.chip.off { color: var(--ink-2); background: rgba(255,255,255,.08); border-color: var(--hairline); }
.field input[type="text"], .field input[type="password"], .field textarea, .field select, .addrow input {
  background: rgba(10,8,40,.55); color: #fff; border: 1.5px solid var(--hairline); border-radius: 16px; font-family: inherit; font-size: 16px; padding: 13px; width: 100%;
}
.field input::placeholder, .field textarea::placeholder, .addrow input::placeholder { color: #A9A5D8; }
.field input:focus, .field textarea:focus, .field select:focus, .addrow input:focus { outline: 3px solid #A5F3FF; outline-offset: 0; }
.field label { color: var(--ink-2); }
.note { color: var(--ink-2); font-size: 13.5px; }
.errmsg { color: var(--red); font-weight: 700; min-height: 1em; }
.okmsg { color: var(--teal); font-weight: 700; }
#bottomnav { background: rgba(21,18,58,.92); backdrop-filter: blur(14px); border-top: 1px solid var(--hairline); }
.navbtn { color: var(--ink-3); }
.navbtn.active, .navbtn.on { color: #fff; }
.navbtn.active .navicon { background: var(--btn); border-radius: 14px; box-shadow: 0 0 14px rgba(124,108,255,.7); }
.navicon { font-size: 21px; padding: 4px 16px; transition: background .2s; }
.navlabel { font-size: 11.5px; font-weight: 700; }
#online-dot { background: var(--teal); box-shadow: 0 0 8px var(--teal); }
#toast { background: #fff; color: #15123A; border-radius: 999px; padding: 10px 20px; font-weight: 800; }
.room-hero { background: linear-gradient(160deg, rgba(124,108,255,.35), rgba(63,111,232,.18)); border: 1px solid var(--hairline); border-radius: 30px; padding: 20px 18px 22px; margin: 6px 0 16px; text-align: center; animation: pop .3s ease both; }
.room-hero h2 { margin: 0 0 12px; font-size: 24px; font-weight: 800; }
.room-hero .orbbox { display: flex; justify-content: center; margin-bottom: 4px; }
.room-hero textarea { text-align: right; min-height: 96px; }
.room-big { width: 100%; font-size: 20px; padding: 16px; margin-top: 8px; }
.more { margin: 10px 0; text-align: right; }
.more summary { color: var(--ink-2); padding: 8px 0; cursor: pointer; font-weight: 600; }
.nudge { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: rgba(255,226,122,.14); border: 1.5px solid rgba(255,226,122,.45); border-radius: 20px; padding: 10px 14px; margin-bottom: 12px; font-weight: 700; }
.tpls { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.tpls .note { text-align: center; }
.trow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--hairline); }
.trow:first-of-type { border-top: 0; }
.ttl { flex: 1; font-size: 16px; font-weight: 700; }
.ttl small { display: block; font-size: 12.5px; color: var(--ink-3); font-weight: 500; }
.tbtn { display: flex; gap: 6px; }
.mv { width: 40px; height: 40px; border-radius: 13px; border: 1.5px solid var(--hairline); background: rgba(255,255,255,.08); color: #fff; font-size: 18px; font-family: inherit; cursor: pointer; }
.mv.go { background: rgba(95,227,192,.2); border-color: rgba(95,227,192,.55); color: #9CF5DE; font-weight: 800; }
.chk { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-top: 1px solid var(--hairline); font-size: 16px; }
.chk input { width: 22px; height: 22px; margin-top: 4px; accent-color: #8F7FFF; }
.coltabs { display: flex; gap: 6px; margin: 10px 0; }
.ctab { flex: 1; border: 1.5px solid var(--hairline); background: rgba(255,255,255,.06); color: var(--ink-2); border-radius: 15px; padding: 10px 4px; font-family: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; }
.ctab.on { background: var(--btn); color: #fff; border-color: transparent; box-shadow: 0 6px 16px rgba(80,70,220,.4); }
.board { display: block; }
.bcol { display: none; background: var(--card); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 10px 14px; }
.bcol.on { display: block; animation: pop .25s ease both; }
.bh { display: none; }
.ph { font-size: 20px; font-weight: 800; }
.addrow { display: flex; gap: 8px; margin: 14px 0 4px; }
.rep { white-space: pre-wrap; background: rgba(10,8,40,.5); border-radius: 16px; padding: 12px; font-family: inherit; font-size: 15px; line-height: 1.9; color: #fff; }
.home-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0; }
.tile { background: var(--card); color: #fff; border: 1px solid var(--hairline); border-radius: 24px; padding: 26px 10px; font-size: 18px; font-weight: 800; font-family: inherit; cursor: pointer; }
.room-prog { text-align: center; }
.room-prog progress { width: 100%; height: 12px; accent-color: #8F7FFF; }
.emptybox { text-align: center; padding: 8px 0 4px; }
.emptybox p { margin-top: 0; }
.celebrate { position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(21,18,58,.82); animation: fadeout 1.9s ease forwards; pointer-events: none; }
.celebrate p { font-size: 22px; font-weight: 800; margin-top: 6px; }
.linkbtn { background: none; border: 0; color: #A5F3FF; font-family: inherit; font-size: 15px; text-decoration: underline; cursor: pointer; }
a { color: #A5F3FF; }
/* ── النواة: الحركة حسب الحالة ── */
.orb { display: block; overflow: visible; max-width: 100%; }
.orb .o-core, .orb .o-net, .orb .o-halo, .orb .o-orbit, .orb .o-burst { transform-box: fill-box; transform-origin: center; }
.orb .o-ln { stroke: #A5F3FF; stroke-opacity: .45; stroke-width: 1.3; }
.orb .o-ln2 { stroke-opacity: .25; }
.orb .o-nd { fill: #A5F3FF; }
.orb .o-nd1 { fill: #FF9AD5; }
.orb .o-nd2 { fill: #FFE27A; }
.orb .o-burst, .orb .o-spk { opacity: 0; }
.orb-idle .o-core { animation: breathe 4.2s ease-in-out infinite; }
.orb-idle .o-halo { animation: halo 4.2s ease-in-out infinite; }
.orb-idle .o-net { animation: spin 70s linear infinite; }
.orb-idle .o-orbit { animation: spin 40s linear infinite reverse; }
.orb-think .o-core { animation: pulse .9s ease-in-out infinite; }
.orb-think .o-halo { animation: halo .9s ease-in-out infinite; }
.orb-think .o-net { animation: spin 9s linear infinite; }
.orb-think .o-orbit { animation: spin 5s linear infinite reverse; }
.orb-think .o-nd { animation: blink 1.1s ease-in-out infinite; }
.orb-think .o-nd1 { animation-delay: .3s; } .orb-think .o-nd2 { animation-delay: .6s; }
.orb-success .o-core { animation: flash 1.1s ease-out both, breathe 4.2s 1.1s ease-in-out infinite; }
.orb-success .o-burst { animation: burst 1.2s ease-out both; }
.orb-success .o-burst2 { animation-delay: .25s; }
.orb-success .o-spk { animation: twinkle 1.6s ease-in-out infinite; opacity: 1; }
.orb-success .o-net { animation: spin 30s linear infinite; }
.orb-empty { opacity: .7; }
.orb-empty .o-core { animation: breathe 7s ease-in-out infinite; filter: saturate(.6); }
.orb-empty .o-net { animation: spin 120s linear infinite; opacity: .5; }
.orb-empty .o-nd:nth-child(n+8) { opacity: 0; }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07); } }
@keyframes pulse { 0%, 100% { transform: scale(.96); } 50% { transform: scale(1.14); } }
@keyframes halo { 0%, 100% { opacity: .55; transform: scale(.96); } 50% { opacity: 1; transform: scale(1.08); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes blink { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@keyframes flash { 0% { transform: scale(.8); filter: brightness(2.2); } 40% { transform: scale(1.3); filter: brightness(1.8); } 100% { transform: scale(1); filter: none; } }
@keyframes burst { 0% { opacity: .9; transform: scale(1); } 100% { opacity: 0; transform: scale(3.2); } }
@keyframes twinkle { 0%, 100% { opacity: .2; } 50% { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes fadeout { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }
@media (min-width: 720px) {
  #app, #bottomnav { max-width: 980px; }
  .coltabs { display: none; }
  .board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .bcol { display: block; }
  .bh { display: block; font-size: 15px; margin-bottom: 6px; color: var(--ink-2); }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } .celebrate { display: none; } }
.rowline .btn.small { white-space: nowrap; }
.ph { line-height: 1.4; }

/* ===== v2: حي وعصري ===== */
:root { --ox: 0px; --oy: 0px; }
body { background: radial-gradient(120% 70% at 80% -10%, rgba(124,108,255,.35), transparent 60%), radial-gradient(90% 60% at 0% 100%, rgba(34,211,238,.18), transparent 60%), #0F0D2E; background-size: 140% 140%, 140% 140%, auto; animation: ambient 22s ease-in-out infinite alternate; }
@keyframes ambient { from { background-position: 0% 0%, 100% 100%, 0 0; } to { background-position: 100% 30%, 0% 60%, 0 0; } }
.paused *, .paused body { animation-play-state: paused !important; }
.room-hero .orbbox, .room-prog .orbbox, .emptybox svg { transform: translate(calc(var(--ox) * .8), calc(var(--oy) * .8)); transition: transform .25s ease-out; }
.orb .o-core { filter: drop-shadow(0 0 14px rgba(124,108,255,.8)); }
.orb .o-pt { fill: #CFE9FF; opacity: .15; animation: twinkle 3s ease-in-out infinite; }
.orb .o-sat { transform-box: fill-box; transform-origin: -58px 50%; }
.orb .o-parts { transform-box: fill-box; transform-origin: center; animation: spin 90s linear infinite; }
.orb-idle .o-sat, .orb-success .o-sat { transform-origin: 100px 100px; transform-box: view-box; animation: spin 14s linear infinite; }
.orb-think .o-sat { transform-origin: 100px 100px; transform-box: view-box; animation: spin 2.2s linear infinite; }
.orb-think .o-pt { animation-duration: 1s; }
.orb-empty .o-sat { display: none; }
.orb.typing .o-core { animation: pulse .5s ease-in-out infinite; }
.orb.typing .o-halo { opacity: 1; }
.room-hero { background: linear-gradient(160deg, rgba(124,108,255,.38), rgba(34,211,238,.10)); backdrop-filter: blur(18px); box-shadow: 0 10px 40px rgba(60,40,200,.35), inset 0 1px 0 rgba(255,255,255,.18); }
.card { backdrop-filter: blur(14px); box-shadow: 0 6px 24px rgba(10,8,50,.35), inset 0 1px 0 rgba(255,255,255,.08); }
#view > * { animation: rise .5s cubic-bezier(.2,.8,.2,1) both; }
#view > *:nth-child(2) { animation-delay: .06s; } #view > *:nth-child(3) { animation-delay: .12s; } #view > *:nth-child(4) { animation-delay: .18s; } #view > *:nth-child(n+5) { animation-delay: .24s; }
@keyframes rise { from { opacity: 0; transform: translateY(16px) scale(.98); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
.btn, .tile, .navbtn, .mv { position: relative; overflow: hidden; transition: transform .15s, box-shadow .2s; }
.btn:active, .tile:active, .mv:active { transform: scale(.95); }
.btn:not(.ghost):not([disabled]) { box-shadow: 0 6px 22px rgba(99,102,241,.5); }
.rip { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: rgba(255,255,255,.55); pointer-events: none; animation: ripple .6s ease-out forwards; }
@keyframes ripple { to { transform: scale(26); opacity: 0; } }
.bento { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.bt { background: linear-gradient(160deg, rgba(255,255,255,.12), rgba(255,255,255,.04)); border: 1px solid var(--hairline); border-radius: 22px; padding: 12px 8px; text-align: center; backdrop-filter: blur(12px); }
.bt b { display: block; font-size: 26px; font-weight: 800; background: linear-gradient(90deg, #A5F3FF, #C4B5FD); -webkit-background-clip: text; background-clip: text; color: transparent; }
.bt.good b { background: linear-gradient(90deg, #9CF5DE, #FFE27A); -webkit-background-clip: text; background-clip: text; }
.bt span { font-size: 12px; color: var(--ink-2); font-weight: 700; }
.roster { list-style: none; padding: 0; margin: 12px 0 0; text-align: right; }
.roster li { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-top: 1px solid var(--hairline); font-weight: 700; color: var(--ink-3); }
.roster li i { width: 10px; height: 10px; border-radius: 50%; background: #4B4880; }
.roster li em { margin-inline-start: auto; font-style: normal; font-size: 12.5px; font-weight: 600; }
.roster li.done { color: #9CF5DE; } .roster li.done i { background: #5FE3C0; }
.roster li.act { color: #fff; } .roster li.act i { background: #A5F3FF; box-shadow: 0 0 10px #A5F3FF; animation: blink .8s ease-in-out infinite; }
.errmsg { color: #FFE9A8; font-weight: 600; background: rgba(255,226,122,.12); border: 1px solid rgba(255,226,122,.35); border-radius: 14px; padding: 8px 12px; }
.errmsg:empty { display: none; }
.demo-banner { display: flex; flex-direction: column; gap: 6px; background: linear-gradient(135deg, rgba(34,211,238,.16), rgba(124,108,255,.22)); border: 1px solid rgba(165,243,255,.4); border-radius: 22px; padding: 12px 14px; margin-bottom: 12px; font-size: 14px; }
.demo-banner b { color: #A5F3FF; } .demo-banner .btn { align-self: flex-start; }
.steps3 { list-style: none; padding: 0; margin: 14px 0 6px; text-align: right; display: flex; flex-direction: column; gap: 14px; }
.steps3 li { display: flex; gap: 12px; align-items: flex-start; }
.steps3 .n { flex: none; width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, #7C6CFF, #22D3EE); display: grid; place-items: center; font-weight: 800; }
.steps3 li > div { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.steps3 a.btn { text-decoration: none; text-align: center; display: block; }
.steps3 small { color: var(--ink-3); }
.demohint { margin-top: 10px; }
.linkbtn { background: none; border: 0; color: #A5F3FF; font: inherit; text-decoration: underline; cursor: pointer; padding: 0 4px; }
@media (prefers-reduced-motion: reduce) { *, body { animation: none !important; transition: none !important; } }

/* ===== شعارات الأدوار ===== */
.emb { overflow: visible; display: block; }
.emb * { transform-box: fill-box; transform-origin: center; }
.emb .em-badge { opacity: 0; transform: scale(.3); transition: opacity .3s, transform .35s cubic-bezier(.3,1.6,.5,1); }
.em-done .em-badge { opacity: 1; transform: none; }
.em-idle { opacity: .8; filter: saturate(.8); }
.em-work { filter: drop-shadow(0 0 7px rgba(165,243,255,.7)); }
.em-done { filter: drop-shadow(0 0 6px rgba(95,227,192,.55)); }
.em-sweep { transform-origin: 24px 24px !important; transform-box: view-box !important; }
.em-idle .em-sweep { animation: spin 14s linear infinite; } .em-work .em-sweep { animation: spin 1.6s linear infinite; }
.em-work .em-blip { animation: blink .8s infinite; } .em-idle .em-blip { opacity: .5; }
.em-needle { transform-origin: 24px 24px !important; transform-box: view-box !important; }
.em-idle .em-needle { animation: swing 6s ease-in-out infinite; } .em-work .em-needle { animation: swing 1.4s ease-in-out infinite; }
@keyframes swing { 0%,100% { transform: rotate(-18deg); } 50% { transform: rotate(28deg); } }
.em-work .em-route, .em-done .em-route { animation: dash 1s linear infinite; } .em-idle .em-route { animation: dash 6s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -14; } }
.em-idle .em-cube { animation: bob 4s ease-in-out infinite; } .em-work .em-cube { animation: bob 1s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(1.5px) scale(.97); } 50% { transform: translateY(-2.5px) scale(1.04); } }
.em-wave { opacity: 0; }
.em-idle .em-wave.w1, .em-work .em-wave { animation: wave 2.4s ease-out infinite; }
.em-work .em-wave { animation-duration: 1.2s; } .em-wave.w2 { animation-delay: .4s !important; } .em-wave.w3 { animation-delay: .8s !important; }
.em-done .em-wave.w1 { opacity: .5; transform: scale(1.5); }
@keyframes wave { 0% { opacity: .9; transform: scale(.6); } 100% { opacity: 0; transform: scale(2); } }
.em-check { stroke-dasharray: 1; stroke-dashoffset: 0; }
.em-idle .em-check { stroke-dashoffset: 1; opacity: .35; }
.em-idle .em-shield { animation: breathe 4.2s ease-in-out infinite; }
.em-work .em-shield { animation: pulse 1s ease-in-out infinite; } .em-work .em-check { animation: draw 1.4s ease-in-out infinite; }
@keyframes draw { 0% { stroke-dashoffset: 1; } 60%, 100% { stroke-dashoffset: 0; } }
.em-done .em-shield { fill: rgba(95,227,192,.35); stroke: #5FE3C0; }
.em-n { opacity: .6; } .em-work .em-n { animation: blink .9s infinite; } .em-work .n2 { animation-delay: .2s; } .em-work .n3 { animation-delay: .4s; } .em-work .n4 { animation-delay: .6s; }
.em-idle .em-n { animation: blink 4s infinite; } .em-done .em-n { opacity: 1; }
.em-idle .em-ln { animation: dash 8s linear infinite; } .em-work .em-ln { animation: dash .6s linear infinite; }
.em-ln.l2 { animation-delay: -.2s; } .em-ln.l3 { animation-delay: -.4s; }
.embcard { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; border-radius: 20px; background: linear-gradient(160deg, rgba(255,255,255,.1), rgba(255,255,255,.03)); border: 1px solid var(--hairline); backdrop-filter: blur(10px); text-align: center; transition: border-color .3s, box-shadow .3s; }
.embcard b { font-size: 12.5px; } .embcard small { font-size: 11px; color: var(--ink-3); min-height: 1em; }
.em-c-work { border-color: rgba(165,243,255,.6); box-shadow: 0 0 18px rgba(165,243,255,.25); } .em-c-done { border-color: rgba(95,227,192,.5); }
.emstrip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 4px 0 14px; }
.emstrip.s4 { grid-template-columns: repeat(4, 1fr); }
.roster li .embart { width: 34px; height: 34px; flex: none; }
.roster li i { display: none; }
.room-msg > b { display: flex; align-items: center; gap: 8px; }
.room-msg > b .emb { flex: none; }

/* ===== هوية هندسية: نجمة ثمانية، ضوء ذهبي، تنفّس هادي ===== */
.orb .o-star, .orb .o-gems { transform-box: view-box; transform-origin: 100px 100px; opacity: .85; }
.orb .o-star { animation: spin 80s linear infinite; }
.orb .o-gems { animation: spin 120s linear infinite reverse; }
.orb-think .o-star { animation-duration: 14s; } .orb-think .o-gems { animation-duration: 20s; }
.orb-empty .o-star, .orb-empty .o-gems { opacity: .35; }
.orb .o-halo { filter: drop-shadow(0 0 10px rgba(255,226,122,.35)); }
.orb-idle .o-core { animation-duration: 6s; } .orb-idle .o-halo { animation-duration: 6s; }
.room-hero, .card, .bt, .embcard { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cpath d='M32 6l5 11 12-5-5 12 11 5-11 5 5 12-12-5-5 11-5-11-12 5 5-12-11-5 11-5-5-12 12 5z' fill='none' stroke='%23FFE27A' stroke-opacity='.07' stroke-width='1'/%3E%3C/svg%3E"), linear-gradient(160deg, rgba(255,255,255,.1), rgba(255,255,255,.03)); background-size: 64px 64px, auto; }
.room-hero { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cpath d='M32 6l5 11 12-5-5 12 11 5-11 5 5 12-12-5-5 11-5-11-12 5 5-12-11-5 11-5-5-12 12 5z' fill='none' stroke='%23FFE27A' stroke-opacity='.10' stroke-width='1'/%3E%3C/svg%3E"), linear-gradient(160deg, rgba(124,108,255,.38), rgba(34,211,238,.10)); background-size: 64px 64px, auto; border-color: rgba(255,226,122,.28); box-shadow: 0 10px 40px rgba(60,40,200,.35), 0 0 30px rgba(255,226,122,.08), inset 0 1px 0 rgba(255,226,122,.25); }
#topbar-title h1 { background: linear-gradient(90deg, #fff, #FFE9A8); -webkit-background-clip: text; background-clip: text; color: transparent; }
.btn:not(.ghost):not([disabled]) { box-shadow: 0 6px 22px rgba(99,102,241,.5), 0 0 0 1px rgba(255,226,122,.25) inset; }
.emb.fig .fg-body { transform-origin: 24px 52px !important; transform-box: view-box !important; }
.fig.em-idle .fg-body { animation: sway 5s ease-in-out infinite; } .fig.em-work .fg-body { animation: sway 1.6s ease-in-out infinite; }
@keyframes sway { 0%,100% { transform: rotate(-1.6deg); } 50% { transform: rotate(1.6deg); } }
.fig .em-badge { transform-origin: center; }

/* ===== v2 شعارات: عمق وحركة بيانات ===== */
.emp * { transform-box: fill-box; transform-origin: center; }
.emp .ep-star { transform-box: view-box; transform-origin: 28px 28px; }
.emp.fig2 .ep-star { transform-origin: 28px 32px; }
.emp .ep-orbit { transform-box: view-box !important; }
.emp .ep-pulse { opacity: 0; }
.emp { filter: drop-shadow(0 2px 8px rgba(10,8,50,.6)); }
.emp.em-idle { opacity: .88; } .emp.em-idle .ep-star { animation: spin 60s linear infinite; }
.emp.em-idle .ep-orbit { animation: spin 14s linear infinite; } .emp.em-idle .ep-o2 { animation-duration: 22s; animation-direction: reverse; }
.emp.em-work { filter: drop-shadow(0 0 9px rgba(165,243,255,.55)) drop-shadow(0 2px 8px rgba(10,8,50,.6)); }
.emp.em-work .ep-star { animation: spin 8s linear infinite; }
.emp.em-work .ep-orbit { animation: spin 1.8s linear infinite; } .emp.em-work .ep-o2 { animation-duration: 3s; animation-direction: reverse; }
.emp.em-work .ep-pulse { animation: epulse 1.4s ease-out infinite; }
@keyframes epulse { 0% { opacity: .8; transform: scale(.55); } 100% { opacity: 0; transform: scale(1.12); } }
.emp.em-done { filter: drop-shadow(0 0 8px rgba(95,227,192,.5)) drop-shadow(0 2px 8px rgba(10,8,50,.6)); }
.emp.em-done .ep-orbit { animation: spin 20s linear infinite; }
.emp.em-done .ep-pulse { opacity: .5; }
.emp .em-sweep, .emp .em-needle { transform-box: view-box !important; }
.emp.fig2 .fg-body { transform-box: view-box; }
.emp.fig2.em-idle .fg-body { animation: sway 5s ease-in-out infinite; } .emp.fig2.em-work .fg-body { animation: sway 1.5s ease-in-out infinite; }
.emp.fig2 .fg-prop { animation: bob 3s ease-in-out infinite; } .emp.fig2.em-work .fg-prop { animation-duration: 1s; }
.emp.fig2 .fg-prop * { animation-play-state: inherit; }
.cmp2 .embcard { padding: 8px 4px; }

/* ===== كوكبة التوحيد: مركز واحد، أدوار متعددة ===== */
.cn { position: relative; width: 100%; aspect-ratio: 1; margin: 0 auto 6px; }
.cn-lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.cn-ring { fill: none; stroke: #FFE27A; stroke-opacity: .22; stroke-width: .35; stroke-dasharray: 1 1.6; vector-effect: non-scaling-stroke; transform-origin: 50px 50px; animation: spin 120s linear infinite; }
.cn-ln { stroke-width: .5; stroke: #A5F3FF; stroke-opacity: .28; stroke-linecap: round; vector-effect: non-scaling-stroke; stroke-width: 1.2; }
.cn-ln.cn-work { stroke-opacity: .95; stroke-dasharray: 1.5 7; stroke-dashoffset: 0; animation: cnflow .7s linear infinite; filter: drop-shadow(0 0 3px #A5F3FF); }
.cn-ln.cn-done { stroke: #FFE27A; stroke-opacity: .75; stroke-dasharray: 1.5 9; animation: cnflow 2.6s linear infinite; }
@keyframes cnflow { to { stroke-dashoffset: -17; } }
.cn-center { position: absolute; left: 50%; top: 50%; transform: translate(calc(-50% + var(--ox) * .5), calc(-50% + var(--oy) * .5)); transition: transform .25s ease-out; }
.cn-node { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; }
.cn-node small { font-size: 11px; font-weight: 700; color: var(--ink-2); margin-top: -2px; text-shadow: 0 1px 4px #0F0D2E; }
.cn-node .emb { animation: none; }
.cn-say { text-align: center; font-weight: 800; color: #fff; } .cn-card { padding-bottom: 6px; }

.emp .ep-orbit { transform-origin: 28px 28px !important; }
.cn { max-width: 340px; } .cn.cn-sm { max-width: 300px; }
.cn-p2-0 { left: 50.0%; top: 13.0%; }
.cn-p2-1 { left: 50.0%; top: 87.0%; }
.cn-p3-0 { left: 50.0%; top: 13.0%; }
.cn-p3-1 { left: 82.0%; top: 68.5%; }
.cn-p3-2 { left: 18.0%; top: 68.5%; }
.cn-p4-0 { left: 50.0%; top: 13.0%; }
.cn-p4-1 { left: 87.0%; top: 50.0%; }
.cn-p4-2 { left: 50.0%; top: 87.0%; }
.cn-p4-3 { left: 13.0%; top: 50.0%; }
.cn-p5-0 { left: 50.0%; top: 13.0%; }
.cn-p5-1 { left: 85.2%; top: 38.6%; }
.cn-p5-2 { left: 71.7%; top: 79.9%; }
.cn-p5-3 { left: 28.3%; top: 79.9%; }
.cn-p5-4 { left: 14.8%; top: 38.6%; }
.cn-p6-0 { left: 50.0%; top: 13.0%; }
.cn-p6-1 { left: 82.0%; top: 31.5%; }
.cn-p6-2 { left: 82.0%; top: 68.5%; }
.cn-p6-3 { left: 50.0%; top: 87.0%; }
.cn-p6-4 { left: 18.0%; top: 68.5%; }
.cn-p6-5 { left: 18.0%; top: 31.5%; }
.cn-p7-0 { left: 50.0%; top: 13.0%; }
.cn-p7-1 { left: 78.9%; top: 26.9%; }
.cn-p7-2 { left: 86.1%; top: 58.2%; }
.cn-p7-3 { left: 66.1%; top: 83.3%; }
.cn-p7-4 { left: 33.9%; top: 83.3%; }
.cn-p7-5 { left: 13.9%; top: 58.2%; }
.cn-p7-6 { left: 21.1%; top: 26.9%; }
