/* Polymarket Network - Original Design (from trading_graph.html) */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background: #faf6f0;
    color: #5c5048;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    overflow: hidden;
}

/* GPU-accelerated filtering for instant response */
.cy-node, .cy-edge {
    will-change: transform, opacity;
}

.cy-node.filtered-instant {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: scale(0.8);
    transition: opacity 0.1s ease-out, transform 0.1s ease-out;
}

.cy-node.virtualized {
    display: none !important;
}

.cy-node.preloaded {
    opacity: 0;
    pointer-events: none;
}

.header {
    background: #faf6f0;
    padding: 8px 16px;
    border-bottom: 1px solid #e8e0d4;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.title {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: opacity 0.15s ease;
}

.title:hover { opacity: 0.7; }

.stats { display: flex; gap: 20px; font-size: 10px; align-items: center; }
.stat-item { display: flex; gap: 4px; align-items: center; }
.stat-label { color: #a89984; }
.stat-value { color: #5c5048; font-weight: 500; }

/* Header Buttons - unified style */
.physics-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #f5ebe0;
    border: none;
    padding: 0 10px;
    height: 26px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    font-weight: 600;
    box-sizing: border-box;
}

.header-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.1);
}

.header-btn.search-btn {
    background: #5c5048;
}

.header-btn.physics-btn {
    background: #5c5048;
}

/* Adventure button — green, hidden until exploration mode is active */
.header-btn.adventure-btn {
    background: #a7c080;
    color: #ffffff;
    display: none;
}
body.exploration-active .header-btn.adventure-btn {
    display: inline-block;
}
.header-btn.adventure-btn:hover {
    background: #bdd496;
}

.header-btn.cart-btn {
    background: #5c5048;
    color: #f5ebe0;
    position: relative;
}

.header-btn.cart-btn:hover {
    background: #4a3f38;
}

.header-btn.portfolio-btn {
    background: #5c5048;
    color: #f5ebe0;
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.header-btn.portfolio-btn:hover {
    background: #4a3f38;
}

.portfolio-claim-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 5px;
    border-radius: 9px;
    background: #e67e80;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 0 0 2px rgba(230, 126, 128, 0.18);
    animation: claimPulse 2.2s ease-in-out infinite;
}

@keyframes claimPulse {
    0%, 100% { box-shadow: 0 0 0 2px rgba(230, 126, 128, 0.18); }
    50%      { box-shadow: 0 0 0 5px rgba(230, 126, 128, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .portfolio-claim-badge { animation: none; }
}

/* Wallet Container */
.wallet-container {
    position: relative;
}

.wallet-btn {
    background: #5c5048;
    color: #f5ebe0;
}

.wallet-btn:hover {
    background: #4a3f38;
}

.wallet-btn.connected {
    background: #5c5048;
}

.wallet-btn.connected:hover {
    background: #4a3f38;
}

.wallet-btn .wallet-icon {
    font-size: 11px;
}

.wallet-btn .wallet-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #34d399;
}

.wallet-btn .wallet-address {
    font-family: monospace;
    font-size: 9px;
    letter-spacing: 0.5px;
}

/* Wallet Dropdown */
.wallet-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: #faf6f0;
    border: 1px solid #e8e0d4;
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.10);
    min-width: 260px;
    z-index: 1000;
    overflow: hidden;
}

.wallet-dropdown.show {
    display: block;
    animation: dropdownFadeIn 0.15s ease;
}

@keyframes dropdownFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.wallet-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: transparent;
    border-bottom: 1px solid #e8e0d4;
}

.wallet-dropdown-address {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    color: #7c6f64;
    word-break: break-all;
    line-height: 1.4;
    flex: 1;
    min-width: 0;
}

/* Wallet Cards Grid */
.wallet-balances-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.wallet-card {
    display: flex;
    flex-direction: column;
    padding: 10px 14px;
    border-bottom: 1px solid #e8e0d4;
    cursor: pointer;
    transition: background 0.15s;
    position: relative;
}

.wallet-card:hover {
    background: #f0ebe3;
}

.wallet-card.active {
    background: #f0ebe4;
    border-left: 3px solid #5c5048;
    position: relative;
}

.wallet-card.active::after {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 10px;
    font-size: 11px;
    font-weight: 700;
    color: #5c5048;
}

.wallet-card.active:hover {
    background: #e8e0d4;
}

.wallet-card-top {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.wallet-card-icon {
    font-size: 12px;
    line-height: 1;
}

.wallet-card-label {
    font-size: 10px;
    font-weight: 600;
    color: #5c5048;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Phase 1 (May 2026) deposit-wallet badge — shown when the on-chain wallet
   that holds positions is a Polymarket deposit wallet (ERC-1967 proxy)
   instead of a Safe. Rendered next to the "Trading" label. */
.wallet-card[data-wallet-kind="deposit"] .wallet-card-label::after {
    content: "D";
    margin-left: 6px;
    padding: 1px 5px;
    font-size: 8px;
    font-weight: 700;
    color: #fff;
    background: #7fbbb3;
    border-radius: 3px;
    letter-spacing: 0.3px;
}

.wallet-card-addr {
    margin-left: auto;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    color: #a89984;
    text-decoration: underline dotted;
    cursor: pointer;
}

.wallet-card-addr:hover {
    color: #7c6f64;
}

.wallet-card-balance {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 18px;
    font-weight: 600;
    color: #4caf50;
    padding-left: 22px;
}

.wallet-card-balance.wallet-status-msg {
    font-size: 12px;
    font-weight: 500;
    color: #a89984;
    animation: walletStatusPulse 1.5s ease-in-out infinite;
}

@keyframes walletStatusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Actions */
.wallet-dropdown-actions {
    display: flex;
    gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid #e8e0d4;
}

.wallet-action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 0;
    border-radius: 8px;
    border: 1px solid #e8e0d4;
    background: #f0ebe4;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.wallet-action-btn .wallet-action-icon {
    font-size: 13px;
    font-weight: 700;
}

.deposit-action {
    color: #5c5048;
    border-color: #e8e0d4;
}

.deposit-action:hover {
    background: #e8e0d4;
    border-color: #e8e0d4;
}

.withdraw-action {
    color: #5c5048;
    border-color: #e8e0d4;
}

.withdraw-action:hover {
    background: #e8e0d4;
    border-color: #e8e0d4;
}

.polymarket-transfer-action {
    color: #7c6f64;
    border-color: #d4c8bc;
    flex: 1.2;
}

.polymarket-transfer-action:hover {
    background: #e8e0d4;
    border-color: #a89984;
    color: #3c3836;
}

/* Refresh icon in header */
.wallet-refresh-icon {
    background: none;
    border: none;
    color: #a89984;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    line-height: 1;
    transition: all 0.15s;
}
.wallet-refresh-icon:hover {
    color: #3c3836;
    background: #ede6dc;
}

/* Footer */
.wallet-dropdown-footer {
    display: flex;
    border-top: none;
}

.wallet-footer-btn {
    flex: 1;
    padding: 9px 0;
    border: none;
    background: transparent;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    font-weight: 500;
    color: #7c6f64;
    cursor: pointer;
    transition: all 0.15s;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.wallet-footer-btn:hover {
    background: #f0ebe3;
    color: #3c3836;
}

.wallet-export-key {
    position: absolute;
    right: 10px;
    bottom: 8px;
    padding: 2px 8px;
    border: 1px solid #d5c4a1;
    border-radius: 4px;
    background: #fbf1c7;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 9px;
    font-weight: 500;
    color: #7c6f64;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    z-index: 1;
}

.wallet-card:hover .wallet-export-key {
    opacity: 1;
}

.wallet-export-key:hover {
    background: #ebdbb2;
    color: #3c3836;
    border-color: #bdae93;
}

.wallet-footer-btn.wallet-disconnect {
    color: #cc241d;
}

.wallet-footer-btn.wallet-disconnect:hover {
    background: #fbf1f0;
    color: #9d0006;
}

/* No Trading Wallet Prompt */
.no-trading-section {
    padding: 12px 14px;
    border-bottom: 1px solid #e8e0d4;
    background: #faf6f0;
}

.no-trading-title {
    font-size: 12px;
    font-weight: 700;
    color: #3c3836;
    margin-bottom: 8px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.no-trading-icon {
    width: 14px;
    height: 14px;
    fill: #3c3836;
    flex-shrink: 0;
}

.no-trading-benefits {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
}

.benefit-item {
    font-size: 10px;
    color: #5c5048;
    line-height: 1.4;
    padding-left: 2px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.benefit-icon {
    width: 12px;
    height: 12px;
    fill: #8c7e72;
    flex-shrink: 0;
}

.create-trading-btn {
    display: block;
    width: 100%;
    background: #5c5048;
    color: #f5ebe0;
    border: none;
    padding: 8px 14px;
    border-radius: 8px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.create-trading-btn:hover {
    background: #4a3f38;
}

/* Disabled header buttons */
.header-btn.btn-disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* Proxy Wallet Section — legacy compat */
.proxy-wallet-section {
    display: none;
}

.no-proxy-section {
    padding: 10px 14px;
    border-bottom: 1px solid #e8e0d4;
    background: #faf6f0;
    text-align: center;
}

.no-proxy-text {
    font-size: 11px;
    color: #7c6f64;
    margin-bottom: 8px;
}

.create-proxy-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #d65d0e;
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 5px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.create-proxy-btn:hover {
    background: #af3a03;
}

.no-proxy-hint {
    font-size: 9px;
    color: #a89984;
    margin-top: 6px;
}


/* Clickable wallet sections */
.clickable-section {
    cursor: pointer;
    transition: background 0.15s;
}

.clickable-section:hover {
    filter: brightness(0.97);
}

/* Fund Dialog */
.fund-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10002;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fund-dialog {
    background: #faf6f0;
    border-radius: 14px;
    box-shadow: 0 16px 56px rgba(0, 0, 0, 0.28);
    width: 380px;
    max-width: 90vw;
    overflow: hidden;
    animation: dropdownFadeIn 0.2s ease;
    font-family: 'IBM Plex Mono', monospace;
}

.fund-dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: #f9f6f2;
    border-bottom: 1px solid #e8e0d4;
}

.fund-dialog-header h3 {
    margin: 0;
    font-size: 14px;
    color: #3c3836;
}

.fund-dialog-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #a89984;
    line-height: 1;
    padding: 0;
}

.fund-dialog-close:hover {
    color: #e53935;
}

.fund-dialog-body {
    padding: 16px;
}

.fund-dialog-desc {
    font-size: 12px;
    color: #a89984;
    margin: 0 0 14px 0;
}

.fund-source-box,
.fund-dest-box {
    background: #f9f6f2;
    border: 1px solid #e8e0d4;
    border-radius: 8px;
    padding: 10px 12px;
}

.fund-source-box {
    border-color: #e8e0d4;
    background: #f0ebe4;
}

.fund-dest-box {
    border-color: #e8e0d4;
    background: #f0ebe4;
}

/* Dynamic color classes for swap */
.fund-box-green {
    border-color: #e8e0d4 !important;
    background: #f0ebe4 !important;
}

.fund-box-blue {
    border-color: #e8e0d4 !important;
    background: #f0ebe4 !important;
}

.fund-box-label {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #a89984;
    margin-bottom: 4px;
    font-weight: 600;
}

.fund-box-address {
    display: block;
    font-family: monospace;
    font-size: 10px;
    color: #5c5048;
    margin-bottom: 2px;
    word-break: break-all;
}

.fund-box-balance {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: #4caf50;
    margin-top: 4px;
}

.fund-arrow-icon {
    text-align: center;
    font-size: 20px;
    color: #b0a89e;
    padding: 6px 0;
}

.fund-swap-row {
    text-align: center;
    padding: 4px 0;
}

.fund-swap-btn {
    background: #f0ebe4;
    border: 1px solid #e8e0d4;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 18px;
    cursor: pointer;
    color: #5c5048;
    transition: all 0.2s;
    line-height: 1;
}

.fund-swap-btn:hover {
    background: #e8e0d4;
    transform: rotate(180deg);
}

.fund-amount-row {
    margin: 14px 0;
}

.fund-amount-row label {
    display: block;
    font-size: 11px;
    color: #5c5048;
    margin-bottom: 6px;
}

.fund-input-wrap {
    display: flex;
    gap: 6px;
}

.fund-input-wrap input {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #e8e0d4;
    border-radius: 6px;
    font-family: monospace;
    font-size: 14px;
    color: #3c3836;
    background: #fff;
}

.fund-input-wrap input:focus {
    outline: none;
    border-color: #5c5048;
    box-shadow: 0 0 0 2px rgba(92, 80, 72, 0.15);
}

.fund-max-btn {
    background: #e8e0d4;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 10px;
    font-weight: 600;
    color: #5c5048;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fund-max-btn:hover {
    background: #e8e0d4;
}

.fund-transfer-btn {
    display: block;
    width: 100%;
    background: #5c5048;
    color: #f5ebe0;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.fund-transfer-btn:hover:not(:disabled) {
    background: #4a3f38;
    transform: translateY(-1px);
}

.fund-transfer-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.fund-status {
    margin-top: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 11px;
    text-align: center;
}

.fund-status.loading {
    background: #f0ebe4;
    color: #5c5048;
}

.fund-status.success {
    background: rgba(76, 175, 80, 0.1);
    color: #4caf50;
}

.fund-status.error {
    background: rgba(229, 57, 53, 0.1);
    color: #e53935;
}

/* ============ MOBILE OVERLAY ============ */

/* Mobile-only elements hidden on desktop */
.mobile-nav { display: none; }
.mobile-backdrop { display: none; }

.mobile-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #faf6f0;
    z-index: 99999;
    /* Hidden by default (desktop). Shown on small screens / mobile UA via the
       media query below + the body.mobile-gated class (set in index-init.js).
       body.mobile-gate-dismissed hides it again after "Continue anyway". */
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

/* Show on narrow viewports (instant, no JS — prevents any flash of the app). */
@media (max-width: 768px) {
    body:not(.mobile-gate-dismissed) .mobile-overlay { display: flex; }
}
/* Show on UA-detected mobile even when wider than 768px (rare tablets). */
body.mobile-gated:not(.mobile-gate-dismissed) .mobile-overlay { display: flex; }

.mobile-overlay-btn {
    margin-top: 22px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 14px;
    font-weight: 500;
    color: #faf6f0;
    background: #3c3836;
    border: none;
    border-radius: 8px;
    padding: 11px 22px;
    cursor: pointer;
    transition: opacity 0.15s ease;
}
.mobile-overlay-btn:active { opacity: 0.75; }

.mobile-overlay-link {
    color: #b0a89e;
    text-decoration: none;
}
.mobile-overlay-link:active { color: #5c5048; }

.mobile-overlay-content {
    text-align: center;
    max-width: 340px;
}

.mobile-overlay-title {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 24px;
    font-weight: 700;
    color: #3c3836;
    margin: 0 0 16px;
    letter-spacing: -0.5px;
}

.mobile-overlay-text {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 15px;
    color: #5c5048;
    line-height: 1.6;
    margin: 0 0 10px;
}

.mobile-overlay-sub {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    color: #b0a89e;
    line-height: 1.5;
    margin: 0;
}

/* Bridge Dialog styles → styles-bridge.css (#19a) */
/* ── Portfolio batch filter (reuses .cart-filter-bar / .cf-* classes) ── */
.pf-batch-bar {
    margin: 0;
    border-radius: 0;
    border-bottom: 1px solid #ebe4d8;
    border-top: none;
    padding: 8px 14px;
    flex-wrap: wrap;
    gap: 6px;
}
.pf-batch-bar .cf-mode-pills {
    flex-shrink: 0;
}
.pf-batch-bar .cf-slider-group {
    flex-basis: 100%;
    order: 10;
}
.pf-pills .cf-pill {
    font-size: 10px;
    padding: 3px 6px;
}
.pf-input {
    width: 40px;
}
.pf-sell {
    background: #e67e80;
    margin-left: auto;
}
.pf-sell:hover { background: #d96c6f; }

/* Highlight matching rows */
.cport-row.cport-row-match {
    background: #fef2f2;
    border-left: 3px solid #e67e80;
}

/* Cart items that will be dropped by payout filter */
.cart-item.cart-item-drop {
    background: #fef2f2;
    border-left: 3px solid #e67e80;
    opacity: 0.75;
}







/* Cancel button */
/* Trade action buttons in positions */

/* Position market question as link */


/* Cancel All button */

/* Resolved tab – compact style */





.cport-claim-row-btn.redeemed {
    background: rgba(106,154,58,0.18);
    color: #4a7a2a;
    cursor: default;
}
.cport-claim-row-btn.redeem-failed {
    background: rgba(229,57,53,0.15);
    color: #e53935;
    animation: redeem-fail-pulse 1s ease-in-out 2;
}
@keyframes redeem-fail-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Redeem button spinner */
.btn-spinner {
    display: inline-block;
    width: 10px;
    height: 10px;
    border: 2px solid rgba(92,80,72,0.2);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: cportSpin 0.6s linear infinite;
    vertical-align: middle;
}

/* Row pulsing while redeeming */
.cport-row-resolved.redeeming {
    animation: redeemPulse 1.2s ease-in-out infinite;
}
@keyframes redeemPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}

/* Row fade-out after successful redeem */
.cport-row-resolved.redeemed-fadeout {
    animation: redeemFadeOut 0.6s ease-out forwards;
}
@keyframes redeemFadeOut {
    0%   { opacity: 1; transform: translateX(0); max-height: 80px; }
    70%  { opacity: 0; transform: translateX(30px); max-height: 80px; }
    100% { opacity: 0; transform: translateX(30px); max-height: 0; padding: 0 14px; margin: 0; overflow: hidden; }
}

/* Mobile responsive */

/* Connection Status - bottom left */
.status {
    position: fixed;
    bottom: 12px;
    left: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 9px;
    text-transform: uppercase;
    background: #faf6f0;
    padding: 4px 8px;
    border-radius: 8px;
    border: 1px solid #e8e0d4;
    z-index: 100;
    cursor: default;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
.status.connected { color: #a7c080; }
.status.connected::before { background: #a7c080; }
.status.disconnected { color: #e67e80; }
.status.disconnected::before { background: #e67e80; }

/* Status bar alert states */
.status.status-alert {
    color: #fff;
    background: #e67e80;
    border-color: #cc241d;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    animation: statusPulse 1.5s ease-in-out infinite;
    z-index: 200;
}
.status.status-alert::before { background: #fff; animation: none; }

.status.status-update {
    color: #3c3836;
    background: #faf6f0;
    border-color: #e8e0d4;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.3px;
    cursor: pointer;
    animation: greenGlow 2s ease-in-out infinite;
    z-index: 200;
    border-radius: 8px;
    padding: 3px 8px;
    gap: 4px;
}
.status.status-update::before { background: #4caf50; animation: pulse 1.5s infinite; width: 5px; height: 5px; }
.status.status-update:hover { background: #f0ebe4; transform: scale(1.02); animation: none; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }

@keyframes greenGlow {
    0%, 100% { box-shadow: 0 0 4px rgba(76, 175, 80, 0.15); }
    50% { box-shadow: 0 0 14px rgba(76, 175, 80, 0.45), 0 0 4px rgba(76, 175, 80, 0.2); }
}

@keyframes statusPulse {
    0%, 100% { box-shadow: 0 0 4px rgba(230, 126, 128, 0.3); }
    50% { box-shadow: 0 0 12px rgba(230, 126, 128, 0.7); }
}

/* Data Update Pill (header inline) */
.update-pill {
    display: none;
    align-items: center;
    gap: 4px;
    background: #5c5048;
    color: #f5ebe0;
    border: none;
    padding: 0 12px;
    height: 26px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'IBM Plex Mono', monospace;
    letter-spacing: 0.3px;
    white-space: nowrap;
    animation: pillFadeIn 0.4s ease-out;
    transition: background 0.15s, transform 0.15s, opacity 0.3s;
    margin-left: 4px;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}
.update-pill:hover {
    background: #4a3f38;
    transform: scale(1.05);
}
.update-pill:active {
    transform: scale(0.97);
}
.update-pill.pill-fade-out {
    opacity: 0;
    transform: scale(0.85);
}
@keyframes pillFadeIn {
    from { opacity: 0; transform: scale(0.85); }
    to { opacity: 1; transform: scale(1); }
}

#cy {
    width: 100%;
    height: calc(100vh - 37px);
    cursor: default;
}

#cy:active {
    cursor: grabbing;
}

/* Filters Panel */
.filters-panel {
    position: absolute;
    top: 50px;
    left: 12px;
    background: #faf6f0;
    border: 1px solid #e8e0d4;
    border-radius: 14px;
    width: 280px;
    font-size: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(0,0,0,0.10);
    font-family: 'IBM Plex Mono', monospace;
}

/* Disabled state for exploration mode */
.filters-panel.disabled {
    opacity: 0.5;
}

.filters-panel.disabled .filters-content {
    pointer-events: none;
    filter: grayscale(0.5);
}

.filters-panel.disabled .filters-header {
    cursor: not-allowed;
}

.filters-panel.disabled input,
.filters-panel.disabled select,
.filters-panel.disabled button {
    pointer-events: none;
    cursor: not-allowed;
}

.filters-panel.collapsed {
    width: 26px;
    background: #5c5048;
    border-color: #4a3f38;
    border-radius: 10px;
}

.filters-panel.collapsed .filters-content {
    display: none;
}

.filters-panel.collapsed .filters-header {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    padding: 8px 0;
    justify-content: center;
    align-items: center;
    gap: 4px;
    border-bottom: none;
    width: 100%;
    box-sizing: border-box;
}

.filters-panel.collapsed .filters-header span:first-child {
    display: block;
    color: #f5ebe0;
    font-size: 8px;
    letter-spacing: 0.8px;
}

.filters-panel.collapsed .toggle-icon {
    transform: rotate(90deg);
    color: #f5ebe0;
    font-size: 8px;
}

.filters-panel.collapsed .filters-header:hover {
    background: rgba(255,255,255,0.08);
}

.filters-header {
    background: transparent;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid #e8e0d4;
}

.filters-header:hover {
    background: #f0ebe4;
}

.filters-header span {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 10px;
    color: #3c3836;
}

.filter-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 15px;
    height: 15px;
    padding: 0 4px;
    border-radius: 8px;
    background: #e53935;
    color: #fff !important;
    font-size: 9px;
    font-weight: 700;
    font-family: 'IBM Plex Mono', monospace;
    margin-left: 5px;
    line-height: 1;
}

/* Badge faces user when panel is collapsed (vertical header) */
.filters-panel.collapsed .filter-count-badge {
    writing-mode: horizontal-tb;
    text-orientation: initial;
    margin-left: 0;
    margin-top: 4px;
}

/* Hide badge when panel is open — filters are visible directly */
.filters-panel:not(.collapsed) .filter-count-badge {
    display: none !important;
}

.toggle-icon {
    font-size: 12px;
    transition: transform 0.3s;
}

.filters-panel.collapsed .toggle-icon {
    transform: rotate(180deg);
}

.filters-content {
    padding: 14px 16px;
    max-height: calc(100vh - 150px);
    overflow-y: auto;
}

.filter-section {
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e8e0d4;
}

.filter-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.section-title {
    font-size: 10px;
    font-weight: 600;
    color: #a89984;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

/* Filter Tabs */
.filter-tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 3px;
    margin-bottom: 12px;
}

.filter-tab {
    flex: 1 1 0;
    min-width: 0;
    padding: 5px 4px;
    border: none;
    background: #f0ebe4;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'IBM Plex Mono', monospace;
    color: #7c6f64;
    transition: all 0.2s;
    white-space: nowrap;
    text-align: center;
}

.filter-tab:hover {
    background: #e5dcc8;
}

.filter-tab.active {
    background: #5c5048;
    color: #f5ebe0;
    border-color: #5c5048;
}

/* Filter tab content visibility */
.filter-tab-content {
    display: none;
}

.filter-tab-content.active {
    display: block;
}

/* Tab content styling */
.filter-tab-content .section-title {
    font-size: 10px;
    font-weight: 600;
    color: #a89984;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

/* Sort group in Simple tab */
.sort-group {
    gap: 2px;
}

.sort-group .btn {
    flex: 1;
    padding: 3px 4px;
    font-size: 8px;
}

.btn.small {
    padding: 3px 4px;
    font-size: 8px;
}

.filter-row {
    margin-bottom: 4px;
}

.filter-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1px;
    color: #a89984;
}

.filter-value {
    color: #5c5048;
    font-weight: 500;
}

input[type="range"] {
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: #e8e0d4;
    border-radius: 2px;
    outline: none;
}

/* Range slider with two thumbs - single track */
.range-slider {
    position: relative;
    height: 28px;
    margin-top: 5px;
    display: flex;
    flex-direction: column;
}

.range-slider input[type="range"] {
    position: absolute;
    width: 100%;
    height: 4px;
    top: 0;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    pointer-events: none;
    z-index: 3;
}

.range-slider input[type="range"]::-webkit-slider-runnable-track {
    height: 4px;
    background: transparent;
}

.range-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: #a89984;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    pointer-events: all;
    position: relative;
    margin-top: -4px;
    z-index: 4;
}

.range-slider input[type="range"]::-webkit-slider-thumb:hover {
    background: #5c5048;
}

.range-slider-track {
    position: absolute;
    width: 100%;
    height: 4px;
    top: 0;
    background: #e67e80;
    border-radius: 2px;
    z-index: 1;
}

.range-slider-fill {
    position: absolute;
    height: 4px;
    top: 0;
    left: 0;
    width: 100%;
    background: #a7c080;
    border-radius: 2px;
    z-index: 2;
}

.range-values {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    pointer-events: none;
}

.range-values span {
    font-size: 9px;
    color: #a89984;
    white-space: nowrap;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: #a89984;
    border-radius: 50%;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb:hover {
    background: #5c5048;
}

.btn-group {
    display: flex;
    gap: 4px;
}

.btn-group.tags-group {
    flex-wrap: wrap;
}

/* ===== BULK SEARCH ===== */

.bulk-search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(40, 35, 30, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'IBM Plex Mono', monospace;
    animation: fadeIn 0.15s ease;
}
.bulk-search-panel {
    background: #faf6f0;
    border: 1px solid #e8e0d4;
    border-radius: 14px;
    width: 460px;
    max-width: 95vw;
    max-height: 85vh;
    padding: 14px 18px 16px;
    box-shadow: 0 20px 60px rgba(40, 35, 30, 0.18);
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.bulk-search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.bulk-search-title {
    font-size: 13px;
    font-weight: 600;
    color: #5c5048;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}
.bulk-search-close {
    background: none;
    border: none;
    font-size: 22px;
    color: #a89984;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}
.bulk-search-close:hover { color: #5c5048; }
.bulk-search-help {
    color: #7c6f64;
    font-size: 11px;
    line-height: 1.5;
}
.bulk-search-help code {
    background: #f0ebe4;
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 10px;
    color: #5c5048;
}
.bulk-search-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 0;
    max-height: 140px;
    overflow-y: auto;
}
.bulk-search-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 4px 4px 10px;
    background: #f5ebe0;
    border: 1px solid #e8e0d4;
    border-radius: 14px;
    font-size: 11px;
    color: #5c5048;
    max-width: 100%;
}
.bulk-search-chip-type {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    background: #5c5048;
    color: #f5ebe0;
}
.bulk-search-chip-type.trader { background: #7fbbb3; }
.bulk-search-chip-type.market { background: #a7c080; color: #2d353b; }
.bulk-search-chip-type.token  { background: #d4a46a; color: #2d353b; }
.bulk-search-chip-label {
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.bulk-search-chip-remove {
    border: none;
    background: transparent;
    color: #a89984;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0 4px;
    border-radius: 50%;
    transition: color 0.15s, background 0.15s;
}
.bulk-search-chip-remove:hover {
    color: #e67e80;
    background: rgba(230, 126, 128, 0.12);
}
.bulk-search-input-wrap {
    position: relative;
}
.bulk-search-input {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 12px;
    border: 1px solid #e8e0d4;
    border-radius: 8px;
    background: #faf7f2;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    color: #3c3836;
    outline: none;
    transition: border-color 0.15s;
}
.bulk-search-input::placeholder { color: #a89984; }
.bulk-search-input:focus { border-color: #5c5048; }
.bulk-search-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 260px;
    overflow-y: auto;
    background: #faf6f0;
    border: 1px solid #e8e0d4;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(40, 35, 30, 0.14);
    z-index: 1;
}
.bulk-search-suggestion {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0ebe4;
    font-size: 12px;
    color: #3c3836;
}
.bulk-search-suggestion:last-child { border-bottom: none; }
.bulk-search-suggestion:hover { background: #f5ebe0; }
.bulk-search-suggestion-type {
    flex-shrink: 0;
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    background: #5c5048;
    color: #f5ebe0;
}
.bulk-search-suggestion-type.trader { background: #7fbbb3; }
.bulk-search-suggestion-type.market { background: #a7c080; color: #2d353b; }
.bulk-search-suggestion-type.token  { background: #d4a46a; color: #2d353b; }
.bulk-search-suggestion-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.bulk-search-suggestion-sub {
    font-size: 10px;
    color: #a89984;
    flex-shrink: 0;
}
.bulk-search-dropdown-empty {
    padding: 14px;
    text-align: center;
    font-size: 11px;
    color: #a89984;
}
.bulk-search-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}
.bulk-search-btn {
    padding: 8px 18px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.4px;
    transition: background 0.15s;
}
.bulk-search-btn-cancel { background: #f0ebe4; color: #5c5048; }
.bulk-search-btn-cancel:hover { background: #e8e0d4; }
.bulk-search-btn-primary { background: #5c5048; color: #f5ebe0; text-transform: uppercase; }
.bulk-search-btn-primary:hover { background: #7a6e64; }
.bulk-search-btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== TAG PICKER ===== */

.tag-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.tag-expand-btn {
    margin-top: 4px;
    font-size: 9px;
    color: #a89984;
    cursor: pointer;
    text-align: center;
    padding: 2px 0;
    transition: color 0.15s;
}

.tag-expand-btn:hover {
    color: #5c5048;
}

.tag-picker-dropdown {
    margin-top: 4px;
    border: 1px solid #e8e0d4;
    border-radius: 4px;
    background: #faf6f0;
    max-height: 260px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.tag-search-input {
    width: 100%;
    box-sizing: border-box;
    padding: 5px 8px;
    border: none;
    border-bottom: 1px solid #e8e0d4;
    background: #faf6f0;
    font-size: 10px;
    font-family: inherit;
    color: #5c5048;
    outline: none;
}

.tag-search-input::placeholder {
    color: #b0a090;
}

.tag-picker-list {
    overflow-y: auto;
    padding: 4px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-content: flex-start;
    max-height: 220px;
}

.btn.tag-btn {
    flex: 0 0 auto;
    font-size: 9px;
    padding: 3px 8px;
    border-radius: 12px;
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn.tag-btn .tag-name {
    white-space: nowrap;
}

.btn.tag-btn .tag-count {
    font-size: 8px;
    opacity: 0.6;
}

.btn.tag-btn mark {
    background: #ffe066;
    color: inherit;
    padding: 0;
    border-radius: 1px;
}

.btn.tag-btn.active {
    background: var(--tag-color, #a89984);
    border-color: var(--tag-color, #a89984);
    color: #fff;
}

.btn.tag-btn.active .tag-count {
    opacity: 0.8;
}

.btn.tag-btn.active mark {
    background: rgba(255,255,255,0.3);
}

.btn.tag-btn.excluded {
    background: rgba(180, 60, 60, 0.15);
    border-color: #b43c3c;
    color: #b43c3c;
    text-decoration: line-through;
}

.btn.tag-btn.excluded .tag-count {
    opacity: 0.5;
}

.btn {
    flex: 1;
    padding: 5px 6px;
    border: 1px solid #e8e0d4;
    background: #faf6f0;
    border-radius: 3px;
    font-size: 9px;
    cursor: pointer;
    font-family: inherit;
    color: #5c5048;
    transition: all 0.2s;
}

.btn:hover {
    background: #e5dcc8;
}

.btn.active {
    background: #5c5048;
    color: #fff;
    border-color: #5c5048;
}

.filter-buttons {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding: 8px 0 0 0;
    border-top: 1px solid #e8e0d4;
}

.filter-buttons .btn {
    flex: 1;
    padding: 8px 12px;
    font-size: 10px;
    font-weight: 600;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.apply-btn {
    background: #5c5048 !important;
    color: #f5ebe0 !important;
    border-color: #5c5048 !important;
}

.apply-btn:hover:not(:disabled) {
    background: #4a3f38 !important;
}

.apply-btn:disabled {
    background: #9a8e84 !important;
    border-color: #9a8e84 !important;
    cursor: not-allowed;
    opacity: 0.6;
}

.reset-btn {
    background: #f0ebe4 !important;
    border-color: #e8e0d4 !important;
    color: #7c6f64 !important;
}

.reset-btn:hover:not(:disabled) {
    background: #e8e0d4 !important;
}

.reset-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Node Panel */
.node-panel {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: #faf6f0;
    border: 1px solid #e8e0d4;
    border-radius: 14px;
    padding: 14px 16px;
    width: 280px;
    display: none;
    overflow: visible;
    box-shadow: 0 8px 32px rgba(0,0,0,0.10);
    font-family: 'IBM Plex Mono', monospace;
}

.node-panel-close {
    position: absolute;
    top: 2px;
    right: 3px;
    width: auto;
    height: auto;
    background: none;
    border: none;
    border-radius: 0;
    font-size: 13px;
    line-height: 1;
    text-align: center;
    color: #b0a89e;
    cursor: pointer;
    padding: 0;
    z-index: 2;
    box-shadow: none;
}

.node-panel-close:hover {
    color: #5c5048;
}

.node-panel.visible { display: block; }

/* Timeframe buttons */
.timeframe-buttons {
    display: flex;
    gap: 4px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e8e0d4;
}

.tf-btn {
    flex: 1;
    padding: 4px 8px;
    border: none;
    border-radius: 6px;
    background: #f0ebe4;
    color: #7c6f64;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: 'IBM Plex Mono', monospace;
}

.tf-btn:hover {
    background: #e5dcc8;
}

.tf-btn.active {
    background: #5c5048;
    color: #f5ebe0;
    border-color: #5c5048;
}

.node-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    gap: 8px;
}

.node-header-text {
    flex: 1;
    min-width: 0;
}

.node-search-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid #d4cabb;
    border-radius: 8px;
    background: #f5ebe0;
    color: #5c5048;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.node-search-icon:hover {
    background: #7fbbb3;
    border-color: #7fbbb3;
    color: #ffffff;
}

.node-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e5a84b;
    margin-right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #fff;
    font-size: 10px;
}

.node-title { font-weight: 500; }
.node-subtitle { font-size: 9px; color: #a89984; }

.node-address {
    font-size: 8px;
    color: #7c6f64;
    background: #f0ebe4;
    padding: 6px 8px;
    border-radius: 6px;
    margin: 8px 0;
    word-break: break-all;
    cursor: pointer;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
}

.info-label { color: #a89984; font-size: 10px; }
.info-value { color: #3c3836; font-weight: 600; font-size: 10px; }

/* Leaderboard Panel */
.leaderboard-panel {
    position: absolute;
    top: 50px;
    right: 12px;
    background: #faf6f0;
    border: 1px solid #e8e0d4;
    border-radius: 14px;
    /* Widened 260→300 so the Buy/Sell button pair on token rows lines up
       gracefully next to the name+stats column instead of clipping. */
    width: 300px;
    font-size: 10px;
    max-height: calc(100vh - 100px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(0,0,0,0.10);
    font-family: 'IBM Plex Mono', monospace;
}

.leaderboard-panel.collapsed {
    width: 26px;
    background: #5c5048;
    border-color: #4a3f38;
    border-radius: 10px;
}

.leaderboard-panel.collapsed .leaderboard-body {
    display: none;
}

.leaderboard-panel.collapsed .leaderboard-toggle {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    padding: 8px 0;
    justify-content: center;
    align-items: center;
    gap: 4px;
    border-bottom: none;
    width: 100%;
    box-sizing: border-box;
}

.leaderboard-panel.collapsed .leaderboard-toggle span:first-child {
    display: block;
    color: #f5ebe0;
    font-size: 8px;
    letter-spacing: 0.8px;
}

.leaderboard-panel.collapsed .toggle-icon {
    transform: none;
    color: #f5ebe0;
    font-size: 8px;
}

.leaderboard-panel.collapsed .leaderboard-toggle:hover {
    background: rgba(255,255,255,0.08);
}

.leaderboard-toggle {
    background: transparent;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid #e8e0d4;
}

.leaderboard-toggle:hover {
    background: #f0ebe4;
}

.leaderboard-toggle span {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 10px;
    color: #3c3836;
}

.leaderboard-toggle .toggle-icon {
    font-size: 12px;
    transition: transform 0.3s;
    transform: rotate(180deg);
}

.leaderboard-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.leaderboard-tabs {
    display: flex;
    gap: 4px;
    padding: 8px 12px;
    background: transparent;
    border-bottom: 1px solid #e8e0d4;
}

.tab-btn {
    flex: 1;
    padding: 5px 6px;
    border: none;
    background: #f0ebe4;
    border-radius: 6px;
    font-size: 10px;
    cursor: pointer;
    font-family: 'IBM Plex Mono', monospace;
    color: #7c6f64;
    font-weight: 600;
    transition: all 0.2s;
}

.tab-btn:hover {
    background: #e5dcc8;
}

.tab-btn.active {
    background: #5c5048;
    color: #f5ebe0;
    border-color: #5c5048;
}

.leaderboard-content {
    padding: 8px 12px;
    overflow-y: auto;
    max-height: 300px;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    padding: 8px;
    margin-bottom: 4px;
    background: #f0ebe4;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.leaderboard-item:hover {
    background: #e8e0d4;
}

.leaderboard-item.skeleton {
    height: 44px;
    background: linear-gradient(90deg, #faf6f0 25%, #e5dcc8 50%, #faf6f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.leaderboard-rank {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #e8e0d4;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 9px;
    color: #5c5048;
    margin-right: 8px;
    flex-shrink: 0;
}

.leaderboard-rank.gold { background: #e5a84b; color: #fff; }
.leaderboard-rank.silver { background: #a8a8a8; color: #fff; }
.leaderboard-rank.bronze { background: #cd7f32; color: #fff; }

.leaderboard-info {
    flex: 1;
    min-width: 0;
}

.leaderboard-name {
    font-weight: 500;
    color: #5c5048;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 9px;
}

.leaderboard-stats {
    display: flex;
    gap: 8px;
    font-size: 8px;
    color: #a89984;
    margin-top: 2px;
}

.leaderboard-stats .value {
    color: #5c5048;
    font-weight: 500;
}

.leaderboard-volume {
    text-align: right;
    flex-shrink: 0;
    margin-left: 8px;
}

.leaderboard-volume .amount {
    font-weight: 600;
    color: #5c5048;
    font-size: 10px;
}

.leaderboard-volume .label {
    font-size: 7px;
    color: #a89984;
    text-transform: uppercase;
}

/* Leaderboard Buy/Sell buttons for tokens */
.leaderboard-actions {
    display: flex;
    gap: 4px;
    margin-left: 8px;
    flex-shrink: 0;
}

.lb-trade-btn {
    padding: 4px 8px;
    font-size: 10px;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.lb-trade-btn.buy {
    background: #a7c080;
    color: #2d353b;
}

.lb-trade-btn.buy:hover {
    background: #8fb573;
}

.lb-trade-btn.sell {
    background: #e67e80;
    color: #2d353b;
}

.lb-trade-btn.sell:hover {
    background: #d4686a;
}

.lb-pm-btn {
    padding: 3px;
    border: 1px solid #d4c4b0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    background: #faf6f0;
    text-decoration: none;
    line-height: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.lb-pm-btn:hover {
    background: #eee2d0;
    border-color: #a89984;
}

.lb-pm-icon {
    width: 16px;
    height: 16px;
    display: block;
}

/* Minimap */
#minimap-container {
    position: absolute;
    right: 12px;
    bottom: 12px;
    width: 150px;
    height: 150px;
    background: #faf6f0;
    border: none;
    border-radius: 10px;
    overflow: hidden;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.10);
}

#minimap {
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#minimap-viewport {
    position: absolute;
    border: 1.5px solid rgba(92, 80, 72, 0.35);
    background: rgba(92, 80, 72, 0.06);
    border-radius: 8px;
    pointer-events: none;
}

/* Performance: GPU-accelerated hiding for faster toggle */
.fast-hidden {
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Optimized transitions for exploration mode */
.node, .edge {
    will-change: opacity, visibility;
}

.hidden-explore {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: none !important; /* Instant hide for performance */
}

/* Remove transitions during exploration for speed */
.exploration-mode .node,
.exploration-mode .edge {
    transition: none !important;
}

/* In search/exploration mode the Simple tab is irrelevant (top-N caps and
   timeframe are applied locally to the seed set, not refetched). Hide it so
   users don't try to dial in topN and get confused. */
body.exploration-active .filter-tab[data-filter-tab="simple"],
body.exploration-active #simpleFilters {
    display: none !important;
}

/* =============================================================================
   PERFORMANCE OPTIMIZATIONS - LOD SYSTEM
   ============================================================================= */

/* FPS Indicator */
.fps-indicator {
    position: fixed;
    top: 50px;
    right: 12px;
    background: rgba(45, 53, 59, 0.85);
    color: #a7c080;
    padding: 6px 12px;
    border-radius: 4px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    z-index: 1000;
    border: 1px solid rgba(167, 192, 128, 0.3);
}

.fps-indicator.warning {
    color: #e5a84b;
    border-color: rgba(229, 168, 75, 0.3);
}

.fps-indicator.critical {
    color: #e67e80;
    border-color: rgba(230, 126, 128, 0.3);
    animation: fps-pulse 1s infinite;
}

@keyframes fps-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* LOD Classes - hide elements at low zoom */
.lod-hidden {
    display: none !important;
}

/* Cytoscape-specific classes (no-label, simplified, cluster-node) 
   are defined in JavaScript, not CSS */

.clustered {
    display: none !important;
}

/* Cluster button style */
#clusterBtn {
    background: #faf6f0;
    border: 1px solid #e8e0d4;
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 10px;
    transition: all 0.2s;
}

#clusterBtn:hover {
    background: #e5dcc8;
}

#clusterBtn.active {
    background: #ff9800;
    color: white;
    border-color: #f57c00;
}

/* ============ Trade Buttons ============ */
.trade-buttons {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e8e0d4;
}

.market-closed-message {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 12px;
    padding: 10px;
    background: #5c5048;
    border-radius: 4px;
    color: #e8e0d4;
    font-size: 12px;
    font-weight: 500;
}

.trade-btn {
    flex: 1;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    text-transform: capitalize;
}

.trade-btn.buy-btn {
    background: #a7c080;
    color: #2d353b;
}

.trade-btn.buy-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.trade-btn.sell-btn {
    background: #e67e80;
    color: #2d353b;
}

.trade-btn.sell-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

/* Cart "+" button — square, sits next to Buy/Sell in the token panel and
   each market-token row. Stays compact so Buy/Sell get the visual weight. */
.trade-buttons > .trade-btn.cart-btn,
.market-token-actions > .trade-btn.cart-btn {
    flex: 0 0 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f0ebe4;
    color: #5c5048;
    border: 1px solid #d4cabb;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.trade-buttons > .trade-btn.cart-btn:hover,
.market-token-actions > .trade-btn.cart-btn:hover {
    background: #7fbbb3;
    color: #ffffff;
    border-color: #7fbbb3;
}

/* Brief green flash after addToCart — class-based so the SVG stays put. */
.trade-buttons > .trade-btn.cart-btn.cart-added,
.market-token-actions > .trade-btn.cart-btn.cart-added {
    background: #a7c080;
    color: #ffffff;
    border-color: #a7c080;
}

/* ============ Floating Cart Popup ============ */
/* PnL toggle in info panel */
.pnl-toggle { display:flex; gap:2px; background:#1a1a2e; border-radius:4px; padding:1px; }
.pnl-toggle-btn { background:transparent; border:none; color:#7c6f64; font-size:10px; padding:2px 7px; border-radius:3px; cursor:pointer; font-weight:600; transition:all .15s; }
.pnl-toggle-btn.active { background:#3a3a5e; color:#e8d4b0; }
.pnl-toggle-btn:hover { color:#e8d4b0; }
.pnl-period-tabs { display:flex; gap:2px; margin-top:2px; }
.pnl-period-btn { background:transparent; border:none; color:#7c6f64; font-size:10px; padding:2px 6px; border-radius:3px; cursor:pointer; font-weight:500; transition:all .15s; }
.pnl-period-btn.active { background:#3a3a5e; color:#e8d4b0; }
.pnl-period-btn:hover { color:#e8d4b0; }

.floating-cart-popup {
    position: fixed;
    z-index: 5000;
    pointer-events: auto;
    animation: floatingCartIn 0.15s ease-out;
}

@keyframes floatingCartIn {
    from { opacity: 0; transform: scale(0.8) translateX(-4px); }
    to { opacity: 1; transform: scale(1) translateX(0); }
}

.floating-cart-btn {
    padding: 4px 10px;
    background: #5c5048;
    color: #e8e0d4;
    border: 1px solid rgba(92, 80, 72, 0.4);
    border-radius: 4px;
    font-family: inherit;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: all 0.12s ease;
}

.floating-cart-btn:hover {
    filter: brightness(1.15);
    transform: scale(1.05);
}

/* Trade Modal styles → styles-trade.css (#19b) */
/* ============ Responsive ============ */

/* Tablets & small laptops */
@media (max-width: 1024px) {
    .stats { gap: 12px; }
    .stat-item { gap: 2px; }
    .leaderboard-panel { width: 260px; }
    .node-panel { width: 260px; }
    .filters-panel { width: 260px; }
}

/* Phones landscape & small tablets */
@media (max-width: 768px) {
    .header {
        flex-wrap: wrap;
        gap: 6px;
        padding: 6px 10px;
    }
    .title { font-size: 11px; }
    .title img { width: 22px !important; height: 22px !important; }
    .stats {
        order: 3;
        width: 100%;
        justify-content: center;
        gap: 8px;
        font-size: 9px;
        /* no divider line above the stats on mobile */
    }
    .physics-controls { gap: 4px; }
    .header-btn { padding: 4px 7px; font-size: 9px; }

    .filters-panel {
        width: 240px;
        left: 8px;
        top: 80px;
    }
    .leaderboard-panel {
        width: 200px;
        right: 8px;
        top: 80px;
        max-height: calc(100vh - 120px);
    }
    .node-panel {
        width: 240px;
        left: 8px;
        bottom: 8px;
    }
    .trade-modal-content {
        width: 95vw;
    }
    .trade-modal-body {
        flex-direction: column;
    }
    .trade-col-left {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e8e0d4;
        max-height: 220px;
    }
    .orderbook-container {
        border-radius: 0;
        min-height: 120px;
    }
}

/* Phones portrait */
@media (max-width: 480px) {
    .header {
        padding: 5px 8px;
        gap: 4px;
    }
    .title { font-size: 10px; letter-spacing: 0.5px; }
    .title img { width: 20px !important; height: 20px !important; margin-right: 4px !important; }

    /* Keep stats on ONE line inside the fixed 36px header. flex-wrap:wrap here
       pushed Volume onto a 2nd row on ~393px phones (iPhone 15 Pro), spilling
       over the header onto the graph. Nowrap + drop the two least-useful stats
       (Edges, Trades) so Nodes + Volume always fit cleanly. */
    .stats { font-size: 10px; gap: 8px; flex-wrap: nowrap; justify-content: flex-end; overflow: hidden; }
    .stat-label {
        display: inline;
        font-size: 9px;
        opacity: 0.7;
    }
    .stat-item { gap: 3px; white-space: nowrap; }
    /* Visible order after the 768px block hides Timeframe+FPS:
       Nodes(2) Edges(3) Trades(4) Volume(5). Hide Edges + Trades. */
    .stat-item:nth-child(3),
    .stat-item:nth-child(4) { display: none !important; }

    .physics-controls { gap: 3px; }
    .header-btn {
        padding: 3px 6px;
        font-size: 8px;
    }
    /* Physics button — icon only */
    .header-btn.physics-btn {
        padding: 3px 5px;
        font-size: 0;
    }
    .header-btn.physics-btn::after {
        content: 'P';
        font-size: 10px;
    }
    /* Search button — compact */
    .header-btn.search-btn {
        padding: 3px 5px;
        font-size: 0;
    }
    .header-btn.search-btn::after {
        content: 'S';
        font-size: 10px;
    }
    /* Wallet button: show only icon, hide text */
    .wallet-btn {
        padding: 3px 6px !important;
        font-size: 8px !important;
    }
    .wallet-btn .wallet-icon {
        font-size: 10px;
    }
    .wallet-btn span:not(.wallet-icon):not(.wallet-dot):not(.wallet-address) {
        display: none;
    }
    .wallet-btn.connected .wallet-address {
        display: inline;
        font-size: 8px;
        max-width: 60px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .filters-panel {
        left: 4px;
        width: auto;
        top: 75px;
        bottom: auto;
        right: auto;
        max-width: 280px;
        max-height: calc(100vh - 90px);
        z-index: 200;
    }
    .filters-panel.collapsed {
        top: 75px;
        bottom: auto;
        left: 4px;
        width: 26px;
    }
    .leaderboard-panel {
        right: 4px;
        width: auto;
        top: 75px;
        bottom: auto;
        left: auto;
        max-width: 280px;
        max-height: calc(100vh - 90px);
        z-index: 200;
    }
    .leaderboard-panel.collapsed {
        width: 26px;
        left: auto;
        right: 4px;
        top: 75px;
        bottom: auto;
    }
    .node-panel {
        left: 4px;
        right: auto;
        width: calc(50vw - 8px);
        bottom: 4px;
        max-height: 45vh;
        overflow-y: auto;
        padding: 6px 8px;
        font-size: 9px;
        z-index: 150;
    }
    /* Minimap stays visible in bottom-right */
    #minimap-container {
        width: 100px;
        height: 100px;
        right: 4px;
        bottom: 4px;
        z-index: 100;
    }
    .node-panel .timeframe-buttons {
        gap: 2px;
        margin-bottom: 4px;
    }
    .node-panel .tf-btn {
        padding: 2px 6px;
        font-size: 8px;
    }
    .node-panel .node-header {
        margin-bottom: 4px;
    }
    .node-panel .node-icon {
        width: 20px;
        height: 20px;
        font-size: 8px;
        margin-right: 6px;
    }
    .node-panel .node-title { font-size: 9px; }
    .node-panel .node-subtitle { font-size: 7px; }
    .node-panel .node-address {
        padding: 2px 4px;
        margin: 3px 0;
        font-size: 6px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .node-panel .info-row {
        padding: 1px 0;
        font-size: 8px;
    }
    .node-panel #nodeLinkRow a {
        font-size: 7px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: block;
    }
    .trade-modal-content {
        width: 100vw;
        max-width: 100vw;
        border-radius: 10px 10px 0 0;
        max-height: 85vh;
    }
    .trade-modal {
        align-items: flex-end;
    }

    /* Bulk search */
    .bulk-search-panel {
        width: calc(100vw - 16px) !important;
        left: 8px !important;
        right: 8px !important;
    }
}

/* Large screens */
@media (min-width: 1600px) {
    .header { padding: 10px 24px; }
    .stats { gap: 24px; font-size: 11px; }
    .header-btn { font-size: 11px; padding: 6px 12px; }
    .filters-panel { width: 320px; }
    .leaderboard-panel { width: 300px; }
    .node-panel { width: 320px; }
}

/* Ultra-wide */
@media (min-width: 2400px) {
    .header { padding: 12px 32px; }
    .title { font-size: 14px; }
    .stats { gap: 28px; font-size: 12px; }
    .header-btn { font-size: 12px; padding: 7px 14px; }
    .filters-panel { width: 360px; }
    .leaderboard-panel { width: 340px; }
    .node-panel { width: 360px; }
}

/* Trade Cart styles → styles-cart.css (#19c) */
/* Onboarding Tutorial styles → styles-onboarding.css (#19d) */
/* ============================================================================
   MOBILE LAYOUT (≤768px)
   Limited version: filters, info panels, top-by-filters, onboarding.
   No wallet, no search, no minimap.
   ============================================================================ */

@media (max-width: 768px) {

    /* ---- Body & global ---- */
    body {
        overflow-x: hidden;
        font-size: 12px;
    }

    body.mobile-filters-open,
    body.mobile-leaderboard-open,
    body.mobile-node-open {
        overflow: hidden;
    }

    /* ---- Hide desktop-only elements ---- */
    /* .mobile-overlay is now the desktop-recommendation gate — it is SHOWN on
       mobile (see the .mobile-overlay rules above), not hidden here. */
    #bulkSearchBtn,
    #togglePhysics,
    #adventureToggle,
    #cartBtn,
    .wallet-container,
    #minimap-container,
    #bulkSearchModal,
    #portfolioPanel,
    #tradeButtonsRow,
    #floatingCartPopup,
    #traderCartRow,
    #marketTokensRow,
    #appFooter,
    .update-pill {
        display: none !important;
    }

    /* ---- Header ---- */
    .header {
        padding: 4px 10px;
        position: fixed;
        top: 0; left: 0; right: 0;
        z-index: 500;
        height: 36px;
        box-sizing: border-box;
        flex-wrap: nowrap;
        /* Drop the divider line + shadow under the stats on mobile — the
           header shares the graph's cream background, so it reads cleaner
           flush against the canvas. */
        border-bottom: none;
        box-shadow: none;
    }

    .title {
        font-size: 10px;
        white-space: nowrap;
    }

    .title img {
        width: 20px !important;
        height: 20px !important;
        margin-right: 4px !important;
    }

    .stats {
        gap: 8px;
        font-size: 10px;
        flex: 1;
        justify-content: flex-end;
        overflow: hidden;
    }

    .stat-label {
        display: inline;
        font-size: 9px;
        opacity: 0.6;
    }

    .stat-item {
        gap: 1px;
        white-space: nowrap;
    }

    /* Hide Timeframe + FPS on mobile */
    .stat-item:nth-child(1),
    .stat-item:nth-child(6) {
        display: none !important;
    }

    .physics-controls {
        display: none !important;
    }

    /* ---- Graph ---- */
    #cy {
        height: calc(100vh - 36px) !important;
        margin-top: 36px;
        width: 100vw;
        touch-action: manipulation;
    }

    /* ---- Connection status ---- */
    .status {
        bottom: 72px;
        left: 8px;
        font-size: 10px;
        padding: 3px 7px;
        z-index: 400;
    }

    /* ---- Mobile bottom navigation bar (floating glass tab bar) ---- */
    .mobile-nav {
        display: block !important;
        position: fixed;
        bottom: 0; left: 0; right: 0;
        z-index: 10000;
        padding: 0 12px calc(env(safe-area-inset-bottom, 0px) + 6px) 12px;
        pointer-events: none;
        background: linear-gradient(to top, rgba(250,246,240,0.85) 60%, rgba(250,246,240,0) 100%);
    }

    .mobile-nav-inner {
        display: flex;
        align-items: center;
        justify-content: space-around;
        height: 52px;
        background: rgba(250,246,240,0.75);
        backdrop-filter: blur(16px) saturate(1.4);
        -webkit-backdrop-filter: blur(16px) saturate(1.4);
        border-radius: 16px;
        box-shadow: 0 4px 24px rgba(92,80,72,0.12), 0 0 0 0.5px rgba(92,80,72,0.08);
        pointer-events: auto;
    }

    .mobile-nav-btn {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        background: none;
        border: none;
        color: #b0a89e;
        font-family: 'IBM Plex Mono', monospace;
        font-size: 9px;
        font-weight: 600;
        cursor: pointer;
        padding: 8px 20px;
        border-radius: 12px;
        transition: color 0.2s, background 0.2s;
        -webkit-tap-highlight-color: transparent;
        position: relative;
    }

    .mobile-nav-btn .nav-icon {
        width: 22px;
        height: 22px;
        stroke: currentColor;
        transition: stroke 0.2s;
    }

    .mobile-nav-btn.active {
        color: #5c5048;
        background: rgba(92,80,72,0.08);
    }

    .mobile-nav-btn:active {
        transform: scale(0.92);
    }

    /* ---- Filters panel as bottom sheet ---- */
    .filters-panel {
        position: fixed !important;
        top: auto !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        max-height: calc(100vh - 36px);
        border-radius: 16px 16px 0 0 !important;
        z-index: 9500;
        transform: translateY(100%);
        transition: transform 0.3s ease;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        box-shadow: 0 -4px 24px rgba(0,0,0,0.12);
        box-sizing: border-box;
    }

    .filters-panel.collapsed {
        width: 100vw !important;
        max-width: 100vw !important;
        background: #faf6f0;
        border-color: #e8e0d4;
        border-radius: 16px 16px 0 0 !important;
        transform: translateY(100%);
    }

    .filters-panel.collapsed .filters-content { display: none; }
    .filters-panel.collapsed .filters-header {
        writing-mode: horizontal-tb;
        text-orientation: initial;
        padding: 14px 16px;
        justify-content: space-between;
    }

    .filters-panel.collapsed .filters-header span:first-child {
        color: #5c5048;
    }

    .filters-panel.mobile-open {
        transform: translateY(0) !important;
    }

    .filters-panel.mobile-open.collapsed {
        /* override collapsed to show content */
    }

    .filters-header {
        padding: 14px 16px;
        position: sticky;
        top: 0;
        background: #faf6f0;
        z-index: 2;
        border-bottom: 1px solid #e8e0d4;
    }

    .filters-content {
        padding: 12px 16px 80px;
    }

    .filter-tabs {
        gap: 6px;
        margin-bottom: 14px;
    }

    .filter-tab {
        padding: 10px 6px;
        font-size: 11px;
        border-radius: 8px;
        min-height: 38px;
    }

    .filter-row {
        margin-bottom: 10px;
    }

    .filter-label {
        font-size: 12px;
        margin-bottom: 4px;
    }

    /* Larger touch targets for sliders */
    .range-slider {
        height: 36px;
        margin-top: 8px;
    }

    .range-slider input[type="range"]::-webkit-slider-thumb {
        width: 22px !important;
        height: 22px !important;
        margin-top: -9px !important;
    }

    input[type="range"]::-webkit-slider-thumb {
        width: 22px !important;
        height: 22px !important;
    }

    input[type="range"] {
        height: 6px;
    }

    .range-slider input[type="range"] {
        height: 6px;
    }

    .range-values span {
        font-size: 10px;
    }

    /* Larger buttons in btn-group */
    .btn-group {
        gap: 6px;
        flex-wrap: wrap;
    }

    .btn {
        min-height: 36px;
        padding: 8px 10px;
        font-size: 11px;
        border-radius: 8px;
    }

    .btn.small {
        min-height: 32px;
        padding: 6px 8px;
        font-size: 10px;
    }

    .sort-group .btn {
        font-size: 10px;
        padding: 6px 6px;
    }

    /* Apply/Reset buttons - sticky at bottom */
    .filter-buttons {
        position: sticky;
        bottom: 0;
        background: #faf6f0;
        padding: 12px 0 calc(env(safe-area-inset-bottom, 0px) + 12px);
        margin: 0 -16px;
        padding-left: 16px;
        padding-right: 16px;
        gap: 10px;
        border-top: 1px solid #e8e0d4;
        z-index: 5;
    }

    .apply-btn, .reset-btn {
        min-height: 42px;
        font-size: 12px;
        border-radius: 10px;
    }

    /* Tag picker mobile-friendly */
    .tag-picker-dropdown {
        max-height: 200px;
    }

    .tag-search-input {
        min-height: 36px;
        font-size: 12px;
    }

    /* ---- Node info panel as bottom sheet ---- */
    .node-panel {
        position: fixed !important;
        top: auto !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        max-height: calc(100vh - 36px);
        border-radius: 16px 16px 0 0 !important;
        z-index: 9500;
        padding: 16px 20px 80px;
        box-sizing: border-box;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        box-shadow: 0 -4px 24px rgba(0,0,0,0.12);
        transform: translateY(100%);
        transition: transform 0.3s ease;
    }

    .node-panel.visible {
        display: block;
        transform: translateY(0);
    }

    .node-panel-close {
        top: 8px;
        right: 12px;
        font-size: 18px;
        min-width: 32px;
        min-height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .node-header {
        margin-bottom: 12px;
    }

    .node-icon {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }

    .node-title {
        font-size: 13px;
    }

    .node-subtitle {
        font-size: 10px;
    }

    .node-address {
        font-size: 10px;
        padding: 8px 10px;
    }

    .info-row {
        padding: 5px 0;
    }

    .info-label {
        font-size: 11px;
    }

    .info-value {
        font-size: 11px;
    }

    .timeframe-buttons {
        gap: 6px;
    }

    .tf-btn {
        min-height: 34px;
        padding: 6px 8px;
        font-size: 11px;
    }

    /* PnL toggle */
    .pnl-toggle-btn {
        min-height: 28px;
        padding: 4px 8px;
        font-size: 10px;
    }

    /* ---- Leaderboard panel as bottom sheet ---- */
    .leaderboard-panel {
        position: fixed !important;
        top: auto !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        max-height: calc(100vh - 36px);
        border-radius: 16px 16px 0 0 !important;
        z-index: 9500;
        transform: translateY(100%);
        transition: transform 0.3s ease;
        overflow: hidden;
        box-shadow: 0 -4px 24px rgba(0,0,0,0.12);
        box-sizing: border-box;
    }

    .leaderboard-panel.collapsed {
        width: 100vw !important;
        max-width: 100vw !important;
        background: #faf6f0;
        border-color: #e8e0d4;
        border-radius: 16px 16px 0 0 !important;
        transform: translateY(100%);
    }

    .leaderboard-panel.collapsed .leaderboard-toggle {
        writing-mode: horizontal-tb;
        text-orientation: initial;
        padding: 14px 16px;
        justify-content: space-between;
    }

    .leaderboard-panel.collapsed .leaderboard-toggle span:first-child {
        color: #5c5048;
        font-size: 12px;
    }

    .leaderboard-panel.collapsed .toggle-icon {
        color: #a89984;
        font-size: 10px;
    }

    .leaderboard-panel.mobile-open {
        transform: translateY(0) !important;
    }

    .leaderboard-toggle {
        padding: 14px 16px;
        position: sticky;
        top: 0;
        background: #faf6f0;
        z-index: 2;
    }

    .leaderboard-tabs {
        gap: 6px;
        padding: 0 16px;
    }

    .tab-btn {
        min-height: 36px;
        font-size: 11px;
        padding: 8px 10px;
    }

    .leaderboard-body {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        max-height: calc(100vh - 36px - 110px);
    }

    .leaderboard-content {
        padding: 0 8px 80px;
    }

    .leaderboard-item {
        padding: 10px 8px;
        min-height: 44px;
    }

    /* ---- Mobile sheet backdrop ---- */
    .mobile-backdrop {
        display: none;
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(0,0,0,0.3);
        z-index: 9000;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-backdrop.visible {
        display: block;
    }

    /* Trade modal mobile overrides → styles-trade.css (#19e/f) */

    /* ---- Loading overlay ---- */
    #loadingOverlay .loading-container {
        padding: 20px;
    }

    /* Onboarding tooltip mobile overrides → styles-onboarding.css (#19e/f) */

    /* Bridge dialog mobile overrides → styles-bridge.css (#19e/f) */

    /* ---- Token type buttons wrap ---- */
    .token-type-group {
        gap: 6px;
    }
}

/* ──────────────────────────────────────────────────────────────────────────
 * Loading overlay — morphing shape animation (YES → NO → ▲)
 * Used by #loadingOverlay in index.html.
 * Extracted from inline <style> block.
 * ────────────────────────────────────────────────────────────────────────── */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
}

/* ── morphing shape: circle → square → triangle ── */
.loading-shape {
    position: relative;
    width: 52px;
    aspect-ratio: 1;
    border-radius: 50%;
    background: #a7c080;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    animation: morphShape 3s infinite cubic-bezier(0.3, 1, 0, 1);
}
.loading-shape .shape-label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1px;
    color: #fff;
    animation: morphLabel 3s infinite cubic-bezier(0.3, 1, 0, 1);
}

@keyframes morphShape {
    0%        { border-radius: 50%;  background: #a7c080; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
    33%       { border-radius: 0;    background: #e67e80; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
    66%, 100% { border-radius: 0;    background: #dbbc7f; clip-path: polygon(50% 0, 50% 0, 100% 100%, 0 100%); }
}
@keyframes morphLabel {
    0%        { content: 'YES'; }
    33%       { content: 'NO'; }
    66%, 100% { content: ''; }
}

.loading-status {
    font-family: 'IBM Plex Mono', monospace;
    color: #a89984;
    font-size: 11px;
    min-height: 16px;
}

/* ─── Cross-EOA hint banner (#47) ─────────────────────────────────────── */
/* Inserted at top of #walletDropdown by frontend/modules/wallet/cross-eoa-hint.js
   when localStorage detects >1 historical Privy embedded EOA for this device. */
.cross-eoa-hint {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 8px 12px 0;
    padding: 8px 10px;
    background: #fdf4d7;
    border: 1px solid #e0c97c;
    border-radius: 6px;
    font-size: 11px;
    line-height: 1.4;
    color: #5c4a1d;
}
.cross-eoa-hint-text {
    flex: 1;
}
.cross-eoa-hint-detail {
    display: block;
    margin-top: 2px;
    color: #7a6332;
}
.cross-eoa-hint-dismiss {
    background: none;
    border: none;
    color: #8b7244;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    flex-shrink: 0;
}
.cross-eoa-hint-dismiss:hover {
    background: rgba(0,0,0,0.06);
    color: #5c4a1d;
}

/* ─── Polymarket-unreachable dialog (DNS/ISP block) ───────────────────── */
/* Injected by frontend/modules/connectivity.js when a Polymarket call fails
   after all retries AND a reachability probe confirms the host is blocked.
   Reuses .bridge-overlay / .bridge-dialog / .bridge-header / .bridge-close
   (styles-bridge.css) so it's a 1:1 visual sibling of the bridge dialog;
   the classes below only style the card's interior. */
.pg-conn-title {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: #5c5048;
}
.pg-conn-body {
    padding: 16px 18px 18px;
    font-family: 'IBM Plex Mono', monospace;
}
.pg-conn-lead {
    margin: 0 0 12px;
    font-size: 12px;
    line-height: 1.5;
    color: #6b6056;
}
.pg-conn-steps {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.pg-conn-step {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 9px 12px;
    background: #fdfaf5;
    border: 1px solid #e8e0d4;
    border-radius: 10px;
}
.pg-conn-step-os {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #5c5048;
}
.pg-conn-step-how {
    font-size: 11px;
    line-height: 1.45;
    color: #7a6f66;
}
.pg-conn-step-how strong { color: #5c5048; }
.pg-conn-step-how em { font-style: italic; color: #6b6056; }
.pg-conn-foot {
    margin: 14px 0 0;
    text-align: center;
    font-size: 11px;
    color: #a89984;
}

/* =============================================================================
   Search-mode timeline panel (Phase 3 of #126) — 95px bottom-of-viewport bar.
   Hidden by default; visible while body has .exploration-active AND
   timeline.mount() has flipped display:block.
   ============================================================================= */

#searchTimeline {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 10px;
    width: calc(100% - 640px);
    max-width: 1200px;
    min-width: 480px;
    height: 52px;
    background: #faf6f0;
    border: 1px solid #d4c4b0;
    border-radius: 10px;
    padding: 4px 10px;
    box-sizing: border-box;
    /* Clip histogram to the rounded outer frame — without this, the
       inner histogram element pokes past the panel corners. */
    overflow: hidden;
    z-index: 9999;
    color: #5c5048;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    user-select: none;
    box-shadow: 0 8px 24px rgba(92,80,72,0.15);
}

#searchTimelineLabelRow {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3px;
    line-height: 12px;
}

#searchTimelineLeftEdge { color: #a89984; }

#searchTimelineRangeLabel { color: #5c5048; font-weight: 600; }

/* Volume-weighted avg price for SINGLE-TOKEN search seed only.
   Hidden by default — render.js::_updateAvgPrice flips display when the
   /search URL is exactly `?tokens=<single>`. Sits between range label and
   RESET without disturbing the existing flex layout (justify-content:
   space-between on parent — extra child stays out of layout while hidden). */
#searchTimelineAvgPrice {
    display: none;
    color: #7daea3;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    margin-right: 8px;
}

/* Mirrors the .btn.reset-btn pair used in the Filters panel so the
   timeline RESET reads as the same control class. Compact line-height
   so it fits inside the 12px label row. */
#searchTimelineReset {
    background: #f0ebe4;
    color: #7c6f64;
    border: 1px solid #e8e0d4;
    border-radius: 3px;
    padding: 0 8px;
    font-family: inherit;
    font-size: 9px;
    line-height: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
#searchTimelineReset:hover { background: #e8e0d4; color: #5c5048; }

#searchTimelineHistogramWrap {
    position: relative;
    height: 30px;
    background: #f0ebe4;
    border: 1px solid #e8e0d4;
    border-radius: 3px;
    overflow: hidden;
    cursor: ew-resize;
}

#searchTimelineHistogram {
    width: 100%;
    height: 100%;
    display: block;
}

#searchTimelineBrush {
    position: absolute;
    top: 0;
    bottom: 0;
    background: rgba(92,80,72,0.14);
    border-left: 2px solid #5c5048;
    border-right: 2px solid #5c5048;
    pointer-events: none;
}

.searchTimelineHandle {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 8px;
    margin-left: -4px;  /* center handle on its slot edge */
    cursor: ew-resize;
    z-index: 2;
}

/* Mobile: hide the panel — desktop forensic-focused feature.
   Phase 5 will polish; Phase 3 just keeps the panel out of the way. */
@media (max-width: 640px) {
    #searchTimeline { display: none !important; }
}

/* Tighter side margins on smaller desktops so the centered strip
   stays narrow enough to fit between side panels. */
@media (max-width: 1280px) {
    #searchTimeline { width: calc(100% - 320px); }
}

/* In search/exploration mode hide the app footer so the timeline
   strip has clear breathing room at the bottom of the viewport. */
body.exploration-active #appFooter { display: none !important; }
