/**
 * 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: var(--zs-font-institutional);
  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: var(--zs-font-institutional);
  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: 1024px) {
  .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;
  }
}

