/* ============================================================
   وريد — نظام التصميم
   الهوية المعتمدة: عنابي، فحمي، عاجي، ترابي، بترولي
   ============================================================ */

:root {
  /* لوحة الألوان الأساسية المعتمدة */
  --burgundy: #8B1E2D;
  --charcoal: #2A2A2C;
  --ivory: #F7F3ED;
  --earth: #BF7F4D;
  --teal: #1F6B7A;

  /* مشتقات */
  --burgundy-dark: #6E1522;
  --burgundy-soft: rgba(139, 30, 45, 0.08);
  --earth-soft: rgba(191, 127, 77, 0.12);
  --teal-soft: rgba(31, 107, 122, 0.09);
  --ivory-deep: #EFE8DD;
  --line: rgba(42, 42, 44, 0.12);
  --text: #2A2A2C;
  --text-soft: #55524E;

  /* الخطوط */
  --font-ar: "Cairo", "Noto Sans Arabic", sans-serif;
  --font-en: "Montserrat", "Cairo", sans-serif;

  --radius: 16px;
  --radius-lg: 26px;
  --shadow: 0 10px 40px rgba(42, 42, 44, 0.10);
  --shadow-soft: 0 4px 18px rgba(42, 42, 44, 0.07);
  --container: 1160px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-ar);
  background: var(--ivory);
  color: var(--text);
  line-height: 1.9;
  font-size: 17px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}

.en { font-family: var(--font-en); }

/* ============ الترويسة ============ */

.site-header {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 100;
  background: rgba(247, 243, 237, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.site-header.scrolled {
  border-bottom-color: var(--line);
  box-shadow: 0 2px 20px rgba(42, 42, 44, 0.06);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand img { height: 46px; width: auto; }

.brand .brand-name {
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--burgundy);
  line-height: 1;
}

.brand .brand-sub {
  font-size: 0.68rem;
  color: var(--text-soft);
  letter-spacing: 0.02em;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.main-nav a {
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-soft);
  transition: color 0.2s, background 0.2s;
}

.main-nav a:hover { color: var(--burgundy); background: var(--burgundy-soft); }

.main-nav a.active { color: var(--burgundy); background: var(--burgundy-soft); }

.main-nav a.cta {
  background: var(--burgundy);
  color: var(--ivory);
  margin-inline-start: 8px;
}

.main-nav a.cta:hover { background: var(--burgundy-dark); color: var(--ivory); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--charcoal);
}

.nav-toggle svg { width: 26px; height: 26px; }

/* ============ الأزرار ============ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 32px;
  border-radius: 999px;
  font-family: var(--font-ar);
  font-weight: 700;
  font-size: 1.02rem;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s, color 0.2s;
}

.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--burgundy);
  color: var(--ivory);
  box-shadow: 0 8px 24px rgba(139, 30, 45, 0.28);
}

.btn-primary:hover { background: var(--burgundy-dark); }

.btn-outline {
  background: transparent;
  color: var(--burgundy);
  border-color: var(--burgundy);
}

.btn-outline:hover { background: var(--burgundy-soft); }

.btn-teal {
  background: var(--teal);
  color: var(--ivory);
  box-shadow: 0 8px 24px rgba(31, 107, 122, 0.25);
}

.btn-teal:hover { background: #17545F; }

/* ============ البطل (Hero) ============ */

.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  padding-top: 110px;
  padding-bottom: 60px;
  overflow: hidden;
}

.hero-flow {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.hero-flow svg { width: 100%; height: 100%; }

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 40px;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--teal-soft);
  color: var(--teal);
  border: 1px solid rgba(31, 107, 122, 0.25);
  padding: 6px 18px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.88rem;
  margin-bottom: 22px;
}

.hero h1 {
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  font-weight: 900;
  color: var(--burgundy);
  line-height: 1.25;
  margin-bottom: 10px;
}

.hero .hero-def {
  font-size: clamp(1.25rem, 2.6vw, 1.75rem);
  font-weight: 800;
  color: var(--charcoal);
  margin-bottom: 6px;
}

.hero .hero-msg {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-soft);
  font-weight: 600;
  margin-bottom: 14px;
}

.hero .hero-en {
  font-family: var(--font-en);
  color: var(--teal);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 34px;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }

.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
}

.hero-visual img {
  width: min(420px, 80vw);
  filter: drop-shadow(0 20px 50px rgba(42, 42, 44, 0.15));
  animation: float 7s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-16px); }
}

/* ============ الأقسام ============ */

section { padding: 90px 0; }

.section-tight { padding: 60px 0; }

.section-head { max-width: 720px; margin-bottom: 48px; }

.section-head.center { margin-inline: auto; text-align: center; }

.kicker {
  display: inline-block;
  color: var(--earth);
  font-weight: 800;
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}

.section-head h2 {
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  font-weight: 900;
  color: var(--charcoal);
  line-height: 1.4;
  margin-bottom: 14px;
}

.section-head h2 .accent { color: var(--burgundy); }

.section-head p { color: var(--text-soft); font-size: 1.05rem; }

.divider-flow {
  height: 3px;
  width: 90px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--burgundy), var(--earth), var(--teal));
  margin-top: 18px;
}

.center .divider-flow { margin-inline: auto; }

/* ============ البطاقات ============ */

.grid { display: grid; gap: 24px; }

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  box-shadow: var(--shadow-soft);
  transition: transform 0.25s, box-shadow 0.25s;
}

.card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }

.card .icon {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  font-size: 1.5rem;
}

.icon.i-burgundy { background: var(--burgundy-soft); color: var(--burgundy); }
.icon.i-earth { background: var(--earth-soft); color: var(--earth); }
.icon.i-teal { background: var(--teal-soft); color: var(--teal); }

.card h3 {
  font-size: 1.18rem;
  font-weight: 800;
  color: var(--charcoal);
  margin-bottom: 10px;
}

.card p { color: var(--text-soft); font-size: 0.98rem; }

.card ul { padding-inline-start: 20px; color: var(--text-soft); font-size: 0.97rem; }
.card ul li { margin-bottom: 6px; }

/* ============ شرائح داكنة وملونة ============ */

.band-dark {
  background: var(--charcoal);
  color: var(--ivory);
  position: relative;
  overflow: hidden;
}

.band-dark .section-head h2 { color: var(--ivory); }
.band-dark .section-head p { color: rgba(247, 243, 237, 0.75); }

.band-dark .card {
  background: rgba(247, 243, 237, 0.05);
  border-color: rgba(247, 243, 237, 0.12);
  box-shadow: none;
}

.band-dark .card h3 { color: var(--ivory); }
.band-dark .card p, .band-dark .card ul { color: rgba(247, 243, 237, 0.72); }

.band-burgundy {
  background: linear-gradient(135deg, var(--burgundy-dark), var(--burgundy));
  color: var(--ivory);
}

/* ============ خط الزمن الثلاثي ============ */

.layers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  position: relative;
}

.layer {
  border-radius: var(--radius-lg);
  padding: 34px 28px;
  position: relative;
  overflow: hidden;
  color: var(--ivory);
}

.layer::after {
  content: "";
  position: absolute;
  inset-inline-start: -30px;
  bottom: -40px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: rgba(247, 243, 237, 0.08);
}

.layer.past { background: linear-gradient(150deg, var(--burgundy-dark), var(--burgundy)); }
.layer.present { background: linear-gradient(150deg, #A96A3C, var(--earth)); }
.layer.future { background: linear-gradient(150deg, #174F5A, var(--teal)); }

.layer .layer-num {
  font-family: var(--font-en);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  opacity: 0.75;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.layer h3 { font-size: 1.5rem; font-weight: 900; margin-bottom: 10px; }

.layer p { font-size: 0.97rem; opacity: 0.92; }

/* ============ قائمة مرقّمة (مراحل التوسع) ============ */

.steps { display: grid; gap: 14px; counter-reset: step; }

.step {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow-soft);
}

.step .num {
  counter-increment: step;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--burgundy-soft);
  color: var(--burgundy);
  font-weight: 900;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step .num::before { content: counter(step); }

.step h4 { font-size: 1.05rem; font-weight: 800; color: var(--charcoal); }
.step p { color: var(--text-soft); font-size: 0.95rem; }

/* ============ اقتباس / رسالة ختامية ============ */

.quote-band {
  text-align: center;
  padding: 100px 24px;
}

.quote-band blockquote {
  font-size: clamp(1.4rem, 3.4vw, 2.2rem);
  font-weight: 900;
  color: var(--ivory);
  max-width: 850px;
  margin-inline: auto;
  line-height: 1.8;
}

.quote-band .q-mark {
  color: var(--earth);
  font-size: 3rem;
  display: block;
  line-height: 1;
  margin-bottom: 12px;
}

/* ============ التذييل ============ */

.site-footer {
  background: var(--charcoal);
  color: rgba(247, 243, 237, 0.75);
  padding: 60px 0 30px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.site-footer h4 { color: var(--ivory); font-size: 1.05rem; margin-bottom: 14px; }

.site-footer a { display: block; padding: 4px 0; font-size: 0.95rem; transition: color 0.2s; }
.site-footer a:hover { color: var(--earth); }

.footer-brand img { height: 60px; margin-bottom: 14px; filter: brightness(0) invert(1) opacity(0.9); }

.footer-brand p { font-size: 0.92rem; max-width: 320px; }

.footer-bottom {
  border-top: 1px solid rgba(247, 243, 237, 0.12);
  padding-top: 24px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.85rem;
  color: rgba(247, 243, 237, 0.5);
}

/* ============ حركة الظهور ============ */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible { opacity: 1; transform: translateY(0); }

.reveal-d1 { transition-delay: 0.1s; }
.reveal-d2 { transition-delay: 0.2s; }
.reveal-d3 { transition-delay: 0.3s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-visual img { animation: none; }
  html { scroll-behavior: auto; }
}

/* ============ صفحة افهم وريد: فهرس جانبي ============ */

.doc-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 48px;
  align-items: start;
}

.doc-toc {
  position: sticky;
  top: 100px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  font-size: 0.92rem;
}

.doc-toc h4 { color: var(--burgundy); margin-bottom: 10px; font-size: 1rem; }

.doc-toc a {
  display: block;
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--text-soft);
  transition: background 0.2s, color 0.2s;
}

.doc-toc a:hover, .doc-toc a.active { background: var(--burgundy-soft); color: var(--burgundy); }

.doc-content section { padding: 40px 0; border-bottom: 1px dashed var(--line); }
.doc-content section:last-child { border-bottom: none; }

.doc-content h2 {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--burgundy);
  margin-bottom: 18px;
}

.doc-content h3 { font-size: 1.15rem; font-weight: 800; color: var(--charcoal); margin: 22px 0 10px; }

.doc-content p { color: var(--text-soft); margin-bottom: 14px; }

.doc-content ul { padding-inline-start: 24px; color: var(--text-soft); margin-bottom: 14px; }
.doc-content ul li { margin-bottom: 6px; }

.doc-content .highlight {
  background: var(--burgundy-soft);
  border-inline-start: 4px solid var(--burgundy);
  border-radius: 10px;
  padding: 18px 22px;
  font-weight: 700;
  color: var(--charcoal);
  margin: 18px 0;
}

.chip-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }

.chip {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-soft);
}

.chip.c-teal { border-color: rgba(31,107,122,.3); color: var(--teal); background: var(--teal-soft); }
.chip.c-earth { border-color: rgba(191,127,77,.35); color: #96603A; background: var(--earth-soft); }
.chip.c-burgundy { border-color: rgba(139,30,45,.3); color: var(--burgundy); background: var(--burgundy-soft); }

/* ============ صفحة جرّب وريد ============ */

.demo-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--earth-soft);
  border: 1px dashed rgba(191, 127, 77, 0.5);
  color: #96603A;
  border-radius: 12px;
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 700;
}

.scene-wrap {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #3E3128 0%, #5C4632 45%, #8A6A48 100%);
  aspect-ratio: 16 / 8.5;
  min-height: 380px;
}

.scene-canvas { position: absolute; inset: 0; }

.scene-svg { position: absolute; inset: 0; width: 100%; height: 100%; }

.scene-hint { display: none; text-align: center; color: var(--text-soft); font-size: 0.85rem; font-weight: 600; margin-top: 12px; }

.hotspot {
  position: absolute;
  transform: translate(50%, -50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: rgba(247, 243, 237, 0.92);
  color: var(--burgundy);
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s, background 0.2s;
  z-index: 3;
}

.hotspot::after {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  border: 2px solid rgba(247, 243, 237, 0.65);
  animation: pulse 2.2s ease-out infinite;
}

@keyframes pulse {
  0% { transform: scale(0.8); opacity: 1; }
  100% { transform: scale(1.5); opacity: 0; }
}

.hotspot:hover { transform: translate(50%, -50%) scale(1.12); background: #fff; }

.hotspot .tip {
  position: absolute;
  bottom: calc(100% + 10px);
  right: 50%;
  transform: translateX(50%);
  background: var(--charcoal);
  color: var(--ivory);
  font-family: var(--font-ar);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 999px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.hotspot:hover .tip, .hotspot:focus .tip { opacity: 1; }

.scene-caption {
  position: absolute;
  bottom: 14px;
  inset-inline-start: 16px;
  background: rgba(42, 42, 44, 0.72);
  color: var(--ivory);
  border-radius: 12px;
  padding: 8px 18px;
  font-size: 0.85rem;
  backdrop-filter: blur(6px);
  z-index: 2;
}

/* بطاقات العناصر الثقافية */

.element-card { cursor: pointer; text-align: start; font-family: var(--font-ar); border: 1px solid var(--line); }

.element-card .tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  border-radius: 999px;
  padding: 3px 12px;
  margin-bottom: 12px;
}

/* نافذة العنصر (Modal) */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(42, 42, 44, 0.55);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.open { display: flex; }

.modal {
  background: var(--ivory);
  border-radius: var(--radius-lg);
  max-width: 680px;
  width: 100%;
  max-height: 86vh;
  overflow-y: auto;
  padding: 36px;
  position: relative;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  animation: modalIn 0.3s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(24px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.modal .close-btn {
  position: absolute;
  top: 18px;
  inset-inline-end: 18px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--burgundy-soft);
  color: var(--burgundy);
  font-size: 1.15rem;
  cursor: pointer;
}

.modal h3 { font-size: 1.5rem; font-weight: 900; color: var(--burgundy); margin-bottom: 4px; }

.modal .m-type { color: var(--earth); font-weight: 700; font-size: 0.9rem; margin-bottom: 16px; }

.modal p { color: var(--text-soft); margin-bottom: 12px; }

.modal h4 { font-size: 1.02rem; font-weight: 800; color: var(--charcoal); margin: 18px 0 8px; }

/* خط الزمن التفاعلي */

.timeline-tabs { display: flex; gap: 10px; margin-bottom: 26px; flex-wrap: wrap; }

.timeline-tab {
  border: 2px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 10px 28px;
  font-family: var(--font-ar);
  font-weight: 800;
  font-size: 1rem;
  color: var(--text-soft);
  cursor: pointer;
  transition: all 0.25s;
}

.timeline-tab.active.t-past { background: var(--burgundy); border-color: var(--burgundy); color: #fff; }
.timeline-tab.active.t-present { background: var(--earth); border-color: var(--earth); color: #fff; }
.timeline-tab.active.t-future { background: var(--teal); border-color: var(--teal); color: #fff; }

.timeline-panel {
  display: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 34px;
  box-shadow: var(--shadow-soft);
}

.timeline-panel.active { display: block; animation: modalIn 0.35s ease; }

.timeline-panel h3 { color: var(--charcoal); font-weight: 900; font-size: 1.3rem; margin-bottom: 12px; }

.timeline-panel p { color: var(--text-soft); }

/* اسأل وريد */

.chat-shell {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  height: 520px;
}

.chat-head {
  background: linear-gradient(135deg, var(--burgundy-dark), var(--burgundy));
  color: var(--ivory);
  padding: 18px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-head img { height: 38px; filter: brightness(0) invert(1); }

.chat-head .t { font-weight: 800; font-size: 1.05rem; }
.chat-head .s { font-size: 0.78rem; opacity: 0.8; }

.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--ivory);
}

.msg {
  max-width: 82%;
  padding: 12px 18px;
  border-radius: 18px;
  font-size: 0.95rem;
  line-height: 1.8;
  animation: modalIn 0.25s ease;
}

.msg.bot {
  background: #fff;
  border: 1px solid var(--line);
  align-self: flex-start;
  border-start-start-radius: 4px;
}

.msg.user {
  background: var(--teal);
  color: #fff;
  align-self: flex-end;
  border-start-end-radius: 4px;
}

.chat-suggest { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 22px 12px; background: var(--ivory); }

.chat-suggest button {
  border: 1px solid rgba(31, 107, 122, 0.35);
  background: var(--teal-soft);
  color: var(--teal);
  border-radius: 999px;
  padding: 6px 14px;
  font-family: var(--font-ar);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.chat-suggest button:hover { background: rgba(31, 107, 122, 0.18); }

.chat-input {
  display: flex;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.chat-input input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 12px 20px;
  font-family: var(--font-ar);
  font-size: 0.95rem;
  background: var(--ivory);
  color: var(--text);
}

.chat-input input:focus { outline: 2px solid rgba(139, 30, 45, 0.35); }

.chat-input button {
  border: none;
  background: var(--burgundy);
  color: #fff;
  border-radius: 999px;
  padding: 0 26px;
  font-family: var(--font-ar);
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s;
}

.chat-input button:hover { background: var(--burgundy-dark); }

/* ============ استجابة الشاشات ============ */

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .doc-layout { grid-template-columns: 1fr; }
  .doc-toc { position: static; display: none; }
}

@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-actions { justify-content: center; }
  .hero-visual { order: -1; }
  .hero-visual img { width: min(280px, 65vw); }
  .hero { min-height: auto; }
  .grid-3, .layers { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 26px; }

  .main-nav {
    position: fixed;
    top: 72px;
    inset-inline: 0;
    background: var(--ivory);
    flex-direction: column;
    align-items: stretch;
    padding: 18px 24px 26px;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 20px 40px rgba(42, 42, 44, 0.12);
    display: none;
  }

  .main-nav.open { display: flex; }

  .main-nav a { padding: 12px 16px; font-size: 1.05rem; }
  .main-nav a.cta { margin-inline-start: 0; text-align: center; margin-top: 8px; }

  .nav-toggle { display: block; }
}

/* ============ بوابة الدليل الحي ============ */

/* طريقتا الوصول: الذكية والتقليدية */

.access-tabs {
  display: inline-flex;
  gap: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px;
  margin-top: 30px;
  box-shadow: var(--shadow-soft);
}

.access-tab {
  border: none;
  background: transparent;
  border-radius: 999px;
  padding: 10px 26px;
  font-family: var(--font-ar);
  font-weight: 800;
  font-size: 0.98rem;
  color: var(--text-soft);
  cursor: pointer;
  transition: all 0.25s;
}

.access-tab.active { background: var(--burgundy); color: #fff; box-shadow: 0 6px 18px rgba(139, 30, 45, 0.3); }

.access-panel { display: none; }
.access-panel.active { display: block; animation: modalIn 0.3s ease; }

.smart-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  font-size: 0.88rem;
  color: var(--text-soft);
}

.smart-note .pill {
  background: var(--teal-soft);
  color: var(--teal);
  border-radius: 999px;
  padding: 3px 12px;
  font-weight: 800;
  font-size: 0.78rem;
}

/* خريطة المناطق والمواقع */

.map-wrap {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-soft);
  margin-top: 24px;
}

.map-wrap svg { width: 100%; height: auto; display: block; max-height: 520px; margin-inline: auto; }

.ksa-land { fill: var(--ivory-deep); stroke: var(--earth); stroke-width: 2.5; stroke-linejoin: round; }

.map-marker { cursor: pointer; }

.map-marker .core { fill: var(--earth); transition: r 0.2s; }
.map-marker .halo { fill: none; stroke: var(--earth); stroke-width: 2; opacity: 0.45; }

.map-marker.available .core { fill: var(--burgundy); }
.map-marker.available .halo { stroke: var(--burgundy); }

.map-marker text {
  font-family: var(--font-ar);
  font-weight: 800;
  fill: var(--charcoal);
  font-size: 21px;
}

.map-marker .sub { font-size: 16px; font-weight: 600; fill: #55524E; }

.map-marker:hover .core { r: 13; }

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 16px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-soft);
}

.map-legend .dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-inline-end: 6px; }

/* زر الصوت */

.mic-btn {
  border: none;
  background: var(--teal-soft);
  color: var(--teal);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.05rem;
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s;
}

.mic-btn:hover { background: rgba(31, 107, 122, 0.22); }

.mic-btn.listening {
  background: var(--burgundy);
  color: #fff;
  animation: micPulse 1.1s ease infinite;
}

@keyframes micPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(139, 30, 45, 0.4); }
  50% { box-shadow: 0 0 0 12px rgba(139, 30, 45, 0); }
}

.guide-search .mic-btn {
  position: absolute;
  inset-inline-end: 54px;
  top: 50%;
  transform: translateY(-50%);
}

.guide-search input { padding-inline-end: 104px; }


.breadcrumb {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.92rem;
  font-weight: 700;
  margin-bottom: 20px;
}

.breadcrumb a { color: var(--teal); }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { color: var(--text-soft); opacity: 0.6; }
.breadcrumb .current { color: var(--text-soft); }

.guide-search { position: relative; max-width: 760px; margin-top: 26px; }

.guide-search .search-icon {
  position: absolute;
  inset-inline-start: 22px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--burgundy);
  font-size: 1.15rem;
  pointer-events: none;
}

.guide-search input {
  width: 100%;
  padding: 17px 22px;
  padding-inline-start: 56px;
  border-radius: 999px;
  border: 2px solid var(--line);
  font-family: var(--font-ar);
  font-size: 1.05rem;
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow-soft);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.guide-search input:focus {
  outline: none;
  border-color: var(--burgundy);
  box-shadow: 0 8px 30px rgba(139, 30, 45, 0.14);
}

.guide-search .clear-btn {
  position: absolute;
  inset-inline-end: 14px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: var(--burgundy-soft);
  color: var(--burgundy);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.9rem;
  display: none;
}

.guide-search.has-text .clear-btn { display: block; }

.search-hints {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 0.85rem;
  color: var(--text-soft);
}

.search-hints button {
  border: 1px dashed rgba(139, 30, 45, 0.35);
  background: transparent;
  color: var(--burgundy);
  border-radius: 999px;
  padding: 4px 14px;
  font-family: var(--font-ar);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.search-hints button:hover { background: var(--burgundy-soft); }

/* أشرطة التصفية */

.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; margin: 30px 0 10px; align-items: center; }

.filter-label { font-size: 0.85rem; font-weight: 800; color: var(--text-soft); margin-inline-end: 4px; }

.fchip {
  border: 2px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 7px 20px;
  font-family: var(--font-ar);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-soft);
  cursor: pointer;
  transition: all 0.2s;
}

.fchip:hover { border-color: var(--burgundy); color: var(--burgundy); }

.fchip.active { background: var(--burgundy); border-color: var(--burgundy); color: #fff; }

.fchip.f-region.active { background: var(--teal); border-color: var(--teal); }

.result-count { margin: 18px 0 22px; font-size: 0.95rem; font-weight: 700; color: var(--text-soft); }
.result-count .accent { color: var(--burgundy); }

/* بطاقات المواقع */

.site-card { position: relative; display: flex; flex-direction: column; }

.site-card .site-thumb {
  border-radius: 16px;
  height: 130px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  position: relative;
  overflow: hidden;
}

.site-thumb.th-najd { background: linear-gradient(150deg, #B68E5F, #8A6A44); }
.site-thumb.th-hijaz { background: linear-gradient(150deg, #7C6250, #4E3E33); }
.site-thumb.th-asir { background: linear-gradient(150deg, #3E6E5A, #24493B); }
.site-thumb.th-east { background: linear-gradient(150deg, #2A7F91, #17545F); }
.site-thumb.th-qassim { background: linear-gradient(150deg, #9C8A3C, #6E6128); }
.site-thumb.th-north { background: linear-gradient(150deg, #A96A3C, #7C4A26); }

.badge {
  position: absolute;
  top: 12px;
  inset-inline-start: 12px;
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 0.75rem;
  font-weight: 800;
}

.badge-available { background: rgba(31, 107, 122, 0.95); color: #fff; }
.badge-soon { background: rgba(247, 243, 237, 0.92); color: #96603A; }

.site-card .region-line { font-size: 0.82rem; font-weight: 700; color: var(--teal); margin-bottom: 6px; }

.site-card .alt-names { font-size: 0.85rem; color: var(--text-soft); background: var(--earth-soft); border-radius: 10px; padding: 8px 14px; margin-top: 10px; }
.site-card .alt-names strong { color: #96603A; }

.site-card .cta-line { margin-top: auto; padding-top: 14px; font-weight: 800; font-size: 0.92rem; color: var(--burgundy); }
.site-card.soon .cta-line { color: var(--text-soft); }

.site-card.soon { opacity: 0.92; }
.site-card.soon:hover { transform: translateY(-2px); }

.no-results {
  text-align: center;
  padding: 50px 20px;
  background: #fff;
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  color: var(--text-soft);
}

.no-results strong { color: var(--burgundy); }

/* شريط التوأم المميز */

.featured-twin {
  background: linear-gradient(135deg, var(--burgundy-dark), var(--burgundy));
  border-radius: var(--radius-lg);
  color: var(--ivory);
  padding: 40px 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  flex-wrap: wrap;
  box-shadow: 0 18px 50px rgba(139, 30, 45, 0.3);
}

.featured-twin h3 { font-size: clamp(1.3rem, 2.6vw, 1.8rem); font-weight: 900; margin-bottom: 8px; }
.featured-twin p { opacity: 0.9; max-width: 560px; }

.featured-twin .btn { background: var(--ivory); color: var(--burgundy); flex-shrink: 0; }
.featured-twin .btn:hover { background: #fff; }

@media (max-width: 640px) {
  body { font-size: 16px; }
  section { padding: 60px 0; }
  .grid-2, .grid-4 { grid-template-columns: 1fr; }
  .featured-twin { padding: 30px 24px; }

  /* المشهد يصبح قابلًا للسحب أفقيًا مع ثبات مواضع النقاط */
  .scene-wrap { aspect-ratio: auto; height: auto; min-height: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .scene-canvas { position: relative; width: 860px; height: 457px; }
  .scene-hint { display: block; }

  .modal { padding: 26px 20px; }
  .chat-shell { height: 480px; }
}

/* ============================================================
   وريد — نمط المتحف الرقمي (صفحة التوأم + رأس الدليل)
   مستلهم من المتاحف الرقمية العالمية: دخول سينمائي داكن،
   عارض بملء الشاشة، لوحة جانبية، جولة موجهة
   ============================================================ */

:root {
  --gold: #C9A227;
  --museum-bg: #161618;
  --museum-panel: #1F1F22;
  --museum-line: rgba(247, 243, 237, 0.12);
  --museum-text: rgba(247, 243, 237, 0.78);
}

body.museum { background: var(--museum-bg); color: var(--museum-text); }

body.museum .site-header { display: none; }

body.museum.intro-open { overflow: hidden; }

/* ---------- الدخول السينمائي ---------- */

.museum-intro {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background:
    radial-gradient(ellipse at 50% 120%, rgba(191, 127, 77, 0.18), transparent 55%),
    radial-gradient(ellipse at 80% 0%, rgba(139, 30, 45, 0.22), transparent 50%),
    linear-gradient(180deg, #101012, #1B1B1E);
  transition: opacity 0.9s ease, visibility 0.9s;
}

.museum-intro.gone { opacity: 0; visibility: hidden; pointer-events: none; }

.museum-intro::after {
  content: "";
  position: absolute;
  inset: 24px;
  border: 1px solid rgba(201, 162, 39, 0.22);
  border-radius: 18px;
  pointer-events: none;
}

.intro-inner { position: relative; max-width: 780px; padding: 24px; }

.intro-inner .intro-symbol {
  width: 110px;
  margin: 0 auto 26px;
  filter: drop-shadow(0 0 30px rgba(201, 162, 39, 0.25));
  animation: float 7s ease-in-out infinite;
}

.intro-kicker {
  font-size: 0.95rem;
  letter-spacing: 0.35em;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 18px;
}

.museum-intro h1 {
  font-size: clamp(2.2rem, 6vw, 4rem);
  font-weight: 900;
  color: #F7F3ED;
  line-height: 1.35;
  margin-bottom: 14px;
}

.museum-intro .intro-sub {
  color: rgba(247, 243, 237, 0.65);
  font-size: 1.05rem;
  max-width: 560px;
  margin: 0 auto 12px;
}

.intro-meta {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 22px;
  color: rgba(247, 243, 237, 0.55);
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 34px;
}

.intro-meta span::before { content: "◆"; color: var(--gold); font-size: 0.6rem; margin-inline-end: 8px; vertical-align: 2px; }

.intro-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; margin-bottom: 26px; }

.btn-museum {
  background: var(--burgundy);
  color: #F7F3ED;
  border: none;
  box-shadow: 0 10px 40px rgba(139, 30, 45, 0.45);
}

.btn-museum:hover { background: var(--burgundy-dark); }

.btn-ghost {
  background: transparent;
  color: #F7F3ED;
  border: 1.5px solid rgba(247, 243, 237, 0.35);
}

.btn-ghost:hover { border-color: var(--gold); color: var(--gold); background: rgba(201, 162, 39, 0.06); }

.intro-note { font-size: 0.8rem; color: rgba(247, 243, 237, 0.4); max-width: 520px; margin: 0 auto; }

.intro-back {
  position: absolute;
  top: 42px;
  inset-inline-start: 48px;
  color: rgba(247, 243, 237, 0.6);
  font-weight: 700;
  font-size: 0.92rem;
  z-index: 2;
}

.intro-back:hover { color: var(--gold); }

/* ---------- العارض بملء الشاشة ---------- */

.viewer-wrap { position: relative; }

#viewer {
  height: 100svh;
  min-height: 540px;
  overflow-x: auto;
  overflow-y: hidden;
  position: relative;
  background: #101012;
  scrollbar-width: none;
}

#viewer::-webkit-scrollbar { display: none; }

.scene-stage {
  position: relative;
  height: 100%;
  aspect-ratio: 1600 / 850;
  min-width: 100%;
  margin-inline: auto;
}

.scene-stage .scene-svg { position: absolute; inset: 0; width: 100%; height: 100%; }

/* واجهة عائمة فوق العارض */

.viewer-ui-top {
  position: absolute;
  top: 0;
  inset-inline: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 22px 34px;
  background: linear-gradient(180deg, rgba(12, 12, 14, 0.75), transparent);
  pointer-events: none;
}

.viewer-ui-top > * { pointer-events: auto; }

.viewer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #F7F3ED;
}

.viewer-brand img { height: 40px; }

.viewer-brand .vt { font-weight: 800; font-size: 1.02rem; }
.viewer-brand .vs { font-size: 0.72rem; color: rgba(247, 243, 237, 0.55); }

.viewer-link {
  color: rgba(247, 243, 237, 0.75);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 9px 20px;
  border-radius: 999px;
  border: 1px solid rgba(247, 243, 237, 0.25);
  backdrop-filter: blur(8px);
  background: rgba(22, 22, 24, 0.35);
  cursor: pointer;
  font-family: var(--font-ar);
  transition: all 0.2s;
}

.viewer-link:hover { color: var(--gold); border-color: var(--gold); }

.viewer-hint {
  position: absolute;
  bottom: 26px;
  inset-inline: 0;
  display: flex;
  justify-content: center;
  z-index: 5;
  pointer-events: none;
}

.viewer-hint span {
  background: rgba(16, 16, 18, 0.65);
  border: 1px solid rgba(247, 243, 237, 0.18);
  color: rgba(247, 243, 237, 0.85);
  border-radius: 999px;
  padding: 9px 24px;
  font-size: 0.88rem;
  font-weight: 700;
  backdrop-filter: blur(8px);
}

.viewer-vignette {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  box-shadow: inset 0 0 180px rgba(0, 0, 0, 0.55);
}

/* نقاط متحفية مرقّمة */

body.museum .hotspot {
  width: 40px;
  height: 40px;
  background: rgba(16, 16, 18, 0.55);
  border: 1.5px solid rgba(247, 243, 237, 0.85);
  color: #F7F3ED;
  font-family: var(--font-en);
  font-size: 0.95rem;
  font-weight: 700;
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5);
  z-index: 4;
}

body.museum .hotspot::after { border-color: rgba(201, 162, 39, 0.7); }

body.museum .hotspot:hover {
  background: var(--gold);
  border-color: var(--gold);
  color: #161618;
}

body.museum .hotspot .tip {
  background: rgba(16, 16, 18, 0.9);
  border: 1px solid rgba(201, 162, 39, 0.4);
  color: #F7F3ED;
}

/* ---------- اللوحة الجانبية (المتحفية) ---------- */

.drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  inset-inline-start: 0;
  width: min(460px, 94vw);
  z-index: 300;
  background: rgba(24, 24, 27, 0.97);
  backdrop-filter: blur(18px);
  border-inline-end: 1px solid rgba(201, 162, 39, 0.35);
  box-shadow: 30px 0 80px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  transform: translateX(105%);
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.drawer.open { transform: translateX(0); }

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 26px;
  border-bottom: 1px solid var(--museum-line);
}

.drawer-head .dh-label { font-size: 0.8rem; letter-spacing: 0.25em; color: var(--gold); font-weight: 700; }

.drawer-close {
  border: 1px solid rgba(247, 243, 237, 0.25);
  background: transparent;
  color: #F7F3ED;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s;
}

.drawer-close:hover { border-color: var(--gold); color: var(--gold); }

.drawer-body { flex: 1; overflow-y: auto; padding: 30px 28px; }

.drawer-body .d-num {
  font-family: var(--font-en);
  font-size: 3rem;
  font-weight: 700;
  color: rgba(201, 162, 39, 0.35);
  line-height: 1;
  margin-bottom: 10px;
}

.drawer-body .d-type {
  display: inline-block;
  border: 1px solid rgba(201, 162, 39, 0.5);
  color: var(--gold);
  border-radius: 999px;
  padding: 4px 16px;
  font-size: 0.78rem;
  font-weight: 800;
  margin-bottom: 14px;
}

.drawer-body h3 {
  font-size: 1.65rem;
  font-weight: 900;
  color: #F7F3ED;
  margin-bottom: 8px;
  line-height: 1.4;
}

.drawer-body .d-note { font-size: 0.78rem; color: rgba(247, 243, 237, 0.4); margin-bottom: 20px; }

.drawer-body h4 {
  color: var(--gold);
  font-size: 0.98rem;
  font-weight: 800;
  margin: 22px 0 8px;
}

.drawer-body p { color: var(--museum-text); font-size: 0.95rem; margin-bottom: 12px; }

.drawer-body strong { color: #F7F3ED; }

.drawer-body [style*="teal-soft"] { background: rgba(31, 107, 122, 0.18) !important; }

.drawer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 26px;
  border-top: 1px solid var(--museum-line);
}

.drawer-foot button {
  border: 1px solid rgba(247, 243, 237, 0.25);
  background: transparent;
  color: #F7F3ED;
  border-radius: 999px;
  padding: 9px 24px;
  font-family: var(--font-ar);
  font-weight: 800;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.drawer-foot button:hover { border-color: var(--gold); color: var(--gold); }

.drawer-foot .d-count { font-family: var(--font-en); color: rgba(247, 243, 237, 0.55); font-size: 0.9rem; letter-spacing: 0.1em; }

/* ---------- الأقسام الداكنة أسفل العارض ---------- */

body.museum .section-head h2 { color: #F7F3ED; }
body.museum .section-head p { color: var(--museum-text); }
body.museum .kicker { color: var(--gold); }

body.museum .card {
  background: var(--museum-panel);
  border-color: var(--museum-line);
  box-shadow: none;
}

body.museum .card h3 { color: #F7F3ED; }
body.museum .card p, body.museum .card ul { color: var(--museum-text); }

body.museum .timeline-tab { background: var(--museum-panel); border-color: rgba(247, 243, 237, 0.18); color: var(--museum-text); }

body.museum .timeline-panel { background: var(--museum-panel); border-color: var(--museum-line); box-shadow: none; }
body.museum .timeline-panel h3 { color: #F7F3ED; }
body.museum .timeline-panel p { color: var(--museum-text); }

body.museum .chat-shell { background: var(--museum-panel); border-color: var(--museum-line); box-shadow: none; }
body.museum .chat-body { background: #141416; }
body.museum .msg.bot { background: #232326; border-color: rgba(247, 243, 237, 0.12); color: #EDE9E2; }
body.museum .chat-suggest { background: #141416; }
body.museum .chat-input { background: var(--museum-panel); border-color: var(--museum-line); }
body.museum .chat-input input { background: #141416; border-color: rgba(247, 243, 237, 0.15); color: #F7F3ED; }

body.museum .demo-note { background: rgba(191, 127, 77, 0.12); border-color: rgba(191, 127, 77, 0.4); color: #D8A574; }

body.museum .band-dark { background: transparent; border-top: 1px solid var(--museum-line); }

body.museum .site-footer { background: #101012; }

body.museum .breadcrumb a { color: var(--gold); }

/* ---------- رأس الدليل السينمائي ---------- */

.guide-hero {
  background:
    radial-gradient(ellipse at 15% 0%, rgba(139, 30, 45, 0.25), transparent 50%),
    radial-gradient(ellipse at 90% 100%, rgba(191, 127, 77, 0.16), transparent 55%),
    linear-gradient(180deg, #131315, #1E1E21);
  color: var(--museum-text);
  border-bottom: 1px solid rgba(201, 162, 39, 0.25);
}

.guide-hero .section-head h2 { color: #F7F3ED; }
.guide-hero .section-head h2 .accent { color: var(--gold); }
.guide-hero .section-head p { color: var(--museum-text); }
.guide-hero .kicker { color: var(--gold); }

.guide-hero .access-tabs { background: rgba(247, 243, 237, 0.06); border-color: rgba(247, 243, 237, 0.14); box-shadow: none; }
.guide-hero .access-tab { color: rgba(247, 243, 237, 0.65); }
.guide-hero .access-tab.active { background: var(--burgundy); color: #F7F3ED; }

@media (max-width: 640px) {
  .intro-back { top: 30px; inset-inline-start: 26px; }
  .viewer-ui-top { padding: 16px 18px; }
  .viewer-brand .vs { display: none; }
  .drawer { width: 100vw; border-inline-end: none; }
}

/* ============================================================
   فضاء وريد + استوديو وريد
   ============================================================ */

/* بطاقات الجولات في الفضاء */

.tour-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--museum-line);
  background: var(--museum-panel);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s, border-color 0.3s;
}

.tour-card:hover { transform: translateY(-6px); border-color: rgba(201, 162, 39, 0.5); }

.tour-card .tc-media {
  height: 190px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.4rem;
  overflow: hidden;
}

.tour-card .tc-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.tour-card .tc-body { padding: 22px 24px 24px; display: flex; flex-direction: column; gap: 8px; flex: 1; }

.tour-card h3 { color: #F7F3ED; font-size: 1.15rem; font-weight: 800; }

.tour-card .tc-desc { color: var(--museum-text); font-size: 0.9rem; }

.contrib-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px dashed var(--museum-line);
  font-size: 0.82rem;
  color: rgba(247, 243, 237, 0.6);
}

.contrib-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--burgundy), var(--earth));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #F7F3ED;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.contrib-line .wname { color: #F7F3ED; font-weight: 700; }

.contrib-badge {
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 800;
  border: 1px solid rgba(201, 162, 39, 0.45);
  border-radius: 999px;
  padding: 1px 10px;
}

.tc-stats { display: flex; gap: 16px; font-size: 0.78rem; color: rgba(247, 243, 237, 0.5); }

/* خط سير المنصة (كيف تعمل) */

.flow-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; counter-reset: fstep; }

.flow-step {
  background: var(--museum-panel);
  border: 1px solid var(--museum-line);
  border-radius: var(--radius-lg);
  padding: 26px 22px;
  position: relative;
}

.flow-step::before {
  counter-increment: fstep;
  content: counter(fstep, arabic-indic);
  position: absolute;
  top: -16px;
  inset-inline-start: 20px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--burgundy);
  color: #F7F3ED;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  box-shadow: 0 6px 18px rgba(139, 30, 45, 0.4);
}

.flow-step .fs-icon { font-size: 1.8rem; margin-bottom: 10px; }
.flow-step h4 { color: #F7F3ED; font-size: 1rem; font-weight: 800; margin-bottom: 6px; }
.flow-step p { color: var(--museum-text); font-size: 0.86rem; }

/* ---------- الاستوديو ---------- */

.studio-stepper {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.sstep {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid var(--museum-line);
  color: rgba(247, 243, 237, 0.55);
  font-weight: 700;
  font-size: 0.9rem;
  background: transparent;
  font-family: var(--font-ar);
  cursor: default;
}

.sstep .n {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-family: var(--font-en);
}

.sstep.active { border-color: var(--gold); color: var(--gold); background: rgba(201, 162, 39, 0.08); }
.sstep.done { color: #7FBF9E; border-color: rgba(127, 191, 158, 0.4); }

.studio-layout { display: grid; grid-template-columns: 1.5fr 1fr; gap: 24px; align-items: start; }

.studio-stage-wrap {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--museum-line);
  background: #101012;
}

.studio-stage { position: relative; aspect-ratio: 1600 / 850; }

.studio-stage img { position: absolute; inset: 0; width: 100%; height: 100%; }

.studio-stage.placing { cursor: crosshair; }

.studio-stage .cam-frame {
  position: absolute;
  inset: 14px;
  border: 1.5px dashed rgba(247, 243, 237, 0.35);
  border-radius: 10px;
  pointer-events: none;
}

.cam-hud {
  position: absolute;
  top: 24px;
  inset-inline-start: 28px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 16, 18, 0.7);
  color: #F7F3ED;
  border-radius: 999px;
  padding: 5px 16px;
  font-size: 0.78rem;
  font-weight: 700;
  z-index: 3;
}

.cam-hud .rec { width: 9px; height: 9px; border-radius: 50%; background: #E23B3B; animation: pulse 1.6s infinite; }

.spin {
  position: absolute;
  border-radius: 50%;
  transform: translate(50%, -50%);
  width: 34px;
  height: 34px;
  background: rgba(201, 162, 39, 0.95);
  color: #161618;
  border: 2px solid #F7F3ED;
  font-family: var(--font-en);
  font-weight: 800;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  z-index: 4;
}

.spin.preview-pin { background: rgba(16, 16, 18, 0.6); color: #F7F3ED; border-color: rgba(247, 243, 237, 0.85); backdrop-filter: blur(4px); }
.spin.preview-pin::after { content: ""; position: absolute; inset: -7px; border-radius: 50%; border: 2px solid rgba(201, 162, 39, 0.7); animation: pulse 2.2s ease-out infinite; }

.studio-panel {
  background: var(--museum-panel);
  border: 1px solid var(--museum-line);
  border-radius: var(--radius-lg);
  padding: 26px;
}

.studio-panel h3 { color: #F7F3ED; font-weight: 900; font-size: 1.2rem; margin-bottom: 6px; }
.studio-panel .sp-sub { color: var(--museum-text); font-size: 0.88rem; margin-bottom: 18px; }

.studio-panel label { display: block; color: var(--gold); font-size: 0.8rem; font-weight: 800; margin: 12px 0 4px; }

.studio-panel input, .studio-panel textarea, .studio-panel select {
  width: 100%;
  background: #141416;
  border: 1px solid rgba(247, 243, 237, 0.15);
  border-radius: 10px;
  color: #F7F3ED;
  font-family: var(--font-ar);
  font-size: 0.9rem;
  padding: 9px 14px;
}

.studio-panel input:focus, .studio-panel textarea:focus { outline: 1.5px solid rgba(201, 162, 39, 0.5); }

/* جدول المعلومات (نموذج الإكسل) */

.excel-look {
  border: 1px solid rgba(247, 243, 237, 0.15);
  border-radius: 12px;
  overflow: hidden;
  font-size: 0.85rem;
}

.excel-look .xrow { display: grid; grid-template-columns: 44px 1fr 1fr; border-top: 1px solid rgba(247, 243, 237, 0.08); }
.excel-look .xrow:first-child { border-top: none; background: rgba(201, 162, 39, 0.12); color: var(--gold); font-weight: 800; }
.excel-look .xcell { padding: 8px 12px; border-inline-start: 1px solid rgba(247, 243, 237, 0.08); color: var(--museum-text); }
.excel-look .xcell:first-child { border-inline-start: none; font-family: var(--font-en); text-align: center; }

.studio-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }

.ai-build-note {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(31, 107, 122, 0.15);
  border: 1px solid rgba(31, 107, 122, 0.4);
  border-radius: 12px;
  padding: 12px 18px;
  color: #9ED4DF;
  font-size: 0.85rem;
  font-weight: 700;
  margin-top: 18px;
}

/* حالة التوليد */

.ai-progress { display: none; margin-top: 20px; }
.ai-progress.on { display: block; }

.ai-progress .ap-line { display: flex; align-items: center; gap: 10px; color: var(--museum-text); font-size: 0.88rem; margin-bottom: 8px; opacity: 0; transform: translateY(6px); transition: all 0.4s; }
.ai-progress .ap-line.show { opacity: 1; transform: none; }
.ai-progress .ap-line .ok { color: #7FBF9E; }

/* سجل التوثيق */

.provenance {
  border: 1px solid rgba(201, 162, 39, 0.35);
  border-radius: var(--radius);
  padding: 18px 22px;
  background: rgba(201, 162, 39, 0.05);
  font-size: 0.85rem;
  color: var(--museum-text);
}

.provenance h4 { color: var(--gold); font-size: 0.9rem; margin-bottom: 10px; }
.provenance .prow { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-top: 1px dashed rgba(247, 243, 237, 0.1); }
.provenance .prow span:last-child { color: #F7F3ED; font-weight: 700; }

@media (max-width: 1024px) {
  .flow-steps { grid-template-columns: repeat(2, 1fr); row-gap: 30px; }
  .studio-layout { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .flow-steps { grid-template-columns: 1fr; row-gap: 30px; }
}

/* ============ نقاط الجولات البانورامية (Pannellum) ============ */

/* تثبيت أصل التموضع لليسار — صفحتنا RTL وPannellum يحسب من اليسار */
.wpin { width: 40px !important; height: 40px !important; position: absolute !important; top: 0 !important; left: 0 !important; right: auto !important; }

.wpin .wpin-dot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(16, 16, 18, 0.55);
  border: 1.5px solid rgba(247, 243, 237, 0.9);
  color: #F7F3ED;
  font-family: var(--font-en);
  font-weight: 700;
  font-size: 0.95rem;
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  transition: all 0.2s;
}

.wpin .wpin-dot::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid rgba(201, 162, 39, 0.7);
  animation: pulse 2.2s ease-out infinite;
}

.wpin:hover .wpin-dot { background: var(--gold); border-color: var(--gold); color: #161618; }

.wpin-scene .wpin-dot { border-radius: 12px; background: rgba(31, 107, 122, 0.75); font-size: 1.2rem; }
.wpin-scene .wpin-dot::after { border-radius: 16px; border-color: rgba(31, 107, 122, 0.6); }

.wpin .wpin-tip {
  position: absolute;
  bottom: calc(100% + 12px);
  right: 50%;
  transform: translateX(50%);
  background: rgba(16, 16, 18, 0.9);
  border: 1px solid rgba(201, 162, 39, 0.4);
  color: #F7F3ED;
  font-family: var(--font-ar);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 999px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.wpin:hover .wpin-tip { opacity: 1; }

/* تحييد شعار Pannellum الافتراضي وتحسين التحميل */
.pnlm-about-msg, .pnlm-sprite.pnlm-hot-spot-debug-indicator { display: none !important; }
.pnlm-load-box { background: rgba(16,16,18,0.8); border-radius: 14px; font-family: var(--font-ar); }
.pnlm-container { background: #101012 !important; }

/* ============ معامل وريد الافتراضية ============ */

.lab-chapter { display: none; }
.lab-chapter.active { display: block; animation: modalIn 0.35s ease; }

.weave-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }

.weave-board {
  background: #141416;
  border: 1px solid var(--museum-line);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.weave-board h4 { color: var(--gold); font-size: 0.9rem; margin-bottom: 12px; }

.weave-grid {
  display: grid;
  gap: 3px;
  background: #0E0E10;
  border-radius: 10px;
  padding: 10px;
}

.weave-cell {
  aspect-ratio: 1;
  border-radius: 3px;
  background: #232326;
  cursor: pointer;
  transition: transform 0.1s;
  border: none;
}

.weave-cell:hover { transform: scale(1.12); }

.weave-grid.target .weave-cell { cursor: default; }
.weave-grid.target .weave-cell:hover { transform: none; }

.palette { display: flex; gap: 10px; margin: 16px 0; flex-wrap: wrap; }

.palette button {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 3px solid transparent;
  cursor: pointer;
  transition: transform 0.15s;
}

.palette button:hover { transform: scale(1.1); }
.palette button.sel { border-color: var(--gold); transform: scale(1.1); }

.weave-progress {
  height: 10px;
  border-radius: 999px;
  background: rgba(247, 243, 237, 0.1);
  overflow: hidden;
  margin: 14px 0;
}

.weave-progress .bar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--burgundy), var(--earth), var(--gold));
  transition: width 0.4s;
}

/* الاختبار */

.quiz-q { background: var(--museum-panel); border: 1px solid var(--museum-line); border-radius: var(--radius); padding: 22px 24px; margin-bottom: 16px; }
.quiz-q h4 { color: #F7F3ED; font-size: 1rem; margin-bottom: 12px; }
.quiz-q .opts { display: grid; gap: 8px; }
.quiz-q .opts button {
  text-align: start;
  background: #141416;
  border: 1px solid rgba(247, 243, 237, 0.15);
  color: var(--museum-text);
  border-radius: 10px;
  padding: 10px 16px;
  font-family: var(--font-ar);
  font-size: 0.92rem;
  cursor: pointer;
  transition: all 0.2s;
}
.quiz-q .opts button:hover { border-color: var(--gold); color: #F7F3ED; }
.quiz-q .opts button.correct { border-color: #7FBF9E; color: #7FBF9E; background: rgba(127, 191, 158, 0.08); }
.quiz-q .opts button.wrong { border-color: #E23B3B; color: #E88; }

/* الشهادة */

.certificate {
  border: 2px solid rgba(201, 162, 39, 0.5);
  border-radius: var(--radius-lg);
  padding: 40px 34px;
  text-align: center;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(201, 162, 39, 0.1), transparent 60%),
    #17171A;
  position: relative;
}

.certificate::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(201, 162, 39, 0.25);
  border-radius: 18px;
  pointer-events: none;
}

.certificate img { height: 60px; margin: 0 auto 14px; }
.certificate .c-title { color: var(--gold); letter-spacing: 0.3em; font-size: 0.8rem; font-weight: 800; margin-bottom: 10px; }
.certificate h3 { color: #F7F3ED; font-size: 1.6rem; font-weight: 900; margin-bottom: 4px; }
.certificate .c-name { color: var(--gold); font-size: 1.3rem; font-weight: 900; margin: 12px 0 4px; }
.certificate p { font-size: 0.88rem; color: var(--museum-text); }

@media (max-width: 860px) {
  .weave-wrap { grid-template-columns: 1fr; }
}

/* ============ معالج وريد (رفع الجولات) ============ */

.dropzone {
  border: 2px dashed rgba(201, 162, 39, 0.45);
  border-radius: var(--radius-lg);
  background: rgba(201, 162, 39, 0.04);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s;
}

.dropzone:hover, .dropzone.drag {
  border-color: var(--gold);
  background: rgba(201, 162, 39, 0.1);
  transform: scale(1.005);
}

.dropzone .dz-icon { font-size: 2.6rem; margin-bottom: 10px; }
.dropzone h3 { color: #F7F3ED; font-weight: 900; margin-bottom: 6px; }
.dropzone p { color: var(--museum-text); font-size: 0.9rem; }
.dropzone .hint { color: rgba(247, 243, 237, 0.4); font-size: 0.78rem; margin-top: 10px; }

.wizard-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; margin-top: 22px; }

.wthumb {
  background: var(--museum-panel);
  border: 1px solid var(--museum-line);
  border-radius: 14px;
  overflow: hidden;
}

.wthumb img { width: 100%; aspect-ratio: 2/1; object-fit: cover; display: block; }

.wthumb .wt-body { padding: 10px 12px; }

.wthumb input {
  width: 100%;
  background: #141416;
  border: 1px solid rgba(247, 243, 237, 0.15);
  border-radius: 8px;
  color: #F7F3ED;
  font-family: var(--font-ar);
  font-size: 0.85rem;
  padding: 6px 10px;
}

.wthumb .wt-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 0.72rem; color: rgba(247, 243, 237, 0.45); }

.wthumb .wt-del { background: none; border: none; color: #E88; cursor: pointer; font-size: 0.78rem; font-family: var(--font-ar); }

/* قائمة المعالجة */

.proc-list { display: grid; gap: 10px; }

.proc-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--museum-panel);
  border: 1px solid var(--museum-line);
  border-radius: 12px;
  padding: 12px 18px;
  font-size: 0.9rem;
  color: var(--museum-text);
}

.proc-item .st { margin-inline-start: auto; font-weight: 800; font-size: 0.8rem; }
.proc-item .st.wait { color: rgba(247, 243, 237, 0.35); }
.proc-item .st.run { color: var(--gold); }
.proc-item .st.ok { color: #7FBF9E; }
.proc-item .st.err { color: #E88; }

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(201, 162, 39, 0.25);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  display: inline-block;
  vertical-align: middle;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* معاينة الجولة داخل المعالج */

.wizard-preview {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(201, 162, 39, 0.35);
  position: relative;
  height: 480px;
  background: #101012;
}

.wizard-preview #wiz-pano { width: 100%; height: 100%; }

.hs-edit-list { display: grid; gap: 10px; margin-top: 18px; }

.hs-edit {
  background: var(--museum-panel);
  border: 1px solid var(--museum-line);
  border-radius: 12px;
  padding: 14px 18px;
}

.hs-edit .he-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.hs-edit .he-num { color: var(--gold); font-family: var(--font-en); font-weight: 800; }
.hs-edit input, .hs-edit textarea {
  width: 100%;
  background: #141416;
  border: 1px solid rgba(247, 243, 237, 0.12);
  border-radius: 8px;
  color: #F7F3ED;
  font-family: var(--font-ar);
  font-size: 0.85rem;
  padding: 7px 12px;
  margin-top: 6px;
}

.api-note {
  background: rgba(31, 107, 122, 0.12);
  border: 1px solid rgba(31, 107, 122, 0.35);
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 0.85rem;
  color: #9ED4DF;
}

/* ============================================================
   بوابات الوثائق في «افهم وريد» — وثيقة التأسيس والعرض التقديمي
   ============================================================ */

.doc-gateways {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  max-width: 900px;
  margin: 32px auto 8px;
  text-align: start;
}

.gateway {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-soft);
  transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
}

.gateway:hover {
  border-color: var(--burgundy);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.gateway .gw-icon {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--burgundy-soft);
  color: var(--burgundy);
}

.gateway.gw-accent .gw-icon { background: var(--teal-soft); color: var(--teal); }

.gateway .gw-icon svg { width: 24px; height: 24px; }

.gateway .gw-body { flex: 1; min-width: 0; }

.gateway .gw-title {
  display: block;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--charcoal);
  margin-bottom: 3px;
}

.gateway .gw-sub {
  display: block;
  font-size: 0.86rem;
  color: var(--text-soft);
  line-height: 1.65;
}

.gateway .gw-go {
  flex: none;
  color: var(--burgundy);
  font-size: 1.2rem;
  transition: transform 0.3s;
}

.gateway:hover .gw-go { transform: translateX(-5px); }
.gateway.gw-accent .gw-go { color: var(--teal); }

/* ============================================================
   بطاقات «توثيق وريد» الرسمي في الفضاء
   ============================================================ */

.official-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 18px;
}

.official-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 26px 26px 22px;
  border: 1px solid rgba(201, 162, 39, 0.3);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(ellipse at 100% 0%, rgba(201, 162, 39, 0.09), transparent 58%),
    rgba(31, 31, 34, 0.55);
  transition: border-color 0.35s, transform 0.35s, background 0.35s;
}

.official-card:hover {
  border-color: rgba(201, 162, 39, 0.65);
  transform: translateY(-4px);
}

.official-card .oc-badge {
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--gold);
  border: 1px solid rgba(201, 162, 39, 0.45);
  background: rgba(201, 162, 39, 0.08);
  border-radius: 999px;
  padding: 5px 13px;
}

.official-card .oc-type {
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  color: rgba(247, 243, 237, 0.45);
  font-weight: 700;
}

.official-card h3 {
  font-size: 1.15rem;
  color: #F7F3ED;
  font-weight: 800;
  margin: 0;
  line-height: 1.6;
}

.official-card p {
  font-size: 0.92rem;
  color: rgba(247, 243, 237, 0.62);
  line-height: 1.95;
  margin: 0;
  flex: 1;
}

.official-card .oc-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  border-top: 1px solid rgba(247, 243, 237, 0.1);
  padding-top: 14px;
  margin-top: 6px;
}

.official-card .oc-status { font-size: 0.78rem; color: rgba(191, 127, 77, 0.95); font-weight: 700; }
.official-card .oc-go { font-size: 0.82rem; color: var(--gold); font-weight: 800; }

/* ============================================================
   تفاعل الفضاء: إعجاب، تعليق، مشاركة
   ============================================================ */

.social-panel {
  border: 1px solid rgba(247, 243, 237, 0.12);
  border-radius: var(--radius-lg);
  background: rgba(31, 31, 34, 0.55);
  padding: 22px 24px;
}

.social-panel .sp-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(247, 243, 237, 0.1);
}

.social-panel .sp-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border: 1px solid rgba(247, 243, 237, 0.18);
  border-radius: 999px;
  background: transparent;
  color: rgba(247, 243, 237, 0.8);
  font-family: var(--font-ar);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.25s, color 0.25s, background 0.25s;
}

.social-panel .sp-btn:hover { border-color: var(--gold); color: var(--gold); }
.social-panel .sp-btn.on { border-color: var(--burgundy); color: #E8A0A8; background: rgba(139, 30, 45, 0.14); }
.social-panel .sp-btn .sp-ico { font-size: 1.05rem; line-height: 1; }
.social-panel .sp-share-msg { color: #7FBF9E; font-size: 0.82rem; font-weight: 700; }

.social-panel .sp-form { display: grid; gap: 10px; padding: 18px 0; }

.social-panel .sp-name,
.social-panel .sp-text {
  width: 100%;
  background: rgba(247, 243, 237, 0.05);
  border: 1px solid rgba(247, 243, 237, 0.14);
  border-radius: 12px;
  padding: 11px 15px;
  color: #F7F3ED;
  font-family: var(--font-ar);
  font-size: 0.92rem;
  resize: vertical;
}

.social-panel .sp-name { max-width: 260px; }
.social-panel .sp-name:focus,
.social-panel .sp-text:focus { outline: none; border-color: rgba(201, 162, 39, 0.55); }
.social-panel ::placeholder { color: rgba(247, 243, 237, 0.35); }

.social-panel .sp-form-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.social-panel .sp-hint { font-size: 0.78rem; color: rgba(247, 243, 237, 0.42); }

.social-panel .sp-send {
  padding: 9px 26px;
  border: none;
  border-radius: 999px;
  background: var(--burgundy);
  color: #F7F3ED;
  font-family: var(--font-ar);
  font-weight: 800;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 0.25s;
}

.social-panel .sp-send:hover { background: var(--burgundy-dark); }
.social-panel .sp-send:disabled { opacity: 0.5; cursor: default; }

.social-panel .sp-msg { font-size: 0.85rem; font-weight: 700; }
.social-panel .sp-msg.ok { color: #7FBF9E; }
.social-panel .sp-msg.err { color: #E88; }

.social-panel .sp-list { display: grid; gap: 12px; padding-top: 6px; }
.social-panel .sp-empty { color: rgba(247, 243, 237, 0.4); font-size: 0.88rem; margin: 0; }

.social-panel .sp-item { display: flex; gap: 12px; align-items: flex-start; }
.social-panel .sp-item.pending { opacity: 0.62; }

.social-panel .sp-avatar {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(201, 162, 39, 0.16);
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
}

.social-panel .sp-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 3px; }
.social-panel .sp-meta strong { color: #F7F3ED; font-size: 0.9rem; }
.social-panel .sp-time { color: rgba(247, 243, 237, 0.38); font-size: 0.76rem; }

.social-panel .sp-pending {
  font-size: 0.7rem;
  font-weight: 700;
  color: rgba(191, 127, 77, 0.95);
  border: 1px solid rgba(191, 127, 77, 0.4);
  border-radius: 999px;
  padding: 2px 9px;
}

.social-panel .sp-body p { margin: 0; color: rgba(247, 243, 237, 0.78); font-size: 0.92rem; line-height: 1.85; }

/* الشريط المصغّر على البطاقات */

.social-mini {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.82rem;
  color: rgba(247, 243, 237, 0.5);
  font-weight: 700;
  margin-top: 10px;
}

.social-mini .sm-like { cursor: pointer; transition: color 0.25s; }
.social-mini .sm-like:hover { color: var(--gold); }
.social-mini .sm-like.on { color: #E8A0A8; }



/* ============================================================
   خريطة الفضاء — حدود ومناطق حقيقية (Natural Earth، ملك عام)
   ============================================================ */

.guide-map-wrap {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 24px;
  align-items: center;
}

@media (max-width: 800px) { .guide-map-wrap { grid-template-columns: 1fr; } }

#guide-map { width: 100%; max-width: 620px; margin-inline: auto; }
.gm-svg { width: 100%; height: auto; overflow: visible; display: block; }

.gm-region {
  fill: rgba(247, 243, 237, 0.035);
  stroke: rgba(247, 243, 237, 0.1);
  stroke-width: 1;
  transition: fill 0.3s;
  vector-effect: non-scaling-stroke;
}

.gm-region:hover { fill: rgba(201, 162, 39, 0.07); }

.gm-land {
  fill: none;
  stroke: rgba(201, 162, 39, 0.55);
  stroke-width: 2;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

.gm-isle { stroke-width: 1.4; }

.gm-pin { cursor: pointer; outline: none; }

.gm-pin .gm-dot {
  fill: var(--burgundy);
  stroke: rgba(201, 162, 39, 0.9);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
  transition: fill 0.25s;
}

.gm-pin.official .gm-dot { fill: var(--gold); stroke: rgba(247, 243, 237, 0.7); }

.gm-pin .gm-halo {
  fill: rgba(201, 162, 39, 0.16);
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  transition: opacity 0.3s, transform 0.3s;
}

.gm-pin:hover .gm-halo,
.gm-pin:focus .gm-halo { opacity: 1; transform: scale(1.35); }
.gm-pin:focus .gm-dot { fill: var(--gold); }

.guide-map-side {
  display: grid;
  gap: 14px;
  align-content: center;
}

#guide-map-info {
  display: grid;
  gap: 5px;
  padding: 16px 18px;
  border: 1px solid rgba(247, 243, 237, 0.12);
  border-radius: 14px;
  background: rgba(31, 31, 34, 0.55);
  min-height: 96px;
  opacity: 0.5;
  transition: opacity 0.3s, border-color 0.3s;
}

#guide-map-info.on { opacity: 1; border-color: rgba(201, 162, 39, 0.4); }
#guide-map-info .gmi-kind { font-size: 0.72rem; font-weight: 800; color: var(--gold); letter-spacing: 0.06em; }
#guide-map-info strong { color: #F7F3ED; font-size: 0.95rem; line-height: 1.6; }
#guide-map-info .gmi-where { font-size: 0.8rem; color: rgba(247, 243, 237, 0.5); }

.guide-map-side .gm-legend { display: grid; gap: 8px; font-size: 0.8rem; color: rgba(247, 243, 237, 0.55); }
.guide-map-side .gm-legend span { display: flex; align-items: center; gap: 9px; }
.guide-map-side .gm-legend i {
  width: 11px; height: 11px; border-radius: 50%; flex: none;
  border: 1.5px solid rgba(201, 162, 39, 0.9); background: var(--burgundy);
}
.guide-map-side .gm-legend i.official { background: var(--gold); border-color: rgba(247, 243, 237, 0.7); }
.guide-map-side .gm-source { font-size: 0.72rem; color: rgba(247, 243, 237, 0.3); line-height: 1.7; }

/* ملخص السجل ورابطه في الفضاء — بدل إغراق الصفحة بكل الملفات */

.official-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  margin-bottom: 22px;
  font-size: 0.88rem;
  color: rgba(247, 243, 237, 0.55);
}

.official-stats b {
  font-family: var(--font-en, Montserrat), sans-serif;
  color: var(--gold);
  font-size: 1.2rem;
  margin-inline-end: 6px;
}

.registry-cta {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 18px;
  padding: 20px 26px;
  border: 1px solid rgba(201, 162, 39, 0.35);
  border-radius: var(--radius);
  background: rgba(201, 162, 39, 0.05);
  transition: border-color 0.3s, background 0.3s, transform 0.3s;
}

.registry-cta:hover {
  border-color: rgba(201, 162, 39, 0.7);
  background: rgba(201, 162, 39, 0.09);
  transform: translateY(-2px);
}

.registry-cta .rc-body { flex: 1; display: grid; gap: 4px; }
.registry-cta strong { color: var(--gold); font-size: 1.05rem; font-weight: 800; }
.registry-cta span span { color: rgba(247, 243, 237, 0.6); font-size: 0.88rem; line-height: 1.7; }
.registry-cta .rc-go { flex: none; color: var(--gold); font-size: 1.4rem; transition: transform 0.3s; }
.registry-cta:hover .rc-go { transform: translateX(-6px); }

/* ============================================================
   ما تحت عارض الجولة: التفاعل جزء من الصفحة لا لوحة مخبأة
   ============================================================ */

.tour-below {
  background: linear-gradient(180deg, #121214, var(--museum-bg));
  border-top: 1px solid rgba(201, 162, 39, 0.22);
  padding: clamp(44px, 7vh, 80px) 0 clamp(60px, 9vh, 100px);
}

.tour-below .tb-head { margin-bottom: 26px; max-width: 680px; }

.tour-below .tb-head h2 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 900;
  color: #F7F3ED;
  margin: 0 0 10px;
}

.tour-below .tb-head p {
  color: rgba(247, 243, 237, 0.6);
  font-size: 0.98rem;
  line-height: 1.95;
  margin: 0;
}

.tour-below .social-panel { max-width: 780px; }

/* إشارة النزول فوق العارض */

.scroll-cue {
  position: absolute;
  bottom: 20px;
  /* الزاوية اليسرى (RTL): تلميح التجوّل في المنتصف والدرج يفتح من اليمين */
  inset-inline-end: 20px;
  z-index: 7;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  border: 1px solid rgba(201, 162, 39, 0.45);
  border-radius: 999px;
  background: rgba(18, 18, 20, 0.82);
  backdrop-filter: blur(8px);
  color: var(--gold);
  font-family: var(--font-ar);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.25s, border-color 0.25s;
}

.scroll-cue:hover { background: rgba(201, 162, 39, 0.14); border-color: var(--gold); }

.scroll-cue .sc-arrow { animation: cue-drop 2.2s ease-in-out infinite; }

@keyframes cue-drop {
  0%, 100% { transform: translateY(0); opacity: 0.7; }
  50% { transform: translateY(4px); opacity: 1; }
}

/* على الشاشات الضيقة يتمدد تلميح التجوّل فترتفع الإشارة فوقه */
@media (max-width: 720px) {
  .scroll-cue { bottom: 68px; font-size: 0.78rem; padding: 7px 15px; }
}

/* ============================================================
   محرّر الجولات في لوحة المدير — تعديل قبل النشر وبعده
   ============================================================ */

.ed-list { display: grid; gap: 10px; margin-bottom: 20px; }

.ed-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  grid-template-areas: "title state btns" "meta meta btns";
  align-items: center;
  gap: 4px 14px;
  padding: 14px 20px;
  border: 1px solid var(--museum-line);
  border-radius: 14px;
  background: var(--museum-panel);
}

.ed-row .ed-title { grid-area: title; color: #F7F3ED; font-weight: 800; font-size: 1rem; }
.ed-row .ed-meta { grid-area: meta; color: rgba(247, 243, 237, 0.45); font-size: 0.82rem; }
.ed-row .ed-btns { grid-area: btns; display: flex; gap: 8px; }
.ed-row .ed-btn { padding: 6px 18px; font-size: 0.82rem; }

.ed-state {
  grid-area: state;
  justify-self: start;
  font-size: 0.74rem;
  font-weight: 700;
  border: 1px solid;
  border-radius: 999px;
  padding: 2px 12px;
  white-space: nowrap;
}

.ed-state.ok { color: #7FBF9E; border-color: rgba(127, 191, 158, 0.4); background: rgba(127, 191, 158, 0.08); }
.ed-state.warn { color: #D6A44A; border-color: rgba(214, 164, 74, 0.4); background: rgba(214, 164, 74, 0.08); }
.ed-state.wait { color: rgba(247, 243, 237, 0.5); border-color: rgba(247, 243, 237, 0.18); }

@media (max-width: 620px) {
  .ed-row { grid-template-columns: 1fr; grid-template-areas: "title" "state" "meta" "btns"; }
  .ed-row .ed-btns { margin-top: 8px; }
}

/* نموذج التحرير */

.ed-panel { margin-top: 6px; }
.ed-panel h3 { color: var(--gold); margin-bottom: 18px; }

.ed-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }

.ed-f { display: grid; gap: 5px; margin-bottom: 12px; }
.ed-f > span { font-size: 0.8rem; color: rgba(247, 243, 237, 0.55); font-weight: 700; }

.ed-f input,
.ed-f textarea {
  width: 100%;
  background: rgba(247, 243, 237, 0.05);
  border: 1px solid rgba(247, 243, 237, 0.14);
  border-radius: 10px;
  padding: 9px 13px;
  color: #F7F3ED;
  font-family: var(--font-ar);
  font-size: 0.9rem;
  resize: vertical;
}

.ed-f input:focus,
.ed-f textarea:focus { outline: none; border-color: rgba(201, 162, 39, 0.55); }

.ed-scene {
  border: 1px solid rgba(247, 243, 237, 0.1);
  border-radius: 12px;
  padding: 14px 18px;
  margin-top: 12px;
  background: rgba(247, 243, 237, 0.02);
}

.ed-scene > summary {
  cursor: pointer;
  color: #F7F3ED;
  font-weight: 800;
  font-size: 0.95rem;
  margin-bottom: 10px;
}

.ed-scene > summary span { color: rgba(247, 243, 237, 0.4); font-weight: 400; font-size: 0.82rem; }

.ed-hs {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid rgba(247, 243, 237, 0.07);
}

.ed-hs-n {
  font-family: var(--font-en, Montserrat), sans-serif;
  font-size: 0.8rem;
  color: rgba(201, 162, 39, 0.8);
  font-weight: 700;
  padding-top: 8px;
}

.ed-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--museum-line);
}

.ed-actions .btn { padding: 9px 24px; font-size: 0.88rem; }
.ed-msg { font-size: 0.86rem; font-weight: 700; }
.ed-msg.ok { color: #7FBF9E; }
.ed-msg.err { color: #E88; }

/* ============================================================
   صفحة الجولة: شاشة الدخول داخل تدفق الصفحة
   حتى تُمرَّر إلى التعليقات والإعجابات بدل أن تحجبها
   ============================================================ */

/* ‎.in-flow‎ خاصة بصفحة الجولة — شاشة دخول التوأم (twin) تبقى ثابتة كما هي */
.museum-intro.in-flow { position: absolute; }

.intro-social {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin: 0 auto 20px;
  padding: 10px 22px;
  border: 1px solid rgba(247, 243, 237, 0.2);
  border-radius: 999px;
  background: rgba(20, 20, 22, 0.55);
  backdrop-filter: blur(8px);
  color: rgba(247, 243, 237, 0.85);
  font-family: var(--font-ar);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.25s, background 0.25s;
}

.intro-social[hidden] { display: none; }
.intro-social:hover { border-color: var(--gold); background: rgba(201, 162, 39, 0.1); }

.intro-social b { font-family: var(--font-en, Montserrat), sans-serif; margin-inline-start: 4px; }
.intro-social .is-sep { width: 1px; height: 16px; background: rgba(247, 243, 237, 0.18); }
.intro-social .is-like { transition: color 0.25s; }
.intro-social .is-like:hover { color: #E8A0A8; }
.intro-social .is-like.on { color: #E8A0A8; }
.intro-social .is-go { color: var(--gold); font-size: 0.82rem; }

@media (max-width: 560px) {
  .intro-social { font-size: 0.82rem; padding: 8px 16px; gap: 10px; }
  .intro-social .is-go { display: none; }
}

/* عدّاد المشاهدات */

.social-panel .sp-views {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: rgba(247, 243, 237, 0.45);
  font-weight: 700;
  margin-inline-start: auto;
}

.social-mini .sm-v { color: rgba(247, 243, 237, 0.42); }
.intro-social .is-v { color: rgba(247, 243, 237, 0.7); }
