/**
 * Mobile P0 — global header only (<480px). Desktop unchanged.
 */
@media (max-width: 479px) {
  .zs-header-p0 .zs-header-bar {
    overflow-x: hidden;
  }

  .zs-header-p0 .zs-header-inner {
    padding-left: 8px;
    padding-right: 8px;
    gap: 4px;
    overflow-x: hidden;
    max-width: 100vw;
  }

  .zs-header-p0 .zs-header-left {
    gap: 6px;
    min-width: 0;
    flex: 0 0 auto;
    overflow: visible;
  }

  .zs-header-p0 .zs-header-right {
    gap: 6px;
    flex: 1 1 auto;
    justify-content: flex-end;
    min-width: 0;
    overflow: hidden;
  }

  .zs-header-p0 .zs-header-logo {
    flex-shrink: 0;
  }

  .zs-header-p0 .zs-simple-header {
    padding-inline-start: 0;
    gap: 4px;
    max-width: 100%;
    min-width: 0;
  }

  .zs-header-p0 .zs-login-text-link {
    display: none !important;
  }

  .zs-header-p0 .zs-login-icon-link {
    display: inline-flex !important;
  }

  .zs-header-p0 .zs-start-cta {
    min-height: 40px;
    height: 40px;
    padding-left: 10px;
    padding-right: 10px;
    font-size: 11px;
  }

  /* Icon controls: theme, language, search, menu */
  .zs-header-p0 .zs-header-touch,
  .zs-header-p0 button.h-8.w-8,
  .zs-header-p0 a.h-8.w-8 {
    min-height: 40px;
    min-width: 40px;
    height: 40px;
    width: 40px;
  }
}

/* Desktop: keep login text, hide icon-only link */
@media (min-width: 480px) {
  .zs-header-p0 .zs-login-icon-link {
    display: none !important;
  }
}

/**
 * ZeroSpread — Desktop V2 · Header STRUCTURE + GEOMETRY (≥ 1024px).
 *
 * The approved header concept is preserved: physical zones
 *   | ACCOUNT + CTA | · | NAV + SEARCH | · | WORDMARK |
 * with the wordmark on the reading-start edge (right in RTL).
 *
 * Desktop V2 changes (see DESKTOP_V2_HEADER_SYSTEM.md):
 *   1. Geometry comes from the --zs-hdr-* contract (zs-desktop-v2.css).
 *      The old `minmax(488px, 1fr)` column pushed the account zone off-screen
 *      (Upgrade CTA clipped at 1440 and fully hidden at 1280).
 *   2. The centre navigation now shows from 1024px (was 1280 via Tailwind `xl`,
 *      leaving 1024–1279 with a phone hamburger inside the desktop chrome).
 *      1024–1279 is a compact band: icon search, icon Upgrade, tighter gaps.
 *   3. Colours are tone tokens (--zs-hdr-*), never hard-coded per theme.
 *      Active section = ink + brand marker (was TradingView blue #2962ff).
 *   4. --zs-header-height is owned by app/layout-offset.css only. This file used
 *      to redeclare it (72px / 60px under 480px) and, loading later, overrode the
 *      Mobile V2 value — removed (shared bug; see MOBILE_V2_PROTECTION.md).
 *   5. Rules for < 1024px are gone: the desktop chrome is not rendered there.
 *
 * Paint: site-header-theme.css. Overlay: site-header-guest-hero.css.
 * Popovers: mega-menu-desktop-tv.css + each popover's own file (shared --zs-pop-* grammar).
 */

/* ── Shell ─────────────────────────────────────────────────────────── */
.zs-header-p0 {
  --zs-header-nav-font-family: var(--zs-font-institutional, "Tajawal", sans-serif);
  --zs-header-nav-font-size: var(--zs-t-nav, 14px);
  --zs-header-nav-font-weight: 500;
  --zs-header-nav-line-height: 1.3;
  --zs-header-nav-letter-spacing: 0;
}

.zs-header-p0 .zs-light-pilot-inner {
  position: relative;
  display: grid;
  direction: ltr; /* physical zone order; each zone sets its own dir */
  grid-template-columns:
    auto
    minmax(var(--zs-hdr-zone-gap), 1fr)
    auto
    minmax(var(--zs-hdr-zone-gap), 1fr)
    auto;
  grid-template-areas: "actions . middle . brand";
  align-items: center;
  box-sizing: border-box;
  width: 100%;
  height: var(--zs-hdr-h);
  padding-inline: var(--zs-hdr-pad-inline);
  column-gap: 0;
}

.zs-header-p0 .zs-light-pilot-actions {
  grid-area: actions;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  overflow: visible;
  z-index: 3;
}

.zs-header-p0 .zs-light-pilot-middle-group {
  grid-area: middle;
  display: flex;
  align-items: center;
  gap: var(--zs-hdr-zone-gap);
  height: 100%;
  min-width: 0;
  z-index: 2;
}

.zs-header-p0 .zs-light-pilot-nav {
  position: static;
  display: flex;
  height: 100%;
  min-width: 0;
  overflow: visible;
}

.zs-header-p0 .zs-light-pilot-brand {
  grid-area: brand;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  z-index: 3;
}

.zs-header-p0 .zs-light-pilot-actions-bar {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  overflow: visible;
}

.zs-header-p0 .zs-light-pilot-account-cluster {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
  overflow: visible;
}

.zs-header-p0 .zs-light-pilot-user-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: var(--zs-hdr-control);
  height: var(--zs-hdr-control);
  flex-shrink: 0;
  line-height: 0;
}

/* ── Wordmark ──────────────────────────────────────────────────────── */
.zs-header-p0 .zs-light-pilot-wordmark,
.zs-header-p0 .zs-light-pilot-wordmark:hover,
.zs-header-p0 .zs-light-pilot-wordmark:focus {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 0;
  width: var(--zs-hdr-logo-w);
  height: var(--zs-hdr-logo-h);
  color: var(--zs-hdr-ink);
  font-family: var(--zs-font-institutional, "Tajawal", sans-serif);
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  text-decoration: none;
  white-space: nowrap;
  overflow: visible;
  border-radius: var(--zs-r-control);
}

.zs-header-p0 .zs-light-pilot-wordmark:focus-visible {
  outline: none;
  box-shadow: var(--zs-hdr-focus);
}

.zs-header-p0 .zs-laser-reveal {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  color: currentColor;
}

.zs-header-p0 .zs-laser-reveal-art {
  display: block;
  width: 100%;
  height: 100%;
}

.zs-header-p0 .zs-laser-reveal-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Navigation triggers ───────────────────────────────────────────── */
.zs-header-p0 .zs-mega-nav-row {
  gap: var(--zs-hdr-nav-gap) !important; /* beats the component's Tailwind gap-[20px] */
  justify-content: flex-start;
  height: 100%;
  flex-shrink: 0;
}

/* Every trigger wrapper spans the full bar height, so every panel's
   `top: 100%` is the header's bottom edge — one anchor line for all menus. */
.zs-header-p0 .zs-mega-nav-row > [data-zs-nav-trigger] {
  height: var(--zs-hdr-h);
}

.zs-header-p0 .zs-header-nav-type,
.zs-header-p0 .zs-mega-nav-row > [data-zs-nav-trigger] > a,
.zs-header-p0 .zs-mega-nav-row > [data-zs-nav-trigger] > button {
  font-family: var(--zs-header-nav-font-family);
  font-size: var(--zs-header-nav-font-size);
  font-weight: var(--zs-header-nav-font-weight);
  font-synthesis: none;
  line-height: var(--zs-header-nav-line-height);
  letter-spacing: var(--zs-header-nav-letter-spacing);
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.zs-header-p0 .zs-mega-nav-row > [data-zs-nav-trigger] > a,
.zs-header-p0 .zs-mega-nav-row > [data-zs-nav-trigger] > button {
  position: relative;
  gap: 5px;
  height: 100%;
  padding-inline: 0;
  color: var(--zs-hdr-ink-2);
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  transition: color var(--zs-dur-d-fast) var(--zs-ease-d);
}

.zs-header-p0 .zs-mega-nav-row > [data-zs-nav-trigger] > a:hover,
.zs-header-p0 .zs-mega-nav-row > [data-zs-nav-trigger] > button:hover,
.zs-header-p0 .zs-mega-nav-row > [data-zs-nav-trigger] > button[aria-expanded='true'] {
  color: var(--zs-hdr-ink);
}

.zs-header-p0 .zs-mega-nav-row > [data-zs-nav-trigger] > a:focus-visible,
.zs-header-p0 .zs-mega-nav-row > [data-zs-nav-trigger] > button:focus-visible {
  outline: none;
  color: var(--zs-hdr-ink);
}

.zs-header-p0 .zs-mega-nav-row > [data-zs-nav-trigger] > a:focus-visible > span,
.zs-header-p0 .zs-mega-nav-row > [data-zs-nav-trigger] > button:focus-visible > span {
  border-radius: 6px;
  box-shadow: var(--zs-hdr-focus);
}

/* Current section: ink + 2px marker on the header's bottom edge.
   (Direct links set aria-current; menu triggers set data-zs-current.) */
.zs-header-p0 .zs-mega-nav-row > [data-zs-nav-trigger] > a[aria-current='page'],
.zs-header-p0 .zs-mega-nav-row > [data-zs-nav-trigger][data-zs-current] > button {
  color: var(--zs-hdr-ink);
}

.zs-header-p0 .zs-mega-nav-row > [data-zs-nav-trigger] > a[aria-current='page']::after,
.zs-header-p0 .zs-mega-nav-row > [data-zs-nav-trigger][data-zs-current] > button::after {
  content: '';
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--zs-hdr-active);
}

.zs-header-p0 .zs-mega-nav-row > [data-zs-nav-trigger] > button > svg {
  width: 10px;
  height: 10px;
  color: var(--zs-hdr-muted);
  stroke-width: 1.6;
  transition: transform var(--zs-dur-d) var(--zs-ease-d);
}

/* ── Search pill (one mount) ───────────────────────────────────────── */
.zs-header-p0 .zs-light-pilot-search {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  direction: rtl;
  box-sizing: border-box;
  width: var(--zs-hdr-search-w);
  height: var(--zs-hdr-search-h);
  padding-inline: 14px;
  border: 1px solid var(--zs-hdr-control-line);
  border-radius: var(--zs-r-pill);
  background: var(--zs-hdr-control-bg);
  color: var(--zs-hdr-muted);
  box-shadow: none;
  outline: none;
  cursor: pointer;
  transition: background-color var(--zs-dur-d-fast) var(--zs-ease-d);
}

.zs-header-p0 .zs-light-pilot-search:hover,
.zs-header-p0 .zs-light-pilot-search[aria-expanded='true'] {
  background: color-mix(in srgb, var(--zs-hdr-control-bg) 88%, var(--zs-hdr-ink));
  color: var(--zs-hdr-ink);
}

.zs-header-p0 .zs-light-pilot-search:focus-visible {
  box-shadow: var(--zs-hdr-focus);
}

.zs-header-p0 .zs-light-pilot-search-label {
  font-family: var(--zs-font-institutional, "Tajawal", sans-serif);
  font-size: 12.5px;
  font-weight: 400;
  font-synthesis: none;
  color: inherit;
  line-height: 1;
  white-space: nowrap;
}

.zs-header-p0 .zs-light-pilot-search-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: inherit;
  stroke-width: 1.6;
}

/* ── Utility controls (globe, bell, guest menu, login) ─────────────── */
.zs-header-p0 .zs-light-pilot-actions-bar .zs-header-touch,
.zs-header-p0 .zs-light-pilot-actions-bar button.h-8.w-8,
.zs-header-p0 .zs-light-pilot-user-trigger {
  color: var(--zs-hdr-ink);
  border-color: var(--zs-hdr-control-line);
  background: transparent;
}

.zs-header-p0 .zs-light-pilot-actions-bar svg:not(.zs-light-pilot-cta-sparkle) {
  color: var(--zs-hdr-ink);
}

.zs-header-p0 .zs-light-pilot-actions-bar .zs-header-touch:hover,
.zs-header-p0 .zs-light-pilot-actions-bar button.h-8.w-8:hover,
.zs-header-p0 .zs-light-pilot-user-trigger:hover,
.zs-header-p0 .zs-light-pilot-user-trigger[aria-expanded='true'] {
  background: var(--zs-hdr-hover);
}

.zs-header-p0 .zs-light-pilot-actions-bar :is(button, a):focus-visible {
  outline: none;
  box-shadow: var(--zs-hdr-focus);
}

.zs-header-p0 .zs-light-pilot-login-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding-inline: 10px;
  border: none;
  border-radius: var(--zs-r-control);
  background: transparent;
  color: var(--zs-hdr-ink);
  font-family: var(--zs-font-institutional, "Tajawal", sans-serif);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.zs-header-p0 .zs-light-pilot-login-link:hover {
  background: var(--zs-hdr-hover);
  color: var(--zs-hdr-ink);
  text-decoration: none;
}

.zs-header-p0 .zs-light-pilot-login-link.zs-login-icon-link {
  display: none !important;
}

/* ── Upgrade ticket (approved control — geometry unchanged at ≥1280) ─ */
.zs-header-p0 .zs-light-pilot-cta {
  --zs-ticket-w: 158px;
  --zs-ticket-h: 40px;
  --zs-ticket-split: 116px;
  --zs-ticket-stub: 42px;
  --zs-ticket-notch: 6.5px;
  --zs-ticket-radius: 10px;
  --zs-ticket-offset: 4px;
  position: relative;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  box-sizing: border-box;
  width: var(--zs-ticket-w);
  height: var(--zs-ticket-h);
  /* reserve the offset backing so it is never clipped by the bar edge */
  margin-inline-end: var(--zs-ticket-offset);
  padding: 0;
  border: none;
  color: #111111;
  text-decoration: none;
  overflow: visible;
  direction: ltr;
  unicode-bidi: isolate;
  align-self: center;
  /* Hard #A3FF12 — --zs-green-primary is remapped to slate under html.light. */
  background: #a3ff12;
  border-radius: var(--zs-ticket-radius);
  transform: translateY(0);
  transition: transform 140ms ease;
}

.zs-header-p0 .zs-light-pilot-cta::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: 0;
  right: calc(var(--zs-ticket-offset) * -1);
  bottom: calc(var(--zs-ticket-offset) * -1);
  left: var(--zs-ticket-offset);
  border-radius: var(--zs-ticket-radius);
  background: #a3ff12;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
  pointer-events: none;
  transition:
    top 140ms ease,
    right 140ms ease,
    bottom 140ms ease,
    left 140ms ease,
    box-shadow 140ms ease;
}

.zs-header-p0 .zs-light-pilot-cta-face {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--zs-ticket-stub);
  box-sizing: border-box;
  width: var(--zs-ticket-w);
  height: var(--zs-ticket-h);
  overflow: visible;
  border: 1px solid #151515;
  border-radius: var(--zs-ticket-radius);
  background: #ffffff;
  -webkit-mask-image:
    radial-gradient(
      circle var(--zs-ticket-notch) at var(--zs-ticket-split) 0px,
      transparent var(--zs-ticket-notch),
      #000 calc(var(--zs-ticket-notch) + 0.5px)
    ),
    radial-gradient(
      circle var(--zs-ticket-notch) at var(--zs-ticket-split) 100%,
      transparent var(--zs-ticket-notch),
      #000 calc(var(--zs-ticket-notch) + 0.5px)
    );
  -webkit-mask-size: 100% 51%, 100% 51%;
  -webkit-mask-position: 0 0, 0 100%;
  -webkit-mask-repeat: no-repeat;
  mask-image:
    radial-gradient(
      circle var(--zs-ticket-notch) at var(--zs-ticket-split) 0px,
      transparent var(--zs-ticket-notch),
      #000 calc(var(--zs-ticket-notch) + 0.5px)
    ),
    radial-gradient(
      circle var(--zs-ticket-notch) at var(--zs-ticket-split) 100%,
      transparent var(--zs-ticket-notch),
      #000 calc(var(--zs-ticket-notch) + 0.5px)
    );
  mask-size: 100% 51%, 100% 51%;
  mask-position: 0 0, 0 100%;
  mask-repeat: no-repeat;
}

.zs-header-p0 .zs-light-pilot-cta-face::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--zs-ticket-split);
  width: 1px;
  background: #151515;
  transform: translateX(-50%);
  pointer-events: none;
}

.zs-header-p0 .zs-light-pilot-cta-label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding-inline: 8px;
  color: #111111;
  font-family: var(--zs-font-institutional, "Tajawal", sans-serif);
  font-size: 14px;
  font-weight: 700;
  font-synthesis: none;
  line-height: 1;
  white-space: nowrap;
}

.zs-header-p0 .zs-light-pilot-cta-stub {
  display: flex;
  align-items: center;
  justify-content: center;
}

.zs-header-p0 .zs-light-pilot-cta-sparkle {
  display: block;
  width: 19px;
  height: 19px;
  color: #111111;
  fill: currentColor;
  stroke: currentColor;
}

@keyframes zs-upgrade-spark-idle {
  0%,
  8%,
  100% {
    transform: rotate(0deg) scale(1);
  }

  3% {
    transform: rotate(8deg) scale(1.12);
  }

  5.5% {
    transform: rotate(-2deg) scale(0.98);
  }
}

.zs-header-p0 .zs-upgrade-spark {
  display: inline-block;
  transform-origin: 50% 50%;
  animation: zs-upgrade-spark-idle 10s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}

.zs-header-p0 .zs-light-pilot-cta:hover {
  color: #111111;
  text-decoration: none;
  transform: translateY(-1px);
}

.zs-header-p0 .zs-light-pilot-cta:hover::before {
  right: -5px;
  bottom: -5px;
  left: 5px;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.14);
}

.zs-header-p0 .zs-light-pilot-cta:active {
  transform: translateY(0);
}

.zs-header-p0 .zs-light-pilot-cta:active::before {
  right: -3px;
  bottom: -3px;
  left: 3px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.zs-header-p0 .zs-light-pilot-cta:focus {
  outline: none;
}

.zs-header-p0 .zs-light-pilot-cta:focus-visible {
  box-shadow: var(--zs-hdr-focus);
}

/* ── Account avatar ────────────────────────────────────────────────── */
.zs-header-p0 .zs-light-pilot-user-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: var(--zs-hdr-control);
  height: var(--zs-hdr-control);
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  outline: none;
  box-shadow: none;
  appearance: none;
  -webkit-appearance: none;
  line-height: 0;
}

.zs-header-p0 .zs-light-pilot-avatar,
.zs-header-p0 .zs-light-pilot-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 36px;
  height: 36px;
  overflow: hidden;
  border: none;
  border-radius: 50%;
  background: #5f6b70;
  color: #ffffff;
  font-family: var(--zs-font-institutional, "Tajawal", sans-serif);
  font-size: 15px;
  font-weight: 500;
  font-synthesis: none;
  line-height: 1;
  box-shadow: 0 0 0 1px var(--zs-hdr-line);
}

.zs-header-p0 .zs-light-pilot-avatar-fallback {
  opacity: 0.72;
}

/* ── Account / guest popover anchor (one contract for both states) ────
   Fixed to the header grid, not to a magic 4px: its physical-left edge is
   the header's inline padding (the account zone edge), its top is the
   header bottom + the shared popover offset. */
.zs-header-p0 .zs-account-menu-anchor {
  position: fixed;
  top: calc(var(--zs-header-height, 72px) + var(--zs-pop-offset));
  left: var(--zs-hdr-pad-inline);
  right: auto;
  bottom: auto;
  margin: 0;
  z-index: var(--zs-z-d-header-layer);
}

.zs-header-p0[dir='ltr'] .zs-account-menu-anchor,
html[dir='ltr'] .zs-header-p0 .zs-account-menu-anchor {
  left: var(--zs-hdr-pad-inline);
}

.zs-header-p0 .zs-account-menu-anchor > aside[role='menu'] {
  margin: 0;
}

/* Legacy mobile-sheet dialog: never rendered ≥ 1024 (trigger hidden below). */
.zs-header-p0 [role='dialog'].fixed.inset-x-0 {
  top: var(--zs-header-height, 72px);
}

/* ── Compact band 1024 – 1279 (desktop, not tablet) ──────────────────
   Same header, tighter: icon-only search, icon-only Upgrade (label kept
   for assistive tech), no language globe gap waste. */
@media (min-width: 1024px) and (max-width: 1279.98px) {
  .zs-header-p0 {
    --zs-header-nav-font-size: 13.5px;
    --zs-hdr-logo-w: 136px;
    --zs-hdr-logo-h: 36px;
  }

  .zs-header-p0 .zs-light-pilot-account-cluster {
    gap: 10px;
  }

  .zs-header-p0 .zs-light-pilot-search {
    width: var(--zs-hdr-search-h);
    padding-inline: 0;
    justify-content: center;
  }

  .zs-header-p0 .zs-light-pilot-search-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .zs-header-p0 .zs-light-pilot-cta {
    --zs-ticket-w: var(--zs-ticket-stub);
  }

  .zs-header-p0 .zs-light-pilot-cta-face {
    /* label is visually hidden (out of flow) → the stub is the only grid item */
    grid-template-columns: var(--zs-ticket-stub);
    -webkit-mask-image: none;
    mask-image: none;
  }

  .zs-header-p0 .zs-light-pilot-cta-face::after {
    display: none;
  }

  .zs-header-p0 .zs-light-pilot-cta-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .zs-header-p0 .zs-light-pilot-cta,
  .zs-header-p0 .zs-light-pilot-cta::before,
  .zs-header-p0 .zs-mega-nav-row > [data-zs-nav-trigger] > button > svg {
    transition: none;
  }

  .zs-header-p0 .zs-light-pilot-cta:hover,
  .zs-header-p0 .zs-light-pilot-cta:active {
    transform: none;
  }

  .zs-header-p0 .zs-upgrade-spark {
    animation: none;
  }
}

/**
 * ZeroSpread — Desktop V2 header PAINT (single source).
 *
 * The bar is painted from ONE input: the --zs-hdr-* tone tokens, which are
 * selected by html[data-zs-header-theme] — the output of the canonical
 * resolver (src/lib/site-header-theme.ts; written pre-paint by the bootstrap,
 * kept current by SiteHeaderThemeSync). Page-level hosts are mirrored in
 * app/design-system/zs-desktop-v2.css for the first frame.
 *
 * What this file intentionally no longer does (Desktop V2):
 *   - key off html.light / html:not(.light)      → a stored preference could
 *     paint a black bar over a Light-only / light-surface page
 *   - per-route header overrides (about, contact, school pricing) → removed
 *     from those route stylesheets; dark hosts resolve through the resolver
 *   - !important colour wars with the light chrome file
 *
 * Structure / geometry: site-header-light.css. Hero overlay: site-header-guest-hero.css.
 * Scope: .zs-header-p0 exists only in the desktop chrome (≥ 1024px).
 */

.zs-header-p0 .zs-site-header {
  background: var(--zs-hdr-bg);
  color: var(--zs-hdr-ink);
  border: 0;
  border-bottom: 1px solid var(--zs-hdr-line);
  box-shadow: none;
  outline: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  /* No colour transition on the solid bar: a route change between tones
     swaps instantly (no white/black flash). Only the hero overlay → solid
     handoff animates (site-header-guest-hero.css). */
}

/**
 * ZeroSpread — Desktop V2 · Header OVERLAY mode (guest homepage hero, /about hero).
 *
 * Overlay is a SURFACE mode, not a colour scheme:
 *   - the bar becomes transparent (no gradient slab, no hairline)
 *   - the ink comes from the tone of the surface UNDER the bar
 *
 * Guest `/`: the cinematic hero stage is a pearl (#f8f8f6) surface in BOTH
 * appearances, so overlay ink is the light tone (graphite). The previous
 * implementation forced white ink here → white-on-pearl, the most visible
 * desktop defect in the handoff captures (1024–1920).
 *
 * /about sets data-zs-header-variant="hero-overlay" over a true-black hero;
 * it is a dark host, so the resolver already gives it the dark tone.
 *
 * Activation (unchanged contract):
 *   html[data-zs-header-variant="hero-overlay"]                       (JS: GuestHeroHeaderSync / AboutPageClient)
 *   html:has([data-zs-guest-parallax-hero]):not([data-zs-guest-hero-past="1"])   (first paint)
 * Authenticated `/` never renders the hero element → never matches → solid from first paint.
 */

/* Guest homepage: the hero sits under the fixed bar (unchanged behaviour). */
html:has([data-zs-guest-parallax-hero]) body main {
  padding-top: 0 !important;
}

html:has([data-zs-guest-parallax-hero]):not([data-zs-guest-hero-past='1']) .zs-header-p0 > .zs-header-offset {
  height: 0 !important;
  min-height: 0 !important;
}

/* Surface: transparent while overlaid. Only this handoff animates. */
html:has([data-zs-guest-parallax-hero]) .zs-header-p0 .zs-site-header {
  transition:
    background-color var(--zs-dur-d-slow) var(--zs-ease-d),
    border-color var(--zs-dur-d-slow) var(--zs-ease-d),
    color var(--zs-dur-d-slow) var(--zs-ease-d);
}

html[data-zs-header-variant='hero-overlay'] .zs-header-p0 .zs-site-header,
html:has([data-zs-guest-parallax-hero]):not([data-zs-guest-hero-past='1']) .zs-header-p0 .zs-site-header {
  background: transparent;
  border-bottom-color: transparent;
}

/* Ink: the guest hero stage is pearl → light tone tokens for the whole bar
   (nav, logo, search pill, icons, focus). Popovers keep their own surface. */
html:has([data-zs-guest-parallax-hero]):not([data-zs-guest-hero-past='1']) .zs-header-p0 {
  --zs-hdr-bg: transparent;
  --zs-hdr-ink: #141715;
  --zs-hdr-ink-2: #2b302d;
  --zs-hdr-muted: #5f6561;
  --zs-hdr-line: transparent;
  --zs-hdr-control-bg: rgba(20, 23, 21, 0.055);
  --zs-hdr-control-line: transparent;
  --zs-hdr-hover: rgba(20, 23, 21, 0.05);
  --zs-hdr-active: #141715;
  --zs-hdr-focus: 0 0 0 2px #f8f8f6, 0 0 0 4px #141715;
  --zs-hdr-pop-ring: 0 0 0 1px rgba(17, 21, 18, 0.06);
}

@media (prefers-reduced-motion: reduce) {
  html:has([data-zs-guest-parallax-hero]) .zs-header-p0 .zs-site-header {
    transition: none;
  }
}

/**
 * School lesson header/shell — follows data-school-theme only on real lesson routes.
 * Does not restyle the global header on the rest of the site.
 */

html[data-zs-school-lesson="1"][data-school-theme="dark"] body {
  background: #07080a;
  color: #f4f5f3;
}

html[data-zs-school-lesson="1"][data-school-theme="light"] body {
  background: #f6f6f2;
  color: #0b0d0c;
}

html[data-zs-school-lesson="1"][data-school-theme="dark"] .zs-header-p0 .zs-site-header {
  background: #07080a !important;
  background-color: #07080a !important;
  color: #f4f5f3 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07) !important;
  box-shadow: none !important;
}

html[data-zs-school-lesson="1"][data-school-theme="dark"] .zs-header-p0 .zs-light-pilot-wordmark,
html[data-zs-school-lesson="1"][data-school-theme="dark"] .zs-header-p0 .zs-light-pilot-wordmark:hover,
html[data-zs-school-lesson="1"][data-school-theme="dark"] .zs-header-p0 .zs-light-pilot-wordmark:focus {
  color: #f4f5f3 !important;
}

html[data-zs-school-lesson="1"][data-school-theme="dark"] .zs-header-p0 .zs-mega-nav-row > [data-zs-nav-trigger] > a,
html[data-zs-school-lesson="1"][data-school-theme="dark"] .zs-header-p0 .zs-mega-nav-row > [data-zs-nav-trigger] > button {
  color: rgba(244, 245, 243, 0.88) !important;
}

html[data-zs-school-lesson="1"][data-school-theme="dark"] .zs-header-p0 .zs-mega-nav-row > [data-zs-nav-trigger] > a:hover,
html[data-zs-school-lesson="1"][data-school-theme="dark"] .zs-header-p0 .zs-mega-nav-row > [data-zs-nav-trigger] > button:hover {
  color: #f4f5f3 !important;
}

html[data-zs-school-lesson="1"][data-school-theme="dark"] .zs-header-p0 .zs-mega-nav-row > [data-zs-nav-trigger] > a[aria-current="page"],
html[data-zs-school-lesson="1"][data-school-theme="dark"] .zs-header-p0 .zs-mega-nav-row > [data-zs-nav-trigger] > a[aria-current="page"]:hover {
  color: #a3ff12 !important;
}

html[data-zs-school-lesson="1"][data-school-theme="dark"] .zs-header-p0 .zs-mega-nav-row > [data-zs-nav-trigger] > button > svg,
html[data-zs-school-lesson="1"][data-school-theme="dark"] .zs-header-p0 .zs-mega-nav-row > [data-zs-nav-trigger] > a > svg {
  color: rgba(244, 245, 243, 0.46);
}

html[data-zs-school-lesson="1"][data-school-theme="dark"] .zs-header-p0 .zs-light-pilot-search {
  background: #101318;
  color: rgba(244, 245, 243, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

html[data-zs-school-lesson="1"][data-school-theme="dark"] .zs-header-p0 .zs-light-pilot-search:hover,
html[data-zs-school-lesson="1"][data-school-theme="dark"] .zs-header-p0 .zs-light-pilot-search:focus {
  background: #14181e;
  color: #f4f5f3;
}

html[data-zs-school-lesson="1"][data-school-theme="dark"] .zs-header-p0 .zs-light-pilot-search-label,
html[data-zs-school-lesson="1"][data-school-theme="dark"] .zs-header-p0 .zs-light-pilot-search-icon {
  color: rgba(244, 245, 243, 0.68) !important;
}

html[data-zs-school-lesson="1"][data-school-theme="dark"] .zs-header-p0 .zs-light-pilot-login-link {
  color: #f4f5f3 !important;
}

html[data-zs-school-lesson="1"][data-school-theme="dark"] .zs-header-p0 .zs-light-pilot-login-link:hover {
  background: #101318;
  color: #f4f5f3;
}

html[data-zs-school-lesson="1"][data-school-theme="dark"] .zs-header-p0 .zs-header-touch,
html[data-zs-school-lesson="1"][data-school-theme="dark"] .zs-header-p0 .zs-light-pilot-actions-bar .zs-header-touch,
html[data-zs-school-lesson="1"][data-school-theme="dark"] .zs-header-p0 .zs-light-pilot-actions-bar button.h-8.w-8,
html[data-zs-school-lesson="1"][data-school-theme="dark"] .zs-header-p0 .zs-light-pilot-user-trigger {
  color: #f4f5f3;
  border-color: rgba(255, 255, 255, 0.1);
  background: transparent;
}

html[data-zs-school-lesson="1"][data-school-theme="dark"] .zs-header-p0 .zs-header-touch:hover,
html[data-zs-school-lesson="1"][data-school-theme="dark"] .zs-header-p0 .zs-light-pilot-actions-bar .zs-header-touch:hover,
html[data-zs-school-lesson="1"][data-school-theme="dark"] .zs-header-p0 .zs-light-pilot-actions-bar button.h-8.w-8:hover,
html[data-zs-school-lesson="1"][data-school-theme="dark"] .zs-header-p0 .zs-light-pilot-user-trigger:hover {
  background: #101318;
  color: #f4f5f3;
}

html[data-zs-school-lesson="1"][data-school-theme="dark"] .zs-header-p0 .zs-light-pilot-user-trigger svg,
html[data-zs-school-lesson="1"][data-school-theme="dark"] .zs-header-p0 .zs-light-pilot-actions-bar svg {
  color: #f4f5f3;
}

/* Sticky / scrolled / fixed — never revert to white on lesson dark */
html[data-zs-school-lesson="1"][data-school-theme="dark"] .zs-header-p0 .zs-site-header.scrolled,
html[data-zs-school-lesson="1"][data-school-theme="dark"] .zs-header-p0 .zs-site-header.is-stuck,
html[data-zs-school-lesson="1"][data-school-theme="dark"] .zs-header-p0 .zs-site-header.is-sticky,
html[data-zs-school-lesson="1"][data-school-theme="dark"] .zs-header-p0 .zs-site-header[data-scrolled="true"],
html[data-zs-school-lesson="1"][data-school-theme="dark"] .zs-header-p0 .zs-site-header.fixed,
html[data-zs-school-lesson="1"][data-school-theme="dark"] header.zs-site-header {
  background: #07080a !important;
  background-color: #07080a !important;
}

html[data-zs-school-lesson="1"][data-school-theme="light"] .zs-header-p0 .zs-site-header {
  background: #ffffff !important;
  background-color: #ffffff !important;
  color: #171717 !important;
}

/* Foundations outer shell follows lesson theme before React hydrates */
html[data-zs-school-lesson="1"][data-school-theme="light"] .zs-chapter-typography > div {
  background-color: #f6f6f2 !important;
}

html[data-zs-school-lesson="1"][data-school-theme="dark"] .zs-chapter-typography > div {
  background-color: #07080a !important;
}

/* Upgrade ticket stays the existing control — keep label readable */
html[data-zs-school-lesson="1"][data-school-theme="dark"] .zs-header-p0 .zs-light-pilot-cta-label,
html[data-zs-school-lesson="1"][data-school-theme="dark"] .zs-header-p0 .zs-light-pilot-cta-sparkle {
  color: #111111 !important;
}

html[data-zs-school-lesson="1"][data-school-theme="dark"] .zs-header-p0 .zs-header-p0,
html[data-zs-school-lesson="1"][data-school-theme="dark"] .zs-header-p0 {
  background: transparent;
}

/* Mobile sheet / more menu chrome on dark lessons */
html[data-zs-school-lesson="1"][data-school-theme="dark"] .zs-header-p0 .zs-mega-nav-row {
  color: rgba(244, 245, 243, 0.88);
}

/**
 * Tablet + phone nav sheet polish — <1280px (matches `xl` desktop nav threshold).
 * Desktop mega menu unchanged.
 */
@media (max-width: 1279px) {
  .zs-mobile-nav-sheet {
    max-height: min(calc(100dvh - 4.5rem - env(safe-area-inset-top, 0px)), 720px) !important;
  }

  .zs-mobile-nav-sheet > .flex.items-center.justify-between {
    min-height: 52px;
    padding: 10px 14px 12px;
  }

  .zs-mobile-nav-sheet > .flex.items-center.justify-between > span {
    font-size: 15px;
    line-height: 1.3;
    letter-spacing: -0.01em;
  }

  .zs-mobile-nav-sheet button[aria-label='إغلاق'] {
    min-width: 44px;
    min-height: 44px;
    width: 44px;
    height: 44px;
  }

  .zs-mobile-nav-sheet .mega-menu-scroll {
    padding: 8px 12px 12px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  .zs-mobile-nav-sheet .mega-menu-scroll > div {
    padding-block: 6px;
  }

  .zs-mobile-nav-sheet .mega-menu-scroll > div + div {
    margin-top: 2px;
    border-top: 1px solid rgba(163, 255, 18, 0.05);
    padding-top: 10px;
  }

  .zs-mobile-nav-sheet .mega-menu-scroll > div > button[type='button'] {
    min-height: 44px;
    padding: 10px 12px;
    gap: 10px;
    font-size: 16px;
    line-height: 1.35;
    border-radius: 12px;
  }

  .zs-mobile-nav-sheet .mega-menu-scroll h3 {
    font-size: 11px;
    line-height: 1.4;
    margin-bottom: 6px;
    padding-inline: 4px;
    color: rgba(156, 163, 175, 0.95);
  }

  .zs-mobile-nav-sheet .mega-menu-link-card {
    min-height: 44px;
    padding: 10px 12px !important;
    gap: 10px !important;
    max-width: 100%;
    box-sizing: border-box;
  }

  .zs-mobile-nav-sheet .mega-menu-link-card span.block.text-sm {
    font-size: 14px;
    line-height: 1.35;
  }

  .zs-mobile-nav-sheet .mega-menu-link-card span.block.text-\[11px\] {
    font-size: 12px;
    line-height: 1.45;
    margin-top: 3px !important;
  }

  .zs-mobile-nav-sheet .mega-menu-icon-ring {
    min-width: 40px;
    min-height: 40px;
    width: 40px !important;
    height: 40px !important;
  }

  .zs-mobile-nav-sheet ul.flex.flex-col.gap-2 {
    gap: 10px;
  }

  .zs-mobile-nav-sheet .grid.gap-4,
  .zs-mobile-nav-sheet .grid.gap-2 {
    gap: 10px;
  }

  .zs-mobile-nav-sheet .shrink-0.border-t {
    padding: 12px 12px calc(12px + env(safe-area-inset-bottom, 0px));
  }

  .zs-mobile-nav-sheet .shrink-0.border-t a,
  .zs-mobile-nav-sheet .shrink-0.border-t button {
    min-height: 44px;
    padding-top: 10px;
    padding-bottom: 10px;
    font-size: 13px;
    line-height: 1.3;
  }

  .zs-mobile-nav-sheet .shrink-0.border-t .grid {
    gap: 10px;
  }
}

/**
 * ZeroSpread — Desktop V2 · Mega menu grammar (≥ 1024px).
 *
 * ONE grammar for every header dropdown (Products, School, News, Trading, More):
 * same surface, border, radius, elevation, anchor line, row height, type ramp,
 * icon box, section label, separator, hover / focus / selected, motion and RTL
 * behaviour. Only WIDTH and ROW COUNT differ, chosen from a small family:
 *
 *   data-zs-mm-width="compact"   264px   News · Trading · More   (single list)
 *   data-zs-mm-width="standard"  288px   School                  (featured + 2 groups)
 *   data-zs-mm-width="wide"      312px   Products                (featured + sections + flyouts)
 *   contextual child column      232px   every flyout
 *
 * What was inconsistent before (evidence: previous version of this file +
 * site-header-light.css): panel widths 300 / 270 / 260 / 260 / 260, flyouts
 * 235 vs 208, rows 48 vs 45, section-label margins 10 / 12 / 14, panel top =
 * "trigger text bottom + 12px" (so each menu started at a different y),
 * hard-coded #111 icons, TradingView-blue focus rings, 3 !important layers.
 *
 * Tokens: app/design-system/zs-desktop-v2.css (--zs-pop-*, --zs-mm-*).
 */

/* ── Anchor: every panel hangs from the header's bottom edge ───────── */
.zs-header-p0 .zs-mm-anchor {
  position: absolute;
  top: 100%;
  inset-inline-start: 0;
  z-index: var(--zs-z-d-header-layer);
  /* invisible hover bridge = the shared popover offset */
  padding-top: var(--zs-pop-offset);
  overflow: visible;
  transform: translateX(var(--zs-mm-shift, 0px));
}

.zs-header-p0 .tv-nav-bridge {
  position: relative;
  display: flex;
  align-items: stretch;
  overflow: visible;
  font-family: var(--zs-font-institutional, "Tajawal", sans-serif);
  font-synthesis: none;
  letter-spacing: 0;
  color: var(--zs-pop-ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: geometricPrecision;
}

/* ── Surface ───────────────────────────────────────────────────────── */
.zs-header-p0 .tv-nav-panel,
.zs-header-p0 .tv-nav-flyout {
  box-sizing: border-box;
  flex-shrink: 0;
  padding-block: var(--zs-pop-pad-block);
  background: var(--zs-pop-bg);
  border: 1px solid var(--zs-pop-line);
  border-radius: var(--zs-pop-radius);
  box-shadow: var(--zs-pop-shadow), var(--zs-hdr-pop-ring);
  color: var(--zs-pop-ink);
}

/* ── Width family ──────────────────────────────────────────────────── */
.zs-header-p0 .tv-nav-panel {
  width: var(--zs-mm-w-compact);
  max-width: calc(100vw - 2 * var(--zs-mm-edge));
}

.zs-header-p0 .tv-nav-panel[data-zs-mm-width='standard'] {
  width: var(--zs-mm-w-standard);
}

.zs-header-p0 .tv-nav-panel[data-zs-mm-width='wide'] {
  width: var(--zs-mm-w-wide);
}

.zs-header-p0 .tv-nav-scroll {
  max-height: calc(100vh - var(--zs-header-height, 72px) - var(--zs-pop-offset) - 24px);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(17, 21, 18, 0.18) transparent;
}

/* ── Contextual child column (flyout) — attached, one seam ─────────── */
.zs-header-p0 .tv-nav-flyout {
  position: absolute;
  top: 0;
  width: var(--zs-mm-flyout-w);
  max-width: calc(100vw - 2 * var(--zs-mm-edge));
  height: auto;
  animation: zs-mm-flyout-in var(--zs-dur-d-fast) var(--zs-ease-d) both;
}

.zs-header-p0 .tv-nav-flyout--full {
  bottom: 0;
  height: 100%;
}

/* RTL: [child | root] — the child sits on the root's physical left and
   shares one 1px seam (root's left border). Physical corners on purpose. */
.zs-header-p0 .tv-nav-bridge[dir='rtl'] .tv-nav-flyout {
  right: 100%;
  border-right: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.zs-header-p0 .tv-nav-bridge[dir='rtl']:has(.tv-nav-flyout) .tv-nav-panel {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

/* LTR: [root | child] */
.zs-header-p0 .tv-nav-bridge[dir='ltr'] .tv-nav-flyout {
  left: 100%;
  border-left: 0;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.zs-header-p0 .tv-nav-bridge[dir='ltr']:has(.tv-nav-flyout) .tv-nav-panel {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

/* Edge flip: when useMegaMenuEdgeClamp reports no room on the usual side,
   the child column opens on the other side as a detached panel (4px gap,
   full radius) — never clipped by the viewport. */
.zs-header-p0 .zs-mm-anchor[data-zs-mm-flip] .tv-nav-bridge .tv-nav-flyout {
  right: auto;
  left: auto;
  border: 1px solid var(--zs-pop-line);
  border-radius: var(--zs-pop-radius);
}

.zs-header-p0 .zs-mm-anchor[data-zs-mm-flip] .tv-nav-bridge[dir='rtl'] .tv-nav-flyout {
  left: calc(100% + 4px);
}

.zs-header-p0 .zs-mm-anchor[data-zs-mm-flip] .tv-nav-bridge[dir='ltr'] .tv-nav-flyout {
  right: calc(100% + 4px);
}

.zs-header-p0 .zs-mm-anchor[data-zs-mm-flip] .tv-nav-bridge:has(.tv-nav-flyout) .tv-nav-panel {
  border-radius: var(--zs-pop-radius);
}

/* ── Featured row (first row of every panel that has one) ──────────── */
.zs-header-p0 .tv-nav-panel:has(> .tv-nav-featured) {
  padding-top: 0;
}

.zs-header-p0 .tv-nav-panel > .tv-nav-featured {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  column-gap: var(--zs-pop-icon-gap);
  box-sizing: border-box;
  width: 100%;
  min-height: 64px;
  margin: 0 0 var(--zs-pop-pad-block);
  padding: 12px var(--zs-pop-row-pad);
  border: 0;
  border-bottom: 1px solid var(--zs-pop-line-soft);
  border-start-start-radius: var(--zs-pop-radius);
  border-start-end-radius: var(--zs-pop-radius);
  background: transparent;
  color: var(--zs-pop-ink);
  text-align: start;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--zs-dur-d-fast) var(--zs-ease-d);
}

.zs-header-p0 .tv-nav-panel > .tv-nav-featured:hover {
  background: var(--zs-pop-hover);
}

.zs-header-p0 .tv-nav-panel > .tv-nav-featured:focus-visible {
  outline: none;
  box-shadow: var(--zs-pop-focus);
}

.zs-header-p0 .tv-nav-featured-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: var(--zs-pop-ink);
  font-size: 24px; /* react-icons render at 1em */
  line-height: 1;
}

.zs-header-p0 .tv-nav-featured-icon svg {
  display: block;
  width: 24px;
  height: 24px;
}

.zs-header-p0 .tv-nav-featured-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-width: 0;
}

.zs-header-p0 .tv-nav-featured-title {
  display: block;
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--zs-pop-ink);
}

.zs-header-p0 .tv-nav-featured-desc {
  display: block;
  font-size: var(--zs-pop-desc);
  font-weight: 400;
  line-height: 1.45;
  color: var(--zs-pop-muted);
}

/* ── Section label ─────────────────────────────────────────────────── */
.zs-header-p0 .tv-nav-section-label {
  display: block;
  margin: 0;
  padding: 12px var(--zs-pop-row-pad) 4px;
  font-size: var(--zs-pop-section);
  font-weight: 500;
  line-height: 1.3;
  color: var(--zs-pop-muted);
}

.zs-header-p0 .tv-nav-panel > .tv-nav-section-label:first-child,
.zs-header-p0 .tv-nav-featured + .tv-nav-section-label {
  padding-top: 4px;
}

/* Groups after the first read as groups: a hairline above the label. */
.zs-header-p0 .tv-nav-row + .tv-nav-section-label {
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--zs-pop-line-soft);
}

.zs-header-p0 .tv-nav-panel > hr,
.zs-header-p0 .tv-nav-separator {
  display: none;
}

/* ── Rows (root + flyout share the same rule) ──────────────────────── */
.zs-header-p0 .tv-nav-row,
.zs-header-p0 .tv-nav-flyout-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--zs-pop-icon-gap);
  box-sizing: border-box;
  width: 100%;
  height: var(--zs-pop-row-h);
  min-height: var(--zs-pop-row-h);
  padding-inline: var(--zs-pop-row-pad);
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--zs-pop-ink);
  font-size: var(--zs-pop-label);
  font-weight: 500;
  line-height: 1.3;
  text-align: start;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--zs-dur-d-fast) var(--zs-ease-d);
}

.zs-header-p0 .tv-nav-flyout-row {
  justify-content: flex-start;
  overflow: hidden;
  text-overflow: ellipsis;
}

.zs-header-p0 .tv-nav-row:hover,
.zs-header-p0 .tv-nav-flyout-row:hover {
  background: var(--zs-pop-hover);
}

.zs-header-p0 .tv-nav-row--active {
  background: var(--zs-pop-selected);
}

.zs-header-p0 .tv-nav-row:active,
.zs-header-p0 .tv-nav-flyout-row:active {
  background: var(--zs-pop-press);
}

.zs-header-p0 .tv-nav-row:focus-visible,
.zs-header-p0 .tv-nav-flyout-row:focus-visible {
  outline: none;
  box-shadow: var(--zs-pop-focus);
}

/* Current page inside a menu: 3px brand marker on the reading-start edge. */
.zs-header-p0 :is(.tv-nav-row, .tv-nav-flyout-row, .tv-nav-featured)[aria-current='page'] {
  position: relative;
  font-weight: 700;
}

.zs-header-p0 :is(.tv-nav-row, .tv-nav-flyout-row, .tv-nav-featured)[aria-current='page']::before {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-start-end-radius: 3px;
  border-end-end-radius: 3px;
  background: var(--zs-pop-marker);
}

.zs-header-p0 .tv-nav-row-main {
  display: flex;
  align-items: center;
  gap: var(--zs-pop-icon-gap);
  min-width: 0;
  flex: 1;
}

.zs-header-p0 .tv-nav-row-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: inherit;
}

/* ── Icon box — one size, one colour, both icon families ───────────── */
.zs-header-p0 .tv-nav-row-icon,
.zs-header-p0 .tv-nav-flyout-row-icon {
  display: inline-flex;
  flex: 0 0 var(--zs-pop-icon);
  align-items: center;
  justify-content: center;
  width: var(--zs-pop-icon);
  height: var(--zs-pop-icon);
  color: var(--zs-pop-ink);
  font-size: var(--zs-pop-icon);
  line-height: 1;
}

.zs-header-p0 .tv-nav-row-icon svg,
.zs-header-p0 .tv-nav-flyout-row-icon svg {
  display: block;
  width: var(--zs-pop-icon);
  height: var(--zs-pop-icon);
}

/* Solid (react-icons) glyphs are filled; lucide glyphs are stroked. Both
   take the ink colour from currentColor — no per-panel colour overrides. */
.zs-header-p0 .tv-nav-bridge svg.tv-nav-solid-icon {
  fill: currentColor;
  stroke: none;
}

.zs-header-p0 .tv-nav-bridge svg:not(.tv-nav-solid-icon):not(.tv-nav-chevron) {
  fill: none;
  stroke: currentColor;
}

.zs-header-p0 .tv-nav-chevron {
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  color: var(--zs-pop-muted);
}

/* ── Motion ────────────────────────────────────────────────────────── */
@keyframes zs-mm-flyout-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .zs-header-p0 .tv-nav-flyout,
  .zs-header-p0 .tv-nav-row,
  .zs-header-p0 .tv-nav-flyout-row,
  .zs-header-p0 .tv-nav-featured {
    animation: none;
    transition: none;
  }
}

/* Guest account panel — Desktop V2 header popover grammar (--zs-pop-*). Same surface,
   radius, elevation, row height and ink as the account menu and mega menus. */
.GuestUserMenu_panel__SZ7Du.zs-account-menu-anchor {
  box-sizing: border-box;
  width: 320px;
  min-width: 320px;
  max-width: 320px;
  overflow: hidden;
  padding-block: var(--zs-pop-pad-block, 8px);
  border: 1px solid var(--zs-pop-line, rgba(17, 21, 18, 0.1)) !important;
  border-radius: var(--zs-pop-radius, 12px);
  background: var(--zs-pop-bg, #ffffff) !important;
  color: var(--zs-pop-ink, #111512) !important;
  box-shadow: var(--zs-pop-shadow, 0 16px 40px -12px rgba(15, 18, 16, 0.22)), var(--zs-hdr-pop-ring, 0 0 0 0 transparent);
}

.GuestUserMenu_divider__E_TcS {
  height: 1px;
  margin: 4px 0;
  background: var(--zs-pop-line-soft, #e2e8f0);
}

.GuestUserMenu_loginRow__0mE43 {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 11px;
  box-sizing: border-box;
  width: 100%;
  height: var(--zs-pop-row-h, 44px);
  padding-inline: var(--zs-pop-row-pad, 16px);
  border: 0;
  background: transparent;
  color: var(--zs-pop-ink, #111512) !important;
  font-size: var(--zs-pop-label, 15px);
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--zs-dur-d-fast, 120ms) var(--zs-ease-d, ease);
}

.GuestUserMenu_loginRow__0mE43:hover,
.GuestUserMenu_loginRow__0mE43:focus-visible {
  background: var(--zs-pop-hover, #f4f5f3) !important;
  color: var(--zs-pop-ink, #111512) !important;
  text-decoration: none;
}

.GuestUserMenu_loginRow__0mE43:focus-visible {
  outline: none;
  box-shadow: var(--zs-pop-focus, inset 0 0 0 2px #111512);
}

.GuestUserMenu_loginIcon__lG11e {
  flex-shrink: 0;
  color: var(--zs-pop-ink, #111512) !important;
  stroke: var(--zs-pop-ink, #111512) !important;
}

.GuestUserMenu_loginText__Kwmgr {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--zs-pop-ink, #111512) !important;
}

.GuestUserMenu_textRow__LSVdv {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  box-sizing: border-box;
  width: 100%;
  height: var(--zs-pop-row-h, 44px);
  padding-inline: var(--zs-pop-row-pad, 16px);
  border: 0;
  background: transparent;
  color: var(--zs-pop-ink, #111512) !important;
  font-size: var(--zs-pop-label, 15px);
  font-weight: 500;
  line-height: 1.2;
  text-align: start;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--zs-dur-d-fast, 120ms) var(--zs-ease-d, ease);
}

.GuestUserMenu_textRow__LSVdv:hover,
.GuestUserMenu_textRow__LSVdv:focus-visible {
  background: var(--zs-pop-hover, #f4f5f3) !important;
  color: var(--zs-pop-ink, #111512) !important;
  outline: none;
}

.GuestUserMenu_darkRow__mNFax {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-sizing: border-box;
  width: 100%;
  height: var(--zs-pop-row-h, 44px);
  padding-inline: var(--zs-pop-row-pad, 16px);
  border: 0;
  background: transparent;
  color: var(--zs-pop-ink, #111512) !important;
  cursor: pointer;
  transition: background-color var(--zs-dur-d-fast, 120ms) var(--zs-ease-d, ease);
}

.GuestUserMenu_darkRow__mNFax:hover,
.GuestUserMenu_darkRow__mNFax:focus-visible {
  background: var(--zs-pop-hover, #f4f5f3) !important;
  outline: none;
}

.GuestUserMenu_darkLabel__HkHgw {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-size: var(--zs-pop-label, 15px);
  font-weight: 500;
  line-height: 1.2;
  text-align: start;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--zs-pop-ink, #111512) !important;
}

.GuestUserMenu_switch__7ZHiJ {
  position: relative;
  flex-shrink: 0;
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: #9ca3af;
  transition: background-color 180ms ease;
}

.GuestUserMenu_switchOn__WC1pj {
  background: #4b5563;
}

.GuestUserMenu_switchThumb__al5se {
  position: absolute;
  top: 2px;
  inset-inline-start: 2px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.18);
  transition: inset-inline-start 180ms ease;
  pointer-events: none;
}

.GuestUserMenu_switchOn__WC1pj .GuestUserMenu_switchThumb__al5se {
  inset-inline-start: 20px;
}

/**
 * Mobile — Search Center (shared with desktop overlay).
 */
@media (max-width: 767px) {
  .zs-search-center-stack {
    width: calc(100vw - 28px);
    max-width: none;
  }

  .zs-search-center-input {
    font-size: 16px;
  }
}

/**
 * ZeroSpread global Search Center — TradingView-grade white overlay.
 * Attached below SiteHeader; does not alter header/rail geometry.
 */

.zs-search-center-root {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
}

.zs-search-center-backdrop {
  position: absolute;
  top: var(--zs-header-height, 72px);
  left: 0;
  right: var(--zs-right-utility-rail-width, 52px);
  bottom: 0;
  background: rgba(0, 0, 0, 0.2);
  pointer-events: auto;
}

.zs-search-center {
  position: absolute;
  top: var(--zs-header-height, 72px);
  left: 0;
  right: var(--zs-right-utility-rail-width, 52px);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 24px 24px;
  pointer-events: none;
  font-family: "Tajawal", "IBM Plex Sans Arabic", sans-serif;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

.zs-search-center-stack {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: min(860px, calc(100vw - var(--zs-right-utility-rail-width, 52px) - 48px));
  max-width: 860px;
}

.zs-search-center-field {
  display: flex;
  align-items: center;
  box-sizing: border-box;
  width: 100%;
  max-width: 800px;
  align-self: center;
  height: 46px;
  padding-inline: 16px;
  border: none;
  border-radius: 23px;
  background: #f4f4f4;
  color: #111111;
  gap: 10px;
  pointer-events: auto;
}

.zs-search-center-field-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: #6b7280;
}

.zs-search-center-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: none;
  background: transparent;
  color: #111111;
  font-family: inherit;
  font-size: 14px;
  font-weight: 450;
  font-synthesis: none;
  line-height: 1.35;
  outline: none;
}

.zs-search-center-input::placeholder {
  color: #9ca3af;
}

.zs-search-center-input::-webkit-search-cancel-button,
.zs-search-center-input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}

.zs-search-center-clear {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: #4b5563;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  font-synthesis: none;
  cursor: pointer;
}

.zs-search-center-clear:hover {
  color: #111111;
}

.zs-search-center-clear-x {
  width: 14px;
  height: 14px;
}

/* ── Panel ── */
.zs-search-center-panel {
  box-sizing: border-box;
  width: 100%;
  max-width: 860px;
  align-self: center;
  max-height: min(70vh, calc(100vh - var(--zs-header-height, 72px) - 80px));
  margin-top: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid #e7e7e7;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  pointer-events: auto;
}

.zs-search-center-subhead {
  flex-shrink: 0;
  background: #ffffff;
  border-bottom: 1px solid #e8eaed;
}

.zs-search-center-tabs {
  display: flex;
  flex-shrink: 0;
  gap: 24px;
  padding: 16px 18px 0;
}

.zs-search-center-tab {
  position: relative;
  margin: 0;
  padding: 0 0 12px;
  border: none;
  background: transparent;
  color: #222222;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  font-synthesis: none;
  line-height: 1.3;
  cursor: default;
  white-space: nowrap;
}

.zs-search-center-tab[data-active='true'] {
  color: #111111;
  font-size: 14px;
  font-weight: 600;
}

.zs-search-center-tab[data-active='true']::after {
  content: "";
  position: absolute;
  right: 0;
  left: 0;
  bottom: 0;
  height: 2px;
  background: #111111;
  border-radius: 1px;
}

.zs-search-center-chips {
  display: flex;
  flex-shrink: 0;
  gap: 8px;
  padding: 12px 18px 14px;
  overflow-x: auto;
  scrollbar-width: none;
}

.zs-search-center-chips::-webkit-scrollbar {
  display: none;
}

.zs-search-center-chip {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  height: 29px;
  padding: 0 14px;
  border: none;
  border-radius: 15px;
  background: #f1f3f4;
  color: #2f343a;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  font-synthesis: none;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition: background 120ms ease, color 120ms ease;
}

.zs-search-center-chip:hover:not([data-active='true']) {
  background: #eceef0;
}

.zs-search-center-chip[data-active='true'] {
  background: #2a2a2a;
  color: #ffffff;
}

/* ── Scroll body ── */
.zs-search-center-body {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.zs-search-center-section-label {
  padding: 10px 18px 6px;
  color: #6b7280;
  font-size: 11px;
  font-weight: 600;
  font-synthesis: none;
}

/* ── Result row (TradingView table scan) ── */
.zs-search-center-row {
  display: grid;
  grid-template-columns: 20px 76px minmax(0, 1fr) minmax(88px, 128px);
  align-items: center;
  column-gap: 12px;
  box-sizing: border-box;
  width: 100%;
  height: 43px;
  min-height: 43px;
  padding: 0 18px;
  border: none;
  border-bottom: 1px solid #e8eaed;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font-family: inherit;
  text-align: start;
  cursor: pointer;
  transition: background 80ms ease;
}

.zs-search-center-row:hover {
  background: #f7f7f8;
}

.zs-search-center-row[data-active='true'] {
  background: #f1f3f5;
}

.zs-search-center-body .zs-search-center-row:last-child {
  border-bottom: none;
}

.zs-search-center-row-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  overflow: hidden;
  flex-shrink: 0;
}

.zs-search-center .zsWlAssetIcon {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 50%;
}

.zs-search-center .zsWlAssetIcon img {
  width: 20px;
  height: 20px;
  object-fit: cover;
  border-radius: 50%;
}

.zs-search-center-row-symbol {
  color: #111111;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  font-synthesis: none;
  line-height: 1.3;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.zs-search-center-row-name {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
  min-width: 0;
  overflow: hidden;
}

.zs-search-center-row-name-primary {
  font-family: "Tajawal", "IBM Plex Sans Arabic", sans-serif;
  color: #111111;
  font-size: 14px;
  font-weight: 500;
  font-synthesis: none;
  line-height: 1.3;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.zs-search-center-row-name-secondary {
  font-family: inherit;
  color: #7b8492;
  font-size: 12px;
  font-weight: 400;
  font-synthesis: none;
  line-height: 1.2;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.zs-search-center-row-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 0;
  min-width: 0;
  text-align: end;
}

.zs-search-center-row-meta-primary {
  color: #1f2937;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  font-synthesis: none;
  line-height: 1.3;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.zs-search-center-row-meta-secondary {
  color: #6b7280;
  font-family: inherit;
  font-size: 12px;
  font-weight: 400;
  font-synthesis: none;
  line-height: 1.2;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* ── Empty / status ── */
.zs-search-center-empty,
.zs-search-center-status {
  padding: 40px 24px 48px;
  text-align: center;
}

.zs-search-center-empty-title,
.zs-search-center-status-title {
  color: #111111;
  font-size: 14px;
  font-weight: 600;
  font-synthesis: none;
}

.zs-search-center-empty-sub,
.zs-search-center-status-sub {
  margin-top: 6px;
  color: #6b7280;
  font-size: 13px;
  font-weight: 400;
  font-synthesis: none;
  line-height: 1.45;
}

/* ── Skeleton ── */
.zs-search-center-skel {
  display: grid;
  grid-template-columns: 20px 76px minmax(0, 1fr) 96px;
  align-items: center;
  column-gap: 12px;
  height: 43px;
  min-height: 43px;
  padding: 0 18px;
  border-bottom: 1px solid #e8eaed;
}

.zs-search-center-skel-bar {
  height: 10px;
  border-radius: 4px;
  background: linear-gradient(90deg, #f3f4f6 0%, #e8eaed 50%, #f3f4f6 100%);
  background-size: 200% 100%;
  animation: zs-search-skel 1.2s ease-in-out infinite;
}

.zs-search-center-skel-bar.is-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
}

.zs-search-center-skel-bar.is-symbol {
  width: 52px;
}

.zs-search-center-skel-bar.is-meta {
  width: 72px;
  justify-self: end;
}

@keyframes zs-search-skel {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

@media (max-width: 1023.98px) {
  .zs-search-center {
    padding-inline: 16px;
  }

  .zs-search-center-stack {
    width: min(860px, calc(100vw - var(--zs-right-utility-rail-width, 52px) - 32px));
  }
}

@media (max-width: 767px) {
  .zs-search-center-backdrop,
  .zs-search-center {
    right: 0;
    top: var(--zs-header-height, 60px);
  }

  .zs-search-center {
    padding: 8px 14px 16px;
  }

  .zs-search-center-stack {
    width: calc(100vw - 28px);
    max-width: none;
  }

  .zs-search-center-field {
    max-width: none;
    height: 44px;
  }

  .zs-search-center-panel {
    max-width: none;
    max-height: min(72vh, calc(100dvh - var(--zs-header-height, 60px) - 68px));
  }

  .zs-search-center-row {
    grid-template-columns: 20px 68px minmax(0, 1fr) auto;
    column-gap: 10px;
    padding-inline: 14px;
    height: 43px;
    min-height: 43px;
  }

  .zs-search-center-row-meta-primary {
    display: none;
  }

  .zs-search-center-row-meta-secondary {
    font-size: 11px;
  }

  .zs-search-center-input {
    font-size: 16px;
  }

  .zs-search-center-tabs {
    gap: 16px;
    padding-inline: 14px;
  }

  .zs-search-center-chips {
    padding-inline: 14px;
  }
}

/* ── Desktop V2 (≥ 1024px): Search Center joins the header popover grammar ──
   Same layer family, surface, radius, elevation and offset as every other
   header popover. Mobile (< 1024px) keeps the rules above unchanged. */
@media (min-width: 1024px) {
  .zs-search-center-root {
    /* above page content and the fixed header's 50, below dialogs */
    z-index: var(--zs-z-d-page-popover, 1000);
  }

  .zs-search-center-backdrop {
    background: rgba(12, 14, 13, 0.28);
  }

  .zs-search-center {
    padding-top: var(--zs-pop-offset, 8px);
    padding-inline: var(--zs-gutter-d, 24px);
  }

  .zs-search-center-field {
    border: 1px solid var(--zs-pop-line, rgba(17, 21, 18, 0.1));
    background: var(--zs-pop-bg, #ffffff);
    color: var(--zs-pop-ink, #111512);
    box-shadow: var(--zs-pop-shadow, 0 16px 40px -12px rgba(15, 18, 16, 0.22));
  }

  .zs-search-center-field:focus-within {
    box-shadow: var(--zs-pop-shadow, 0 16px 40px -12px rgba(15, 18, 16, 0.22)), 0 0 0 2px #111512;
  }

  .zs-search-center-panel {
    border: 1px solid var(--zs-pop-line, rgba(17, 21, 18, 0.1));
    border-radius: var(--zs-pop-radius, 12px);
    background: var(--zs-pop-bg, #ffffff);
    box-shadow: var(--zs-pop-shadow, 0 16px 40px -12px rgba(15, 18, 16, 0.22));
  }
}

