/* ============================================================================
   ReelPip Unified Public Navigation (nav-in), Footer & Interactive Diagrams
   Shared across /, /install, /trial, /portal, /docs, /changelog (EN & AR RTL)
   ============================================================================ */
header.rp-nav {
  background: var(--surf, #ffffff);
  border-bottom: 1px solid var(--border, #e6e7e9);
  position: sticky;
  top: 0;
  z-index: 60;
  backdrop-filter: saturate(160%) blur(10px);
}
header.rp-nav .hidden, .rp-nbtn.hidden { display: none !important; }
html[data-theme="dark"] header.rp-nav {
  background: rgba(24, 26, 29, 0.94);
  border-bottom-color: var(--border, #2b2f36);
}
header.rp-nav .nav-in {
  max-width: 1280px;
  margin: 0 auto;
  padding: 11px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
header.rp-nav .rp-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--ink, #182433);
  min-width: 0;
  flex-shrink: 0;
}
header.rp-nav .rp-logo {
  height: 28px;
  width: auto;
  display: block;
  flex-shrink: 0;
}
header.rp-nav .rp-logo-dark { display: none; }
html[data-theme="dark"] header.rp-nav .rp-logo-light { display: none; }
html[data-theme="dark"] header.rp-nav .rp-logo-dark { display: block; }
header.rp-nav .rp-sep {
  width: 1px;
  height: 20px;
  background: var(--border, #e6e7e9);
  flex-shrink: 0;
}
header.rp-nav .rp-brand-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
header.rp-nav .rp-brand-t {
  font-size: 12.6px;
  font-weight: 600;
  color: var(--ink2, #49566c);
  line-height: 1.25;
  white-space: nowrap;
}
header.rp-nav .rp-brand-s {
  font-size: 10.8px;
  color: var(--ink3, #667382);
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
}
header.rp-nav .rp-nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}
header.rp-nav .rp-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 36px;
  padding: 0 12px;
  border-radius: 7px;
  border: 0;
  background: transparent;
  color: var(--ink2, #49566c);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background .14s ease, color .14s ease;
}
header.rp-nav .rp-nav-link:hover,
header.rp-nav .rp-nav-link.is-active {
  background: var(--surf2, #f1f5f9);
  color: var(--primary, #066fd1);
}
html[data-theme="dark"] header.rp-nav .rp-nav-link {
  color: #cbd5e1;
}
html[data-theme="dark"] header.rp-nav .rp-nav-link:hover,
html[data-theme="dark"] header.rp-nav .rp-nav-link.is-active {
  background: rgba(255, 255, 255, .07);
  color: #60a5fa;
}
header.rp-nav .rp-dd {
  position: relative;
}
header.rp-nav .rp-dd-menu {
  position: absolute;
  top: calc(100% + 6px);
  inset-inline-start: 0;
  min-width: 235px;
  padding: 6px;
  border-radius: 10px;
  background: var(--surf, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  box-shadow: 0 14px 34px rgba(15, 23, 42, .16);
  display: none;
  flex-direction: column;
  gap: 2px;
  z-index: 90;
}
header.rp-nav .rp-dd.rp-dd-end .rp-dd-menu {
  inset-inline-start: auto;
  inset-inline-end: 0;
}
html[data-theme="dark"] header.rp-nav .rp-dd-menu {
  background: #1d2026;
  border-color: #323742;
  box-shadow: 0 16px 38px rgba(0, 0, 0, .52);
}
header.rp-nav .rp-dd:hover .rp-dd-menu,
header.rp-nav .rp-dd.is-open .rp-dd-menu {
  display: flex;
}
header.rp-nav .rp-dd-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 7px;
  border: 0;
  background: transparent;
  color: var(--ink, #182433);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  width: 100%;
  text-align: start;
  transition: background .12s ease, color .12s ease;
}
header.rp-nav .rp-dd-item:hover {
  background: var(--primary-soft, rgba(6, 111, 209, .10));
  color: var(--primary, #066fd1);
}
html[data-theme="dark"] header.rp-nav .rp-dd-item {
  color: #e2e8f0;
}
html[data-theme="dark"] header.rp-nav .rp-dd-item:hover {
  background: rgba(59, 130, 246, .16);
  color: #60a5fa;
}
header.rp-nav .rp-dd-tag {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(47, 179, 68, .14);
  color: #2fb344;
}
header.rp-nav .rp-nav-sep {
  width: 1px;
  height: 20px;
  background: var(--border, #e2e8f0);
  margin: 0 6px;
}
header.rp-nav .rp-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 7px;
  border: 1px solid var(--border2, #dadcde);
  background: transparent;
  color: var(--ink2, #49566c);
  cursor: pointer;
  transition: all .14s ease;
}
header.rp-nav .rp-icon-btn:hover {
  border-color: var(--primary, #066fd1);
  color: var(--primary, #066fd1);
  background: var(--surf2, #f8fafc);
}
html[data-theme="dark"] header.rp-nav .rp-icon-btn {
  border-color: #353a42;
  color: #cbd5e1;
}
html[data-theme="dark"] header.rp-nav .rp-icon-btn:hover {
  border-color: #4f9cf9;
  color: #ffffff;
  background: #282c34;
}
header.rp-nav .rp-nbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 13px;
  border-radius: 7px;
  border: 1px solid var(--border2, #dadcde);
  background: var(--surf, #ffffff);
  color: var(--ink2, #49566c);
  font-family: inherit;
  font-size: 12.8px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: all .14s ease;
}
header.rp-nav .rp-nbtn-cta {
  background: #066fd1 !important;
  border-color: #066fd1 !important;
  color: #ffffff !important;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(6, 111, 209, .28);
}
header.rp-nav .rp-nbtn-cta:hover {
  background: #0b7ce6 !important;
  border-color: #0b7ce6 !important;
  color: #ffffff !important;
}
.rp-nav-chat-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef4444;
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1;
}
.rp-nav-chat-badge.hidden { display: none !important; }

/* Mobile Controls & Clean Full-Width Slide-Down Drawer (Zero Clipping on Any Phone!) */
header.rp-nav .rp-mob-actions {
  display: none;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
header.rp-nav .rp-mob-drawer {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 10px 14px 16px;
  border-top: 1px solid var(--border, #e6e7e9);
  background: var(--surf, #ffffff);
  max-height: calc(100dvh - 60px);
  overflow-y: auto;
}
html[data-theme="dark"] header.rp-nav .rp-mob-drawer {
  background: #181a1d;
  border-top-color: #2b2f36;
}
header.rp-nav .rp-mob-drawer.is-open { display: flex; }
header.rp-nav .rp-mob-sec {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--ink3, #64748b);
  padding: 8px 8px 3px;
}
header.rp-nav .rp-mob-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: var(--ink, #182433);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  text-align: start;
  cursor: pointer;
}
header.rp-nav .rp-mob-item:hover,
header.rp-nav .rp-mob-item.is-active {
  background: var(--primary-soft, rgba(6, 111, 209, .12));
  color: var(--primary, #066fd1);
}
html[data-theme="dark"] header.rp-nav .rp-mob-item { color: #e2e8f0; }
html[data-theme="dark"] header.rp-nav .rp-mob-item:hover,
html[data-theme="dark"] header.rp-nav .rp-mob-item.is-active {
  background: rgba(59, 130, 246, .16);
  color: #60a5fa;
}
header.rp-nav .rp-mob-cta {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  border-radius: 8px;
  background: #066fd1;
  color: #ffffff !important;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

@media (max-width: 1180px) {
  header.rp-nav .rp-sep, header.rp-nav .rp-brand-meta { display: none; }
}
@media (max-width: 960px) {
  header.rp-nav .nav-in { padding: 10px 14px; gap: 10px; flex-wrap: nowrap; }
  header.rp-nav .rp-sep, header.rp-nav .rp-brand-meta { display: none; }
  header.rp-nav .rp-logo { height: 24px; }
  header.rp-nav .rp-nav-links { display: none; }
  header.rp-nav .rp-mob-actions { display: inline-flex; }
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
}

/* ============================================================================
   Mobile Fixed Bottom Navigation Bar & Thumb-Friendly Menu Sheet (<= 960px)
   ============================================================================ */
.rp-mob-bottom-nav,
.rp-mob-sheet-backdrop,
.rp-mob-sheet { display: none; }

@media (max-width: 960px) {
  .rp-mob-bottom-nav {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 940;
    background: rgba(255, 255, 255, .97);
    border-top: 1px solid #e2e8f0;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    box-shadow: 0 -6px 24px rgba(15, 23, 42, .08);
    backdrop-filter: saturate(160%) blur(12px);
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  }
  html[data-theme="dark"] .rp-mob-bottom-nav {
    background: rgba(15, 19, 27, .97);
    border-top-color: rgba(255, 255, 255, .09);
    box-shadow: 0 -8px 28px rgba(0, 0, 0, .58);
  }
  .rp-mbn-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 4px 2px;
    border: 0;
    background: transparent;
    color: #64748b;
    text-decoration: none;
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.15;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: color .14s ease;
    min-width: 0;
  }
  html[data-theme="dark"] .rp-mbn-item { color: #9aa4b2; }
  .rp-mbn-item:hover,
  .rp-mbn-item.is-active {
    color: #066fd1;
  }
  html[data-theme="dark"] .rp-mbn-item:hover,
  html[data-theme="dark"] .rp-mbn-item.is-active {
    color: #60a5fa;
  }
  .rp-mbn-ic {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 22px;
  }
  .rp-mbn-lbl {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }
  .rp-mbn-badge {
    position: absolute;
    top: -5px;
    right: -11px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 999px;
    background: #ef4444;
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid #ffffff;
  }
  html[data-theme="dark"] .rp-mbn-badge { border-color: #0f131b; }
  .rp-mbn-badge.hidden { display: none !important; }
  .rp-mbn-dot {
    position: absolute;
    top: -1px;
    right: -4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    border: 1.5px solid #ffffff;
  }
  html[data-theme="dark"] .rp-mbn-dot { border-color: #0f131b; }
  .rp-mbn-dot.is-offline { background: #64748b; }

  .rp-mob-sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 930;
    background: rgba(5, 8, 14, .56);
    backdrop-filter: blur(3px);
  }
  .rp-mob-sheet-backdrop.is-open { display: block; }
  .rp-mob-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(58px + env(safe-area-inset-bottom));
    z-index: 935;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px 16px;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    border-top: 1px solid #e2e8f0;
    background: #ffffff;
    box-shadow: 0 -16px 46px rgba(15, 23, 42, .22);
    max-height: calc(100dvh - 120px);
    overflow-y: auto;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  }
  html[data-theme="dark"] .rp-mob-sheet {
    background: #141923;
    border-top-color: rgba(255, 255, 255, .10);
    box-shadow: 0 -18px 50px rgba(0, 0, 0, .68);
  }
  .rp-mob-sheet.is-open { display: flex; }
  .rp-mob-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px 6px 10px;
    margin-bottom: 4px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 13.5px;
    font-weight: 800;
    color: #0f172a;
  }
  html[data-theme="dark"] .rp-mob-sheet-head {
    border-bottom-color: rgba(255, 255, 255, .08);
    color: #f8fafc;
  }
  .rp-mob-sheet-x {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 0;
    background: rgba(148, 163, 184, .14);
    color: inherit;
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
  }
  .rp-mob-sheet .rp-mob-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border-radius: 9px;
    border: 0;
    background: transparent;
    color: #182433;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    text-align: start;
    cursor: pointer;
  }
  .rp-mob-sheet .rp-mob-item:hover,
  .rp-mob-sheet .rp-mob-item.is-active {
    background: rgba(6, 111, 209, .10);
    color: #066fd1;
  }
  html[data-theme="dark"] .rp-mob-sheet .rp-mob-item { color: #e2e8f0; }
  html[data-theme="dark"] .rp-mob-sheet .rp-mob-item:hover,
  html[data-theme="dark"] .rp-mob-sheet .rp-mob-item.is-active {
    background: rgba(59, 130, 246, .16);
    color: #60a5fa;
  }
  .rp-mob-sheet .rp-mob-cta {
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 42px;
    border-radius: 9px;
    background: #066fd1;
    color: #ffffff !important;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
  }
}

/* Unified Bilingual Footer */
footer.rp-footer {
  margin-top: 48px;
  background: #0f1622;
  color: #cbd5e1;
  border-top: 1px solid #1e293b;
  font-family: "Inter", "IBM Plex Sans Arabic", -apple-system, sans-serif;
}
footer.rp-footer .rp-foot-in {
  max-width: 1120px;
  margin: 0 auto;
  padding: 40px 22px 30px;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 28px;
}
footer.rp-footer .rp-foot-brand img {
  height: 26px;
  width: auto;
  display: block;
  margin-bottom: 12px;
}
footer.rp-footer .rp-foot-brand p {
  font-size: 13px;
  line-height: 1.65;
  color: #94a3b8;
  max-width: 320px;
  margin-bottom: 14px;
}
footer.rp-footer .rp-foot-tg {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(45, 212, 191, .12);
  border: 1px solid rgba(45, 212, 191, .34);
  color: #5eead4;
  font-size: 12.2px;
  font-weight: 600;
  text-decoration: none;
  transition: .15s;
}
footer.rp-footer .rp-foot-tg:hover {
  background: #0d9488;
  border-color: #0d9488;
  color: #ffffff;
}
footer.rp-footer .rp-foot-col h4 {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: #f8fafc;
  margin: 0 0 12px;
}
footer.rp-footer .rp-foot-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
footer.rp-footer .rp-foot-col a {
  font-size: 13px;
  color: #94a3b8;
  text-decoration: none;
  transition: .14s;
}
footer.rp-footer .rp-foot-col a:hover { color: #38bdf8; }
footer.rp-footer .rp-foot-bot {
  border-top: 1px solid #1e293b;
  background: #0a1019;
}
footer.rp-footer .rp-foot-bot-in {
  max-width: 1320px;
  margin: 0 auto;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #64748b;
}
footer.rp-footer .rp-foot-bot-in a { color: #94a3b8; text-decoration: none; }
footer.rp-footer .rp-foot-bot-in a:hover { color: #38bdf8; }
@media (max-width: 860px) {
  footer.rp-footer .rp-foot-in { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
}
@media (max-width: 520px) {
  footer.rp-footer .rp-foot-in { grid-template-columns: 1fr; padding: 30px 16px 22px; }
  footer.rp-footer .rp-foot-bot-in { justify-content: center; text-align: center; }
}

/* RTL Layout Overrides for Bilingual Pages */
html[dir="rtl"] body {
  font-family: "IBM Plex Sans Arabic", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
html[dir="rtl"] .mono, html[dir="rtl"] code, html[dir="rtl"] pre {
  direction: ltr;
  unicode-bidi: embed;
}
html[dir="rtl"] .info-btn .tip {
  right: auto;
  left: 0;
  text-align: right;
  font-family: "IBM Plex Sans Arabic", "Inter", sans-serif;
}
html[dir="rtl"] .timeline {
  padding-left: 0;
  padding-right: 28px;
}
html[dir="rtl"] .timeline::before {
  left: auto;
  right: 8px;
}
html[dir="rtl"] .release-node {
  left: auto;
  right: -27px;
}
html[dir="rtl"] .search-box svg {
  left: auto;
  right: 11px;
}
html[dir="rtl"] .search-input {
  padding: 9px 34px 9px 12px;
}
html[dir="rtl"] .kv-v {
  text-align: left;
}

/* Animated Pulse Keyframes for Interactive Diagrams */
@keyframes rpFlowDash {
  to { stroke-dashoffset: -28; }
}
@keyframes rpGlowPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(20, 184, 166, .34); }
  50% { box-shadow: 0 0 0 7px rgba(20, 184, 166, 0); }
}
.rp-anim-line {
  stroke-dasharray: 8 6;
  animation: rpFlowDash 1.1s linear infinite;
}
