        input[type="number"]::-webkit-inner-spin-button, 
        input[type="number"]::-webkit-outer-spin-button {
            -webkit-appearance: none; 
            margin: 0;
        }
        input[type="number"] {
            -moz-appearance: textfield;
        }
        #page-requests .requests-grid {
            max-width: 1200px;
            margin: 0 auto;
            display: grid;
            grid-template-columns: 1.1fr 1.4fr;
            gap: 14px;
        }
        #page-requests .settings-card {
            overflow: visible;
        }
        #page-requests .custom-select-wrapper.open .custom-options {
            z-index: 50;
        }
        .settings-input {
            width: 100%;
            height: 38px;
            padding: 0 12px;
            border-radius: 10px;
            border: 1px solid var(--border-color, rgba(255,255,255,0.12));
            background: var(--input-bg, rgba(255,255,255,0.04));
            color: var(--text-primary, #f2f2f7);
            font-size: 14px;
            outline: none;
            transition: border-color 0.15s ease, box-shadow 0.15s ease;
        }
        .settings-input:focus {
            border-color: rgba(59, 130, 246, 0.55);
            box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
        }
        .ai-header-dot {
            display: inline-block;
            width: 7px;
            height: 7px;
            border-radius: 50%;
            background: linear-gradient(135deg, #3b82f6, #22d3ee);
            margin-right: 6px;
            vertical-align: middle;
            box-shadow: 0 0 8px rgba(59, 130, 246, 0.45);
        }
        @media (max-width: 980px) {
            #page-requests .requests-grid {
                grid-template-columns: 1fr;
            }
        }
        .split-resizer:hover, .split-resizer:active { background: rgba(129, 161, 193,0.4) !important; }
        /* --- AI chat: mobile --- */
        @media (max-width: 768px) {
            .ai-chat-panel {
                width: 100% !important;
                /* Mobilde tam ekran yap */
                height: 100dvh !important;
                border-left: none;
                transform: translateX(100%);
                z-index: 10000;
            }

            .ai-chat-panel.visible {
                transform: translateX(0);
                right: 0 !important;
            }

            .page-content.ai-open .chart-grid-container {
                margin-right: 0 !important;
                width: 100% !important;
            }

            .ai-input-area {
                padding: 15px;
                padding-bottom: max(25px, env(safe-area-inset-bottom));
            }

            .ai-input-wrapper {
                padding: 10px 10px 10px 20px;
            }

            .ai-send-round {
                width: 44px;
                height: 44px;
                font-size: 17px;
            }

            #ai-chat-input {
                font-size: 16px;
            }
        }

        /* AI panel open: charts remain fully interactive */

        /* Updated AI Chat Layout - Docked Sidebar */
        .ai-chat-panel {
            position: fixed;
            top: 0;
            right: 0;
            width: 440px;
            height: 100dvh;
            background: rgba(12, 12, 14, 0.72) !important;
            backdrop-filter: blur(28px) saturate(180%) !important;
            -webkit-backdrop-filter: blur(28px) saturate(180%) !important;
            border-left: 1px solid rgba(255, 255, 255, 0.06) !important;
            z-index: 9999;
            display: flex;
            flex-direction: column;
            box-shadow: -15px 0 40px rgba(0, 0, 0, 0.6), inset 1px 0 0 rgba(255,255,255,0.05) !important;
            transform: translateX(100%);
            transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.24s ease;
            font-family: 'Inter', sans-serif;
            box-sizing: border-box !important;
            overflow: hidden !important;
        }

        /* Dock offset only when a panel is actually open — applying right to closed panels
           breaks translateX(100%) hide and makes AI/watchlist appear when trade dock widens. */
        .ai-chat-panel.visible {
            transform: translateX(0);
            right: var(--trade-dock-width, 0px);
        }

        .ai-chat-panel.dock-panel-closing {
            pointer-events: none;
            opacity: 0;
            transform: translateX(105%) !important;
        }

        .ai-chat-panel:not(.visible),
        .right-sidebar-panel:not(.visible),
        #lh-ai-chat-panel:not(.visible) {
            pointer-events: none !important;
        }

        .ai-chat-panel.visible,
        .right-sidebar-panel.visible,
        #lh-ai-chat-panel.visible {
            pointer-events: auto;
        }

        #overlay:not(.active),
        .sheet-overlay:not(.active),
        #mobile-trade-overlay:not(.active),
        #mobile-positions-overlay:not(.active) {
            pointer-events: none !important;
        }

        .chart-loader-overlay:not(.visible),
        #liquidity-loader-overlay:not(.visible) {
            pointer-events: none !important;
        }

        .chart-loader-overlay.visible,
        #liquidity-loader-overlay.visible {
            pointer-events: auto;
        }

        /* Chart Grid Transition — trade panel genişliği sağ sabit panellerin sola kayması için */
        #page-charts,
        #page-liquidation-heatmap {
            --trade-dock-width: 0px;
            --right-dock-total-width: 0px;
            --right-floating-width: 0px;
        }

        #page-charts #top-horizontal-split {
            box-sizing: border-box;
            padding-right: var(--right-floating-width, 0px);
            transition: padding-right 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
        }

        /* Lazy loading feel for chart data fetch overlays */
        .chart-loader-overlay,
        #liquidity-loader-overlay {
            background: radial-gradient(circle at 50% 35%, rgba(34, 44, 70, 0.28), rgba(8, 10, 16, 0.9)) !important;
            transition: opacity 0.65s ease, visibility 0.65s ease !important;
        }

        .chart-loader-overlay::before,
        #liquidity-loader-overlay::before {
            content: "";
            position: absolute;
            inset: 0;
            background: linear-gradient(110deg, rgba(255, 255, 255, 0) 20%, rgba(255, 255, 255, 0.09) 48%, rgba(255, 255, 255, 0) 78%);
            transform: translateX(-100%);
            animation: pi-loader-shimmer 1.6s ease-in-out infinite;
            pointer-events: none;
        }

        .chart-loader-overlay .ai-console-loader,
        #liquidity-loader-overlay .ai-console-loader {
            opacity: 1 !important;
            transform: translateY(0) !important;
            animation: pi-loader-float 1.5s ease-in-out infinite alternate;
        }

        .chart-loader-overlay .loader-text,
        #liquidity-loader-overlay .loader-text {
            display: inline-block;
            position: relative;
            overflow: hidden;
        }

        .chart-loader-overlay .spinner,
        #liquidity-loader-overlay .spinner {
            opacity: 0.9;
            animation-duration: 1.8s !important;
        }

        @keyframes pi-loader-shimmer {
            0% { transform: translateX(-100%); }
            100% { transform: translateX(100%); }
        }

        @keyframes pi-loader-float {
            0% { transform: translateY(0); }
            100% { transform: translateY(4px); }
        }

        /* Desktop browsers: give Charts area ~10% more horizontal room. */
        @media (min-width: 1025px) {
            #page-charts #top-horizontal-split {
                padding-right: calc(var(--right-floating-width, 0px) * 0.9);
            }
        }

        #page-charts .chart-grid-container {
            min-width: 0;
            width: auto;
            margin-right: 0;
        }

        #page-charts.positions-hidden #positions-panel-bottom {
            height: 0 !important;
            min-height: 0 !important;
            max-height: 0 !important;
            padding: 0 !important;
            margin: 0 !important;
            border: none !important;
            opacity: 0 !important;
            overflow: hidden !important;
            pointer-events: none !important;
        }

        #page-charts.positions-hidden #trade-v-resizer {
            display: none !important;
        }

        #page-charts.positions-hidden #top-horizontal-split {
            flex: 1 1 100% !important;
            min-height: 0 !important;
        }

        .positions-toggle-btn {
            min-width: 30px;
            padding: 0 8px;
        }

        .positions-toggle-btn.active {
            background: rgba(61,145,255,0.2);
            border-color: rgba(61,145,255,0.4);
        }

        #chart-positions-toggle-btn.active {
            background: rgba(61,145,255,0.2);
            border-color: rgba(61,145,255,0.4);
        }

        #chart-positions-toggle-btn {
            color: #c97735;
            border-color: rgba(201, 119, 53, 0.45);
            background: rgba(201, 119, 53, 0.14);
        }

        #chart-positions-toggle-btn:hover {
            color: #ffd9b7;
            border-color: rgba(255, 186, 122, 0.58);
            background: rgba(201, 119, 53, 0.24);
        }

        .positions-restore-bar {
            display: none;
            position: absolute;
            left: 50%;
            bottom: 10px;
            transform: translateX(-50%);
            z-index: 55;
            border: 1px solid rgba(61,145,255,0.35);
            background: rgba(16, 21, 34, 0.92);
            color: #dbeafe;
            border-radius: 10px;
            padding: 6px 12px;
            font-size: 12px;
            line-height: 1;
            letter-spacing: 0.2px;
            align-items: center;
            gap: 8px;
            cursor: pointer;
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
            transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
        }

        .positions-restore-bar:hover {
            transform: translateX(-50%) translateY(-1px);
            background: rgba(28, 39, 62, 0.96);
            border-color: rgba(61,145,255,0.55);
        }

        #page-charts.positions-hidden #positions-restore-bar {
            display: inline-flex;
        }

        #page-liquidation-heatmap #lh-chart-container {
            transition: margin-right 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), width 0.4s ease;
            width: calc(100% - var(--right-dock-total-width, 0px));
            margin-right: var(--right-dock-total-width, 0px);
        }

        /* When AI Panel is Open (Applied to parent) */
        .page-content.ai-open .chart-grid-container { }

        .ai-panel-header {
            padding: 16px 18px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.06);
            display: flex;
            justify-content: space-between;
            align-items: center;
            background: rgba(12, 12, 14, 0.45) !important;
            min-height: 56px;
            flex-shrink: 0 !important;
        }

        .ai-panel-header--composer {
            display: grid;
            grid-template-columns: 1fr auto 1fr;
            align-items: center;
            gap: 10px;
        }

        .ai-header-left {
            display: flex;
            align-items: center;
            justify-content: flex-start;
        }

        .ai-header-title {
            margin: 0;
            font-size: 15px;
            font-weight: 600;
            color: #fff;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            letter-spacing: -0.02em;
        }

        .ai-header-title i {
            background: linear-gradient(135deg, #3d91ff, #00C6FF);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            font-size: 18px;
        }

        .ai-context-pill {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 6px 12px;
            border-radius: 999px;
            font-size: 12px;
            color: #c7c7cc;
            background: rgba(255, 255, 255, 0.06);
            border: 1px solid rgba(255, 255, 255, 0.08);
            cursor: default;
            user-select: none;
        }
        .ai-attach-option-details {
            display: flex;
            flex-direction: column;
         }

        .ai-context-pill .ai-chevron {
            font-size: 9px;
            opacity: 0.65;
        }

        .ai-close-btn {
            justify-self: end;
            background: rgba(255, 255, 255, 0.05);
            border: none;
            color: #8E8E93;
            width: 34px;
            height: 34px;
            border-radius: 50%;
            cursor: pointer;
            transition: all 0.2s ease;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .ai-close-btn:hover {
            background: rgba(255, 255, 255, 0.1);
            color: #fff;
        }

        .ai-panel-header h3 {
            margin: 0;
            font-size: 16px;
            font-weight: 600;
            color: #fff;
            display: flex;
            align-items: center;
            gap: 12px;
            letter-spacing: -0.02em;
        }

        .ai-panel-header h3 i {
            background: linear-gradient(135deg, #3d91ff, #00C6FF);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            font-size: 20px;
        }

        .ai-panel-header button {
            background: rgba(255, 255, 255, 0.05);
            border: none;
            color: #8E8E93;
            width: 32px;
            height: 32px;
            border-radius: 50%;
            cursor: pointer;
            transition: all 0.2s ease;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .ai-panel-header button:hover {
            background: rgba(255, 255, 255, 0.1);
            color: #fff;
        }

        .ai-chat-history {
            flex: 1 1 0% !important;
            min-height: 0 !important;
            overflow-y: auto !important;
            padding: 24px;
            display: flex;
            flex-direction: column;
            gap: 20px;
            scroll-behavior: smooth;
        }

        .modal-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.85);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            z-index: 11000;
            justify-content: center;
            align-items: center;
            opacity: 0;
            transition: opacity 0.3s ease;
            pointer-events: none;
        }

        .modal-overlay.visible {
            display: flex;
            opacity: 1;
            pointer-events: auto;
        }

        .modal-content {
            background: #1c1c1e;
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 16px;
            width: 90%;
            max-width: 500px;
            max-height: 85vh;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
            animation: modalFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        }

        .modal-header {
            padding: 18px 20px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.06);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .modal-header h3 {
            margin: 0;
            font-size: 16px;
            font-weight: 600;
            color: #fff;
        }

        .close-modal {
            background: rgba(255, 255, 255, 0.05);
            border: none;
            color: #888;
            width: 30px;
            height: 30px;
            border-radius: 50%;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s;
        }

        .close-modal:hover {
            background: rgba(255, 255, 255, 0.1);
            color: #fff;
        }

        @keyframes modalFadeIn {
            from {
                opacity: 0;
                transform: scale(0.95) translateY(10px);
            }

            to {
                opacity: 1;
                transform: scale(1) translateY(0);
            }
        }

        /* Watchlist Panel Specifics */
        #watchlist-panel {
            z-index: 9998;
        }
        .watchlist-controls {
            flex-shrink: 0 !important;
        }

        .page-content.watchlist-open .chart-grid-container { }

        /* Scrollbar Styling */
        .ai-chat-history::-webkit-scrollbar {
            width: 4px;
        }

        .ai-chat-history::-webkit-scrollbar-thumb {
            background: rgba(255, 255, 255, 0.2);
            border-radius: 4px;
        }

        .ai-message {
            padding: 12px 18px;
            border-radius: 16px;
            color: #F2F2F7;
            font-size: 14px;
            line-height: 1.55;
            max-width: 100%;
            position: relative;
            word-wrap: break-word;
            overflow-wrap: break-word;
            word-break: normal;
            box-sizing: border-box;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
            transition: all 0.2s ease;
        }

        /* Message Entry Animation Class - Added via JS */
        .ai-message.animate-in {
            animation: messageFadeIn 0.15s ease-out;
        }

        .ai-message.history {
            animation: none;
        }

        @keyframes messageFadeIn {
            from {
                opacity: 0;
                transform: translateY(4px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        @keyframes messagePop {
            from {
                opacity: 0;
                transform: translateY(12px) scale(0.97);
            }

            to {
                opacity: 1;
                transform: translateY(0) scale(1);
            }
        }

        .ai-message.user {
            background: linear-gradient(135deg, #1d4ed8, #3b82f6);
            color: #ffffff;
            align-self: flex-end;
            max-width: min(88%, 520px);
            border-bottom-right-radius: 4px;
            box-shadow: 0 4px 14px rgba(59, 130, 246, 0.25);
        }

        .ai-message.system {
            background: rgba(255, 255, 255, 0.02);
            border: 1px solid rgba(255, 255, 255, 0.04);
            color: #8E8E93;
            align-self: center;
            font-size: 12px;
            padding: 8px 16px;
            text-align: center;
            border-radius: 20px;
            box-shadow: none;
        }

        .ai-message.assistant {
            display: flex;
            align-items: flex-start;
            gap: 10px;
            width: 100%;
            max-width: 100%;
            padding: 0;
            background: transparent;
            border: none;
            box-shadow: none;
            backdrop-filter: none;
            -webkit-backdrop-filter: none;
            align-self: stretch;
            border-radius: 0;
            box-sizing: border-box;
        }
        .ai-assistant-avatar {
            flex-shrink: 0;
            width: 30px;
            height: 30px;
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: linear-gradient(135deg, rgba(59, 130, 246, 0.95), rgba(139, 92, 246, 0.9));
            color: #fff;
            font-size: 13px;
            box-shadow: 0 4px 14px rgba(59, 130, 246, 0.28);
            margin-top: 2px;
        }
        .ai-assistant-body {
            flex: 1;
            min-width: 0;
            max-width: 100%;
            padding: 12px 14px;
            border-radius: 14px;
            border-bottom-left-radius: 4px;
            background: linear-gradient(180deg, rgba(24, 24, 30, 0.96), rgba(18, 18, 24, 0.98));
            border: 1px solid rgba(255, 255, 255, 0.07);
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
            color: #e8eaed;
            font-size: 13.5px;
            line-height: 1.62;
            overflow-wrap: break-word;
            word-break: normal;
        }
        .ai-md-content h2.ai-md-h2,
        .ai-md-content h3.ai-md-h3,
        .ai-md-content h4.ai-md-h4 {
            margin: 0 0 8px;
            font-weight: 700;
            letter-spacing: -0.01em;
            color: #fff;
        }
        .ai-md-content h2.ai-md-h2 { font-size: 15px; }
        .ai-md-content {
            max-width: 100%;
            overflow-wrap: break-word;
            word-break: normal;
        }
        .ai-md-content .ai-md-para {
            margin: 0 0 0.7em;
            line-height: 1.62;
        }
        .ai-md-content .ai-md-para:last-child {
            margin-bottom: 0;
        }
        .ai-md-content h3.ai-md-h3 { font-size: 14px; color: #f1f5f9; }
        .ai-md-content h4.ai-md-h4 { font-size: 13px; color: #cbd5e1; }
        .ai-md-content .ai-md-quote {
            margin: 8px 0;
            padding: 8px 12px;
            border-left: 3px solid rgba(59, 130, 246, 0.65);
            background: rgba(59, 130, 246, 0.08);
            border-radius: 0 8px 8px 0;
            color: #dbeafe;
            font-size: 13px;
        }
        .ai-md-content .ai-md-hr {
            border: none;
            border-top: 1px solid rgba(255, 255, 255, 0.08);
            margin: 10px 0;
        }
        .ai-md-content .ai-md-ul,
        .ai-md-content .ai-md-ol {
            margin: 0 0 10px 0;
            padding-left: 18px;
        }
        .ai-md-content .ai-md-ul li,
        .ai-md-content .ai-md-ol li {
            margin-bottom: 5px;
            padding-left: 2px;
        }
        .ai-md-content .ai-md-ul li::marker { color: #60a5fa; }
        .ai-assistant-body strong,
        .ai-assistant-body b { color: #fff; font-weight: 650; }
        .ai-assistant-body em { color: #c4b5fd; }
        .ai-assistant-body code {
            font-family: 'Fira Code', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
            font-size: 12px;
            background: rgba(0, 0, 0, 0.35);
            padding: 2px 6px;
            border-radius: 5px;
            color: #fda4af;
            border: 1px solid rgba(255, 255, 255, 0.06);
        }
        .ai-assistant-body pre {
            background: #0d1117;
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 10px;
            padding: 12px;
            margin: 10px 0;
            overflow-x: auto;
            position: relative;
        }
        .ai-assistant-body pre code {
            background: transparent;
            border: none;
            padding: 0;
            color: #e2e8f0;
        }
        .ai-message.assistant .ai-trade-inline-draw-btn {
            margin-top: 10px;
        }

        .ai-message.error {
            background: rgba(255, 69, 58, 0.08);
            border: 1px solid rgba(255, 69, 58, 0.2);
            color: #FF453A;
            align-self: flex-start;
            border-bottom-left-radius: 4px;
        }

        /* Markdown rendering styles within chat messages */
        .ai-message strong, .ai-message b {
            font-weight: 700;
            color: #ffffff;
        }
        .ai-message p {
            margin: 0 0 8px 0;
        }
        .ai-message p:last-child {
            margin-bottom: 0;
        }
        .ai-message ul, .ai-message ol {
            margin: 0 0 8px 20px;
            padding: 0;
        }
        .ai-message li {
            margin-bottom: 4px;
        }
        .ai-message code {
            font-family: 'Fira Code', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
            font-size: 12px;
            background: rgba(0, 0, 0, 0.35);
            padding: 2px 5px;
            border-radius: 4px;
            color: #fca5a5;
        }
        .ai-message pre {
            background: rgba(0, 0, 0, 0.45);
            border: 1px solid rgba(255, 255, 255, 0.06);
            border-radius: 8px;
            padding: 12px;
            margin: 8px 0;
            overflow-x: auto;
            position: relative;
        }
        .ai-message pre code {
            background: transparent;
            padding: 0;
            border-radius: 0;
            color: #e2e8f0;
            display: block;
        }
        .ai-message pre .copy-code-btn {
            position: absolute;
            top: 6px;
            right: 6px;
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 4px;
            color: #a1a1aa;
            padding: 2px 6px;
            font-size: 10px;
            cursor: pointer;
            transition: all 0.15s;
        }
        .ai-message pre .copy-code-btn:hover {
            background: rgba(255, 255, 255, 0.12);
            color: #ffffff;
        }

        /* AI Analyst — command-center composer */
        .ai-input-area {
            padding: 16px 18px 22px;
            border-top: 1px solid rgba(255, 255, 255, 0.05);
            background: rgba(10, 10, 12, 0.55);
            backdrop-filter: blur(12px);
            flex-shrink: 0 !important;
        }

        .ai-input-area--composer {
            padding-bottom: max(20px, env(safe-area-inset-bottom));
        }

        .ai-composer-card {
            background: rgba(26, 26, 30, 0.6);
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 20px;
            padding: 14px 14px 10px;
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
            transition: border-color 0.2s ease, box-shadow 0.2s ease;
        }

        .ai-composer-card:focus-within {
            border-color: rgba(59, 130, 246, 0.4);
            box-shadow: 0 8px 28px rgba(59, 130, 246, 0.12);
        }

        .ai-composer-textarea {
            width: 100%;
            box-sizing: border-box;
            min-height: 52px;
            max-height: 160px;
            padding: 4px 4px 8px;
            margin: 0;
            border: none;
            background: transparent;
            color: #f2f2f7;
            font-family: inherit;
            font-size: 14px;
            line-height: 1.45;
            resize: none;
            outline: none;
        }

        .ai-composer-textarea::placeholder {
            color: #8e8e93;
        }

        .ai-composer-toolbar {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            margin-top: 4px;
        }

        .ai-composer-toolbar-left {
            display: flex;
            align-items: center;
            gap: 10px;
            flex-wrap: wrap;
        }

        .ai-attach-toggle {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 34px;
            height: 34px;
            border-radius: 10px;
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.08);
            cursor: pointer;
            transition: background 0.15s ease, border-color 0.15s ease;
        }

        .ai-attach-toggle input {
            position: absolute;
            opacity: 0;
            width: 0;
            height: 0;
        }

        .ai-attach-toggle:has(input:checked) {
            background: rgba(61, 145, 255, 0.18);
            border-color: rgba(61, 145, 255, 0.45);
        }

        .ai-attach-toggle:has(input:disabled) {
            opacity: 0.35;
            cursor: not-allowed;
        }

        .ai-attach-icon {
            color: #c7c7cc;
            font-size: 14px;
        }

        .ai-mode-pills {
            display: flex;
            gap: 6px;
        }

        .ai-mode-pill {
            padding: 6px 12px;
            border-radius: 999px;
            font-size: 11px;
            font-weight: 600;
            letter-spacing: 0.02em;
            border: 1px solid rgba(255, 255, 255, 0.12);
            background: transparent;
            color: #aeaeb2;
            cursor: pointer;
            transition: all 0.18s ease;
        }

        .ai-mode-pill:hover {
            color: #fff;
            border-color: rgba(255, 255, 255, 0.24);
        }

        .ai-mode-pill.active {
            color: #fff;
            background: rgba(255, 255, 255, 0.06);
            border-color: rgba(255, 255, 255, 0.2);
        }

        .ai-send-round {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            border: none;
            background: linear-gradient(135deg, #3b82f6, #60a5fa);
            color: #ffffff;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            font-size: 16px;
            box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
            transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
        }

        .ai-send-round:hover {
            filter: brightness(1.08);
            transform: scale(1.04);
            box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
        }

        .ai-send-round:active {
            transform: scale(0.96);
        }

        .ai-composer-hints {
            margin-top: 10px;
            padding: 0 4px;
            font-size: 11px;
            color: #636366;
            line-height: 1.4;
        }

        .ai-disclaimer {
            margin: 8px 4px 0;
            padding: 0;
            font-size: 10px;
            line-height: 1.45;
            color: #6b7280;
            letter-spacing: 0.01em;
        }
        body.theme-light .ai-disclaimer {
            color: #9ca3af;
        }

        .scanner-container {
            flex: 1 1 0% !important;
            min-height: 0 !important;
            overflow-y: auto !important;
        }

        .ai-trade-card {
            align-self: stretch;
            margin: 0 18px 12px;
            padding: 12px 14px;
            border-radius: 14px;
            background: rgba(42, 42, 46, 0.95);
            border: 1px solid rgba(61, 145, 255, 0.25);
        }

        .ai-model-static-label {
            cursor: default;
            pointer-events: none;
            opacity: 0.92;
        }

        .ai-trade-inline-draw-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            margin-top: 10px;
            padding: 8px 14px;
            border-radius: 10px;
            border: 1px solid transparent;
            font-weight: 600;
            font-size: 12px;
            cursor: pointer;
            transition: filter 0.15s ease, transform 0.1s ease;
        }

        .ai-trade-inline-draw-btn--long {
            color: #052e16;
            background: rgba(34, 197, 94, 0.85);
            border-color: rgba(34, 197, 94, 0.95);
        }

        .ai-trade-inline-draw-btn--short {
            color: #450a0a;
            background: rgba(239, 68, 68, 0.85);
            border-color: rgba(239, 68, 68, 0.95);
        }

        .ai-trade-inline-draw-btn:hover {
            filter: brightness(1.08);
        }

        .ai-trade-inline-draw-btn:active {
            transform: scale(0.98);
        }

        .ai-trade-json {
            margin: 0 0 10px;
            padding: 10px;
            max-height: 180px;
            overflow: auto;
            font-size: 11px;
            line-height: 1.35;
            color: #c7c7cc;
            background: rgba(0, 0, 0, 0.35);
            border-radius: 8px;
            font-family: ui-monospace, 'Fira Code', monospace;
        }

        .ai-trade-card-actions {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            align-items: stretch;
        }

        .ai-trade-panel-btn {
            flex: 1;
            min-width: 0;
            padding: 10px 12px;
            border-radius: 10px;
            border: 1px solid rgba(255, 255, 255, 0.22);
            font-weight: 600;
            font-size: 12px;
            cursor: pointer;
            color: #e8e8ed;
            background: rgba(255, 255, 255, 0.06);
            transition: background 0.15s ease, border-color 0.15s ease;
        }

        .ai-trade-panel-btn:hover {
            background: rgba(255, 255, 255, 0.1);
            border-color: rgba(255, 255, 255, 0.32);
        }

        .ai-trade-quick-btn {
            flex: 1;
            min-width: 0;
            padding: 10px 12px;
            border-radius: 10px;
            border: none;
            font-weight: 700;
            font-size: 12px;
            cursor: pointer;
            color: #fff;
            transition: filter 0.15s ease, transform 0.12s ease;
        }

        .ai-trade-quick-btn:hover {
            filter: brightness(1.08);
        }

        .ai-trade-quick-btn:active {
            transform: scale(0.98);
        }

        .ai-trade-quick-btn--buy {
            background: linear-gradient(135deg, #0a6b47, #00C087);
        }

        .ai-trade-quick-btn--sell {
            background: linear-gradient(135deg, #9c2824, #FF3B30);
        }

        .ai-trade-card-hint {
            margin-top: 8px;
            font-size: 11px;
            color: #8e8e93;
        }

        .ai-session-card {
            align-self: stretch;
            margin: 0 18px 12px;
            padding: 12px 14px;
            border-radius: 14px;
            background: rgba(35, 40, 48, 0.95);
            border: 1px solid rgba(129, 161, 193, 0.35);
        }

        .ai-session-apply-btn {
            width: 100%;
            margin-top: 8px;
            padding: 10px 14px;
            border-radius: 10px;
            border: 1px solid rgba(129, 161, 193, 0.45);
            font-weight: 600;
            font-size: 13px;
            cursor: pointer;
            color: #e8edf4;
            background: rgba(129, 161, 193, 0.15);
        }

        .ai-session-apply-btn:hover {
            background: rgba(129, 161, 193, 0.28);
        }

        .ai-input-wrapper {
            background: rgba(118, 118, 128, 0.12);
            border: 0.5px solid rgba(255, 255, 255, 0.1);
            border-radius: 24px;
            display: flex;
            align-items: flex-end;
            padding: 8px 8px 8px 16px;
            transition: all 0.2s ease;
        }

        .ai-input-wrapper:focus-within {
            background: rgba(118, 118, 128, 0.24);
            border-color: rgba(255, 255, 255, 0.2);
            box-shadow: 0 0 0 2px rgba(129, 161, 193, 0.3);
        }

        #ai-chat-input {
            flex: 1;
            background: transparent;
            border: none;
            color: #fff;
            padding: 8px 0;
            resize: none;
            min-height: 24px;
            max-height: 120px;
            font-family: inherit;
            font-size: 15px;
            outline: none;
            line-height: 1.4;
        }

        #ai-chat-input::placeholder {
            color: #8E8E93;
        }

        /* Typing Indicator — Cursor-style pulse */
        .typing-indicator {
            display: none;
            align-items: center;
            gap: 10px;
            background: rgba(30, 30, 35, 0.85);
            padding: 10px 14px;
            border-radius: 12px;
            border: 1px solid rgba(255, 255, 255, 0.06);
            width: fit-content;
            margin-bottom: 15px;
            margin-left: 24px;
            align-self: flex-start;
        }

        .typing-indicator::before {
            content: '';
            display: block;
            width: 3px;
            height: 16px;
            border-radius: 2px;
            background: linear-gradient(180deg, #3b82f6, #60a5fa);
            animation: aiThinkPulse 1s ease-in-out infinite;
        }

        .typing-indicator::after {
            content: 'Thinking…';
            font-size: 12px;
            color: #8E8E93;
            letter-spacing: 0.02em;
        }

        .typing-indicator span {
            display: none;
        }

        @keyframes aiThinkPulse {
            0%, 100% { opacity: 0.35; transform: scaleY(0.85); }
            50% { opacity: 1; transform: scaleY(1); }
        }

        .typing-indicator span.legacy-dot {
            display: inline-block;
            width: 7px;
            height: 7px;
            background-color: #8E8E93;
            border-radius: 50%;
            animation: typing 1.4s infinite ease-in-out both;
            margin: 0 2px;
        }

        .typing-indicator span:nth-child(1) {
            animation-delay: -0.32s;
        }

        .typing-indicator span:nth-child(2) {
            animation-delay: -0.16s;
        }

        @keyframes typing {

            0%,
            80%,
            100% {
                transform: scale(0);
                opacity: 0.4;
            }

            40% {
                transform: scale(1);
                opacity: 1;
            }
        }

        /* Markdown Styling */
        .ai-message b {
            color: #fff;
            font-weight: 700;
        }

        .ai-message strong {
            color: #fff;
            font-weight: 700;
        }

        .ai-message ul {
            margin: 8px 0 8px 24px;
            padding: 0;
        }

        .ai-message li {
            margin-bottom: 6px;
        }

        /* Modern Dashboard Widgets (Glassmorphism 2026) */
        .dashboard-section-title {
            font-size: 13px;
            font-weight: 600;
            color: rgba(255, 255, 255, 0.5);
            margin: 25px 0 15px 0;
            text-transform: uppercase;
            letter-spacing: 0.8px;
            display: flex;
            align-items: center;
            gap: 10px;
            padding-left: 5px;
        }

        .dashboard-section-title i {
            color: #3d91ff;
            font-size: 14px;
        }

        .dashboard-widgets-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
            gap: 20px;
            margin-bottom: 30px;
        }

        /* ── News Page (modern shell) ── */
        #page-news {
            padding: 0 !important;
            background: linear-gradient(180deg, rgba(59,130,246,0.06) 0%, transparent 28%);
        }
        body.theme-light #page-news {
            background: linear-gradient(180deg, rgba(59,130,246,0.06) 0%, transparent 32%);
        }
        .news-shell {
            min-height: 100%;
            padding-bottom: 48px;
        }
        .news-page--modern {
            max-width: 920px;
            margin: 0 auto;
            padding: 32px 20px 56px;
        }
        .news-hero {
            text-align: center;
            margin-bottom: 28px;
            padding: 8px 8px 0;
        }
        .news-hero-badge {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 6px 14px;
            border-radius: 999px;
            font-size: 11px;
            font-weight: 700;
            letter-spacing: 0.06em;
            text-transform: uppercase;
            color: #93c5fd;
            background: rgba(59, 130, 246, 0.12);
            border: 1px solid rgba(59, 130, 246, 0.25);
            margin-bottom: 16px;
        }
        .news-hero-title {
            font-size: clamp(26px, 4vw, 34px);
            font-weight: 800;
            letter-spacing: -0.03em;
            margin: 0 0 10px;
            background: linear-gradient(135deg, #e7e9ea 0%, #94a3b8 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }
        body.theme-light .news-hero-title {
            background: linear-gradient(135deg, #0f172a 0%, #475569 100%);
            -webkit-background-clip: text;
            background-clip: text;
        }
        .news-hero-sub {
            font-size: 15px;
            line-height: 1.55;
            color: #8b98a5;
            max-width: 520px;
            margin: 0 auto;
        }
        body.theme-light .news-hero-sub { color: #64748b; }

        .news-search-form--modern {
            display: flex;
            gap: 12px;
            margin-bottom: 22px;
            align-items: stretch;
        }
        .news-search-form--modern .news-search-inner {
            flex: 1;
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 4px 4px 4px 16px;
            border-radius: 16px;
            background: rgba(255,255,255,0.04);
            border: 1px solid rgba(255,255,255,0.1);
            box-shadow: 0 4px 24px rgba(0,0,0,0.12);
            transition: border-color .2s, box-shadow .2s;
        }
        body.theme-light .news-search-form--modern .news-search-inner {
            background: #fff;
            border-color: #e2e8f0;
            box-shadow: 0 4px 20px rgba(15,23,42,0.06);
        }
        .news-search-form--modern .news-search-inner:focus-within {
            border-color: rgba(59,130,246,0.55);
            box-shadow: 0 0 0 3px rgba(59,130,246,0.12), 0 8px 28px rgba(0,0,0,0.15);
        }
        .news-search-form-icon {
            color: #64748b;
            font-size: 15px;
        }
        .news-search-form--modern .news-search-input {
            flex: 1;
            border: none;
            background: transparent;
            padding: 14px 12px 14px 0;
            font-size: 15px;
            color: #e7e9ea;
            outline: none;
            min-width: 0;
        }
        .news-search-form--modern .news-search-input::placeholder { color: #64748b; }
        body.theme-light .news-search-form--modern .news-search-input {
            color: #0f172a;
        }
        .news-search-form--modern .news-search-btn {
            padding: 14px 22px;
            border-radius: 14px;
            border: none;
            background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
            color: #fff;
            font-size: 14px;
            font-weight: 700;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            gap: 10px;
            box-shadow: 0 4px 16px rgba(37,99,235,0.35);
            transition: transform .12s, filter .15s;
        }
        .news-search-form--modern .news-search-btn:hover { filter: brightness(1.08); }
        .news-search-form--modern .news-search-btn:active { transform: scale(0.98); }
        .news-search-form--modern .news-search-btn:disabled {
            opacity: 0.55;
            cursor: not-allowed;
            transform: none;
        }

        .news-topics-row {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            margin-bottom: 28px;
            padding: 4px;
            justify-content: center;
        }
        .news-topic-chip {
            padding: 8px 16px;
            border-radius: 999px;
            font-size: 12px;
            font-weight: 700;
            cursor: pointer;
            border: 1px solid rgba(255,255,255,0.1);
            background: rgba(255,255,255,0.04);
            color: #94a3b8;
            transition: all .18s;
        }
        .news-topic-chip:hover {
            color: #e2e8f0;
            border-color: rgba(59,130,246,0.35);
            background: rgba(59,130,246,0.1);
        }
        .news-topic-chip.active {
            color: #fff;
            border-color: transparent;
            background: linear-gradient(135deg, rgba(59,130,246,0.9) 0%, rgba(99,102,241,0.85) 100%);
            box-shadow: 0 4px 16px rgba(59,130,246,0.35);
        }
        body.theme-light .news-topic-chip {
            background: #f8fafc;
            border-color: #e2e8f0;
            color: #64748b;
        }
        body.theme-light .news-topic-chip:hover {
            border-color: #3b82f6;
            color: #1e40af;
        }
        body.theme-light .news-topic-chip.active {
            color: #fff;
        }

        .news-results-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
            gap: 18px;
        }
        @media (max-width: 500px) {
            .news-results-grid { grid-template-columns: 1fr; }
            .news-search-form--modern { flex-direction: column; }
        }
        .news-status-msg {
            text-align: center; color: #64748b;
            padding: 56px 20px;
            font-size: 14px;
            line-height: 1.65;
            grid-column: 1 / -1;
        }
        .news-status-msg i {
            font-size: 36px;
            display: block;
            margin-bottom: 14px;
            opacity: 0.35;
            color: #3b82f6;
        }

        .news-card {
            position: relative;
            background: linear-gradient(145deg, rgba(39,39,42,0.95) 0%, rgba(24,24,27,0.98) 100%);
            border: 1px solid rgba(255,255,255,0.08);
            border-radius: 16px;
            padding: 0 20px 20px;
            padding-top: 18px;
            overflow: hidden;
            transition: transform .2s, border-color .2s, box-shadow .2s;
        }
        .news-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 3px;
            background: linear-gradient(90deg, #3b82f6, #8b5cf6, #06b6d4);
            opacity: 0.85;
        }
        .news-card:hover {
            transform: translateY(-4px);
            border-color: rgba(59,130,246,0.3);
            box-shadow: 0 12px 40px rgba(0,0,0,0.25);
        }
        body.theme-light .news-card {
            background: #fff;
            border-color: #e5e7eb;
        }
        body.theme-light .news-card:hover {
            box-shadow: 0 12px 32px rgba(15,23,42,0.08);
        }
        .news-card-top {
            display: flex; align-items: center; gap: 8px;
            margin-bottom: 12px;
        }
        .news-card-category {
            font-size: 11px; font-weight: 700; text-transform: uppercase;
            letter-spacing: 0.5px; padding: 3px 10px;
            border-radius: 6px;
        }
        .news-cat-crypto { background: rgba(247,147,26,0.15); color: #f7931a; }
        .news-cat-stocks { background: rgba(34,197,94,0.15); color: #22c55e; }
        .news-cat-forex { background: rgba(59,130,246,0.15); color: #3b82f6; }
        .news-cat-commodities { background: rgba(234,179,8,0.15); color: #eab308; }
        .news-cat-economy { background: rgba(168,85,247,0.15); color: #a855f7; }
        .news-cat-regulation { background: rgba(239,68,68,0.15); color: #ef4444; }
        .news-cat-technology { background: rgba(6,182,212,0.15); color: #06b6d4; }
        .news-cat-geopolitics { background: rgba(244,63,94,0.15); color: #f43f5e; }
        .news-card-sentiment {
            font-size: 11px; font-weight: 600; margin-left: auto;
            display: flex; align-items: center; gap: 4px;
        }
        .news-sent-bullish { color: #22c55e; }
        .news-sent-bearish { color: #ef4444; }
        .news-sent-neutral { color: #8b98a5; }
        .news-card-title {
            font-size: 15px; font-weight: 700; line-height: 1.4;
            color: #e7e9ea; margin-bottom: 8px;
        }
        body.theme-light .news-card-title { color: #0f1419; }
        .news-card-summary {
            font-size: 13px; line-height: 1.55;
            color: rgba(255,255,255,0.55);
        }
        body.theme-light .news-card-summary { color: #536471; }
        body.theme-light .news-card {
            background: #fff; border-color: #eff3f4;
        }
        body.theme-light .news-card:hover {
            box-shadow: 0 8px 24px rgba(0,0,0,0.06);
        }
        .news-card-date {
            font-size: 11px; color: #6b7280; margin-top: 10px;
            display: flex; align-items: center; gap: 5px;
        }

        .modern-glass-card {
            background-color: var(--bg-secondary);
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            border: 1px solid var(--border-color);
            border-radius: 16px;
            padding: 24px;
            position: relative;
            overflow: hidden;
            transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
            box-shadow: 0 4px 24px -1px rgba(0, 0, 0, 0.2);
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            height: 140px;
        }

        .modern-glass-card:hover {
            transform: translateY(-4px);
            box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
            border-color: var(--border-color);
        }

        /* Order Book & Trades Sidebar */
        .right-sidebar-panel {
            position: fixed;
            top: 0;
            right: 0;
            width: 320px;
            height: 100dvh;
            background: rgba(19, 20, 21, 0.85); /* Glassmorphism Match*/
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border-left: 1px solid rgba(255, 255, 255, 0.08); /* Match AI Chat Border */
            z-index: 9990; 
            display: flex;
            flex-direction: column;
            transform: translateX(100%);
            transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.24s ease; /* Match AI Chat Transition */
            box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5); /* Match AI Chat Shadow */
            font-family: 'Inter', sans-serif;
            box-sizing: border-box !important;
            overflow: hidden !important;
        }

        .right-sidebar-panel.visible {
            transform: translateX(0);
            right: var(--trade-dock-width, 0px);
        }
        .right-sidebar-panel.dock-panel-closing {
            pointer-events: none;
            opacity: 0;
            transform: translateX(105%) !important;
        }

        /* Charts dock force-alignment layer (highest priority). */
        body.pi-chart-dock-force #watchlist-panel.visible,
        body.pi-chart-dock-force #orderbook-panel.visible,
        body.pi-chart-dock-force #ai-chat-panel.visible,
        body.pi-chart-dock-force .right-sidebar-panel.visible,
        body.pi-chart-dock-force .ai-chat-panel.visible {
            top: var(--pi-chart-dock-top, 0px) !important;
            height: var(--pi-chart-dock-height, 100dvh) !important;
            max-height: var(--pi-chart-dock-height, 100dvh) !important;
            bottom: auto !important;
            margin-top: 0 !important;
        }

        /* Adjust Chart when Sidebar is open (shared with Watchlist logic if needed) */
        .page-content.orderbook-open .chart-grid-container { }

        .sidebar-header {
            display: flex;
            align-items: center;
            height: 50px;
            border-bottom: 1px solid rgba(255,255,255,0.06); /* Match thinner border */
            background: rgba(255, 255, 255, 0.01); /* Match AI Chat Header bg */
            flex-shrink: 0 !important;
        }

        .sidebar-tab {
            flex: 1;
            text-align: center;
            padding: 0 10px;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 13px;
            font-weight: 600;
            color: #848E9C;
            cursor: pointer;
            transition: all 0.2s;
            position: relative;
        }

        .sidebar-tab:hover {
            color: #E6E8EA;
            background: rgba(255,255,255,0.02);
        }

        .sidebar-tab.active {
            color: #3b82f6;
            background: transparent;
        }

        .sidebar-tab.active::after {
            content: '';
            position: absolute;
            bottom: -1px;
            left: 0;
            width: 100%;
            height: 2px;
            background: #3b82f6;
        }

        .sidebar-content {
            flex: 1;
            overflow: hidden;
            display: none;
            flex-direction: column;
        }

        .sidebar-content.active {
            display: flex;
        }

        /* Order Book Table Header */
        .ob-header-row {
            display: flex;
            padding: 8px 12px;
            font-size: 11px;
            color: #848E9C;
            font-weight: 600;
        }
        .ob-col { flex: 1; text-align: right; }
        .ob-col.price { text-align: left; }
        .ob-col.total { display: none; } /* Hide total on narrow screens if needed, strictly asking for Price/Amount/Value? User asked for Last Trades too */

        /* Order Book Lists */
        .ob-list {
            flex: 1;
            overflow-y: hidden; /* Scroll handled manually or hidden */
            display: flex;
            flex-direction: column;
        }
        
        .ob-scroll-area {
            overflow-y: auto;
            flex: 1;
        }
         .ob-scroll-area::-webkit-scrollbar { width: 4px; }
         .ob-scroll-area::-webkit-scrollbar-thumb { background: #333; border-radius: 2px; }

        .ob-row {
            display: flex;
            padding: 2px 12px;
            font-family: 'Fira Code', monospace;
            font-size: 12px;
            cursor: pointer;
            position: relative;
            height: 20px;
            align-items: center;
        }

        .ob-row:hover { background: #2A2B2F; }

        /* Depth Bar Visualization */
        .ob-bg-bar {
            position: absolute;
            top: 1px;
            bottom: 1px;
            right: 0;
            opacity: 0.15;
            z-index: 0;
            pointer-events: none;
        }
        .ob-ask .ob-bg-bar { background-color: #FF3B30; } /* Red */
        .ob-bid .ob-bg-bar { background-color: #00C087; } /* Green */

        .ob-cell { 
            flex: 1; 
            text-align: right; 
            z-index: 1; 
            position: relative; 
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .ob-cell.price { text-align: left; }

        .text-buy { color: #00C087; }
        .text-sell { color: #FF3B30; }
        .text-primary { color: #EAECEF; }
        .text-sec { color: #848E9C; }

        .ob-divider {
            padding: 10px 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            border-top: 1px solid rgba(255,255,255,0.05);
            border-bottom: 1px solid rgba(255,255,255,0.05);
            font-family: 'Fira Code', monospace;
            font-size: 16px;
            font-weight: 600;
        }
        .ob-current-price { color: #EAECEF; }
        .ob-current-price.up { color: #00C087; }
        .ob-current-price.down { color: #FF3B30; }
        
        /* Trades List */
        .trades-list {
            flex: 1;
            overflow-y: auto;
        }
        .trades-list::-webkit-scrollbar { width: 4px; }
        .trades-list::-webkit-scrollbar-thumb { background: #333; border-radius: 2px; }

        .trade-row {
            display: flex;
            padding: 2px 12px;
            font-family: 'Fira Code', monospace;
            font-size: 12px;
        }
        .trade-row:hover { background: #2A2B2F; }
        .trade-col { flex: 1; text-align: right; color: #EAECEF; }
        .trade-col.price { text-align: left; }
        .trade-col.time { color: #848E9C; font-size: 11px; flex: 0.8; }
        
        .connection-status {
             width: 8px; height: 8px; border-radius: 50%;
             background: #333; margin-left: auto;
        }
        .connection-status.connected { background: #00C087; box-shadow: 0 0 5px #00C087; }

        #ob-connection-status {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            width: auto;
            min-width: 8px;
            margin-left: auto;
        }
        #ob-connection-status .status-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            flex-shrink: 0;
            background: #333;
        }
        #ob-connection-status .status-dot.online {
            background: #00C087;
            box-shadow: 0 0 5px #00C087;
        }
        #ob-connection-status .status-dot.offline {
            background: #f59e0b;
        }
        .ob-sources-label {
            font-size: 10px;
            color: #8E8E93;
            max-width: 160px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .chart-toolbar-btn.active-ob {
            color: #2196F3;
            background: rgba(33, 150, 243, 0.15);
        }

        .widget-top {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
        }

        .widget-meta {
            text-align: right;
        }

        .widget-icon-bg {
            width: 44px;
            height: 44px;
            border-radius: 14px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 20px;
            background: rgba(255, 255, 255, 0.05);
            color: #fff;
            box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.02);
        }
        .widget-icon-bg .widget-logo-img {
            width: 26px;
            height: 26px;
            object-fit: contain;
            border-radius: 50%;
            display: block;
        }

        /* Specific Icon Colors with Glow */
        .widget-icon-bg.btc {
            color: #f7931a;
            background: rgba(247, 147, 26, 0.1);
            box-shadow: 0 0 15px rgba(247, 147, 26, 0.1);
        }

        .widget-icon-bg.eth {
            color: #627eea;
            background: rgba(98, 126, 234, 0.1);
            box-shadow: 0 0 15px rgba(98, 126, 234, 0.1);
        }

        .widget-icon-bg.sol {
            color: #14f195;
            background: rgba(20, 241, 149, 0.1);
            box-shadow: 0 0 15px rgba(20, 241, 149, 0.1);
        }

        .widget-icon-bg.gold {
            color: #FFD700;
            background: rgba(255, 215, 0, 0.1);
            box-shadow: 0 0 15px rgba(255, 215, 0, 0.1);
        }

        .widget-icon-bg.oil {
            color: #ff6b6b;
            background: rgba(255, 107, 107, 0.1);
            box-shadow: 0 0 15px rgba(255, 107, 107, 0.1);
        }

        .widget-icon-bg.index {
            color: #3d91ff;
            background: rgba(129, 161, 193, 0.1);
            box-shadow: 0 0 15px rgba(129, 161, 193, 0.1);
        }

        .widget-name {
            display: block;
            font-size: 14px;
            font-weight: 600;
            color: var(--text-primary);
            margin-bottom: 4px;
        }

        .widget-symbol-tag {
            font-size: 10px;
            color: var(--text-secondary);
            font-family: 'Fira Code', monospace;
        }

        .widget-main {
            display: flex;
            align-items: flex-end;
            justify-content: space-between;
        }

        .widget-price {
            font-family: 'Fira Code', monospace;
            font-size: 24px;
            font-weight: 700;
            color: var(--text-primary);
            letter-spacing: -0.5px;
        }

        .widget-change-pill {
            padding: 4px 10px;
            border-radius: 20px;
            font-size: 12px;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 5px;
        }

        .widget-change-pill.up {
            background: rgba(46, 189, 133, 0.15);
            color: #2ebd85;
            border: 1px solid rgba(46, 189, 133, 0.2);
        }

        .widget-change-pill.down {
            background: rgba(191, 97, 106, 0.15);
            color: #FF3B30;
            border: 1px solid rgba(191, 97, 106, 0.2);
        }

        .market-status {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            font-size: 10px;
            padding: 2px 6px;
            border-radius: 4px;
            font-weight: 500;
            margin-top: 4px;
        }

        .market-status.open {
            color: #2ebd85;
            background: rgba(46, 189, 133, 0.1);
        }

        .market-status.closed {
            color: #FF3B30;
            background: rgba(191, 97, 106, 0.1);
        }

        .market-status i {
            font-size: 8px;
        }
        /* Liquidation Heatmap Specific Styles */
        #lh-time-dropdown .time-btn {
            background: transparent;
            border: 1px solid transparent;
            color: #aaa;
            padding: 6px;
            border-radius: 4px;
            cursor: pointer;
            font-size: 12px;
            font-weight: 600;
            transition: all 0.2s;
            text-align: center;
            flex: 1;
        }
        #lh-time-dropdown .time-btn:hover { background: #2b2b2e; color: #fff; }
        #lh-time-dropdown .time-btn.active { background: #2962FF; color: #fff; border-color: #2962FF; }
        
        .leverage-btn {
            padding: 4px 10px;
            background: #1e1e20;
            border: 1px solid #2b2b2e;
            color: #777;
            border-radius: 4px;
            font-size: 11px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
        }
        .leverage-btn:hover { background: #2b2b2e; color: #aaa; }
        .leverage-btn.active { background: rgba(240, 185, 11, 0.15); border-color: #f0b90b; color: #f0b90b; }

        #page-liquidation-heatmap.lh-focus-mode {
            position: fixed !important;
            inset: 0 !important;
            z-index: 100320 !important;
            background: #000 !important;
            padding: 0 !important;
        }
        #page-liquidation-heatmap.lh-focus-mode .chart-toolbar {
            position: absolute !important;
            top: 8px;
            left: 8px;
            right: 8px;
            z-index: 100330;
            background: rgba(8, 12, 20, 0.35) !important;
            backdrop-filter: blur(8px);
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 10px;
            padding: 6px 8px !important;
        }
        #page-liquidation-heatmap.lh-focus-mode #lh-chart-container {
            height: 100dvh !important;
        }

        #lh-chart-container {
            height: calc(100vh - 120px) !important;
            overflow: hidden;
        }
        #lh-chart-container .chart-wrapper {
            height: 100%;
            width: 100%;
            background: #000;
        }

        .notifications-page {
            padding: 20px;
            height: 100%;
            overflow: auto;
        }
        .reports-page {
            padding-top: 24px;
            background: #0f0f0f;
        }
        .reports-page-hero {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 18px;
        }
        .reports-page-title {
            margin: 0;
            display: inline-flex;
            align-items: center;
            gap: 10px;
            color: var(--feed-fg, #fff);
            font-size: 22px;
            font-weight: 700;
            letter-spacing: -0.02em;
        }
        .reports-page-title i {
            color: #3b82f6;
            opacity: 0.95;
        }
        .notifications-report-card {
            position: relative;
            overflow: hidden;
            border: 1px solid #262626;
            background: #171717;
            border-radius: 18px;
            padding: 18px;
            margin-bottom: 16px;
            box-shadow: 0 12px 30px rgba(0,0,0,0.22);
        }
        .notifications-report-card::before {
            content: "";
            position: absolute;
            inset: 0 0 auto 0;
            height: 1px;
            background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.28), transparent);
            pointer-events: none;
        }
        .notifications-report-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 10px;
            margin-bottom: 12px;
            flex-wrap: wrap;
        }
        .report-section-title {
            margin: 0;
            color: #f8fafc;
            font-size: 16px;
            font-weight: 700;
            letter-spacing: -0.01em;
        }
        .report-filter-row {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
        }
        .report-filter-row .custom-select-wrapper {
            min-width: 160px;
            flex: 0 0 auto;
        }
        .lh-lookback-selector .custom-select-wrapper {
            min-width: 84px;
            width: 84px;
        }
        .report-filter-row .custom-select-trigger,
        .lh-lookback-selector .custom-select-trigger {
            height: 38px;
            padding: 8px 12px;
            font-size: 12px;
            border-radius: 8px;
        }
        .report-filter-row .custom-options,
        .lh-lookback-selector .custom-options {
            min-width: 100%;
            z-index: 10010;
        }
        .report-date-input {
            min-height: 40px;
            background: #141414;
            color: #e5e7eb;
            border: 1px solid #262626;
            border-radius: 8px;
            padding: 9px 12px;
            font-size: 12px;
            outline: none;
            box-shadow: none;
            transition: border-color .18s ease, box-shadow .18s ease, background .18s ease, transform .18s ease;
        }
        .report-date-input:hover {
            border-color: #404040;
        }
        .report-date-input:focus {
            border-color: #3b82f6;
            box-shadow: 0 0 0 2px rgba(59,130,246,0.20);
        }
        .report-btn {
            min-height: 40px;
            border: 1px solid rgba(59,130,246,0.4);
            background: rgba(59,130,246,0.14);
            color: #dbeafe;
            border-radius: 8px;
            padding: 8px 14px;
            cursor: pointer;
            font-size: 12px;
            font-weight: 600;
            box-shadow: none;
            transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
        }
        .report-btn:hover {
            border-color: rgba(59,130,246,0.65);
            background: rgba(59,130,246,0.22);
        }
        .report-btn-ai {
            border-color: rgba(168,85,247,0.45);
            background: linear-gradient(135deg, rgba(139,92,255,0.18) 0%, rgba(198,91,255,0.18) 100%);
            color: #e9d5ff;
        }
        .report-btn-ai:hover {
            border-color: rgba(198,91,255,0.7);
            background: linear-gradient(135deg, rgba(139,92,255,0.28) 0%, rgba(198,91,255,0.28) 100%);
        }
        .report-metrics-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
            gap: 12px;
            margin-bottom: 14px;
        }
        .report-metrics-grid-charts {
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        }
        .report-metric {
            position: relative;
            overflow: hidden;
            border: 1px solid #262626;
            background: #141414;
            border-radius: 12px;
            padding: 14px 14px 13px;
            box-shadow: none;
        }
        .report-metric::after {
            content: "";
            position: absolute;
            inset: 0 auto 0 0;
            width: 3px;
            border-radius: 999px;
            background: linear-gradient(180deg, rgba(96,165,250,0.9), rgba(34,197,94,0.5));
        }
        .report-metric-label {
            color: #94a3b8;
            font-size: 11px;
            margin-bottom: 7px;
            text-transform: uppercase;
            letter-spacing: 0.08em;
        }
        .report-metric-value {
            color: #fff;
            font-size: 16px;
            font-weight: 700;
            line-height: 1.2;
            letter-spacing: -0.02em;
        }
        .report-chart-wrap {
            border: 1px solid #262626;
            border-radius: 16px;
            background: #141414;
            padding: 14px;
            box-shadow: none;
        }
        .report-chart-title {
            font-size: 12px;
            color: #94a3b8;
            margin-bottom: 10px;
            font-weight: 600;
            letter-spacing: 0.02em;
        }
        .reports-advisor-shell {
            padding: 0;
            overflow: hidden;
            background: #111827;
            border: 1px solid #262626;
            box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35) inset;
        }
        .reports-advisor-topbar {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            padding: 11px 12px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.08);
            background: #111827;
        }
        .reports-advisor-topbar-title {
            color: #f3f4f6;
            font-size: 12px;
            font-weight: 600;
            letter-spacing: 0.01em;
        }
        .reports-advisor-topbar-badge {
            color: #9ca3af;
            background: rgba(255, 255, 255, 0.04);
            border: 1px solid rgba(255, 255, 255, 0.14);
            border-radius: 999px;
            padding: 2px 8px;
            font-size: 11px;
            font-weight: 600;
        }
        .reports-advisor-messages {
            max-height: 320px;
            overflow: auto;
            display: flex;
            flex-direction: column;
            gap: 10px;
            padding: 12px;
            font-size: 13px;
            font-family: "JetBrains Mono", "Cascadia Mono", "Fira Code", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
        }
        .reports-advisor-messages::-webkit-scrollbar { width: 6px; }
        .reports-advisor-messages::-webkit-scrollbar-thumb {
            background: rgba(148, 163, 184, 0.35);
            border-radius: 999px;
        }
        .reports-advisor-empty {
            color: #9ca3af;
            font-size: 12px;
        }
        .reports-advisor-row {
            display: flex;
            align-items: flex-end;
            gap: 8px;
            width: 100%;
        }
        .reports-advisor-row.user {
            flex-direction: row-reverse;
        }
        .reports-advisor-avatar {
            width: 24px;
            height: 24px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 10px;
            font-weight: 700;
            flex: 0 0 24px;
            letter-spacing: 0.02em;
        }
        .reports-advisor-avatar.user {
            color: #cbd5e1;
            background: #1f2937;
            border: 1px solid rgba(148, 163, 184, 0.35);
        }
        .reports-advisor-avatar.assistant {
            color: #e5e7eb;
            background: #111827;
            border: 1px solid rgba(255, 255, 255, 0.16);
        }
        .reports-advisor-bubble {
            padding: 10px 12px 8px 12px;
            border-radius: 12px;
            border: 1px solid rgba(255, 255, 255, 0.11);
            white-space: pre-wrap;
            line-height: 1.45;
            animation: advisorBubbleIn 0.25s ease;
            box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
        }
        .reports-advisor-bubble.user {
            align-self: flex-end;
            background: #1f2937;
            color: #e5e7eb;
            max-width: 88%;
        }
        .reports-advisor-bubble.assistant {
            align-self: flex-start;
            background: #111827;
            color: #e5e7eb;
            max-width: 96%;
            border-left: 2px solid rgba(156, 163, 175, 0.45);
        }
        .reports-advisor-bubble-content {
            white-space: pre-wrap;
            word-break: break-word;
        }
        .reports-advisor-bubble-meta {
            margin-top: 6px;
            font-size: 10px;
            color: #9ca3af;
            opacity: 0.9;
            letter-spacing: 0.02em;
        }
        .reports-advisor-bubble.loading {
            color: #94a3b8;
        }
        .reports-advisor-bubble.loading .reports-advisor-bubble-content {
            display: inline-flex;
            align-items: center;
            gap: 4px;
        }
        .reports-advisor-bubble.loading .reports-advisor-bubble-content span {
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: #94a3b8;
            display: inline-block;
            animation: advisorTypingPulse 1.2s infinite ease-in-out;
        }
        .reports-advisor-bubble.loading .reports-advisor-bubble-content span:nth-child(2) { animation-delay: 0.15s; }
        .reports-advisor-bubble.loading .reports-advisor-bubble-content span:nth-child(3) { animation-delay: 0.3s; }
        .reports-advisor-input {
            min-height: 38px;
            flex: 1 1 260px;
            font-family: "JetBrains Mono", "Cascadia Mono", "Fira Code", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
        }
        .reports-advisor-send-btn:disabled {
            opacity: 0.6;
            cursor: not-allowed;
        }
        @keyframes advisorBubbleIn {
            from { opacity: 0; transform: translateY(6px); }
            to { opacity: 1; transform: translateY(0); }
        }
        @keyframes advisorTypingPulse {
            0%, 80%, 100% { transform: scale(0.5); opacity: 0.4; }
            40% { transform: scale(1); opacity: 1; }
        }
        .report-chart-canvas-fixed {
            position: relative;
            width: 100%;
            height: 220px;
        }
        .report-chart-canvas-fixed.report-chart-canvas-tall {
            height: 260px;
        }
        .report-chart-canvas-fixed canvas {
            width: 100% !important;
            height: 100% !important;
            display: block;
        }
        .report-chart-empty {
            color: #9ca3af;
            font-size: 12px;
            text-align: center;
            padding: 20px 10px;
        }
        .report-table-wrap {
            margin-top: 12px;
        }
        .report-table-scroll {
            overflow: auto;
        }
        .report-table {
            width: 100%;
            min-width: 680px;
            border-collapse: collapse;
            font-size: 12px;
            color: #e5e7eb;
        }
        .report-table thead th {
            color: #94a3b8;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            font-size: 10px;
            font-weight: 700;
            padding: 0 12px 10px;
            text-align: left;
            border-bottom: 1px solid rgba(255,255,255,0.08);
        }
        .report-table thead th.is-right,
        .report-table tbody td.is-right {
            text-align: right;
        }
        .report-table tbody tr {
            background: transparent;
            transition: background .18s ease;
        }
        .report-table tbody tr:hover {
            background: rgba(255,255,255,0.03);
        }
        .report-table tbody td {
            padding: 11px 12px;
            border-bottom: 1px solid rgba(255,255,255,0.06);
        }
        .report-table-empty {
            padding: 14px 12px !important;
            color: #9ca3af;
            text-align: center;
        }
        body.theme-light .reports-page {
            background: linear-gradient(180deg, rgba(248,250,252,0.96), rgba(241,245,249,0.92));
        }
        body.theme-light .reports-page-title {
            color: #0f172a;
        }
        body.theme-light .notifications-report-card {
            background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(248,250,252,0.98) 100%);
            border-color: rgba(148,163,184,0.22);
            box-shadow: 0 18px 40px rgba(15,23,42,0.08);
        }
        body.theme-light .report-section-title,
        body.theme-light .report-metric-value {
            color: #0f172a;
        }
        body.theme-light .report-date-input {
            color: #0f172a;
            background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
            border-color: rgba(148,163,184,0.32);
            box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
        }
        body.theme-light .report-btn {
            color: #eff6ff;
        }
        body.theme-light .report-metric,
        body.theme-light .report-chart-wrap {
            background: linear-gradient(180deg, rgba(255,255,255,0.96) 0%, rgba(248,250,252,0.94) 100%);
            border-color: rgba(148,163,184,0.20);
            box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
        }
        body.theme-light .report-table {
            color: #0f172a;
        }
        body.theme-light .report-table tbody tr {
            background: transparent;
        }
        body.theme-light .report-table tbody tr:hover {
            background: rgba(148,163,184,0.08);
        }
        body.theme-light .report-table tbody td,
        body.theme-light .report-table thead th {
            border-color: rgba(148,163,184,0.16);
        }
        @media (max-width: 768px) {
            .reports-page {
                padding: 16px;
            }
            .reports-page-hero {
                margin-bottom: 14px;
            }
            .reports-page-title {
                font-size: 19px;
            }
            .notifications-report-card {
                border-radius: 16px;
                padding: 14px;
            }
            .report-filter-row {
                width: 100%;
            }
            .report-filter-row .custom-select-wrapper,
            .report-date-input,
            .report-btn {
                width: 100%;
                min-width: 0;
            }
            .report-metrics-grid,
            .report-metrics-grid-charts {
                grid-template-columns: 1fr;
            }
        }
        .notifications-list {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }
        .notification-item {
            border: 1px solid rgba(255,255,255,0.08);
            background: rgba(255,255,255,0.02);
            border-radius: 10px;
            padding: 14px;
        }
        .notification-item-title {
            color: #fff;
            font-size: 14px;
            font-weight: 600;
            margin-bottom: 6px;
        }
        .notification-item-meta {
            color: #9ca3af;
            font-size: 12px;
            margin-bottom: 6px;
        }
        .notification-item-body {
            color: #d1d5db;
            font-size: 13px;
        }

        /* --- MODERN MOBILE NAVIGATION & ACCOUNT FLOW --- */
        @media (max-width: 768px) {
            .sidebar { 
                position: fixed;
                left: -280px;
                top: 0;
                bottom: 0;
                width: 280px;
                z-index: 100002; /* Above bottom nav but below sheet */
                transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
                background: #111;
                display: flex !important;
                flex-direction: column;
            }
            .sidebar.mobile-active { transform: translateX(280px); }
            
            /* Sidebar Footer visibility fix */
            .sidebar-nav { flex: 1; overflow-y: auto; padding-bottom: 20px; }
            .sidebar-footer { 
                padding: 15px 20px; 
                margin-top: auto; 
                border-top: 1px solid rgba(255,255,255,0.05); 
                background: #111;
                padding-bottom: calc(15px + env(safe-area-inset-bottom));
            }
            
            .main-content { margin-left: 0 !important; width: 100% !important; padding-bottom: 80px !important; }
            .mobile-menu-toggle { display: flex !important; align-items: center; justify-content: center; }

            /* Bottom Navigation Bar */
            .mobile-bottom-nav {
                position: fixed;
                bottom: 0;
                left: 0;
                right: 0;
                height: 72px;
                background: #121214;
                border-top: 1px solid rgba(255, 255, 255, 0.1);
                display: flex;
                justify-content: space-around;
                align-items: center;
                z-index: 100000; /* High enough to be over everything but the sheets */
                padding-bottom: env(safe-area-inset-bottom);
                box-shadow: 0 -10px 30px rgba(0,0,0,0.5);
                transition: background 0.3s ease;
            }

            .bottom-nav-item {
                display: flex;
                flex-direction: column;
                align-items: center;
                gap: 4px;
                color: #8E8E93;
                text-decoration: none;
                font-size: 11px;
                font-weight: 500;
                transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
                flex: 1;
                padding: 8px 0;
                -webkit-tap-highlight-color: transparent;
            }

            .bottom-nav-item i { font-size: 22px; transition: transform 0.3s ease; }
            .bottom-nav-item.active { color: #3b82f6; }
            .bottom-nav-item.active i { transform: translateY(-2px); }

            /* Account Bottom Sheet */
            .account-bottom-sheet {
                position: fixed;
                bottom: 0;
                left: 0;
                right: 0;
                background: #1c1c1e;
                border-radius: 24px 24px 0 0;
                z-index: 100005;
                transform: translateY(100%);
                transition: transform 0.5s cubic-bezier(0.32, 0.72, 0, 1);
                padding: 24px;
                padding-bottom: calc(30px + env(safe-area-inset-bottom));
                box-shadow: 0 -20px 50px rgba(0, 0, 0, 0.8);
                border-top: 1px solid rgba(255, 255, 255, 0.12);
            }

            .account-bottom-sheet.visible { transform: translateY(0); }
            
            .sheet-overlay {
                position: fixed;
                top: 0;
                left: 0;
                right: 0;
                bottom: 0;
                background: rgba(0,0,0,0.7);
                backdrop-filter: blur(4px);
                z-index: 10009;
                opacity: 0;
                visibility: hidden;
                transition: all 0.4s ease;
            }
            .sheet-overlay.active { opacity: 1; visibility: visible; }

            .sheet-handle {
                width: 36px;
                height: 5px;
                background: rgba(255, 255, 255, 0.15);
                border-radius: 10px;
                margin: -8px auto 20px auto;
            }

            .sheet-title {
                font-size: 19px;
                font-weight: 700;
                color: #fff;
                margin-bottom: 24px;
                display: flex;
                justify-content: space-between;
                align-items: center;
                letter-spacing: -0.5px;
            }

            .sheet-close-btn {
                background: rgba(255,255,255,0.06);
                border: none;
                color: #fff;
                width: 32px;
                height: 32px;
                border-radius: 50%;
                display: flex;
                align-items: center;
                justify-content: center;
                cursor: pointer;
            }

            /* Account Slider - Horizontal Scrolling */
            .account-options-slider {
                display: flex;
                gap: 14px;
                overflow-x: auto;
                padding: 4px 0 16px 0;
                scrollbar-width: none;
                -webkit-overflow-scrolling: touch;
            }
            .account-options-slider::-webkit-scrollbar { display: none; }

            .account-option-chip {
                flex-shrink: 0;
                display: flex;
                flex-direction: column;
                align-items: center;
                justify-content: center;
                gap: 10px;
                width: 90px;
                height: 100px;
                background: rgba(255, 255, 255, 0.04);
                border: 1px solid rgba(255, 255, 255, 0.08);
                border-radius: 20px;
                color: #A1A1A6;
                transition: all 0.3s ease;
                cursor: pointer;
            }

            .account-option-chip i { font-size: 24px; }
            .account-option-chip span { font-size: 12px; font-weight: 600; }
            
            .account-option-chip:active { transform: scale(0.95); background: rgba(255,255,255,0.08); }
            .account-option-chip.active {
                background: rgba(129, 161, 193, 0.1);
                border-color: rgba(129, 161, 193, 0.4);
                color: #3d91ff;
            }
            .account-option-chip.logout-chip { color: #FF453A; }
            .account-option-chip.logout-chip.active { background: rgba(255, 69, 58, 0.1); border-color: rgba(255, 69, 58, 0.4); }

            /* Settings Page Responsiveness */
            .account-layout { flex-direction: column !important; }
            .account-sidebar { 
                display: flex !important; 
                flex-direction: row !important; 
                width: 100% !important; 
                padding: 15px !important;
                border-right: none !important;
                border-bottom: 1px solid rgba(255,255,255,0.08);
                gap: 12px;
                overflow-x: auto;
                scrollbar-width: none;
            }
            .account-sidebar::-webkit-scrollbar { display: none; }
            .account-nav-list { flex-direction: row !important; display: flex !important; gap: 8px; }
            .account-nav-item { 
                padding: 8px 16px !important; 
                background: rgba(255,255,255,0.05); 
                border-radius: 10px !important; 
                white-space: nowrap; 
                font-size: 13px !important;
                flex-shrink: 0;
            }
            .account-nav-item.active { background: #3d91ff; color: #fff; }
            .account-sidebar-footer, .account-sidebar-title { display: none !important; }
            .account-main-content { padding: 20px !important; }
            .account-page-title { font-size: 24px !important; margin-bottom: 20px !important; }
            .account-overview-grid { grid-template-columns: 1fr !important; gap: 15px !important; }
        }

        /* Account → Preferences: Theme & Language (select visible on dark/light) */
        #account-tab-preferences .preferences-theme-lang-card {
            background: rgba(255, 255, 255, 0.04);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 14px;
            padding: 20px 22px;
        }
        body.theme-light #account-tab-preferences .preferences-theme-lang-card {
            background: #fff;
            border-color: #e5e7eb;
        }
        #account-tab-preferences .preferences-label {
            display: block;
            font-size: 13px;
            font-weight: 600;
            color: #e7e9ea !important;
            margin-bottom: 8px;
        }
        body.theme-light #account-tab-preferences .preferences-label {
            color: #0f1419 !important;
        }
        #account-tab-preferences .setting-row {
            margin-bottom: 22px;
        }
        #account-tab-preferences .setting-row:last-child {
            margin-bottom: 0;
        }
        #account-tab-preferences .setting-control {
            width: 100%;
            max-width: 420px;
        }
        .pi-sr-only {
            position: absolute !important;
            width: 1px !important;
            height: 1px !important;
            padding: 0 !important;
            margin: -1px !important;
            overflow: hidden !important;
            clip: rect(0, 0, 0, 0) !important;
            white-space: nowrap !important;
            border: 0 !important;
        }
        #account-tab-preferences .preferences-hint {
            font-size: 12px;
            color: #8b98a5;
            margin: 0 0 12px;
            line-height: 1.45;
        }
        body.theme-light #account-tab-preferences .preferences-hint {
            color: #64748b;
        }
        #account-tab-preferences .pi-lang-combobox,
        #account-tab-notifications .pi-combobox-wrap {
            position: relative;
            z-index: 5;
        }
        #account-tab-notifications .pi-combobox-wrap {
            min-width: 118px;
            flex-shrink: 0;
        }
        #account-tab-preferences .pi-combobox-trigger,
        #account-tab-notifications .pi-combobox-trigger {
            width: 100%;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            min-height: 48px;
            padding: 10px 14px 10px 16px;
            font-size: 14px;
            font-weight: 600;
            color: #e7e9ea;
            background: linear-gradient(180deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.03) 100%);
            border: 1px solid rgba(255, 255, 255, 0.14);
            border-radius: 12px;
            cursor: pointer;
            transition: border-color .2s, box-shadow .2s;
            text-align: left;
        }
        #account-tab-preferences .pi-combobox-trigger:hover,
        #account-tab-notifications .pi-combobox-trigger:hover {
            border-color: rgba(59, 130, 246, 0.45);
        }
        #account-tab-preferences .pi-combobox-trigger[aria-expanded="true"],
        #account-tab-notifications .pi-combobox-trigger[aria-expanded="true"] {
            border-color: #3b82f6;
            box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
        }
        #account-tab-preferences .pi-combobox-chevron,
        #account-tab-notifications .pi-combobox-chevron {
            font-size: 12px;
            opacity: 0.7;
            transition: transform .2s;
        }
        #account-tab-preferences .pi-combobox-trigger[aria-expanded="true"] .pi-combobox-chevron,
        #account-tab-notifications .pi-combobox-trigger[aria-expanded="true"] .pi-combobox-chevron {
            transform: rotate(180deg);
        }
        body.theme-light #account-tab-preferences .pi-combobox-trigger,
        body.theme-light #account-tab-notifications .pi-combobox-trigger {
            color: #0f172a;
            background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
            border-color: #e2e8f0;
        }
        #account-tab-preferences .pi-combobox-panel,
        #account-tab-notifications .pi-combobox-panel {
            position: absolute;
            left: 0;
            right: 0;
            top: calc(100% + 6px);
            background: rgba(24, 24, 27, 0.98);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 14px;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
            overflow: hidden;
        }
        body.theme-light #account-tab-preferences .pi-combobox-panel,
        body.theme-light #account-tab-notifications .pi-combobox-panel {
            background: #fff;
            border-color: #e5e7eb;
            box-shadow: 0 12px 40px rgba(15, 23, 42, 0.12);
        }
        #account-tab-preferences .pi-combobox-search-wrap {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px 12px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.06);
            color: #71717a;
        }
        body.theme-light #account-tab-preferences .pi-combobox-search-wrap {
            border-bottom-color: #f1f5f9;
            color: #64748b;
        }
        #account-tab-preferences .pi-combobox-filter {
            flex: 1;
            border: none;
            background: transparent;
            color: #e7e9ea;
            font-size: 13px;
            outline: none;
        }
        body.theme-light #account-tab-preferences .pi-combobox-filter {
            color: #0f172a;
        }
        #account-tab-preferences .pi-combobox-filter::placeholder {
            color: #71717a;
        }
        #account-tab-preferences .pi-combobox-list,
        #account-tab-notifications .pi-combobox-list {
            list-style: none;
            margin: 0;
            padding: 6px;
            max-height: 280px;
            overflow-y: auto;
            overflow-x: hidden;
        }
        #account-tab-preferences .pi-combobox-option,
        #account-tab-notifications .pi-combobox-option {
            display: block;
            width: 100%;
            box-sizing: border-box;
            margin: 0;
            padding: 10px 12px;
            border-radius: 10px;
            font-size: 14px;
            line-height: 1.4;
            font-weight: 500;
            color: #e4e4e7;
            cursor: pointer;
            transition: background .12s;
            text-align: left;
            white-space: normal;
            word-break: break-word;
        }
        #account-tab-preferences .pi-combobox-option:hover,
        #account-tab-notifications .pi-combobox-option:hover {
            background: rgba(59, 130, 246, 0.15);
            color: #fff;
        }
        body.theme-light #account-tab-preferences .pi-combobox-option,
        body.theme-light #account-tab-notifications .pi-combobox-option {
            color: #334155;
        }
        body.theme-light #account-tab-preferences .pi-combobox-option:hover,
        body.theme-light #account-tab-notifications .pi-combobox-option:hover {
            background: rgba(59, 130, 246, 0.1);
            color: #1e40af;
        }
        #account-tab-preferences .pi-combobox-option.is-selected,
        #account-tab-notifications .pi-combobox-option.is-selected {
            background: rgba(255, 255, 255, 0.06);
        }
        .pi-combobox-check {
            display: inline-flex;
            width: 1rem;
            margin-right: 0.45rem;
            color: #86efac;
            font-size: 0.75rem;
            flex-shrink: 0;
        }
        .pi-combobox-wrap--multi .pi-combobox-value {
            white-space: normal;
            line-height: 1.25;
        }

        /* Combobox dropdown: same visuals when panel is portaled to document.body */
        #language-combobox-panel.pi-combobox-panel,
        .pi-combobox-panel.pi-combobox-panel--portal {
            box-sizing: border-box;
            background: rgba(24, 24, 27, 0.98);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 14px;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
            overflow: hidden;
        }
        body.theme-light #language-combobox-panel.pi-combobox-panel,
        body.theme-light .pi-combobox-panel.pi-combobox-panel--portal {
            background: #fff;
            border-color: #e5e7eb;
            box-shadow: 0 12px 40px rgba(15, 23, 42, 0.12);
        }
        #language-combobox-panel .pi-combobox-search-wrap {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px 12px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.06);
            color: #71717a;
        }
        body.theme-light #language-combobox-panel .pi-combobox-search-wrap {
            border-bottom-color: #f1f5f9;
            color: #64748b;
        }
        #language-combobox-panel .pi-combobox-filter {
            flex: 1;
            min-width: 0;
            border: none;
            background: transparent;
            color: #e7e9ea;
            font-size: 13px;
            outline: none;
        }
        body.theme-light #language-combobox-panel .pi-combobox-filter {
            color: #0f172a;
        }
        #language-combobox-panel .pi-combobox-list,
        .pi-combobox-panel.pi-combobox-panel--portal .pi-combobox-list {
            list-style: none;
            margin: 0;
            padding: 6px;
            max-height: 280px;
            overflow-y: auto;
            overflow-x: hidden;
        }
        #language-combobox-panel .pi-combobox-option,
        .pi-combobox-panel.pi-combobox-panel--portal .pi-combobox-option {
            display: block;
            width: 100%;
            box-sizing: border-box;
            margin: 0;
            padding: 10px 12px;
            border-radius: 10px;
            font-size: 14px;
            line-height: 1.45;
            font-weight: 500;
            color: #e4e4e7;
            cursor: pointer;
            transition: background .12s;
            text-align: left;
            white-space: normal;
            word-break: break-word;
            list-style: none;
        }
        #language-combobox-panel .pi-combobox-option:hover,
        .pi-combobox-panel.pi-combobox-panel--portal .pi-combobox-option:hover {
            background: rgba(59, 130, 246, 0.15);
            color: #fff;
        }
        body.theme-light #language-combobox-panel .pi-combobox-option,
        body.theme-light .pi-combobox-panel.pi-combobox-panel--portal .pi-combobox-option {
            color: #334155;
        }
        body.theme-light #language-combobox-panel .pi-combobox-option:hover,
        body.theme-light .pi-combobox-panel.pi-combobox-panel--portal .pi-combobox-option:hover {
            background: rgba(59, 130, 246, 0.1);
            color: #1e40af;
        }

        /* Sidebar footer: version + online (replaces duplicate Account) */
        .sidebar-footer-meta {
            padding: 12px 14px;
            margin-top: auto;
            margin-left: 10px;
            margin-right: 10px;
            margin-bottom: 10px;
            border-top: 1px solid rgba(255, 255, 255, 0.06);
            background: rgba(0, 0, 0, 0.2);
            border-radius: 14px;
            overflow: hidden;
        }
        body.theme-light .sidebar-footer-meta {
            border-top-color: #e5e7eb;
            background: rgba(0, 0, 0, 0.03);
        }
        .sidebar-meta-card {
            border-radius: 12px;
            padding: 10px 12px;
            background: rgba(255, 255, 255, 0.04);
            border: 1px solid rgba(255, 255, 255, 0.08);
        }
        body.theme-light .sidebar-meta-card {
            background: #fff;
            border-color: #e5e7eb;
        }
        .sidebar-meta-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            font-size: 11px;
            color: #a3a3a3;
        }
        /* Author display:flex beats UA [hidden]; keep admin toggle effective */
        .sidebar-meta-row[hidden] {
            display: none !important;
        }
        .sidebar-meta-row + .sidebar-meta-row {
            margin-top: 8px;
            padding-top: 8px;
            border-top: 1px solid rgba(255, 255, 255, 0.06);
        }
        body.theme-light .sidebar-meta-row + .sidebar-meta-row {
            border-top-color: #f1f5f9;
        }
        .sidebar-meta-label {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            font-weight: 600;
            color: #d4d4d8;
        }
        body.theme-light .sidebar-meta-label {
            color: #475569;
        }
        .sidebar-meta-online {
            justify-content: flex-start;
            flex-wrap: nowrap;
            gap: 8px;
        }
        .sidebar-meta-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: #22c55e;
            box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25);
            flex-shrink: 0;
            animation: sidebar-pulse 2s ease-in-out infinite;
        }
        @keyframes sidebar-pulse {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.65; }
        }
        .sidebar-meta-online-text {
            font-size: 12px;
            color: #e4e4e7;
        }
        .sidebar-meta-online-text strong {
            color: #fafafa;
            font-weight: 700;
            display: inline-block;
            min-width: 1ch;
            font-variant-numeric: tabular-nums;
        }
        #sidebar-connection-quality.pi-quality-good {
            color: #22c55e;
        }
        #sidebar-connection-quality.pi-quality-mid {
            color: #f0b90b;
        }
        #sidebar-connection-quality.pi-quality-poor {
            color: #ff6b6b;
        }
        body.theme-light .sidebar-meta-online-text {
            color: #334155;
        }
        body.theme-light .sidebar-meta-online-text strong {
            color: #0f172a;
        }

        .sidebar-meta-version-tokens {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            flex-wrap: wrap;
        }
        .sidebar-meta-token-pill {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            padding: 3px 8px;
            border-radius: 999px;
            background: rgba(245, 158, 11, 0.12);
            border: 1px solid rgba(245, 158, 11, 0.28);
            font-size: 11px;
            color: #fcd34d;
            font-variant-numeric: tabular-nums;
        }
        .sidebar-meta-token-pill .fa-coins {
            font-size: 10px;
            opacity: 0.9;
        }
        .sidebar-meta-token-pill strong {
            color: #fde68a;
            font-weight: 700;
        }
        .sidebar-token-sep {
            opacity: 0.55;
        }
        .sidebar-meta-reset {
            margin-left: 4px;
            padding-left: 6px;
            border-left: 1px solid rgba(255, 255, 255, 0.12);
            font-size: 10px;
            color: #a1a1aa;
            font-variant-numeric: tabular-nums;
        }
        body.theme-light .sidebar-meta-token-pill {
            background: rgba(245, 158, 11, 0.1);
            border-color: rgba(217, 119, 6, 0.25);
            color: #b45309;
        }
        body.theme-light .sidebar-meta-token-pill strong {
            color: #92400e;
        }
        body.theme-light .sidebar-meta-reset {
            color: #64748b;
            border-left-color: rgba(15, 23, 42, 0.12);
        }

        .sidebar.collapsed .sidebar-footer,
        .sidebar.collapsed .sidebar-footer-meta {
            display: none !important;
        }

        /* Modern Pill Buttons */
        .modern-pill-group {
            display: flex;
            background: rgba(255, 255, 255, 0.05);
            padding: 4px;
            border-radius: 8px;
            gap: 4px;
            border: 1px solid rgba(255, 255, 255, 0.08);
        }

        .modern-pill-btn {
            background: transparent;
            color: #8E8E93;
            border: none;
            padding: 6px 14px;
            border-radius: 6px;
            cursor: pointer;
            transition: all 0.2s ease;
            font-weight: 500;
            font-size: 13px;
        }

        .modern-pill-btn:hover {
            color: #fff;
            background: rgba(255, 255, 255, 0.1);
        }

        .modern-pill-btn.active {
            background: #3d91ff;
            color: #fff;
            box-shadow: 0 0 10px rgba(129, 161, 193, 0.3);
        }

        /* Modern Checkbox */
        .modern-checkbox-label {
            display: flex;
            align-items: center;
            gap: 8px;
            cursor: pointer;
            font-size: 13px;
            color: #ccc;
            user-select: none;
            transition: color 0.2s;
        }

        .modern-checkbox-label:hover {
            color: #fff;
        }

        .modern-checkbox {
            appearance: none;
            -webkit-appearance: none;
            width: 16px;
            height: 16px;
            border: 1.5px solid #3d91ff;
            border-radius: 4px;
            background: transparent;
            cursor: pointer;
            position: relative;
            transition: background 0.2s;
            margin: 0;
            display: inline-block;
        }

        .modern-checkbox:checked {
            background: #3d91ff;
        }

        .modern-checkbox:checked::after {
            content: '\f00c';
            font-family: 'Font Awesome 6 Free';
            font-weight: 900;
            position: absolute;
            color: white;
            font-size: 10px;
            top: 0px;
        }
        
        /* Mobile: chart üstte; trade paneli tablet/mobil sheet kuralları (@media 1024px) yönetir */
        @media (max-width: 768px) {
            #top-horizontal-split {
                flex-direction: column !important;
            }
            #trade-h-resizer {
                display: none !important;
            }
            .chart-grid-container {
                min-height: 260px;
                flex: 1 1 auto;
            }
        }
        
        #page-charts.active {
            display: flex !important;
            flex-direction: column;
            position: relative;
            height: 100%;
            overflow-y: auto !important;
            padding: 24px;
            box-sizing: border-box;
        }

        #page-charts #main-vertical-split {
            height: auto !important;
            min-height: calc(100vh - 120px) !important;
            overflow: visible !important;
        }

        #page-charts #top-horizontal-split {
            min-height: 500px !important;
        }

        #active-positions-view,
        #position-history-view {
            height: calc(100% - 45px) !important;
            width: 100%;
        }

        #hist-table-container,
        #hist-calendar-container {
            height: calc(100% - 45px) !important;
            overflow-y: overlay !important;
            overflow-x: auto !important;
        }

        /* Allow active view to also scroll */
        #active-positions-view {
            overflow-y: overlay !important;
            overflow-x: auto !important;
        }
        
        #position-history-view {
            overflow: hidden !important;
        }

        /* Trading Panel Sidebar Animation */
        .custom-scroll-area::-webkit-scrollbar {
            width: 8px;
            height: 8px;
        }
        .custom-scroll-area::-webkit-scrollbar-track {
            background: transparent;
        }
        .custom-scroll-area::-webkit-scrollbar-thumb {
            background: rgba(255, 255, 255, 0.15);
            border-radius: 4px;
        }
        .custom-scroll-area::-webkit-scrollbar-thumb:hover {
            background: rgba(255, 255, 255, 0.3);
        }

        #trading-panel-sidebar {
            transition: width 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), min-width 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), padding 0.3s ease, opacity 0.3s ease, margin 0.3s ease;
        }

        #trading-panel-sidebar:not(.trade-panel--collapsed) {
            width: 340px !important;
            min-width: 280px !important;
            max-width: 600px !important;
            opacity: 1 !important;
            pointer-events: auto !important;
            position: relative;
            z-index: 10010;
            flex-shrink: 0 !important;
            display: flex !important;
            flex-direction: column !important;
            gap: 15px !important;
            overflow-y: auto !important;
            overflow-x: hidden !important;
            padding: 15px !important;
            background: #1c1c1e !important;
            border-left: 1px solid rgba(255, 255, 255, 0.08) !important;
        }

        #trading-panel-sidebar.trade-panel--collapsed {
            width: 0 !important;
            min-width: 0 !important;
            max-width: 0 !important;
            padding: 0 !important;
            gap: 0 !important;
            border: none !important;
            opacity: 0 !important;
            overflow: hidden !important;
            margin: 0 !important;
            flex-shrink: 0 !important;
            pointer-events: none !important;
        }

        #trading-panel-sidebar .settings-select {
            position: relative;
            z-index: 1;
            max-width: 100%;
        }

        /* Premium Number Input Redesign - Targeted only at spin buttons to avoid global conflicts */
        input[type="number"]::-webkit-inner-spin-button,
        input[type="number"]::-webkit-outer-spin-button {
            -webkit-appearance: none;
            opacity: 1 !important;
            background-color: rgba(255, 255, 255, 0.04);
            border-left: 1px solid rgba(255, 255, 255, 0.08);
            width: 26px;
            cursor: pointer;
            margin: 0;
            background-image: url('data:image/svg+xml;utf8,<svg width="12" height="18" viewBox="0 0 12 18" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M6 4L2 8h8L6 4zm0 10l4-4H2l4 4z" fill="%23848E9C"/></svg>');
            background-repeat: no-repeat;
            background-position: center;
            transition: all 0.2s ease;
        }

        input[type="number"]::-webkit-inner-spin-button:hover,
        input[type="number"]::-webkit-outer-spin-button:hover {
            background-color: rgba(255, 255, 255, 0.12);
            background-image: url('data:image/svg+xml;utf8,<svg width="12" height="18" viewBox="0 0 12 18" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M6 4L2 8h8L6 4zm0 10l4-4H2l4 4z" fill="%23FFFFFF"/></svg>');
        }

        /* --- App shell: align with public/index.php (flat, Inter, segmented controls) --- */
        body.theme-dark {
            --pi-landing-bg: #0f0f0f;
            --pi-landing-surface: #171717;
            --pi-landing-border: #262626;
            --pi-landing-accent: #3b82f6;
            --pi-landing-muted: #a3a3a3;
        }

        body.theme-dark .dashboard-container {
            background: var(--pi-landing-bg);
        }

        body.theme-dark .sidebar {
            background: var(--pi-landing-surface);
            border-right: 1px solid var(--pi-landing-border);
        }

        body.theme-dark .sidebar-header {
            border-bottom-color: var(--pi-landing-border);
        }

        body.theme-dark .sidebar-nav {
            padding: 8px 10px;
            gap: 2px;
        }

        body.theme-dark .sidebar-nav .nav-link {
            border-radius: 8px;
            padding: 11px 14px;
            font-size: 14px;
            font-weight: 500;
            border: 1px solid transparent;
            margin-bottom: 0;
        }

        body.theme-dark .sidebar-nav .nav-link:hover {
            background: #262626;
            color: #fafafa;
        }

        body.theme-dark .sidebar-nav .nav-link.active {
            background: #262626;
            color: #fafafa;
            border-color: rgba(255, 255, 255, 0.06);
            box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
        }

        body.theme-dark .sidebar-nav .nav-link i {
            color: var(--pi-landing-muted);
        }

        body.theme-dark .sidebar-nav .nav-link.active i,
        body.theme-dark .sidebar-nav .nav-link:hover i {
            color: inherit;
        }

        body.theme-dark .account-link {
            border-radius: 8px !important;
            border-color: var(--pi-landing-border) !important;
            background: #141414 !important;
        }

        body.theme-dark .main-header {
            background: var(--pi-landing-surface);
            border-bottom: 1px solid var(--pi-landing-border);
        }

        body.theme-dark .main-header .page-title {
            font-size: 18px;
            font-weight: 600;
            letter-spacing: -0.02em;
        }

        body.theme-dark .chart-toolbar {
            background: var(--pi-landing-surface);
            border-bottom: 1px solid var(--pi-landing-border);
            align-items: flex-start;
        }

        body.theme-dark .chart-toolbar .header-layout-selector {
            padding: 4px;
            gap: 2px;
            background: var(--pi-landing-bg);
            border: 1px solid var(--pi-landing-border);
            border-radius: 10px;
        }

        body.theme-dark .chart-toolbar .header-layout-selector .header-btn {
            border-radius: 8px;
            border: none;
            background: transparent;
        }

        body.theme-dark .chart-toolbar .header-layout-selector .header-btn:hover {
            background: #262626;
            color: #fafafa;
        }

        body.theme-dark .chart-toolbar .header-layout-selector .header-btn.active {
            background: #262626;
            color: #fafafa;
        }

        body.theme-dark .chart-toolbar .chart-actions {
            flex-wrap: wrap;
            gap: 4px;
            padding: 4px;
            background: var(--pi-landing-bg);
            border: 1px solid var(--pi-landing-border);
            border-radius: 10px;
        }

        body.theme-dark .chart-toolbar .chart-actions .header-btn {
            border-radius: 8px;
            border: none;
            background: transparent;
        }

        body.theme-dark .chart-toolbar .chart-actions .header-btn:hover {
            background: #262626;
            color: #fafafa;
        }

        body.theme-dark .modern-glass-card {
            background: var(--pi-landing-surface);
            border: 1px solid var(--pi-landing-border);
            border-radius: 12px;
            box-shadow: none;
            backdrop-filter: none;
            -webkit-backdrop-filter: none;
        }

        body.theme-dark .modern-glass-card:hover {
            border-color: #404040;
            background: #1a1a1a;
            transform: translateY(-2px);
        }

        body.theme-dark .dashboard-section-title {
            color: #737373;
            letter-spacing: 0.06em;
        }

        body.theme-dark .dashboard-section-title i {
            color: var(--pi-landing-accent);
        }

        /* Chart settings: labels + hints (select visuals: injected #chartSettingsModalBody select.pi-chart-settings-select) */
        #chartSettingsModalBody .chart-candle-style-row > label,
        #chartSettingsModalBody .chart-timezone-row > label {
            width: 100%;
            font-weight: 600;
            color: #a1a1aa;
        }
        #chartSettingsModalBody .chart-candle-style-hint,
        #chartSettingsModalBody .chart-timezone-hint {
            font-size: 12px;
            color: #71717a;
            margin: 0 0 8px;
            line-height: 1.45;
        }
        #chartSettingsModalBody .chart-timezone-hint {
            margin-top: 12px;
        }
        body.theme-light #chartSettingsModalBody .chart-candle-style-row > label,
        body.theme-light #chartSettingsModalBody .chart-timezone-row > label {
            color: #475569;
        }
        body.theme-light #chartSettingsModalBody .chart-candle-style-hint,
        body.theme-light #chartSettingsModalBody .chart-timezone-hint {
            color: #64748b;
        }

        body.theme-light {
            --pi-light-bg: #f6f8fc;
            --pi-light-surface: #ffffff;
            --pi-light-surface-2: #f8fafc;
            --pi-light-border: #dbe3ef;
            --pi-light-border-strong: #c7d3e4;
            --pi-light-text: #0f172a;
            --pi-light-text-muted: #475569;
            --pi-light-shadow: 0 8px 24px rgba(15, 23, 42, 0.07);
            --bg-primary: #f6f8fc;
            --bg-secondary: #ffffff;
            --content-bg: #ffffff;
            --text-primary: #0f172a;
            --text-secondary: #475569;
            --text-tertiary: #64748b;
            --border-color: #dbe3ef;
            --input-bg: #ffffff;
            --input-border: #cbd5e1;
        }

        body.theme-light .dashboard-container {
            background: var(--pi-light-bg);
        }

        body.theme-light .sidebar {
            background: var(--pi-light-surface);
            border-right: 1px solid var(--pi-light-border);
            box-shadow: 2px 0 18px rgba(15, 23, 42, 0.04);
        }

        body.theme-light .sidebar-header,
        body.theme-light .main-header {
            background: var(--pi-light-surface);
            border-bottom: 1px solid var(--pi-light-border);
        }

        body.theme-light .main-header .page-title {
            color: var(--pi-light-text);
        }

        body.theme-light .sidebar-nav .nav-link {
            color: var(--pi-light-text-muted);
            border: 1px solid transparent;
            border-radius: 8px;
        }

        body.theme-light .sidebar-nav .nav-link:hover,
        body.theme-light .sidebar-nav .nav-link.active {
            background: #eef3fb;
            color: var(--pi-light-text);
            border-color: var(--pi-light-border);
        }

        body.theme-light .sidebar-nav .nav-link i {
            color: #64748b;
        }

        body.theme-light .sidebar-nav .nav-link:hover i,
        body.theme-light .sidebar-nav .nav-link.active i {
            color: #334155;
        }

        body.theme-light .account-link {
            background: #f8fafc !important;
            border-color: var(--pi-light-border) !important;
        }

        body.theme-light .page-content {
            background: var(--pi-light-bg);
        }

        body.theme-light .chart-toolbar {
            background: var(--pi-light-surface);
            border-bottom: 1px solid var(--pi-light-border);
        }

        body.theme-light .chart-toolbar .header-layout-selector,
        body.theme-light .chart-toolbar .chart-actions {
            background: var(--pi-light-surface-2);
            border: 1px solid var(--pi-light-border);
            border-radius: 10px;
            padding: 4px;
            gap: 2px;
        }

        body.theme-light .chart-toolbar .header-btn {
            color: var(--pi-light-text-muted);
        }

        body.theme-light .chart-toolbar .header-layout-selector .header-btn.active,
        body.theme-light .chart-toolbar .chart-actions .header-btn:hover {
            background: #ffffff;
            color: var(--pi-light-text);
            border-color: var(--pi-light-border-strong);
        }

        body.theme-light .modern-glass-card,
        body.theme-light .widget-card,
        body.theme-light .btc-card,
        body.theme-light .chart-wrapper {
            background: var(--pi-light-surface);
            border: 1px solid var(--pi-light-border);
            box-shadow: var(--pi-light-shadow);
            backdrop-filter: none;
            -webkit-backdrop-filter: none;
        }

        body.theme-light .modal-overlay {
            background: rgba(15, 23, 42, 0.28);
            backdrop-filter: blur(6px);
            -webkit-backdrop-filter: blur(6px);
        }

        body.theme-light .modal-content,
        body.theme-light .indicator-modal-content {
            background: #ffffff;
            border-color: var(--pi-light-border);
            box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
        }

        body.theme-light .modal-header,
        body.theme-light .indicator-modal-content .modal-header {
            background: #ffffff;
            border-bottom: 1px solid var(--pi-light-border);
        }

        body.theme-light .modal-header h3,
        body.theme-light .indicator-modal-content .modal-header h3 {
            color: var(--pi-light-text);
        }

        body.theme-light .indicator-modal-content .modal-body-wrapper {
            background: #f8fafc;
        }

        body.theme-light .indicator-modal-content .modal-sidebar {
            background: #ffffff;
            border-right: 1px solid var(--pi-light-border);
        }

        body.theme-light .indicator-modal-content .sidebar-search input {
            background: #f8fafc;
            color: var(--pi-light-text);
            border-color: var(--pi-light-border);
        }

        body.theme-light .indicator-modal-content .sidebar-btn {
            color: #475569;
        }

        body.theme-light .indicator-modal-content .sidebar-btn:hover,
        body.theme-light .indicator-modal-content .sidebar-btn.active {
            background: #eaf1fb;
            color: #0f172a;
        }

        body.theme-light .close-modal {
            background: #eef2f7;
            color: #334155;
        }

        body.theme-light .close-modal:hover {
            background: #e2e8f0;
            color: #0f172a;
        }

        body.theme-light .ai-chat-panel {
            background: rgba(255, 255, 255, 0.92);
            border-left: 1px solid var(--pi-light-border);
            box-shadow: -8px 0 24px rgba(15, 23, 42, 0.09);
        }

        body.theme-light .ai-panel-header {
            background: #ffffff;
            border-bottom: 1px solid var(--pi-light-border);
        }

        body.theme-light .ai-panel-header h3 {
            color: var(--pi-light-text);
        }

        body.theme-light .ai-panel-header button {
            background: #eef2f7;
            color: #475569;
        }

        body.theme-light .ai-panel-header button:hover {
            background: #e2e8f0;
            color: #1e293b;
        }

        body.theme-light input,
        body.theme-light select,
        body.theme-light textarea,
        body.theme-light .apple-search-bar {
            background: #ffffff;
            color: var(--pi-light-text);
            border-color: var(--pi-light-border-strong);
        }

        body.theme-light table,
        body.theme-light .finder-table,
        body.theme-light .positions-table {
            color: var(--pi-light-text);
        }

        body.theme-light .finder-table th,
        body.theme-light .positions-table th {
            background: #f8fafc;
            color: #334155;
            border-bottom: 1px solid var(--pi-light-border);
        }

        body.theme-light .finder-table td,
        body.theme-light .positions-table td {
            border-bottom: 1px solid #e7edf6;
        }

        @media (max-width: 768px) {
            body.theme-dark .chart-toolbar,
            body.theme-light .chart-toolbar {
                flex-direction: column;
                align-items: stretch;
                gap: 10px;
                padding: 10px 12px;
            }

            body.theme-dark .chart-toolbar .header-layout-selector,
            body.theme-light .chart-toolbar .header-layout-selector {
                width: 100%;
                justify-content: flex-start;
                overflow-x: auto;
                -webkit-overflow-scrolling: touch;
                flex-wrap: nowrap;
                scrollbar-width: thin;
            }

            body.theme-dark .chart-toolbar .chart-actions,
            body.theme-light .chart-toolbar .chart-actions {
                width: 100%;
                justify-content: flex-start;
                overflow-x: auto;
                -webkit-overflow-scrolling: touch;
                flex-wrap: nowrap;
            }

            body.theme-dark .chart-toolbar .header-btn,
            body.theme-light .chart-toolbar .header-btn {
                min-width: 44px;
                min-height: 44px;
                flex-shrink: 0;
            }

            .page-content {
                padding: 16px 12px !important;
            }

            #page-feed.page-content {
                padding: 0 !important;
            }

            #page-charts.page-content {
                padding: 16px 12px !important;
            }

            #page-home h1 {
                font-size: 1.35rem;
                line-height: 1.3;
            }
        }

        /* ─── Feed (X / Twitter tarzı, Yeux tema uyumu) ─── */
        body.theme-dark #page-feed,
        body.theme-dark #page-profile {
            --feed-fg: #fafafa;
            --feed-muted: #a3a3a3;
            --feed-muted2: #737373;
            --feed-line: #262626;
            --feed-surface: #141414;
            --feed-surface2: #171717;
            --feed-accent: #3b82f6;
            --feed-hover: rgba(255,255,255,0.04);
        }
        body.theme-light #page-feed,
        body.theme-light #page-profile {
            --feed-fg: #0f1419;
            --feed-muted: #536471;
            --feed-muted2: #8899a6;
            --feed-line: #eff3f4;
            --feed-surface: #ffffff;
            --feed-surface2: #f7f9f9;
            --feed-accent: #2563eb;
            --feed-hover: rgba(0,0,0,0.03);
        }

        /* Feed page: use full main column width (avoid nested max-width clashes) */
        #page-feed.page-content {
            width: 100%;
            max-width: none;
            padding: 0 !important;
            box-sizing: border-box;
            align-self: stretch;
        }
        #page-feed {
            max-width: none;
            margin: 0;
            padding: 0 !important;
            background: #0f0f0f;
        }
        body.theme-light #page-feed {
            background: transparent;
        }
        .feed-shell {
            width: 100%;
            max-width: none;
            margin: 0;
            padding: 10px 12px 24px;
            box-sizing: border-box;
        }
        @media (min-width: 900px) {
            .feed-shell { padding: 14px 20px 32px; }
        }
        #page-feed .feed-wrap--modern,
        #page-feed .feed-wrap.feed-wrap--modern {
            background: var(--feed-surface);
            border: 1px solid var(--feed-line);
            min-height: calc(100vh - 24px);
            width: 100%;
            max-width: none;
            margin: 0;
            border-radius: 12px;
            box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset, 0 8px 32px rgba(0,0,0,0.35);
            overflow: hidden;
        }
        body.theme-light #page-feed .feed-wrap.feed-wrap--modern {
            box-shadow: 0 4px 24px rgba(15,23,42,0.06);
        }

        .feed-wrap { display: flex; flex-direction: column; }

        /* ── Composer ── */
        .feed-composer {
            display: flex;
            gap: 14px;
            padding: 18px 18px 16px;
            margin: 0;
            border-bottom: 1px solid var(--feed-line);
            background: var(--feed-surface2);
        }
        .feed-avatar, .feed-avatar-sm {
            flex-shrink: 0;
            width: 42px; height: 42px;
            border-radius: 999px;
            background: linear-gradient(145deg, #2563eb 0%, #1d4ed8 100%);
            color: #fff; font-weight: 700; font-size: 15px;
            display: flex; align-items: center; justify-content: center;
        }
        .feed-avatar-sm { width: 32px; height: 32px; font-size: 12px; }

        .feed-composer-main { flex: 1; min-width: 0; }
        .feed-composer textarea {
            width: 100%; box-sizing: border-box;
            border: none; border-radius: 0;
            padding: 8px 0 4px; font: inherit;
            font-size: 20px; line-height: 1.35; font-weight: 400;
            resize: none; min-height: 52px;
            background: transparent; color: var(--feed-fg);
        }
        .feed-composer textarea::placeholder { color: var(--feed-muted2); }
        .feed-composer textarea:focus { outline: none; }

        .feed-composer-preview {
            position: relative;
            margin: 10px 0 4px;
            border-radius: 16px;
            overflow: hidden;
            max-height: 280px;
            border: 1px solid var(--feed-line);
        }
        .feed-composer-preview img {
            display: block;
            width: 100%; max-height: 280px;
            object-fit: cover;
            border-radius: 16px;
        }
        .feed-composer-preview-remove {
            position: absolute; top: 6px; right: 6px;
            width: 32px; height: 32px;
            border-radius: 999px;
            background: rgba(15,20,25,0.75);
            backdrop-filter: blur(4px);
            color: #fff; font-size: 18px; line-height: 1;
            border: none; cursor: pointer;
            display: flex; align-items: center; justify-content: center;
            transition: background .15s;
        }
        .feed-composer-preview-remove:hover { background: rgba(15,20,25,0.9); }

        .feed-composer-foot {
            display: flex; justify-content: space-between; align-items: center;
            margin-top: 10px; padding-top: 10px;
            border-top: 1px solid var(--feed-line);
        }
        .feed-composer-actions {
            display: flex; align-items: center; gap: 4px;
        }
        .feed-composer-icon-btn {
            display: inline-flex; align-items: center; justify-content: center;
            width: 36px; height: 36px; border-radius: 999px;
            color: var(--feed-accent); font-size: 18px;
            cursor: pointer; transition: background .15s;
        }
        .feed-composer-icon-btn:hover {
            background: rgba(59,130,246,0.12);
        }
        .feed-char-count {
            font-size: 13px; font-variant-numeric: tabular-nums;
            color: var(--feed-muted); margin-left: 8px;
        }
        .feed-composer-foot .header-btn,
        #page-feed .feed-load-more-wrap .header-btn {
            border-radius: 999px; padding: 8px 20px;
            font-weight: 700; font-size: 15px; border: none;
            background: var(--feed-accent) !important;
            color: #fff !important;
            transition: filter .15s;
        }
        .feed-composer-foot .header-btn:hover,
        #page-feed .feed-load-more-wrap .header-btn:hover {
            filter: brightness(1.12);
        }

        /* ── Feed list ── */
        .feed-list { display: flex; flex-direction: column; }
        .feed-card {
            border-bottom: 1px solid var(--feed-line);
            padding: 16px 18px;
            transition: background .15s, box-shadow .15s;
            cursor: default;
            position: relative;
        }
        .feed-card::before {
            content: '';
            position: absolute;
            left: 0;
            top: 0;
            bottom: 0;
            width: 3px;
            background: #3b82f6;
            opacity: 0;
            transition: opacity .15s;
        }
        .feed-card:hover {
            background: var(--feed-hover);
            box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
        }
        .feed-card:hover::before { opacity: 1; }

        .feed-repost-banner {
            font-size: 13px; color: var(--feed-muted);
            margin: 0 0 4px 54px;
            display: flex; align-items: center; gap: 6px;
        }
        .feed-repost-banner i { font-size: 12px; }

        .feed-tweet-row { display: flex; gap: 12px; align-items: flex-start; }
        .feed-tweet-main { flex: 1; min-width: 0; }
        .feed-tweet-head {
            display: flex; flex-wrap: wrap;
            align-items: baseline; gap: 4px 6px;
            font-size: 15px; line-height: 1.2; margin-bottom: 2px;
        }
        .feed-name { font-weight: 700; color: var(--feed-fg); }
        .feed-handle, .feed-time { color: var(--feed-muted); font-size: 15px; }
        .feed-dot { color: var(--feed-muted2); font-size: 3px; vertical-align: middle; display: inline-block; width: 3px; height: 3px; border-radius: 50%; background: var(--feed-muted2); }

        .feed-clickable { cursor: pointer; text-decoration: none; color: inherit; }
        .feed-clickable:hover { text-decoration: underline; }
        .feed-avatar.feed-clickable:hover { text-decoration: none; filter: brightness(1.1); }

        .feed-tweet-text {
            font-size: 15px; line-height: 1.55;
            color: var(--feed-fg);
            white-space: pre-wrap; word-break: break-word;
        }

        /* ── Image in post ── */
        .feed-tweet-image {
            margin-top: 12px;
            border-radius: 16px;
            overflow: hidden;
            border: 1px solid var(--feed-line);
            max-height: 510px;
        }
        .feed-tweet-image img {
            display: block; width: 100%;
            max-height: 510px; object-fit: cover;
        }

        /* ── Toolbar ── */
        .feed-toolbar {
            display: flex; align-items: center;
            gap: 2px; margin-top: 12px;
            max-width: 425px;
        }
        .feed-tb-btn {
            display: inline-flex; align-items: center; justify-content: center;
            gap: 6px; min-width: 40px; height: 34px;
            padding: 0 10px; border: none; background: none;
            color: var(--feed-muted); font-size: 13px; font-weight: 500;
            cursor: pointer; border-radius: 999px;
            transition: background .12s, color .12s;
        }
        .feed-tb-btn:hover { transform: none; }
        .feed-tb-btn.feed-tb-reply:hover { background: rgba(59,130,246,0.12); color: #3b82f6; }
        .feed-tb-btn.feed-tb-repost:hover { background: rgba(0,186,124,0.1); color: #00ba7c; }
        .feed-tb-btn.feed-tb-like:hover { background: rgba(249,24,128,0.1); color: #f91880; }
        .feed-tb-btn.feed-tb-like.feed-tb-on { color: #f91880; }
        .feed-tb-btn.feed-tb-like.feed-tb-on i { animation: feedHeartPop .35s ease; }
        .feed-tb-btn.feed-tb-repost.feed-tb-on { color: #00ba7c; }
        .feed-tb-btn.feed-tb-del:hover { background: rgba(244,33,46,0.1); color: #f4212e; }
        .feed-tb-n { min-width: 1.25em; font-variant-numeric: tabular-nums; }

        @keyframes feedHeartPop {
            0% { transform: scale(1); }
            30% { transform: scale(1.35); }
            100% { transform: scale(1); }
        }

        /* ── Comments ── */
        .feed-comments {
            margin-top: 12px; padding: 12px 0 4px;
            border-top: 1px solid var(--feed-line);
            display: none;
        }
        .feed-comments.feed-comments-open { display: block; }
        .feed-comment-row { display: flex; gap: 10px; margin-bottom: 12px; align-items: flex-start; }
        .feed-comment-body { flex: 1; min-width: 0; font-size: 14px; }
        .feed-comment-head { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; margin-bottom: 3px; }
        .feed-comment-head strong { color: var(--feed-fg); }
        .feed-comment-text { color: var(--feed-fg); white-space: pre-wrap; word-break: break-word; line-height: 1.45; }
        .feed-comment-del { font-size: 12px; color: var(--feed-muted); background: none; border: none; cursor: pointer; padding: 0; margin-top: 4px; }
        .feed-comment-del:hover { color: #f4212e; }
        .feed-comment-form { display: flex; gap: 10px; align-items: flex-end; margin-top: 10px; padding-top: 12px; border-top: 1px dashed var(--feed-line); }
        .feed-comment-form textarea {
            flex: 1; min-height: 42px;
            border: 1px solid var(--feed-line); border-radius: 999px;
            padding: 9px 16px; font: inherit; font-size: 14px;
            background: var(--feed-surface2); color: var(--feed-fg); resize: none;
        }
        .feed-comment-form textarea:focus { border-color: var(--feed-accent); outline: none; }
        body.theme-light .feed-comment-form textarea { background: var(--feed-surface2); }
        .feed-comment-form .header-btn {
            border-radius: 999px; flex-shrink: 0; padding: 8px 16px;
            font-weight: 700; background: var(--feed-accent) !important;
            color: #fff !important; border: none !important;
        }

        .feed-empty {
            text-align: center; padding: 64px 24px;
            color: var(--feed-muted); font-size: 15px; line-height: 1.6;
            border-bottom: 1px solid var(--feed-line);
        }
        .feed-load-more-wrap {
            display: flex; justify-content: center;
            padding: 20px 16px 28px;
        }

        /* ── Search bar ── */
        .feed-search-bar {
            position: relative;
            padding: 14px 16px;
            border-bottom: 1px solid var(--feed-line);
            background: var(--feed-surface);
        }
        body.theme-light .feed-search-bar {
            background: var(--feed-surface);
        }
        .feed-search-input-wrap {
            position: relative;
            display: flex;
            align-items: center;
        }
        .feed-search-icon {
            position: absolute; left: 14px;
            color: var(--feed-muted); font-size: 14px;
            pointer-events: none;
        }
        .feed-search-input {
            width: 100%; box-sizing: border-box;
            padding: 10px 16px 10px 40px;
            border-radius: 999px;
            border: 1px solid var(--feed-line);
            background: var(--feed-surface2, var(--feed-surface));
            color: var(--feed-fg);
            font: inherit; font-size: 15px;
            transition: border-color .15s, box-shadow .15s;
        }
        .feed-search-input::placeholder { color: var(--feed-muted2); }
        .feed-search-input:focus {
            outline: none;
            border-color: var(--feed-accent);
            box-shadow: 0 0 0 3px rgba(59,130,246,0.18);
        }
        .feed-search-results {
            position: absolute; left: 16px; right: 16px; top: 100%;
            background: var(--feed-surface);
            border: 1px solid var(--feed-line);
            border-radius: 12px;
            box-shadow: 0 8px 32px rgba(0,0,0,0.35);
            z-index: 100; max-height: 320px; overflow-y: auto;
        }
        body.theme-light .feed-search-results {
            box-shadow: 0 4px 16px rgba(15,23,42,0.12);
        }
        .feed-search-item {
            display: flex; align-items: center; gap: 12px;
            padding: 10px 16px;
            cursor: pointer;
            transition: background .1s;
            color: var(--feed-fg);
        }
        .feed-search-item:first-child { border-radius: 12px 12px 0 0; }
        .feed-search-item:last-child { border-radius: 0 0 12px 12px; }
        .feed-search-item:hover { background: var(--feed-hover); }
        .feed-search-item .feed-avatar-sm { flex-shrink: 0; }
        .feed-search-item-info { flex: 1; min-width: 0; }
        .feed-search-item-name { font-weight: 700; font-size: 15px; color: var(--feed-fg); }
        .feed-search-item-handle { font-size: 14px; color: var(--feed-muted); }
        .feed-search-empty {
            padding: 16px; text-align: center;
            color: var(--feed-muted); font-size: 14px;
        }

        /* ── Profile topbar ── */
        .profile-topbar {
            display: flex; align-items: center; gap: 12px;
            padding: 8px 16px;
            border-bottom: 1px solid var(--feed-line);
            min-height: 48px;
            position: sticky; top: 0;
            background: var(--feed-surface);
            backdrop-filter: blur(12px);
            z-index: 10;
        }
        .profile-back-btn, .profile-link-btn {
            display: inline-flex; align-items: center; justify-content: center;
            width: 36px; height: 36px;
            border-radius: 999px; border: none;
            background: transparent; color: var(--feed-fg);
            cursor: pointer; font-size: 16px;
            transition: background .12s;
        }
        .profile-back-btn:hover, .profile-link-btn:hover {
            background: var(--feed-hover);
        }
        .profile-link-btn { margin-left: auto; font-size: 15px; color: var(--feed-muted); }
        .profile-link-btn:hover { color: var(--feed-accent); }
        .profile-topbar-name {
            font-weight: 700; font-size: 17px;
            color: var(--feed-fg);
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
        }
        .profile-link-copied {
            font-size: 12px; color: var(--feed-accent);
            margin-left: auto; font-weight: 600;
            animation: feedFadeIn .2s ease;
        }
        @keyframes feedFadeIn { from { opacity:0; transform:translateY(-4px); } to { opacity:1; transform:translateY(0); } }

        /* ── Feed nav tabs (dark: neutral, active: blue accent) ── */
        .feed-nav-tabs {
            display: flex;
            gap: 8px;
            padding: 12px 14px 10px;
            border-bottom: 1px solid var(--feed-line);
            background: #0f0f0f;
        }
        body.theme-light .feed-nav-tabs {
            background: var(--feed-surface2);
        }
        .feed-nav-tab {
            flex: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            padding: 11px 12px;
            font-size: 14px;
            font-weight: 600;
            color: var(--feed-muted);
            background: #171717;
            border: 1px solid var(--feed-line);
            border-radius: 10px;
            cursor: pointer;
            transition: color .15s, background .15s, border-color .15s;
        }
        body.theme-light .feed-nav-tab {
            background: #fff;
        }
        .feed-nav-tab:hover {
            color: var(--feed-fg);
            border-color: rgba(59,130,246,0.35);
            background: #1f1f1f;
        }
        body.theme-light .feed-nav-tab:hover {
            background: #f8fafc;
        }
        .feed-nav-tab.active {
            color: #fafafa;
            background: #1e3a5f;
            border-color: rgba(59,130,246,0.45);
            box-shadow: 0 0 0 1px rgba(59,130,246,0.25);
        }
        body.theme-light .feed-nav-tab.active {
            color: #fff;
            background: #2563eb;
            border-color: #2563eb;
            box-shadow: none;
        }
        .feed-msg-badge {
            background: var(--feed-accent); color: #fff;
            font-size: 11px; font-weight: 700;
            min-width: 18px; height: 18px;
            border-radius: 999px; padding: 0 5px;
            display: inline-flex; align-items: center; justify-content: center;
        }

        /* ── DM Conversations ── */
        .feed-dm-header {
            padding: 18px 18px 16px;
            border-bottom: 1px solid var(--feed-line);
            background: var(--feed-surface2);
        }
        .feed-dm-header h3 {
            margin: 0;
            font-size: 18px;
            font-weight: 800;
            letter-spacing: -0.02em;
            color: var(--feed-fg);
        }
        .feed-dm-convo-list { display: flex; flex-direction: column; }
        .feed-dm-convo-item {
            display: flex; align-items: center; gap: 12px;
            padding: 12px 16px; cursor: pointer;
            border-bottom: 1px solid var(--feed-line);
            transition: background .1s; color: var(--feed-fg);
        }
        .feed-dm-convo-item:hover { background: var(--feed-hover); }
        .feed-dm-convo-info { flex: 1; min-width: 0; }
        .feed-dm-convo-name {
            font-weight: 700; font-size: 15px; color: var(--feed-fg);
        }
        .feed-dm-convo-preview {
            font-size: 13px; color: var(--feed-muted);
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
        }
        .feed-dm-convo-meta {
            text-align: right; flex-shrink: 0;
        }
        .feed-dm-convo-time {
            font-size: 12px; color: var(--feed-muted);
        }
        .feed-dm-convo-unread {
            background: var(--feed-accent); color: #fff;
            font-size: 11px; font-weight: 700; border-radius: 999px;
            min-width: 18px; height: 18px; padding: 0 5px;
            display: inline-flex; align-items: center; justify-content: center;
            margin-top: 4px;
        }

        /* ── DM Chat ── */
        .feed-dm-chat { display: flex; flex-direction: column; height: 65vh; }
        .feed-dm-chat-header {
            display: flex; align-items: center; gap: 12px;
            padding: 10px 16px; border-bottom: 1px solid var(--feed-line);
        }
        .feed-dm-chat-name {
            font-weight: 700; font-size: 16px; color: var(--feed-fg);
        }
        .feed-dm-chat-messages {
            flex: 1; overflow-y: auto; padding: 16px;
            display: flex; flex-direction: column; gap: 8px;
        }
        .feed-dm-chat-messages .profile-msg-bubble { max-width: 70%; }
        .feed-dm-chat-form {
            display: flex; gap: 10px; padding: 10px 16px;
            border-top: 1px solid var(--feed-line);
            align-items: flex-end;
        }
        .feed-dm-chat-form textarea {
            flex: 1; min-height: 38px;
            border: 1px solid var(--feed-line); border-radius: 999px;
            padding: 8px 16px; font: inherit; font-size: 14px;
            background: var(--feed-surface2); color: var(--feed-fg); resize: none;
        }
        .feed-dm-chat-form textarea:focus {
            border-color: var(--feed-accent); outline: none;
        }
        .feed-dm-chat-form .header-btn {
            border-radius: 999px; padding: 8px 16px; font-weight: 700;
            background: var(--feed-accent) !important;
            color: #fff !important; border: none !important;
        }

        @media (max-width: 640px) {
            #page-feed .feed-wrap,
            #page-profile .feed-wrap {
                border-left: none;
                border-right: none;
            }
        }

        /* ─── Profile Page (legacy — X layout lives in app-feed-modern.css) ─── */
        #page-profile {
            max-width: 100%;
            margin: 0;
            padding: 0 !important;
        }
        #page-profile .feed-wrap:not(.feed-wrap--profile-x) {
            background: var(--feed-surface);
            border-left: 1px solid var(--feed-line);
            border-right: 1px solid var(--feed-line);
            min-height: 100vh;
            max-width: 100%;
            margin: 0;
            border-radius: 0;
        }

        #page-profile .feed-wrap--profile-x .profile-header {
            display: none;
        }

        .profile-header {
            padding: 24px 16px 20px;
            border-bottom: 1px solid var(--feed-line);
            display: flex; gap: 16px;
            align-items: flex-start;
        }
        .profile-avatar-lg {
            flex-shrink: 0; width: 68px; height: 68px;
            border-radius: 999px;
            background: linear-gradient(145deg, #2563eb 0%, #1d4ed8 100%);
            color: #fff; font-weight: 800; font-size: 26px;
            display: flex; align-items: center; justify-content: center;
        }
        .profile-info { flex: 1; min-width: 0; }
        .profile-name {
            font-size: 20px; font-weight: 800;
            color: var(--feed-fg);
            letter-spacing: -0.02em; line-height: 1.2;
        }
        .profile-handle {
            font-size: 15px; color: var(--feed-muted);
            margin-top: 2px;
        }
        .profile-stats {
            display: flex; gap: 20px;
            margin-top: 12px; font-size: 14px;
            color: var(--feed-muted);
        }
        .profile-stats strong { color: var(--feed-fg); font-weight: 700; }
        .profile-actions { display: flex; gap: 10px; margin-top: 14px; }
        .profile-btn-follow {
            border-radius: 999px; padding: 8px 20px;
            font-weight: 700; font-size: 14px;
            border: 1px solid var(--feed-line);
            cursor: pointer; transition: all .15s;
            background: transparent; color: var(--feed-fg);
        }
        .profile-btn-follow:hover {
            border-color: var(--feed-accent); color: var(--feed-accent);
        }
        .profile-btn-follow.following {
            background: var(--feed-accent); color: #fff;
            border-color: transparent;
        }
        .profile-btn-msg {
            border-radius: 999px; padding: 8px 16px;
            font-weight: 600; font-size: 14px;
            border: 1px solid var(--feed-line);
            cursor: pointer; transition: all .15s;
            background: transparent; color: var(--feed-fg);
        }
        .profile-btn-msg:hover {
            border-color: var(--feed-accent); color: var(--feed-accent);
        }
        .profile-tabs {
            display: flex;
            border-bottom: 1px solid var(--feed-line);
        }
        .profile-tab {
            flex: 1; padding: 14px 0;
            text-align: center; font-size: 15px; font-weight: 600;
            color: var(--feed-muted);
            background: none; border: none;
            border-bottom: 3px solid transparent;
            cursor: pointer; transition: color .15s, border-color .15s;
        }
        .profile-tab:hover { color: var(--feed-fg); }
        .profile-tab.active {
            color: var(--feed-accent);
            border-bottom-color: var(--feed-accent);
        }
        .profile-tab-content { min-height: 100px; }
        .profile-msg-list {
            max-height: 440px; overflow-y: auto;
            padding: 16px; display: flex;
            flex-direction: column; gap: 10px;
        }
        .profile-msg-bubble {
            max-width: 78%; padding: 10px 14px;
            border-radius: 18px; font-size: 14px;
            line-height: 1.45; word-break: break-word;
        }
        .profile-msg-bubble.msg-own {
            align-self: flex-end;
            background: var(--feed-accent); color: #fff;
            border-bottom-right-radius: 6px;
        }
        .profile-msg-bubble.msg-other {
            align-self: flex-start;
            background: var(--feed-surface2); color: var(--feed-fg);
            border-bottom-left-radius: 6px;
        }
        .profile-msg-bubble .msg-time {
            font-size: 11px; opacity: 0.6;
            margin-top: 4px; display: block;
        }
        .profile-msg-form {
            display: flex; gap: 10px;
            padding: 12px 16px 16px;
            border-top: 1px solid var(--feed-line);
            align-items: flex-end;
        }
        .profile-msg-form textarea {
            flex: 1; min-height: 42px;
            border: 1px solid var(--feed-line);
            border-radius: 999px;
            padding: 9px 16px; font: inherit; font-size: 14px;
            background: var(--feed-surface2);
            color: var(--feed-fg); resize: none;
        }
        .profile-msg-form textarea:focus {
            border-color: var(--feed-accent); outline: none;
        }
        .profile-msg-form .header-btn {
            border-radius: 999px; flex-shrink: 0;
            padding: 8px 16px; font-weight: 700;
            background: var(--feed-accent) !important;
            color: #fff !important; border: none !important;
        }
        .profile-empty {
            text-align: center; padding: 40px 20px;
            color: var(--feed-muted); font-size: 14px;
        }

        @media (max-width: 768px) {
            .dashboard-widgets-grid {
                grid-template-columns: 1fr;
                gap: 12px;
            }

            .main-header .page-title {
                font-size: 16px !important;
            }

            .mobile-bottom-nav {
                padding-bottom: max(10px, env(safe-area-inset-bottom));
            }

            body.theme-dark .sidebar.mobile-active {
                box-shadow: 8px 0 32px rgba(0, 0, 0, 0.45);
            }

            #positions-panel-bottom > div:first-child {
                flex-direction: column;
                align-items: stretch !important;
                gap: 12px;
            }

            #positions-panel-bottom > div:first-child > div:first-child {
                overflow-x: auto;
                flex-wrap: nowrap;
                -webkit-overflow-scrolling: touch;
                gap: 8px;
                padding-bottom: 4px;
            }

            #positions-panel-bottom > div:first-child > div:last-child {
                flex-wrap: wrap;
                justify-content: flex-start;
                gap: 10px;
            }

            #positions-panel-bottom .modern-tab-btn {
                flex-shrink: 0;
                white-space: nowrap;
            }
        }

        /* Tablet + Mobile: prioritize full-screen chart usability */
        @media (max-width: 1024px) {
            #positions-restore-bar {
                display: none !important;
            }

            #chart-positions-toggle-btn {
                display: none !important;
            }

            #mobile-positions-btn {
                display: inline-flex !important;
            }

            #page-charts.active {
                height: 100dvh !important;
                min-height: 100dvh !important;
                padding: 24px !important;
                box-sizing: border-box !important;
            }

            #page-charts .chart-toolbar {
                position: sticky;
                top: 0;
                z-index: 40;
            }

            #page-charts #trade-v-resizer,
            #page-charts #trade-h-resizer {
                display: none !important;
            }

            #page-charts #main-vertical-split,
            #page-charts #top-horizontal-split {
                height: auto !important;
                min-height: 0 !important;
                width: 100% !important;
                max-width: 100% !important;
                box-sizing: border-box !important;
                flex: 1 1 auto !important;
            }

            #page-charts #top-horizontal-split {
                padding-right: 0 !important;
            }

            #chart-grid-container {
                width: 100% !important;
                max-width: 100% !important;
                min-width: 0 !important;
                box-sizing: border-box !important;
            }

            #page-charts .chart-wrapper {
                width: 100% !important;
                max-width: 100% !important;
                min-width: 0 !important;
                box-sizing: border-box !important;
                overflow: hidden !important;
            }

            #page-charts .chart-container-wrapper {
                width: 100% !important;
                max-width: 100% !important;
                min-width: 0 !important;
                box-sizing: border-box !important;
                overflow: hidden !important;
            }

            #page-liquidation-heatmap #lh-chart-container {
                width: 100% !important;
                margin-right: 0 !important;
            }
            #page-charts .chart-content {
                touch-action: none;
            }

            /* Mobile/tablet positions as separate bottom sheet */
            #positions-panel-bottom {
                position: fixed !important;
                left: 0;
                right: 0;
                bottom: 0;
                height: 68dvh !important;
                min-height: 320px !important;
                max-height: 80dvh !important;
                z-index: 100050;
                transform: translateY(110%);
                transition: transform 0.28s ease;
                border-top: 1px solid rgba(255, 255, 255, 0.12);
                border-radius: 16px 16px 0 0;
                box-shadow: 0 -20px 40px rgba(0, 0, 0, 0.45);
            }

            #positions-panel-bottom.mobile-open {
                transform: translateY(0);
            }

            /* Mobile/tablet trade panel as separate sheet (above bottom nav z-index 100000) */
            #trading-panel-sidebar {
                position: fixed !important;
                top: 0;
                right: 0;
                bottom: 0;
                height: 100dvh !important;
                max-height: 100dvh !important;
                width: min(100vw, 480px) !important;
                max-width: min(100vw, 480px) !important;
                z-index: 100200 !important;
                border-left: 1px solid rgba(255, 255, 255, 0.12);
                background: rgba(15, 20, 32, 0.98) !important;
                backdrop-filter: blur(12px);
                -webkit-backdrop-filter: blur(12px);
                transform: translate3d(105%, 0, 0);
                transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
                display: flex !important;
                flex-direction: column !important;
                overflow-y: auto !important;
                overflow-x: hidden !important;
                padding: 12px 14px calc(16px + env(safe-area-inset-bottom, 0px)) !important;
                box-sizing: border-box !important;
                will-change: transform;
            }

            #trading-panel-sidebar:not(.trade-panel--collapsed) {
                transform: translate3d(0, 0, 0) !important;
                visibility: visible !important;
                pointer-events: auto !important;
            }

            #trading-panel-sidebar.trade-panel--collapsed {
                transform: translate3d(105%, 0, 0) !important;
                pointer-events: none !important;
                visibility: hidden !important;
            }

            #mobile-trade-overlay {
                position: fixed;
                inset: 0;
                z-index: 100190;
                background: rgba(0, 0, 0, 0.55);
                backdrop-filter: blur(2px);
                opacity: 0;
                visibility: hidden;
                transition: opacity 0.2s ease, visibility 0.2s ease;
            }

            #mobile-trade-overlay.active {
                opacity: 1;
                visibility: visible;
            }

            #mobile-positions-overlay {
                position: fixed;
                inset: 0;
                z-index: 100040;
                background: rgba(0, 0, 0, 0.55);
                backdrop-filter: blur(2px);
                opacity: 0;
                visibility: hidden;
                transition: opacity 0.2s ease, visibility 0.2s ease;
            }

            #mobile-positions-overlay.active {
                opacity: 1;
                visibility: visible;
            }

            .right-sidebar-panel,
            .ai-chat-panel {
                width: min(100vw, 420px) !important;
                max-width: 100vw !important;
                z-index: 100210 !important;
            }

        }

        @media (max-width: 768px) {
            /* Keep chart time scale visible above bottom nav */
            #page-charts.active {
                height: calc(100dvh - 112px - env(safe-area-inset-bottom)) !important;
                min-height: calc(100dvh - 112px - env(safe-area-inset-bottom)) !important;
                padding: 16px 12px !important;
                box-sizing: border-box !important;
            }

            #page-charts .chart-content {
                padding-bottom: 34px;
                touch-action: none;
            }
        }

        /* Chart focus mode: TradingView-like clean chart surface */
        body.chart-focus-mode .sidebar,
        body.chart-focus-mode .main-header,
        body.chart-focus-mode .mobile-bottom-nav,
        body.chart-focus-mode #positions-panel-bottom,
        body.chart-focus-mode #trade-v-resizer,
        body.chart-focus-mode #trading-panel-sidebar,
        body.chart-focus-mode #trade-h-resizer,
        body.chart-focus-mode .right-sidebar-panel.visible,
        body.chart-focus-mode .ai-chat-panel.visible {
            display: none !important;
        }

        body.chart-focus-mode .dashboard-container,
        body.chart-focus-mode .main-content {
            margin: 0 !important;
            padding: 0 !important;
            width: 100vw !important;
            height: 100dvh !important;
            max-width: 100vw !important;
        }

        body.chart-focus-mode #page-charts.active {
            position: fixed !important;
            inset: 0 !important;
            z-index: 100300 !important;
            width: 100vw !important;
            height: 100dvh !important;
            min-height: 100dvh !important;
            background: #000 !important;
            padding: 0 !important;
        }

        body.chart-focus-mode #page-charts .chart-toolbar {
            position: absolute !important;
            top: 8px;
            left: 8px;
            right: 8px;
            z-index: 100310;
            background: rgba(8, 12, 20, 0.35) !important;
            backdrop-filter: blur(8px);
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 10px;
            padding: 6px 8px !important;
        }

        body.chart-focus-mode #focus-symbol-wrap {
            display: flex !important;
            align-items: center;
            gap: 6px;
            margin-left: auto;
            background: rgba(0, 0, 0, 0.35);
            border: 1px solid rgba(255, 255, 255, 0.14);
            border-radius: 8px;
            padding: 4px 8px;
        }

        body.chart-focus-mode #focus-symbol-input {
            background: transparent;
            border: none;
            color: #dbeafe;
            font-size: 13px;
            width: 112px;
            outline: none;
            text-transform: uppercase;
        }

        body.chart-focus-mode #focus-symbol-go {
            background: #2b78dd;
            color: #fff;
            border: none;
            border-radius: 6px;
            padding: 4px 8px;
            font-size: 12px;
            cursor: pointer;
        }

        body.chart-focus-mode #page-charts #main-vertical-split,
        body.chart-focus-mode #page-charts #top-horizontal-split,
        body.chart-focus-mode #page-charts .chart-grid-container {
            width: 100% !important;
            height: 100% !important;
            min-height: 100% !important;
            margin: 0 !important;
        }

        body.chart-focus-mode #chart-focus-btn i::before {
            content: "\f066"; /* fa-compress */
        }

        /* Select Pair modal: override .modal-content max-width (420–500px) from n.css / app-main */
        #pairSelectorModal .modal-content.pair-selector-content,
        #pairSelectorModal .indicator-modal-content.pair-selector-content {
            width: min(1200px, 96vw) !important;
            max-width: min(1200px, 96vw) !important;
            min-width: min(880px, 96vw);
        }

        /* Indicators + Chart Settings: match pair selector spacious layout */
        #indicatorModalOverlay .modal-content.indicator-modal-content,
        #chartSettingsModalOverlay .modal-content.indicator-modal-content {
            width: min(1200px, 96vw) !important;
            max-width: min(1200px, 96vw) !important;
            min-width: min(880px, 96vw);
            height: min(920px, 92vh) !important;
            max-height: min(920px, 92vh) !important;
            min-height: min(640px, 92vh);
            resize: none !important;
        }

        @media (max-width: 900px) {
            #pairSelectorModal .modal-content.pair-selector-content,
            #pairSelectorModal .indicator-modal-content.pair-selector-content {
                min-width: 0;
                width: 96vw !important;
                max-width: 96vw !important;
            }

            #indicatorModalOverlay .modal-content.indicator-modal-content,
            #chartSettingsModalOverlay .modal-content.indicator-modal-content {
                min-width: 0;
                width: 96vw !important;
                max-width: 96vw !important;
                min-height: 0;
                height: 96vh !important;
                max-height: 96vh !important;
            }
        }

        /* --- Chart chrome: smoother labels + depth (2026) --- */
        #page-charts .chart-wrapper {
            border-radius: 10px;
            /* Do not clip header pair label in rounded top-left corner (mobile Safari). */
            overflow: visible;
            background: rgba(0, 0, 0, 0.25);
            border: 1px solid rgba(255, 255, 255, 0.06);
        }

        #page-charts .chart-content {
            overflow: hidden;
            border-radius: 0 0 10px 10px;
        }

        #page-charts .chart-container-wrapper {
            overflow: visible;
        }

        #page-charts .chart-header {
            overflow: visible;
            box-sizing: border-box;
        }

        #page-charts .chart-title,
        #page-liquidation-heatmap .chart-title {
            letter-spacing: 0;
            overflow: visible;
            min-width: 0;
        }

        #page-charts .chart-title .chart-symbol-heading,
        #page-liquidation-heatmap .chart-title .chart-symbol-heading {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            min-width: 0;
            max-width: 100%;
            flex: 0 1 auto;
            vertical-align: middle;
        }

        #page-charts .chart-title .chart-symbol-logo,
        #page-liquidation-heatmap .chart-title .chart-symbol-logo {
            display: inline-flex;
            flex-shrink: 0;
        }

        #page-charts .chart-title [id$="_symbolName"],
        #page-liquidation-heatmap .chart-title [id$="_symbolName"] {
            display: inline-block;
            padding-left: 3px;
            padding-right: 6px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            min-width: 0;
            max-width: 100%;
            flex: 1 1 auto;
            -webkit-font-smoothing: antialiased;
        }

        #page-charts .chart-title [id$="_symbolName"].is-compact,
        #page-liquidation-heatmap .chart-title [id$="_symbolName"].is-compact {
            flex: 0 1 auto;
            text-overflow: clip;
        }

        body.theme-light #page-charts .chart-wrapper {
            background: rgba(255, 255, 255, 0.65);
            border-color: rgba(0, 0, 0, 0.08);
        }

        @media (max-width: 1024px) {
            #page-charts .chart-container-wrapper {
                padding-left: 0 !important;
                padding-right: 0 !important;
            }

            #page-charts .chart-header {
                padding-left: max(10px, env(safe-area-inset-left, 0px)) !important;
                padding-right: max(10px, env(safe-area-inset-right, 0px)) !important;
            }

            #page-charts .chart-title {
                justify-content: flex-start !important;
                text-align: left;
                width: 100%;
                flex: 1 1 100%;
                margin-right: 0 !important;
                margin-bottom: 6px;
            }

            #page-charts .chart-title [id$="_symbolName"],
            #page-liquidation-heatmap .chart-title [id$="_symbolName"] {
                padding-left: 4px;
                overflow: hidden;
                white-space: nowrap;
                text-overflow: ellipsis;
            }
        }

        .crosshair-label {
            transition: opacity 0.12s ease, transform 0.12s ease;
            will-change: transform, opacity;
        }

        @media (prefers-reduced-motion: reduce) {
            .crosshair-label {
                transition: none;
            }
        }

        /* --- Golden Rate / Nadaraya step 1 --- */
        .finder-step-1,
        #gr-step-1,
        #nw-step-1 {
            flex-direction: column;
            align-items: stretch;
            gap: 16px;
        }

        .finder-step-1-shell {
            display: flex;
            flex-direction: column;
            gap: 18px;
            padding: 20px;
            border-radius: 16px;
            border: 1px solid rgba(255, 255, 255, 0.08);
            background: linear-gradient(165deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
        }

        .finder-step-1-header {
            display: flex;
            align-items: flex-start;
            gap: 14px;
        }

        .finder-step-1-icon {
            flex-shrink: 0;
            width: 48px;
            height: 48px;
            border-radius: 14px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 20px;
            border: 1px solid rgba(255, 255, 255, 0.1);
            background: rgba(255, 255, 255, 0.04);
        }

        .finder-step-1-icon.is-golden {
            color: #0ecb81;
            border-color: rgba(14, 203, 129, 0.35);
            background: rgba(14, 203, 129, 0.1);
        }

        .finder-step-1-icon.is-nadaraya {
            color: #60a5fa;
            border-color: rgba(96, 165, 250, 0.35);
            background: rgba(96, 165, 250, 0.1);
        }

        .finder-step-1-copy h4 {
            margin: 0 0 6px;
            font-size: 1.12rem;
            font-weight: 600;
            letter-spacing: -0.02em;
        }

        .finder-step-1-lead,
        .gr-step-1-lead {
            margin: 0;
            font-size: 13px;
            color: var(--text-tertiary, #8b8d93);
            line-height: 1.5;
            max-width: 42rem;
        }

        .finder-step-1-cards {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 12px;
        }

        .finder-step-1-card {
            display: flex;
            align-items: center;
            gap: 14px;
            width: 100%;
            min-height: 72px;
            padding: 16px 18px;
            border-radius: 14px;
            border: 1px solid rgba(255, 255, 255, 0.1);
            background: rgba(255, 255, 255, 0.03);
            text-align: left;
            cursor: pointer;
            transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
        }

        .finder-step-1-card:hover:not(:disabled) {
            border-color: rgba(255, 255, 255, 0.18);
            background: rgba(255, 255, 255, 0.06);
            transform: translateY(-1px);
        }

        .finder-step-1-card-icon {
            flex-shrink: 0;
            width: 40px;
            height: 40px;
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 17px;
            background: rgba(14, 203, 129, 0.12);
            color: #0ecb81;
        }

        .finder-step-1-card-icon.is-watchlist {
            background: rgba(240, 185, 11, 0.12);
            color: #f0b90b;
        }

        .finder-step-1-card-body {
            display: flex;
            flex-direction: column;
            gap: 4px;
            flex: 1;
            min-width: 0;
        }

        .finder-step-1-card-body strong {
            font-size: 14px;
            font-weight: 600;
            color: var(--text-primary, #fff);
        }

        .finder-step-1-card-desc {
            font-size: 12px;
            line-height: 1.4;
            color: var(--text-tertiary, #8b8d93);
        }

        .finder-step-1-card-arrow {
            flex-shrink: 0;
            font-size: 12px;
            color: var(--text-tertiary, #8b8d93);
            opacity: 0.7;
        }

        .finder-step-1-card.finder-choice-btn-primary {
            border-color: rgba(14, 203, 129, 0.35);
            background: linear-gradient(145deg, rgba(14, 203, 129, 0.14), rgba(14, 203, 129, 0.04));
        }

        .gr-step-1-actions {
            display: flex;
            flex-wrap: wrap;
            gap: 12px;
            align-items: center;
        }

        .finder-choice-btn-primary {
            border-color: rgba(14, 203, 129, 0.45) !important;
            background: linear-gradient(145deg, rgba(14, 203, 129, 0.18), rgba(14, 203, 129, 0.06)) !important;
        }

        .finder-choice-btn-primary i {
            margin-right: 8px;
            color: #0ecb81;
        }

        #gr-btn-watchlist i {
            margin-right: 8px;
            color: #f0b90b;
        }

        .finder-step-1-card.is-watchlist-empty {
            opacity: 0.82;
        }

        .finder-step-1-card.is-watchlist-empty .finder-step-1-card-desc {
            color: #a8b0c2;
        }

        .finder-choice-btn-disabled,
        .finder-choice-btn:disabled {
            opacity: 0.45;
            cursor: not-allowed;
            pointer-events: none;
        }

        @media (max-width: 720px) {
            .finder-step-1-shell {
                padding: 16px;
            }
            .finder-step-1-cards {
                grid-template-columns: 1fr;
            }
            .finder-step-1-card {
                min-height: 64px;
                padding: 14px 16px;
            }
            .finder-step-1-header {
                flex-direction: column;
                gap: 10px;
            }
        }

        .gr-watchlist-hint {
            margin-top: 6px;
            padding: 14px 16px;
            border-radius: 12px;
            background: rgba(240, 185, 11, 0.08);
            border: 1px solid rgba(240, 185, 11, 0.22);
        }

        .gr-watchlist-hint-text {
            margin: 0 0 12px;
            font-size: 13px;
            line-height: 1.5;
            color: var(--text-secondary, #c9cdd4);
        }

        .gr-watchlist-hint-actions {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
        }

        /* --- Golden Rate / Nadaraya: scrollable scan results --- */
        #page-golden-rate.active,
        #page-nadaraya-watson.active {
            display: flex !important;
            flex-direction: column;
            flex: 1 1 auto;
            min-height: 0;
            overflow: hidden;
        }

        #page-golden-rate #golden-rate-container,
        #page-nadaraya-watson #nadaraya-watson-container {
            display: flex;
            flex-direction: column;
            flex: 1 1 auto;
            min-height: 0;
            overflow: hidden;
        }

        #page-golden-rate #gr-step-3,
        #page-nadaraya-watson #nw-step-3 {
            display: flex;
            flex-direction: column;
            flex: 1 1 auto;
            min-height: 0;
            overflow: hidden;
        }

        #page-golden-rate .finder-table-container,
        #page-nadaraya-watson .finder-table-container {
            flex: 1 1 auto;
            min-height: 160px;
            overflow-x: auto;
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
            overscroll-behavior: contain;
            scrollbar-gutter: stable;
        }

        /* --- yeux.app wordmark (replaces logo.gif) --- */
        .yeux-brand-mark {
            display: inline-block;
            font-family: "Syne", "Inter", ui-sans-serif, system-ui, sans-serif;
            font-size: 1.25rem;
            font-weight: 700;
            letter-spacing: -0.045em;
            line-height: 1;
            text-decoration: none;
            color: #fafafa;
            white-space: nowrap;
            transition: color 0.18s ease, opacity 0.18s ease;
        }

        .yeux-brand-mark:hover {
            color: #ffffff;
            opacity: 0.92;
        }

        .yeux-brand-mark--sidebar {
            font-size: 1.2rem;
            padding-left: 0;
        }

        #sidebar .sidebar-header {
            justify-content: space-between;
            padding-left: 12px;
            padding-right: 8px;
            min-height: 54px;
            align-items: center;
        }

        #sidebar .sidebar-header .sidebar-logo {
            flex: 0 1 auto;
            width: auto;
            min-width: 0;
            display: flex;
            align-items: center;
            justify-content: flex-start;
            text-align: left;
        }

        .sidebar.collapsed .yeux-brand-mark--sidebar {
            font-size: 0.72rem;
            letter-spacing: -0.06em;
            max-width: 100%;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        [data-pl-item][data-pl-hidden="1"] {
            display: none !important;
        }

        .yeux-brand-mark--landing {
            font-size: 1.35rem;
        }

        @media (min-width: 640px) {
            .yeux-brand-mark--landing {
                font-size: 1.5rem;
            }
        }

        body.theme-light .yeux-brand-mark {
            color: #0a0a0a;
        }

        body.theme-light .yeux-brand-mark:hover {
            color: #000000;
        }

        /* --- Scanner (step 3): professional console + table polish (Golden Rate + Nadaraya-Watson) --- */
        #page-golden-rate #gr-step-3,
        #page-nadaraya-watson #nw-step-3 {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        #page-golden-rate .finder-console-container,
        #page-nadaraya-watson .finder-console-container {
            --gr-console-bg: rgba(10, 10, 12, 0.78);
            --gr-console-border: rgba(255, 255, 255, 0.10);
            --gr-console-border-2: rgba(255, 255, 255, 0.06);
            --gr-console-shadow: 0 16px 44px rgba(0, 0, 0, 0.40);
            --gr-console-text: rgba(255, 255, 255, 0.86);
            --gr-console-muted: rgba(255, 255, 255, 0.55);

            margin: 0 16px;
            height: 190px;
            border-radius: 14px;
            overflow: hidden;
            border: 1px solid var(--gr-console-border);
            background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 55%),
                var(--gr-console-bg);
            box-shadow: var(--gr-console-shadow);
            backdrop-filter: blur(14px);
            -webkit-backdrop-filter: blur(14px);
            font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Fira Code", monospace;
            font-size: 12.5px;
            color: var(--gr-console-text);
        }

        #page-golden-rate .finder-console-container.collapsed,
        #page-nadaraya-watson .finder-console-container.collapsed {
            height: 48px;
        }

        #page-golden-rate .console-header,
        #page-nadaraya-watson .console-header {
            padding: 10px 12px;
            background: linear-gradient(180deg, rgba(0, 0, 0, 0.35), transparent);
            border-bottom: 1px solid var(--gr-console-border-2);
            color: var(--gr-console-muted);
            font-size: 12px;
            letter-spacing: 0.02em;
        }

        #page-golden-rate .console-header > span,
        #page-nadaraya-watson .console-header > span {
            display: inline-flex;
            align-items: center;
            gap: 10px;
            user-select: none;
        }

        #page-golden-rate .console-header > span::before,
        #page-nadaraya-watson .console-header > span::before {
            content: "";
            width: 10px;
            height: 10px;
            border-radius: 999px;
            background: radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.12) 55%),
                linear-gradient(135deg, rgba(99, 102, 241, 0.95), rgba(14, 203, 129, 0.85));
            box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.16);
        }

        #page-golden-rate .console-toggle-btn,
        #page-nadaraya-watson .console-toggle-btn {
            width: 34px;
            height: 28px;
            border-radius: 10px;
            border: 1px solid rgba(255, 255, 255, 0.10);
            background: rgba(255, 255, 255, 0.04);
            color: rgba(255, 255, 255, 0.70);
            display: inline-flex;
            align-items: center;
            justify-content: center;
            transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
        }

        #page-golden-rate .console-toggle-btn:hover,
        #page-nadaraya-watson .console-toggle-btn:hover {
            background: rgba(255, 255, 255, 0.07);
            border-color: rgba(255, 255, 255, 0.16);
            color: rgba(255, 255, 255, 0.92);
        }

        #page-golden-rate .console-toggle-btn:active,
        #page-nadaraya-watson .console-toggle-btn:active {
            transform: translateY(1px);
        }

        #page-golden-rate .console-content,
        #page-nadaraya-watson .console-content {
            padding: 10px 12px 12px;
            gap: 8px;
            scrollbar-gutter: stable;
        }

        #page-golden-rate #finderConsoleOutput,
        #page-nadaraya-watson #nwConsoleOutput {
            padding-right: 6px;
        }

        #page-golden-rate .console-content p,
        #page-nadaraya-watson .console-content p {
            margin: 0 0 6px 0;
            color: rgba(255, 255, 255, 0.82);
        }

        #page-golden-rate .console-content .prompt,
        #page-nadaraya-watson .console-content .prompt {
            color: #60a5fa;
            text-shadow: 0 0 14px rgba(96, 165, 250, 0.28);
        }

        #page-golden-rate .console-content .success,
        #page-nadaraya-watson .console-content .success {
            color: #34d399;
        }

        #page-golden-rate .console-content .error,
        #page-nadaraya-watson .console-content .error {
            color: #fb7185;
        }

        #page-golden-rate .console-cursor,
        #page-nadaraya-watson .console-cursor {
            width: 7px;
            height: 14px;
            border-radius: 2px;
            background-color: rgba(255, 255, 255, 0.78);
        }

        #page-golden-rate .finder-actions,
        #page-nadaraya-watson .finder-actions {
            gap: 10px;
        }

        #page-golden-rate .finder-table-container,
        #page-nadaraya-watson .finder-table-container {
            margin: 0 16px;
            border-radius: 14px;
            border: 1px solid rgba(255, 255, 255, 0.08);
            background: rgba(255, 255, 255, 0.03);
        }

        #page-golden-rate .finder-table thead th,
        #page-nadaraya-watson .finder-table thead th {
            position: sticky;
            top: 0;
            z-index: 2;
            background: linear-gradient(180deg, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.12));
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
        }

        #page-golden-rate .finder-table tbody tr:hover td,
        #page-nadaraya-watson .finder-table tbody tr:hover td {
            background: rgba(255, 255, 255, 0.045);
        }

        body.theme-light #page-golden-rate .finder-console-container,
        body.theme-light #page-nadaraya-watson .finder-console-container {
            --gr-console-bg: rgba(255, 255, 255, 0.82);
            --gr-console-border: rgba(0, 0, 0, 0.08);
            --gr-console-border-2: rgba(0, 0, 0, 0.06);
            --gr-console-shadow: 0 12px 34px rgba(0, 0, 0, 0.12);
            --gr-console-text: rgba(10, 12, 16, 0.88);
            --gr-console-muted: rgba(10, 12, 16, 0.55);
            background: linear-gradient(180deg, rgba(59, 130, 246, 0.08), transparent 55%),
                var(--gr-console-bg);
        }

        body.theme-light #page-golden-rate .console-content p,
        body.theme-light #page-nadaraya-watson .console-content p {
            color: rgba(10, 12, 16, 0.78);
        }

        @media (max-width: 768px) {
            #page-golden-rate .finder-console-container,
            #page-golden-rate .finder-table-container,
            #page-nadaraya-watson .finder-console-container,
            #page-nadaraya-watson .finder-table-container {
                margin: 0 12px;
            }
        }

        /* --- Pair selector modal --- */
        #pairSelectorModal .pair-selector-header {
            padding: 12px 14px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.08);
            background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent);
        }

        #pairSelectorModal #pairsList {
            padding: 8px 10px 12px;
            scrollbar-gutter: stable;
        }

        #pairSelectorModal .pair-left {
            display: flex;
            align-items: center;
            gap: 10px;
            min-width: 0;
            flex: 1;
        }
        #pairSelectorModal .pair-left-text {
            display: flex;
            flex-direction: column;
            min-width: 0;
        }
        .pi-pair-logo {
            flex-shrink: 0;
            width: 28px;
            height: 28px;
            border-radius: 8px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            background: rgba(255, 255, 255, 0.04);
            border: 1px solid rgba(255, 255, 255, 0.08);
            overflow: hidden;
        }
        .pi-pair-logo.lm-card-coin { width: 36px; height: 36px; border-radius: 8px; }
        .pi-pair-logo.lm-card-coin .pi-pair-logo-img { width: 22px; height: 22px; }
        .pi-pair-logo--sm { width: 24px; height: 24px; border-radius: 7px; }
        .pi-pair-logo--md { width: 28px; height: 28px; }
        .pi-pair-logo-img {
            width: 18px;
            height: 18px;
            object-fit: contain;
            display: block !important;
        }
        .pair-left .pi-pair-logo-img,
        .finder-table .pi-pair-logo-img,
        .btc-card-title .pi-pair-logo-img,
        .chart-symbol-logo .pi-pair-logo-img,
        .chart-title .pi-pair-logo-img {
            display: block !important;
            visibility: visible !important;
            opacity: 1 !important;
        }
        .pi-pair-logo--sm .pi-pair-logo-img { width: 16px; height: 16px; }
        .pi-pair-logo-letter {
            font-size: 10px;
            font-weight: 700;
            color: #9aa0a6;
            letter-spacing: 0.02em;
        }
        .pi-pair-info {
            display: flex;
            align-items: center;
            gap: 10px;
            min-width: 0;
        }
        .pi-pair-info-text {
            display: flex;
            flex-direction: column;
            min-width: 0;
        }
        .pi-pair-info-title {
            font-weight: 600;
            color: inherit;
            line-height: 1.2;
        }
        .pi-pair-info-sub {
            font-size: 11px;
            color: #666;
            line-height: 1.2;
        }
        body.theme-light .pi-pair-logo {
            background: rgba(0, 0, 0, 0.04);
            border-color: rgba(0, 0, 0, 0.08);
        }
        body.theme-light .pi-pair-logo-letter { color: #5a6474; }

        #pairSelectorModal .pairs-list-item {
            border-radius: 10px;
            margin-bottom: 6px;
            padding: 12px 14px;
            border: 1px solid transparent;
            background: rgba(255, 255, 255, 0.02);
            transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
        }

        #pairSelectorModal .pairs-list-item:hover {
            background: rgba(255, 255, 255, 0.06);
            border-color: rgba(255, 255, 255, 0.08);
        }

        #pairSelectorModal .pairs-list-item.active {
            border-color: rgba(14, 203, 129, 0.45);
            background: rgba(14, 203, 129, 0.1);
        }

        @media (prefers-reduced-motion: reduce) {
            #pairSelectorModal .pairs-list-item {
                transition: none;
            }
        }

        body.theme-light #pairSelectorModal .pairs-list-item {
            background: rgba(0, 0, 0, 0.03);
        }

        body.theme-light #pairSelectorModal .pairs-list-item:hover {
            background: rgba(0, 0, 0, 0.06);
        }

        /* --- Reports tab polish --- */
        .reports-page-hero {
            border-radius: 14px;
            padding: 20px 22px;
            background: linear-gradient(135deg, rgba(14, 203, 129, 0.12), rgba(99, 102, 241, 0.08));
            border: 1px solid rgba(255, 255, 255, 0.08);
            margin-bottom: 18px;
        }

        .reports-page-title {
            letter-spacing: -0.03em;
        }

        .reports-advisor-shell {
            border-radius: 12px;
            border: 1px solid rgba(255, 255, 255, 0.08);
            box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
        }

        .reports-advisor-input:focus-visible,
        .report-date-input:focus-visible,
        .report-select:focus-visible {
            outline: 2px solid rgba(14, 203, 129, 0.55);
            outline-offset: 2px;
        }

        .reports-advisor-bubble {
            border-radius: 12px;
        }

        body.theme-light .reports-page-hero {
            background: linear-gradient(135deg, rgba(14, 203, 129, 0.08), rgba(99, 102, 241, 0.06));
            border-color: rgba(0, 0, 0, 0.06);
        }

        #pairSelectorModal .pair-selector-toolbar {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        #pairSelectorModal .pair-selector-search {
            margin-bottom: 0;
        }

        #pairSelectorModal .pair-selector-subfilter {
            padding: 0;
            border: none;
            background: transparent;
        }

        #pairSelectorModal .pair-empty-state {
            padding: 48px 24px;
            text-align: center;
            color: var(--text-tertiary, #8b8d93);
        }

        #pairSelectorModal .pair-empty-state > i {
            font-size: 2rem;
            margin-bottom: 14px;
            display: block;
            opacity: 0.55;
            color: var(--accent-muted, #6366f1);
        }

        #pairSelectorModal .pair-empty-title {
            margin: 0 0 6px;
            font-size: 15px;
            font-weight: 600;
            color: var(--text-secondary, #c9cdd4);
        }

        #pairSelectorModal .pair-empty-sub {
            margin: 0;
            font-size: 13px;
            line-height: 1.45;
            max-width: 28rem;
            margin-left: auto;
            margin-right: auto;
        }

        #pairSelectorModal .pair-list-hint {
            padding: 12px 16px 16px;
            font-size: 12px;
            color: var(--text-tertiary, #8b8d93);
            text-align: center;
            border-top: 1px solid rgba(255, 255, 255, 0.06);
        }

        /* --- Global Currency & Latency Indicator --- */
        .header-actions {
            display: flex;
            align-items: center;
            gap: 12px;
        }
        .header-widget {
            background: rgba(255, 255, 255, 0.03);
            border: 1px solid rgba(255, 255, 255, 0.08);
            padding: 5px 10px;
            border-radius: 8px;
            font-family: 'Inter', sans-serif;
            transition: all 0.2s ease;
        }
        .header-widget:hover {
            border-color: rgba(255, 255, 255, 0.15);
            background: rgba(255, 255, 255, 0.05);
        }
        .currency-selector-wrapper select {
            background: transparent;
            border: none;
            color: #e7e9ea;
            font-size: 12px;
            font-weight: 600;
            cursor: pointer;
            outline: none;
            padding-right: 4px;
        }
        .currency-selector-wrapper select option {
            background: #1e222d !important;
            color: #fff !important;
        }
        .ping-indicator-wrapper {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 12px;
            color: #b2b5be;
            font-weight: 600;
        }
        .ping-dot {
            display: inline-block;
            width: 8px;
            height: 8px;
            background-color: #26a69a;
            border-radius: 50%;
            position: relative;
            box-shadow: 0 0 6px #26a69a;
        }
        .ping-dot.ping-pulse {
            animation: ping-pulse-anim 2s infinite ease-in-out;
        }
        @keyframes ping-pulse-anim {
            0% {
                transform: scale(0.9);
                box-shadow: 0 0 0 0 rgba(38, 166, 154, 0.7);
            }
            70% {
                transform: scale(1.1);
                box-shadow: 0 0 0 6px rgba(38, 166, 154, 0);
            }
            100% {
                transform: scale(0.9);
                box-shadow: 0 0 0 0 rgba(38, 166, 154, 0);
            }
        }

        /* --- AI Explainer Popover & Signal Toast Styles --- */
        .ai-indicator-explainer-btn {
            background: rgba(38, 166, 154, 0.12) !important;
            color: #26a69a !important;
            border: 1px solid rgba(38, 166, 154, 0.3) !important;
            padding: 3px 8px !important;
            border-radius: 6px !important;
            font-size: 11px !important;
            font-weight: 700 !important;
            cursor: pointer;
            transition: all 0.2s ease;
            display: inline-flex;
            align-items: center;
            gap: 4px;
            vertical-align: middle;
            line-height: 1.2;
            height: fit-content;
        }
        .ai-indicator-explainer-btn:hover {
            background: rgba(38, 166, 154, 0.2) !important;
            border-color: rgba(38, 166, 154, 0.5) !important;
            transform: scale(1.03);
        }
        
        .ai-explainer-popover {
            position: absolute !important;
            background: rgba(18, 18, 22, 0.92) !important;
            backdrop-filter: blur(24px) saturate(180%);
            -webkit-backdrop-filter: blur(24px) saturate(180%);
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 12px;
            padding: 16px;
            width: 380px;
            max-height: 480px;
            display: flex;
            flex-direction: column;
            box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(255, 255, 255, 0.03);
            z-index: 2000000 !important;
            font-family: 'Inter', sans-serif;
            opacity: 0;
            transform: scale(0.95) translateY(-5px);
            pointer-events: none;
            transition: opacity 0.2s cubic-bezier(0.25, 0.8, 0.25, 1), transform 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
        }
        .ai-explainer-popover.visible {
            opacity: 1;
            transform: scale(1) translateY(0);
            pointer-events: auto !important;
        }
        .ai-explainer-popover-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            font-weight: 800;
            font-size: 13px;
            color: #26a69a;
            border-bottom: 1px solid rgba(255, 255, 255, 0.06);
            padding-bottom: 8px;
            margin-bottom: 10px;
            flex-shrink: 0;
        }
        .popover-audio-btn {
            background: transparent;
            border: none;
            color: #b2b5be;
            cursor: pointer;
            font-size: 14px;
            transition: color 0.2s, transform 0.1s;
            padding: 2px 6px;
        }
        .popover-audio-btn:hover {
            color: #26a69a;
            transform: scale(1.1);
        }
        .popover-audio-btn.speaking {
            color: #ef5350;
            animation: pulse-audio 1.5s infinite ease-in-out;
        }
        @keyframes pulse-audio {
            0% { opacity: 0.6; }
            50% { opacity: 1; }
            100% { opacity: 0.6; }
        }
        .ai-explainer-popover-body {
            font-size: 12px;
            line-height: 1.6;
            color: #cbd5e1;
            font-weight: 500;
            max-height: 330px;
            overflow-y: auto;
            padding-right: 6px;
            margin-bottom: 12px;
            flex-grow: 1;
        }
        .ai-explainer-popover-footer {
            display: flex;
            align-items: center;
            justify-content: flex-end;
            gap: 8px;
            border-top: 1px solid rgba(255, 255, 255, 0.06);
            padding-top: 10px;
            flex-shrink: 0;
        }
        .ai-explainer-popover-btn {
            background: rgba(38, 166, 154, 0.12);
            color: #26a69a;
            border: 1px solid rgba(38, 166, 154, 0.3);
            padding: 6px 12px;
            border-radius: 6px;
            font-size: 11px;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.2s ease;
            display: inline-flex;
            align-items: center;
            gap: 6px;
        }
        .ai-explainer-popover-btn:hover {
            background: rgba(38, 166, 154, 0.2);
            border-color: rgba(38, 166, 154, 0.5);
        }
        .ai-explainer-popover-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
            pointer-events: none;
        }
        .ai-explainer-popover-btn.btn-download {
            background: rgba(61, 145, 255, 0.12);
            color: #3d91ff;
            border: 1px solid rgba(61, 145, 255, 0.3);
        }
        .ai-explainer-popover-btn.btn-download:hover {
            background: rgba(61, 145, 255, 0.2);
            border-color: rgba(61, 145, 255, 0.5);
        }
        .ai-explainer-loading {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 10px;
            padding: 20px 0;
            color: #b2b5be;
        }
        .ai-explainer-loading .spinner {
            width: 24px;
            height: 24px;
            border: 2px solid rgba(38, 166, 154, 0.2);
            border-top-color: #26a69a;
            border-radius: 50%;
            animation: ai-spin 0.8s linear infinite;
        }
        @keyframes ai-spin {
            to { transform: rotate(360deg); }
        }
        
        /* Signal Toasts container & cards */
        .signal-toast-card {
            animation: slideInToast 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
        }
        @keyframes slideInToast {
            from {
                transform: translateX(120%);
                opacity: 0;
            }
            to {
                transform: translateX(0);
                opacity: 1;
            }
        }

        /* --- Multi-Timeframe Matrix Styles --- */
        .matrix-toggle-btn {
            background: rgba(61, 145, 255, 0.12) !important;
            color: #3d91ff !important;
            border: 1px solid rgba(61, 145, 255, 0.3) !important;
            padding: 3px 8px !important;
            border-radius: 6px !important;
            font-size: 11px !important;
            font-weight: 700 !important;
            cursor: pointer;
            transition: all 0.2s ease;
            display: inline-flex;
            align-items: center;
            gap: 4px;
            vertical-align: middle;
            line-height: 1.2;
            height: fit-content;
            margin-left: 8px;
        }
        .matrix-toggle-btn:hover {
            background: rgba(61, 145, 255, 0.2) !important;
            border-color: rgba(61, 145, 255, 0.5) !important;
            transform: scale(1.03);
        }
        .matrix-popover {
            position: fixed;
            background: rgba(18, 18, 22, 0.95);
            backdrop-filter: blur(24px) saturate(180%);
            -webkit-backdrop-filter: blur(24px) saturate(180%);
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 12px;
            padding: 12px;
            width: 240px;
            box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(255, 255, 255, 0.03);
            z-index: 100001;
            font-family: 'Inter', sans-serif;
            opacity: 0;
            transform: scale(0.95) translateY(-5px);
            pointer-events: none;
            transition: opacity 0.2s cubic-bezier(0.25, 0.8, 0.25, 1), transform 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
        }
        .matrix-popover.visible {
            opacity: 1;
            transform: scale(1) translateY(0);
            pointer-events: auto;
        }
        .matrix-table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 4px;
        }
        .matrix-table th {
            text-align: left;
            padding: 5px;
            font-size: 10px;
            color: #848E9C;
            text-transform: uppercase;
            font-weight: 700;
            border-bottom: 1px solid rgba(255,255,255,0.06);
        }
        .matrix-table td {
            padding: 6px 5px;
            font-size: 11px;
            font-weight: 600;
            border-bottom: 1px solid rgba(255,255,255,0.04);
        }
        .matrix-trend-bullish {
            color: #26a69a;
        }
        .matrix-trend-bearish {
            color: #ef5350;
        }
        .matrix-trend-neutral {
            color: #848E9C;
        }

        /* --- Screenshot Share Modal Styles --- */
        #screenshot-share-modal {
            display: none;
        }
        #screenshot-share-modal.visible {
            display: flex;
            align-items: center;
            justify-content: center;
        }
        #screenshot-share-modal .modal-content {
            background: rgba(18, 18, 22, 0.9);
            backdrop-filter: blur(28px) saturate(190%);
            -webkit-backdrop-filter: blur(28px) saturate(190%);
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 16px;
            width: 90%;
            max-width: 650px;
            box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
            overflow: hidden;
            animation: modalFadeIn 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
        }

        /* --- AI Chat Pre-Attached Preview --- */
        .ai-attached-preview {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 8px 12px;
            background: rgba(255, 255, 255, 0.03);
            border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        }
        .ai-attached-preview img {
            width: 44px;
            height: 30px;
            border-radius: 4px;
            object-fit: cover;
            border: 1px solid rgba(255, 255, 255, 0.1);
        }
        .ai-attached-preview-text {
            font-size: 11px;
            color: #848E9C;
            flex: 1;
            font-weight: 600;
        }
        .ai-attached-preview-remove {
            background: transparent;
            border: none;
            color: #ef5350;
            cursor: pointer;
            font-size: 16px;
            padding: 2px 6px;
            line-height: 1;
            transition: color 0.2s;
        }
        .ai-attached-preview-remove:hover {
            color: #ff3b30;
        }

        /* --- Modern AI Composer --- */
        .ai-composer-card {
            background: rgba(30, 30, 35, 0.7) !important;
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border: 1px solid rgba(255, 255, 255, 0.08) !important;
            border-radius: 24px !important;
            padding: 8px 12px !important;
            display: flex;
            flex-direction: column;
            gap: 6px;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
            position: relative;
        }
        .ai-composer-input-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            width: 100%;
        }
        .ai-composer-textarea {
            background: transparent !important;
            border: none !important;
            color: #f3f4f6 !important;
            flex-grow: 1;
            outline: none !important;
            resize: none;
            padding: 8px 4px !important;
            font-size: 14px !important;
            line-height: 1.5;
            font-family: inherit;
        }
        .ai-model-selector-wrapper {
            position: relative;
        }
        .ai-model-select-btn {
            background: rgba(255, 255, 255, 0.06);
            border: 1px solid rgba(255, 255, 255, 0.1);
            color: #e5e7eb;
            padding: 4px 10px;
            border-radius: 16px;
            font-size: 12px;
            font-weight: 700;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 6px;
            transition: background 0.2s;
        }
        .ai-model-select-btn:hover {
            background: rgba(255, 255, 255, 0.12);
        }
        .ai-model-dropdown {
            position: absolute;
            bottom: calc(100% + 8px);
            right: 0;
            background: rgba(24, 24, 28, 0.95);
            backdrop-filter: blur(24px);
            -webkit-backdrop-filter: blur(24px);
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 16px;
            width: 240px;
            box-shadow: 0 12px 40px rgba(0,0,0,0.6);
            display: none;
            flex-direction: column;
            padding: 8px;
            z-index: 100002;
        }
        .ai-model-dropdown.visible {
            display: flex;
        }
        .ai-model-option {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 8px 12px;
            border-radius: 10px;
            cursor: pointer;
            transition: background 0.2s;
        }
        .ai-model-option:hover {
            background: rgba(255, 255, 255, 0.06);
        }
        .ai-model-option.active {
            background: rgba(38, 166, 154, 0.15);
            color: #26a69a;
        }
        .ai-model-option i {
            font-size: 14px;
            width: 16px;
            text-align: center;
        }
        .ai-model-option-details {
            display: flex;
            flex-direction: column;
        }
        .ai-model-option-name {
            font-size: 12px;
            font-weight: 700;
            color: #fff;
        }
        .ai-model-option-desc {
            font-size: 10px;
            color: #848E9C;
            margin-top: 1px;
        }
        
        /* Attachment Dropdown Menu */
        .ai-attach-menu-wrapper {
            position: relative;
        }
        .ai-attach-menu-btn {
            background: transparent;
            border: none;
            color: #b2b5be;
            font-size: 18px;
            cursor: pointer;
            padding: 6px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: color 0.2s, transform 0.1s;
        }
        .ai-attach-menu-btn:hover {
            color: #fff;
            transform: scale(1.05);
        }
        .ai-attach-dropdown {
            position: absolute;
            bottom: calc(100% + 8px);
            left: 0;
            background: rgba(24, 24, 28, 0.95);
            backdrop-filter: blur(24px);
            -webkit-backdrop-filter: blur(24px);
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 16px;
            width: 250px;
            box-shadow: 0 12px 40px rgba(0,0,0,0.6);
            display: none;
            flex-direction: column;
            padding: 8px;
            z-index: 100002;
        }
        .ai-attach-dropdown.visible {
            display: flex;
        }
        .ai-attach-option {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 10px 12px;
            border-radius: 10px;
            cursor: pointer;
            transition: background 0.2s;
            color: #cbd5e1;
        }
        .ai-attach-option:hover {
            background: rgba(255, 255, 255, 0.06);
            color: #fff;
        }
        .ai-attach-option.active {
            background: rgba(38, 166, 154, 0.15);
            color: #26a69a;
        }
        .ai-attach-option-details-old {
            display: flex;
            flex-direction: column;
            padding: 6px 12px;
            border-radius: 10px;
            background: rgba(255, 255, 255, 0.04);
            border: 1px solid rgba(255, 255, 255, 0.08);
            color: #aeaeb2;
            cursor: pointer;
            font-size: 12px;
            font-weight: 500;
            transition: all 0.2s ease;
        }
        .ai-composer-btn-old-hover {
            background: rgba(255, 255, 255, 0.08);
            color: #fff;
            border-color: rgba(255, 255, 255, 0.16);
        }
        .ai-dropdown-menu {
            position: absolute;
            bottom: calc(100% + 8px);
            left: 0;
            background: rgba(24, 24, 28, 0.96);
            backdrop-filter: blur(24px);
            -webkit-backdrop-filter: blur(24px);
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 16px;
            width: 280px;
            box-shadow: 0 12px 40px rgba(0, 0, 0, 0.65);
            display: flex;
            flex-direction: column;
            padding: 8px;
            z-index: 100005;
            opacity: 0;
            pointer-events: none;
            transform: translateY(6px);
            transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
            visibility: hidden;
        }
        @keyframes dropdownFadeIn {
            from {
                opacity: 0;
                transform: translateY(6px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }
        .ai-dropdown-menu.visible {
            opacity: 1;
            pointer-events: auto;
            transform: translateY(0);
            visibility: visible;
        }
        .ai-dropdown-header {
            font-size: 10px;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            color: #8E8E93;
            padding: 6px 12px 4px;
            font-weight: 600;
            text-align: left;
        }
        .ai-dropdown-option {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            padding: 10px 12px;
            border-radius: 10px;
            cursor: pointer;
            transition: all 0.2s;
            color: #cbd5e1;
            text-align: left;
        }
        .ai-dropdown-option:hover {
            background: rgba(255, 255, 255, 0.06);
            color: #fff;
        }
        .ai-dropdown-option.active {
            background: rgba(59, 130, 246, 0.15);
            color: #3b82f6;
        }
        .ai-dropdown-option-content {
            display: flex;
            flex-direction: column;
            gap: 2px;
        }
        .ai-dropdown-option-title {
            font-size: 12px;
            font-weight: 700;
        }
        .ai-dropdown-option-desc {
            font-size: 10px;
            color: #8E8E93;
        }
        .ai-dropdown-option-badge {
            font-size: 9px;
            font-weight: 600;
            padding: 2px 6px;
            border-radius: 4px;
            background: rgba(255, 255, 255, 0.06);
            color: #aeaeb2;
            flex-shrink: 0;
        }
        .ai-dropdown-option.active .ai-dropdown-option-badge {
            background: rgba(59, 130, 246, 0.2);
            color: #3b82f6;
        }        
        /* Streaming AI Typing Cursor & Modern Reveal Animation */
        .ai-streaming-cursor {
            display: inline-block;
            width: 2px;
            height: 1em;
            background: #60a5fa;
            margin-left: 2px;
            border-radius: 1px;
            vertical-align: text-bottom;
            animation: streamingCursorBlink 0.9s ease-in-out infinite;
        }
        @keyframes streamingCursorBlink {
            0% { opacity: 0.2; }
            100% { opacity: 1; }
        }
        .ai-stream-block {
            margin-top: 0;
        }
        .ai-stream-block + .ai-stream-block {
            margin-top: 6px;
            padding-top: 0;
            border-top: none;
        }
        .ai-stream-block .ai-md-content > :first-child {
            margin-top: 0;
        }
        @keyframes aiAssistantFadeIn {
            from {
                opacity: 0;
                transform: translateY(6px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        /* AI Composer Custom Dropdown Selector Styling */
        .ai-model-dropdown-wrapper,
        .ai-mode-dropdown-wrapper {
            position: relative;
            display: inline-block;
            /* Ensure dropdown can overflow parent */
            overflow: visible;
        }
        /* toolbar-left must allow overflow so dropdowns are not clipped */
        .ai-composer-toolbar-left {
            overflow: visible !important;
            position: relative;
            z-index: 1;
        }
        .ai-composer-toolbar {
            overflow: visible !important;
        }
        .ai-composer-card {
            overflow: visible !important;
        }
        .ai-input-area {
            overflow: visible !important;
        }
        .ai-mode-dropdown-wrapper .ai-dropdown-menu {
            left: auto;
            right: 0;
        }
        .ai-composer-btn .ai-chevron {
            font-size: 8px;
            opacity: 0.65;
            transition: transform 0.2s ease;
            margin-left: 4px;
        }
        .ai-composer-btn.active .ai-chevron {
            transform: rotate(180deg);
        }
        .ai-composer-btn {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 6px 12px;
            border-radius: 10px;
            background: rgba(255, 255, 255, 0.04);
            border: 1px solid rgba(255, 255, 255, 0.08);
            color: #aeaeb2;
            cursor: pointer;
            font-size: 12px;
            font-weight: 500;
            transition: all 0.2s ease;
            user-select: none;
            position: relative;
            z-index: 2;
        }
        .ai-composer-btn:hover {
            background: rgba(255, 255, 255, 0.08);
            color: #fff;
            border-color: rgba(255, 255, 255, 0.16);
        }
        .ai-composer-btn.active {
            background: rgba(59, 130, 246, 0.1);
            border-color: rgba(59, 130, 246, 0.3);
            color: #3b82f6;
        }

        /* ============================ Yeux Blog (News page) ============================ */
        body.theme-dark #page-news {
            --blog-fg: #f5f5f5;
            --blog-muted: #a3a3a3;
            --blog-line: #262626;
            --blog-surface: #161616;
            --blog-surface2: #1c1c1f;
            --blog-accent: #3b82f6;
            --blog-hover: rgba(255, 255, 255, 0.04);
            --blog-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
        }
        body.theme-light #page-news {
            --blog-fg: #0f1419;
            --blog-muted: #5b6b7a;
            --blog-line: #e8edf1;
            --blog-surface: #ffffff;
            --blog-surface2: #f7f9fb;
            --blog-accent: #2563eb;
            --blog-hover: rgba(0, 0, 0, 0.025);
            --blog-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
        }

        .blog-shell {
            width: 100%;
            max-width: 980px;
            margin: 0 auto;
            padding: 8px 16px 56px;
            box-sizing: border-box;
            color: var(--blog-fg);
        }

        .blog-hero {
            padding: 18px 4px 24px;
        }
        .blog-hero-badge {
            display: inline-flex;
            align-items: center;
            gap: 7px;
            font-size: 12px;
            font-weight: 700;
            letter-spacing: 0.4px;
            text-transform: uppercase;
            color: var(--blog-accent);
            background: color-mix(in srgb, var(--blog-accent) 12%, transparent);
            padding: 6px 12px;
            border-radius: 999px;
        }
        .blog-hero-title {
            margin: 14px 0 6px;
            font-size: clamp(26px, 4vw, 36px);
            font-weight: 800;
            letter-spacing: -0.02em;
            color: var(--blog-fg);
        }
        .blog-hero-sub {
            margin: 0;
            font-size: 15px;
            color: var(--blog-muted);
        }

        .blog-list {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
            gap: 18px;
        }

        .blog-card {
            display: flex;
            flex-direction: column;
            background: var(--blog-surface);
            border: 1px solid var(--blog-line);
            border-radius: 18px;
            overflow: hidden;
            cursor: pointer;
            transition: transform 0.18s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.18s ease, border-color 0.18s ease;
            outline: none;
        }
        .blog-card:hover,
        .blog-card:focus-visible {
            transform: translateY(-4px);
            box-shadow: var(--blog-shadow);
            border-color: color-mix(in srgb, var(--blog-accent) 45%, var(--blog-line));
        }
        .blog-card-cover {
            aspect-ratio: 16 / 9;
            overflow: hidden;
            background: var(--blog-surface2);
        }
        .blog-card-cover img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
            transition: transform 0.3s ease;
        }
        .blog-card:hover .blog-card-cover img { transform: scale(1.05); }

        .blog-card-body {
            display: flex;
            flex-direction: column;
            gap: 10px;
            padding: 16px 16px 14px;
            flex: 1;
        }
        .blog-card-meta {
            display: flex;
            align-items: center;
            flex-wrap: wrap;
            gap: 10px;
            font-size: 12px;
            color: var(--blog-muted);
        }
        .blog-card-date,
        .blog-card-read {
            display: inline-flex;
            align-items: center;
            gap: 5px;
        }
        .blog-tag {
            font-size: 11px;
            font-weight: 800;
            letter-spacing: 0.4px;
            text-transform: uppercase;
            padding: 3px 9px;
            border-radius: 999px;
            background: color-mix(in srgb, var(--blog-accent) 14%, transparent);
            color: var(--blog-accent);
        }
        .blog-tag-news        { background: rgba(59,130,246,0.14);  color: #60a5fa; }
        .blog-tag-announcement{ background: rgba(168,85,247,0.16);  color: #c084fc; }
        .blog-tag-guide       { background: rgba(34,197,94,0.16);   color: #4ade80; }
        .blog-tag-feature     { background: rgba(245,158,11,0.16);  color: #fbbf24; }
        .blog-tag-update      { background: rgba(14,165,233,0.16);  color: #38bdf8; }
        .blog-tag-market      { background: rgba(244,63,94,0.16);   color: #fb7185; }

        .blog-card-title {
            margin: 0;
            font-size: 18px;
            font-weight: 800;
            line-height: 1.3;
            letter-spacing: -0.01em;
            color: var(--blog-fg);
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }
        .blog-card-excerpt {
            margin: 0;
            font-size: 14px;
            line-height: 1.55;
            color: var(--blog-muted);
            display: -webkit-box;
            -webkit-line-clamp: 3;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }
        .blog-card-footer {
            display: flex;
            align-items: center;
            gap: 16px;
            margin-top: auto;
            padding-top: 12px;
            border-top: 1px solid var(--blog-line);
            font-size: 13px;
            color: var(--blog-muted);
        }
        .blog-stat {
            display: inline-flex;
            align-items: center;
            gap: 6px;
        }
        .blog-card-cta {
            margin-left: auto;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            font-weight: 700;
            color: var(--blog-accent);
        }

        .blog-empty,
        .blog-loading {
            grid-column: 1 / -1;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 12px;
            padding: 60px 20px;
            color: var(--blog-muted);
            font-size: 15px;
            text-align: center;
        }
        .blog-empty i,
        .blog-loading i { font-size: 30px; opacity: 0.5; }

        .blog-list-actions {
            display: flex;
            justify-content: center;
            margin-top: 26px;
        }
        .blog-loadmore-btn {
            padding: 11px 26px;
            border-radius: 999px;
            border: 1px solid var(--blog-line);
            background: var(--blog-surface);
            color: var(--blog-fg);
            font-weight: 700;
            font-size: 14px;
            cursor: pointer;
            transition: background 0.15s ease, border-color 0.15s ease;
        }
        .blog-loadmore-btn:hover { background: var(--blog-hover); border-color: var(--blog-accent); }
        .blog-loadmore-btn:disabled { opacity: 0.6; cursor: default; }

        /* ── Blog detail ── */
        .blog-detail-view { max-width: 760px; margin: 0 auto; }
        .blog-back-btn {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            background: transparent;
            border: none;
            color: var(--blog-muted);
            font-size: 14px;
            font-weight: 700;
            cursor: pointer;
            padding: 8px 4px;
            margin-bottom: 8px;
        }
        .blog-back-btn:hover { color: var(--blog-accent); }

        .blog-article-cover {
            border-radius: 18px;
            overflow: hidden;
            margin-bottom: 22px;
            border: 1px solid var(--blog-line);
        }
        .blog-article-cover img { width: 100%; display: block; }
        .blog-article-meta {
            display: flex;
            align-items: center;
            flex-wrap: wrap;
            gap: 12px;
            font-size: 13px;
            color: var(--blog-muted);
            margin-bottom: 12px;
        }
        .blog-article-title {
            margin: 0 0 22px;
            font-size: clamp(26px, 4.5vw, 40px);
            font-weight: 800;
            line-height: 1.18;
            letter-spacing: -0.02em;
            color: var(--blog-fg);
        }
        .blog-article-body {
            font-size: 17px;
            line-height: 1.75;
            color: var(--blog-fg);
        }
        .blog-article-body p { margin: 0 0 18px; }
        .blog-article-body h2 { font-size: 24px; font-weight: 800; margin: 32px 0 12px; letter-spacing: -0.01em; }
        .blog-article-body h3 { font-size: 20px; font-weight: 700; margin: 26px 0 10px; }
        .blog-article-body ul,
        .blog-article-body ol { margin: 0 0 18px; padding-left: 24px; }
        .blog-article-body li { margin-bottom: 8px; }
        .blog-article-body a { color: var(--blog-accent); text-decoration: underline; }
        .blog-article-body blockquote {
            margin: 22px 0;
            padding: 12px 20px;
            border-left: 4px solid var(--blog-accent);
            background: var(--blog-surface2);
            border-radius: 0 10px 10px 0;
            color: var(--blog-muted);
        }
        .blog-article-body img { max-width: 100%; border-radius: 12px; }

        /* ── Reactions ── */
        .blog-reactions {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            margin: 34px 0 8px;
            padding: 18px 0;
            border-top: 1px solid var(--blog-line);
            border-bottom: 1px solid var(--blog-line);
        }
        .blog-react-btn {
            display: inline-flex;
            align-items: center;
            gap: 7px;
            padding: 7px 13px;
            border-radius: 999px;
            border: 1px solid var(--blog-line);
            background: var(--blog-surface);
            cursor: pointer;
            font-size: 15px;
            line-height: 1;
            transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
        }
        .blog-react-btn:hover { transform: translateY(-2px); background: var(--blog-hover); }
        .blog-react-btn:disabled { opacity: 0.5; cursor: default; }
        .blog-react-btn.active {
            background: color-mix(in srgb, var(--blog-accent) 16%, transparent);
            border-color: var(--blog-accent);
        }
        .blog-react-emoji { font-size: 18px; }
        .blog-react-count { font-size: 13px; font-weight: 700; color: var(--blog-muted); }
        .blog-react-btn.active .blog-react-count { color: var(--blog-accent); }

        /* ── Comments ── */
        .blog-comments { margin-top: 30px; }
        .blog-comments-title {
            display: flex;
            align-items: center;
            gap: 9px;
            font-size: 18px;
            font-weight: 800;
            margin: 0 0 16px;
            color: var(--blog-fg);
        }
        .blog-comment-form {
            display: flex;
            gap: 10px;
            align-items: flex-end;
            margin-bottom: 22px;
        }
        .blog-comment-form textarea {
            flex: 1;
            resize: vertical;
            min-height: 46px;
            max-height: 180px;
            padding: 12px 14px;
            border-radius: 14px;
            border: 1px solid var(--blog-line);
            background: var(--blog-surface);
            color: var(--blog-fg);
            font: inherit;
            font-size: 14px;
        }
        .blog-comment-form textarea:focus {
            outline: none;
            border-color: var(--blog-accent);
        }
        .blog-comment-submit {
            display: inline-flex;
            align-items: center;
            gap: 7px;
            padding: 12px 18px;
            border-radius: 14px;
            border: none;
            background: var(--blog-accent);
            color: #fff;
            font-weight: 700;
            font-size: 14px;
            cursor: pointer;
            white-space: nowrap;
            transition: filter 0.15s ease;
        }
        .blog-comment-submit:hover { filter: brightness(1.08); }
        .blog-comment-submit:disabled { opacity: 0.6; cursor: default; }

        .blog-comment-list { display: flex; flex-direction: column; gap: 16px; }
        .blog-comment-empty { color: var(--blog-muted); font-size: 14px; padding: 8px 0; }
        .blog-comment { display: flex; gap: 12px; }
        .blog-comment-avatar {
            flex-shrink: 0;
            width: 38px;
            height: 38px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 800;
            font-size: 15px;
            color: #fff;
            background: linear-gradient(135deg, #3b82f6, #8b5cf6);
        }
        .blog-comment-main { flex: 1; min-width: 0; }
        .blog-comment-head {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 3px;
        }
        .blog-comment-user { font-weight: 700; font-size: 14px; color: var(--blog-fg); }
        .blog-comment-time { font-size: 12px; color: var(--blog-muted); }
        .blog-comment-del {
            margin-left: auto;
            background: transparent;
            border: none;
            color: var(--blog-muted);
            cursor: pointer;
            font-size: 13px;
            padding: 2px 6px;
            border-radius: 6px;
        }
        .blog-comment-del:hover { color: #fb7185; background: rgba(244,63,94,0.12); }
        .blog-comment-body {
            font-size: 14px;
            line-height: 1.55;
            color: var(--blog-fg);
            white-space: pre-wrap;
            word-break: break-word;
        }

        @media (max-width: 600px) {
            .blog-list { grid-template-columns: 1fr; }
            .blog-comment-form { flex-direction: column; align-items: stretch; }
            .blog-comment-submit { width: 100%; justify-content: center; }
        }

        /* ============================ Feed modern refresh (X / Twitter home) ============================ */
        /* Underline-style nav tabs (cleaner, more "home timeline" feel). */
        #page-feed .feed-nav-tabs {
            gap: 0;
            padding: 0;
            background: var(--feed-surface);
        }
        body.theme-light #page-feed .feed-nav-tabs { background: var(--feed-surface); }
        #page-feed .feed-nav-tab {
            flex: 1;
            background: transparent !important;
            border: none !important;
            border-radius: 0;
            padding: 16px 12px;
            position: relative;
            color: var(--feed-muted);
            font-weight: 700;
            font-size: 15px;
            box-shadow: none !important;
            transition: background .15s ease, color .15s ease;
        }
        #page-feed .feed-nav-tab:hover {
            background: var(--feed-hover) !important;
            color: var(--feed-fg);
        }
        #page-feed .feed-nav-tab.active {
            color: var(--feed-fg) !important;
            background: transparent !important;
        }
        #page-feed .feed-nav-tab.active::after {
            content: '';
            position: absolute;
            left: 50%;
            bottom: 0;
            transform: translateX(-50%);
            width: 52px;
            height: 4px;
            border-radius: 999px;
            background: var(--feed-accent);
        }

        /* Composer: focus highlight + accent rail. */
        #page-feed .feed-composer {
            transition: background .2s ease, box-shadow .2s ease;
        }
        #page-feed .feed-composer:focus-within {
            background: var(--feed-surface);
            box-shadow: inset 3px 0 0 var(--feed-accent);
        }
        #page-feed .feed-composer-foot .header-btn {
            background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
            box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
        }
        #page-feed .feed-composer-foot .header-btn:disabled {
            filter: grayscale(0.3);
            opacity: 0.6;
            box-shadow: none;
        }

        /* Toolbar: larger, crisper icons + retweet pop. */
        #page-feed .feed-tb-btn i { font-size: 16px; }
        #page-feed .feed-tb-btn.feed-tb-repost.feed-tb-on i { animation: feedHeartPop .35s ease; }

        /* Post images: subtle zoom on hover. */
        #page-feed .feed-tweet-image img { transition: transform .35s ease; }
        #page-feed .feed-tweet-image:hover img { transform: scale(1.035); }

        /* Avatars: soft depth. */
        #page-feed .feed-avatar { box-shadow: 0 2px 10px rgba(0, 0, 0, 0.28); }
        body.theme-light #page-feed .feed-avatar { box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12); }

        /* Card: smoother accent rail on hover. */
        #page-feed .feed-card::before { width: 3px; background: linear-gradient(var(--feed-accent), #8b5cf6); }

        /* Live Monitor — anthracite / black flat UI (dark default) */
        #page-live-monitor.page-content {
            padding: 0;
            overflow: auto;
            background: #08080a;
        }
        .reports-page.live-monitor-page {
            background: transparent;
        }
        .live-monitor-page {
            width: 100%;
            max-width: none;
            margin: 0;
            padding: 24px 28px 32px;
            font-family: 'Google Sans', Roboto, 'Segoe UI', system-ui, sans-serif;
            --lm-text: #ececef;
            --lm-muted: #9a9aa3;
            --lm-dim: #6b6b73;
            --lm-up: #4ade9a;
            --lm-down: #f87171;
            --lm-accent: #b8bcc6;
            --lm-accent-soft: rgba(255, 255, 255, 0.05);
            --lm-surface: #131419;
            --lm-surface-2: #1a1b1f;
            --lm-surface-hover: #1e2026;
            --lm-border: rgba(255, 255, 255, 0.08);
            --lm-border-hover: rgba(255, 255, 255, 0.14);
            --lm-shadow: none;
            --lm-ease: cubic-bezier(0.22, 1, 0.36, 1);
        }

        .live-monitor-hero-shell {
            display: flex;
            flex-wrap: wrap;
            align-items: flex-end;
            justify-content: space-between;
            gap: 20px;
            padding: 24px 26px;
            border-radius: 12px;
            border: 1px solid var(--lm-border);
            background: var(--lm-surface);
            box-shadow: none;
            margin-bottom: 20px;
            transition: border-color 0.28s var(--lm-ease), background 0.28s var(--lm-ease);
        }
        .live-monitor-hero-shell:hover {
            border-color: var(--lm-border-hover);
            background: var(--lm-surface-hover);
        }
        .lm-hero-badge {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 6px 12px;
            border-radius: 6px;
            font-size: 12px;
            font-weight: 500;
            letter-spacing: 0.02em;
            color: var(--lm-muted);
            background: var(--lm-surface-2);
            border: 1px solid var(--lm-border);
            margin-bottom: 10px;
            transition: background 0.22s var(--lm-ease), border-color 0.22s var(--lm-ease), color 0.22s var(--lm-ease);
        }
        .lm-hero-badge:hover {
            background: var(--lm-surface-hover);
            border-color: var(--lm-border-hover);
            color: var(--lm-text);
        }
        .lm-hero-badge i { color: var(--lm-accent); }
        .lm-hero-title {
            display: flex;
            align-items: center;
            gap: 12px;
            margin: 0 0 8px;
            font-size: clamp(24px, 2.5vw, 32px);
            font-weight: 500;
            letter-spacing: -0.01em;
            color: var(--lm-text);
        }
        .lm-hero-title > i { color: var(--lm-accent); font-size: 0.9em; }
        .lm-hero-desc {
            margin: 0 0 14px;
            max-width: 920px;
            font-size: 15px;
            line-height: 1.6;
            color: var(--lm-muted);
        }
        .lm-hero-features {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
        }
        .lm-hero-chip {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 7px 12px;
            border-radius: 6px;
            font-size: 13px;
            font-weight: 500;
            color: var(--lm-muted);
            background: var(--lm-surface-2);
            border: 1px solid var(--lm-border);
            transition: background 0.22s var(--lm-ease), border-color 0.22s var(--lm-ease), color 0.22s var(--lm-ease), transform 0.22s var(--lm-ease);
        }
        .lm-hero-chip:hover {
            background: var(--lm-accent-soft);
            border-color: var(--lm-border-hover);
            color: var(--lm-text);
            transform: translateY(-1px);
        }
        .lm-hero-chip i { color: var(--lm-accent); font-size: 12px; transition: transform 0.22s var(--lm-ease); }
        .lm-hero-chip:hover i { transform: scale(1.08); }
        .lm-hero-actions {
            display: flex;
            flex-direction: column;
            align-items: flex-end;
            gap: 6px;
        }
        .lm-refresh-btn {
            display: inline-flex;
            align-items: center;
            gap: 10px;
            padding: 10px 20px;
            border-radius: 8px;
            border: 1px solid var(--lm-border);
            background: var(--lm-surface-2);
            color: var(--lm-text);
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: background 0.22s var(--lm-ease), border-color 0.22s var(--lm-ease), color 0.22s var(--lm-ease), transform 0.22s var(--lm-ease);
            box-shadow: none;
        }
        .lm-refresh-btn:hover {
            background: var(--lm-surface-hover);
            border-color: var(--lm-border-hover);
            color: #fff;
            transform: translateY(-1px);
        }
        .lm-refresh-btn:active { transform: translateY(0); }
        .lm-refresh-btn i { transition: transform 0.35s var(--lm-ease); }
        .lm-refresh-btn:hover i { transform: rotate(-28deg); }
        .live-monitor-live-dot {
            width: 7px;
            height: 7px;
            border-radius: 50%;
            background: var(--lm-up);
            box-shadow: 0 0 0 3px rgba(74, 222, 154, 0.15);
            animation: live-monitor-pulse 2.4s ease-in-out infinite;
        }
        @keyframes live-monitor-pulse {
            0%, 100% { opacity: 1; box-shadow: 0 0 0 3px rgba(74, 222, 154, 0.15); }
            50% { opacity: 0.5; box-shadow: 0 0 0 5px rgba(74, 222, 154, 0.06); }
        }
        .live-monitor-updated {
            margin: 0;
            font-size: 13px;
            color: var(--lm-dim);
        }
        .live-monitor-locked {
            display: flex;
            justify-content: center;
            padding: 12px 0 32px;
        }
        .lm-locked-card {
            width: min(520px, 100%);
            padding: 28px 24px;
            border-radius: 12px;
            text-align: center;
            border: 1px solid var(--lm-border);
            background: var(--lm-surface);
            box-shadow: none;
            transition: border-color 0.28s var(--lm-ease), background 0.28s var(--lm-ease);
        }
        .lm-locked-card:hover {
            border-color: var(--lm-border-hover);
            background: var(--lm-surface-hover);
        }
        .lm-locked-icon-wrap {
            width: 52px;
            height: 52px;
            margin: 0 auto 14px;
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 20px;
            color: var(--lm-muted);
            background: var(--lm-surface-2);
            border: 1px solid var(--lm-border);
            transition: background 0.22s var(--lm-ease), border-color 0.22s var(--lm-ease), color 0.22s var(--lm-ease);
        }
        .lm-locked-card:hover .lm-locked-icon-wrap {
            background: var(--lm-accent-soft);
            border-color: var(--lm-border-hover);
            color: var(--lm-accent);
        }
        .lm-locked-title {
            margin: 0 0 10px;
            font-size: 18px;
            font-weight: 700;
            color: var(--lm-text);
        }
        .lm-locked-desc {
            margin: 0 0 16px;
            font-size: 13px;
            line-height: 1.6;
            color: var(--lm-muted);
        }
        .lm-locked-perks {
            list-style: none;
            margin: 0 0 20px;
            padding: 0;
            text-align: left;
            display: flex;
            flex-direction: column;
            gap: 8px;
        }
        .lm-locked-perks li {
            display: flex;
            align-items: center;
            gap: 10px;
            font-size: 12px;
            color: var(--lm-muted);
            padding: 10px 12px;
            border-radius: 6px;
            background: var(--lm-surface-2);
            border: 1px solid var(--lm-border);
            transition: background 0.22s var(--lm-ease), border-color 0.22s var(--lm-ease), color 0.22s var(--lm-ease), transform 0.22s var(--lm-ease);
        }
        .lm-locked-perks li:hover {
            border-color: var(--lm-border-hover);
            background: var(--lm-accent-soft);
            color: var(--lm-text);
            transform: translateX(3px);
        }
        .lm-locked-perks li i { color: var(--lm-dim); width: 16px; text-align: center; transition: color 0.22s var(--lm-ease); }
        .lm-locked-perks li:hover i { color: var(--lm-accent); }
        .lm-discord-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            width: 100%;
            padding: 12px 16px;
            border-radius: 8px;
            font-size: 13px;
            font-weight: 600;
            text-decoration: none;
            color: var(--lm-text);
            background: var(--lm-surface-2);
            border: 1px solid var(--lm-border);
            transition: border-color 0.22s var(--lm-ease), background 0.22s var(--lm-ease), transform 0.22s var(--lm-ease), color 0.22s var(--lm-ease);
            box-shadow: none;
        }
        .lm-discord-btn i.fa-discord { color: #7c8ee8; transition: color 0.22s var(--lm-ease); }
        .lm-discord-btn:hover {
            border-color: var(--lm-border-hover);
            background: var(--lm-accent-soft);
            transform: translateY(-1px);
            color: #fff;
        }
        .lm-discord-btn:hover i.fa-discord { color: #a5b4fc; }
        .lm-locked-note {
            margin: 12px 0 0;
            font-size: 11px;
            color: var(--lm-dim);
        }
        .live-monitor-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 12px;
            width: 100%;
        }
        .lm-consistency-section {
            margin-top: 28px;
            padding-top: 24px;
            border-top: 1px solid var(--lm-border);
        }
        .lm-consistency-head {
            margin-bottom: 16px;
        }
        .lm-consistency-head h3 {
            margin: 0 0 6px;
            font-size: 16px;
            font-weight: 600;
            color: #fff;
        }
        .lm-consistency-desc {
            margin: 0;
            font-size: 13px;
            color: var(--lm-muted);
            line-height: 1.45;
        }
        .lm-consistency-chart-wrap {
            position: relative;
            height: 220px;
            margin-bottom: 18px;
            padding: 14px 12px;
            border-radius: 12px;
            border: 1px solid var(--lm-border);
            background: var(--lm-surface);
        }
        .lm-consistency-chart-wrap canvas {
            width: 100% !important;
            height: 100% !important;
        }
        .lm-consistency-chart-empty {
            position: absolute;
            inset: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0;
            padding: 16px;
            text-align: center;
            font-size: 13px;
            color: var(--lm-muted);
        }
        .lm-consistency-table-wrap {
            margin-top: 0;
        }
        .lm-outcome-badge {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            padding: 3px 9px;
            border-radius: 999px;
            font-size: 11px;
            font-weight: 600;
            letter-spacing: 0.02em;
            text-transform: uppercase;
        }
        .lm-outcome-badge.is-hit_tp { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
        .lm-outcome-badge.is-success { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
        .lm-outcome-badge.is-hit_sl { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
        .lm-outcome-badge.is-failure { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
        .lm-outcome-badge.is-no_hit { background: rgba(161, 161, 170, 0.15); color: #a1a1aa; }
        .lm-outcome-badge.is-expired { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
        .lm-outcome-badge.is-pending { background: rgba(96, 165, 250, 0.15); color: #60a5fa; }
        .lm-anomaly-history-card {
            margin-top: 20px;
        }

        /* ── Live Monitor: past-signals history + search ─────────────── */
        .lm-history-section {
            margin-top: 28px;
            padding-top: 24px;
            border-top: 1px solid var(--lm-border);
        }
        .lm-history-head {
            margin-bottom: 14px;
        }
        .lm-history-head h3 {
            margin: 0 0 6px;
            font-size: 16px;
            font-weight: 600;
            color: #fff;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .lm-history-desc {
            margin: 0;
            font-size: 13px;
            color: var(--lm-muted);
            line-height: 1.45;
        }
        .lm-history-searchbar {
            position: relative;
            display: flex;
            align-items: center;
            margin-bottom: 14px;
            max-width: 360px;
        }
        .lm-history-searchbar > i {
            position: absolute;
            left: 14px;
            color: var(--lm-muted);
            font-size: 13px;
            pointer-events: none;
        }
        .lm-history-searchbar input {
            width: 100%;
            padding: 10px 36px 10px 36px;
            border-radius: 10px;
            border: 1px solid var(--lm-border);
            background: var(--lm-surface);
            color: var(--text-primary, #e7e9ea);
            font-size: 14px;
            outline: none;
            transition: border-color 0.15s ease, box-shadow 0.15s ease;
        }
        .lm-history-searchbar input:focus {
            border-color: rgba(96, 165, 250, 0.6);
            box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.12);
        }
        .lm-history-clear {
            position: absolute;
            right: 8px;
            width: 24px;
            height: 24px;
            border: none;
            border-radius: 6px;
            background: transparent;
            color: var(--lm-muted);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .lm-history-clear:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
        .lm-hist-dir {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            font-weight: 600;
            font-size: 12.5px;
        }
        .lm-hist-dir.is-long { color: #22c55e; }
        .lm-hist-dir.is-short { color: #f6465d; }
        .lm-hist-entry { font-variant-numeric: tabular-nums; color: var(--text-primary, #e7e9ea); }
        .lm-hist-tp { font-variant-numeric: tabular-nums; color: #22c55e; font-weight: 600; }
        .lm-hist-sl { font-variant-numeric: tabular-nums; color: #f6465d; font-weight: 600; }

        /* ── Live Monitor: per-card 15m candlestick chart ────────────── */
        .lm-card-chart {
            position: relative;
            width: 100%;
            height: 96px;
            margin: 4px 0 10px;
            border-radius: 10px;
            border: 1px solid var(--lm-border);
            background: var(--lm-surface, rgba(0, 0, 0, 0.2));
            overflow: hidden;
        }
        .lm-card-candles {
            display: block;
            width: 100%;
            height: 100%;
        }
        .lm-card-chart-tf {
            position: absolute;
            top: 6px;
            right: 8px;
            font-size: 10px;
            font-weight: 700;
            letter-spacing: 0.04em;
            color: var(--lm-muted);
            background: rgba(0, 0, 0, 0.35);
            padding: 1px 6px;
            border-radius: 5px;
            pointer-events: none;
        }
        body.theme-light .lm-card-chart-tf {
            background: rgba(255, 255, 255, 0.6);
        }
        .live-monitor-empty {
            grid-column: 1 / -1;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 12px;
            padding: 48px 20px;
            border: 1px dashed var(--lm-border);
            border-radius: 12px;
            color: var(--lm-muted);
            text-align: center;
            background: var(--lm-surface);
            font-size: 15px;
            line-height: 1.5;
            transition: border-color 0.28s var(--lm-ease), background 0.28s var(--lm-ease);
        }
        .live-monitor-empty:hover {
            border-color: var(--lm-border-hover);
            background: var(--lm-surface-hover);
        }
        .live-monitor-empty i {
            font-size: 32px;
            opacity: 0.55;
            color: var(--lm-accent);
            transition: opacity 0.28s var(--lm-ease), transform 0.28s var(--lm-ease);
        }
        .live-monitor-empty:hover i { opacity: 0.85; transform: scale(1.05); }
        .live-monitor-card {
            position: relative;
            overflow: hidden;
            background: var(--lm-surface);
            border: 1px solid var(--lm-border);
            border-radius: 12px;
            padding: 18px 18px 16px;
            display: flex;
            flex-direction: column;
            gap: 12px;
            min-height: 0;
            box-shadow: none;
            transition: border-color 0.28s var(--lm-ease), background 0.28s var(--lm-ease), transform 0.28s var(--lm-ease);
        }
        .live-monitor-card:hover {
            border-color: var(--lm-border-hover);
            background: var(--lm-surface-hover);
            transform: translateY(-2px);
        }
        .live-monitor-card.is-long .lm-card-accent { background: var(--lm-up); }
        .live-monitor-card.is-short .lm-card-accent { background: var(--lm-down); }
        .lm-card-accent {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 2px;
            opacity: 0.75;
            transition: opacity 0.28s var(--lm-ease), height 0.28s var(--lm-ease);
        }
        .live-monitor-card:hover .lm-card-accent {
            opacity: 1;
            height: 3px;
        }
        .lm-card-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
        }
        .lm-card-rank-wrap {
            display: flex;
            align-items: center;
            gap: 8px;
            min-width: 0;
        }
        .lm-card-rank {
            font-size: 13px;
            font-weight: 600;
            color: var(--lm-dim);
            min-width: 22px;
            flex-shrink: 0;
            transition: color 0.22s var(--lm-ease);
        }
        .live-monitor-card:hover .lm-card-rank { color: var(--lm-accent); }
        .lm-card-symbol-block {
            display: flex;
            align-items: center;
            gap: 8px;
            min-width: 0;
        }
        .lm-card-coin {
            width: 36px;
            height: 36px;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: var(--lm-surface-2);
            border: 1px solid var(--lm-border);
            color: var(--lm-muted);
            font-size: 14px;
            flex-shrink: 0;
            overflow: hidden;
            transition: background 0.22s var(--lm-ease), border-color 0.22s var(--lm-ease), transform 0.22s var(--lm-ease);
        }
        .lm-card-coin-img {
            width: 22px;
            height: 22px;
            object-fit: contain;
            display: block;
        }
        .lm-card-coin-letter {
            font-size: 11px;
            font-weight: 700;
            letter-spacing: 0.02em;
            color: var(--lm-muted);
        }
        .live-monitor-card:hover .lm-card-coin {
            border-color: var(--lm-border-hover);
            background: var(--lm-surface-hover);
            transform: scale(1.04);
        }
        .lm-card-symbol {
            display: block;
            font-size: 17px;
            font-weight: 500;
            color: var(--lm-text);
            line-height: 1.2;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .lm-card-pair {
            display: block;
            font-size: 12px;
            color: var(--lm-dim);
            margin-top: 2px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .lm-card-dir {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            font-size: 12px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.04em;
            padding: 6px 10px;
            border-radius: 6px;
            white-space: nowrap;
            flex-shrink: 0;
            transition: background 0.22s var(--lm-ease), border-color 0.22s var(--lm-ease), transform 0.22s var(--lm-ease);
        }
        .lm-card-dir.is-long {
            background: rgba(74, 222, 154, 0.1);
            color: var(--lm-up);
            border: 1px solid rgba(74, 222, 154, 0.22);
        }
        .lm-card-dir.is-short {
            background: rgba(248, 113, 113, 0.1);
            color: var(--lm-down);
            border: 1px solid rgba(248, 113, 113, 0.22);
        }
        .live-monitor-card:hover .lm-card-dir { transform: translateY(-1px); }
        .live-monitor-card.is-long:hover .lm-card-dir.is-long {
            background: rgba(74, 222, 154, 0.16);
            border-color: rgba(74, 222, 154, 0.35);
        }
        .live-monitor-card.is-short:hover .lm-card-dir.is-short {
            background: rgba(248, 113, 113, 0.16);
            border-color: rgba(248, 113, 113, 0.35);
        }
        .lm-card-confidence {
            display: flex;
            flex-direction: column;
            gap: 4px;
        }
        .lm-conf-label {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 13px;
            color: var(--lm-muted);
        }
        .lm-conf-label i { color: var(--lm-accent); font-size: 12px; }
        .lm-conf-label strong { margin-left: auto; color: var(--lm-text); font-size: 14px; font-weight: 600; }
        .lm-conf-bar {
            height: 5px;
            border-radius: 99px;
            background: #0a0a0c;
            overflow: hidden;
            border: 1px solid var(--lm-border);
        }
        .live-monitor-card.is-long .lm-conf-bar span {
            background: linear-gradient(90deg, rgba(74, 222, 154, 0.45), var(--lm-up));
        }
        .live-monitor-card.is-short .lm-conf-bar span {
            background: linear-gradient(90deg, rgba(248, 113, 113, 0.45), var(--lm-down));
        }
        .lm-conf-bar span {
            display: block;
            height: 100%;
            border-radius: inherit;
            transition: width 0.4s var(--lm-ease);
        }
        .live-monitor-card:hover .lm-conf-bar span { filter: brightness(1.08); }
        .lm-card-levels {
            display: grid;
            grid-template-columns: repeat(3, minmax(0, 1fr));
            gap: 6px;
        }
        .lm-level {
            display: flex;
            flex-direction: column;
            gap: 4px;
            padding: 10px 8px;
            border-radius: 6px;
            background: var(--lm-surface-2);
            border: 1px solid var(--lm-border);
            text-align: center;
            min-width: 0;
            transition: background 0.22s var(--lm-ease), border-color 0.22s var(--lm-ease), transform 0.22s var(--lm-ease);
        }
        .lm-level:hover {
            background: var(--lm-accent-soft);
            border-color: var(--lm-border-hover);
            transform: translateY(-1px);
        }
        .lm-level i { font-size: 12px; margin-bottom: 2px; color: var(--lm-accent); transition: transform 0.22s var(--lm-ease); }
        .lm-level:hover i { transform: scale(1.1); }
        .lm-level span {
            font-size: 11px;
            text-transform: uppercase;
            letter-spacing: 0.04em;
            color: var(--lm-dim);
            font-weight: 500;
        }
        .lm-level strong {
            font-size: 14px;
            font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
            font-weight: 600;
            color: var(--lm-text);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .lm-level-tp strong { color: var(--lm-up); }
        .lm-level-sl strong { color: var(--lm-down); }
        .lm-level-gain {
            font-style: normal;
            font-size: 11px;
            font-weight: 700;
            font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
            color: var(--lm-up);
            background: rgba(14, 203, 129, 0.12);
            border-radius: 5px;
            padding: 1px 5px;
            align-self: flex-start;
        }
        .lm-card-stats {
            display: flex;
            flex-wrap: wrap;
            gap: 5px;
        }
        .lm-stat {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            font-size: 13px;
            color: var(--lm-muted);
            padding: 6px 10px;
            border-radius: 6px;
            background: var(--lm-surface-2);
            border: 1px solid var(--lm-border);
            transition: background 0.22s var(--lm-ease), border-color 0.22s var(--lm-ease), color 0.22s var(--lm-ease), transform 0.22s var(--lm-ease);
        }
        .lm-stat:hover {
            background: var(--lm-accent-soft);
            border-color: var(--lm-border-hover);
            color: var(--lm-text);
            transform: translateY(-1px);
        }
        .lm-stat strong { color: var(--lm-text); font-size: 14px; }
        .lm-stat i { color: var(--lm-accent); font-size: 12px; }
        .lm-card-reason {
            margin: 0;
            font-size: 13px;
            line-height: 1.55;
            color: var(--lm-muted);
            display: -webkit-box;
            -webkit-line-clamp: 3;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }
        .lm-card-reason i {
            font-size: 11px;
            margin-right: 5px;
            color: var(--lm-accent);
        }
        .lm-card-signals {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
            max-height: 56px;
            overflow: hidden;
        }
        .lm-signal {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            font-size: 12px;
            color: var(--lm-muted);
            padding: 5px 10px;
            border-radius: 6px;
            background: var(--lm-surface-2);
            border: 1px solid var(--lm-border);
            white-space: nowrap;
            max-width: 100%;
            overflow: hidden;
            text-overflow: ellipsis;
            transition: background 0.22s var(--lm-ease), border-color 0.22s var(--lm-ease), color 0.22s var(--lm-ease), transform 0.22s var(--lm-ease);
        }
        .lm-signal:hover {
            background: var(--lm-accent-soft);
            border-color: var(--lm-border-hover);
            color: var(--lm-text);
            transform: translateY(-1px);
        }
        .lm-signal i { font-size: 11px; color: var(--lm-accent); flex-shrink: 0; }
        .lm-card-action {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 100%;
            margin-top: 4px;
            padding: 11px 14px;
            border-radius: 8px;
            border: 1px solid var(--lm-border);
            background: var(--lm-surface-2);
            color: var(--lm-text);
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: background 0.22s var(--lm-ease), border-color 0.22s var(--lm-ease), color 0.22s var(--lm-ease), transform 0.22s var(--lm-ease);
            box-shadow: none;
        }
        .lm-card-action:hover {
            background: var(--lm-surface-hover);
            border-color: var(--lm-border-hover);
            transform: translateY(-1px);
            color: #fff;
        }
        .lm-card-action:active { transform: translateY(0); }
        /* Watchlist priority + pin control */
        .lm-card-head-right {
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .lm-card-priority {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            padding: 3px 8px;
            border-radius: 999px;
            font-size: 11px;
            font-weight: 700;
            letter-spacing: 0.02em;
            color: #f5c518;
            background: rgba(245, 197, 24, 0.12);
            border: 1px solid rgba(245, 197, 24, 0.35);
        }
        .live-monitor-card.is-pinned {
            border-color: rgba(245, 197, 24, 0.4);
            box-shadow: 0 0 0 1px rgba(245, 197, 24, 0.18) inset;
        }
        .lm-card-actions {
            display: flex;
            align-items: stretch;
            gap: 8px;
            margin-top: 4px;
        }
        .lm-card-actions .lm-card-action { margin-top: 0; flex: 1 1 auto; }
        .lm-card-pin {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 44px;
            flex: 0 0 44px;
            border-radius: 8px;
            border: 1px solid var(--lm-border);
            background: var(--lm-surface-2);
            color: var(--lm-muted);
            font-size: 15px;
            cursor: pointer;
            transition: background 0.22s var(--lm-ease), border-color 0.22s var(--lm-ease), color 0.22s var(--lm-ease), transform 0.22s var(--lm-ease);
        }
        .lm-card-pin:hover {
            background: var(--lm-surface-hover);
            border-color: var(--lm-border-hover);
            color: var(--lm-text);
            transform: translateY(-1px);
        }
        .lm-card-pin i { transform: rotate(30deg); transition: transform 0.22s var(--lm-ease); }
        .lm-card-pin.is-pinned {
            color: #f5c518;
            border-color: rgba(245, 197, 24, 0.45);
            background: rgba(245, 197, 24, 0.12);
        }
        .lm-card-pin.is-pinned i { transform: rotate(0deg); }
        .lm-card-pin:disabled { opacity: 0.55; cursor: default; }
        body.theme-light .live-monitor-page {
            --lm-text: #131419;
            --lm-muted: #5a6474;
            --lm-dim: #9aa3b3;
            --lm-accent: #5a6474;
            --lm-accent-soft: rgba(0, 0, 0, 0.04);
            --lm-surface: #ffffff;
            --lm-surface-2: #f0f2f5;
            --lm-surface-hover: #e8eaed;
            --lm-border: rgba(0, 0, 0, 0.1);
            --lm-border-hover: rgba(0, 0, 0, 0.16);
        }
        body.theme-light #page-live-monitor.page-content {
            background: #f1f5f9;
        }
        body.theme-light .live-monitor-hero-shell,
        body.theme-light .live-monitor-card,
        body.theme-light .live-monitor-empty,
        body.theme-light .lm-locked-card {
            background: var(--lm-surface);
            border-color: var(--lm-border);
            box-shadow: none;
        }
        body.theme-light .live-monitor-hero-shell:hover,
        body.theme-light .live-monitor-card:hover,
        body.theme-light .live-monitor-empty:hover {
            background: var(--lm-surface-hover);
            border-color: var(--lm-border-hover);
        }
        body.theme-light .lm-level,
        body.theme-light .lm-stat,
        body.theme-light .lm-signal,
        body.theme-light .lm-hero-chip {
            background: var(--lm-surface-2);
            border-color: var(--lm-border);
        }
        body.theme-light .lm-level:hover,
        body.theme-light .lm-stat:hover,
        body.theme-light .lm-signal:hover,
        body.theme-light .lm-hero-chip:hover {
            background: var(--lm-accent-soft);
            border-color: var(--lm-border-hover);
        }
        body.theme-light .lm-level strong { color: #0f172a; }
        body.theme-light .lm-refresh-btn,
        body.theme-light .lm-card-action {
            background: var(--lm-surface-2);
            border-color: var(--lm-border);
            color: var(--lm-text);
        }
        body.theme-light .lm-refresh-btn:hover,
        body.theme-light .lm-card-action:hover {
            background: var(--lm-surface-hover);
            border-color: var(--lm-border-hover);
            color: #131419;
        }
        @media (max-width: 1280px) {
            .live-monitor-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
        }
        @media (max-width: 720px) {
            .live-monitor-page { padding: 12px 12px 20px; }
            .live-monitor-grid { grid-template-columns: 1fr; }
            .live-monitor-hero-shell { flex-direction: column; align-items: stretch; }
            .lm-hero-actions { align-items: stretch; }
            .lm-refresh-btn { width: 100%; justify-content: center; }
        }

        /* Account — Two-Factor Authentication */
        .account-2fa-wrap {
            max-width: 880px;
            display: flex;
            flex-direction: column;
            gap: 18px;
        }
        .account-2fa-hero {
            display: flex;
            align-items: flex-start;
            gap: 16px;
            padding: 20px 22px;
            border-radius: 16px;
            border: 1px solid rgba(255, 255, 255, 0.08);
            background: linear-gradient(145deg, rgba(59, 130, 246, 0.08), rgba(255, 255, 255, 0.02));
        }
        .account-2fa-hero-icon {
            width: 48px;
            height: 48px;
            border-radius: 14px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 20px;
            color: #60a5fa;
            background: rgba(59, 130, 246, 0.12);
            border: 1px solid rgba(59, 130, 246, 0.22);
            flex-shrink: 0;
        }
        .account-2fa-title {
            margin: 0 0 6px;
            font-size: 20px;
            font-weight: 700;
            color: #fff;
            letter-spacing: -0.02em;
        }
        .account-2fa-subtitle {
            margin: 0;
            font-size: 13px;
            line-height: 1.55;
            color: #9ca3af;
        }
        .account-2fa-alert {
            padding: 12px 14px;
            border-radius: 10px;
            font-size: 13px;
            text-align: center;
        }
        .account-2fa-alert.is-error {
            background: rgba(255, 69, 58, 0.1);
            border: 1px solid rgba(255, 69, 58, 0.28);
            color: #ff6b6b;
        }
        .account-2fa-alert.is-success {
            background: rgba(52, 199, 89, 0.1);
            border: 1px solid rgba(52, 199, 89, 0.28);
            color: #34c759;
        }
        .account-2fa-card {
            padding: 20px;
            border-radius: 16px;
            border: 1px solid rgba(255, 255, 255, 0.08);
            background: #0c0c0c;
        }
        .account-2fa-card--enabled {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            justify-content: space-between;
            gap: 16px;
        }
        .account-2fa-status-badge {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 5px 10px;
            border-radius: 999px;
            font-size: 12px;
            font-weight: 600;
            color: #34c759;
            background: rgba(52, 199, 89, 0.12);
            border: 1px solid rgba(52, 199, 89, 0.25);
            margin-bottom: 8px;
        }
        .account-2fa-status-text {
            margin: 0;
            font-size: 14px;
            color: #a3a3a3;
        }
        .account-2fa-setup-lead {
            margin: 0 0 16px;
            font-size: 14px;
            line-height: 1.55;
            color: #9ca3af;
        }
        .account-2fa-steps {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 14px;
        }
        .account-2fa-step {
            border-radius: 14px;
            border: 1px solid rgba(255, 255, 255, 0.08);
            background: rgba(255, 255, 255, 0.02);
            padding: 16px;
        }
        .account-2fa-step-head {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 14px;
        }
        .account-2fa-step-head h3 {
            margin: 0;
            font-size: 14px;
            font-weight: 600;
            color: #f5f5f5;
        }
        .account-2fa-step-num {
            width: 26px;
            height: 26px;
            border-radius: 8px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
            font-weight: 700;
            color: #93c5fd;
            background: rgba(59, 130, 246, 0.14);
            border: 1px solid rgba(59, 130, 246, 0.25);
        }
        .account-2fa-qr-card {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 14px;
        }
        .account-2fa-qr {
            width: 180px;
            height: 180px;
            border-radius: 12px;
            background: #fff;
            padding: 10px;
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
        }
        .account-2fa-secret-block {
            width: 100%;
        }
        .account-2fa-secret-label {
            display: block;
            font-size: 11px;
            color: #737373;
            margin-bottom: 6px;
            text-transform: uppercase;
            letter-spacing: 0.06em;
        }
        .account-2fa-secret-row {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
        }
        .account-2fa-secret {
            flex: 1 1 auto;
            min-width: 0;
            padding: 8px 10px;
            border-radius: 8px;
            font-size: 13px;
            letter-spacing: 0.08em;
            color: #60a5fa;
            background: rgba(0, 0, 0, 0.35);
            border: 1px solid rgba(255, 255, 255, 0.08);
            word-break: break-all;
        }
        .account-2fa-copy-btn {
            padding: 8px 12px;
            border-radius: 8px;
            border: 1px solid rgba(255, 255, 255, 0.12);
            background: rgba(255, 255, 255, 0.04);
            color: #e5e5e5;
            font-size: 12px;
            font-weight: 600;
            cursor: pointer;
        }
        .account-2fa-copy-btn:hover {
            background: rgba(255, 255, 255, 0.08);
        }
        .account-2fa-verify-card {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }
        .account-2fa-code-input {
            width: 100%;
            box-sizing: border-box;
            background: rgba(0, 0, 0, 0.45);
            border: 1px solid rgba(255, 255, 255, 0.12);
            color: #fff;
            padding: 14px 12px;
            text-align: center;
            font-size: 22px;
            letter-spacing: 0.28em;
            border-radius: 12px;
            outline: none;
        }
        .account-2fa-code-input:focus {
            border-color: rgba(59, 130, 246, 0.55);
            box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
        }
        .account-2fa-turnstile {
            display: flex;
            justify-content: center;
        }
        .account-2fa-btn {
            border: none;
            border-radius: 10px;
            padding: 12px 18px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            transition: background 0.2s ease, transform 0.15s ease;
        }
        .account-2fa-btn--primary {
            width: 100%;
            background: #3b82f6;
            color: #fff;
        }
        .account-2fa-btn--primary:hover {
            background: #2563eb;
        }
        .account-2fa-btn--danger {
            background: rgba(255, 69, 58, 0.12);
            color: #ff453a;
            border: 1px solid rgba(255, 69, 58, 0.28);
        }
        .account-2fa-btn--danger:hover {
            background: rgba(255, 69, 58, 0.18);
        }
        @media (max-width: 768px) {
            .account-2fa-steps { grid-template-columns: 1fr; }
            .account-2fa-card--enabled { flex-direction: column; align-items: stretch; }
        }

        #page-container:has(#page-chat.active) {
            overflow: hidden;
        }
        #page-chat .app-chat-composer textarea,
        #page-chat .app-chat-composer button,
        #page-chat .app-chat-sidebar,
        #page-chat .app-chat-session-list {
            pointer-events: auto;
        }

        /* App — Chat tab (ChatGPT dark UI) */
        #page-chat.page-content {
            padding: 0;
            background: var(--gpt-main, #212121);
            overflow: hidden;
        }
        #page-chat.page-content.active {
            display: flex;
            flex-direction: column;
            flex: 1 1 auto;
            min-height: calc(100vh - var(--header-height, 64px));
            height: calc(100vh - var(--header-height, 64px));
            box-sizing: border-box;
        }
        /* Chat page — dark default, light overrides via body.theme-light below */
        .app-chat-page {
            --gpt-sidebar: #171717;
            --gpt-main: #212121;
            --gpt-surface: #2a2a2a;
            --gpt-composer: #2f2f2f;
            --gpt-text: #ececec;
            --gpt-muted: #a0a0a0;
            --gpt-faint: #6e6e6e;
            --gpt-border: rgba(255, 255, 255, 0.09);
            --gpt-hover: rgba(255, 255, 255, 0.06);
            --gpt-active: rgba(255, 255, 255, 0.11);
            --gpt-accent: #10a37f;
            --gpt-code-bg: rgba(0, 0, 0, 0.35);
            --gpt-code-text: #d4d4d4;
            --gpt-code-inline: rgba(255, 255, 255, 0.1);
            --gpt-table-head: rgba(255, 255, 255, 0.05);
            --gpt-error-text: #fca5a5;
            /* Educational block accent colours */
            --gpt-edu-symbol:  #10a37f;
            --gpt-edu-concept: #818cf8;
            --gpt-edu-math:    #fbbf24;
            --gpt-edu-formula: #c084fc;
            --gpt-edu-note:    #38bdf8;
            display: flex;
            flex-direction: row;
            flex: 1;
            min-height: 0;
            width: 100%;
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
            color: var(--gpt-text);
            background: var(--gpt-main);
        }
        .app-chat-sidebar {
            width: 260px;
            flex-shrink: 0;
            display: flex;
            flex-direction: column;
            background: var(--gpt-sidebar);
            min-height: 0;
            border-right: 1px solid var(--gpt-border);
        }
        .app-chat-sidebar-top {
            padding: 10px 8px 6px;
            flex-shrink: 0;
        }
        .app-chat-new-btn {
            display: flex;
            align-items: center;
            gap: 10px;
            width: 100%;
            padding: 10px 12px;
            border-radius: 12px;
            border: 1px solid var(--gpt-border);
            background: transparent;
            color: var(--gpt-text);
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            font-family: inherit;
            transition: background 0.15s ease;
        }
        .app-chat-new-btn:hover {
            background: var(--gpt-hover);
        }
        .app-chat-new-btn i {
            font-size: 13px;
            opacity: 0.9;
        }
        .app-chat-sidebar-scroll {
            flex: 1;
            min-height: 0;
            overflow-y: auto;
            padding: 4px 8px 12px;
        }
        .app-chat-session-list {
            display: flex;
            flex-direction: column;
            gap: 2px;
        }
        .app-chat-session-item {
            display: flex;
            align-items: center;
            gap: 4px;
            width: 100%;
            border-radius: 10px;
            background: transparent;
            color: var(--gpt-text);
            transition: background 0.12s ease;
        }
        .app-chat-session-item.is-active {
            background: var(--gpt-active);
        }
        .app-chat-session-item:hover:not(.is-active) {
            background: var(--gpt-hover);
        }
        .app-chat-session-select {
            flex: 1;
            min-width: 0;
            padding: 9px 10px;
            border: none;
            background: transparent;
            color: inherit;
            text-align: left;
            cursor: pointer;
            font-family: inherit;
        }
        .app-chat-session-title {
            display: block;
            font-size: 14px;
            font-weight: 400;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            color: var(--gpt-text);
        }
        .app-chat-session-date {
            display: none;
        }
        .app-chat-session-delete {
            flex-shrink: 0;
            width: 28px;
            height: 28px;
            margin-right: 4px;
            border: none;
            border-radius: 8px;
            background: transparent;
            color: var(--gpt-faint);
            cursor: pointer;
            opacity: 0;
            transition: opacity 0.12s ease, background 0.12s ease, color 0.12s ease;
        }
        .app-chat-session-item:hover .app-chat-session-delete,
        .app-chat-session-item.is-active .app-chat-session-delete {
            opacity: 1;
        }
        .app-chat-session-delete:hover {
            background: rgba(239, 68, 68, 0.15);
            color: #f87171;
        }
        .app-chat-no-sessions {
            margin: 12px 10px;
            font-size: 13px;
            color: var(--gpt-faint);
            line-height: 1.45;
        }
        .app-chat-main {
            flex: 1;
            min-width: 0;
            display: flex;
            flex-direction: column;
            min-height: 0;
            background: var(--gpt-main);
        }
        .app-chat-topbar {
            flex-shrink: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            height: 48px;
            border-bottom: 1px solid transparent;
        }
        .app-chat-model {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 6px 12px;
            border: none;
            border-radius: 10px;
            background: transparent;
            color: var(--gpt-text);
            font-size: 15px;
            font-weight: 500;
            font-family: inherit;
            cursor: default;
        }
        .app-chat-model i {
            font-size: 10px;
            color: var(--gpt-faint);
            margin-top: 1px;
        }
        .app-chat-body {
            flex: 1;
            min-height: 0;
            overflow-y: auto;
            scroll-behavior: smooth;
        }
        .app-chat-thread {
            width: 100%;
            max-width: 768px;
            margin: 0 auto;
            min-height: 100%;
            display: flex;
            flex-direction: column;
            padding: 0 16px;
            box-sizing: border-box;
        }
        .app-chat-empty {
            flex: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            min-height: 40vh;
            padding: 24px 16px;
            text-align: center;
        }
        .app-chat-empty[hidden] {
            display: none !important;
        }
        .app-chat-empty-title {
            margin: 0;
            font-size: clamp(1.5rem, 4vw, 2rem);
            font-weight: 500;
            letter-spacing: -0.02em;
            color: var(--gpt-text);
            line-height: 1.25;
        }
        .app-chat-messages {
            flex: 1;
            display: flex;
            flex-direction: column;
            gap: 24px;
            padding: 24px 0 16px;
            width: 100%;
            font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
        }
        .app-chat-messages .yeux-lc-msg {
            font-size: 16px;
            line-height: 1.78;
            letter-spacing: 0.008em;
            max-width: 100%;
            width: 100%;
            box-sizing: border-box;
            overflow-wrap: break-word;
            word-break: normal;
            padding: 0;
            border: none;
            border-radius: 0;
            background: transparent;
            color: var(--gpt-text);
            animation: gpt-msg-in 0.32s cubic-bezier(0.22, 0.61, 0.36, 1) both;
        }
        @keyframes gpt-msg-in {
            from { opacity: 0; transform: translateY(6px); }
            to   { opacity: 1; transform: translateY(0); }
        }
        .app-chat-messages .yeux-lc-msg-time {
            display: block;
            margin-top: 8px;
            font-size: 12px;
            line-height: 1.3;
            letter-spacing: 0;
            color: var(--text-muted, #8e8ea0);
            opacity: 0.88;
            font-weight: 400;
        }
        .app-chat-messages .yeux-lc-msg.user .yeux-lc-msg-time {
            text-align: right;
        }
        .app-chat-messages .yeux-lc-msg.assistant .yeux-lc-msg-time {
            padding-left: 0;
        }
        .app-chat-messages .yeux-lc-msg.system {
            display: none;
        }
        .app-chat-messages .yeux-lc-msg.user {
            align-self: flex-end;
            width: auto;
            max-width: min(88%, 680px);
            padding: 14px 20px;
            border-radius: 24px;
            background: var(--gpt-surface);
            color: var(--gpt-text);
            font-size: 15.5px;
            line-height: 1.68;
        }
        .app-chat-messages .yeux-lc-msg.assistant {
            position: relative;
            align-self: stretch;
            width: 100%;
            max-width: 100%;
            padding: 4px 0 4px 44px;
            color: var(--gpt-text);
            font-size: 16px;
            line-height: 1.78;
            font-family: 'Inter', ui-sans-serif, -apple-system, 'Segoe UI', system-ui, sans-serif;
        }
        .app-chat-messages .yeux-lc-msg.assistant::before {
            content: '\e2ca';
            font-family: 'Font Awesome 6 Free';
            font-weight: 900;
            font-size: 13px;
            display: flex;
            align-items: center;
            justify-content: center;
            position: absolute;
            left: 0;
            top: 2px;
            width: 30px;
            height: 30px;
            border-radius: 50%;
            color: #fff;
            background: linear-gradient(135deg, #4f8cff 0%, #8b5cff 48%, #c65bff 100%);
            box-shadow: 0 2px 10px rgba(120, 90, 255, 0.4), inset 0 0 0 1px rgba(255, 255, 255, 0.12);
        }
        .app-chat-messages .yeux-lc-para {
            margin: 6px 0;
            line-height: 1.82;
        }
        .app-chat-messages .yeux-lc-code-block {
            margin: 12px 0;
            padding: 14px 16px;
            border-radius: 10px;
            background: var(--gpt-code-bg, rgba(0,0,0,0.28));
            border: 1px solid var(--gpt-border);
            overflow-x: auto;
        }
        .app-chat-messages .yeux-lc-code-block code {
            font-family: ui-monospace, 'Fira Code', SFMono-Regular, Menlo, Monaco, Consolas, monospace;
            font-size: 13.5px;
            line-height: 1.6;
            color: var(--gpt-code-text, #e0e0e0);
            white-space: pre-wrap;
        }
        .app-chat-messages .yeux-lc-inline-code {
            padding: 2px 7px;
            border-radius: 6px;
            background: var(--gpt-code-inline, rgba(127,127,127,0.18));
            font-family: ui-monospace, 'Fira Code', SFMono-Regular, Menlo, Monaco, Consolas, monospace;
            font-size: 0.9em;
            color: var(--gpt-text);
        }
        .app-chat-messages .yeux-lc-heading {
            margin: 16px 0 6px;
            font-weight: 700;
            line-height: 1.3;
            color: var(--gpt-text);
            letter-spacing: -0.01em;
        }
        .app-chat-messages .yeux-lc-h1 { font-size: 1.2rem; margin-top: 20px; }
        .app-chat-messages .yeux-lc-h2 { font-size: 1.08rem; margin-top: 16px; }
        .app-chat-messages .yeux-lc-h3 { font-size: 0.97rem; margin-top: 12px; }
        .app-chat-messages .yeux-lc-quote {
            margin: 12px 0;
            padding: 10px 16px;
            border-left: 3px solid var(--gpt-accent);
            color: var(--gpt-muted);
            font-style: italic;
            border-radius: 0 6px 6px 0;
            background: var(--gpt-hover);
        }
        .app-chat-messages .yeux-lc-list,
        .app-chat-messages .yeux-lc-olist {
            margin: 8px 0 8px 1.4rem;
            padding: 0;
            line-height: 1.78;
        }
        .app-chat-messages .yeux-lc-stream-cursor {
            display: inline-block;
            width: 7px;
            height: 1em;
            margin-left: 2px;
            vertical-align: text-bottom;
            background: var(--gpt-accent);
            border-radius: 2px;
            animation: gpt-cursor-blink 1s step-end infinite;
        }
        @keyframes gpt-cursor-blink {
            50% { opacity: 0; }
        }
        .app-chat-messages .yeux-lc-msg.error {
            align-self: flex-start;
            max-width: 100%;
            padding: 12px 16px;
            border-radius: 12px;
            background: rgba(239, 68, 68, 0.12);
            border: 1px solid rgba(239, 68, 68, 0.25);
            color: var(--gpt-error-text, #fca5a5);
        }
        .app-chat-messages .yeux-lc-msg.analysis-badge {
            align-self: flex-start;
            max-width: 100%;
            padding: 8px 14px;
            border-radius: 10px;
            background: rgba(16, 163, 127, 0.1);
            border: 1px solid rgba(16, 163, 127, 0.22);
            color: var(--gpt-accent);
            font-size: 13px;
            font-weight: 500;
        }
        .app-chat-messages .yeux-lc-report,
        .app-chat-messages .yeux-lc-para,
        .app-chat-messages .yeux-lc-section-title,
        .app-chat-messages .yeux-lc-list,
        .app-chat-messages .yeux-lc-concept,
        .app-chat-messages .yeux-lc-math,
        .app-chat-messages .yeux-lc-formula,
        .app-chat-messages .yeux-lc-note,
        .app-chat-messages .yeux-lc-symbol-block {
            overflow-wrap: break-word;
            word-break: normal;
            max-width: 100%;
            color: var(--gpt-text);
        }
        /* Single primary chart */
        .app-chat-messages .yeux-lc-mini-chart-single {
            width: 100%;
            margin-top: 16px;
        }
        .app-chat-messages .yeux-lc-mini-chart-single .yeux-lc-mini-chart {
            max-width: 100%;
        }
        /* Legacy grid (hidden, replaced by single chart) */
        .app-chat-messages .yeux-lc-mini-chart-grid {
            display: none;
        }
        .app-chat-messages .yeux-lc-mini-chart {
            width: 100%;
            overflow: hidden;
            border-radius: 14px;
            border: 1px solid var(--gpt-border);
            background: var(--gpt-surface);
        }
        .app-chat-messages .yeux-lc-msg.analysis,
        .app-chat-messages .yeux-lc-msg.education {
            max-width: 100%;
            width: 100%;
        }
        .app-chat-messages .yeux-lc-report-wide {
            width: 100%;
        }
        /* Tables */
        .app-chat-messages .yeux-lc-table-wrap {
            width: 100%;
            overflow-x: auto;
            margin: 14px 0;
            border: 1px solid var(--gpt-border);
            border-radius: 12px;
            background: var(--gpt-surface);
        }
        .app-chat-messages .yeux-lc-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 13.5px;
            min-width: 480px;
            font-family: 'Inter', ui-sans-serif, -apple-system, 'Segoe UI', system-ui, sans-serif;
        }
        .app-chat-messages .yeux-lc-table th,
        .app-chat-messages .yeux-lc-table td {
            padding: 9px 13px;
            border-bottom: 1px solid var(--gpt-border);
            text-align: left;
            color: var(--gpt-text);
            white-space: nowrap;
        }
        .app-chat-messages .yeux-lc-table th {
            background: var(--gpt-table-head, rgba(127,127,127,0.08));
            font-weight: 600;
            font-size: 12.5px;
            letter-spacing: 0.02em;
            text-transform: uppercase;
        }
        .app-chat-messages .yeux-lc-table tr:last-child td { border-bottom: none; }
        /* Pivot table */
        .app-chat-messages .yeux-lc-pivot-table-wrap {
            margin-top: 18px;
        }
        .app-chat-messages .yeux-lc-pivot-table-title {
            font-size: 13px;
            font-weight: 600;
            color: var(--gpt-muted);
            letter-spacing: 0.04em;
            text-transform: uppercase;
            margin-bottom: 8px;
            display: flex;
            align-items: center;
            gap: 7px;
        }
        .app-chat-messages .yeux-lc-pivot-table th.lvl-s2,
        .app-chat-messages .yeux-lc-pivot-table td.lvl-s2 { color: #38bdf8; }
        .app-chat-messages .yeux-lc-pivot-table th.lvl-s1,
        .app-chat-messages .yeux-lc-pivot-table td.lvl-s1 { color: #60a5fa; }
        .app-chat-messages .yeux-lc-pivot-table th.lvl-p,
        .app-chat-messages .yeux-lc-pivot-table td.lvl-p  { color: #fbbf24; font-weight: 700; }
        .app-chat-messages .yeux-lc-pivot-table th.lvl-r1,
        .app-chat-messages .yeux-lc-pivot-table td.lvl-r1 { color: #fb923c; }
        .app-chat-messages .yeux-lc-pivot-table th.lvl-r2,
        .app-chat-messages .yeux-lc-pivot-table td.lvl-r2 { color: #f87171; }
        .app-chat-messages .yeux-lc-pivot-table .tf-badge {
            display: inline-block;
            padding: 2px 8px;
            border-radius: 5px;
            background: var(--gpt-hover);
            font-size: 11.5px;
            font-weight: 700;
            letter-spacing: 0.05em;
            color: var(--gpt-text);
        }

        /* ── Educational blocks — theme-aware modern redesign ─────────── */
        .app-chat-messages .yeux-lc-edu-icon {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 16px;
            height: 16px;
            margin-right: 7px;
            flex-shrink: 0;
            font-size: 11px;
        }
        .app-chat-messages .yeux-lc-symbol-block {
            background: var(--gpt-hover);
            border: 1px solid var(--gpt-border);
            border-left: 3px solid var(--gpt-edu-symbol);
            border-radius: 10px;
            padding: 14px 16px;
            margin: 10px 0;
        }
        .app-chat-messages .yeux-lc-symbol-block-title {
            display: flex;
            align-items: center;
            font-size: 13px;
            font-weight: 700;
            color: var(--gpt-edu-symbol);
            margin-bottom: 10px;
        }
        .app-chat-messages .yeux-lc-symbol-block-body {
            font-size: 14px;
            line-height: 1.75;
            color: var(--gpt-text);
        }
        .app-chat-messages .yeux-lc-concept {
            background: rgba(129, 140, 248, 0.06);
            border: 1px solid rgba(129, 140, 248, 0.2);
            border-radius: 10px;
            padding: 14px 16px;
            margin: 10px 0;
        }
        .app-chat-messages .yeux-lc-concept-title {
            display: flex;
            align-items: center;
            font-size: 11px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.07em;
            color: var(--gpt-edu-concept);
            margin-bottom: 8px;
        }
        .app-chat-messages .yeux-lc-concept-body {
            font-size: 14px;
            line-height: 1.75;
            color: var(--gpt-text);
        }
        .app-chat-messages .yeux-lc-math {
            background: rgba(251, 191, 36, 0.05);
            border: 1px solid rgba(251, 191, 36, 0.2);
            border-radius: 10px;
            padding: 14px 16px;
            margin: 10px 0;
        }
        .app-chat-messages .yeux-lc-math-title {
            display: flex;
            align-items: center;
            font-size: 11px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.07em;
            color: var(--gpt-edu-math);
            margin-bottom: 8px;
        }
        .app-chat-messages .yeux-lc-math-body {
            font-family: ui-monospace, 'Fira Code', SFMono-Regular, Menlo, Monaco, Consolas, monospace;
            font-size: 13.5px;
            line-height: 1.72;
            color: var(--gpt-edu-math);
        }
        .app-chat-messages .yeux-lc-formula {
            background: rgba(192, 132, 252, 0.06);
            border: 1px solid rgba(192, 132, 252, 0.2);
            border-radius: 10px;
            padding: 14px 16px;
            margin: 10px 0;
        }
        .app-chat-messages .yeux-lc-formula-label {
            display: flex;
            align-items: center;
            font-size: 11px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.07em;
            color: var(--gpt-edu-formula);
            margin-bottom: 8px;
        }
        .app-chat-messages .yeux-lc-formula-body {
            font-family: ui-monospace, 'Fira Code', SFMono-Regular, Menlo, Monaco, Consolas, monospace;
            font-size: 13.5px;
            color: var(--gpt-text);
            line-height: 1.65;
        }
        .app-chat-messages .yeux-lc-note {
            background: rgba(56, 189, 248, 0.06);
            border: 1px solid rgba(56, 189, 248, 0.2);
            border-left: 3px solid var(--gpt-edu-note);
            border-radius: 0 10px 10px 0;
            padding: 12px 16px;
            margin: 10px 0;
        }
        .app-chat-messages .yeux-lc-note-title {
            display: flex;
            align-items: center;
            font-size: 11px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.07em;
            color: var(--gpt-edu-note);
            margin-bottom: 6px;
        }
        .app-chat-messages .yeux-lc-note-body {
            font-size: 14px;
            line-height: 1.72;
            color: var(--gpt-text);
        }
        .app-chat-messages .yeux-lc-report {
            display: flex;
            flex-direction: column;
            gap: 6px;
        }
        .app-chat-messages .yeux-lc-report-sectioned .yeux-lc-section {
            background: var(--gpt-hover);
            border: 1px solid var(--gpt-border);
            border-radius: 10px;
            padding: 12px 16px;
            margin-top: 6px;
        }
        .app-chat-messages .yeux-lc-section-title {
            font-size: 11.5px;
            font-weight: 700;
            letter-spacing: 0.05em;
            text-transform: uppercase;
            color: var(--gpt-muted);
            margin-bottom: 8px;
            padding-bottom: 8px;
            border-bottom: 1px solid var(--gpt-border);
        }
        .app-chat-messages .yeux-lc-para {
            margin: 6px 0;
            line-height: 1.82;
            color: var(--gpt-text);
        }
        .app-chat-messages .yeux-lc-strong { color: var(--gpt-text); font-weight: 700; }
        .app-chat-messages .yeux-lc-em     { color: var(--gpt-muted); font-style: italic; }
        .app-chat-messages .yeux-lc-list,
        .app-chat-messages .yeux-lc-olist {
            margin: 6px 0 10px;
            padding-left: 1.4rem;
            color: var(--gpt-text);
            line-height: 1.78;
        }
        .app-chat-messages .yeux-lc-list li,
        .app-chat-messages .yeux-lc-olist li { margin-bottom: 5px; }

        .app-chat-thinking {
            display: none;
            align-items: center;
            gap: 12px;
            padding: 6px 0 18px 44px;
            font-size: 14.5px;
            position: relative;
            min-height: 30px;
        }
        /* Breathing gradient orb — mirrors the assistant avatar while thinking */
        .app-chat-thinking-dots {
            position: absolute;
            left: 0;
            top: 2px;
            width: 30px;
            height: 30px;
            border-radius: 50%;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 0;
            background: linear-gradient(135deg, #4f8cff 0%, #8b5cff 48%, #c65bff 100%);
            box-shadow: 0 2px 12px rgba(120, 90, 255, 0.5);
            animation: gpt-think-orb 1.5s ease-in-out infinite;
        }
        .app-chat-thinking-dots span { display: none; }
        @keyframes gpt-think-orb {
            0%, 100% { transform: scale(0.8);  opacity: 0.6; }
            50%      { transform: scale(1);    opacity: 1; }
        }
        /* Shimmering "Thinking…" text sweep, ChatGPT/Gemini style */
        .app-chat-thinking .label {
            font-weight: 500;
            background: linear-gradient(
                90deg,
                var(--gpt-faint) 0%,
                var(--gpt-faint) 35%,
                var(--gpt-text) 50%,
                var(--gpt-faint) 65%,
                var(--gpt-faint) 100%
            );
            background-size: 200% 100%;
            -webkit-background-clip: text;
            background-clip: text;
            -webkit-text-fill-color: transparent;
            color: transparent;
            animation: gpt-think-shimmer 1.8s linear infinite;
        }
        @keyframes gpt-think-shimmer {
            0%   { background-position: 200% 0; }
            100% { background-position: -200% 0; }
        }
        .app-chat-footer {
            flex-shrink: 0;
            padding: 12px 16px 18px;
            background: linear-gradient(180deg, transparent 0%, var(--gpt-main) 24%);
        }
        .app-chat-composer {
            width: 100%;
            max-width: 960px;
            margin: 0 auto;
            display: block;
        }
        .app-chat-composer-box {
            display: flex;
            align-items: flex-end;
            gap: 8px;
            padding: 10px 10px 10px 16px;
            border-radius: 26px;
            border: 1px solid var(--gpt-border);
            background: var(--gpt-composer);
            box-shadow: 0 0 0 0 transparent, 0 8px 24px rgba(0, 0, 0, 0.28);
            transition: border-color 0.15s ease, box-shadow 0.15s ease;
        }
        .app-chat-composer-box:focus-within {
            border-color: rgba(255, 255, 255, 0.18);
            box-shadow: 0 0 0 0 transparent, 0 10px 32px rgba(0, 0, 0, 0.35);
        }
        .app-chat-composer textarea {
            flex: 1;
            min-height: 24px;
            max-height: 200px;
            border: none;
            background: transparent;
            color: var(--gpt-text);
            padding: 6px 0;
            font-size: 16px;
            line-height: 1.5;
            resize: none;
            font-family: inherit;
            outline: none;
        }
        .app-chat-composer textarea::placeholder {
            color: var(--gpt-faint);
        }
        .app-chat-send {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            border: none;
            background: #424242;
            color: #8e8e8e;
            cursor: not-allowed;
            font-size: 14px;
            flex-shrink: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
        }
        .app-chat-send:not(:disabled) {
            background: #ffffff;
            color: #000000;
            cursor: pointer;
        }
        .app-chat-send:not(:disabled):hover {
            background: #e8e8e8;
        }
        .app-chat-send:not(:disabled):active {
            transform: scale(0.96);
        }
        .app-chat-disclaimer {
            margin: 10px auto 0;
            max-width: 768px;
            padding: 0 8px;
            font-size: 12px;
            line-height: 1.45;
            text-align: center;
            color: var(--gpt-faint);
        }
        .app-chat-drawer-overlay {
            display: none !important;
        }
        .app-chat-drawer-overlay.is-visible {
            display: block !important;
        }
        .app-chat-topbar-btn {
            display: none;
            align-items: center;
            justify-content: center;
            width: 44px;
            height: 44px;
            margin: 0;
            padding: 0;
            border: none;
            border-radius: 12px;
            background: transparent;
            color: var(--gpt-text);
            font-size: 18px;
            cursor: pointer;
            flex-shrink: 0;
            -webkit-tap-highlight-color: transparent;
            transition: background 0.15s ease;
        }
        .app-chat-topbar-btn:hover,
        .app-chat-topbar-btn:active {
            background: var(--gpt-hover);
        }
        .app-chat-empty-inner {
            width: 100%;
            max-width: 420px;
        }
        .app-chat-suggestions {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            gap: 10px;
            margin-top: 28px;
        }
        .app-chat-suggestion-chip {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-height: 44px;
            padding: 10px 16px;
            border-radius: 22px;
            border: 1px solid var(--gpt-border);
            background: var(--gpt-surface);
            color: var(--gpt-text);
            font-size: 14px;
            font-weight: 500;
            font-family: inherit;
            line-height: 1.3;
            cursor: pointer;
            text-align: center;
            -webkit-tap-highlight-color: transparent;
            transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
        }
        .app-chat-suggestion-chip:hover {
            background: var(--gpt-hover);
            border-color: rgba(255, 255, 255, 0.16);
        }
        .app-chat-suggestion-chip:active {
            transform: scale(0.98);
        }
        @media (min-width: 769px) {
            .app-chat-history-btn,
            .app-chat-new-top-btn {
                display: none !important;
            }
            .app-chat-topbar {
                justify-content: center;
            }
        }
        @media (max-width: 768px) {
            body:has(#page-chat.active) .main-content {
                padding-bottom: 0 !important;
            }
            #page-chat.page-content.active {
                height: calc(100dvh - var(--header-height, 56px));
                min-height: 0;
            }
            .app-chat-page {
                flex-direction: row;
                position: relative;
            }
            .app-chat-drawer-overlay {
                position: fixed;
                top: var(--header-height, 56px);
                right: 0;
                bottom: 0;
                left: 0;
                z-index: 100200;
                background: rgba(0, 0, 0, 0.55);
                opacity: 0;
                visibility: hidden;
                pointer-events: none;
                transition: opacity 0.28s ease, visibility 0.28s ease;
            }
            .app-chat-drawer-overlay.is-visible {
                opacity: 1;
                visibility: visible;
                pointer-events: auto;
            }
            body.app-chat-drawer-open {
                overflow: hidden;
            }
            .app-chat-sidebar {
                position: fixed;
                top: var(--header-height, 56px);
                left: 0;
                bottom: 0;
                width: min(88vw, 300px);
                max-height: none;
                z-index: 100210;
                border-right: 1px solid var(--gpt-border);
                border-bottom: none;
                transform: translateX(-105%);
                transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
                box-shadow: 8px 0 32px rgba(0, 0, 0, 0.45);
            }
            .app-chat-sidebar.is-open {
                transform: translateX(0);
            }
            .app-chat-sidebar-scroll {
                overflow-x: hidden;
                overflow-y: auto;
                -webkit-overflow-scrolling: touch;
            }
            .app-chat-session-list {
                flex-direction: column;
                gap: 2px;
                padding-bottom: 0;
            }
            .app-chat-session-item {
                min-width: 0;
                flex-shrink: 1;
            }
            .app-chat-main {
                width: 100%;
            }
            .app-chat-topbar {
                justify-content: space-between;
                gap: 4px;
                height: 52px;
                padding: 0 6px;
                border-bottom: 1px solid rgba(255, 255, 255, 0.06);
            }
            .app-chat-history-btn,
            .app-chat-new-top-btn {
                display: inline-flex;
            }
            .app-chat-model {
                flex: 1;
                justify-content: center;
                min-width: 0;
                padding: 6px 4px;
            }
            .app-chat-body {
                -webkit-overflow-scrolling: touch;
            }
            .app-chat-thread {
                padding: 0 12px;
            }
            .app-chat-empty {
                min-height: min(52vh, 420px);
                padding: 20px 8px 12px;
            }
            .app-chat-empty-title {
                font-size: 1.5rem;
            }
            .app-chat-suggestions {
                margin-top: 24px;
                gap: 8px;
            }
            .app-chat-suggestion-chip {
                font-size: 13px;
                padding: 10px 14px;
            }
            .app-chat-messages {
                gap: 20px;
                padding: 16px 0 12px;
            }
            .app-chat-messages .yeux-lc-msg {
                font-size: 15px;
            }
            .app-chat-messages .yeux-lc-msg.user {
                max-width: 92%;
                border-radius: 22px;
                padding: 11px 14px;
            }
            .app-chat-messages .yeux-lc-msg.assistant {
                padding-left: 40px;
            }
            .app-chat-messages .yeux-lc-msg.assistant::before {
                width: 26px;
                height: 26px;
            }
            .app-chat-thinking {
                padding-left: 40px;
            }
            .app-chat-footer {
                position: sticky;
                bottom: 0;
                z-index: 2;
                padding: 8px 12px calc(72px + env(safe-area-inset-bottom, 0px) + 10px);
                background: #212121;
                border-top: 1px solid rgba(255, 255, 255, 0.06);
            }
            .app-chat-composer-box {
                padding: 8px 8px 8px 14px;
                border-radius: 24px;
            }
            .app-chat-send {
                width: 36px;
                height: 36px;
                font-size: 15px;
            }
            .app-chat-disclaimer {
                font-size: 11px;
                margin-top: 8px;
                line-height: 1.35;
            }
        }

        /* ── Chat page is ALWAYS ChatGPT dark — white tones forbidden ─── */
        /* The chat tab ignores the site light theme and locks to the exact
           ChatGPT dark palette so responses always feel native. */
        body.theme-light .app-chat-page {
            --gpt-sidebar:      #171717;
            --gpt-main:         #212121;
            --gpt-surface:      #2a2a2a;
            --gpt-composer:     #2f2f2f;
            --gpt-text:         #ececec;
            --gpt-muted:        #a0a0a0;
            --gpt-faint:        #6e6e6e;
            --gpt-border:       rgba(255, 255, 255, 0.09);
            --gpt-hover:        rgba(255, 255, 255, 0.06);
            --gpt-active:       rgba(255, 255, 255, 0.11);
            --gpt-accent:       #10a37f;
            --gpt-code-bg:      rgba(0, 0, 0, 0.35);
            --gpt-code-text:    #d4d4d4;
            --gpt-code-inline:  rgba(255, 255, 255, 0.1);
            --gpt-table-head:   rgba(255, 255, 255, 0.05);
            --gpt-error-text:   #fca5a5;
            --gpt-edu-symbol:   #10a37f;
            --gpt-edu-concept:  #818cf8;
            --gpt-edu-math:     #fbbf24;
            --gpt-edu-formula:  #c084fc;
            --gpt-edu-note:     #38bdf8;
            background: var(--gpt-main);
            color-scheme: dark;
        }
        body.theme-light #page-chat.page-content {
            background: var(--gpt-main, #212121);
        }
        /* Neutralize every light-theme override that injected white tones */
        body.theme-light .app-chat-composer-box {
            background: var(--gpt-composer);
            border: 1px solid var(--gpt-border);
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
        }
        body.theme-light .app-chat-send { background: #424242; color: #8e8e8e; }
        body.theme-light .app-chat-send:not(:disabled) { background: #ffffff; color: #000000; }
        body.theme-light .app-chat-send:not(:disabled):hover { background: #e8e8e8; }
        body.theme-light .app-chat-sidebar { border-right: 1px solid var(--gpt-border); }
        body.theme-light .app-chat-history-item:hover { background: var(--gpt-hover); }
        body.theme-light .app-chat-composer-wrap { border-top: 1px solid var(--gpt-border); }
        body.theme-light .app-chat-messages .yeux-lc-msg.user { box-shadow: none; }
        body.theme-light .app-chat-messages .yeux-lc-code-block { box-shadow: none; }
        body.theme-light .app-chat-messages .yeux-lc-mini-chart {
            box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
        }

        /* ── Mobile chat — keep dark composer in every theme ─────────── */
        @media (max-width: 768px) {
            body.theme-light .app-chat-composer-wrap {
                background: var(--gpt-composer) !important;
                border-top: 1px solid var(--gpt-border) !important;
            }
            body.theme-light .app-chat-footer {
                background: #212121;
                border-top: 1px solid rgba(255, 255, 255, 0.06);
            }
        }

/* =========================================================
   Auto-Trade & MCP tab  (matches Live Monitor tones)
   ========================================================= */
.autotrade-page .at-muted { color: var(--lm-muted); font-size: 13px; line-height: 1.5; }
.autotrade-page .at-muted code,
.autotrade-page #at-api-base {
    font-family: 'SFMono-Regular', ui-monospace, Menlo, Consolas, monospace;
    background: var(--lm-surface-2); color: var(--lm-text);
    padding: 2px 7px; border-radius: 6px; border: 1px solid var(--lm-border);
}

.autotrade-page .at-warn {
    display: flex; gap: 12px; align-items: flex-start;
    background: rgba(251, 191, 36, 0.09); border: 1px solid rgba(251, 191, 36, 0.32);
    border-radius: 12px; padding: 12px 16px; margin-bottom: 20px;
    font-size: 13px; line-height: 1.5; color: var(--lm-text);
}
.autotrade-page .at-warn i { color: #f5a524; font-size: 18px; margin-top: 1px; }
.autotrade-page .at-warn strong { color: var(--lm-text); }

.autotrade-page .at-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; }
.autotrade-page .at-stack { display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 1100px) { .autotrade-page .at-grid { grid-template-columns: 1fr; } }

/* Status pill — neutral like Live Monitor chips */
.autotrade-page .at-status-pill {
    font-size: 11.5px; font-weight: 600; padding: 5px 11px; border-radius: 6px;
    border: 1px solid var(--lm-border); background: var(--lm-surface-2); color: var(--lm-muted);
}
.autotrade-page .at-status-pill.is-live { color: #052e26; background: var(--lm-up); border-color: var(--lm-up); }
.autotrade-page .at-status-pill.is-warn { color: #7c5e10; background: rgba(245, 165, 36, .18); border-color: rgba(245, 165, 36, .4); }
.autotrade-page .at-status-pill.is-off { color: var(--lm-muted); }
.autotrade-page .at-status-pill.is-danger { color: #fff; background: var(--lm-down); border-color: var(--lm-down); }

/* Toggle rows */
.autotrade-page .at-switch-row { display: flex; align-items: center; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--lm-border); }
.autotrade-page .at-switch-row:last-of-type { border-bottom: none; }
.autotrade-page .at-switch-txt strong { display: block; font-size: 13.5px; color: var(--lm-text); font-weight: 600; }
.autotrade-page .at-switch-txt small { display: block; color: var(--lm-muted); font-size: 11.5px; margin-top: 2px; }

.autotrade-page .at-switch { position: relative; display: inline-block; width: 44px; height: 24px; flex: 0 0 auto; }
.autotrade-page .at-switch input { opacity: 0; width: 0; height: 0; }
.autotrade-page .at-slider { position: absolute; inset: 0; cursor: pointer; background: var(--lm-surface-hover); border: 1px solid var(--lm-border); border-radius: 999px; transition: .2s var(--lm-ease); }
.autotrade-page .at-slider::before { content: ""; position: absolute; height: 16px; width: 16px; left: 3px; top: 3px; background: var(--lm-text); border-radius: 50%; transition: .2s var(--lm-ease); }
.autotrade-page .at-switch input:checked + .at-slider { background: var(--lm-up); border-color: var(--lm-up); }
.autotrade-page .at-switch input:checked + .at-slider::before { background: #0b0d10; transform: translateX(20px); }
.autotrade-page .at-switch.at-switch--danger input:checked + .at-slider { background: var(--lm-down); border-color: var(--lm-down); }

/* Fields — labels + standard settings-input / settings-select controls */
.autotrade-page .at-field-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin: 18px 0; }
.autotrade-page .at-field { display: flex; flex-direction: column; gap: 6px; }
.autotrade-page .at-field.at-field--full { grid-column: 1 / -1; }
.autotrade-page .at-lbl { font-size: 12px; font-weight: 600; color: var(--lm-muted); letter-spacing: 0.01em; }
.autotrade-page .at-hint { color: var(--lm-dim); font-size: 11px; }
.autotrade-page .at-textarea { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.5; }

/* Multi-select timeframe chips */
.autotrade-page .at-tf-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.autotrade-page .at-tf-opt {
    position: relative; display: inline-flex; align-items: center; justify-content: center;
    min-width: 46px; padding: 7px 12px; cursor: pointer; user-select: none;
    background: var(--lm-surface-2); border: 1px solid var(--lm-border); border-radius: 8px;
    color: var(--lm-muted); font-size: 12.5px; font-weight: 600;
    transition: background .15s var(--lm-ease), border-color .15s var(--lm-ease), color .15s var(--lm-ease);
}
.autotrade-page .at-tf-opt:hover { border-color: var(--lm-border-hover); color: var(--lm-text); }
.autotrade-page .at-tf-opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.autotrade-page .at-tf-opt:has(input:checked) {
    background: rgba(74, 222, 154, .14); border-color: var(--lm-up); color: var(--lm-up);
}

/* Manual pair picker */
.autotrade-page .at-pairpick { display: flex; flex-direction: column; gap: 8px; }
.autotrade-page .at-pair-chips { display: flex; flex-wrap: wrap; gap: 7px; min-height: 4px; }
.autotrade-page .at-pair-empty { font-size: 12px; color: var(--lm-dim); }
.autotrade-page .at-pair-chip {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--lm-surface-2); border: 1px solid var(--lm-border);
    color: var(--lm-text); font-size: 12px; font-weight: 600;
    padding: 4px 6px 4px 10px; border-radius: 7px;
    font-family: ui-monospace, Menlo, Consolas, monospace;
    cursor: pointer;
}
.autotrade-page .at-pair-chip:hover { border-color: var(--lm-border-hover); background: var(--lm-surface-hover); }
.autotrade-page .at-pair-chip.is-custom {
    border-color: rgba(74, 222, 154, .45);
    box-shadow: inset 0 0 0 1px rgba(74, 222, 154, .12);
}
.autotrade-page .at-pair-chip-meta {
    font-size: 10px; font-weight: 600; color: var(--lm-up);
    opacity: .9; letter-spacing: 0.01em;
}
.autotrade-page .at-pair-chip-x {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border: none; border-radius: 5px; cursor: pointer;
    background: transparent; color: var(--lm-muted); font-size: 15px; line-height: 1; padding: 0;
}
.autotrade-page .at-pair-chip-x:hover { background: rgba(248, 113, 113, .16); color: var(--lm-down); }
.autotrade-page .at-pair-override {
    margin-top: 10px; padding: 12px 14px;
    background: var(--lm-surface-2); border: 1px solid var(--lm-border);
    border-radius: 10px;
}
.autotrade-page .at-pair-override-head {
    display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px;
}
.autotrade-page .at-pair-override-head strong {
    font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; color: var(--lm-text);
}
.autotrade-page .at-pair-override-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px;
}
.autotrade-page .at-pair-search-wrap { position: relative; }
.autotrade-page .at-pair-dropdown {
    position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 40;
    max-height: 240px; overflow-y: auto;
    background: var(--lm-surface); border: 1px solid var(--lm-border-hover);
    border-radius: 8px; box-shadow: 0 12px 30px rgba(0,0,0,.28); padding: 4px;
}
.autotrade-page .at-pair-opt {
    padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 12.5px;
    color: var(--lm-text); font-family: ui-monospace, Menlo, Consolas, monospace;
}
.autotrade-page .at-pair-opt:hover { background: var(--lm-surface-hover); }
.autotrade-page .at-pair-opt--add { color: var(--lm-up); font-family: inherit; }
.autotrade-page .at-pair-opt--add i { margin-right: 6px; }

.autotrade-page .at-actions-row { display: flex; align-items: center; gap: 12px; margin-top: 16px; flex-wrap: wrap; }

/* Buttons — built on Live Monitor's .lm-refresh-btn */
.autotrade-page .at-btn-primary { background: var(--lm-up); border-color: var(--lm-up); color: #052e26; font-weight: 600; }
.autotrade-page .at-btn-primary:hover { background: var(--lm-up); border-color: var(--lm-up); color: #04211b; filter: brightness(1.06); }
.autotrade-page .at-btn-primary:hover i { transform: none; }
.autotrade-page .at-btn-sm { padding: 7px 14px; font-size: 13px; }
.autotrade-page .at-btn-danger { color: var(--lm-down); border-color: rgba(248, 113, 113, .4); }
.autotrade-page .at-btn-danger:hover { background: rgba(248, 113, 113, .12); border-color: var(--lm-down); color: var(--lm-down); }
.autotrade-page .at-btn-danger:hover i { transform: none; }
.autotrade-page .lm-refresh-btn:disabled { opacity: .55; cursor: default; transform: none; }

.autotrade-page .at-save-msg { font-size: 12.5px; color: var(--lm-muted); }
.autotrade-page .at-save-msg.is-ok { color: var(--lm-up); }
.autotrade-page .at-save-msg.is-err { color: var(--lm-down); }

/* Tables */
.autotrade-page .at-orders-table td, .autotrade-page .at-tokens-table td { font-size: 12.5px; }
.autotrade-page .at-dir-long { color: var(--lm-up); font-weight: 700; }
.autotrade-page .at-dir-short { color: var(--lm-down); font-weight: 700; }
.autotrade-page .at-st { font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 6px; display: inline-block; }
.autotrade-page .at-st-ok { color: var(--lm-up); background: rgba(74, 222, 154, .14); }
.autotrade-page .at-st-err { color: var(--lm-down); background: rgba(248, 113, 113, .14); }
.autotrade-page .at-st-err[data-at-err] {
    cursor: pointer;
    text-decoration: underline dotted;
    text-underline-offset: 2px;
}
.autotrade-page .at-st-err[data-at-err]:focus-visible {
    outline: 2px solid rgba(248, 113, 113, .55);
    outline-offset: 2px;
}
.autotrade-page .at-state-cell {
    max-width: 220px;
    vertical-align: top;
}
.autotrade-page .at-err-inline {
    margin-top: 4px;
    font-size: 11px;
    line-height: 1.35;
    font-weight: 500;
    color: #fca5a5;
    word-break: break-word;
    white-space: normal;
}
body.theme-light .autotrade-page .at-err-inline {
    color: #b91c1c;
}
.at-err-pop {
    position: fixed;
    z-index: 100000;
    max-width: min(360px, calc(100vw - 24px));
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(248, 113, 113, .35);
    background: rgba(24, 24, 27, .96);
    color: #fecaca;
    font-size: 12.5px;
    line-height: 1.4;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .45);
    pointer-events: auto;
    word-break: break-word;
}
body.theme-light .at-err-pop {
    background: #fff;
    color: #991b1b;
    border-color: rgba(185, 28, 28, .25);
    box-shadow: 0 10px 28px rgba(15, 23, 42, .12);
}
.autotrade-page .at-st-dry { color: #f5a524; background: rgba(245, 165, 36, .14); }
.autotrade-page .at-st-pend { color: var(--lm-muted); background: var(--lm-surface-2); }
.autotrade-page .at-st-open { color: #38bdf8; background: rgba(56, 189, 248, .14); }
.autotrade-page .at-st-profit { color: var(--lm-up); background: rgba(74, 222, 154, .14); }
.autotrade-page .at-st-loss { color: var(--lm-down); background: rgba(248, 113, 113, .14); }
.autotrade-page .at-pnl { font-variant-numeric: tabular-nums; font-weight: 700; }
.autotrade-page .at-pnl.is-profit { color: var(--lm-up); }
.autotrade-page .at-pnl.is-loss { color: var(--lm-down); }
.autotrade-page .at-pnl.is-flat { color: var(--lm-muted); }
.autotrade-page .at-sym-cell { display: inline-flex; align-items: center; gap: 8px; }
.autotrade-page .at-sym-cell .pi-pair-logo { width: 18px; height: 18px; flex: 0 0 auto; }
.autotrade-page .at-sym-cell .pi-pair-logo-img { width: 18px; height: 18px; border-radius: 50%; }
.autotrade-page .at-sym-cell .pi-pair-logo-letter { font-size: 8px; }

/* Token creation */
.autotrade-page .at-token-create { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; align-items: end; margin: 14px 0; }
.autotrade-page .at-scopes { display: flex; flex-wrap: wrap; gap: 9px 18px; }
.autotrade-page .at-scopes label { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--lm-text); font-family: ui-monospace, Menlo, Consolas, monospace; cursor: pointer; }
.autotrade-page .at-scope-tag { display: inline-block; font-size: 10.5px; font-family: ui-monospace, Menlo, Consolas, monospace; padding: 1px 7px; border-radius: 6px; background: var(--lm-surface-2); border: 1px solid var(--lm-border); color: var(--lm-muted); }

.autotrade-page .at-token-reveal { background: rgba(74, 222, 154, .08); border: 1px solid rgba(74, 222, 154, .3); border-radius: 10px; padding: 12px 14px; margin: 10px 0 4px; }
.autotrade-page .at-token-reveal-head { font-size: 12.5px; font-weight: 600; color: var(--lm-up); margin-bottom: 8px; }
.autotrade-page .at-token-reveal-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.autotrade-page .at-token-reveal-row code { flex: 1 1 260px; word-break: break-all; background: var(--lm-surface); border: 1px solid var(--lm-border); border-radius: 8px; padding: 9px 11px; font-size: 12.5px; color: var(--lm-text); font-family: ui-monospace, Menlo, Consolas, monospace; }
.autotrade-page .at-tokens-table code { font-family: ui-monospace, Menlo, Consolas, monospace; color: var(--lm-text); }
.autotrade-page .at-row-revoked { opacity: .5; }

/* Live activity — bubble map constellation */
.autotrade-page .at-live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--lm-dim); margin-left: 8px; vertical-align: middle; }
.autotrade-page .at-live-dot.is-live { background: var(--lm-up); box-shadow: 0 0 0 3px rgba(74,222,154,.15); animation: at-pulse 2.2s ease-in-out infinite; }
@keyframes at-pulse { 0%,100% { opacity: 1; } 50% { opacity: .45; } }

.autotrade-page .at-bubble-stage {
    position: relative;
    height: min(460px, 58vh);
    min-height: 320px;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid var(--lm-border);
    background:
        radial-gradient(ellipse 70% 55% at 50% 42%, rgba(56,189,248,.07), transparent 62%),
        radial-gradient(ellipse 50% 40% at 18% 78%, rgba(74,222,154,.06), transparent 55%),
        radial-gradient(ellipse 45% 35% at 86% 18%, rgba(245,165,36,.05), transparent 50%),
        linear-gradient(165deg, rgba(255,255,255,.02), transparent 40%),
        var(--lm-surface);
}
.autotrade-page .at-bubble-sky { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.autotrade-page .at-orb {
    position: absolute; border-radius: 50%; filter: blur(28px); opacity: .45;
    animation: at-orb-drift 18s ease-in-out infinite;
}
.autotrade-page .at-orb-a { width: 160px; height: 160px; left: 8%; top: 18%; background: rgba(56,189,248,.22); }
.autotrade-page .at-orb-b { width: 200px; height: 200px; right: 6%; bottom: 12%; background: rgba(74,222,154,.18); animation-delay: -6s; animation-duration: 22s; }
.autotrade-page .at-orb-c { width: 120px; height: 120px; left: 42%; top: 8%; background: rgba(245,165,36,.14); animation-delay: -11s; animation-duration: 16s; }
@keyframes at-orb-drift {
    0%,100% { transform: translate(0,0) scale(1); }
    50% { transform: translate(18px,-14px) scale(1.08); }
}

.autotrade-page .at-bubble-links {
    position: absolute; inset: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 1;
}
.autotrade-page .at-bubble-links line {
    stroke: rgba(148,163,184,.22);
    stroke-width: 1;
    stroke-dasharray: 4 6;
    animation: at-link-dash 8s linear infinite;
}
@keyframes at-link-dash { to { stroke-dashoffset: -80; } }

.autotrade-page .at-bubbles {
    position: absolute; inset: 0; z-index: 2;
}
.autotrade-page .at-bubble-empty {
    position: absolute; inset: 0; z-index: 3;
    display: flex; align-items: center; justify-content: center;
    text-align: center; padding: 24px; color: var(--lm-dim); font-size: 13.5px;
    pointer-events: none; transition: opacity .4s ease;
}
.autotrade-page .at-bubble-empty.is-hidden { opacity: 0; }

.autotrade-page .at-bubble {
    position: absolute;
    left: 50%; top: 50%;
    width: var(--at-bsize, 72px); height: var(--at-bsize, 72px);
    margin: 0;
    transform: translate(calc(-50% + var(--at-x, 0px)), calc(-50% + var(--at-y, 0px)));
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    cursor: default; z-index: 2;
    transition: width .35s ease, height .35s ease, filter .3s ease;
}
.autotrade-page .at-bubble-float {
    width: 100%; height: 100%;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    position: relative;
    animation: at-bubble-float var(--at-float-dur, 7s) ease-in-out infinite;
    animation-delay: var(--at-float-delay, 0s);
}
.autotrade-page .at-bubble:hover { z-index: 5; filter: brightness(1.08); }
.autotrade-page .at-bubble:hover .at-bubble-tip { opacity: 1; transform: translate(-50%, 0) scale(1); pointer-events: auto; }

@keyframes at-bubble-float {
    0%,100% { transform: translate(0, 0); }
    50% { transform: translate(var(--at-dx, 6px), var(--at-dy, -8px)); }
}

.autotrade-page .at-bubble-ring {
    position: absolute; inset: -6px; border-radius: 50%;
    border: 1px solid rgba(148,163,184,.2);
    opacity: .7; pointer-events: none;
}
.autotrade-page .at-bubble.is-hot .at-bubble-ring {
    border-color: rgba(74,222,154,.55);
    box-shadow: 0 0 0 6px rgba(74,222,154,.08);
    animation: at-ring-pop .9s ease-out;
}
.autotrade-page .at-bubble.is-warn .at-bubble-ring { border-color: rgba(245,165,36,.55); box-shadow: 0 0 0 6px rgba(245,165,36,.08); }
.autotrade-page .at-bubble.is-err .at-bubble-ring { border-color: rgba(248,113,113,.55); box-shadow: 0 0 0 6px rgba(248,113,113,.08); }
@keyframes at-ring-pop {
    0% { transform: scale(.85); opacity: 1; }
    100% { transform: scale(1.25); opacity: 0; }
}

.autotrade-page .at-bubble-core {
    width: 78%; height: 78%; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(160deg, rgba(255,255,255,.08), rgba(255,255,255,.02));
    border: 1px solid rgba(255,255,255,.1);
    box-shadow:
        0 10px 28px rgba(0,0,0,.28),
        inset 0 1px 0 rgba(255,255,255,.12);
    backdrop-filter: blur(8px);
    overflow: hidden;
    position: relative;
}
.autotrade-page .at-bubble-core .pi-pair-logo,
.autotrade-page .at-bubble-core .pi-pair-logo-img {
    width: 58%; height: 58%; border-radius: 50%;
}
.autotrade-page .at-bubble-core .pi-pair-logo-letter { font-size: 12px; }
.autotrade-page .at-bubble-core i { color: var(--lm-muted); font-size: 18px; }

.autotrade-page .at-bubble--hub {
    --at-bsize: 88px;
    --at-x: 0px; --at-y: 0px;
    z-index: 3;
}
.autotrade-page .at-bubble--hub .at-bubble-core {
    background: radial-gradient(circle at 35% 30%, rgba(56,189,248,.22), rgba(15,23,42,.65));
    border-color: rgba(56,189,248,.35);
}
.autotrade-page .at-bubble--hub .at-bubble-core i { color: #7dd3fc; }
.autotrade-page .at-bubble--hub.is-scanning .at-bubble-ring {
    border-style: dashed; border-color: rgba(56,189,248,.5);
    animation: at-hub-spin 4s linear infinite;
}
@keyframes at-hub-spin { to { transform: rotate(360deg); } }

/* Expanding radio waves from antenna during scan */
.autotrade-page .at-scan-waves {
    position: absolute; left: 50%; top: 50%;
    width: 0; height: 0; z-index: 1; pointer-events: none;
}
.autotrade-page .at-scan-wave {
    position: absolute; left: 0; top: 0;
    width: 24px; height: 24px;
    margin: -12px 0 0 -12px;
    border-radius: 50%;
    border: 2px solid rgba(56,189,248,.45);
    animation: at-scan-wave 1.6s ease-out forwards;
}
.autotrade-page .at-scan-wave:nth-child(2) { animation-delay: .28s; border-color: rgba(74,222,154,.4); }
.autotrade-page .at-scan-wave:nth-child(3) { animation-delay: .56s; border-color: rgba(125,211,252,.35); }
@keyframes at-scan-wave {
    0% { transform: scale(1); opacity: .75; }
    100% { transform: scale(18); opacity: 0; }
}

/* Pairs flying from corners → antenna, then vanish */
.autotrade-page .at-scan-fly {
    position: absolute;
    left: 50%; top: 50%;
    width: 44px; height: 44px;
    margin: 0;
    z-index: 7;
    pointer-events: none;
    --sx: -42vw; --sy: -34vh;
    transform: translate(calc(-50% + var(--sx)), calc(-50% + var(--sy))) scale(.35);
    opacity: 0;
    animation: at-fly-to-hub 1.15s cubic-bezier(.22,.75,.25,1) forwards;
    animation-delay: var(--delay, 0ms);
}
.autotrade-page .at-scan-fly-inner {
    width: 100%; height: 100%; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(160deg, rgba(255,255,255,.14), rgba(15,23,42,.55));
    border: 1px solid rgba(125,211,252,.45);
    box-shadow:
        0 0 0 4px rgba(56,189,248,.08),
        0 10px 22px rgba(0,0,0,.35);
    position: relative;
}
.autotrade-page .at-scan-fly-inner .pi-pair-logo,
.autotrade-page .at-scan-fly-inner .pi-pair-logo-img {
    width: 62%; height: 62%; border-radius: 50%;
}
.autotrade-page .at-scan-fly-inner .pi-pair-logo-letter { font-size: 11px; }
.autotrade-page .at-scan-fly-trail {
    position: absolute; inset: -6px; border-radius: 50%;
    border: 1px solid rgba(56,189,248,.25);
    animation: at-fly-trail 1.15s ease-out forwards;
    animation-delay: var(--delay, 0ms);
}
.autotrade-page .at-scan-fly-tag {
    position: absolute; left: 50%; bottom: -14px;
    transform: translateX(-50%);
    font-size: 9px; font-weight: 700; letter-spacing: .04em;
    color: #e2e8f0; white-space: nowrap;
    font-family: ui-monospace, Menlo, Consolas, monospace;
    text-shadow: 0 2px 6px rgba(0,0,0,.6);
}
@keyframes at-fly-to-hub {
    0% {
        transform: translate(calc(-50% + var(--sx)), calc(-50% + var(--sy))) scale(.3) rotate(-12deg);
        opacity: 0;
    }
    12% { opacity: 1; }
    72% {
        transform: translate(-50%, -50%) scale(1.05) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(.15);
        opacity: 0;
    }
}
@keyframes at-fly-trail {
    0% { transform: scale(.6); opacity: .6; }
    100% { transform: scale(1.8); opacity: 0; }
}

.autotrade-page .at-bubble-label {
    position: absolute; bottom: -2px; left: 50%; transform: translate(-50%, 100%);
    font-size: 10px; font-weight: 700; letter-spacing: .04em;
    color: var(--lm-text); white-space: nowrap;
    text-shadow: 0 2px 8px rgba(0,0,0,.55);
    font-family: ui-monospace, Menlo, Consolas, monospace;
}
.autotrade-page .at-bubble-heat {
    position: absolute; top: -2px; right: -2px;
    min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: 999px; font-size: 10px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    background: var(--lm-up); color: #052e26;
    box-shadow: 0 4px 10px rgba(0,0,0,.25);
}

.autotrade-page .at-bubble-tip {
    position: absolute; left: 50%; bottom: calc(100% + 14px);
    transform: translate(-50%, 6px) scale(.96);
    width: max(180px, min(260px, 70vw));
    padding: 10px 12px; border-radius: 12px;
    background: rgba(15,18,24,.94); border: 1px solid var(--lm-border);
    box-shadow: 0 14px 36px rgba(0,0,0,.35);
    opacity: 0; pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
    z-index: 8; text-align: left;
}
.autotrade-page .at-bubble-tip strong {
    display: block; font-size: 11px; color: var(--lm-muted);
    text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px;
}
.autotrade-page .at-bubble-tip p {
    margin: 0; font-size: 12.5px; color: var(--lm-text); line-height: 1.35;
}

.autotrade-page .at-bubble-ping {
    position: absolute; inset: -4px; border-radius: 50%;
    border: 2px solid rgba(74,222,154,.55);
    animation: at-ping 1.1s ease-out forwards;
    pointer-events: none;
}
.autotrade-page .at-bubble-ping.is-warn { border-color: rgba(245,165,36,.6); }
.autotrade-page .at-bubble-ping.is-err { border-color: rgba(248,113,113,.6); }
.autotrade-page .at-bubble-ping.is-info { border-color: rgba(56,189,248,.55); }
@keyframes at-ping {
    0% { transform: scale(.7); opacity: .9; }
    100% { transform: scale(1.85); opacity: 0; }
}

.autotrade-page .at-bubble-ticker {
    position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 4;
    display: flex; gap: 8px; overflow: hidden;
    mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.autotrade-page .at-bubble-ticker-track {
    display: flex; gap: 8px; animation: at-ticker-scroll 40s linear infinite;
    will-change: transform;
}
.autotrade-page .at-bubble-ticker:hover .at-bubble-ticker-track { animation-play-state: paused; }
@keyframes at-ticker-scroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}
.autotrade-page .at-tick {
    flex: 0 0 auto;
    display: inline-flex; align-items: center; gap: 8px;
    padding: 7px 12px; border-radius: 999px;
    background: rgba(15,18,24,.78); border: 1px solid var(--lm-border);
    backdrop-filter: blur(8px);
    font-size: 12px; color: var(--lm-text); white-space: nowrap;
    animation: at-tick-in .35s ease both;
}
.autotrade-page .at-tick .pi-pair-logo,
.autotrade-page .at-tick .pi-pair-logo-img { width: 16px; height: 16px; border-radius: 50%; }
.autotrade-page .at-tick-sym { font-weight: 700; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11px; }
.autotrade-page .at-tick-ev { color: var(--lm-muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; }
.autotrade-page .at-tick.is-success { border-color: rgba(74,222,154,.35); }
.autotrade-page .at-tick.is-error { border-color: rgba(248,113,113,.35); }
.autotrade-page .at-tick.is-warn { border-color: rgba(245,165,36,.35); }
@keyframes at-tick-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (max-width: 640px) {
    .autotrade-page .at-field-grid { grid-template-columns: 1fr 1fr; }
    .autotrade-page .at-bubble-stage { height: 360px; min-height: 280px; }
    .autotrade-page .at-bubble--hub { --at-bsize: 72px; }
}
