/* ============================================================
   Nexora — Brand stylesheet
   Charcoal #1A1A28 · Gold #A07E3F · Cream #F5F2EA
   Type: IBM Plex Sans (Latin) + IBM Plex Sans Arabic + IBM Plex Mono
   Substitute for Somar Sans until licensed font is installed.
   Philosophy: editorial · sovereign · disciplined · restrained
   ============================================================ */

@font-face {
  font-family: "Somar Sans";
  src: url("fonts/somar-sans-regular.otf") format("opentype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --charcoal: #1A1A28;
  --charcoal-soft: #2A2A38;
  --gold: #A07E3F;
  --gold-soft: #C9A961;
  --cream: #F5F2EA;
  --ivory: #FAFAF7;
  --line: rgba(26, 26, 40, 0.12);
  --line-soft: rgba(26, 26, 40, 0.07);
  --muted: rgba(26, 26, 40, 0.58);

  --maxw: 1180px;
  --gutter: clamp(22px, 5vw, 64px);

  --font-sans: "Somar Sans", "IBM Plex Sans Arabic", "IBM Plex Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--cream);
  color: var(--charcoal);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.55;
}

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

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

::selection { background: var(--gold); color: var(--ivory); }

/* ---------- Layout ---------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

section { padding-block: clamp(64px, 9vw, 130px); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 22px;
}

h1, h2, h3 { font-weight: 600; letter-spacing: -0.02em; margin: 0; }

h1 { font-size: clamp(40px, 6.4vw, 78px); line-height: 1.02; }
h2 { font-size: clamp(28px, 4vw, 46px); line-height: 1.08; }
h3 { font-size: clamp(19px, 2vw, 22px); line-height: 1.2; }

p { margin: 0; text-wrap: pretty; }

.lead { font-size: clamp(17px, 1.5vw, 20px); color: var(--muted); max-width: 56ch; }

/* ---------- Logo mark ---------- */
.mark { display: inline-flex; align-items: center; gap: 14px; }
.mark svg { display: block; }
.mark .word {
  font-weight: 600;
  letter-spacing: 0.16em;
  font-size: 19px;
  text-transform: uppercase;
}
.mark .word .ar {
  display: block;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-transform: none;
  margin-top: 1px;
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--cream) 86%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.topbar .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px;
}
.nav { display: flex; align-items: center; gap: clamp(18px, 3vw, 40px); }
.nav a {
  font-size: 14px; color: var(--muted);
  transition: color 0.2s ease;
}
.nav a:hover { color: var(--charcoal); }
.nav .btn { color: var(--ivory); }
@media (max-width: 720px) { .nav .links { display: none; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 14px; font-weight: 500;
  padding: 12px 22px;
  background: var(--charcoal); color: var(--ivory);
  border: 1px solid var(--charcoal);
  border-radius: 2px;
  white-space: nowrap;
  transition: background 0.2s ease, transform 0.2s ease;
  cursor: pointer;
}
.btn:hover { background: var(--charcoal-soft); transform: translateY(-1px); }
.btn--ghost {
  background: transparent; color: var(--charcoal);
  border-color: var(--line);
}
.btn--ghost:hover { background: rgba(26,26,40,0.04); border-color: var(--charcoal); }
.btn--gold { background: var(--gold); border-color: var(--gold); }
.btn--gold:hover { background: #8d6e35; }

/* ---------- Hero ---------- */
.hero { padding-top: clamp(60px, 9vw, 120px); }
.hero h1 { margin-bottom: 28px; }
.hero .lead { margin-bottom: 38px; }
.hero .cta-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.hero .meta {
  margin-top: 56px; display: flex; flex-wrap: wrap; gap: 40px;
  padding-top: 32px; border-top: 1px solid var(--line);
}
.hero .meta div { min-width: 0; }
.hero .meta .n {
  font-size: clamp(30px, 3.6vw, 44px); font-weight: 600;
  letter-spacing: -0.03em; line-height: 1;
}
.hero .meta .k {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted); margin-top: 8px;
}

/* ---------- Tools grid ---------- */
.section-head { max-width: 60ch; margin-bottom: clamp(40px, 5vw, 64px); }
.section-head h2 { margin-bottom: 18px; }

.tools {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
}
.tool {
  background: var(--ivory);
  padding: 36px 32px 40px;
  display: flex; flex-direction: column;
  transition: background 0.25s ease;
}
.tool:hover { background: #fff; }
.tool .icon { margin-bottom: 26px; }
.tool h3 { margin-bottom: 6px; }
.tool .v {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--gold); letter-spacing: 0.08em; margin-bottom: 16px;
}
.tool p { font-size: 14.5px; color: var(--muted); }

/* refined hover: gold reveal + lift */
.tool { position: relative; }
.tool::before {
  content: ""; position: absolute; inset-inline: 0; top: 0; height: 2px;
  background: var(--gold); transform: scaleX(0); transform-origin: inline-start;
  transition: transform 0.3s ease;
}
.tool:hover::before { transform: scaleX(1); }
.tool .idx {
  position: absolute; top: 22px; inset-inline-end: 26px;
  font-family: var(--font-mono); font-size: 11px; color: var(--line);
  letter-spacing: 0.1em;
}

/* custom-dashboard CTA card — distinct, action-oriented */
.tool--cta {
  background: linear-gradient(160deg, rgba(160,126,63,0.07), rgba(160,126,63,0.02));
  border: 1px dashed rgba(160,126,63,0.5);
  outline: none;
}
.tool--cta:hover { background: linear-gradient(160deg, rgba(160,126,63,0.12), rgba(160,126,63,0.04)); }
.tool--cta .icon svg { color: var(--gold); }
.tool--cta h3 { color: var(--gold); }
.tool--cta .cta-link {
  margin-top: auto; padding-top: 20px;
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 500; color: var(--charcoal);
}
.tool--cta .cta-link .arr { transition: transform 0.2s ease; }
html[dir="rtl"] .tool--cta .cta-link .arr { transform: scaleX(-1); }
.tool--cta:hover .cta-link .arr { transform: translateX(3px); }
html[dir="rtl"] .tool--cta:hover .cta-link .arr { transform: scaleX(-1) translateX(3px); }
.tool .spacer { margin-top: auto; }

/* ---------- Trust band ---------- */
.band { background: var(--charcoal); color: var(--ivory); }
.band .eyebrow { color: var(--gold-soft); }
.band h2 { color: var(--ivory); }
.band .lead { color: rgba(250,250,247,0.62); }
.feats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1px; background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.08); margin-top: 52px;
}
.feat { background: var(--charcoal); padding: 30px 28px; }
.feat .t { display: flex; align-items: center; gap: 10px; font-weight: 600; margin-bottom: 10px; }
.feat .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); flex: none; }
.feat p { font-size: 14px; color: rgba(250,250,247,0.6); }

/* ---------- Generic prose (legal/support) ---------- */
.page-head { padding-top: clamp(56px, 8vw, 104px); padding-bottom: 8px; }
.page-head .eyebrow { margin-bottom: 18px; }
.page-head .upd { font-family: var(--font-mono); font-size: 12px; color: var(--muted); margin-top: 18px; }

.prose { max-width: 760px; }
.prose h2 { font-size: clamp(22px, 2.6vw, 30px); margin: 56px 0 16px; }
.prose h3 { font-size: 18px; margin: 32px 0 10px; }
.prose p, .prose li { color: rgba(26,26,40,0.78); font-size: 16px; }
.prose p + p { margin-top: 14px; }
.prose ul { padding-inline-start: 22px; margin: 12px 0; }
.prose li { margin: 7px 0; }
.prose a { color: var(--gold); border-bottom: 1px solid var(--gold-soft); }
.prose strong { color: var(--charcoal); font-weight: 600; }
.prose .callout {
  border-inline-start: 3px solid var(--gold);
  background: var(--ivory); padding: 18px 22px; margin: 24px 0;
  font-size: 15px;
}

/* ---------- FAQ ---------- */
.faq { max-width: 820px; border-top: 1px solid var(--line); }
.faq details {
  border-bottom: 1px solid var(--line); padding: 6px 0;
}
.faq summary {
  list-style: none; cursor: pointer; padding: 22px 4px;
  display: flex; justify-content: space-between; align-items: center;
  gap: 20px; font-weight: 500; font-size: 17px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .pm {
  font-family: var(--font-mono); color: var(--gold); flex: none;
  transition: transform 0.2s ease;
}
.faq details[open] summary .pm { transform: rotate(45deg); }
.faq .a { padding: 0 4px 24px; color: var(--muted); font-size: 15.5px; max-width: 68ch; }

/* ---------- Contact cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.card {
  background: var(--ivory); border: 1px solid var(--line-soft);
  padding: 30px 28px;
}
.card .k { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); margin-bottom: 12px; }
.card .v { font-size: 18px; font-weight: 500; }
.card p { color: var(--muted); font-size: 14px; margin-top: 8px; }

/* ---------- Footer ---------- */
.foot { background: var(--charcoal); color: rgba(250,250,247,0.7); }
.foot .wrap { padding-block: 56px; }
.foot .grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 40px; }
.foot .mark .word { color: var(--ivory); }
.foot .mark .word .ar { color: rgba(250,250,247,0.5); }
.foot nav { display: flex; flex-wrap: wrap; gap: 28px; }
.foot nav a { font-size: 14px; transition: color 0.2s ease; }
.foot nav a:hover { color: var(--ivory); }
.foot .legal {
  margin-top: 44px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,0.1);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px;
  font-size: 13px; color: rgba(250,250,247,0.45);
}

/* ---------- Language toggle ---------- */
.lang-toggle {
  font-family: var(--font-mono);
  font-size: 12px; letter-spacing: 0.06em;
  padding: 8px 14px;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 2px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
  min-width: 60px; text-align: center;
}
.lang-toggle:hover { color: var(--charcoal); border-color: var(--charcoal); }

/* ---------- Smooth language fade ---------- */
body { transition: none; }
.lang-fade { transition: opacity 0.18s ease; }
.lang-fade.is-swapping { opacity: 0; }

/* ============================================================
   RTL / Arabic-first adjustments
   ============================================================ */

/* keep the brand lockup left-to-right regardless of page direction */
.mark { direction: ltr; }

/* Arabic script must not be letter-spaced (breaks cursive joining)
   and has no letter case — switch labels to the sans family. */
html[lang="ar"] .eyebrow,
html[lang="ar"] .hero .meta .k,
html[lang="ar"] .card .k,
html[lang="ar"] .feat .t,
html[lang="ar"] .faq summary,
html[lang="ar"] .faq .a {
  font-family: var(--font-sans);
  letter-spacing: normal;
  text-transform: none;
}

/* Arabic reads a touch more comfortably with slightly looser leading */
html[lang="ar"] body { line-height: 1.7; }
html[lang="ar"] h1 { line-height: 1.12; }
html[lang="ar"] h2 { line-height: 1.18; }
html[lang="ar"] .lead { line-height: 1.7; }

/* version chips stay LTR; hero metrics auto-detect direction per content */
.tool .v, .upd { direction: ltr; unicode-bidi: isolate; }
.hero .meta .n { unicode-bidi: plaintext; }

/* FAQ plus-sign sits on the correct side in RTL automatically via flex;
   keep its glyph upright */
html[lang="ar"] .faq summary .pm { font-family: var(--font-mono); }

/* ============================================================
   Showcase — analytics posts, rating, LinkedIn
   ============================================================ */
.showcase-intro { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-end; justify-content: space-between; }

.linkedin-btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 20px; border-radius: 2px;
  background: var(--charcoal); color: var(--ivory);
  font-size: 14px; font-weight: 500; white-space: nowrap;
  transition: background 0.2s ease, transform 0.2s ease;
}
.linkedin-btn:hover { background: var(--charcoal-soft); transform: translateY(-1px); }
.linkedin-btn svg { flex: none; }

/* posts feed */
.posts { display: flex; flex-direction: column; gap: clamp(40px, 6vw, 76px); }

.post {
  display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(24px, 4vw, 56px);
  align-items: center;
}
.post:nth-child(even) .post-media { order: 2; }
@media (max-width: 860px) { .post { grid-template-columns: 1fr; }
  .post:nth-child(even) .post-media { order: 0; } }

.post-media {
  position: relative; background: var(--ivory);
  border: 1px solid var(--line-soft);
}
.post-media image-slot { width: 100%; aspect-ratio: 16 / 10; display: block; }
.post-media .tag {
  position: absolute; top: 14px; inset-inline-start: 14px; z-index: 2;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; padding: 5px 10px; border-radius: 2px;
  background: var(--charcoal); color: var(--ivory);
}

.post-body .kicker {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--gold); margin: 0 0 14px;
}
.post-body h3 { font-size: clamp(22px, 2.6vw, 30px); margin-bottom: 14px; }
.post-body p.desc { color: var(--muted); font-size: 15.5px; margin-bottom: 24px; max-width: 52ch; }

/* metadata rows */
.post-meta { border-top: 1px solid var(--line); margin-bottom: 24px; }
.post-meta .row {
  display: grid; grid-template-columns: 130px 1fr; gap: 16px;
  padding: 13px 0; border-bottom: 1px solid var(--line-soft); align-items: baseline;
}
.post-meta .row .lbl {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--gold);
}
.post-meta .chips { display: flex; flex-wrap: wrap; gap: 7px; }
.post-meta .chip {
  font-size: 12.5px; padding: 4px 11px; border: 1px solid var(--line);
  border-radius: 100px; color: var(--charcoal);
}
.post-meta .row .val { font-size: 14.5px; color: var(--charcoal); }
@media (max-width: 480px) { .post-meta .row { grid-template-columns: 1fr; gap: 6px; } }

/* star rating (rating only, no comments) */
.rating { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.stars { display: inline-flex; gap: 4px; direction: ltr; }
.stars button {
  background: none; border: none; padding: 2px; cursor: pointer; line-height: 0;
  color: var(--line); transition: color 0.15s ease, transform 0.15s ease;
}
.stars button:hover { transform: scale(1.12); }
.stars button.on { color: var(--gold); }
.stars button svg { display: block; }
.rating .rate-label { font-size: 13.5px; color: var(--muted); }
.rating .rate-thanks { font-size: 13.5px; color: var(--gold); font-weight: 500; }

/* ============================================================
   Live tool previews — card affordance, 3D tilt, Power-BI modal
   ============================================================ */

/* clickable card + subtle 3D tilt */
.tool[data-demo] { cursor: pointer; transform-style: preserve-3d; transition: background 0.25s ease, transform 0.35s cubic-bezier(.2,.7,.2,1), box-shadow 0.35s ease; }
.tool[data-demo]:hover { transform: perspective(900px) translateZ(0) rotateX(3.5deg) translateY(-4px); box-shadow: 0 28px 60px -38px rgba(26,26,40,0.55); }
.tool[data-demo]:active { transform: perspective(900px) rotateX(1.5deg) translateY(-1px); }

.tool-preview {
  margin-top: auto; padding-top: 22px;
  display: inline-flex; align-items: center; gap: 9px;
  background: none; border: none; padding-inline: 0; cursor: pointer;
  font-family: var(--font-sans); font-size: 13.5px; font-weight: 500;
  color: var(--charcoal); letter-spacing: 0; transition: gap 0.2s ease;
}
.tool[data-demo]:hover .tool-preview { gap: 13px; }
.tool-preview .play {
  width: 22px; height: 22px; border-radius: 50%; flex: none;
  background: var(--gold); color: var(--ivory);
  display: inline-flex; align-items: center; justify-content: center;
}
.tool-preview .play svg { width: 9px; height: 9px; }
html[dir="rtl"] .tool-preview .play svg { transform: scaleX(-1); }

/* modal overlay */
.demo-modal {
  position: fixed; inset: 0; z-index: 200;
  display: none; align-items: center; justify-content: center;
  padding: clamp(16px, 4vw, 56px);
  background: rgba(20,20,30,0.55); backdrop-filter: blur(8px);
  opacity: 0; transition: opacity 0.28s ease;
}
.demo-modal.open { display: flex; opacity: 1; }

/* Power-BI-style report panel with 3D entrance */
.demo-panel {
  width: min(960px, 100%); max-height: 90vh; overflow: hidden;
  background: var(--cream);
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 6px;
  box-shadow: 0 60px 120px -40px rgba(0,0,0,0.7);
  display: flex; flex-direction: column;
  transform: perspective(1600px) rotateX(8deg) translateY(40px) scale(0.96);
  opacity: 0; transition: transform 0.42s cubic-bezier(.2,.8,.2,1), opacity 0.42s ease;
}
.demo-modal.open .demo-panel { transform: perspective(1600px) rotateX(0) translateY(0) scale(1); opacity: 1; }

.demo-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 24px; border-bottom: 1px solid var(--line);
  background: var(--ivory);
}
.demo-head .ttl { display: flex; align-items: center; gap: 13px; min-width: 0; }
.demo-head .ttl .badge {
  width: 34px; height: 34px; border-radius: 6px; flex: none;
  background: var(--charcoal); color: var(--gold);
  display: inline-flex; align-items: center; justify-content: center;
}
.demo-head .ttl h3 { font-size: 17px; margin: 0; }
.demo-head .ttl .v { font-family: var(--font-mono); font-size: 10.5px; color: var(--gold); letter-spacing: 0.08em; }
.demo-close {
  width: 36px; height: 36px; flex: none; cursor: pointer;
  background: none; border: 1px solid var(--line); border-radius: 4px;
  color: var(--charcoal); font-size: 18px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.demo-close:hover { background: rgba(26,26,40,0.05); border-color: var(--charcoal); }

.demo-stage {
  padding: clamp(20px, 3vw, 34px);
  overflow: auto; flex: 1;
  background:
    linear-gradient(var(--line-soft) 1px, transparent 1px) 0 0 / 100% 28px,
    var(--cream);
}
.demo-canvas {
  background: #fff; border: 1px solid var(--line-soft);
  border-radius: 4px; padding: clamp(18px, 2.6vw, 30px);
  box-shadow: 0 18px 40px -34px rgba(26,26,40,0.5);
  min-height: 300px;
}
/* force the approved brand font on ALL demo SVG text (SVG text otherwise
   falls back to the browser serif default, breaking visual consistency) */
.demo-canvas svg text,
.dv-axis-label, .dv-node-label, .dv-heat-label, .dv-radial-sub, .dv-radial-center {
  font-family: var(--font-sans);
}
.demo-foot {
  padding: 13px 24px; border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: var(--ivory);
  font-size: 12.5px; color: var(--muted);
}
.demo-foot .hint { display: inline-flex; align-items: center; gap: 8px; }
.demo-foot .hint .k { font-family: var(--font-mono); color: var(--gold); }
.demo-foot .dummy {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted);
  border: 1px solid var(--line); border-radius: 100px; padding: 4px 11px;
}

/* ---- shared demo widget styling ---- */
/* shared: consistent rhythm between controls and the chart in every demo */
.demo-canvas > .dv-controls:first-child { margin-top: 0; }
.demo-canvas > svg.dv-svg { margin-top: 4px; }
.dv-controls { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.dv-chip {
  font-family: var(--font-sans); font-size: 13px; cursor: pointer;
  padding: 8px 16px; border-radius: 100px; border: 1px solid var(--line);
  background: #fff; color: var(--charcoal); transition: all 0.18s ease;
}
.dv-chip:hover { border-color: var(--gold); }
.dv-chip.on { background: var(--charcoal); color: var(--ivory); border-color: var(--charcoal); }
.dv-chip.gold.on { background: var(--gold); border-color: var(--gold); }

.dv-tooltip {
  position: fixed; z-index: 210; pointer-events: none; opacity: 0;
  background: var(--charcoal); color: var(--ivory);
  font-size: 12.5px; padding: 8px 12px; border-radius: 4px;
  transition: opacity 0.12s ease; white-space: nowrap;
  box-shadow: 0 10px 30px -12px rgba(0,0,0,0.6);
}
.dv-tooltip .tt-k { color: var(--gold-soft); font-family: var(--font-mono); font-size: 10.5px; display: block; margin-bottom: 2px; letter-spacing: 0.06em; }

/* KPI demo */
.dv-kpi { text-align: center; padding: 18px 0; }
.dv-kpi .label { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 16px; }
.dv-kpi .big { font-size: clamp(48px, 9vw, 92px); font-weight: 600; letter-spacing: -0.03em; line-height: 1; direction: ltr; }
.dv-kpi .delta { margin-top: 18px; font-size: 16px; font-weight: 500; }
.dv-kpi .delta.up { color: #1F8A5B; }
.dv-kpi .delta.down { color: #C0392B; }
.dv-kpi .spark { margin-top: 26px; }

/* Table demo */
.dv-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.dv-table th {
  text-align: start; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted); font-weight: 500;
  padding: 11px 12px; border-bottom: 1.5px solid var(--line); cursor: pointer; white-space: nowrap;
}
.dv-table th:hover { color: var(--charcoal); }
.dv-table th .ar { color: var(--gold); font-size: 9px; }
.dv-table td { padding: 11px 12px; border-bottom: 1px solid var(--line-soft); }
.dv-table tr:hover td { background: var(--ivory); }
.dv-table .num { text-align: end; font-variant-numeric: tabular-nums; direction: ltr; }
.dv-bar-cell { position: relative; min-width: 120px; }
.dv-bar-track { position: relative; height: 22px; display: flex; align-items: center; }
.dv-bar-fill { position: absolute; inset-inline-start: 0; height: 100%; background: rgba(160,126,63,0.18); border-radius: 2px; transition: width 0.6s cubic-bezier(.2,.8,.2,1); }
.dv-bar-val { position: relative; font-variant-numeric: tabular-nums; font-weight: 500; padding-inline-start: 8px; direction: ltr; }

/* Radial demo */
.dv-radial-wrap { display: flex; align-items: center; gap: clamp(26px, 5vw, 48px); flex-wrap: wrap; justify-content: center; padding: 8px 0; }
.dv-radial-svg { flex: none; }
.dv-radial-arc { transition: stroke-dashoffset 0.9s cubic-bezier(.2,.8,.2,1); }
.dv-radial-center { font-size: 30px; font-weight: 600; direction: ltr; }
.dv-radial-sub { font-size: 11px; fill: var(--muted); letter-spacing: 0.04em; }

/* Line / Sankey / Heatmap interactive bits */
.dv-svg { width: 100%; height: auto; display: block; overflow: visible; }
.dv-line-path { fill: none; stroke: var(--charcoal); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.dv-line-area { fill: rgba(160,126,63,0.08); }
.dv-dot { fill: #fff; stroke: var(--gold); stroke-width: 2.5; cursor: pointer; transition: r 0.15s ease; }
.dv-dot:hover { r: 7; }
.dv-grid-line { stroke: var(--line-soft); stroke-width: 1; }
.dv-axis-label { font-family: var(--font-mono); font-size: 10px; fill: var(--muted); }

.dv-flow { fill: none; stroke-linecap: butt; transition: opacity 0.2s ease; cursor: pointer; }
.dv-node { cursor: pointer; }
.dv-node-rect { transition: opacity 0.2s ease; }
.dv-node-label { font-size: 11px; fill: var(--charcoal); }

.dv-heat-cell { cursor: pointer; transition: transform 0.15s ease; }
.dv-heat-cell:hover { stroke: var(--charcoal); stroke-width: 2; }
.dv-heat-label { font-size: 10px; fill: var(--muted); font-family: var(--font-mono); }

/* Slicer demo: buttons + reactive mini chart */
.dv-slicer-layout { display: grid; grid-template-columns: 180px 1fr; gap: 26px; align-items: start; }
@media (max-width: 560px) { .dv-slicer-layout { grid-template-columns: 1fr; } }
.dv-slicer-btns { display: flex; flex-direction: column; gap: 8px; }
.dv-slicer-btn {
  font-family: var(--font-sans); font-size: 14px; cursor: pointer; text-align: start;
  padding: 11px 16px; border-radius: 4px; border: 1px solid var(--line);
  background: #fff; color: var(--charcoal); transition: all 0.18s ease;
}
.dv-slicer-btn:hover { border-color: var(--gold); }
.dv-slicer-btn.on { background: var(--gold); color: var(--ivory); border-color: var(--gold); }
.dv-react .dv-react-kpi { font-size: 40px; font-weight: 600; direction: ltr; line-height: 1; }
.dv-react .dv-react-lbl { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-top: 8px; }
.dv-react-bars { margin-top: 24px; display: flex; flex-direction: column; gap: 10px; }
.dv-react-row { display: grid; grid-template-columns: 90px 1fr 54px; gap: 10px; align-items: center; font-size: 13px; }
.dv-react-track { height: 18px; background: var(--ivory); border-radius: 2px; overflow: hidden; }
.dv-react-fill { height: 100%; background: var(--charcoal); border-radius: 2px; transition: width 0.6s cubic-bezier(.2,.8,.2,1); }
.dv-react-val { text-align: end; font-variant-numeric: tabular-nums; direction: ltr; color: var(--muted); }

/* ===================== MOBILE RESPONSIVE FIXES (v2.1) ===================== */
/* منع أي تجاوز أفقي على كل الصفحات */
html, body { overflow-x: hidden; max-width: 100%; }
* { min-width: 0; }

/* الجوال: إصلاح شريط التنقّل */
@media (max-width: 720px) {
  /* إخفاء روابط التنقّل بقوة (تتغلّب على inline style) */
  .nav .links { display: none !important; }
  /* تصغير الفجوات والأزرار */
  .nav { gap: 12px; }
  .nav .btn { font-size: 13px; padding: 8px 14px; white-space: nowrap; }
  .lang-toggle { font-size: 13px; padding: 6px 10px; }
  .topbar .wrap { height: 64px; }
  /* اللوقو أصغر قليلاً */
  .mark .word { font-size: 16px; }
}

/* شاشات صغيرة جداً */
@media (max-width: 420px) {
  .nav { gap: 8px; }
  .nav .btn { font-size: 12px; padding: 7px 11px; }
  .mark svg { width: 30px; height: 30px; }
  .mark .word { font-size: 14px; }
  h1 { font-size: clamp(32px, 9vw, 44px); }
}

/* ===================== DEMO v3 — layout + format pane ===================== */
.dv-layout { display: flex; gap: 0; align-items: stretch; }
.dv-stage-canvas { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; padding: 8px; }
.dv-stage-canvas svg.dv-svg { width: 100%; height: auto; max-width: 100%; }

.dv-pane {
  width: 188px; flex-shrink: 0; background: var(--cream);
  border-inline-start: 1px solid var(--line); padding: 4px 16px 4px;
  align-self: stretch;
}
.dv-pane-title {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--gold); font-weight: 600; margin-bottom: 16px;
}
.dv-group { margin-bottom: 18px; }
.dv-group-lab { font-size: 12px; color: var(--muted); margin-bottom: 9px; font-weight: 600; }

.dv-style-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.dv-style-btn {
  font-size: 11px; padding: 6px 10px; border-radius: 7px; cursor: pointer;
  background: #fff; border: 1px solid var(--line); color: var(--charcoal);
  transition: all .15s; font-family: inherit;
}
.dv-style-btn.on { background: var(--charcoal); color: #fff; border-color: var(--charcoal); }
.dv-style-btn:hover:not(.on) { border-color: var(--gold); }

.dv-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.dv-swatch {
  width: 28px; height: 28px; border-radius: 8px; cursor: pointer;
  border: 2px solid transparent; transition: all .12s; position: relative;
}
.dv-swatch.on { border-color: var(--charcoal); transform: scale(1.08); }
.dv-swatch.on::after {
  content: "✓"; position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; color: #fff; font-size: 13px; font-weight: 700;
  text-shadow: 0 1px 2px rgba(0,0,0,.4);
}
.dv-toggle {
  display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--charcoal);
  cursor: pointer; margin-bottom: 9px;
}
.dv-toggle .sw {
  width: 34px; height: 18px; border-radius: 10px; background: #D0C9BA;
  position: relative; transition: background .15s; flex-shrink: 0;
}
.dv-toggle .sw::after {
  content: ""; position: absolute; width: 14px; height: 14px; border-radius: 50%;
  background: #fff; top: 2px; inset-inline-start: 2px; transition: transform .15s;
}
.dv-toggle.on .sw { background: var(--gold); }
.dv-toggle.on .sw::after { transform: translateX(16px); }
html[dir=rtl] .dv-toggle.on .sw::after { transform: translateX(-16px); }

/* value bars in table demo */
.dv-bar { position: relative; height: 22px; background: var(--cream); border-radius: 4px; overflow: hidden; min-width: 90px; }
.dv-bar-fill { position: absolute; inset-inline-start: 0; top: 0; height: 100%; width: 0; border-radius: 4px; transition: width .8s ease; opacity: .85; }
.dv-bar-lab { position: relative; z-index: 1; font-size: 12px; padding: 0 8px; line-height: 22px; color: var(--charcoal); font-weight: 600; }

/* button slicer demo */
.dv-slicer { display: flex; flex-wrap: wrap; gap: 10px; align-content: center; justify-content: center; padding: 20px; }
.dv-slicer.vertical { flex-direction: column; align-items: stretch; max-width: 240px; margin: 0 auto; }
.dv-pill {
  display: inline-flex; align-items: center; gap: 8px; justify-content: space-between;
  font-size: 14px; padding: 9px 16px; border-radius: 22px; cursor: pointer;
  background: var(--cream); border: 1.5px solid var(--line); color: var(--charcoal);
  transition: all .15s; font-family: inherit;
}
.dv-pill.on { color: #fff; }
.dv-pill:hover:not(.on) { border-color: var(--gold); }
.dv-pill-count { font-size: 11px; opacity: .7; font-family: var(--font-mono); }
.dv-pill.on .dv-pill-count { opacity: .85; }

.dv-cell { transition: fill-opacity .15s; }
.dv-cell:hover { stroke: var(--charcoal); stroke-width: 2; }

/* mobile: stack pane under chart */
@media (max-width: 640px) {
  .dv-layout { flex-direction: column; }
  .dv-pane { width: 100%; border-inline-start: none; border-top: 1px solid var(--line);
    padding-top: 16px; margin-top: 12px; display: flex; flex-wrap: wrap; gap: 16px; }
  .dv-pane-title { width: 100%; margin-bottom: 4px; }
  .dv-group { margin-bottom: 8px; flex: 1; min-width: 130px; }
}
