/* ============================================================
   صور الكواكب — أنماط المحاكاة
   ============================================================ */

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

html, body {
  height: 100%;
  overflow: hidden;
  font-family: 'Cairo', 'Tajawal', sans-serif;
}

/* ------------- متغيّرات الوضع: ليلي ------------- */
html[data-mode="night"] {
  --bg-1: #04060f;
  --bg-2: #0a0e22;
  --bg-3: #161a3a;
  --neb-1: #4a3a7a;
  --neb-2: #2a3a6a;
  --neb-3: #6a4a8a;

  --star-bg: #fff6e0;
  --star-core: #ffe8b8;
  --line-color: #c89a4a;
  --figure-fill: rgba(212, 168, 92, 0.10);
  --figure-stroke: rgba(240, 200, 130, 0.85);

  --name-color: #f0e0b4;
  --text-1: #f3e8c8;
  --text-2: #c4b48a;
  --text-3: #8a7a58;
  --accent: #d4a64a;
  --accent-2: #b8862a;
  --panel-bg: rgba(8, 10, 28, 0.72);
  --panel-bd: rgba(212, 166, 74, 0.22);
  --panel-bd-strong: rgba(212, 166, 74, 0.55);
  --card-bg: rgba(12, 14, 36, 0.82);
  --milky-op: 0.4;
}

/* ------------- وضع مخطوطة ------------- */
html[data-mode="manuscript"] {
  --bg-1: #ede0bc;
  --bg-2: #e6d6a8;
  --bg-3: #ddc890;
  --neb-1: #c4a36a;
  --neb-2: #d8b888;
  --neb-3: #b89058;

  --star-bg: #3a2412;
  --star-core: #2a1808;
  --line-color: #8a3a18;
  --figure-fill: rgba(120, 60, 20, 0.14);
  --figure-stroke: rgba(80, 30, 12, 0.85);

  --name-color: #3a2412;
  --text-1: #2a1808;
  --text-2: #5a3818;
  --text-3: #8a6838;
  --accent: #8a3a18;
  --accent-2: #5a2410;
  --panel-bg: rgba(238, 220, 178, 0.92);
  --panel-bd: rgba(120, 70, 30, 0.32);
  --panel-bd-strong: rgba(120, 70, 30, 0.6);
  --card-bg: rgba(245, 230, 190, 0.96);
  --milky-op: 0.18;
}

/* ------------- وضع فجر ------------- */
html[data-mode="dawn"] {
  --bg-1: #1a0e2a;
  --bg-2: #4a1e3a;
  --bg-3: #c45a4a;
  --neb-1: #d4756a;
  --neb-2: #6a3a5a;
  --neb-3: #f4a878;

  --star-bg: #fff4d8;
  --star-core: #ffd890;
  --line-color: #f0c478;
  --figure-fill: rgba(255, 200, 140, 0.12);
  --figure-stroke: rgba(255, 224, 160, 0.85);

  --name-color: #fff0d0;
  --text-1: #fff0d0;
  --text-2: #f4c898;
  --text-3: #c48868;
  --accent: #f0c478;
  --accent-2: #d49050;
  --panel-bg: rgba(20, 8, 30, 0.65);
  --panel-bd: rgba(240, 196, 120, 0.28);
  --panel-bd-strong: rgba(240, 196, 120, 0.6);
  --card-bg: rgba(30, 14, 40, 0.78);
  --milky-op: 0.35;
}

body {
  background: var(--bg-1);
  color: var(--text-1);
  direction: rtl;
  transition: background 0.6s ease;
}

#root { height: 100vh; width: 100vw; }

.app {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  display: grid;
  grid-template-rows: 72px 1fr;
  grid-template-columns: 1fr 280px;
  grid-template-areas:
    "topbar topbar"
    "stage  index";
}

/* ============================================================
   خلفية السماء — النجوم العشوائية والسديم
   ============================================================ */
.sky-bg {
  position: absolute; inset: 0; z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.sky-gradient {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 50% 100%, var(--bg-3) 0%, var(--bg-2) 40%, var(--bg-1) 90%);
  transition: background 0.6s ease;
}

html[data-mode="dawn"] .sky-gradient {
  background:
    linear-gradient(180deg, var(--bg-1) 0%, var(--bg-2) 45%, var(--bg-3) 100%);
}

.sky-nebulae {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  mix-blend-mode: screen;
  opacity: 0.5;
  filter: blur(2px);
}

html[data-mode="manuscript"] .sky-nebulae {
  mix-blend-mode: multiply;
  opacity: 0.35;
}

.sky-stars {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
}

.sky-stars-rotor {
  transform-origin: 50% 50%;
  animation: sky-rot var(--rot-dur, 200s) linear infinite;
}

@keyframes sky-rot {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes twinkle {
  from { opacity: 0.2; }
  to { opacity: 1; }
}

.milky-way {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 120% 12% at 50% 50%, rgba(255, 240, 200, 0.08) 0%, transparent 70%);
  transform: rotate(28deg);
  opacity: var(--milky-op);
  pointer-events: none;
  mix-blend-mode: screen;
}

html[data-mode="manuscript"] .milky-way { mix-blend-mode: multiply; }

/* ============================================================
   الهيدر العلوي
   ============================================================ */
.topbar {
  grid-area: topbar;
  z-index: 10;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 18px;
  position: relative;
  border-bottom: 1px solid var(--panel-bd);
  background: linear-gradient(180deg,
    rgba(0,0,0,0.25) 0%,
    rgba(0,0,0,0.05) 80%,
    transparent 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

html[data-mode="manuscript"] .topbar {
  background: linear-gradient(180deg,
    rgba(180, 140, 80, 0.22) 0%,
    rgba(180, 140, 80, 0.04) 100%);
}

.hamburger {
  width: 36px; height: 36px;
  display: flex; flex-direction: column; justify-content: center; gap: 4px;
  padding: 0 8px;
  background: none; border: 1px solid var(--panel-bd);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.hamburger:hover { border-color: var(--panel-bd-strong); background: rgba(212,166,74,0.08); }
.hamburger span {
  display: block; height: 1.5px; background: var(--text-2);
  transition: background 0.2s;
}

.brand {
  display: flex; flex-direction: column;
  line-height: 1.1;
}

.brand-ar {
  font-family: 'Cairo', 'Tajawal', sans-serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.brand-sub {
  font-size: 11.5px;
  color: var(--text-3);
  margin-top: 4px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.cat-tabs {
  margin-inline-start: auto;
  display: flex;
  gap: 6px;
  padding: 4px;
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--panel-bd);
  border-radius: 14px;
}

html[data-mode="manuscript"] .cat-tabs { background: rgba(120, 80, 30, 0.08); }

.cat-tabs button {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 14px;
  background: none;
  border: none;
  border-radius: 10px;
  color: var(--text-2);
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.cat-tabs button .num {
  font-family: 'Cairo', 'Tajawal', sans-serif;
  font-size: 16px;
  font-weight: 700;
  opacity: 0.7;
  min-width: 22px;
  text-align: center;
}

.cat-tabs button:hover { color: var(--text-1); background: rgba(212,166,74,0.08); }

.cat-tabs button.on {
  background: var(--accent);
  color: #0a0e22;
}
html[data-mode="manuscript"] .cat-tabs button.on { color: #f4ecd8; }
.cat-tabs button.on .num { opacity: 1; }

/* ============================================================
   لوحة الفهرس الجانبية
   ============================================================ */
.index-panel {
  grid-area: index;
  z-index: 5;
  background: var(--panel-bg);
  border-inline-start: 1px solid var(--panel-bd);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  overflow-y: auto;
  transition: width 0.4s cubic-bezier(.4,0,.2,1), opacity 0.3s;
}

.index-panel.collapsed {
  width: 0;
  overflow: hidden;
  border: none;
}

.index-inner {
  padding: 18px 14px 80px;
  min-width: 252px;
}

.idx-section {
  margin-bottom: 22px;
}

.idx-cat {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 8px 10px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--panel-bd);
}

.idx-cat-ar {
  font-family: 'Cairo', 'Tajawal', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
}

.idx-cat-count {
  font-size: 10.5px;
  color: var(--text-3);
  letter-spacing: 0.03em;
}

.idx-section ul { list-style: none; }

.idx-section li button {
  width: 100%;
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 6px 10px;
  background: none;
  border: none;
  border-radius: 8px;
  color: var(--text-2);
  font-family: inherit;
  text-align: start;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.idx-section li button:hover {
  background: rgba(212, 166, 74, 0.08);
  color: var(--text-1);
}

.idx-section li button.on {
  background: rgba(212, 166, 74, 0.18);
  color: var(--accent);
  box-shadow: inset 2px 0 0 var(--accent);
}

.idx-num {
  font-family: 'Cairo', 'Tajawal', sans-serif;
  font-size: 13px;
  color: var(--text-3);
  min-width: 22px;
  font-weight: 600;
}

.idx-name { display: flex; flex-direction: column; line-height: 1.15; }
.idx-name .ar { font-size: 16px; font-weight: 600; }
.idx-name .lat { font-size: 10.5px; color: var(--text-3); font-family: 'Cormorant Garamond', serif; font-style: italic; margin-top: 2px; }

/* تمرير ناعم */
.index-panel::-webkit-scrollbar { width: 6px; }
.index-panel::-webkit-scrollbar-track { background: transparent; }
.index-panel::-webkit-scrollbar-thumb { background: var(--panel-bd-strong); border-radius: 3px; }

/* ============================================================
   المسرح الرئيسي
   ============================================================ */
.stage {
  grid-area: stage;
  position: relative;
  overflow: hidden;
}

/* ============================================================
   شاشة الترحيب
   ============================================================ */
.intro {
  position: absolute; inset: 0;
  padding: 24px 40px 32px;
  text-align: center;
  z-index: 2;
  opacity: 1;
  overflow-y: auto;
}
.intro-inner {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.intro-ornament-top {
  font-size: 28px;
  color: var(--accent);
  margin-bottom: 8px;
  opacity: 0.8;
}

.intro-title {
  font-family: 'Cairo', 'Tajawal', sans-serif;
  font-size: clamp(28px, 4vw, 56px);
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: 0.01em;
  margin-bottom: 14px;
  line-height: 1.15;
  text-shadow: 0 2px 30px rgba(212, 166, 74, 0.15);
}

.intro-sub {
  font-size: clamp(13px, 1.2vw, 18px);
  color: var(--text-2);
  line-height: 1.7;
  max-width: 640px;
  margin-bottom: 24px;
}
.intro-sub em {
  color: var(--accent);
  font-style: normal;
  font-weight: 600;
}

.intro-stats {
  display: flex; gap: 18px; align-items: center;
  margin-bottom: 28px;
  font-size: 14px;
  color: var(--text-2);
}
.intro-stats > div:not(.dot) {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.intro-stats .big {
  font-family: 'Cairo', 'Tajawal', sans-serif;
  font-size: 36px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}
.intro-stats .dot { font-size: 24px; color: var(--text-3); opacity: 0.5; }

.intro-pick {
  font-size: 16px;
  color: var(--text-3);
  margin-bottom: 18px;
  letter-spacing: 0.04em;
}

.intro-featured {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  max-width: 920px;
  width: 100%;
  margin-bottom: 20px;
}

.feat-card {
  background: var(--card-bg);
  border: 1px solid var(--panel-bd);
  border-radius: 12px;
  padding: 14px 10px 10px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-family: inherit;
  color: var(--text-1);
}
.feat-card:hover {
  border-color: var(--panel-bd-strong);
  transform: translateY(-3px);
  box-shadow: 0 12px 36px rgba(212, 166, 74, 0.18);
}

.mini-svg {
  width: 80px; height: 60px;
  margin-bottom: 4px;
}

.feat-name {
  font-family: 'Cairo', 'Tajawal', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-1);
}
.feat-name-lat {
  font-size: 10px;
  color: var(--text-3);
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  letter-spacing: 0.04em;
}

.intro-hint {
  font-size: 12.5px;
  color: var(--text-3);
  letter-spacing: 0.05em;
  margin-top: 8px;
  opacity: 0.7;
}

/* ============================================================
   عرض الكوكبة
   ============================================================ */
.cv {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cv-canvas-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cc-wrap {
  width: min(92%, 1100px);
  height: 86%;
  position: relative;
}

.cc-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* ============================================================
   عناصر داخل SVG الكوكبة
   ============================================================ */
/* ============================================================
   صور المخطوطات (Wikimedia) — تُعرض خلف النجوم عند توفّرها
   ============================================================ */
.cc-ms-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  transition: opacity 1.2s ease;
  /* تطبيق طبقة دافئة قليلاً ليظهر مع المخطوطة الأصلية */
  mix-blend-mode: normal;
}
html[data-mode="night"] .cc-ms-image {
  filter: sepia(0.15) brightness(1.05) contrast(1.05);
  opacity: 0.92;
}
html[data-mode="dawn"] .cc-ms-image {
  filter: sepia(0.25) brightness(0.95);
  opacity: 0.88;
}

/* بطاقة المصدر (أسفل الصورة) */
.cc-ms-attr {
  position: absolute;
  bottom: 14px;
  inset-inline-end: 24px;
  font-size: 11px;
  color: var(--text-3);
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--panel-bd);
  padding: 4px 10px;
  border-radius: 100px;
  letter-spacing: 0.04em;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: opacity 1.2s ease;
  pointer-events: none;
  z-index: 2;
}
html[data-mode="manuscript"] .cc-ms-attr {
  background: rgba(245, 230, 190, 0.85);
  color: var(--text-2);
}

/* ============================================================
   عناصر داخل SVG الكوكبة (أسماء النجوم)
   ============================================================ */
.cc-name-ar {
  font-family: 'Cairo', 'Tajawal', sans-serif;
  paint-order: stroke;
  stroke: var(--bg-1);
  stroke-width: 0.5;
  stroke-linejoin: round;
}
.cc-name-lat {
  font-family: 'Cormorant Garamond', serif;
  paint-order: stroke;
  stroke: var(--bg-1);
  stroke-width: 0.3;
  stroke-linejoin: round;
}
html[data-mode="manuscript"] .cc-name-ar,
html[data-mode="manuscript"] .cc-name-lat {
  stroke: var(--bg-2);
}

/* ============================================================
   بطاقة التفاصيل
   ============================================================ */
.cv-card {
  position: absolute;
  inset-inline-start: 28px;
  bottom: 24px;
  width: 360px;
  max-height: calc(100% - 60px);
  overflow-y: auto;
  background: var(--card-bg);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid var(--panel-bd);
  border-radius: 16px;
  padding: 20px 24px 22px;
  z-index: 5;
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
}

.cv-badge {
  display: inline-block;
  font-size: 11.5px;
  color: var(--accent);
  letter-spacing: 0.06em;
  padding: 3px 10px;
  background: rgba(212, 166, 74, 0.12);
  border: 1px solid var(--panel-bd);
  border-radius: 100px;
  margin-bottom: 14px;
}

.cv-name-ar {
  font-family: 'Cairo', 'Tajawal', sans-serif;
  font-size: 42px;
  font-weight: 700;
  color: var(--text-1);
  line-height: 1.05;
  margin-bottom: 4px;
}

.cv-name-lat {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 16px;
  color: var(--text-3);
  letter-spacing: 0.06em;
  margin-bottom: 18px;
}

.cv-quote {
  font-size: 16px;
  line-height: 1.85;
  color: var(--text-2);
  padding: 14px 18px;
  border-inline-start: 2px solid var(--accent-2);
  background: rgba(212, 166, 74, 0.04);
  border-radius: 0 10px 10px 0;
  position: relative;
  margin-bottom: 18px;
}

.qmark-open, .qmark-close {
  color: var(--accent);
  font-weight: 700;
  font-family: 'Cairo', 'Tajawal', sans-serif;
  font-size: 22px;
  vertical-align: -2px;
  margin: 0 2px;
}

.cv-quote-attr {
  font-size: 11.5px;
  color: var(--text-3);
  margin-top: 8px;
  letter-spacing: 0.04em;
  font-style: italic;
}

.cv-stars-list { }

.cv-stars-title {
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.1em;
  margin-bottom: 10px;
  font-weight: 600;
}

.cv-stars-list ul { list-style: none; }
.cv-stars-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
  border-bottom: 1px solid rgba(212, 166, 74, 0.08);
}
.cv-stars-list li:last-child { border-bottom: none; }
.stardot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  flex-shrink: 0;
}
.star-ar { font-family: 'Cairo', 'Tajawal', sans-serif; font-size: 15px; color: var(--text-1); line-height: 1.2; }
.star-lat { font-size: 10.5px; color: var(--text-3); font-family: 'Cormorant Garamond', serif; font-style: italic; letter-spacing: 0.04em; }

/* ============================================================
   أزرار التنقل (الأسهم)
   ============================================================ */
.navarrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--card-bg);
  border: 1px solid var(--panel-bd);
  backdrop-filter: blur(12px);
  color: var(--text-1);
  font-size: 28px;
  font-family: serif;
  cursor: pointer;
  z-index: 6;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
  line-height: 1;
  padding-bottom: 4px;
}
.navarrow:hover {
  border-color: var(--panel-bd-strong);
  color: var(--accent);
  transform: translateY(-50%) scale(1.08);
}
.navarrow.prev { inset-inline-start: 28px; }
.navarrow.next { inset-inline-end: 28px; }

/* ============================================================
   لوحة Tweaks — تجاوزات
   ============================================================ */
.twk-panel {
  left: 16px !important;
  right: auto !important;
  bottom: 16px !important;
  font-family: 'Cairo', 'Tajawal', sans-serif !important;
  direction: rtl !important;
  background: var(--card-bg) !important;
  color: var(--text-1) !important;
  border-color: var(--panel-bd-strong) !important;
}
.twk-panel * { font-family: inherit !important; }
.twk-panel button, .twk-panel input, .twk-panel select { color: var(--text-1) !important; }

/* مقاسات أصغر */
@media (max-width: 1280px) {
  .app { grid-template-columns: 1fr 240px; }
  .cv-card { width: 320px; padding: 18px 20px; }
  .cv-name-ar { font-size: 34px; }
  .intro-title { font-size: 32px; margin-bottom: 8px; }
  .intro-sub { font-size: 13px; margin-bottom: 16px; }
  .intro-featured { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .feat-card { padding: 10px 6px 8px; }
  .mini-svg { width: 64px; height: 48px; }
  .feat-name { font-size: 14px; }
  .intro-stats { margin-bottom: 18px; gap: 14px; font-size: 12px; }
  .intro-stats .big { font-size: 28px; }
}

/* ============================================================
   إحداثيات النجوم في البطاقة (قابلة للنسخ)
   ============================================================ */
.star-info { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }

.star-coords {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin-top: 6px;
  padding: 6px 10px;
  font-size: 10.5px;
  color: var(--text-2);
  font-family: 'JetBrains Mono', ui-monospace, 'Cormorant Garamond', monospace;
  letter-spacing: 0.01em;
  background: rgba(212, 166, 74, 0.06);
  border: 1px solid var(--panel-bd);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: start;
  width: 100%;
  position: relative;
}
.star-coords:hover {
  border-color: var(--accent);
  background: rgba(212, 166, 74, 0.12);
  color: var(--text-1);
}
.star-coords:active { transform: scale(0.98); }
.star-coords span {
  white-space: nowrap;
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
}
.star-coords .coord-lbl {
  font-size: 9px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 600;
}
.star-coords:hover .coord-lbl { color: var(--accent); }
.copy-hint {
  margin-inline-start: auto;
  color: var(--text-3);
  opacity: 0.7;
  transition: opacity 0.15s, color 0.15s;
}
.star-coords:hover .copy-hint { color: var(--accent); opacity: 1; }

/* رأس قسم النجوم: العنوان + زر نسخ الكل */
.cv-stars-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 8px;
}
.cv-stars-head .cv-stars-title { margin-bottom: 0; }
.copy-all-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: transparent;
  border: 1px solid var(--panel-bd);
  border-radius: 6px;
  color: var(--text-2);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.copy-all-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(212, 166, 74, 0.08);
}

.cv-stars-foot {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(212, 166, 74, 0.10);
  font-size: 10.5px;
  color: var(--text-3);
  line-height: 1.6;
}
.cv-stars-foot em { color: var(--accent); font-style: normal; font-weight: 600; }

.cv-stars-list li {
  align-items: flex-start;
  padding: 10px 0;
  gap: 10px;
}

/* إشعار النسخ */
.copy-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: rgba(20, 22, 48, 0.95);
  border: 1px solid var(--accent);
  border-radius: 100px;
  color: var(--accent);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  z-index: 200;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  animation: toastIn 0.25s ease both;
}
@keyframes toastIn {
  from { transform: translate(-50%, 10px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

/* ============================================================
   زر "عن الكتاب" في الهيدر
   ============================================================ */
.about-btn {
  padding: 8px 14px;
  background: transparent;
  border: 1px solid var(--panel-bd);
  border-radius: 10px;
  color: var(--text-2);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.about-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(212, 166, 74, 0.06);
}

.tweaks-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--panel-bd);
  border-radius: 10px;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.2s;
}
.tweaks-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(212, 166, 74, 0.06);
  transform: rotate(30deg);
}

/* ============================================================
   مودال "المراجع"
   ============================================================ */
.about-overlay {
  position: fixed; inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  opacity: 1;
}

.about-modal {
  position: relative;
  width: min(680px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  background: linear-gradient(180deg, rgba(20, 22, 48, 0.98), rgba(8, 10, 28, 0.98));
  border: 1px solid var(--panel-bd-strong);
  border-radius: 16px;
  padding: 32px 36px;
  color: var(--text-1);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6);
}
html[data-mode="manuscript"] .about-modal {
  background: linear-gradient(180deg, rgba(245, 230, 190, 0.98), rgba(232, 218, 178, 0.98));
}

.about-close {
  position: absolute;
  top: 14px;
  inset-inline-end: 14px;
  width: 32px; height: 32px;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-2);
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s;
  display: flex; align-items: center; justify-content: center;
  padding-bottom: 3px;
}
.about-close:hover { background: rgba(212, 166, 74, 0.2); color: var(--accent); }

.about-eyebrow {
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.15em;
  margin-bottom: 8px;
  font-weight: 600;
}

.about-title {
  font-family: 'Cairo', sans-serif;
  font-size: 28px;
  font-weight: 800;
  color: var(--text-1);
  line-height: 1.3;
  margin-bottom: 12px;
}

.about-intro {
  font-size: 14.5px;
  line-height: 1.85;
  color: var(--text-2);
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--panel-bd);
}

/* بطاقة مرجع */
.ref-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--panel-bd);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 12px;
}
.ref-card-primary {
  background: rgba(212, 166, 74, 0.06);
  border-color: var(--panel-bd-strong);
}

.ref-title {
  font-family: 'Cairo', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 4px;
}

.ref-author {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 8px;
  font-weight: 500;
}
.ref-dates {
  color: var(--text-3);
  font-weight: 400;
  font-size: 12.5px;
}

.ref-desc {
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--text-2);
  margin-bottom: 8px;
}

.ref-mohaqqiq {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  padding-top: 10px;
  margin-top: 8px;
  border-top: 1px dashed var(--panel-bd);
  font-size: 13px;
}
.ref-lbl {
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.04em;
}
.ref-mohaqqiq-name {
  font-weight: 700;
  color: var(--text-1);
}
.ref-email {
  font-family: 'Cormorant Garamond', serif;
  font-size: 12.5px;
  color: var(--text-2);
  text-decoration: none;
  border-bottom: 1px dashed var(--text-3);
}
.ref-email:hover { color: var(--accent); border-color: var(--accent); }

.ref-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  margin-top: 10px;
  background: var(--accent);
  color: #0a0e22 !important;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s;
}
.ref-link:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(212, 166, 74, 0.3); }

.about-foot {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--panel-bd);
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.7;
  font-style: italic;
}
