/* Search, secondary pools and sort/filter form one aligned card. */
.mobile-sticky-controls,
html.feishu-webview .mobile-sticky-controls {
  margin: 9px 0 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 6px 16px rgba(15, 23, 42, .12);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.mobile-sticky-controls .mobile-tools,
.mobile-sticky-controls .mobile-controls { gap: 8px; }
.mobile-sticky-controls .mobile-tools { grid-template-columns: minmax(0, 1fr) 78px; }
.mobile-sticky-controls .mobile-controls { grid-template-columns: minmax(0, 1fr) 78px 78px; }

/* Remove the old gold glow beneath the exchange-discount footer action in both themes. */
.bottom-nav .fee-discount-nav-item { box-shadow: none; }

/* Legacy BTC tile adds a white inset highlight along its top edge. */
html.hscan-v23-night .mobile-market-overview .btc-tile,
html.hscan-v23-night.feishu-webview .mobile-market-overview .btc-tile {
  box-shadow: none;
}

/* The neutral W-wave badge and footer actions must use night surfaces. */
html.hscan-v23-night .long-row-main > .wave-slot > .badge,
html.hscan-v23-night .mobile-exchange-dialog,
html.hscan-v23-night .mobile-help-dialog,
html.hscan-v23-night .drawer.sort-layout .drawer-sheet,
html.hscan-v23-night .drawer.sort-layout .drawer-head {
  background: var(--panel);
  color: var(--text);
  border-color: var(--line);
}
html.hscan-v23-night .bottom-nav {
  background: var(--v23-sticky);
  border-color: var(--line);
}
html.hscan-v23-night .bottom-nav .fee-discount-nav-item,
html.hscan-v23-night .bottom-nav .notification-nav-item {
  background: var(--v23-card-action);
  background-image: none;
  border-color: var(--line);
  color: var(--text);
  box-shadow: none;
}

/* Exchange-picker and explanatory popups. */
html.hscan-v23-night .mobile-exchange-dialog > header button,
html.hscan-v23-night .mobile-exchange-option,
html.hscan-v23-night .mobile-help-head button {
  background: var(--v23-soft);
  border-color: var(--line);
  color: var(--text);
}
html.hscan-v23-night .mobile-exchange-option.is-disabled {
  background: var(--v23-sticky);
  color: var(--muted);
}
html.hscan-v23-night .mobile-exchange-option:not(.is-disabled) {
  background: var(--v23-ready-bg);
  border-color: var(--v23-ready-line);
  color: var(--green);
}
html.hscan-v23-night .mobile-help-head { border-color: var(--line); }
html.hscan-v23-night .mobile-help-content { color: var(--text); }
html.hscan-v23-night .mobile-help-content .mobile-help-subtitle { color: var(--text); }

/* Sort and filter overlay: legacy selectors used literal white and pale blue. */
html.hscan-v23-night .drawer.sort-layout .sort-choice,
html.hscan-v23-night .drawer.filter-layout .filter-chip {
  background: var(--v23-soft);
  border-color: var(--line);
  color: var(--text);
}
html.hscan-v23-night .drawer.sort-layout .sort-choice.active,
html.hscan-v23-night .drawer.filter-layout .filter-chip.active {
  background: var(--v23-selected-bg);
  border-color: var(--v23-selected-line);
  color: var(--v23-selected-text);
  box-shadow: inset 3px 0 var(--blue);
}
html.hscan-v23-night .sort-choice-direction,
html.hscan-v23-night .filter-wave-guide {
  background: var(--v23-soft);
  border-color: var(--line);
  color: var(--muted);
}
html.hscan-v23-night .sort-choice-check { color: var(--blue); }

/* Notification and settings sheets: cards, controls and state colors. */
html.hscan-v23-night .notification-zone-nav,
html.hscan-v23-night .notification-zone-nav button,
html.hscan-v23-night .notification-channel-card,
html.hscan-v23-night .notification-channel-actions button:not(.primary-btn),
html.hscan-v23-night .notification-status,
html.hscan-v23-night .notification-permission-note,
html.hscan-v23-night .notification-background-note,
html.hscan-v23-night .notification-footnote,
html.hscan-v23-night .notification-server-state,
html.hscan-v23-night .notification-topic-group,
html.hscan-v23-night .notification-topic,
html.hscan-v23-night .notification-check-list,
html.hscan-v23-night .notification-device-maintenance,
html.hscan-v23-night .notification-info-details,
html.hscan-v23-night .notification-tutorial-trigger,
html.hscan-v23-night .mobile-trader-notification-row,
html.hscan-v23-night .notification-wave-filter-dialog {
  background: var(--panel);
  background-image: none;
  border-color: var(--line);
  color: var(--text);
}
html.hscan-v23-night .notification-zone-nav button.active,
html.hscan-v23-night .notification-wave-filter-dialog button:not(.notification-wave-secondary) {
  background: var(--member-cta);
  background-image: none;
  border-color: var(--member-cta);
  color: #fff;
}
html.hscan-v23-night .notification-zone-nav button small,
html.hscan-v23-night .mobile-trader-notification-head small { color: var(--muted); }
html.hscan-v23-night .notification-zone-nav button.active small { color: #E8F0F7; }
html.hscan-v23-night .notification-zone-icon,
html.hscan-v23-night .notification-apk-download,
html.hscan-v23-night .notification-wave-filter-dialog .notification-wave-secondary {
  background: var(--v23-soft);
  border-color: var(--line);
  color: var(--blue);
}
html.hscan-v23-night .notification-topic-group h4,
html.hscan-v23-night .notification-topic[aria-pressed="true"] {
  background: var(--v23-soft);
  color: var(--text);
}
html.hscan-v23-night .notification-topic-check,
html.hscan-v23-night .notification-channel-card.ready,
html.hscan-v23-night .notification-status.ready,
html.hscan-v23-night .notification-status.success {
  background: var(--v23-ready-bg);
  border-color: var(--v23-ready-line);
  color: var(--green);
}
html.hscan-v23-night .notification-channel-card.pending { background: var(--v23-soft); }
html.hscan-v23-night .notification-status.error,
html.hscan-v23-night .notification-server-state.error,
html.hscan-v23-night .notification-recovery {
  background: #3A2634;
  border-color: #744657;
  color: var(--red);
}
html.hscan-v23-night .notification-footnote.warning,
html.hscan-v23-night .notification-background-note {
  background: #3B3427;
  border-color: #75613D;
  color: #F7CA81;
}
html.hscan-v23-night .notification-status.warning,
html.hscan-v23-night .notification-setup-card,
html.hscan-v23-night .notification-check-list > div,
html.hscan-v23-night .notification-info-details summary {
  background: var(--v23-soft);
  background-image: none;
  border-color: var(--line);
  color: var(--text);
}
html.hscan-v23-night .notification-setup-card.complete {
  background: var(--v23-ready-bg);
  border-color: var(--v23-ready-line);
}
html.hscan-v23-night .notification-setup-kicker,
html.hscan-v23-night .mobile-trader-notification-head strong,
html.hscan-v23-night .mobile-trader-notification-head label,
html.hscan-v23-night .mobile-trader-notification-types label { color: var(--text); }
html.hscan-v23-night .notification-channel-actions button.primary-btn {
  background: var(--member-cta);
  border-color: var(--member-cta);
  color: #fff;
}

/* Long-signal W and development state: the same compact type as Favorite. */
.long-row-main > .wave-slot > .badge,
.long-row-main > .status-slot > .badge {
  min-height: 28px;
  padding: 3px 4px;
  font-size: 11px;
  line-height: 1.1;
}

html.feishu-webview .long-row-main > .wave-slot > .badge,
html.feishu-webview .long-row-main > .status-slot > .badge {
  min-height: 26px;
  padding: 3px 4px;
  font-size: 9.5px;
}

@media (max-width: 360px) {
  .long-row-main > .wave-slot > .badge,
  .long-row-main > .status-slot > .badge { font-size: 10px; }

  html.feishu-webview .long-row-main > .wave-slot > .badge,
  html.feishu-webview .long-row-main > .status-slot > .badge {
    min-height: 24px;
    font-size: 8.75px;
  }
}

/* Cover the transparent top margin when the controls stick in an installed iOS app. */
@supports (-webkit-touch-callout: none) {
  @media (display-mode: standalone) {
    .mobile-sticky-controls::before {
      content: "";
      position: absolute;
      top: -10px;
      left: -10px;
      right: -10px;
      height: 10px;
      background: var(--bg);
      pointer-events: none;
    }
  }
}

/* Partner membership opening uses legacy light cards inside the night drawer. */
html.hscan-v23-night .mobile-partner-opening .mobile-partner-price,
html.hscan-v23-night .mobile-partner-opening .mobile-partner-payment-step,
html.hscan-v23-night .mobile-partner-opening .mobile-partner-note {
  background: var(--v23-soft);
  border-color: var(--line);
  color: var(--text);
}
html.hscan-v23-night .mobile-partner-opening .mobile-partner-price > strong,
html.hscan-v23-night .mobile-partner-opening .mobile-partner-benefits > strong,
html.hscan-v23-night .mobile-partner-opening .mobile-partner-benefit-list,
html.hscan-v23-night .mobile-partner-opening .mobile-partner-benefit-detail b,
html.hscan-v23-night .mobile-partner-opening .mobile-partner-note > strong {
  color: var(--text);
}
html.hscan-v23-night .mobile-partner-opening .mobile-partner-price > strong,
html.hscan-v23-night .mobile-partner-opening .mobile-partner-payment-content > p strong {
  color: #ffd58a;
}
html.hscan-v23-night .mobile-partner-opening .mobile-partner-price > strong small,
html.hscan-v23-night .mobile-partner-opening .mobile-partner-benefit-detail small {
  color: var(--muted);
}
html.hscan-v23-night .mobile-partner-opening .mobile-partner-benefits,
html.hscan-v23-night .mobile-partner-opening .mobile-partner-scan-payments {
  border-color: var(--line);
}
html.hscan-v23-night .mobile-partner-opening .mobile-partner-benefit-item > span {
  background: #604718;
  color: #fff0cc;
}
html.hscan-v23-night .mobile-partner-opening .mobile-partner-benefit-copy {
  background: var(--panel);
  border-color: #8f7040;
  color: var(--text);
}
html.hscan-v23-night .mobile-partner-opening .mobile-partner-benefit-copy strong {
  color: var(--text);
}
html.hscan-v23-night .mobile-partner-opening .mobile-partner-network-address,
html.hscan-v23-night .mobile-partner-opening .mobile-partner-scan-payment-grid a,
html.hscan-v23-night .mobile-partner-opening .mobile-partner-contacts button,
html.hscan-v23-night .mobile-partner-opening .mobile-partner-contacts a {
  background: var(--panel);
  border-color: var(--line);
  color: var(--text);
}
html.hscan-v23-night .mobile-partner-opening .mobile-partner-network-address span,
html.hscan-v23-night .mobile-partner-opening .mobile-partner-contacts span {
  color: var(--muted);
}
html.hscan-v23-night .mobile-partner-opening .mobile-partner-network-address code,
html.hscan-v23-night .mobile-partner-opening .mobile-partner-contacts strong {
  color: var(--text);
}
html.hscan-v23-night .mobile-partner-opening .mobile-partner-benefit-copy em,
html.hscan-v23-night .mobile-partner-opening .mobile-partner-network-address em,
html.hscan-v23-night .mobile-partner-opening .mobile-partner-scan-payment-grid small,
html.hscan-v23-night .mobile-partner-opening .mobile-partner-contacts em {
  color: var(--blue);
}
html.hscan-v23-night .mobile-partner-opening .mobile-partner-network-warning,
html.hscan-v23-night .mobile-partner-opening .mobile-partner-scan-payments > p {
  color: #ffb1b8;
}
html.hscan-v23-night .mobile-partner-opening .mobile-partner-note p {
  color: var(--text);
}
