/* ZeroSpread — Page Title Cluster (institutional market/tool heading system)
   Scoped under .zs-ptc. Does not alter theme architecture. */

.zs-ptc {
  --zs-ptc-ink: #0b0f14;
  --zs-ptc-ink-soft: #3d4654;
  --zs-ptc-muted: #6b7280;
  --zs-ptc-panel-bg: #ffffff;
  --zs-ptc-panel-border: rgba(15, 23, 42, 0.08);
  --zs-ptc-panel-shadow: 0 18px 48px rgba(15, 23, 42, 0.1), 0 2px 8px rgba(15, 23, 42, 0.04);
  --zs-ptc-current-bg: #111827;
  --zs-ptc-current-fg: #ffffff;
  --zs-ptc-row-hover: #f4f6f8;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  padding-block: 8px 20px;
  max-width: 52rem;
  text-align: start;
}

.zs-ptc--dark {
  --zs-ptc-ink: #f3f6fa;
  --zs-ptc-ink-soft: #c5ced9;
  --zs-ptc-muted: #93a0b0;
  --zs-ptc-panel-bg: #12161c;
  --zs-ptc-panel-border: rgba(255, 255, 255, 0.1);
  --zs-ptc-panel-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  --zs-ptc-current-bg: #f3f6fa;
  --zs-ptc-current-fg: #0b0f14;
  --zs-ptc-row-hover: rgba(255, 255, 255, 0.06);
}

/* Runtime dark appearance — same contract as .zs-ptc--dark, without requiring a class. */
html:not(.light) .zs-ptc:not(.zs-ptc--force-light) {
  --zs-ptc-ink: #f3f6fa;
  --zs-ptc-ink-soft: #c5ced9;
  --zs-ptc-muted: #93a0b0;
  --zs-ptc-panel-bg: #12161c;
  --zs-ptc-panel-border: rgba(255, 255, 255, 0.1);
  --zs-ptc-panel-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  --zs-ptc-current-bg: #f3f6fa;
  --zs-ptc-current-fg: #0b0f14;
  --zs-ptc-row-hover: rgba(255, 255, 255, 0.06);
}

.zs-ptc__eyebrow {
  margin: 0 0 10px;
  font-size: clamp(13px, 1.15vw, 16px);
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0.01em;
  color: var(--zs-ptc-muted);
}

.zs-ptc__title-row {
  display: flex;
  align-items: center;
  min-width: 0;
  max-width: 100%;
}

.zs-ptc__title-block {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  max-width: 100%;
}

.zs-ptc__title-trigger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 2px 6px 2px 2px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: start;
  max-width: 100%;
  transition: background 0.12s ease;
}

.zs-ptc__title-trigger:hover {
  background: rgba(15, 23, 42, 0.035);
}

.zs-ptc--dark .zs-ptc__title-trigger:hover {
  background: rgba(255, 255, 255, 0.05);
}

.zs-ptc__title-trigger:focus {
  outline: none;
}

.zs-ptc__title-trigger:focus:not(:focus-visible) {
  outline: none;
  box-shadow: none;
}

.zs-ptc__title-trigger:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.45);
  outline-offset: 3px;
}

.zs-ptc__title {
  margin: 0;
  font-size: clamp(30px, 4.2vw, 58px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.035em;
  color: var(--zs-ptc-ink);
  font-family: var(--zs-font-display, var(--zs-font-body, ui-sans-serif, system-ui, sans-serif));
}

.zs-ptc__chevron {
  flex-shrink: 0;
  color: var(--zs-ptc-ink-soft);
  opacity: 0.72;
  transition: transform 0.16s ease;
  margin-top: 0.12em;
}

.zs-ptc--open .zs-ptc__chevron,
.zs-ptc__title-block[data-open='true'] .zs-ptc__chevron {
  transform: rotate(180deg);
}

.zs-ptc__subtitle {
  margin: 12px 0 0;
  max-width: 38rem;
  font-size: clamp(13px, 1.2vw, 16px);
  font-weight: 400;
  line-height: 1.55;
  color: var(--zs-ptc-muted);
}

.zs-ptc__panel {
  position: absolute;
  inset-inline-start: 0;
  top: calc(100% + 8px);
  z-index: 40;
  min-width: min(100%, 280px);
  max-width: min(100vw - 24px, 340px);
  padding: 8px;
  border-radius: 20px;
  border: 1px solid var(--zs-ptc-panel-border);
  background: var(--zs-ptc-panel-bg);
  box-shadow: var(--zs-ptc-panel-shadow);
  animation: zs-ptc-panel-in 140ms ease-out;
}

@keyframes zs-ptc-panel-in {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .zs-ptc__panel {
    animation: none;
  }

  .zs-ptc__chevron {
    transition: none;
  }
}

.zs-ptc__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.zs-ptc__item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--zs-ptc-ink);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.25;
  text-decoration: none;
  text-align: start;
  cursor: pointer;
  box-sizing: border-box;
}

a.zs-ptc__item {
  color: inherit;
}

.zs-ptc__item:hover:not(.zs-ptc__item--current):not(.zs-ptc__item--disabled) {
  background: var(--zs-ptc-row-hover);
}

.zs-ptc__item:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.5);
  outline-offset: 1px;
}

.zs-ptc__item--current {
  background: var(--zs-ptc-current-bg);
  color: var(--zs-ptc-current-fg);
}

.zs-ptc__item--disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.zs-ptc__item-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.9;
}

.zs-ptc__item-icon svg {
  width: 18px;
  height: 18px;
}

.zs-ptc__item-label {
  flex: 1 1 auto;
  min-width: 0;
}

/* Page shell helpers — keep cluster aligned with content without new design system */
.zs-ptc-shell {
  width: 100%;
  min-width: 0;
  padding-block: 4px 4px;
}

@media (max-width: 767px) {
  .zs-ptc {
    padding-block: 4px 14px;
  }

  .zs-ptc__eyebrow {
    margin-bottom: 8px;
  }

  .zs-ptc__title-trigger {
    gap: 8px;
  }

  .zs-ptc__chevron {
    width: 18px;
    height: 18px;
  }

  .zs-ptc__subtitle {
    margin-top: 10px;
  }

  .zs-ptc__panel {
    max-width: calc(100vw - 32px);
  }

  .zs-ptc__item {
    min-height: 44px;
    font-size: 13.5px;
  }
}

/* ═══════════════════════════════════════════════════════════════
   Title Switcher Pilot — shared visual system
   Used by /markets/overview + /crypto/all-coins (and future pilots).
   `.zs-ptc--overview-pilot` kept as alias so Overview stays unchanged.
   ═══════════════════════════════════════════════════════════════ */

.zs-ptc--title-pilot,
.zs-ptc--overview-pilot {
  --zs-ptc-ink: #0f1419;
  --zs-ptc-ink-soft: #4b5563;
  --zs-ptc-muted: #6b7280;
  --zs-ptc-panel-bg: #ffffff;
  --zs-ptc-panel-border: rgba(15, 23, 42, 0.09);
  --zs-ptc-panel-shadow:
    0 2px 4px rgba(15, 23, 42, 0.03),
    0 10px 24px rgba(15, 23, 42, 0.07);
  --zs-ptc-current-bg: #2c3138;
  --zs-ptc-current-fg: #ffffff;
  --zs-ptc-row-hover: #f5f6f7;
  font-family: var(--zs-font-institutional, "IBM Plex Sans Arabic", "Tajawal", sans-serif);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  z-index: 40;
  padding-block: 0;
  max-width: 44rem;
  overflow: visible;
}

.zs-ptc--title-pilot .zs-ptc__eyebrow,
.zs-ptc--overview-pilot .zs-ptc__eyebrow {
  margin: 0 0 8px;
  font-size: clamp(14px, 1vw, 15px);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0;
  color: #5b6470;
}

.zs-ptc--title-pilot .zs-ptc__title-block,
.zs-ptc--overview-pilot .zs-ptc__title-block {
  position: relative;
  align-items: flex-start;
  width: max-content;
  max-width: 100%;
  z-index: 50;
}

.zs-ptc--title-pilot .zs-ptc__title-trigger,
.zs-ptc--overview-pilot .zs-ptc__title-trigger {
  gap: 12px;
  padding: 0;
  border-radius: 6px;
  align-items: center;
}

.zs-ptc--title-pilot .zs-ptc__title-trigger:hover,
.zs-ptc--overview-pilot .zs-ptc__title-trigger:hover {
  background: transparent;
}

.zs-ptc--title-pilot .zs-ptc__title-trigger:focus,
.zs-ptc--title-pilot .zs-ptc__title-trigger:focus:not(:focus-visible),
.zs-ptc--overview-pilot .zs-ptc__title-trigger:focus,
.zs-ptc--overview-pilot .zs-ptc__title-trigger:focus:not(:focus-visible) {
  outline: none;
  box-shadow: none;
}

.zs-ptc--title-pilot .zs-ptc__title-trigger:focus-visible,
.zs-ptc--overview-pilot .zs-ptc__title-trigger:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--zs-green-primary, #a3ff12) 45%, transparent);
  outline-offset: 3px;
}

.zs-ptc--title-pilot .zs-ptc__title,
.zs-ptc--overview-pilot .zs-ptc__title {
  font-size: clamp(34px, 3.8vw, 54px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--zs-ptc-ink);
  font-family: inherit;
}

.zs-ptc--title-pilot .zs-ptc__chevron,
.zs-ptc--overview-pilot .zs-ptc__chevron {
  width: 18px;
  height: 18px;
  stroke-width: 1.65;
  color: var(--zs-ptc-ink-soft);
  opacity: 0.58;
  margin: 0;
  align-self: center;
  position: relative;
  top: 0.06em;
  flex-shrink: 0;
  transition: transform 140ms ease;
}

.zs-ptc--title-pilot .zs-ptc__subtitle,
.zs-ptc--overview-pilot .zs-ptc__subtitle {
  margin: 10px 0 0;
  max-width: 36rem;
  font-size: clamp(14px, 1.05vw, 15.5px);
  font-weight: 400;
  line-height: 1.55;
  color: var(--zs-ptc-muted);
  font-family: inherit;
  position: relative;
  z-index: 1;
}

.zs-ptc--title-pilot .zs-ptc__panel,
.zs-ptc--overview-pilot .zs-ptc__panel {
  position: absolute;
  top: calc(100% + 10px);
  inset-inline-start: 0;
  inset-inline-end: auto;
  margin: 0;
  align-self: auto;
  min-width: 292px;
  width: max-content;
  max-width: min(100vw - 24px, 320px);
  padding: 6px;
  border-radius: 10px;
  border: 1px solid var(--zs-ptc-panel-border);
  background: var(--zs-ptc-panel-bg);
  box-shadow: var(--zs-ptc-panel-shadow);
  z-index: 60;
  animation: zs-ptc-title-pilot-panel-in 140ms ease-out;
}

@keyframes zs-ptc-title-pilot-panel-in {
  from {
    opacity: 0;
    transform: translateY(-3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .zs-ptc--title-pilot .zs-ptc__panel,
  .zs-ptc--overview-pilot .zs-ptc__panel {
    animation: none;
  }

  .zs-ptc--title-pilot .zs-ptc__chevron,
  .zs-ptc--overview-pilot .zs-ptc__chevron {
    transition: none;
  }
}

.zs-ptc--title-pilot .zs-ptc__list,
.zs-ptc--overview-pilot .zs-ptc__list {
  gap: 0;
}

.zs-ptc--title-pilot .zs-ptc__item,
.zs-ptc--overview-pilot .zs-ptc__item {
  gap: 10px;
  min-height: 45px;
  height: 45px;
  padding: 0 14px;
  border-radius: 7px;
  font-size: 15px;
  font-weight: 400;
  font-family: inherit;
  line-height: 1.45;
  letter-spacing: 0;
  color: var(--zs-ptc-ink);
}

.zs-ptc--title-pilot .zs-ptc__item:hover:not(.zs-ptc__item--current):not(.zs-ptc__item--disabled),
.zs-ptc--overview-pilot .zs-ptc__item:hover:not(.zs-ptc__item--current):not(.zs-ptc__item--disabled) {
  background: var(--zs-ptc-row-hover);
}

.zs-ptc--title-pilot .zs-ptc__item:focus-visible,
.zs-ptc--overview-pilot .zs-ptc__item:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--zs-green-primary, #a3ff12) 50%, transparent);
  outline-offset: 0;
  box-shadow: none;
}

.zs-ptc--title-pilot .zs-ptc__item--current,
.zs-ptc--overview-pilot .zs-ptc__item--current {
  background: var(--zs-ptc-current-bg);
  color: var(--zs-ptc-current-fg);
  font-weight: 500;
  box-shadow: none;
  border: 0;
  outline: 0;
}

.zs-ptc--title-pilot .zs-ptc__item-icon,
.zs-ptc--overview-pilot .zs-ptc__item-icon {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.88;
  color: inherit;
}

.zs-ptc--title-pilot .zs-ptc__item-icon svg,
.zs-ptc--overview-pilot .zs-ptc__item-icon svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.65;
  display: block;
  flex-shrink: 0;
}

.zs-ptc--title-pilot .zs-ptc__item--current .zs-ptc__item-icon,
.zs-ptc--overview-pilot .zs-ptc__item--current .zs-ptc__item-icon {
  color: #f8fafc;
  opacity: 0.92;
}

.zs-ptc--title-pilot .zs-ptc__item-label,
.zs-ptc--overview-pilot .zs-ptc__item-label {
  font: inherit;
  font-weight: inherit;
  line-height: inherit;
}

@media (max-width: 767px) {
  .zs-ptc--title-pilot .zs-ptc__eyebrow,
  .zs-ptc--overview-pilot .zs-ptc__eyebrow {
    margin-bottom: 8px;
    font-size: 14px;
  }

  .zs-ptc--title-pilot .zs-ptc__title,
  .zs-ptc--overview-pilot .zs-ptc__title {
    font-size: clamp(32px, 8.5vw, 36px);
    font-weight: 600;
    line-height: 1.08;
  }

  .zs-ptc--title-pilot .zs-ptc__chevron,
  .zs-ptc--overview-pilot .zs-ptc__chevron {
    width: 18px;
    height: 18px;
  }

  .zs-ptc--title-pilot .zs-ptc__subtitle,
  .zs-ptc--overview-pilot .zs-ptc__subtitle {
    margin-top: 8px;
    font-size: 13.5px;
  }

  .zs-ptc--title-pilot .zs-ptc__panel,
  .zs-ptc--overview-pilot .zs-ptc__panel {
    min-width: min(100%, 292px);
    max-width: calc(100vw - 28px);
  }

  .zs-ptc--title-pilot .zs-ptc__item,
  .zs-ptc--overview-pilot .zs-ptc__item {
    min-height: 44px;
    height: 44px;
    font-size: 15px;
    font-weight: 400;
  }
}

/* Page Title Cluster — route integration helpers (scoped; no theme architecture). */

.zsii .intel-nav--title-cluster {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.zsii .intel-nav__title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 20px;
  width: 100%;
}

.zsii .intel-nav__title-row .zs-ptc {
  flex: 1 1 18rem;
  min-width: 0;
  padding-block: 4px 12px;
}

.zsii .intel-nav__asset {
  flex: 0 0 auto;
  margin-inline-start: auto;
  padding-block: 10px 0;
}

.zsii .intel-nav--title-cluster .intel-nav__bar,
.zsii .intel-nav--title-cluster .intel-nav__tabs,
.zsii .intel-nav--title-cluster .intel-nav__item {
  display: none;
}

.asset-detail-title-shell .zs-ptc {
  max-width: 40rem;
  padding-block: 2px 8px;
}

.asset-detail-title-shell .zs-ptc__title {
  font-size: clamp(28px, 3.6vw, 48px);
}

.asset-detail-title-shell .zs-ptc__subtitle {
  margin-top: 8px;
}

.shock-mode-page-title-shell {
  padding-inline: clamp(12px, 2vw, 20px);
  padding-block: 4px 8px;
}

.shock-mode-root .hero-head:not(:has(.h-title)) {
  justify-content: flex-end;
}

.pulse-page-title-shell {
  padding-inline: clamp(12px, 2vw, 18px);
  padding-block: 2px 6px;
}

.zsWlAnalyticsTitleWrap.zs-ptc-shell .zs-ptc {
  padding-block: 0 8px;
}

.zsWlAnalyticsTitleWrap .zsWlAnalyticsDescLink {
  margin-top: 2px;
}

/* /crypto/all-coins — shell spacing (title → content; no subtitle) */
[data-zs-page='crypto-all-coins'] .zs-ptc-shell {
  padding-block: 10px 18px;
  overflow: visible;
}

/* Restore original large H1 (cluster defaults) — title-pilot must not shrink it. */
.crypto-all-coins-page[data-zs-page='crypto-all-coins'] .zs-ptc--title-pilot .zs-ptc__title-trigger,
[data-zs-page='crypto-all-coins'] .zs-ptc--title-pilot .zs-ptc__title-trigger {
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  font-family: inherit;
  text-align: start;
}

.crypto-all-coins-page[data-zs-page='crypto-all-coins'] .zs-ptc--title-pilot .zs-ptc__title,
.crypto-all-coins-page .zs-ptc--title-pilot h1.zs-ptc__title,
[data-zs-page='crypto-all-coins'] .zs-ptc--title-pilot .zs-ptc__title {
  display: block;
  margin: 0;
  font-size: clamp(30px, 4.2vw, 58px) !important;
  font-weight: 700 !important;
  line-height: 1.08;
  letter-spacing: -0.035em;
  color: var(--zs-ptc-ink, #0b0f14);
  font-family: var(--zs-font-display, var(--zs-font-body, ui-sans-serif, system-ui, sans-serif));
}

[data-zs-page='crypto-all-coins'] .zs-ptc__subtitle {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
}

@media (min-width: 1024px) {
  [data-zs-page='crypto-all-coins'] .zs-ptc-shell {
    padding-block: 12px 22px;
  }
}

@media (max-width: 767px) {
  [data-zs-page='crypto-all-coins'] .zs-ptc-shell {
    padding-block: 8px 14px;
  }
}

